mirror of
https://github.com/hanzoai/yaegi.git
synced 2026-10-01 00:49:47 +00:00
This adds `itype.str` which is a string representation of the type built when the type is built. The goal is to make type comparison simpler and centralise the creation of types just to constructors and `nodeType`. `nodeType` continues to build types in parts so to reuse underlying types better.
14 lines
165 B
Go
14 lines
165 B
Go
package main
|
|
|
|
func b() string {
|
|
return "b"
|
|
}
|
|
|
|
func main() {
|
|
var x int
|
|
x = "a" + b()
|
|
}
|
|
|
|
// Error:
|
|
// 9:6: cannot use type untyped string as type int in assignment
|