5.4 omits certain import * as ...
statements from .d.ts
#57861
Labels
Milestone
import * as ...
statements from .d.ts
#57861
π Search Terms
omit, emit, 5.4, import, import *
π Version & Regression Information
β― Playground Link
https://www.typescriptlang.org/play?target=99&moduleResolution=99&module=199&ts=5.4.2&useDefineForClassFields=true&noUnusedLocals=true&noUnusedParameters=true&preserveConstEnums=true&importHelpers=true&experimentalDecorators=true&emitDecoratorMetadata=true&jsx=0&isolatedModules=true&verbatimModuleSyntax=true&pretty=true&noErrorTruncation=true&noFallthroughCasesInSwitch=true&noImplicitOverride=true&noPropertyAccessFromIndexSignature=true&useUnknownInCatchVariables=true#code/JYWwDg9gTgLgBAKjgQwM5wIJjgMyhEOAchzAFoZUB6LMAGwE8iBuAKFElkRXQFFd8hEuUpVewGAAsAplBbtw0eEjRwAkgHkBBYqQrVN8jku6rN07UL2jN4qbKOKuMBmAsr0miJd0iDGjTAYYAgAO0dOeABvOABjMNQYADFkOlRpABo4hJgAFSgAV0zcOggAdyywYDc4AF8fYX0qHALQ2OCwiJMXGpiAGWQALwY6hutqFraO8LZWaQAPSO48HUabDTsZOVmFpfjQxMsAOQK6OmQAIzppAC44AB5eAD4AClu4AeHHp4BKOABeJ4PDCvc53DB-QHqDTSAB0tgkW0eWSOYROZ0u13uIKB-1YcDgb0hQJe52JhOJ+IJcF4sJWIHR5yu0jeLx+P1JyB+O0WJn2h3pmkC0zu3xeVLRYXenwY3wyrHJ2NeOGQdy88ICQRCoSV5PMGs2smRmFxhMloWkeo0sJAyDAL1p9OF2pe5st3NYc15XH58EKoQBD14WRBL2AaphBsRRuDJp+d1phqgxpBAKBwDZPL2OTg-oAqqFtaLYxgsgAhV5UnB3N4J8ll+UEgDmNdVmHr8vJLxVEbhCPsyZLvzTcDLge7WSb5JwpTKL31F1AdoncCnWX1MAgBe1WReMHJMDZHq92YO8HSAEcim1pABlQNYWGX6+xO-zyO0OjAWLIYIAN2kAAFZAoGPXY+RzJtpBgDQoFySR8DKAEqTFTd4MQzF3lrGlyV4KB8FAtMUNDHtoT7DZo0HENfnBIjqTgKo3HFeiCX9bsuUbFjaSgmCoF4NJpBTV4iRHKIqRYuApEQySIHQ8pMKJNgJNqH5OIJMDvXgX04AWYBElQYtqO7VtwXJC4IAga5kFCLtSP1fskSHMyLKsgN-kJHBKVY1ptzCF5fRSASsk8rMILPOA9L6aQcBgQyTXY3sowHITnMs6RrMDfNCz8318iKLIAtSdINNPQ49IAJWAJtJFioMjLsyMHJjajUtczKfOy0J-JyQL0gKnI8stUKfRzGA7SimK4tDKsa3eXhyT-CBgAAE07EcErIpLHJakd7Io5Kh3HTy6M220wAmw8XnmckxPonAro9eioGggooADeYlLqD0gA
π» Code
π Actual behavior
The
import * as E from 'fp-ts/Either'
statement is missing in the .d.ts, leading torun
having a return type of effectivelyany
.π Expected behavior
The
import * as E ...
statement should be in the emitted .d.ts, otherwiseE.Either<E, A>
cannot possibly be resolved.Additional information about the issue
Locally I was able to produce a working .d.ts using 5.3.3, but not using 5.4.2. Unfortunately I wasn't able to produce a correct .d.ts in the playground, but at least there the output is consistently incorrect.
I am aware that in the scope of
=> E.Either<E, A>
there are two symbols calledE
, one referring to the type parameter, the other referring to the module import. when importing and using this .ts directly, everything works as expected, so TS seems to be able to differentiate between these two just fine.However, I was able to workaround this issue by renaming either of the two symbols, so they don't "clash".
The text was updated successfully, but these errors were encountered: