Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

type checking for defined types #1408

Closed
mvertes opened this issue May 25, 2022 · 0 comments · Fixed by #1409
Closed

type checking for defined types #1408

mvertes opened this issue May 25, 2022 · 0 comments · Fixed by #1409
Labels
area/core bug Something isn't working
Milestone

Comments

@mvertes
Copy link
Member

mvertes commented May 25, 2022

The following program sample.go triggers an unexpected result

package main

type ( 
    Number  = int32
    Number2 = Number
)   
    
func f(n Number2) { println(n) }
    
func main() {
    var n Number = 5
    f(n)
}

Expected result

$ go run ./sample.go
5

Got

$ yaegi ./sample.go
run: ./sample.go:12:4: cannot use type main.Number as type main.Number2

Yaegi Version

v0.12.0

Additional Notes

No response

@mvertes mvertes added bug Something isn't working area/core labels May 25, 2022
@mvertes mvertes added this to the v0.12.x milestone May 25, 2022
mvertes added a commit to mvertes/yaegi that referenced this issue May 25, 2022
traefiker pushed a commit to mvertes/yaegi that referenced this issue Jun 13, 2022
traefiker pushed a commit that referenced this issue Jun 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/core bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant