--ignore-not-supported, GenericRecords to object, resolve namespaces#28
--ignore-not-supported, GenericRecords to object, resolve namespaces#28Crusader4Christ wants to merge 2 commits intogristlabs:masterfrom
Conversation
dsagal
left a comment
There was a problem hiding this comment.
Thank you for contributing! Could you add tests for your changes? They would also make it easier to see what kinds of usage got fixed.
| programPath.scope.rename(tsInterfaceCheckerIdentifier); | ||
| programPath.scope.rename(onceIdentifier); | ||
| programPath?.scope.rename(tsInterfaceCheckerIdentifier); | ||
| programPath?.scope.rename(onceIdentifier); |
There was a problem hiding this comment.
Why do we need to add these "optional chaining" operators in this file?
With the optional chaining operators, if programPath is somehow null | undefined (which it should never be), the calls to .rename() will be silently skipped, when we actually want an error instead (to let us know something went wrong)
There was a problem hiding this comment.
Sorry. I dont know why, but my Intellij idea tels me error is here. I'll reverted this.
There was a problem hiding this comment.
This hasn't changed yet with your updates. If you want to get rid of the TS errors you can use ! instead of ?, e.g.:
| programPath?.scope.rename(onceIdentifier); | |
| programPath!.scope.rename(onceIdentifier); |
and that doesn't change the compiled code.
I'm not sure why the TS error doesn't come up when building.. I guess the build is not using "strict null checks" (--strictNullChecks), whereas your IDE is using strict null checks for some reason?
Do not throw exception on non supported features. GenericRecords transforms to object Namespaces content are parsed
784daf5 to
2005b68
Compare
5f15938 to
5592848
Compare
|
@Crusader4Christ It seems the new test ("should compile namespace to runtime code") is also responsible for testing So looking at the test you added, I can see how the "resolve namespaces" feature has been implemented.
Just trying to look at this holistically, in terms of support for namespaces in general. Maybe this is a good stepping stone & these issues can be left for later, since I guess it would be a bit of work between this lib & ts-interface-checker. |
Do not throw exception on non supported features.
GenericRecords transforms to object
Namespaces content are parsed