diff --git a/compiler/tests/org/jetbrains/jet/resolve/constraintSystem/AbstractConstraintSystemTest.kt b/compiler/tests/org/jetbrains/jet/resolve/constraintSystem/AbstractConstraintSystemTest.kt index c96d0b0e34f..eef0ac29810 100644 --- a/compiler/tests/org/jetbrains/jet/resolve/constraintSystem/AbstractConstraintSystemTest.kt +++ b/compiler/tests/org/jetbrains/jet/resolve/constraintSystem/AbstractConstraintSystemTest.kt @@ -41,8 +41,13 @@ abstract public class AbstractConstraintSystemTest() : JetLiteFixture() { val constraintPattern = Pattern.compile("""(SUBTYPE|SUPERTYPE)\s+${typePattern}\s+${typePattern}\s+(weak)?""", Pattern.MULTILINE) val variablesPattern = Pattern.compile("VARIABLES\\s+(.*)") - private var typeResolver: TypeResolver by Delegates.notNull() - private var myDeclarations: MyDeclarations by Delegates.notNull() + private var _typeResolver: TypeResolver? = null + private val typeResolver: TypeResolver + get() = _typeResolver!! + + private var _myDeclarations: MyDeclarations? = null + private val myDeclarations: MyDeclarations + get() = _myDeclarations!! override fun createEnvironment(): JetCoreEnvironment { return createEnvironmentWithMockJdk(ConfigurationKind.ALL) @@ -52,8 +57,14 @@ abstract public class AbstractConstraintSystemTest() : JetLiteFixture() { super.setUp() val injector = InjectorForTests(getProject(), JetTestUtils.createEmptyModule()!!) - typeResolver = injector.getTypeResolver()!! - myDeclarations = analyzeDeclarations() + _typeResolver = injector.getTypeResolver()!! + _myDeclarations = analyzeDeclarations() + } + + override fun tearDown() { + _typeResolver = null + _myDeclarations = null + super.tearDown() } override fun getTestDataPath(): String { diff --git a/idea/tests/org/jetbrains/jet/completion/handlers/CompletionHandlerTestBase.kt b/idea/tests/org/jetbrains/jet/completion/handlers/CompletionHandlerTestBase.kt index d56e74dc2f9..05d8a96e892 100644 --- a/idea/tests/org/jetbrains/jet/completion/handlers/CompletionHandlerTestBase.kt +++ b/idea/tests/org/jetbrains/jet/completion/handlers/CompletionHandlerTestBase.kt @@ -38,12 +38,8 @@ public abstract class CompletionHandlerTestBase() : JetLightCodeInsightFixtureTe protected abstract val completionType : CompletionType protected abstract val testDataRelativePath: String - protected var fixture: JavaCodeInsightTestFixture by Delegates.notNull() - - protected override fun setUp() { - super.setUp() - fixture = myFixture - } + protected val fixture: JavaCodeInsightTestFixture + get() = myFixture protected fun doTest() : Unit = doTest(2, null, null, null, '\n')