compiler: implement type assert without comma-ok

This commit is contained in:
Ayke van Laethem
2018-09-11 19:51:31 +02:00
parent 31e0662856
commit 8675025fc8
3 changed files with 20 additions and 7 deletions
+6
View File
@@ -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")
}
}