Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide factory methods for simple refs (primitives) #651

Closed
leventov opened this issue May 9, 2016 · 0 comments
Closed

Provide factory methods for simple refs (primitives) #651

leventov opened this issue May 9, 2016 · 0 comments

Comments

@leventov
Copy link
Contributor

leventov commented May 9, 2016

Currently TypeFactory has a lot of static fields like INTEGER, INTEGER_PRIMITIVE, etc. But because any object cannot appear in AST twice, it's often requred to write code like

factory.Field().createField(factory.Core().clone(factory.Type().INTEGER_PRIMITIVE), "foo", ...)

when constructring some AST from stratch, i. e. just clone a constant. (And it's very easy to forget to do that.)

I suggest to add factory methods like TypeFactory.integer(), TypeFactory.integerPrimitive() which create a unique object referencing Integer, int, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant