back2dos / tinkerbell

MIT License
83 stars 8 forks source link

TypeTools.asTypePath() doesn't really return a TypePath #3

Closed Simn closed 12 years ago

Simn commented 12 years ago

TypeTools.asTypePath() does actually return a ComplexType which happens to be a TPath. This is a bit misleading because one would expect to be able to use ENew("pack.Name".asTypePath(), []).

I would prefer the TypePath structure itself to be returned so it can be used for ENew and in other situations where a real TypePath is needed. If you want to keep the current behavior, the method name should be changed to asComplexType.

back2dos commented 12 years ago

Good point ;)

Simn commented 12 years ago

So is there any convenient way of getting an ENew?

back2dos commented 12 years ago

Yes. Have a look at TypeTools.asTypePath, TypeTools.instantiate and ExprTools.instantiate to see what suits your needs.