You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
java.lang.Exception: Expected an expression. This is a partially applied Term. Try eta-expanding the term first.
Details
C:\Dev\surface-option-bug\src\main\scala\Main.scala:7:15
Exception occurred while executing macro expansion.
java.lang.Exception: Expected an expression. This is a partially applied Term. Try eta-expanding the term first.
at scala.quoted.runtime.impl.QuotesImpl$reflect$TreeMethods$.asExpr(QuotesImpl.scala:110)
at scala.quoted.runtime.impl.QuotesImpl$reflect$TreeMethods$.asExprOf(QuotesImpl.scala:116)
at scala.quoted.runtime.impl.QuotesImpl$reflect$TreeMethods$.asExprOf(QuotesImpl.scala:115)
at wvlet.airframe.surface.CompileTimeSurfaceFactory.$anonfun$37(CompileTimeSurfaceFactory.scala:662)
at wvlet.airframe.surface.CompileTimeSurfaceFactory.$anonfun$adapted$6(CompileTimeSurfaceFactory.scala:662)
at dotty.tools.dotc.quoted.PickledQuotes$$anon$1.transform(PickledQuotes.scala:110)
at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1538)
at dotty.tools.dotc.quoted.PickledQuotes$$anon$1.transform(PickledQuotes.scala:135)
at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform$$anonfun$1(Trees.scala:1605)
at scala.collection.immutable.List.mapConserve(List.scala:472)
at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1605)
at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1504)
at dotty.tools.dotc.quoted.PickledQuotes$$anon$1.transform(PickledQuotes.scala:135)
at dotty.tools.dotc.quoted.PickledQuotes$.spliceTerms(PickledQuotes.scala:152)
at dotty.tools.dotc.quoted.PickledQuotes$.unpickleTerm(PickledQuotes.scala:88)
at scala.quoted.runtime.impl.QuotesImpl.unpickleExprV2(QuotesImpl.scala:3143)
at wvlet.airframe.surface.CompileTimeSurfaceFactory.$anonfun$36(CompileTimeSurfaceFactory.scala:662)
at scala.collection.Iterator$$anon$9.next(Iterator.scala:584)
at scala.collection.immutable.List.prependedAll(List.scala:153)
at scala.collection.immutable.List$.from(List.scala:684)
at scala.collection.immutable.List$.from(List.scala:681)
at scala.collection.IterableOps$WithFilter.map(Iterable.scala:898)
at wvlet.airframe.surface.CompileTimeSurfaceFactory.wvlet$airframe$surface$CompileTimeSurfaceFactory$$methodParametersOf(CompileTimeSurfaceFactory.scala:747)
at wvlet.airframe.surface.CompileTimeSurfaceFactory.wvlet$airframe$surface$CompileTimeSurfaceFactory$$constructorParametersOf(CompileTimeSurfaceFactory.scala:632)
at wvlet.airframe.surface.CompileTimeSurfaceFactory$$anon$12.applyOrElse(CompileTimeSurfaceFactory.scala:327)
at scala.PartialFunction$AndThen.applyOrElse(PartialFunction.scala:288)
at scala.PartialFunction$OrElse.apply(PartialFunction.scala:266)
at scala.PartialFunction$AndThen.applyOrElse(PartialFunction.scala:289)
at scala.PartialFunction$OrElse.apply(PartialFunction.scala:266)
at scala.PartialFunction$AndThen.applyOrElse(PartialFunction.scala:289)
at scala.PartialFunction$OrElse.apply(PartialFunction.scala:266)
at scala.PartialFunction$AndThen.applyOrElse(PartialFunction.scala:289)
at scala.PartialFunction$OrElse.apply(PartialFunction.scala:266)
at scala.PartialFunction$AndThen.applyOrElse(PartialFunction.scala:289)
at scala.PartialFunction$OrElse.apply(PartialFunction.scala:266)
at scala.PartialFunction$AndThen.applyOrElse(PartialFunction.scala:289)
at scala.PartialFunction$OrElse.apply(PartialFunction.scala:266)
at scala.PartialFunction$AndThen.applyOrElse(PartialFunction.scala:289)
at scala.PartialFunction$OrElse.apply(PartialFunction.scala:266)
at scala.PartialFunction$AndThen.applyOrElse(PartialFunction.scala:289)
at scala.PartialFunction$OrElse.apply(PartialFunction.scala:266)
at scala.PartialFunction$AndThen.applyOrElse(PartialFunction.scala:289)
at scala.PartialFunction$OrElse.apply(PartialFunction.scala:266)
at scala.PartialFunction$AndThen.applyOrElse(PartialFunction.scala:289)
at scala.PartialFunction$OrElse.apply(PartialFunction.scala:266)
at scala.PartialFunction$AndThen.applyOrElse(PartialFunction.scala:289)
at scala.PartialFunction$OrElse.apply(PartialFunction.scala:266)
at scala.PartialFunction$AndThen.applyOrElse(PartialFunction.scala:289)
at scala.PartialFunction$OrElse.apply(PartialFunction.scala:266)
at wvlet.airframe.surface.CompileTimeSurfaceFactory.wvlet$airframe$surface$CompileTimeSurfaceFactory$$surfaceOf(CompileTimeSurfaceFactory.scala:138)
at wvlet.airframe.surface.CompileTimeSurfaceFactory.surfaceOf(CompileTimeSurfaceFactory.scala:78)
at wvlet.airframe.surface.CompileTimeSurfaceFactory$.surfaceOf(CompileTimeSurfaceFactory.scala:15)
Following code compiles and runs fine with Scala 2.13.12, but causes compile-time exception with Scala 3.3.1 and 3.4.0-RC3:
Tested with
The error is:
Details
C:\Dev\surface-option-bug\src\main\scala\Main.scala:7:15 Exception occurred while executing macro expansion. java.lang.Exception: Expected an expression. This is a partially applied Term. Try eta-expanding the term first. at scala.quoted.runtime.impl.QuotesImpl$reflect$TreeMethods$.asExpr(QuotesImpl.scala:110) at scala.quoted.runtime.impl.QuotesImpl$reflect$TreeMethods$.asExprOf(QuotesImpl.scala:116) at scala.quoted.runtime.impl.QuotesImpl$reflect$TreeMethods$.asExprOf(QuotesImpl.scala:115) at wvlet.airframe.surface.CompileTimeSurfaceFactory.$anonfun$37(CompileTimeSurfaceFactory.scala:662) at wvlet.airframe.surface.CompileTimeSurfaceFactory.$anonfun$adapted$6(CompileTimeSurfaceFactory.scala:662) at dotty.tools.dotc.quoted.PickledQuotes$$anon$1.transform(PickledQuotes.scala:110) at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1538) at dotty.tools.dotc.quoted.PickledQuotes$$anon$1.transform(PickledQuotes.scala:135) at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform$$anonfun$1(Trees.scala:1605) at scala.collection.immutable.List.mapConserve(List.scala:472) at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1605) at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1504) at dotty.tools.dotc.quoted.PickledQuotes$$anon$1.transform(PickledQuotes.scala:135) at dotty.tools.dotc.quoted.PickledQuotes$.spliceTerms(PickledQuotes.scala:152) at dotty.tools.dotc.quoted.PickledQuotes$.unpickleTerm(PickledQuotes.scala:88) at scala.quoted.runtime.impl.QuotesImpl.unpickleExprV2(QuotesImpl.scala:3143) at wvlet.airframe.surface.CompileTimeSurfaceFactory.$anonfun$36(CompileTimeSurfaceFactory.scala:662) at scala.collection.Iterator$$anon$9.next(Iterator.scala:584) at scala.collection.immutable.List.prependedAll(List.scala:153) at scala.collection.immutable.List$.from(List.scala:684) at scala.collection.immutable.List$.from(List.scala:681) at scala.collection.IterableOps$WithFilter.map(Iterable.scala:898) at wvlet.airframe.surface.CompileTimeSurfaceFactory.wvlet$airframe$surface$CompileTimeSurfaceFactory$$methodParametersOf(CompileTimeSurfaceFactory.scala:747) at wvlet.airframe.surface.CompileTimeSurfaceFactory.wvlet$airframe$surface$CompileTimeSurfaceFactory$$constructorParametersOf(CompileTimeSurfaceFactory.scala:632) at wvlet.airframe.surface.CompileTimeSurfaceFactory$$anon$12.applyOrElse(CompileTimeSurfaceFactory.scala:327) at scala.PartialFunction$AndThen.applyOrElse(PartialFunction.scala:288) at scala.PartialFunction$OrElse.apply(PartialFunction.scala:266) at scala.PartialFunction$AndThen.applyOrElse(PartialFunction.scala:289) at scala.PartialFunction$OrElse.apply(PartialFunction.scala:266) at scala.PartialFunction$AndThen.applyOrElse(PartialFunction.scala:289) at scala.PartialFunction$OrElse.apply(PartialFunction.scala:266) at scala.PartialFunction$AndThen.applyOrElse(PartialFunction.scala:289) at scala.PartialFunction$OrElse.apply(PartialFunction.scala:266) at scala.PartialFunction$AndThen.applyOrElse(PartialFunction.scala:289) at scala.PartialFunction$OrElse.apply(PartialFunction.scala:266) at scala.PartialFunction$AndThen.applyOrElse(PartialFunction.scala:289) at scala.PartialFunction$OrElse.apply(PartialFunction.scala:266) at scala.PartialFunction$AndThen.applyOrElse(PartialFunction.scala:289) at scala.PartialFunction$OrElse.apply(PartialFunction.scala:266) at scala.PartialFunction$AndThen.applyOrElse(PartialFunction.scala:289) at scala.PartialFunction$OrElse.apply(PartialFunction.scala:266) at scala.PartialFunction$AndThen.applyOrElse(PartialFunction.scala:289) at scala.PartialFunction$OrElse.apply(PartialFunction.scala:266) at scala.PartialFunction$AndThen.applyOrElse(PartialFunction.scala:289) at scala.PartialFunction$OrElse.apply(PartialFunction.scala:266) at scala.PartialFunction$AndThen.applyOrElse(PartialFunction.scala:289) at scala.PartialFunction$OrElse.apply(PartialFunction.scala:266) at scala.PartialFunction$AndThen.applyOrElse(PartialFunction.scala:289) at scala.PartialFunction$OrElse.apply(PartialFunction.scala:266) at wvlet.airframe.surface.CompileTimeSurfaceFactory.wvlet$airframe$surface$CompileTimeSurfaceFactory$$surfaceOf(CompileTimeSurfaceFactory.scala:138) at wvlet.airframe.surface.CompileTimeSurfaceFactory.surfaceOf(CompileTimeSurfaceFactory.scala:78) at wvlet.airframe.surface.CompileTimeSurfaceFactory$.surfaceOf(CompileTimeSurfaceFactory.scala:15)
Scastie repro:
https://scastie.scala-lang.org/5ohvZnwMSX6k2hZvo8el7Q
The text was updated successfully, but these errors were encountered: