mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-19 01:41:30 +00:00
Add a more helpful error message when you haven't defined an allocator (#108)
Also adds a system for writing tests that assert that certain error codes are triggered so that I could test this.
This commit is contained in:
committed by
Daniel Wirtz
parent
edf4aaa966
commit
558ed78cc9
@ -2721,6 +2721,10 @@ export function compileAllocate(
|
||||
DiagnosticCode.Cannot_find_name_0,
|
||||
reportNode.range, allocateInternalName
|
||||
);
|
||||
program.info(
|
||||
DiagnosticCode.An_allocator_must_be_declared_to_allocate_memory_Try_importing_allocator_arena_or_allocator_tlsf,
|
||||
reportNode.range
|
||||
);
|
||||
return module.createUnreachable();
|
||||
}
|
||||
if (allocatePrototype.kind != ElementKind.FUNCTION_PROTOTYPE) {
|
||||
|
Reference in New Issue
Block a user