Created
August 17, 2021 17:14
-
-
Save erickskrauch/67991b74c274f9c690d6d6150ae7aa4d to your computer and use it in GitHub Desktop.
An example of parser error when using a type alias
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
package main | |
import "C" | |
type CInt = C.int | |
func (i *CInt) DoSomething() { | |
println("We can do something") | |
} | |
func NewCInt(i int) CInt { | |
return C.int(i) | |
} | |
func main() { | |
i := NewCInt(1) | |
i.DoSomething() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment