diff --git a/issues/0054-generic-struct-to-param-protocol-erasure.md b/issues/0054-generic-struct-to-param-protocol-erasure.md index 64b910a..c8b5859 100644 --- a/issues/0054-generic-struct-to-param-protocol-erasure.md +++ b/issues/0054-generic-struct-to-param-protocol-erasure.md @@ -1,3 +1,17 @@ +**FIXED** (`1f6e27d`, `examples/212`). Two root causes: +1. `instantiateGenericStruct` now binds the template name to the concrete + instance (`tb.put(tmpl.name, id)`), so an impl method `self: *Combined` + resolves `self.field` to the instance, not the 0-field generic stub. (This + was a general pre-existing bug — `self.x` failed on *any* generic-struct + impl method.) +2. `createProtocolThunk` monomorphizes the template method for a generic-struct + instance (`Combined.get` → `Combined__s64_s64.get` with the instance + bindings), so the erasure vtable dispatches instead of an `unreachable` thunk. + +`xx c` (Combined → VL($R)) now dispatches correctly. The *full* canonical `map` +additionally needs mapper closure-pack typing + `$R` inference at the call site +(a separate piece) — tracked separately. + # Symptom `xx c` where `c` is a generic-struct instance and the target is a parameterized