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
To build it you can just run npm install && tsc. It's about 1800 LOCs of typescript.
On my (old) machine, if I build it as-is with 2.5 or 2.6-dev I get a ~5s build time. If I uncomment in src/IMap.tslines 29 and 30, however, the build time explodes. On 2.5 I didn't bother waiting but it would be a long, long, long time. On 2.6-dev the speed is much better but the build time still explodes from 5 seconds to 35 seconds.
When I implement the interface, I change the return type to a more specific one, which is as far as I'm aware, legal.
Expected behavior:
Uncommenting these two lines of code shouldn't cause the build time to increase sevenfold. Maybe the code is wrong, but then I should get a compilation error or a warning, not an increased build time.
If I put in the tsconfig.json: "noStrictGenericChecks": true
then the performance issue goes away completely even with the lines uncommented.
The text was updated successfully, but these errors were encountered:
emmanueltouzery
changed the title
two lines in an interface cause a build time explosion (probably improved generics typecheck issue)
two lines in an interface cause a build time explosion [strictGenericChecks]
Sep 5, 2017
TypeScript Version: Tested on 2.5.2 and 2.6.0-dev.20170904
Code
The code is there:
https://github.com/emmanueltouzery/prelude.ts/tree/5c33c1eeeea7234506e54331d06590e2feb9b00d
To build it you can just run
npm install && tsc
. It's about 1800 LOCs of typescript.On my (old) machine, if I build it as-is with 2.5 or 2.6-dev I get a ~5s build time. If I uncomment in
src/IMap.ts
lines 29 and 30, however, the build time explodes. On 2.5 I didn't bother waiting but it would be a long, long, long time. On 2.6-dev the speed is much better but the build time still explodes from 5 seconds to 35 seconds.The two lines are:
And they are implemented in
src/HashMap.ts
with:When I implement the interface, I change the return type to a more specific one, which is as far as I'm aware, legal.
Expected behavior:
Uncommenting these two lines of code shouldn't cause the build time to increase sevenfold. Maybe the code is wrong, but then I should get a compilation error or a warning, not an increased build time.
If I put in the
tsconfig.json
:"noStrictGenericChecks": true
then the performance issue goes away completely even with the lines uncommented.
The text was updated successfully, but these errors were encountered: