| Summary: | [Xbase] Visibility computation of feature calls incomplete | ||
|---|---|---|---|
| Product: | [Modeling] TMF | Reporter: | Krzysztof Kowalczyk <kowalczyk.krzysztof> |
| Component: | Xtext | Assignee: | Project Inbox <tmf.xtext-inbox> |
| Status: | NEW --- | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | sebastian.zarnekow, sven.efftinge |
| Version: | 2.0.0 | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Krzysztof Kowalczyk
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.
|