Skip to content

Commit b70d4d7

Browse files
authored
Revert change to type print in an error message (#61977)
1 parent 91cdbd5 commit b70d4d7

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47397,7 +47397,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
4739747397
const errorMessage = overriddenInstanceProperty ?
4739847398
Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property :
4739947399
Diagnostics._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor;
47400-
error(getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage, symbolToString(base), typeToString(getDeclaredTypeOfSymbol(base.parent!)), typeToString(type));
47400+
error(getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage, symbolToString(base), typeToString(baseType), typeToString(type));
4740147401
}
4740247402
else if (useDefineForClassFields) {
4740347403
const uninitialized = derived.declarations?.find(d => d.kind === SyntaxKind.PropertyDeclaration && !(d as PropertyDeclaration).initializer);

tests/baselines/reference/accessorsOverrideProperty10.errors.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
accessorsOverrideProperty10.ts(6,7): error TS2611: 'x' is defined as a property in class 'A', but is overridden here in 'C' as an accessor.
1+
accessorsOverrideProperty10.ts(6,7): error TS2611: 'x' is defined as a property in class 'B', but is overridden here in 'C' as an accessor.
22

33

44
==== accessorsOverrideProperty10.ts (1 errors) ====
@@ -9,7 +9,7 @@ accessorsOverrideProperty10.ts(6,7): error TS2611: 'x' is defined as a property
99
class C extends B {
1010
get x() {
1111
~
12-
!!! error TS2611: 'x' is defined as a property in class 'A', but is overridden here in 'C' as an accessor.
12+
!!! error TS2611: 'x' is defined as a property in class 'B', but is overridden here in 'C' as an accessor.
1313
return 2;
1414
}
1515
}

tests/baselines/reference/propertyOverridesAccessors6.errors.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
propertyOverridesAccessors6.ts(8,3): error TS2610: 'x' is defined as an accessor in class 'A', but is overridden here in 'C' as an instance property.
1+
propertyOverridesAccessors6.ts(8,3): error TS2610: 'x' is defined as an accessor in class 'B', but is overridden here in 'C' as an instance property.
22

33

44
==== propertyOverridesAccessors6.ts (1 errors) ====
@@ -11,6 +11,6 @@ propertyOverridesAccessors6.ts(8,3): error TS2610: 'x' is defined as an accessor
1111
class C extends B {
1212
x = 1;
1313
~
14-
!!! error TS2610: 'x' is defined as an accessor in class 'A', but is overridden here in 'C' as an instance property.
14+
!!! error TS2610: 'x' is defined as an accessor in class 'B', but is overridden here in 'C' as an instance property.
1515
}
1616

0 commit comments

Comments
 (0)