From 27829c15e5d78e421d01e564434bc212e308023a Mon Sep 17 00:00:00 2001 From: Andrey Breslav Date: Thu, 16 Jan 2014 20:01:41 +0400 Subject: [PATCH] Fix for KT-4413 Do not add error types to supertype lists The list is not filtered upon creation because it would force lazy types to compute #KT-4413 Fixed Original commit: 0155bf01898a9872e81da10412b6ee18e3bdf305 --- .../jet/jps/build/SimpleKotlinJpsBuildTest.kt | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 jps/jps-plugin/test/org/jetbrains/jet/jps/build/SimpleKotlinJpsBuildTest.kt diff --git a/jps/jps-plugin/test/org/jetbrains/jet/jps/build/SimpleKotlinJpsBuildTest.kt b/jps/jps-plugin/test/org/jetbrains/jet/jps/build/SimpleKotlinJpsBuildTest.kt new file mode 100644 index 00000000000..651fcebdffc --- /dev/null +++ b/jps/jps-plugin/test/org/jetbrains/jet/jps/build/SimpleKotlinJpsBuildTest.kt @@ -0,0 +1,74 @@ +/* + * Copyright 2010-2014 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.jps.build + +import org.jetbrains.jps.builders.JpsBuildTestCase +import com.intellij.util.PathUtil +import org.jetbrains.jps.model.java.JpsJavaExtensionService + +public class SimpleKotlinJpsBuildTest : JpsBuildTestCase() { + override fun setUp() { + super.setUp() + System.setProperty("kotlin.jps.tests", "true") + } + + override fun tearDown() { + System.clearProperty("kotlin.jps.tests") + super.tearDown() + } + + public fun testThreeModulesNoReexport() { + val aFile = createFile("a/a.kt", + """ + trait A1 { + fun bar() + } + trait A2 { + fun bar() + } + """) + val a = addModule("a", PathUtil.getParentPath(aFile)) + + val bFile = createFile("b/b.kt", + """ + trait B1 { + fun foo(): B2? = null + } + + trait B2 : A1, A2 { + override fun bar() {} + } + """) + val b = addModule("b", PathUtil.getParentPath(bFile)) + JpsJavaExtensionService.getInstance().getOrCreateDependencyExtension( + b.getDependenciesList().addModuleDependency(a) + ).setExported(false) + + val cFile = createFile("c/c.kt", + """ + class C : B1 { + fun test() { + foo()?.bar() + } + } + """) + val c = addModule("c", PathUtil.getParentPath(cFile)) + c.getDependenciesList().addModuleDependency(b) + + rebuildAll() + } +}