You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
an app package that imports the function. Both sides refer to Immutable.List() and specify immutable 3.8.1.
Issues
When compiling the app package, typescript is unable to determine that the types are actually identical (details below)
Also seems to give quite a performance hit - I have a project where tsc slowed down dramatically when split into multiple packages to share code.
See end for workaround!
I admit almost complete ignorance, but presumably this is because two copies of immutable are present (see --listFiles output below), even though they are identical. I assume tsc bails out when trying to compare each immutable's declarations - could it fall back to compare the immutable package.json/version in such a case rather than failing outright?
I assume all this comparing is the cause of the slow down when splitting code into multiple packages because tsc does not assume that modules could be identical.
damian$ tsc --listFiles --diagnostics
error TS2321: Excessive stack depth comparing types 'List<OrderData>' and 'List<OrderData>'.
index.ts(12,39): error TS2345: Argument of type 'List<OrderData>' is not assignable to parameter of type 'List<OrderData>'.
Types of property 'set' are incompatible.
Type '(index: number, value: OrderData) => List<OrderData>' is not assignable to type '(index: number, value: OrderData) => List<OrderData>'. Two different types with this name exist, but they are unre
lated.
Type 'List<OrderData>' is not assignable to type 'List<OrderData>'. Two different types with this name exist, but they are unrelated.
/Users/damian/.nvm/versions/node/v7.10.0/lib/node_modules/typescript/lib/lib.es6.d.ts
/Users/damian/EventSoft/Code/immutate/immutate-lib/node_modules/immutable/dist/immutable-nonambient.d.ts
/Users/damian/EventSoft/Code/immutate/immutate-lib/index.ts
/Users/damian/EventSoft/Code/immutate/immutate-app/node_modules/immutable/dist/immutable-nonambient.d.ts
/Users/damian/EventSoft/Code/immutate/immutate-app/index.ts
Files: 5
Lines: 26203
Nodes: 99337
Identifiers: 35318
Symbols: 129226
Types: 49188
Memory used: 138661K
I/O read: 0.01s
I/O write: 0.00s
Parse time: 0.69s
Bind time: 0.28s
Check time: 2.41s
Emit time: 0.06s
Total time: 3.43s
Workaround
Take advantage of path mapping compiler options to force tsc to see only one copy of immutable.
TypeScript Version: 2.4.1 / typescript@2.5.0-dev.20170629
Demo contains two packages:
Immutable.List()
and specifyimmutable
3.8.1.Issues
I admit almost complete ignorance, but presumably this is because two copies of immutable are present (see --listFiles output below), even though they are identical. I assume tsc bails out when trying to compare each immutable's declarations - could it fall back to compare the immutable package.json/version in such a case rather than failing outright?
I assume all this comparing is the cause of the slow down when splitting code into multiple packages because tsc does not assume that modules could be identical.
Many thanks - Typescript is awesome!
Code
https://github.com/damianaiamad/immutate
lib:
app:
Expected behavior:
tsc
compiles without errorActual behavior:
Workaround
Take advantage of path mapping compiler options to force
tsc
to see only one copy ofimmutable
.immutate-app/tscongif.json:
Result:
The text was updated successfully, but these errors were encountered: