Home » Modeling » TMF (Xtext) » JvmTypeReference and eIsProxy
JvmTypeReference and eIsProxy [message #1696704] |
Thu, 28 May 2015 06:20 |
|
Hi
while working on https://bugs.eclipse.org/bugs/show_bug.cgi?id=468174 I
noted that in the JvmTypesBuilder in two places eIsProxy() is checked on
a JvmTypeReference; from what I understand, a JvmTypeReference will
never be a proxy, since it represents a reference, but it is not an EMF
reference itself; it is the contained JvmType that can be a proxy.
In particular, in the implementation of toGetter you read
if (typeRef != null && !typeRef.eIsProxy() &&
!InferredTypeIndicator.isInferred(typeRef)
&& typeRef.getType()!=null
&& !typeRef.getType().eIsProxy() &&
"boolean".equals(typeRef.getType().getIdentifier())) {
prefix = "is";
}
I guess the intention here is not to trigger type resolution, but indeed
type resolution is triggered by typeRef.getType() (and again,
typeRef.eIsProxy() will always return false.
Shouldn't JvmTypeReference.eIsProxy() be implemented in terms of
"type.eIsProxy()"?
cheers
Lorenzo
--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book
HOME: http://www.lorenzobettini.it
TDD Book: https://leanpub.com/tdd-buildautomation-ci
Xtext Book: https://www.packtpub.com/application-development/implementing-domain-specific-languages-xtext-and-xtend-second-edition
|
|
| |
Re: JvmTypeReference and eIsProxy [message #1696777 is a reply to message #1696773] |
Thu, 28 May 2015 14:04 |
|
On 28/05/2015 15:46, Sven Efftinge wrote:
> Yes, that's a bug.
OK, I'll submit a bug shortly, with a patch proposal:
at least, I think the important thing is that scoping is not triggered
on the original type reference, but on the cloned one.
I'm not planning to touch eIsProxy implementation.
cheers
Lorenzo
--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book
HOME: http://www.lorenzobettini.it
TDD Book: https://leanpub.com/tdd-buildautomation-ci
Xtext Book: https://www.packtpub.com/application-development/implementing-domain-specific-languages-xtext-and-xtend-second-edition
|
|
| | | |
Goto Forum:
Current Time: Fri Apr 19 21:58:45 GMT 2024
Powered by FUDForum. Page generated in 0.05212 seconds
|