mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-07-28 23:58:40 +00:00
19e2d12517
This is a big reimplementation that simplifies the compiler a lot. Instead of storing the method set in metadata and lowering the type asserts as a whole program pass, this change just puts the list of methods in the type code (and a separate global for the interface type).
32 lines
534 B
Plaintext
32 lines
534 B
Plaintext
thing: foo
|
|
Thing.Print: foo
|
|
is int: 5
|
|
is byte: 120
|
|
is string: foo
|
|
is Foo: 18
|
|
is Thing: foo
|
|
is *Thing: foo
|
|
is *Thing: foo
|
|
is struct{n int}
|
|
is struct{n int `foo:"bar"`}
|
|
is Doubler: 6
|
|
is Tuple: 1 7 11 13
|
|
Array len: 4
|
|
is Tuple: 1 7 11 13
|
|
ArrayStruct.Print: 4 3
|
|
is Tuple: 0 8 16 24
|
|
SmallPair.Print: 3 5
|
|
is nil
|
|
Stringer.String(): foo
|
|
Stringer.(*Thing).String(): foo
|
|
s has String() method: foo
|
|
nested switch: true
|
|
Byte(): 3
|
|
non-blocking call on sometimes-blocking interface
|
|
slept 1ms
|
|
slept 1ms
|
|
type is int
|
|
type is *int
|
|
type is **int
|
|
x is 5
|