Test for property resolve
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user