Community
Participate
Working Groups
Xtend compiler does not check if given type is visible in given context e.g. if one references package-visible class from different package it leads to Java error but Xtend compiler does not complain. Example is available on: https://github.com/KrzysztofKowalczyk/Tests/blob/master/src/Visibility.xtend
Preliminary scheduled for 2.0RC1
postponed to SR1
The VisisbilityService and DefaultJvmFeatureDescriptionProvider doesn't take the actual receiver into account when detecting whether a certain feature is visible or not. Consider the following case: class MyXtendClass { def foo() { new Object().clone // clone should be marked with an error this.clone // this is ok } }
I don't think we'll be able to fix this completely for SR2, so we should at least have a small 'hack' which is to remove 'clone' and 'finalize' from the scope (or maybe just from the list of proposals). Since currently those methods are always proposed as valid.
I have removed Object.finalize() and Object.clone() from the list of proposals.
*** Bug 342035 has been marked as a duplicate of this bug. ***
Fixed validation for member access was pushed and will be available with the type system. We still need to validate type references themselves. Furthermore, super type computation has to take the current context into account: The super type of StringBuilder in StringBuffer is AbstractStringBuilder (+ some interfaces) as long as the context is the package java.lang, other contexts have to yield Object + some interfaces.
Other pending issues with default visibility: package a; class A { void m() } package b; class B extends A {} package a; class C extends B { // m() is not visible } There may be issues with members of nested types, too.