mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-07 12:33:42 +00:00
interp: add support for constant type asserts
Non-constant type asserts are not yet implemented, but should be relatively easy to add at a later time. They should result in a clear error message for now.
This commit is contained in:
committed by
Ron Evans
parent
213a6240a1
commit
9222bda9c6
Vendored
+6
@@ -137,6 +137,12 @@ func printItf(val interface{}) {
|
||||
}
|
||||
}
|
||||
|
||||
var (
|
||||
// Test for type assert support in the interp package.
|
||||
globalThing interface{} = Foo(3)
|
||||
_ = globalThing.(Foo)
|
||||
)
|
||||
|
||||
func nestedSwitch(verb rune, arg interface{}) bool {
|
||||
switch verb {
|
||||
case 'v', 's':
|
||||
|
||||
Reference in New Issue
Block a user