-
Notifications
You must be signed in to change notification settings - Fork 12.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrading to 3.2.1 causes out of memory error in watch mode #30732
Comments
This does indeed appear to be caused by #28490. The OOM happes when the @weswigham You added the code in #28490, you may want to take a look. |
There's a |
It's not quite that simple. Any check except I'm going to assign this one back to you. |
Ohho? Sounds like we can't actually print declarations for this type structure and either need to reduce accuracy or issue a declaration error. I'll look into it. |
@weswigham Any update on this? |
Two things going on here:
export type Key<U> = keyof U;
export type Value<K extends Key<U>, U> = U[K];
export const updateIfChanged = <T>(t: T) => {
const reduce = <U>(u: U, update: (u: U) => T) => {
const set = (newU: U) => Object.is(u, newU) ? t : update(newU);
return Object.assign(
<K extends Key<U>>(key: K) =>
reduce<Value<K, U>>(u[key as keyof U] as Value<K, U>, (v: Value<K, U>) => {
return update(Object.assign(Array.isArray(u) ? [] : {}, u, { [key]: v }));
}),
{ map: (updater: (u: U) => U) => set(updater(u)), set });
};
return reduce<T>(t, (t: T) => t);
}; emit without producing code with any errors. function f<X>(arg: X) {
type Cond1 = X extends [infer A] ? A : never;
type Cond2 = X extends [infer A] ? A : never;
let x: Cond1 = null as any;
let y: Cond2 = null as any;
x = y; // is err, should be ok
y = x; // is err, should be ok
} (in the example in the OP, we inline the alias into the constraint and the argument, meaning we have two conditionals with differing identities, as in the above, and the @ahejlsberg should I fix these separately? The two parts seem different enough that they warrant separate review. |
This is fixed in TS 4.5 (and probably much earlier). |
This compiled successfully using
tsc --watch
in 3.1.6, but broke in 3.2.1. I traced it down further to 3.2.0-dev.20181113 and most specifically this PR: #28490.TypeScript Version: 3.4.0-dev.20190403
Search Terms:
OOM 3.2.1
Code
Expected behavior:
The code compiles and watches when running
tsc --watch
.Actual behavior:
When running
tsc --watch
it outputs:Playground Link:
Here's a repo with the source code and
tsconfig.json
: https://github.com/Methuselah96/typescript-oom.Related Issues:
None.
The text was updated successfully, but these errors were encountered: