tinygo/testdata/interface.txt
Ayke van Laethem 0596b3c003 compiler: add support for anonymous type asserts
This is used for example by the errors package, which contains:

    if x, ok := err.(interface{ As(interface{}) bool }); ok && x.As(target) {
        return true
    }

The interface here is not a named type.
2020-03-29 08:39:07 +02:00

25 строки
470 Б
Text

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
Stringer.String(): foo
Stringer.(*Thing).String(): foo
s has String() method: foo
nested switch: true
non-blocking call on sometimes-blocking interface
slept 1ms
slept 1ms