-
Notifications
You must be signed in to change notification settings - Fork 44
genType.import of nested types causes name conflicts in TypeScript 3.7.2 #302
Comments
@wokalski why regression vs just an issue? If you rename |
Btw notice:
is not a useful pattern. |
I guess what we're looking at there is a feature request, where the above pattern is checked: there's the JS type definition, there's the Reason type definition, and one would like to check that they match. And I guess match means something like: if the reason type |
Right @cristianoc. I figured it's better to use |
I'm closing this one. Seems like an interesting feature @cristianoc but it feels like an error is a desirable result now. Maybe it should even fail during |
Reopening:
compiles to:
which causes the same error. |
@wokalski thanks it appears I have zero examples of that pattern, and needs to be fixed. |
Maybe in the case of interfaces one does need that pattern? |
Here's a very simple problematic example: [@genType.import ("./MyMath", "num")]
type num; gives import {num as num} from './MyMath';
// tslint:disable-next-line:interface-over-type-literal
export type num = num; |
Yes @cristianoc, exactly. Let me put this example in the issue description so that it's clear in the future what it's about. |
Maybe it's about choosing different example, or maybe it's about TS version and/or config. |
hmm, it's probably the version! I just upgraded 🤦♀ |
@wokalski how did it go after version upgrade? |
I had to downgrade and I think it builds correctly now. |
Closing optimistically. |
I mean that the code generated by genType is incompatible with new versions of typescript! I think this requires a re-open 😄 |
I can confirm repro on TS 3.7.2. |
Great, thanks! |
Generates:
When you compile it with
tsc
you get:The text was updated successfully, but these errors were encountered: