Add nightly-only error on ImportType resolution mode assertion#49356
Conversation
|
It should be noted that some of the errors added in this one are in |
tests/baselines/reference/nodeModulesDeclarationEmitDynamicImportWithPackageExports.js
Outdated
Show resolved
Hide resolved
|
I think we need to add an emit resolver portability error (with a new error message) whenever the declaration emitter has to produce one of these |
|
First draft:
|
My minor edits were just that it needs to be wrapped in single quotes, and I would encourage using a hyphen so people can understand what we're talking about better. |
|
Otherwise, I think that's good. |
c163402 to
e158d6c
Compare
|
@DanielRosenwasser I was matching this one: Do you want me to update it too? |
| export const b = import("package/mjs"); | ||
| ~ | ||
| !!! error TS2841: The type of this expression cannot be named without a resolution mode assertion, which is an unstable feature. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'. |
There was a problem hiding this comment.
Here’s the new portability error in action. Bummer. 🥲
|
@DanielRosenwasser also this one? |
|
@weswigham mind taking another look since I added some SymbolTracker code? |
|
@typescript-bot cherry-pick this to release-4.7 |
|
Heya @andrewbranch, I've started to run the task to cherry-pick this into |
|
Hey @andrewbranch, I couldn't open a PR with the cherry-pick. (You can check the log here). You may need to squash and pick this PR into release-4.7 manually. |
…soft#49356) * Add nightly-only error on ImportType resolution mode assertion * Temporarily change version to demonstrate errors * Revert "Temporarily change version to demonstrate errors" This reverts commit 40c2469. * "Resolution mode" -> "resolution-mode"
…assertion) into release-4.7 (#49365) * Add nightly-only error on ImportType resolution mode assertion (#49356) * Add nightly-only error on ImportType resolution mode assertion * Temporarily change version to demonstrate errors * Revert "Temporarily change version to demonstrate errors" This reverts commit 40c2469. * "Resolution mode" -> "resolution-mode" * Update baselines


Counterpart to #49002
The reverted commit shows errors that will appear in non-nightly (including the ones from #49002)
Fixes #49354