Skip to content

Cannot trigger an inline macro from a compiler plugin #7160

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Atry opened this issue Sep 3, 2019 · 3 comments · Fixed by #9984
Closed

Cannot trigger an inline macro from a compiler plugin #7160

Atry opened this issue Sep 3, 2019 · 3 comments · Fixed by #9984

Comments

@Atry
Copy link
Contributor

Atry commented Sep 3, 2019

minimized code

I've created a minimized reproduction at https://github.com/Atry/trigger-inline-macro-from-compiler-plugin

git clone [email protected]:Atry/trigger-inline-macro-from-compiler-plugin.git && cd trigger-inline-macro-from-compiler-plugin && sbt test
Error log
Cloning into 'trigger-inline-macro-from-compiler-plugin'...
remote: Enumerating objects: 24, done.
remote: Counting objects: 100% (24/24), done.
remote: Compressing objects: 100% (16/16), done.
remote: Total 24 (delta 0), reused 21 (delta 0), pack-reused 0
Receiving objects: 100% (24/24), done.
[info] Loading global plugins from /Users/twer/.sbt/1.0/plugins/project
[info] Loading settings for project global-plugins from idea.sbt,mavenResolvers.sbt,metals.sbt ...
[info] Loading global plugins from /Users/twer/.sbt/1.0/plugins
[info] Loading settings for project trigger-inline-macro-from-compiler-plugin-build from local.sbt,plugins.sbt ...
[info] Loading project definition from /private/tmp/trigger-inline-macro-from-compiler-plugin/project
[info] Updating ProjectRef(uri("file:/private/tmp/trigger-inline-macro-from-compiler-plugin/project/"), "trigger-inline-macro-from-compiler-plugin-build")...
[info] Done updating.
[info] Loading settings for project trigger-inline-macro-from-compiler-plugin from build.sbt ...
[info] Set current project to trigger-inline-macro-from-compiler-plugin (in build file:/private/tmp/trigger-inline-macro-from-compiler-plugin/)
[info] Updating ...
[info] Done updating.
[info] Compiling 2 Scala sources to /private/tmp/trigger-inline-macro-from-compiler-plugin/target/scala-0.18/classes ...
[info] Done compiling.
[info] Packaging /private/tmp/trigger-inline-macro-from-compiler-plugin/target/scala-0.18/trigger-inline-macro-from-compiler-plugin_0.18-0.1.0-SNAPSHOT.jar ...
[info] Done packaging.
[info] Compiling 1 Scala source to /private/tmp/trigger-inline-macro-from-compiler-plugin/target/scala-0.18/test-classes ...
java.lang.AssertionError: assertion failed: unexpected top splice outside quote while compiling /private/tmp/trigger-inline-macro-from-compiler-plugin/src/test/scala/mypackage/Main.scala
[info] exception occurred while compiling /private/tmp/trigger-inline-macro-from-compiler-plugin/src/test/scala/mypackage/Main.scala
[error] ## Exception when compiling 1 sources to /private/tmp/trigger-inline-macro-from-compiler-plugin/target/scala-0.18/test-classes
[error] assertion failed: unexpected top splice outside quote
[error] dotty.DottyPredef$.assertFail(DottyPredef.scala:16)
[error] dotty.tools.dotc.transform.ReifyQuotes$QuoteReifier.transformSplice(ReifyQuotes.scala:268)
[error] dotty.tools.dotc.transform.TreeMapWithStages.transform(TreeMapWithStages.scala:99)
[error] dotty.tools.dotc.transform.ReifyQuotes$QuoteReifier.transform(ReifyQuotes.scala:419)
[error] dotty.tools.dotc.transform.ReifyQuotes$QuoteReifier.transform(ReifyQuotes.scala:394)
[error] dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1298)
[error] dotty.tools.dotc.ast.TreeMapWithImplicits.transform(TreeMapWithImplicits.scala:117)
[error] dotty.tools.dotc.transform.TreeMapWithStages.mapOverTree$1(TreeMapWithStages.scala:76)
[error] dotty.tools.dotc.transform.TreeMapWithStages.transform(TreeMapWithStages.scala:126)
[error] dotty.tools.dotc.transform.ReifyQuotes$QuoteReifier.transform(ReifyQuotes.scala:419)
[error] dotty.tools.dotc.ast.TreeMapWithImplicits.transform(TreeMapWithImplicits.scala:97)
[error] dotty.tools.dotc.transform.TreeMapWithStages.mapOverTree$1(TreeMapWithStages.scala:76)
[error] dotty.tools.dotc.transform.TreeMapWithStages.transform(TreeMapWithStages.scala:126)
[error] dotty.tools.dotc.transform.ReifyQuotes$QuoteReifier.transform(ReifyQuotes.scala:419)
[error] dotty.tools.dotc.ast.TreeMapWithImplicits.traverse$1(TreeMapWithImplicits.scala:51)
[error] dotty.tools.dotc.ast.TreeMapWithImplicits.transformStats(TreeMapWithImplicits.scala:58)
[error] dotty.tools.dotc.ast.TreeMapWithImplicits.transform(TreeMapWithImplicits.scala:108)
[error] dotty.tools.dotc.transform.TreeMapWithStages.mapOverTree$1(TreeMapWithStages.scala:76)
[error] dotty.tools.dotc.transform.TreeMapWithStages.transform(TreeMapWithStages.scala:126)
[error] dotty.tools.dotc.transform.ReifyQuotes$QuoteReifier.transform(ReifyQuotes.scala:419)
[error] dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1334)
[error] dotty.tools.dotc.ast.TreeMapWithImplicits.transform(TreeMapWithImplicits.scala:101)
[error] dotty.tools.dotc.transform.TreeMapWithStages.mapOverTree$1(TreeMapWithStages.scala:76)
[error] dotty.tools.dotc.transform.TreeMapWithStages.transform(TreeMapWithStages.scala:126)
[error] dotty.tools.dotc.transform.ReifyQuotes$QuoteReifier.transform(ReifyQuotes.scala:419)
[error] dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform$$anonfun$2(Trees.scala:1354)
[error] scala.collection.immutable.List.mapConserve(List.scala:451)
[error] dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1354)
[error] dotty.tools.dotc.ast.Trees$Instance$TreeMap.transformStats(Trees.scala:1352)
[error] dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1340)
[error] dotty.tools.dotc.ast.TreeMapWithImplicits.transform(TreeMapWithImplicits.scala:101)
[error] dotty.tools.dotc.transform.TreeMapWithStages.mapOverTree$1(TreeMapWithStages.scala:76)
[error] dotty.tools.dotc.transform.TreeMapWithStages.transform(TreeMapWithStages.scala:126)
[error] dotty.tools.dotc.transform.ReifyQuotes$QuoteReifier.transform(ReifyQuotes.scala:419)
[error] dotty.tools.dotc.transform.ReifyQuotes$$anon$1.transform(ReifyQuotes.scala:94)
[error] dotty.tools.dotc.transform.MacroTransform.run(MacroTransform.scala:21)
[error] dotty.tools.dotc.transform.ReifyQuotes.run(ReifyQuotes.scala:89)
[error] dotty.tools.dotc.core.Phases$Phase.runOn$$anonfun$1(Phases.scala:315)
[error] scala.collection.immutable.List.map(List.scala:222)
[error] dotty.tools.dotc.core.Phases$Phase.runOn(Phases.scala:316)
[error] dotty.tools.dotc.Run.runPhases$4$$anonfun$4(Run.scala:159)
[error] dotty.runtime.function.JProcedure1.apply(JProcedure1.java:15)
[error] dotty.runtime.function.JProcedure1.apply(JProcedure1.java:10)
[error] scala.collection.ArrayOps$.foreach$extension(ArrayOps.scala:1350)
[error] dotty.tools.dotc.Run.runPhases$5(Run.scala:169)
[error] dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:177)
[error] dotty.runtime.function.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
[error] dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:67)
[error] dotty.tools.dotc.Run.compileUnits(Run.scala:184)
[error] dotty.tools.dotc.Run.compileSources(Run.scala:121)
[error] dotty.tools.dotc.Run.compile(Run.scala:104)
[error] dotty.tools.dotc.Driver.doCompile(Driver.scala:35)
[error] dotty.tools.dotc.Driver.process(Driver.scala:179)
[error] dotty.tools.dotc.Main.process(Main.scala)
[error] xsbt.CachedCompilerImpl.run(CachedCompilerImpl.java:69)
[error] xsbt.CompilerInterface.run(CompilerInterface.java:41)
[error] sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[error] sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[error] sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[error] java.lang.reflect.Method.invoke(Method.java:498)
[error] sbt.internal.inc.AnalyzingCompiler.call(AnalyzingCompiler.scala:237)
[error] sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:111)
[error] sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:90)
[error] sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$3(MixedAnalyzingCompiler.scala:82)
[error] scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
[error] sbt.internal.inc.MixedAnalyzingCompiler.timed(MixedAnalyzingCompiler.scala:133)
[error] sbt.internal.inc.MixedAnalyzingCompiler.compileScala$1(MixedAnalyzingCompiler.scala:73)
[error] sbt.internal.inc.MixedAnalyzingCompiler.compile(MixedAnalyzingCompiler.scala:116)
[error] sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1(IncrementalCompilerImpl.scala:307)
[error] sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1$adapted(IncrementalCompilerImpl.scala:307)
[error] sbt.internal.inc.Incremental$.doCompile(Incremental.scala:106)
[error] sbt.internal.inc.Incremental$.$anonfun$compile$4(Incremental.scala:87)
[error] sbt.internal.inc.IncrementalCommon.recompileClasses(IncrementalCommon.scala:116)
[error] sbt.internal.inc.IncrementalCommon.cycle(IncrementalCommon.scala:63)
[error] sbt.internal.inc.Incremental$.$anonfun$compile$3(Incremental.scala:89)
[error] sbt.internal.inc.Incremental$.manageClassfiles(Incremental.scala:134)
[error] sbt.internal.inc.Incremental$.compile(Incremental.scala:80)
[error] sbt.internal.inc.IncrementalCompile$.apply(Compile.scala:67)
[error] sbt.internal.inc.IncrementalCompilerImpl.compileInternal(IncrementalCompilerImpl.scala:311)
[error] sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileIncrementally$1(IncrementalCompilerImpl.scala:269)
[error] sbt.internal.inc.IncrementalCompilerImpl.handleCompilationError(IncrementalCompilerImpl.scala:159)
[error] sbt.internal.inc.IncrementalCompilerImpl.compileIncrementally(IncrementalCompilerImpl.scala:238)
[error] sbt.internal.inc.IncrementalCompilerImpl.compile(IncrementalCompilerImpl.scala:69)
[error] sbt.Defaults$.compileIncrementalTaskImpl(Defaults.scala:1549)
[error] sbt.Defaults$.$anonfun$compileIncrementalTask$1(Defaults.scala:1523)
[error] scala.Function1.$anonfun$compose$1(Function1.scala:44)
[error] sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:40)
[error] sbt.std.Transform$$anon$4.work(System.scala:67)
[error] sbt.Execute.$anonfun$submit$2(Execute.scala:269)
[error] sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error] sbt.Execute.work(Execute.scala:278)
[error] sbt.Execute.$anonfun$submit$1(Execute.scala:269)
[error] sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178)
[error] sbt.CompletionService$$anon$2.call(CompletionService.scala:37)
[error] java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error] java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error] java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error] java.lang.Thread.run(Thread.java:748)
[error]            
[error] java.lang.AssertionError: assertion failed: unexpected top splice outside quote
[error] 	at dotty.DottyPredef$.assertFail(DottyPredef.scala:16)
[error] 	at dotty.tools.dotc.transform.ReifyQuotes$QuoteReifier.transformSplice(ReifyQuotes.scala:268)
[error] 	at dotty.tools.dotc.transform.TreeMapWithStages.transform(TreeMapWithStages.scala:99)
[error] 	at dotty.tools.dotc.transform.ReifyQuotes$QuoteReifier.transform(ReifyQuotes.scala:419)
[error] 	at dotty.tools.dotc.transform.ReifyQuotes$QuoteReifier.transform(ReifyQuotes.scala:394)
[error] 	at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1298)
[error] 	at dotty.tools.dotc.ast.TreeMapWithImplicits.transform(TreeMapWithImplicits.scala:117)
[error] 	at dotty.tools.dotc.transform.TreeMapWithStages.mapOverTree$1(TreeMapWithStages.scala:76)
[error] 	at dotty.tools.dotc.transform.TreeMapWithStages.transform(TreeMapWithStages.scala:126)
[error] 	at dotty.tools.dotc.transform.ReifyQuotes$QuoteReifier.transform(ReifyQuotes.scala:419)
[error] 	at dotty.tools.dotc.ast.TreeMapWithImplicits.transform(TreeMapWithImplicits.scala:97)
[error] 	at dotty.tools.dotc.transform.TreeMapWithStages.mapOverTree$1(TreeMapWithStages.scala:76)
[error] 	at dotty.tools.dotc.transform.TreeMapWithStages.transform(TreeMapWithStages.scala:126)
[error] 	at dotty.tools.dotc.transform.ReifyQuotes$QuoteReifier.transform(ReifyQuotes.scala:419)
[error] 	at dotty.tools.dotc.ast.TreeMapWithImplicits.traverse$1(TreeMapWithImplicits.scala:51)
[error] 	at dotty.tools.dotc.ast.TreeMapWithImplicits.transformStats(TreeMapWithImplicits.scala:58)
[error] 	at dotty.tools.dotc.ast.TreeMapWithImplicits.transform(TreeMapWithImplicits.scala:108)
[error] 	at dotty.tools.dotc.transform.TreeMapWithStages.mapOverTree$1(TreeMapWithStages.scala:76)
[error] 	at dotty.tools.dotc.transform.TreeMapWithStages.transform(TreeMapWithStages.scala:126)
[error] 	at dotty.tools.dotc.transform.ReifyQuotes$QuoteReifier.transform(ReifyQuotes.scala:419)
[error] 	at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1334)
[error] 	at dotty.tools.dotc.ast.TreeMapWithImplicits.transform(TreeMapWithImplicits.scala:101)
[error] 	at dotty.tools.dotc.transform.TreeMapWithStages.mapOverTree$1(TreeMapWithStages.scala:76)
[error] 	at dotty.tools.dotc.transform.TreeMapWithStages.transform(TreeMapWithStages.scala:126)
[error] 	at dotty.tools.dotc.transform.ReifyQuotes$QuoteReifier.transform(ReifyQuotes.scala:419)
[error] 	at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform$$anonfun$2(Trees.scala:1354)
[error] 	at scala.collection.immutable.List.mapConserve(List.scala:451)
[error] 	at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1354)
[error] 	at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transformStats(Trees.scala:1352)
[error] 	at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1340)
[error] 	at dotty.tools.dotc.ast.TreeMapWithImplicits.transform(TreeMapWithImplicits.scala:101)
[error] 	at dotty.tools.dotc.transform.TreeMapWithStages.mapOverTree$1(TreeMapWithStages.scala:76)
[error] 	at dotty.tools.dotc.transform.TreeMapWithStages.transform(TreeMapWithStages.scala:126)
[error] 	at dotty.tools.dotc.transform.ReifyQuotes$QuoteReifier.transform(ReifyQuotes.scala:419)
[error] 	at dotty.tools.dotc.transform.ReifyQuotes$$anon$1.transform(ReifyQuotes.scala:94)
[error] 	at dotty.tools.dotc.transform.MacroTransform.run(MacroTransform.scala:21)
[error] 	at dotty.tools.dotc.transform.ReifyQuotes.run(ReifyQuotes.scala:89)
[error] 	at dotty.tools.dotc.core.Phases$Phase.runOn$$anonfun$1(Phases.scala:315)
[error] 	at scala.collection.immutable.List.map(List.scala:222)
[error] 	at dotty.tools.dotc.core.Phases$Phase.runOn(Phases.scala:316)
[error] 	at dotty.tools.dotc.Run.runPhases$4$$anonfun$4(Run.scala:159)
[error] 	at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:15)
[error] 	at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:10)
[error] 	at scala.collection.ArrayOps$.foreach$extension(ArrayOps.scala:1350)
[error] 	at dotty.tools.dotc.Run.runPhases$5(Run.scala:169)
[error] 	at dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:177)
[error] 	at dotty.runtime.function.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
[error] 	at dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:67)
[error] 	at dotty.tools.dotc.Run.compileUnits(Run.scala:184)
[error] 	at dotty.tools.dotc.Run.compileSources(Run.scala:121)
[error] 	at dotty.tools.dotc.Run.compile(Run.scala:104)
[error] 	at dotty.tools.dotc.Driver.doCompile(Driver.scala:35)
[error] 	at dotty.tools.dotc.Driver.process(Driver.scala:179)
[error] 	at dotty.tools.dotc.Main.process(Main.scala)
[error] 	at xsbt.CachedCompilerImpl.run(CachedCompilerImpl.java:69)
[error] 	at xsbt.CompilerInterface.run(CompilerInterface.java:41)
[error] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[error] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[error] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[error] 	at java.lang.reflect.Method.invoke(Method.java:498)
[error] 	at sbt.internal.inc.AnalyzingCompiler.call(AnalyzingCompiler.scala:237)
[error] 	at sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:111)
[error] 	at sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:90)
[error] 	at sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$3(MixedAnalyzingCompiler.scala:82)
[error] 	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
[error] 	at sbt.internal.inc.MixedAnalyzingCompiler.timed(MixedAnalyzingCompiler.scala:133)
[error] 	at sbt.internal.inc.MixedAnalyzingCompiler.compileScala$1(MixedAnalyzingCompiler.scala:73)
[error] 	at sbt.internal.inc.MixedAnalyzingCompiler.compile(MixedAnalyzingCompiler.scala:116)
[error] 	at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1(IncrementalCompilerImpl.scala:307)
[error] 	at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1$adapted(IncrementalCompilerImpl.scala:307)
[error] 	at sbt.internal.inc.Incremental$.doCompile(Incremental.scala:106)
[error] 	at sbt.internal.inc.Incremental$.$anonfun$compile$4(Incremental.scala:87)
[error] 	at sbt.internal.inc.IncrementalCommon.recompileClasses(IncrementalCommon.scala:116)
[error] 	at sbt.internal.inc.IncrementalCommon.cycle(IncrementalCommon.scala:63)
[error] 	at sbt.internal.inc.Incremental$.$anonfun$compile$3(Incremental.scala:89)
[error] 	at sbt.internal.inc.Incremental$.manageClassfiles(Incremental.scala:134)
[error] 	at sbt.internal.inc.Incremental$.compile(Incremental.scala:80)
[error] 	at sbt.internal.inc.IncrementalCompile$.apply(Compile.scala:67)
[error] 	at sbt.internal.inc.IncrementalCompilerImpl.compileInternal(IncrementalCompilerImpl.scala:311)
[error] 	at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileIncrementally$1(IncrementalCompilerImpl.scala:269)
[error] 	at sbt.internal.inc.IncrementalCompilerImpl.handleCompilationError(IncrementalCompilerImpl.scala:159)
[error] 	at sbt.internal.inc.IncrementalCompilerImpl.compileIncrementally(IncrementalCompilerImpl.scala:238)
[error] 	at sbt.internal.inc.IncrementalCompilerImpl.compile(IncrementalCompilerImpl.scala:69)
[error] 	at sbt.Defaults$.compileIncrementalTaskImpl(Defaults.scala:1549)
[error] 	at sbt.Defaults$.$anonfun$compileIncrementalTask$1(Defaults.scala:1523)
[error] 	at scala.Function1.$anonfun$compose$1(Function1.scala:44)
[error] 	at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:40)
[error] 	at sbt.std.Transform$$anon$4.work(System.scala:67)
[error] 	at sbt.Execute.$anonfun$submit$2(Execute.scala:269)
[error] 	at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error] 	at sbt.Execute.work(Execute.scala:278)
[error] 	at sbt.Execute.$anonfun$submit$1(Execute.scala:269)
[error] 	at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178)
[error] 	at sbt.CompletionService$$anon$2.call(CompletionService.scala:37)
[error] 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error] 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error] 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error] 	at java.lang.Thread.run(Thread.java:748)
[error] (Test / compileIncremental) java.lang.AssertionError: assertion failed: unexpected top splice outside quote
[error] Total time: 5 s, completed 2019-9-2 23:45:38
@nicolasstucki
Copy link
Contributor

This is partly by design. Macro expansion occurs in Typer to be able to refine types of whitebox inlines. While plugins can only execute after Typer to only transform well-typed trees. Your case seems to just use the combination of typing interaction we are trying to avoid.

We have discussed the possibility of expanding blackbox macros after Typer (possibly between Pickler and ReifyQuotes). This might help to support this kind of use cases. We could also imagine expanding whitebox macros at the same time (if inserted by plugins) but treat them as blackbox. The plugin could in such a case add explicitly some casts to recover some precise type of expanded expression, though this would be fragile.

@nicolasstucki nicolasstucki removed their assignment Sep 4, 2019
@Atry
Copy link
Contributor Author

Atry commented Sep 5, 2019

Even blackbox macros are definitely helpful. Unfortunately it still crashes when I switch to blackbox macros: Atry/trigger-inline-macro-from-compiler-plugin@109595b

Error log: https://travis-ci.org/Atry/trigger-inline-macro-from-compiler-plugin/builds/581069366

@nicolasstucki
Copy link
Contributor

Yes. To support them we would need to do a major change in the internal logic of the compiler.

@nicolasstucki nicolasstucki linked a pull request Jan 7, 2021 that will close this issue
@Kordyjan Kordyjan added this to the 3.0.0 milestone Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants