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
typeAttributes<Keysextendsstring>={[KeyinKeys]: string;// I'm actually using Attribute<Key> in my code, but `string` is all that is needed to cause the RangeError}classQuery<AextendsAttributes<keyofA>>{multiply<BextendsAttributes<keyofB>>(x: B): Query<A&B>;}
Expected behavior:
Should compile
Actual behavior:
Fails to compile with stack trace:
/usr/local/lib/node_modules/typescript/lib/tsc.js:51296
throw e;
^
RangeError: Maximum call stack size exceeded
at isRelatedTo (/usr/local/lib/node_modules/typescript/lib/tsc.js:26081:33)
at isRelatedTo (/usr/local/lib/node_modules/typescript/lib/tsc.js:26166:38)
at isRelatedTo (/usr/local/lib/node_modules/typescript/lib/tsc.js:26139:42)
at typeRelatedToEachType (/usr/local/lib/node_modules/typescript/lib/tsc.js:26351:35)
at isRelatedTo (/usr/local/lib/node_modules/typescript/lib/tsc.js:26125:34)
at isRelatedTo (/usr/local/lib/node_modules/typescript/lib/tsc.js:26189:42)
at isRelatedTo (/usr/local/lib/node_modules/typescript/lib/tsc.js:26147:38)
at isRelatedTo (/usr/local/lib/node_modules/typescript/lib/tsc.js:26153:38)
at isRelatedTo (/usr/local/lib/node_modules/typescript/lib/tsc.js:26153:38)
at isRelatedTo (/usr/local/lib/node_modules/typescript/lib/tsc.js:26153:38)
Ivan (@akaRem) The code I added to this issue is not really that useful, it is just the minimal code I could find that causes the bug.
My actual Attributes class has a set of Attribute<Key> objects, as opposed to the string values in the example. I use it to model the response of an API.
Activity
akaRem commentedon Mar 28, 2017
Hi, James K Nelson (@jamesknelson) !
I wonder how you use this type.
I've tried it on playground, and found such valid case:
It doesn't allow to pass anything except just 1 string to Attributes and exposes that string as only valid attribute.
jamesknelson commentedon Mar 30, 2017
Ivan (@akaRem) The code I added to this issue is not really that useful, it is just the minimal code I could find that causes the bug.
My actual
Attributesclass has a set ofAttribute<Key>objects, as opposed to thestringvalues in the example. I use it to model the response of an API.