-
Notifications
You must be signed in to change notification settings - Fork 11
Conversation
src/test/fixtures/custom/my-class.js
Outdated
* @template T | ||
* @constructor | ||
*/ | ||
function MyParameterizedType() {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably pointless at the min seeing as we don't check if named types exist or not
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I would just drop this, not necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't really been in the generator much until now so if this is way off how it should be implemented, do let me know. Happy to discard it or redo it.
Looks great! Same way I would have done it.
Did you run npm run test:make-goldens
? If there were some existing types in Polymer that improve because of this feature, they would show up in your diff.
Is there a way we can default to any if we don't know the type? So if someone does NonExistent, we would produce any? or should we just assume it exists?
Let's just assume it exists.
src/ts-ast.ts
Outdated
itemTypes: Type[]; | ||
name: string; | ||
|
||
constructor(name: string, ...itemTypes: Type[]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd drop the variadic itemTypes
param and just take a regular array.
src/test/fixtures/custom/my-class.js
Outdated
* @template T | ||
* @constructor | ||
*/ | ||
function MyParameterizedType() {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I would just drop this, not necessary.
this is updated now. i did run |
i've also gone ahead and fixed #59 seeing as its in the same piece of code im adding here (just two rename entries). i did a quick ctrl+f through the typescript lib and didn't find any other |
bbfbd4f
to
7b55e5b
Compare
Looks great, merged. Thanks! |
Fixes #58.
Fixes #59.
Just a quick fix.
Haven't really been in the generator much until now so if this is way off how it should be implemented, do let me know. Happy to discard it or redo it.
Is there a way we can default to
any
if we don't know the type? So if someone doesNonExistent<number>
, we would produceany
? or should we just assume it exists?