compiler: do not convert interop types on assertion
This commit is contained in:
parent
2f6345f2d9
commit
73a75cc27a
2 changed files with 14 additions and 2 deletions
|
@ -284,3 +284,12 @@ func isInteropPath(s string) bool {
|
|||
func isNativeHelpersPath(s string) bool {
|
||||
return strings.HasPrefix(s, interopPrefix+"/native")
|
||||
}
|
||||
|
||||
// canConvert returns true if type doesn't need to be converted on type assertion.
|
||||
func canConvert(s string) bool {
|
||||
if isInteropPath(s) {
|
||||
s = s[len(interopPrefix):]
|
||||
return s != "/iterator.Iterator" && s != "/storage.Context"
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue