mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-06 12:03:41 +00:00
compiler: implement type assert without comma-ok
This commit is contained in:
@@ -134,3 +134,9 @@ func interfaceImplements(typecode, interfaceNum uint16) bool {
|
||||
// assert is successful.
|
||||
return true
|
||||
}
|
||||
|
||||
func interfaceTypeAssert(ok bool) {
|
||||
if !ok {
|
||||
runtimePanic("type assert failed")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user