How to implement Overloading scenario #1538
Replies: 3 comments 1 reply
-
if you do explicit scoping you can have a look at the actual parameters and their types |
Beta Was this translation helpful? Give feedback.
-
In addition to what @cdietrich said, you can also override the |
Beta Was this translation helpful? Give feedback.
-
Hello @msujew and @cdietrich, Thanks for your prompt reply, If there exists multiple Named Elements with same name, we could handle this scenario in scope computation, however when creating the for example -> in below scenario we will only get
Request you to guide us as how to resolve this problem. Thanks in advance. |
Beta Was this translation helpful? Give feedback.
-
Hello Team,
We are working on creating a DSL which would create a language similar to functions/methods in java Language, please find below langium rule for creating the same.
MethodMember: name=ID '(' (parameters+=Parameter (',' parameters+=Parameter)*)? ')' ':' returnType=TypeReference ('{' (body=BodyRule)? ('return' return=TypeReference)?'}')? ;
In this DSL we are doing scope resolution on the basis of name of a method Member, however if there are multiple method members with different parameters or return type (i.e. overloading in java), it fails to resolve which method we are trying to refer and only picks one of them.
Request you to help and guide us, how to achieve similar functionality of overloading of java.
Thanks in advance
Beta Was this translation helpful? Give feedback.
All reactions