-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Isolated declarations errors #58201
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
weswigham
merged 27 commits into
microsoft:main
from
bloomberg:isolated-declarations-errors
Apr 19, 2024
Merged
Isolated declarations errors #58201
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
96de93c
Added command line option and errors
dragomirtitian 94e1f5b
Added isolated declaration errors.
dragomirtitian 5ed6046
Addressed code review.
dragomirtitian 2160065
Improved expando function handling.
dragomirtitian 461669d
Change how isolated declaration checks are called.
dragomirtitian 987a476
Improve error for variables initialized with class expression
dragomirtitian 5cb9fad
Forbid allowJS with isolated declarations and changed description of …
dragomirtitian 652d1dc
Merge remote-tracking branch 'remotes/origin/main' into isolated-decl…
dragomirtitian 186a8b8
Remove visitor cache workaround.
dragomirtitian d5a298d
Removed restriction on isolatedDeclaration running with out and outFile.
dragomirtitian 75a43c4
Removed errors for enum members where there is no tantalizer emitted …
dragomirtitian 5d747bb
Moved isolated declaration diagnostics to diagnostics.ts
dragomirtitian a831ae4
Changed diagnostic message texts.
dragomirtitian 0b83d8a
Changed import to use ts namespace instead of the file.
dragomirtitian 7ac2788
Renamed expressionOrTypeToTypeNode
dragomirtitian 7c893ca
Fixed typo in diagnostic.
dragomirtitian b0ad92c
Forbid isolated declarations without declaration option.
dragomirtitian 108fe87
Call expressionOrTypeToTypeNodeHelper instead expressionOrTypeToTypeNode
dragomirtitian 27e1b8a
Removed drive by fix to shouldPrintWithInitializer
dragomirtitian 53cb0ac
Use getEmitDeclarations instead of declaration
dragomirtitian 5f3721c
Update src/compiler/program.ts
dragomirtitian bdd411a
Move methods off of context, fix context bug
jakebailey b761b3f
Merge pull request #144 from jakebailey/bloomberg-isolated-declaratio…
dragomirtitian 4c9318c
Fix unused code lints
jakebailey 102ebf7
Merge pull request #145 from jakebailey/bloomberg-isolated-declaratio…
dragomirtitian 9a073be
Make isEntityNameVisible have the same parameter order
jakebailey ee7a872
Merge pull request #146 from jakebailey/bloomberg-isolated-declaratio…
dragomirtitian File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(the function referenced here should be renamed) and the containing function should be renamed to
expressionOrTypeToTypeNode
. As-is, this is still only being invoked at thatwithContext
callsite (which should also beexpressionOrTypeToTypeNode
once this is renamed), so thatNoSyntacticPrinter
flag isn't even doing anything.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expressionOrTypeToTypeNodeHelper
(after rename) may calltypeToTypeNodeHelper
which in turn will callserializeTypeForDeclaration
andserializeReturnTypeForSignature
and these would perform the check again. I can refactor those intoserializeTypeForDeclarationHelper
andserializeReturnTypeForSignatureHelper
which do not perform the check andserializeTypeForDeclaration
andserializeReturnTypeForSignature
which would only be called from the top level. This would ensure the code does not check multiple times the same expression, and would remove the need for theNoSyntacticPrinter
flag.The flag will disappear in the next PRs. It's definitely not something that will remain. When the syntactic builder actually builds the types and falls back to the checked builder when it can't the problem of duplicate checks will go away.
Should I do the
serializeTypeForDeclarationHelper
andserializeReturnTypeForSignatureHelper
refactor for now? Or ca we live with this until after the beta?