Compiler crashes instead of giving an error message #189

Closed
opened 2019-12-04 21:50:15 +09:00 by gorbak25 · 0 comments
gorbak25 commented 2019-12-04 21:50:15 +09:00 (Migrated from gitlab.com)

When constructing an empty record:

contract Test = 
    record state = {}

    public entrypoint init() =
        state{}    

the compiler crashes with the following stack trace:

{badmatch,[]} [{aeso_parser,record_or_map,1, [{file,"/app/_build/default/lib/aesophia/src/aeso_parser.erl"}, {line,364}]}, {aeso_parser,record_update,3, [{file,"/app/_build/default/lib/aesophia/src/aeso_parser.erl"}, {line,332}]}, {aeso_parser,elim,2, [{file,"/app/_build/default/lib/aesophia/src/aeso_parser.erl"}, {line,327}]}, {aeso_parse_lib,'-apply_p/2-fun-5-',3, [{file,"/app/_build/default/lib/aesophia/src/aeso_parse_lib.erl"}, {line,86}]}, {aeso_parse_lib,apply_p,2, [{file,"/app/_build/default/lib/aesophia/src/aeso_parse_lib.erl"}, {line,82}]}, {aeso_parse_lib,parse1,4, [{file,"/app/_build/default/lib/aesophia/src/aeso_parse_lib.erl"}, {line,300}]}, {aeso_parse_lib,parse,2, [{file,"/app/_build/default/lib/aesophia/src/aeso_parse_lib.erl"}, {line,163}]}, {aeso_parser,string,3, [{file,"/app/_build/default/lib/aesophia/src/aeso_parser.erl"}, {line,33}]}]
At: Line 0, column 0

The compiler should report an relevant error message instead of hard crashing.

When constructing an empty record: ``` contract Test = record state = {} public entrypoint init() = state{} ``` the compiler crashes with the following stack trace: ``` {badmatch,[]} [{aeso_parser,record_or_map,1, [{file,"/app/_build/default/lib/aesophia/src/aeso_parser.erl"}, {line,364}]}, {aeso_parser,record_update,3, [{file,"/app/_build/default/lib/aesophia/src/aeso_parser.erl"}, {line,332}]}, {aeso_parser,elim,2, [{file,"/app/_build/default/lib/aesophia/src/aeso_parser.erl"}, {line,327}]}, {aeso_parse_lib,'-apply_p/2-fun-5-',3, [{file,"/app/_build/default/lib/aesophia/src/aeso_parse_lib.erl"}, {line,86}]}, {aeso_parse_lib,apply_p,2, [{file,"/app/_build/default/lib/aesophia/src/aeso_parse_lib.erl"}, {line,82}]}, {aeso_parse_lib,parse1,4, [{file,"/app/_build/default/lib/aesophia/src/aeso_parse_lib.erl"}, {line,300}]}, {aeso_parse_lib,parse,2, [{file,"/app/_build/default/lib/aesophia/src/aeso_parse_lib.erl"}, {line,163}]}, {aeso_parser,string,3, [{file,"/app/_build/default/lib/aesophia/src/aeso_parser.erl"}, {line,33}]}] At: Line 0, column 0 ``` The compiler should report an relevant error message instead of hard crashing.
Sign in to join this conversation.
No Milestone
No project
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: QPQ-AG/sophia#189
No description provided.