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

#type in FASTJavaVarDeclStatement should be a FASTJavaTypeName #44

Open
NicolasAnquetil opened this issue Jul 7, 2023 · 3 comments
Open
Labels

Comments

@NicolasAnquetil
Copy link
Contributor

it is currently defined as FASTJavaVariableExpression which is twice wrong

@Gabriel-Darbord
Copy link
Member

It should be a TypeExpression, because only ClassTypeExpressions use TypeName.

JavaSmaCCProgramNodeImporterVisitor parseCodeMethodString: 'void f() { int a; }'
image
JavaSmaCCProgramNodeImporterVisitor parseCodeMethodString: 'void f() { String a; }'
image

@NicolasAnquetil
Copy link
Contributor Author

humm not sure I got your point.
What I meant was:

  • the type in FASTJavaVarDeclStatement is not an expression (it is not evaluated at exec time but at compile time
  • it must be a type name "hardcoded"

So the type of a FASTJavaVarDeclStatement is a FASTJavaTypeName

@Gabriel-Darbord
Copy link
Member

Gabriel-Darbord commented Jul 7, 2023

I'm not arguing about the semantics, whether or not it is an "expression."
Currently, among nodes representing a type, only ClassTypeExpression uses TypeName.
For all other types (array and primitives), they don't need to use TypeName because the name is inferred from the node type.
For example, BooleanTypeExpression is boolean, IntTypeExpression is int, etc.
Whereas ClassTypeExpressions need a TypeName to know what class is being referenced.

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

No branches or pull requests

2 participants