Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
interp: fix resolution of methods on aliased types
The type.val field was always pointing to the final underlying type for aliased types, defeating a possible match if a method was attached to a type in between. Now the complete chain of aliases is always preserved. We have added an underlying() itype method which returns the underlying type of a defined type (aliasT), even in the presence of multiple indirections. We have added a definedType function which checks if type t1 is defined from type t2 or t2 defined from t1, required when checking assignability of aliasT types. Fixes #1411. PS: this is the 2nd attempt, as the first version #1412 wasn't passing _test/issue-1408.go as well. This PR does pass and supersedes #1412.
- Loading branch information