
There used to be a difference between `byte` and `uint8` in interface methods. These are aliases, so they should be treated the same. This patch introduces a custom serialization format for types, circumventing the `Type.String()` method that is slightly wrong for our purposes. This also fixes an issue with the `any` keyword in Go 1.18, which suffers from the same problem (but this time actually leads to a crash).
26 строки
481 Б
Text
26 строки
481 Б
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
|
|
Byte(): 3
|
|
non-blocking call on sometimes-blocking interface
|
|
slept 1ms
|
|
slept 1ms
|