{"action":"closed","issue":{"url":"https://api.github.com/repos/x2bool/kuery/issues/9","repository_url":"https://api.github.com/repos/x2bool/kuery","labels_url":"https://api.github.com/repos/x2bool/kuery/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/x2bool/kuery/issues/9/comments","events_url":"https://api.github.com/repos/x2bool/kuery/issues/9/events","html_url":"https://github.com/x2bool/kuery/issues/9","id":173617190,"number":9,"title":"Simply including kuery library in gradle, breaks inlining in non-kuery-related code","user":{"login":"alexbobp","id":97150,"avatar_url":"https://avatars.githubusercontent.com/u/97150?v=3","gravatar_id":"","url":"https://api.github.com/users/alexbobp","html_url":"https://github.com/alexbobp","followers_url":"https://api.github.com/users/alexbobp/followers","following_url":"https://api.github.com/users/alexbobp/following{/other_user}","gists_url":"https://api.github.com/users/alexbobp/gists{/gist_id}","starred_url":"https://api.github.com/users/alexbobp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexbobp/subscriptions","organizations_url":"https://api.github.com/users/alexbobp/orgs","repos_url":"https://api.github.com/users/alexbobp/repos","events_url":"https://api.github.com/users/alexbobp/events{/privacy}","received_events_url":"https://api.github.com/users/alexbobp/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-08-27T21:49:56Z","updated_at":"2016-08-28T21:26:41Z","closed_at":"2016-08-28T21:26:41Z","body":"This error confuses me, so it is possible I misdiagnosed it, but here's what I did and how you can reproduce:\r\nCheck out the anko demo: https://github.com/yanex/anko-example/\r\nAdd kuery to app/build.gradle dependencies: compile 'com.nivabit.kuery:core:0.2'\r\n\r\nBuild fails with:\r\n```\r\ne: (mypath)/app/src/main/java/org/example/ankodemo/CountriesActivity.kt: (23, 31): org.jetbrains.kotlin.codegen.CompilationException: Back-end (JVM) Internal error: Couldn't inline method call 'flatMap' into \r\noverride fun onCreate(savedInstanceState: Bundle?) {\r\n        super.onCreate(savedInstanceState)\r\n\r\n        val items = listOf(\r\n                \"America\" to listOf(\"Brazil\", \"Canada\", \"United States\"),\r\n                \"Asia\" to listOf(\"China\", \"India\", \"Japan\"),\r\n                \"Europe\" to listOf(\"France\", \"Germany\", \"Spain\", \"United Kingdom\"),\r\n                \"Oceania\" to listOf(\"Australia\", \"New Zealand\"))\r\n\r\n        val listItems = items.flatMap {\r\n            listOf(ContinentItem(it.first)) + it.second.map { CountryItem(it) }\r\n        }\r\n\r\n        listAdapter = CountriesAdapter(this, listItems)\r\n    }\r\ncause: Not generated\r\nCause: Collection has more than one element.\r\nFile being compiled and position: (23,31) in (mypath)/app/src/main/java/org/example/ankodemo/CountriesActivity.kt\r\nPsiElement: flatMap {\r\n            listOf(ContinentItem(it.first)) + it.second.map { CountryItem(it) }\r\n        }\r\nThe root cause was thrown at: _Collections.kt:487\r\n        at org.jetbrains.kotlin.codegen.inline.InlineCodegen.genCallInner(InlineCodegen.java:158)\r\n        at org.jetbrains.kotlin.codegen.CallGenerator.genCall(CallGenerator.kt:105)\r\n        at org.jetbrains.kotlin.codegen.ExpressionCodegen.invokeMethodWithArguments(ExpressionCodegen.java:2415)\r\n        at org.jetbrains.kotlin.codegen.ExpressionCodegen.invokeMethodWithArguments(ExpressionCodegen.java:2373)\r\n        at org.jetbrains.kotlin.codegen.Callable$invokeMethodWithArguments$1.invoke(Callable.kt:44)\r\n        at org.jetbrains.kotlin.codegen.Callable$invokeMethodWithArguments$1.invoke(Callable.kt:23)\r\n        at org.jetbrains.kotlin.codegen.OperationStackValue.putSelector(StackValue.kt:65)\r\n        at org.jetbrains.kotlin.codegen.StackValue.put(StackValue.java:109)\r\n        at org.jetbrains.kotlin.codegen.StackValue.put(StackValue.java:102)\r\n        at org.jetbrains.kotlin.codegen.ExpressionCodegen.initializeLocalVariable(ExpressionCodegen.java:3335)\r\n        at org.jetbrains.kotlin.codegen.ExpressionCodegen.visitProperty(ExpressionCodegen.java:3274)\r\n        at org.jetbrains.kotlin.codegen.ExpressionCodegen.visitProperty(ExpressionCodegen.java:107)\r\n        at org.jetbrains.kotlin.psi.KtProperty.accept(KtProperty.java:57)\r\n        at org.jetbrains.kotlin.codegen.CodegenStatementVisitor.visitKtElement(CodegenStatementVisitor.java:31)\r\n        at org.jetbrains.kotlin.codegen.CodegenStatementVisitor.visitKtElement(CodegenStatementVisitor.java:22)\r\n        at org.jetbrains.kotlin.psi.KtVisitor.visitExpression(KtVisitor.java:174)\r\n        at org.jetbrains.kotlin.psi.KtVisitor.visitDeclaration(KtVisitor.java:29)\r\n        at org.jetbrains.kotlin.psi.KtVisitor.visitNamedDeclaration(KtVisitor.java:386)\r\n        at org.jetbrains.kotlin.psi.KtVisitor.visitProperty(KtVisitor.java:57)\r\n        at org.jetbrains.kotlin.psi.KtProperty.accept(KtProperty.java:57)\r\n        at org.jetbrains.kotlin.codegen.ExpressionCodegen.genQualified(ExpressionCodegen.java:280)\r\n        at org.jetbrains.kotlin.codegen.ExpressionCodegen.genStatement(ExpressionCodegen.java:339)\r\n        at org.jetbrains.kotlin.codegen.ExpressionCodegen.generateBlock(ExpressionCodegen.java:1532)\r\n        at org.jetbrains.kotlin.codegen.ExpressionCodegen.generateBlock(ExpressionCodegen.java:1485)\r\n        at org.jetbrains.kotlin.codegen.CodegenStatementVisitor.visitBlockExpression(CodegenStatementVisitor.java:56)\r\n        at org.jetbrains.kotlin.codegen.CodegenStatementVisitor.visitBlockExpression(CodegenStatementVisitor.java:22)\r\n        at org.jetbrains.kotlin.psi.KtBlockExpression.accept(KtBlockExpression.java:44)\r\n        at org.jetbrains.kotlin.codegen.ExpressionCodegen.genQualified(ExpressionCodegen.java:280)\r\n        at org.jetbrains.kotlin.codegen.ExpressionCodegen.genStatement(ExpressionCodegen.java:339)\r\n        at org.jetbrains.kotlin.codegen.ExpressionCodegen.gen(ExpressionCodegen.java:309)\r\n        at org.jetbrains.kotlin.codegen.ExpressionCodegen.returnExpression(ExpressionCodegen.java:1873)\r\n        at org.jetbrains.kotlin.codegen.FunctionGenerationStrategy$FunctionDefault.doGenerateBody(FunctionGenerationStrategy.java:50)\r\n        at org.jetbrains.kotlin.codegen.FunctionGenerationStrategy$CodegenBased.generateBody(FunctionGenerationStrategy.java:72)\r\n        at org.jetbrains.kotlin.codegen.FunctionCodegen.generateMethodBody(FunctionCodegen.java:364)\r\n        at org.jetbrains.kotlin.codegen.FunctionCodegen.generateMethod(FunctionCodegen.java:203)\r\n        at org.jetbrains.kotlin.codegen.FunctionCodegen.generateMethod(FunctionCodegen.java:138)\r\n        at org.jetbrains.kotlin.codegen.FunctionCodegen.gen(FunctionCodegen.java:113)\r\n        at org.jetbrains.kotlin.codegen.MemberCodegen.genFunctionOrProperty(MemberCodegen.java:180)\r\n        at org.jetbrains.kotlin.codegen.ClassBodyCodegen.generateDeclaration(ClassBodyCodegen.java:124)\r\n        at org.jetbrains.kotlin.codegen.ClassBodyCodegen.generateBody(ClassBodyCodegen.java:74)\r\n        at org.jetbrains.kotlin.codegen.MemberCodegen.generate(MemberCodegen.java:117)\r\n        at org.jetbrains.kotlin.codegen.MemberCodegen.genClassOrObject(MemberCodegen.java:231)\r\n        at org.jetbrains.kotlin.codegen.PackageCodegen.generateClassOrObject(PackageCodegen.java:147)\r\n        at org.jetbrains.kotlin.codegen.PackageCodegen.generateFile(PackageCodegen.java:98)\r\n        at org.jetbrains.kotlin.codegen.PackageCodegen.generate(PackageCodegen.java:61)\r\n        at org.jetbrains.kotlin.codegen.KotlinCodegenFacade.generatePackage(KotlinCodegenFacade.java:99)\r\n        at org.jetbrains.kotlin.codegen.KotlinCodegenFacade.doGenerateFiles(KotlinCodegenFacade.java:77)\r\n        at org.jetbrains.kotlin.codegen.KotlinCodegenFacade.compileCorrectFiles(KotlinCodegenFacade.java:44)\r\n        at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.generate(KotlinToJVMBytecodeCompiler.kt:376)\r\n        at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.analyzeAndGenerate(KotlinToJVMBytecodeCompiler.kt:275)\r\n        at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileBunchOfSources(KotlinToJVMBytecodeCompiler.kt:194)\r\n        at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:194)\r\n        at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:49)\r\n        at org.jetbrains.kotlin.cli.common.CLICompiler.exec(CLICompiler.java:174)\r\n        at org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile.callCompiler(Tasks.kt:85)\r\n        at org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile.compile(Tasks.kt:61)\r\n        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n        at java.lang.reflect.Method.invoke(Method.java:498)\r\n        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)\r\n        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:226)\r\n        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:219)\r\n        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:208)\r\n        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:585)\r\n        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:568)\r\n        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)\r\n        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)\r\n        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)\r\n        at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)\r\n        at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)\r\n        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)\r\n        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)\r\n        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)\r\n        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)\r\n        at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)\r\n        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:208)\r\n        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:186)\r\n        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:62)\r\n        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50)\r\n        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:25)\r\n        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:111)\r\n        at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)\r\n        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:62)\r\n        at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)\r\n        at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:68)\r\n        at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)\r\n        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:62)\r\n        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:55)\r\n        at org.gradle.initialization.DefaultGradleLauncher$6.run(DefaultGradleLauncher.java:174)\r\n        at org.gradle.internal.Factories$1.create(Factories.java:22)\r\n        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:62)\r\n        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:47)\r\n        at org.gradle.initialization.DefaultGradleLauncher.runBuildOperation(DefaultGradleLauncher.java:189)\r\n        at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:171)\r\n        at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:35)\r\n        at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:104)\r\n        at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:97)\r\n        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:62)\r\n        at org.gradle.initialization.DefaultGradleLauncher.runRootBuildOperation(DefaultGradleLauncher.java:184)\r\n        at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:97)\r\n        at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:86)\r\n        at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:93)\r\n        at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)\r\n        at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)\r\n        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:43)\r\n        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:27)\r\n        at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:72)\r\n        at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:44)\r\n        at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:50)\r\n        at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:27)\r\n        at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:40)\r\n        at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:170)\r\n        at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:237)\r\n        at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:210)\r\n        at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)\r\n        at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)\r\n        at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:206)\r\n        at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)\r\n        at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)\r\n        at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)\r\n        at org.gradle.launcher.Main.doAction(Main.java:33)\r\n        at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)\r\n        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n        at java.lang.reflect.Method.invoke(Method.java:498)\r\n        at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54)\r\n        at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35)\r\n        at org.gradle.launcher.GradleMain.main(GradleMain.java:23)\r\n        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n        at java.lang.reflect.Method.invoke(Method.java:498)\r\n        at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:33)\r\n        at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:130)\r\n        at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)\r\nCaused by: java.lang.IllegalArgumentException: Collection has more than one element.\r\n        at kotlin.collections.CollectionsKt___CollectionsKt.single(_Collections.kt:487)\r\n        at kotlin.collections.CollectionsKt.single(Unknown Source)\r\n        at org.jetbrains.kotlin.codegen.inline.SMAP.<init>(SMAP.kt:242)\r\n        at org.jetbrains.kotlin.codegen.inline.SMAPParser.parse(SMAPParser.kt:78)\r\n        at org.jetbrains.kotlin.codegen.inline.SMAPParser.parseOrCreateDefault(SMAPParser.kt:24)\r\n        at org.jetbrains.kotlin.codegen.inline.InlineCodegenUtil.getMethodNode(InlineCodegenUtil.java:140)\r\n        at org.jetbrains.kotlin.codegen.inline.InlineCodegen.createMethodNode(InlineCodegen.java:215)\r\n        at org.jetbrains.kotlin.codegen.inline.InlineCodegen.genCallInner(InlineCodegen.java:149)\r\n        ... 136 more\r\n```\r\n\r\nThe error doesn't mention kuery, but simply removing kuery from the dependencies clears it up."}}
{"actor":{"display_login":"alexbobp"}}