-
Notifications
You must be signed in to change notification settings - Fork 358
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
interp: fix method lookup on aliased types
In aliased type declarations, when the target type was imported from an external package rather than declared locally, the aliased type was overwritten by target, loosing ability to lookup methods on the aliased type. Aliasing on imported types is now properly detected and handled. Fixes #971.
- Loading branch information
Showing
4 changed files
with
24 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package main | ||
|
||
import "time" | ||
|
||
type TimeValue time.Time | ||
|
||
func (v *TimeValue) decode() { println("in decode") } | ||
|
||
func main() { | ||
var tv TimeValue | ||
tv.decode() | ||
} | ||
|
||
// Output: | ||
// in decode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters