Test for property resolve

This commit is contained in:
Andrey Breslav
2011-02-28 20:30:31 +03:00
parent 2811094d32
commit 304644db1b
3 changed files with 9 additions and 2 deletions
@@ -21,8 +21,8 @@ public class SubstitutingScope implements JetScope {
@Override
public PropertyDescriptor getProperty(String name) {
PropertyDescriptor property = workerScope.getProperty(name);
if (property == null) {
return null;
if (property == null || substitutionContext.isEmpty()) {
return property;
}
return new LazySubstitutedPropertyDescriptorImpl(property, substitutionContext);
}
+1
View File
@@ -7,6 +7,7 @@ class A {
fun fooB() = foo(1)
fun foo() : Int = 1.plus(1)
fun foo1() : B = new B()
val a : Int
}
class C : A {
@@ -90,6 +90,12 @@ public class JetResolveTest extends LightDaemonAnalyzerTestCase {
assertSame(intPlus, FunctionDescriptorUtil.getOriginal(mustBePlus));
}
{
PropertyDescriptor a = classA.getMemberScope(Collections.<TypeProjection>emptyList()).getProperty("a");
JetProperty aDecl = (JetProperty) classADecl.getDeclarations().get(5);
PropertyDescriptor mustBeA = bindingContext.getPropertyDescriptor(aDecl);
assertSame(a, mustBeA);
}
JetClass classCDecl = (JetClass) declarations.get(1);
ClassDescriptor classC = bindingContext.getClassDescriptor(classCDecl);