-
Notifications
You must be signed in to change notification settings - Fork 356
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
interp: improve handling of aliased types
Avoid to test directly for a type category, as it may give wrong results for aliased types, where the interesting category remains masked. Instead, use some property helpers, such as isFuncSrc, isPtrSrc and isInterfaceSrc to check if a type is of source function, source pointer or source interface respectively (versus runtime defined function, pointer or interface). Fixes #1068.
- Loading branch information
Showing
4 changed files
with
108 additions
and
95 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,19 @@ | ||
package main | ||
|
||
type I interface { | ||
Hello() | ||
} | ||
|
||
type T struct{} | ||
|
||
func (t T) Hello() { println("hello") } | ||
|
||
type I2 I | ||
|
||
func main() { | ||
var i I2 = T{} | ||
i.Hello() | ||
} | ||
|
||
// Output: | ||
// hello |
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
Oops, something went wrong.