transform: replace panics with source locations

Panics are bad for usability: whenever something breaks, the user is
shown a (not very informative) backtrace. Replace it with real error
messages instead, that even try to display the Go source location.
This commit is contained in:
Ayke van Laethem
2020-03-23 14:40:38 +01:00
committed by Ron Evans
parent 25fcf3e18e
commit 26aba72729
3 changed files with 31 additions and 18 deletions
+8 -1
View File
@@ -2,9 +2,16 @@ package transform
import (
"testing"
"tinygo.org/x/go-llvm"
)
func TestInterfaceLowering(t *testing.T) {
t.Parallel()
testTransform(t, "testdata/interface", LowerInterfaces)
testTransform(t, "testdata/interface", func(mod llvm.Module) {
err := LowerInterfaces(mod)
if err != nil {
t.Error(err)
}
})
}