Revert change to type print in an error message (#61977)

This commit is contained in:
Mateusz Burzyński 2025-06-30 23:30:04 +02:00 committed by GitHub
parent 91cdbd518c
commit b70d4d7e4b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 5 deletions

View File

@ -47397,7 +47397,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
const errorMessage = overriddenInstanceProperty ?
Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property :
Diagnostics._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor;
error(getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage, symbolToString(base), typeToString(getDeclaredTypeOfSymbol(base.parent!)), typeToString(type));
error(getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage, symbolToString(base), typeToString(baseType), typeToString(type));
}
else if (useDefineForClassFields) {
const uninitialized = derived.declarations?.find(d => d.kind === SyntaxKind.PropertyDeclaration && !(d as PropertyDeclaration).initializer);

View File

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

View File

@ -1,4 +1,4 @@
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.
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.
==== propertyOverridesAccessors6.ts (1 errors) ====
@ -11,6 +11,6 @@ propertyOverridesAccessors6.ts(8,3): error TS2610: 'x' is defined as an accessor
class C extends B {
x = 1;
~
!!! error TS2610: 'x' is defined as an accessor in class 'A', but is overridden here in 'C' as an instance property.
!!! error TS2610: 'x' is defined as an accessor in class 'B', but is overridden here in 'C' as an instance property.
}