Tests for Java name resolution in the IDE
#KT-3337 In Progress LightClasses: class object's property getter unresolved in Java, but compiles OK
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
class ClassObject {
|
||||
void foo() {
|
||||
WithClassObject.object.$instance.getValue();
|
||||
WithClassObject.object.$instance.getValue();
|
||||
WithClassObject.object.$instance.foo();
|
||||
WithClassObject.object.$instance.getValueWithGetter();
|
||||
WithClassObject.object.$instance.getVariable();
|
||||
WithClassObject.object.$instance.setVariable(0);
|
||||
WithClassObject.object.$instance.getVariableWithAccessors();
|
||||
WithClassObject.object.$instance.setVariableWithAccessors(0);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
class WithClassObject {
|
||||
class object {
|
||||
fun foo() {}
|
||||
|
||||
val value: Int = 0
|
||||
val valueWithGetter: Int
|
||||
get() = 1
|
||||
|
||||
var variable: Int = 0
|
||||
var variableWithAccessors: Int
|
||||
get() = 0
|
||||
set(v) {}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright 2010-2013 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.checkers;
|
||||
|
||||
import com.intellij.codeInsight.daemon.DaemonAnalyzerTestCase;
|
||||
import com.intellij.openapi.projectRoots.Sdk;
|
||||
import org.jetbrains.jet.JetTestCaseBuilder;
|
||||
import org.jetbrains.jet.plugin.PluginTestCaseBase;
|
||||
|
||||
public class KotlinAndJavaCheckerTest extends DaemonAnalyzerTestCase {
|
||||
|
||||
@Override
|
||||
protected Sdk getTestProjectJdk() {
|
||||
return PluginTestCaseBase.jdkFromIdeaHome();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getTestDataPath() {
|
||||
return JetTestCaseBuilder.getHomeDirectory() + "/idea/testData/kotlinAndJavaChecker/";
|
||||
}
|
||||
|
||||
public void testName() throws Exception {
|
||||
doTest(false, false, "ClassObjects.java", "ClassObjects.kt");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user