Update to TypeScript 4#914
Conversation
| @@ -47,7 +47,7 @@ | |||
| "@types/node": "^13.7.7", | |||
| "@types/resolve": "1.14.0", | |||
| "@typescript-eslint/eslint-plugin": "^2.31.0", | |||
There was a problem hiding this comment.
Plugin version should match the parser, otherwise some rules might handle AST incorrectly. Though if it works okay with current codebase, and there would be some rules with changed configuration format, I think it's fine to keep it that way for now. I could update it to match my base config later
| `.expectToMatchJsResult(); | ||
| }); | ||
|
|
||
| test("set accessor override", () => { |
There was a problem hiding this comment.
Could you check skipped tests tests, I think they shouldn't be relevant now too
There was a problem hiding this comment.
Yep they were too, removed them as well
| import { ScopeType, walkScopesUp } from "../utils/scope"; | ||
| import { isArrayType } from "../utils/typescript"; | ||
|
|
||
| function transformExpressionToTupleExpressions( |
There was a problem hiding this comment.
TupleExpressions doesn't make much sense for me. Maybe transformExpressionsInReturn, and let it handle https://github.com/hazzard993/TypescriptToLua/blob/update-typescript/src/transformation/visitors/return.ts#L71-L75 too, so that both usages would be simplified to lua.createReturnStatement(transformExpressionsInReturn(...)) and const results = transformExpressionsInReturn(...)?
if (!isInTupleReturnFunction(context, node)) {
return [context.transformExpression(statement.expression)];
}
let results: lua.Expression[];
// ...| } | ||
|
|
||
| export function transformFunctionBodyStatements(context: TransformationContext, body: ts.Block): lua.Statement[] { | ||
| export function transformFunctionBodyStatements(context: TransformationContext, body: ts.ConciseBody): lua.Statement[] { |
There was a problem hiding this comment.
Statements doesn't make much sense given that now it works on expressions too. transformFunctionBodyContent?
Co-authored-by: ark120202 <ark120202@gmail.com>
| | ts.SyntaxKind.GreaterThanGreaterThanToken | ||
| | ts.SyntaxKind.GreaterThanGreaterThanGreaterThanToken; | ||
|
|
||
| const compoundToAssignmentTokens: Record<ts.CompoundAssignmentOperator, CompoundAssignmentToken> = { |
There was a problem hiding this comment.
Which CompoundAssignmentOperator do we not support now?
There was a problem hiding this comment.
For this PR we should either create an issue to support these compound operators later, or just revert the Partial/ | undefined changes and add them here, but then we also need some tests for them. I'm leaving it up to @hazzard993 to decide.
Fixes #912
Tried to keep changes small
Removed tests that no longer passed TypeScript's type checker