You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you reference a function prototype that requires a type parameter and omit that type parameter, you get an assertion failure rather than a helpful error:
function doit<T,X,O,N>(x: T): T {
return x
}
export function test(x: i32): void {
let x = doit;
}
Returns
ERROR: AssertionError: assertion failed
at assert (/Users/duncanuszkay/src/github.com/Shopify/as-fork/assemblyscript/std/portable/index.js:184:9)
at Resolver.resolveFunction (/Users/duncanuszkay/src/github.com/Shopify/as-fork/assemblyscript/src/resolver.ts:2691:7)
at Compiler.compileIdentifierExpression (/Users/duncanuszkay/src/github.com/Shopify/as-fork/assemblyscript/src/compiler.ts:7954:46)
at Compiler.compileExpression (/Users/duncanuszkay/src/github.com/Shopify/as-fork/assemblyscript/src/compiler.ts:3327:21)
at Compiler.compileBinaryExpression (/Users/duncanuszkay/src/github.com/Shopify/as-fork/assemblyscript/src/compiler.ts:3735:25)
at Compiler.compileExpression (/Users/duncanuszkay/src/github.com/Shopify/as-fork/assemblyscript/src/compiler.ts:3302:21)
at Compiler.compileVariableStatement (/Users/duncanuszkay/src/github.com/Shopify/as-fork/assemblyscript/src/compiler.ts:2868:25)
at Compiler.compileStatement (/Users/duncanuszkay/src/github.com/Shopify/as-fork/assemblyscript/src/compiler.ts:1984:21)
at Compiler.compileStatements (/Users/duncanuszkay/src/github.com/Shopify/as-fork/assemblyscript/src/compiler.ts:2031:23)
at Compiler.compileFunctionBody (/Users/duncanuszkay/src/github.com/Shopify/as-fork/assemblyscript/src/compiler.ts:1393:20)
This came up for us when we made this typo:
let x = doit<String("hey!"); //Forgot the other >
Going to open up a PR to fix this momentarily
The text was updated successfully, but these errors were encountered:
If you reference a function prototype that requires a type parameter and omit that type parameter, you get an assertion failure rather than a helpful error:
Returns
This came up for us when we made this typo:
Going to open up a PR to fix this momentarily
The text was updated successfully, but these errors were encountered: