The code
interface T { callback: () => void; }
let x: T[] | undefined = [{ callback: () => {} }]
crashes the LuaTranspiler with the following tsconfig.json.
{
"compilerOptions": {
"strictNullChecks": true,
}
}
Output:
./dist/LuaTranspiler.js:98
throw exception;
^
TypeError: Cannot read property 'getProperty' of undefined
at Function.inferAssignedType (./dist/TSHelper.js:410:38)
at Function.getSignatureDeclarations (./dist/TSHelper.js:468:47)
at Function.getFunctionContextType (./dist/TSHelper.js:553:48)
at LuaTransformer.transformFunctionExpression (./dist/LuaTransformer.js:1918:48)
at LuaTransformer.transformExpression (./dist/LuaTransformer.js:1424:29)
at node.properties.forEach.element (./dist/LuaTransformer.js:1894:41)
at Array.forEach (<anonymous>)
at LuaTransformer.transformObjectLiteral (./dist/LuaTransformer.js:1891:25)
at LuaTransformer.transformExpression (./dist/LuaTransformer.js:1418:29)
at node.elements.forEach.child (./dist/LuaTransformer.js:1884:62)
The code
crashes the LuaTranspiler with the following
tsconfig.json.{ "compilerOptions": { "strictNullChecks": true, } }Output: