Is the interactive shell ready on M4?


#1

Hi there,

When I run -version on compiler, it goes into an interactive shell (shouldn’t -version prints info and exit?) Also I think printing JDK version would be helpful.

Anyway, I try the interactive shell, but a simple line like below crash the shell.

bash> bin/kotlinc-jvm Kotlin interactive shell Type :help for help, :quit for quit >>> fun test(){ println("hello") } >>> test() hello >>> class Foo{} Exception in thread "main" java.lang.IllegalStateException   at org.jetbrains.jet.lang.resolve.OverloadResolver.constructorsGrouped(OverloadResolver.java:111)   at org.jetbrains.jet.lang.resolve.OverloadResolver.checkOverloads(OverloadResolver.java:61)   at org.jetbrains.jet.lang.resolve.OverloadResolver.process(OverloadResolver.java:57)   at org.jetbrains.jet.lang.resolve.TopDownAnalyzer.doProcess(TopDownAnalyzer.java:131)   at org.jetbrains.jet.lang.resolve.TopDownAnalyzer.processClassOrObject(TopDownAnalyzer.java:201)   at org.jetbrains.jet.lang.types.expressions.ExpressionTypingVisitorForStatements.visitClass(ExpressionTypingVisi torForStatements.java:164)   at org.jetbrains.jet.lang.types.expressions.ExpressionTypingVisitorForStatements.visitClass(ExpressionTypingVisi torForStatements.java:53)   at org.jetbrains.jet.lang.psi.JetClass.accept(JetClass.java:68)   at org.jetbrains.jet.lang.types.expressions.ExpressionTypingVisitorDispatcher.getTypeInfo(ExpressionTypingVisito rDispatcher.java:126)   at org.jetbrains.jet.lang.types.expressions.ExpressionTypingVisitorDispatcher.getTypeInfo(ExpressionTypingVisito rDispatcher.java:101)   at org.jetbrains.jet.lang.types.expressions.ExpressionTypingServices.getBlockReturnedTypeWithWritableScope(Expre ssionTypingServices.java:323)   at org.jetbrains.jet.lang.types.expressions.ExpressionTypingServices.getBlockReturnedType(ExpressionTypingServic es.java:207)   at org.jetbrains.jet.lang.resolve.ScriptBodyResolver.resolveScriptBodies(ScriptBodyResolver.java:80)   at org.jetbrains.jet.lang.resolve.BodyResolver.resolveBehaviorDeclarationBodies(BodyResolver.java:133)   at org.jetbrains.jet.lang.resolve.BodyResolver.resolveBodies(BodyResolver.java:141)   at org.jetbrains.jet.lang.resolve.TopDownAnalyzer.doProcess(TopDownAnalyzer.java:134)   at org.jetbrains.jet.cli.jvm.repl.ReplInterpreter.doAnalyze(ReplInterpreter.java:298)   at org.jetbrains.jet.cli.jvm.repl.ReplInterpreter.eval(ReplInterpreter.java:219)   at org.jetbrains.jet.cli.jvm.repl.ReplFromTerminal.eval(ReplFromTerminal.java:144)   at org.jetbrains.jet.cli.jvm.repl.ReplFromTerminal.one(ReplFromTerminal.java:129)   at org.jetbrains.jet.cli.jvm.repl.ReplFromTerminal.doRun(ReplFromTerminal.java:94)   at org.jetbrains.jet.cli.jvm.repl.ReplFromTerminal.run(ReplFromTerminal.java:197)   at org.jetbrains.jet.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.java:76)   at org.jetbrains.jet.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.java:54)   at org.jetbrains.jet.cli.common.CLICompiler.exec(CLICompiler.java:117)   at org.jetbrains.jet.cli.jvm.K2JVMCompiler.exec(K2JVMCompiler.java:181)   at org.jetbrains.jet.cli.jvm.K2JVMCompiler.exec(K2JVMCompiler.java:54)   at org.jetbrains.jet.cli.common.CLICompiler.exec(CLICompiler.java:47)   at org.jetbrains.jet.cli.common.CLICompiler.doMainNoExit(CLICompiler.java:160)   at org.jetbrains.jet.cli.common.CLICompiler.doMain(CLICompiler.java:151)   at org.jetbrains.jet.cli.jvm.K2JVMCompiler.main(K2JVMCompiler.java:58)

So I guess the shell is not quiet ready yet?


#2

Interactive shell have status of a prototype, and we are not developing it right now.          


#3

Then please fix -version option so users wont' encounter this.


#4

Thanks for pointing this out, I have added bug report: KT-3169