Home » Modeling » TMF (Xtext) » Strange operation scoping for Numbers and null
Strange operation scoping for Numbers and null [message #907249] |
Mon, 03 September 2012 12:03  |
Eclipse User |
|
|
|
Hi,
in my DSL which extends XBase I get a wrong "!=" operator scoping together with "null".
The following code
val Integer myint = 6
if (myint != null)
true
else
false
will be scoped to the following method which is of course not true:
boolean IntegerExtensions.operator_notEquals(int arg0, short arg1)
I'm using Xtext 2.3.1 but the error was also in earlier version.
Any hint on why this is happending or where to investigate further?
Thanks in advance,
~Ingo
|
|
| | | | | |
Re: Strange operation scoping for Numbers and null [message #907618 is a reply to message #907337] |
Tue, 04 September 2012 04:19   |
Eclipse User |
|
|
|
Hi Sebastian, Hi Christian,
thanks for the hint.
As I was not able to create a reproducable example, I decided to dive deeper into my code.
I found some very old stuff in my TypeConformanceComputer, which is at least partly responsible for my problem.
In my DSL I want all Numbers to be conformant and my Generator is then responsible for doing the correct transformation in Java. Thats why I had that code in my #isConformant() method:
left = primitives.asWrapperTypeIfPrimitive( left );
right = primitives.asWrapperTypeIfPrimitive( right );
if (typeRefs.isInstanceOf( left, Number.class ) && typeRefs.isInstanceOf( right, Number.class ))
return TypeConformanceResult.SUCCESS;
final TypeConformanceResult result = super.isConformant( left, right, flags );
if (result.isConformant())
return result;
But it is not a good idea to do the wrapping BEFORE the super call. I just moved it after the super call to just be executed when super class returns no success.
Now my linking for primitive numbers is much more as excepted.
Thanks,
~Ingo
|
|
| | | | | | | | |
Re: Strange operation scoping for Numbers and null [message #907652 is a reply to message #907337] |
Tue, 04 September 2012 04:19  |
Eclipse User |
|
|
|
Hi Sebastian, Hi Christian,
thanks for the hint.
As I was not able to create a reproducable example, I decided to dive deeper into my code.
I found some very old stuff in my TypeConformanceComputer, which is at least partly responsible for my problem.
In my DSL I want all Numbers to be conformant and my Generator is then responsible for doing the correct transformation in Java. Thats why I had that code in my #isConformant() method:
left = primitives.asWrapperTypeIfPrimitive( left );
right = primitives.asWrapperTypeIfPrimitive( right );
if (typeRefs.isInstanceOf( left, Number.class ) && typeRefs.isInstanceOf( right, Number.class ))
return TypeConformanceResult.SUCCESS;
final TypeConformanceResult result = super.isConformant( left, right, flags );
if (result.isConformant())
return result;
But it is not a good idea to do the wrapping BEFORE the super call. I just moved it after the super call to just be executed when super class returns no success.
Now my linking for primitive numbers is much more as excepted.
Thanks,
~Ingo
|
|
|
Re: Strange operation scoping for Numbers and null [message #907653 is a reply to message #907337] |
Tue, 04 September 2012 04:19  |
Eclipse User |
|
|
|
Hi Sebastian, Hi Christian,
thanks for the hint.
As I was not able to create a reproducable example, I decided to dive deeper into my code.
I found some very old stuff in my TypeConformanceComputer, which is at least partly responsible for my problem.
In my DSL I want all Numbers to be conformant and my Generator is then responsible for doing the correct transformation in Java. Thats why I had that code in my #isConformant() method:
left = primitives.asWrapperTypeIfPrimitive( left );
right = primitives.asWrapperTypeIfPrimitive( right );
if (typeRefs.isInstanceOf( left, Number.class ) && typeRefs.isInstanceOf( right, Number.class ))
return TypeConformanceResult.SUCCESS;
final TypeConformanceResult result = super.isConformant( left, right, flags );
if (result.isConformant())
return result;
But it is not a good idea to do the wrapping BEFORE the super call. I just moved it after the super call to just be executed when super class returns no success.
Now my linking for primitive numbers is much more as excepted.
Thanks,
~Ingo
|
|
|
Re: Strange operation scoping for Numbers and null [message #907654 is a reply to message #907337] |
Tue, 04 September 2012 04:22  |
Eclipse User |
|
|
|
Hi Sebastian, Hi Christian,
thanks for the hint.
As I was not able to create a reproducable example, I decided to dive deeper into my code.
I found some very old stuff in my TypeConformanceComputer, which is at least partly responsible for my problem.
In my DSL I want all Numbers to be conformant and my Generator is then responsible for doing the correct transformation in Java. Thats why I had that code in my #isConformant() method:
left = primitives.asWrapperTypeIfPrimitive( left );
right = primitives.asWrapperTypeIfPrimitive( right );
if (typeRefs.isInstanceOf( left, Number.class ) && typeRefs.isInstanceOf( right, Number.class ))
return TypeConformanceResult.SUCCESS;
final TypeConformanceResult result = super.isConformant( left, right, flags );
if (result.isConformant())
return result;
But it is not a good idea to do the wrapping BEFORE the super call. I just moved it after the super call to just be executed when super class returns no success.
Now my linking for primitive numbers is much more as excepted.
Thanks,
~Ingo
|
|
|
Re: Strange operation scoping for Numbers and null [message #907663 is a reply to message #907337] |
Tue, 04 September 2012 04:19  |
Eclipse User |
|
|
|
Hi Sebastian, Hi Christian,
thanks for the hint.
As I was not able to create a reproducable example, I decided to dive deeper into my code.
I found some very old stuff in my TypeConformanceComputer, which is at least partly responsible for my problem.
In my DSL I want all Numbers to be conformant and my Generator is then responsible for doing the correct transformation in Java. Thats why I had that code in my #isConformant() method:
left = primitives.asWrapperTypeIfPrimitive( left );
right = primitives.asWrapperTypeIfPrimitive( right );
if (typeRefs.isInstanceOf( left, Number.class ) && typeRefs.isInstanceOf( right, Number.class ))
return TypeConformanceResult.SUCCESS;
final TypeConformanceResult result = super.isConformant( left, right, flags );
if (result.isConformant())
return result;
But it is not a good idea to do the wrapping BEFORE the super call. I just moved it after the super call to just be executed when super class returns no success.
Now my linking for primitive numbers is much more as excepted.
Thanks,
~Ingo
|
|
|
Re: Strange operation scoping for Numbers and null [message #907664 is a reply to message #907337] |
Tue, 04 September 2012 04:19  |
Eclipse User |
|
|
|
Hi Sebastian, Hi Christian,
thanks for the hint.
As I was not able to create a reproducable example, I decided to dive deeper into my code.
I found some very old stuff in my TypeConformanceComputer, which is at least partly responsible for my problem.
In my DSL I want all Numbers to be conformant and my Generator is then responsible for doing the correct transformation in Java. Thats why I had that code in my #isConformant() method:
left = primitives.asWrapperTypeIfPrimitive( left );
right = primitives.asWrapperTypeIfPrimitive( right );
if (typeRefs.isInstanceOf( left, Number.class ) && typeRefs.isInstanceOf( right, Number.class ))
return TypeConformanceResult.SUCCESS;
final TypeConformanceResult result = super.isConformant( left, right, flags );
if (result.isConformant())
return result;
But it is not a good idea to do the wrapping BEFORE the super call. I just moved it after the super call to just be executed when super class returns no success.
Now my linking for primitive numbers is much more as excepted.
Thanks,
~Ingo
|
|
|
Re: Strange operation scoping for Numbers and null [message #907665 is a reply to message #907337] |
Tue, 04 September 2012 04:22  |
Eclipse User |
|
|
|
Hi Sebastian, Hi Christian,
thanks for the hint.
As I was not able to create a reproducable example, I decided to dive deeper into my code.
I found some very old stuff in my TypeConformanceComputer, which is at least partly responsible for my problem.
In my DSL I want all Numbers to be conformant and my Generator is then responsible for doing the correct transformation in Java. Thats why I had that code in my #isConformant() method:
left = primitives.asWrapperTypeIfPrimitive( left );
right = primitives.asWrapperTypeIfPrimitive( right );
if (typeRefs.isInstanceOf( left, Number.class ) && typeRefs.isInstanceOf( right, Number.class ))
return TypeConformanceResult.SUCCESS;
final TypeConformanceResult result = super.isConformant( left, right, flags );
if (result.isConformant())
return result;
But it is not a good idea to do the wrapping BEFORE the super call. I just moved it after the super call to just be executed when super class returns no success.
Now my linking for primitive numbers is much more as excepted.
Thanks,
~Ingo
|
|
|
Re: Strange operation scoping for Numbers and null [message #907677 is a reply to message #907337] |
Tue, 04 September 2012 04:19  |
Eclipse User |
|
|
|
Hi Sebastian, Hi Christian,
thanks for the hint.
As I was not able to create a reproducable example, I decided to dive deeper into my code.
I found some very old stuff in my TypeConformanceComputer, which is at least partly responsible for my problem.
In my DSL I want all Numbers to be conformant and my Generator is then responsible for doing the correct transformation in Java. Thats why I had that code in my #isConformant() method:
left = primitives.asWrapperTypeIfPrimitive( left );
right = primitives.asWrapperTypeIfPrimitive( right );
if (typeRefs.isInstanceOf( left, Number.class ) && typeRefs.isInstanceOf( right, Number.class ))
return TypeConformanceResult.SUCCESS;
final TypeConformanceResult result = super.isConformant( left, right, flags );
if (result.isConformant())
return result;
But it is not a good idea to do the wrapping BEFORE the super call. I just moved it after the super call to just be executed when super class returns no success.
Now my linking for primitive numbers is much more as excepted.
Thanks,
~Ingo
|
|
|
Re: Strange operation scoping for Numbers and null [message #907678 is a reply to message #907337] |
Tue, 04 September 2012 04:19  |
Eclipse User |
|
|
|
Hi Sebastian, Hi Christian,
thanks for the hint.
As I was not able to create a reproducable example, I decided to dive deeper into my code.
I found some very old stuff in my TypeConformanceComputer, which is at least partly responsible for my problem.
In my DSL I want all Numbers to be conformant and my Generator is then responsible for doing the correct transformation in Java. Thats why I had that code in my #isConformant() method:
left = primitives.asWrapperTypeIfPrimitive( left );
right = primitives.asWrapperTypeIfPrimitive( right );
if (typeRefs.isInstanceOf( left, Number.class ) && typeRefs.isInstanceOf( right, Number.class ))
return TypeConformanceResult.SUCCESS;
final TypeConformanceResult result = super.isConformant( left, right, flags );
if (result.isConformant())
return result;
But it is not a good idea to do the wrapping BEFORE the super call. I just moved it after the super call to just be executed when super class returns no success.
Now my linking for primitive numbers is much more as excepted.
Thanks,
~Ingo
|
|
|
Re: Strange operation scoping for Numbers and null [message #907679 is a reply to message #907337] |
Tue, 04 September 2012 04:22  |
Eclipse User |
|
|
|
Hi Sebastian, Hi Christian,
thanks for the hint.
As I was not able to create a reproducable example, I decided to dive deeper into my code.
I found some very old stuff in my TypeConformanceComputer, which is at least partly responsible for my problem.
In my DSL I want all Numbers to be conformant and my Generator is then responsible for doing the correct transformation in Java. Thats why I had that code in my #isConformant() method:
left = primitives.asWrapperTypeIfPrimitive( left );
right = primitives.asWrapperTypeIfPrimitive( right );
if (typeRefs.isInstanceOf( left, Number.class ) && typeRefs.isInstanceOf( right, Number.class ))
return TypeConformanceResult.SUCCESS;
final TypeConformanceResult result = super.isConformant( left, right, flags );
if (result.isConformant())
return result;
But it is not a good idea to do the wrapping BEFORE the super call. I just moved it after the super call to just be executed when super class returns no success.
Now my linking for primitive numbers is much more as excepted.
Thanks,
~Ingo
|
|
|
Re: Strange operation scoping for Numbers and null [message #907691 is a reply to message #907337] |
Tue, 04 September 2012 04:19  |
Eclipse User |
|
|
|
Hi Sebastian, Hi Christian,
thanks for the hint.
As I was not able to create a reproducable example, I decided to dive deeper into my code.
I found some very old stuff in my TypeConformanceComputer, which is at least partly responsible for my problem.
In my DSL I want all Numbers to be conformant and my Generator is then responsible for doing the correct transformation in Java. Thats why I had that code in my #isConformant() method:
left = primitives.asWrapperTypeIfPrimitive( left );
right = primitives.asWrapperTypeIfPrimitive( right );
if (typeRefs.isInstanceOf( left, Number.class ) && typeRefs.isInstanceOf( right, Number.class ))
return TypeConformanceResult.SUCCESS;
final TypeConformanceResult result = super.isConformant( left, right, flags );
if (result.isConformant())
return result;
But it is not a good idea to do the wrapping BEFORE the super call. I just moved it after the super call to just be executed when super class returns no success.
Now my linking for primitive numbers is much more as excepted.
Thanks,
~Ingo
|
|
|
Re: Strange operation scoping for Numbers and null [message #907692 is a reply to message #907337] |
Tue, 04 September 2012 04:19  |
Eclipse User |
|
|
|
Hi Sebastian, Hi Christian,
thanks for the hint.
As I was not able to create a reproducable example, I decided to dive deeper into my code.
I found some very old stuff in my TypeConformanceComputer, which is at least partly responsible for my problem.
In my DSL I want all Numbers to be conformant and my Generator is then responsible for doing the correct transformation in Java. Thats why I had that code in my #isConformant() method:
left = primitives.asWrapperTypeIfPrimitive( left );
right = primitives.asWrapperTypeIfPrimitive( right );
if (typeRefs.isInstanceOf( left, Number.class ) && typeRefs.isInstanceOf( right, Number.class ))
return TypeConformanceResult.SUCCESS;
final TypeConformanceResult result = super.isConformant( left, right, flags );
if (result.isConformant())
return result;
But it is not a good idea to do the wrapping BEFORE the super call. I just moved it after the super call to just be executed when super class returns no success.
Now my linking for primitive numbers is much more as excepted.
Thanks,
~Ingo
|
|
|
Re: Strange operation scoping for Numbers and null [message #907693 is a reply to message #907337] |
Tue, 04 September 2012 04:22  |
Eclipse User |
|
|
|
Hi Sebastian, Hi Christian,
thanks for the hint.
As I was not able to create a reproducable example, I decided to dive deeper into my code.
I found some very old stuff in my TypeConformanceComputer, which is at least partly responsible for my problem.
In my DSL I want all Numbers to be conformant and my Generator is then responsible for doing the correct transformation in Java. Thats why I had that code in my #isConformant() method:
left = primitives.asWrapperTypeIfPrimitive( left );
right = primitives.asWrapperTypeIfPrimitive( right );
if (typeRefs.isInstanceOf( left, Number.class ) && typeRefs.isInstanceOf( right, Number.class ))
return TypeConformanceResult.SUCCESS;
final TypeConformanceResult result = super.isConformant( left, right, flags );
if (result.isConformant())
return result;
But it is not a good idea to do the wrapping BEFORE the super call. I just moved it after the super call to just be executed when super class returns no success.
Now my linking for primitive numbers is much more as excepted.
Thanks,
~Ingo
|
|
|
Re: Strange operation scoping for Numbers and null [message #907710 is a reply to message #907337] |
Tue, 04 September 2012 04:19  |
Eclipse User |
|
|
|
Hi Sebastian, Hi Christian,
thanks for the hint.
As I was not able to create a reproducable example, I decided to dive deeper into my code.
I found some very old stuff in my TypeConformanceComputer, which is at least partly responsible for my problem.
In my DSL I want all Numbers to be conformant and my Generator is then responsible for doing the correct transformation in Java. Thats why I had that code in my #isConformant() method:
left = primitives.asWrapperTypeIfPrimitive( left );
right = primitives.asWrapperTypeIfPrimitive( right );
if (typeRefs.isInstanceOf( left, Number.class ) && typeRefs.isInstanceOf( right, Number.class ))
return TypeConformanceResult.SUCCESS;
final TypeConformanceResult result = super.isConformant( left, right, flags );
if (result.isConformant())
return result;
But it is not a good idea to do the wrapping BEFORE the super call. I just moved it after the super call to just be executed when super class returns no success.
Now my linking for primitive numbers is much more as excepted.
Thanks,
~Ingo
|
|
|
Re: Strange operation scoping for Numbers and null [message #907711 is a reply to message #907337] |
Tue, 04 September 2012 04:19  |
Eclipse User |
|
|
|
Hi Sebastian, Hi Christian,
thanks for the hint.
As I was not able to create a reproducable example, I decided to dive deeper into my code.
I found some very old stuff in my TypeConformanceComputer, which is at least partly responsible for my problem.
In my DSL I want all Numbers to be conformant and my Generator is then responsible for doing the correct transformation in Java. Thats why I had that code in my #isConformant() method:
left = primitives.asWrapperTypeIfPrimitive( left );
right = primitives.asWrapperTypeIfPrimitive( right );
if (typeRefs.isInstanceOf( left, Number.class ) && typeRefs.isInstanceOf( right, Number.class ))
return TypeConformanceResult.SUCCESS;
final TypeConformanceResult result = super.isConformant( left, right, flags );
if (result.isConformant())
return result;
But it is not a good idea to do the wrapping BEFORE the super call. I just moved it after the super call to just be executed when super class returns no success.
Now my linking for primitive numbers is much more as excepted.
Thanks,
~Ingo
|
|
|
Re: Strange operation scoping for Numbers and null [message #907712 is a reply to message #907337] |
Tue, 04 September 2012 04:22  |
Eclipse User |
|
|
|
Hi Sebastian, Hi Christian,
thanks for the hint.
As I was not able to create a reproducable example, I decided to dive deeper into my code.
I found some very old stuff in my TypeConformanceComputer, which is at least partly responsible for my problem.
In my DSL I want all Numbers to be conformant and my Generator is then responsible for doing the correct transformation in Java. Thats why I had that code in my #isConformant() method:
left = primitives.asWrapperTypeIfPrimitive( left );
right = primitives.asWrapperTypeIfPrimitive( right );
if (typeRefs.isInstanceOf( left, Number.class ) && typeRefs.isInstanceOf( right, Number.class ))
return TypeConformanceResult.SUCCESS;
final TypeConformanceResult result = super.isConformant( left, right, flags );
if (result.isConformant())
return result;
But it is not a good idea to do the wrapping BEFORE the super call. I just moved it after the super call to just be executed when super class returns no success.
Now my linking for primitive numbers is much more as excepted.
Thanks,
~Ingo
|
|
|
Re: Strange operation scoping for Numbers and null [message #907733 is a reply to message #907337] |
Tue, 04 September 2012 04:19  |
Eclipse User |
|
|
|
Hi Sebastian, Hi Christian,
thanks for the hint.
As I was not able to create a reproducable example, I decided to dive deeper into my code.
I found some very old stuff in my TypeConformanceComputer, which is at least partly responsible for my problem.
In my DSL I want all Numbers to be conformant and my Generator is then responsible for doing the correct transformation in Java. Thats why I had that code in my #isConformant() method:
left = primitives.asWrapperTypeIfPrimitive( left );
right = primitives.asWrapperTypeIfPrimitive( right );
if (typeRefs.isInstanceOf( left, Number.class ) && typeRefs.isInstanceOf( right, Number.class ))
return TypeConformanceResult.SUCCESS;
final TypeConformanceResult result = super.isConformant( left, right, flags );
if (result.isConformant())
return result;
But it is not a good idea to do the wrapping BEFORE the super call. I just moved it after the super call to just be executed when super class returns no success.
Now my linking for primitive numbers is much more as excepted.
Thanks,
~Ingo
|
|
|
Re: Strange operation scoping for Numbers and null [message #907734 is a reply to message #907337] |
Tue, 04 September 2012 04:19  |
Eclipse User |
|
|
|
Hi Sebastian, Hi Christian,
thanks for the hint.
As I was not able to create a reproducable example, I decided to dive deeper into my code.
I found some very old stuff in my TypeConformanceComputer, which is at least partly responsible for my problem.
In my DSL I want all Numbers to be conformant and my Generator is then responsible for doing the correct transformation in Java. Thats why I had that code in my #isConformant() method:
left = primitives.asWrapperTypeIfPrimitive( left );
right = primitives.asWrapperTypeIfPrimitive( right );
if (typeRefs.isInstanceOf( left, Number.class ) && typeRefs.isInstanceOf( right, Number.class ))
return TypeConformanceResult.SUCCESS;
final TypeConformanceResult result = super.isConformant( left, right, flags );
if (result.isConformant())
return result;
But it is not a good idea to do the wrapping BEFORE the super call. I just moved it after the super call to just be executed when super class returns no success.
Now my linking for primitive numbers is much more as excepted.
Thanks,
~Ingo
|
|
|
Re: Strange operation scoping for Numbers and null [message #907735 is a reply to message #907337] |
Tue, 04 September 2012 04:22  |
Eclipse User |
|
|
|
Hi Sebastian, Hi Christian,
thanks for the hint.
As I was not able to create a reproducable example, I decided to dive deeper into my code.
I found some very old stuff in my TypeConformanceComputer, which is at least partly responsible for my problem.
In my DSL I want all Numbers to be conformant and my Generator is then responsible for doing the correct transformation in Java. Thats why I had that code in my #isConformant() method:
left = primitives.asWrapperTypeIfPrimitive( left );
right = primitives.asWrapperTypeIfPrimitive( right );
if (typeRefs.isInstanceOf( left, Number.class ) && typeRefs.isInstanceOf( right, Number.class ))
return TypeConformanceResult.SUCCESS;
final TypeConformanceResult result = super.isConformant( left, right, flags );
if (result.isConformant())
return result;
But it is not a good idea to do the wrapping BEFORE the super call. I just moved it after the super call to just be executed when super class returns no success.
Now my linking for primitive numbers is much more as excepted.
Thanks,
~Ingo
|
|
|
Goto Forum:
Current Time: Wed Jul 23 13:47:06 EDT 2025
Powered by FUDForum. Page generated in 0.53917 seconds
|