{"action":"created","issue":{"url":"https://api.github.com/repos/lampepfl/dotty/issues/2704","repository_url":"https://api.github.com/repos/lampepfl/dotty","labels_url":"https://api.github.com/repos/lampepfl/dotty/issues/2704/labels{/name}","comments_url":"https://api.github.com/repos/lampepfl/dotty/issues/2704/comments","events_url":"https://api.github.com/repos/lampepfl/dotty/issues/2704/events","html_url":"https://github.com/lampepfl/dotty/issues/2704","id":234235590,"number":2704,"title":"Match error in backend using Java defined annotation with default parameters","user":{"login":"olafurpg","id":1408093,"avatar_url":"https://avatars3.githubusercontent.com/u/1408093?v=3","gravatar_id":"","url":"https://api.github.com/users/olafurpg","html_url":"https://github.com/olafurpg","followers_url":"https://api.github.com/users/olafurpg/followers","following_url":"https://api.github.com/users/olafurpg/following{/other_user}","gists_url":"https://api.github.com/users/olafurpg/gists{/gist_id}","starred_url":"https://api.github.com/users/olafurpg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olafurpg/subscriptions","organizations_url":"https://api.github.com/users/olafurpg/orgs","repos_url":"https://api.github.com/users/olafurpg/repos","events_url":"https://api.github.com/users/olafurpg/events{/privacy}","received_events_url":"https://api.github.com/users/olafurpg/received_events","type":"User","site_admin":false},"labels":[{"id":561305836,"url":"https://api.github.com/repos/lampepfl/dotty/labels/prio:blocker","name":"prio:blocker","color":"1d76db","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2017-06-07T14:47:37Z","updated_at":"2017-06-23T12:55:36Z","closed_at":null,"body":"While trying to compile the compiler-benchmark with Dotty I hit on a match error in the backend\r\n\r\n\r\n```\r\n[error] Error while emitting ColdDotcBenchmark.scala\r\n[error] Block(List(ValDef(warmups$1,TypeTree[TypeRef(ThisType(TypeRef(NoPrefix,scala)),Nothing)],Select(Ident(Fork),$lessinit$greater$default$2)), ValDef(jvm$1,TypeTree[TypeRef(ThisType(TypeRef(NoPrefix,scala)),Nothing)],Select(Ident(Fork),$lessinit$greater$default$3)), ValDef(jvmArgs$1,TypeTree[RefinedType(TypeRef(ThisType(TypeRef(NoPrefix,scala)),Array), scala$Array$$T, TypeAlias(TypeRef(ThisType(TypeRef(NoPrefix,lang)),String), 0))],Apply(Apply(TypeApply(Select(Ident(Array),apply),List(TypeTree[TypeVar(ParamRef(scala$Array$apply$$T) -> TypeRef(ThisType(TypeRef(NoPrefix,lang)),String))])),List(SeqLiteral(List(Literal(Constant(-XX:CICompilerCount=2))),TypeTree[TypeVar(ParamRef(scala$Array$apply$$T) -> TypeRef(ThisType(TypeRef(NoPrefix,lang)),String))]))),List(Apply(TypeApply(Select(Ident(ClassTag),apply),List(TypeTree[TypeVar(ParamRef(scala$Array$apply$$T) -> TypeRef(ThisType(TypeRef(NoPrefix,lang)),String))])),List(Literal(Constant(TypeRef(ThisType(TypeRef(NoPrefix,lang)),String)))))))), ValDef(jvmArgsPrepend$1,TypeTree[TypeRef(ThisType(TypeRef(NoPrefix,scala)),Nothing)],Select(Ident(Fork),$lessinit$greater$default$5))),Apply(Select(New(TypeTree[TypeRef(TermRef(TermRef(TermRef(TermRef(ThisType(TypeRef(NoPrefix,<root>)),org)/withSig(Signature(List(),)),openjdk)/withSig(Signature(List(),)),jmh)/withSig(Signature(List(),)),annotations)/withSig(Signature(List(),)),Fork)]),<init>),List(Literal(Constant(16)), Select(This(Ident(ColdDotcBenchmark)),warmups$1), Select(This(Ident(ColdDotcBenchmark)),jvm$1), Select(This(Ident(ColdDotcBenchmark)),jvmArgs$1), Select(This(Ident(ColdDotcBenchmark)),jvmArgsPrepend$1), Select(Ident(Fork),$lessinit$greater$default$6)))) (of class dotty.tools.dotc.ast.Trees$Block)\r\nscala.MatchError: Block(List(ValDef(warmups$3,TypeTree[TypeRef(ThisType(TypeRef(NoPrefix,scala)),Nothing)],Select(Ident(Fork),$lessinit$greater$default$2)), ValDef(jvm$3,TypeTree[TypeRef(ThisType(TypeRef(NoPrefix,scala)),Nothing)],Select(Ident(Fork),$lessinit$greater$default$3)), ValDef(jvmArgs$3,TypeTree[RefinedType(TypeRef(ThisType(TypeRef(NoPrefix,scala)),Array), scala$Array$$T, TypeAlias(TypeRef(ThisType(TypeRef(NoPrefix,lang)),String), 0))],Apply(Apply(TypeApply(Select(Ident(Array),apply),List(TypeTree[TypeVar(ParamRef(scala$Array$apply$$T) -> TypeRef(ThisType(TypeRef(NoPrefix,lang)),String))])),List(SeqLiteral(List(Literal(Constant(-XX:CICompilerCount=2))),TypeTree[TypeVar(ParamRef(scala$Array$apply$$T) -> TypeRef(ThisType(TypeRef(NoPrefix,lang)),String))]))),List(Apply(TypeApply(Select(Ident(ClassTag),apply),List(TypeTree[TypeVar(ParamRef(scala$Array$apply$$T) -> TypeRef(ThisType(TypeRef(NoPrefix,lang)),String))])),List(Literal(Constant(TypeRef(ThisType(TypeRef(NoPrefix,lang)),String)))))))), ValDef(jvmArgsPrepend$3,TypeTree[TypeRef(ThisType(TypeRef(NoPrefix,scala)),Nothing)],Select(Ident(Fork),$lessinit$greater$default$5))),Apply(Select(New(TypeTree[TypeRef(TermRef(TermRef(TermRef(TermRef(ThisType(TypeRef(NoPrefix,<root>)),org)/withSig(Signature(List(),)),openjdk)/withSig(Signature(List(),)),jmh)/withSig(Signature(List(),)),annotations)/withSig(Signature(List(),)),Fork)]),<init>),List(Literal(Constant(16)), Select(This(Ident(ColdScalacBenchmark)),warmups$3), Select(This(Ident(ColdScalacBenchmark)),jvm$3), Select(This(Ident(ColdScalacBenchmark)),jvmArgs$3), Select(This(Ident(ColdScalacBenchmark)),jvmArgsPrepend$3), Select(Ident(Fork),$lessinit$greater$default$6)))) (of class dotty.tools.dotc.ast.Trees$Block)\r\n    at dotty.tools.backend.jvm.DottyBackendInterface.assocsFromApply(DottyBackendInterface.scala:530)\r\n    at dotty.tools.backend.jvm.DottyBackendInterface$$anon$10.assocs(DottyBackendInterface.scala:521)\r\n    at dotty.tools.backend.jvm.DottyBackendInterface.emitAnnotations$$anonfun$6(DottyBackendInterface.scala:306)\r\n```\r\n\r\nWith `-Xprint:all`\r\n```scala\r\n[info] result of /Users/ollie/dev/compiler-benchmark/compilation/src/main/scala/dotty/tools/dotc/ColdDotcBenchmark.scala after genBCode:\r\n[info]\r\n[info] package dotty.tools.dotc {\r\n[info]   @scala.annotation.internal.SourceFile(\r\n[info]     \"/Users/ollie/dev/compiler-benchmark/compilation/src/main/scala/dotty/tools/dotc/ColdDotcBenchmark.scala\"\r\n[info]   ) @{\r\n[info]     <accessor> val warmups$1: Nothing =\r\n[info]       org.openjdk.jmh.annotations.Fork.$lessinit$greater$default$2\r\n[info]     <accessor> val jvm$1: Nothing =\r\n[info]       org.openjdk.jmh.annotations.Fork.$lessinit$greater$default$3\r\n[info]     <accessor> val jvmArgs$1: Array{scala$Array$$T = String} =\r\n[info]       Array.apply[String^]([\"-XX:CICompilerCount=2\" : String^])(\r\n[info]         scala.reflect.ClassTag.apply[String^](classOf[class String])\r\n[info]       )\r\n[info]     <accessor> val jvmArgsPrepend$1: Nothing =\r\n[info]       org.openjdk.jmh.annotations.Fork.$lessinit$greater$default$5\r\n[info]     new org.openjdk.jmh.annotations.Fork(16,\r\n[info]       dotty.tools.dotc.ColdDotcBenchmark.this.warmups$1\r\n[info]     , dotty.tools.dotc.ColdDotcBenchmark.this.jvm$1,\r\n[info]       dotty.tools.dotc.ColdDotcBenchmark.this.jvmArgs$1\r\n[info]     , dotty.tools.dotc.ColdDotcBenchmark.this.jvmArgsPrepend$1,\r\n[info]       org.openjdk.jmh.annotations.Fork.$lessinit$greater$default$6\r\n[info]     )\r\n[info]   } @org.openjdk.jmh.annotations.OutputTimeUnit(MILLISECONDS) @\r\n[info]     org.openjdk.jmh.annotations.BenchmarkMode\r\n[info]   (\r\n[info]     Array.apply[org.openjdk.jmh.annotations.Mode^](\r\n[info]       [SingleShotTime : org.openjdk.jmh.annotations.Mode^]\r\n[info]     )(\r\n[info]       scala.reflect.ClassTag.apply[org.openjdk.jmh.annotations.Mode^](\r\n[info]         classOf[class Mode]\r\n[info]       )\r\n[info]     )\r\n[info]   ) @org.openjdk.jmh.annotations.State(Benchmark) class ColdDotcBenchmark\r\n[info]      extends\r\n[info]    base.BaseDotcBenchmark {\r\n[info]     def <init>(): Unit =\r\n[info]       {\r\n[info]         super()\r\n[info]         ()\r\n[info]       }\r\n[info]     @org.openjdk.jmh.annotations.Benchmark() override def compile(): Unit =\r\n[info]       super.compile()\r\n[info]   }\r\n[info] }\r\n[info]\r\n```\r\n\r\nThe source file where the error happens ColdDotcBenchmark.scala: https://github.com/lampepfl/compiler-benchmark/blob/82392bc30df11946cb489d45afc2698e3b48bced/compilation/src/main/scala/dotty/tools/dotc/ColdDotcBenchmark.scala#L10-L18\r\n\r\nThe `@Fork` annotations is defined in Java from the JMH project, https://github.com/jacek-lewandowski/jmh-jl/blob/fc92780b525f6376b2433518b3dc90a5f511feef/jmh-core/src/main/java/org/openjdk/jmh/annotations/Fork.java#L44\r\n\r\nI made several attempts to minimize the error with Fork.java and a tiny Foo.scala but didn't manage to reproduce. To reproduce in the environment I hit the error:\r\n\r\n- at commit https://github.com/lampepfl/compiler-benchmark/commit/0e282a72f9a7ef4dcafcf7acacd09ecca756b66f\r\n  - git clone https://github.com/olafurpg/compiler-benchmark\r\n  - git checkout bootstrap\r\n- run `sbt compilation/compile`"},"comment":{"url":"https://api.github.com/repos/lampepfl/dotty/issues/comments/310658175","html_url":"https://github.com/lampepfl/dotty/issues/2704#issuecomment-310658175","issue_url":"https://api.github.com/repos/lampepfl/dotty/issues/2704","id":310658175,"user":{"login":"smarter","id":63430,"avatar_url":"https://avatars1.githubusercontent.com/u/63430?v=3","gravatar_id":"","url":"https://api.github.com/users/smarter","html_url":"https://github.com/smarter","followers_url":"https://api.github.com/users/smarter/followers","following_url":"https://api.github.com/users/smarter/following{/other_user}","gists_url":"https://api.github.com/users/smarter/gists{/gist_id}","starred_url":"https://api.github.com/users/smarter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smarter/subscriptions","organizations_url":"https://api.github.com/users/smarter/orgs","repos_url":"https://api.github.com/users/smarter/repos","events_url":"https://api.github.com/users/smarter/events{/privacy}","received_events_url":"https://api.github.com/users/smarter/received_events","type":"User","site_admin":false},"created_at":"2017-06-23T12:55:36Z","updated_at":"2017-06-23T12:55:36Z","body":"Ok, do let's keep this open until we've done that"}}
{"actor":{"display_login":"smarter"}}