Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1193,7 +1193,6 @@ export class Flow {
canOverflow(expr: ExpressionRef, type: Type): bool {
// TODO: the following catches most common and a few uncommon cases, but there are additional
// opportunities here, obviously.
assert(type != Type.void);

// types other than i8, u8, i16, u16 and bool do not overflow
if (!type.isShortIntegerValue) return false;
Expand Down
8 changes: 8 additions & 0 deletions tests/compiler/function-expression-error.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"asc_flags": [
],
"stderr": [
"TS1110: Type expected.", "missingReturnType",
"EOF"
]
}
5 changes: 5 additions & 0 deletions tests/compiler/function-expression-error.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// see: https://github.com/AssemblyScript/assemblyscript/issues/2036

const missingReturnType: u32 = (() => 42).index;

ERROR("EOF");