Skip to content

Revert change to type print in an error message #61977

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
@@ -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) ====
Expand All @@ -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;
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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) ====
Expand All @@ -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.
}