Fix parse errors causing crashes instead of nice errors

This commit is contained in:
Ulf Norell
2019-12-06 17:09:48 +01:00
parent 6ca63e4b40
commit bf5e2e2443
5 changed files with 42 additions and 7 deletions
+11
View File
@@ -595,6 +595,17 @@ failing_contracts() ->
[<<?Pos(5, 28)
"Invalid call to contract entrypoint 'Foo.foo'.\n"
"It must be called as 'c.foo' for some c : Foo.">>])
, ?TYPE_ERROR(bad_records,
[<<?Pos(3, 16)
"Mixed record fields and map keys in\n"
" {x = 0, [0] = 1}">>,
<<?Pos(4, 6)
"Mixed record fields and map keys in\n"
" r {x = 0, [0] = 1}">>,
<<?Pos(5, 6)
"Empty record/map update\n"
" r {}">>
])
].
-define(Path(File), "code_errors/" ??File).
+5
View File
@@ -0,0 +1,5 @@
contract BadRecord =
entrypoint foo() =
let r = {x = 0, [0] = 1}
r{x = 0, [0] = 1}
r{}