fix: clarify implicit abstract class diagnostic#1824
Open
popsiclelmlm wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1747 by clarifying the
reportImplicitAbstractClassdiagnostic so it does not imply that the missing abstract symbol must come from the parent abstract class.Reproduction
The issue example is a class that extends an abstract base and declares a new abstract method itself:
The previous wording said the class extends an abstract class “without implementing all abstract symbols,” which can read as if the missing abstract symbol necessarily belongs to the base class.
Root cause
The diagnostic message was correct for some cases, but too narrow for classes that still contain abstract symbols introduced on the subclass itself.
Changes
classImplicitlyAbstractdiagnostic wording to say the class still contains abstract symbols.Tests
git diff --checkcd packages/pyright-internal && node --max-old-space-size=8192 --expose-gc ./node_modules/jest/bin/jest checker.test.ts -t reportImplicitAbstractClass --runInBand --forceExitnpm run typechecknpx prettier -c packages/pyright-internal/src/localization/package.nls.en-us.json packages/pyright-internal/src/tests/checker.test.tsESLINT_USE_FLAT_CONFIG=false npx eslint packages/pyright-internal/src/tests/checker.test.tsScreenshots/Logs
N/A