mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-11 10:46:28 -05:00
In isInPropertyInitializer, don't bail out at a PropertyAssignment (#18449)
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
tests/cases/compiler/useBeforeDeclaration_propertyAssignment.ts(2,27): error TS2448: Block-scoped variable 'b' used before its declaration.
|
||||
|
||||
|
||||
==== tests/cases/compiler/useBeforeDeclaration_propertyAssignment.ts (1 errors) ====
|
||||
export class C {
|
||||
public a = { b: this.b };
|
||||
~
|
||||
!!! error TS2448: Block-scoped variable 'b' used before its declaration.
|
||||
private b = 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
//// [useBeforeDeclaration_propertyAssignment.ts]
|
||||
export class C {
|
||||
public a = { b: this.b };
|
||||
private b = 0;
|
||||
}
|
||||
|
||||
|
||||
//// [useBeforeDeclaration_propertyAssignment.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var C = /** @class */ (function () {
|
||||
function C() {
|
||||
this.a = { b: this.b };
|
||||
this.b = 0;
|
||||
}
|
||||
return C;
|
||||
}());
|
||||
exports.C = C;
|
||||
@@ -0,0 +1,4 @@
|
||||
export class C {
|
||||
public a = { b: this.b };
|
||||
private b = 0;
|
||||
}
|
||||
Reference in New Issue
Block a user