Added error diagnostic on inheriting target 6 interface

This commit is contained in:
Michael Bogdanov
2016-09-28 12:11:29 +03:00
parent 7a5c211e8b
commit 95a1c254e1
21 changed files with 217 additions and 144 deletions
@@ -183,10 +183,19 @@ public class CompileKotlinAgainstCustomBinariesTest extends TestCaseWithTmpdir {
return library;
}
private Pair<String, ExitCode> compileKotlin(
@NotNull String fileName,
@NotNull File output,
@NotNull File... classpath
) {
return compileKotlin(fileName, output, false, classpath);
}
@NotNull
private Pair<String, ExitCode> compileKotlin(
@NotNull String fileName,
@NotNull File output,
boolean jvm8Target,
@NotNull File... classpath
) {
List<String> args = new ArrayList<String>();
@@ -199,6 +208,10 @@ public class CompileKotlinAgainstCustomBinariesTest extends TestCaseWithTmpdir {
}
args.add("-d");
args.add(output.getPath());
if (jvm8Target) {
args.add("-jvm-target");
args.add("1.8");
}
return AbstractCliTest.executeCompilerGrabOutput(new K2JVMCompiler(), args);
}
@@ -402,4 +415,24 @@ public class CompileKotlinAgainstCustomBinariesTest extends TestCaseWithTmpdir {
new File(getTestDataDirectory(), "output.txt"), normalizeOutput(outputMain)
);
}
public void testTarget6Inheritance() throws Exception {
target6Inheritance();
}
public void testTarget6MultiInheritance() throws Exception {
target6Inheritance();
}
private void target6Inheritance() {
compileKotlin("target6.kt", tmpdir);
compileKotlin("main.kt", tmpdir, true, tmpdir);
Pair<String, ExitCode> outputMain = compileKotlin("main.kt", tmpdir, true, tmpdir);
KotlinTestUtils.assertEqualsToFile(
new File(getTestDataDirectory(), "output.txt"), normalizeOutput(outputMain)
);
}
}