Fix bug in type checker
This commit is contained in:
parent
592869bf75
commit
d38367e023
@ -1814,6 +1814,10 @@ occurs_check1(R, {tuple_t, _, Ts}) ->
|
||||
occurs_check(R, Ts);
|
||||
occurs_check1(R, {named_arg_t, _, _, T, _}) ->
|
||||
occurs_check(R, T);
|
||||
occurs_check1(R, {record_t, Fields}) ->
|
||||
occurs_check(R, Fields);
|
||||
occurs_check1(R, {field_t, _, _, T}) ->
|
||||
occurs_check(R, T);
|
||||
occurs_check1(R, [H | T]) ->
|
||||
occurs_check(R, H) orelse occurs_check(R, T);
|
||||
occurs_check1(_, []) -> false.
|
||||
|
@ -114,7 +114,8 @@ compilable_contracts() ->
|
||||
"bitcoin_auth",
|
||||
"address_literals",
|
||||
"bytes_equality",
|
||||
"address_chain"
|
||||
"address_chain",
|
||||
"namespace_bug"
|
||||
].
|
||||
|
||||
not_yet_compilable(fate) ->
|
||||
|
12
test/contracts/namespace_bug.aes
Normal file
12
test/contracts/namespace_bug.aes
Normal file
@ -0,0 +1,12 @@
|
||||
|
||||
namespace Foo =
|
||||
|
||||
record bla = {x : int, y : bool}
|
||||
|
||||
function bar() : Foo.bla = {x = 17, y = true}
|
||||
|
||||
contract Bug =
|
||||
|
||||
// Crashed the type checker
|
||||
function foo () = Foo.bar()
|
||||
|
Loading…
x
Reference in New Issue
Block a user