mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-10 18:04:18 -05:00
Allow this in constructor parameter defaults when legal (#57682)
This commit is contained in:
@@ -29815,12 +29815,6 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
error(node, Diagnostics.this_cannot_be_referenced_in_current_location);
|
||||
// do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks
|
||||
break;
|
||||
case SyntaxKind.Constructor:
|
||||
if (isInConstructorArgumentInitializer(node, container)) {
|
||||
error(node, Diagnostics.this_cannot_be_referenced_in_constructor_arguments);
|
||||
// do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1836,10 +1836,6 @@
|
||||
"category": "Error",
|
||||
"code": 2332
|
||||
},
|
||||
"'this' cannot be referenced in constructor arguments.": {
|
||||
"category": "Error",
|
||||
"code": 2333
|
||||
},
|
||||
"'this' cannot be referenced in a static property initializer.": {
|
||||
"category": "Error",
|
||||
"code": 2334
|
||||
|
||||
Reference in New Issue
Block a user