Test for property resolve
This commit is contained in:
@@ -21,8 +21,8 @@ public class SubstitutingScope implements JetScope {
|
|||||||
@Override
|
@Override
|
||||||
public PropertyDescriptor getProperty(String name) {
|
public PropertyDescriptor getProperty(String name) {
|
||||||
PropertyDescriptor property = workerScope.getProperty(name);
|
PropertyDescriptor property = workerScope.getProperty(name);
|
||||||
if (property == null) {
|
if (property == null || substitutionContext.isEmpty()) {
|
||||||
return null;
|
return property;
|
||||||
}
|
}
|
||||||
return new LazySubstitutedPropertyDescriptorImpl(property, substitutionContext);
|
return new LazySubstitutedPropertyDescriptorImpl(property, substitutionContext);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ class A {
|
|||||||
fun fooB() = foo(1)
|
fun fooB() = foo(1)
|
||||||
fun foo() : Int = 1.plus(1)
|
fun foo() : Int = 1.plus(1)
|
||||||
fun foo1() : B = new B()
|
fun foo1() : B = new B()
|
||||||
|
val a : Int
|
||||||
}
|
}
|
||||||
|
|
||||||
class C : A {
|
class C : A {
|
||||||
|
|||||||
@@ -90,6 +90,12 @@ public class JetResolveTest extends LightDaemonAnalyzerTestCase {
|
|||||||
assertSame(intPlus, FunctionDescriptorUtil.getOriginal(mustBePlus));
|
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);
|
JetClass classCDecl = (JetClass) declarations.get(1);
|
||||||
ClassDescriptor classC = bindingContext.getClassDescriptor(classCDecl);
|
ClassDescriptor classC = bindingContext.getClassDescriptor(classCDecl);
|
||||||
|
|||||||
Reference in New Issue
Block a user