Fix state conversion, fix tests

This commit is contained in:
Ilya Chernikov
2017-02-06 17:18:42 +01:00
parent c5bc58ad32
commit 7b2ea001c1
12 changed files with 83 additions and 91 deletions
@@ -70,7 +70,7 @@ open class GenericReplChecker(
override fun check(state: IReplStageState<*>, codeLine: ReplCodeLine): ReplCheckResult {
state.lock.write {
val checkerState = state.asState<GenericReplCheckerState>()
val checkerState = state.asState(GenericReplCheckerState::class.java)
val scriptFileName = makeScriptBaseName(codeLine, checkerState.generation.get())
val virtualFile =
LightVirtualFile("$scriptFileName${KotlinParserDefinition.STD_SCRIPT_EXT}", KotlinLanguage.INSTANCE, StringUtil.convertLineSeparators(codeLine.code)).apply {
@@ -47,7 +47,7 @@ open class GenericReplCompiler(disposable: Disposable,
override fun compile(state: IReplStageState<*>, codeLine: ReplCodeLine): ReplCompileResult {
state.lock.write {
val compilerState = state.asState<GenericReplCompilerState>()
val compilerState = state.asState(GenericReplCompilerState::class.java)
val currentGeneration = compilerState.generation.get()