Uh oh!
There was an error while loading. Please reload this page.
Build better import paths for declaration emit/typeToString from reexports if possible - #27340
Conversation
…node_modules import generation
Wesley Wigham (weswigham)
commented
Sep 25, 2018
TypeScript Bot (@typescript-bot) test this |
Heya Wesley Wigham (@weswigham), I've started to run the extended test suite on this PR at 4f50766. You can monitor the build here. It should now contribute to this PR's status checks. |
Wesley Wigham (weswigham)
commented
Oct 30, 2018
Andy (Andrewkraft) (@Andy-MS) you wanna look over this? |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Wesley Wigham (weswigham)
commented
Nov 10, 2018
Ron Buckton (@rbuckton) done. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| "category": "Message", | ||
| "code": 2738 | ||
| }, | ||
| "The inferred type of '{0}' requires a reference to a module at '{1}' to name, which would likely break on type redistribution. A type annotation is necessary.": { |
There was a problem hiding this comment.
is {1} the name of the package? Or the module itself?
There was a problem hiding this comment.
What about
Generating a declaration for '{0}' requires generating a reference to the module '{1}'; however, this is susceptible to breaking upon distribution. Provide an explicit annotation or add an explicit dependency on '{2}'.
There was a problem hiding this comment.
From the new test:
The inferred type of 'x' requires a reference to a module at 'foo/node_modules/nested' to name, which would likely break on type redistribution. A type annotation is necessary.
It's the specifier we would generate were we to emit it.
There was a problem hiding this comment.
We have an accessibility error
"The inferred type of '{0}' references an inaccessible '{1}' type. A type annotation is necessary."
which this message is templated after. I imagine we should use consistent language.
Ron Buckton (rbuckton)
left a comment
There was a problem hiding this comment.
Barring Daniel's feedback and a minor nitpick, this seems fine.
There was a problem hiding this comment.
This nesting is unnecessarily complicated. What about this:
letresults=links.extendedContainersByFile&&links.extendedContainersByFile.get(id);if(results)returnresults;| "category": "Error", | ||
| "code": 2741 | ||
| }, | ||
| "The inferred type of '{0}' requires a reference to a module at '{1}' to name, which would likely break on type redistribution. A type annotation is necessary.": { |
There was a problem hiding this comment.
Naming the type of '{0}' requires a reference to a module at '{1}' to name, which would likely break on type redistribution. A type annotation is necessary.
or
``
Generating a declaration for the type of '{0}' requires a reference to a module at '{1}' to name, which would likely break on type redistribution. A type annotation is necessary.
There was a problem hiding this comment.
The inferred type of '{0}' cannot be named without a reference to '{1}'. This is likely not portable. A type annotation is necessary. ?
b966829 to
278149cCompare
Also, issue an error on relative/deep
node_modulesimport generation (undermoduleResolution: "node") if a better specifier cannot be found (which can happen if your type definitions need to depend on the types of a dependency of a dependency which you do not yet directly depend on). While such paths technically work on the compiling system, the resulting.d.tsfile will be non-portable; this can cause issues for package consumers, so it is best to mark it as needing a type annotation to fix the problem.Fixes#26985