Closed masad-frost closed 6 months ago
I don't know what the root cause is but here's the most minimal example I could come up with.
type Foo = Bar<typeof baz<Corge<Quux>>>; // Things get messed up here export type Wow = number;
in CodeMirror:
I think the typeof baz< is the problematic bit, if I change that to Baz< the syntax works.
typeof baz<
Baz<
any
https://codemirror.net/try/?c=aW1wb3J0IHtiYXNpY1NldHVwLCBFZGl0b3JWaWV3fSBmcm9tICJjb2RlbWlycm9yIgppbXBvcnQge2phdmFzY3JpcHR9IGZyb20gIkBjb2RlbWlycm9yL2xhbmctamF2YXNjcmlwdCIKCm5ldyBFZGl0b3JWaWV3KHsKICBkb2M6IGB0eXBlIEZvbyA9IEJhcjx0eXBlb2YgYmF6PENvcmdlPFF1dXg+Pj47CgovLyBUaGluZ3MgZ2V0IG1lc3NlZCB1cCBoZXJlCmV4cG9ydCB0eXBlIFdvdyA9IG51bWJlcjsKYCwKICBleHRlbnNpb25zOiBbYmFzaWNTZXR1cCwgamF2YXNjcmlwdCh7IHR5cGVzY3JpcHQ6IHRydWUgfSldLAogIHBhcmVudDogZG9jdW1lbnQuYm9keQp9KQo=
It wasn't accepting type arguments on the (non-call) baz expression. But it seems TypeScript supports this now. Added in attached patch.
baz
Describe the issue
I don't know what the root cause is but here's the most minimal example I could come up with.
in CodeMirror:
I think the
typeof baz<
is the problematic bit, if I change that toBaz<
the syntax works.Browser and platform
any
Reproduction link
https://codemirror.net/try/?c=aW1wb3J0IHtiYXNpY1NldHVwLCBFZGl0b3JWaWV3fSBmcm9tICJjb2RlbWlycm9yIgppbXBvcnQge2phdmFzY3JpcHR9IGZyb20gIkBjb2RlbWlycm9yL2xhbmctamF2YXNjcmlwdCIKCm5ldyBFZGl0b3JWaWV3KHsKICBkb2M6IGB0eXBlIEZvbyA9IEJhcjx0eXBlb2YgYmF6PENvcmdlPFF1dXg+Pj47CgovLyBUaGluZ3MgZ2V0IG1lc3NlZCB1cCBoZXJlCmV4cG9ydCB0eXBlIFdvdyA9IG51bWJlcjsKYCwKICBleHRlbnNpb25zOiBbYmFzaWNTZXR1cCwgamF2YXNjcmlwdCh7IHR5cGVzY3JpcHQ6IHRydWUgfSldLAogIHBhcmVudDogZG9jdW1lbnQuYm9keQp9KQo=