assemblyscript/tests/compiler/new-without-allocator.ts
Alan Pierce 558ed78cc9 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.
2018-05-22 12:09:05 +02:00

9 lines
259 B
TypeScript

// Expect error: TS2304: Cannot find name 'allocate_memory'.
// Expect error: AS214: An allocator must be declared to allocate memory. Try importing allocator/arena or allocator/tlsf.
class A {}
export function test(): i32 {
var a = new A();
return 3;
}