File tree Expand file tree Collapse file tree 4 files changed +7
-4
lines changed Expand file tree Collapse file tree 4 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 3
3
|^^^^^^
4
4
|Failed to evaluate macro annotation '@crash'.
5
5
| Caused by class scala.NotImplementedError: an implementation is missing
6
- | scala.Predef$.$qmark$qmark$qmark(Predef.scala:400 )
6
+ | scala.Predef$.$qmark$qmark$qmark(Predef.scala:401 )
7
7
| crash.transform(Macro_1.scala:7)
Original file line number Diff line number Diff line change 3
3
| ^^^^^^^^^^^^^^^^^^
4
4
| Exception occurred while executing macro expansion.
5
5
| java.lang.IllegalArgumentException: requirement failed: value of StringConstant cannot be `null`
6
- | at scala.Predef$.require(Predef.scala:393 )
6
+ | at scala.Predef$.require(Predef.scala:394 )
7
7
| at scala.quoted.runtime.impl.QuotesImpl$reflect$StringConstant$.apply(QuotesImpl.scala:2542)
8
8
| at scala.quoted.runtime.impl.QuotesImpl$reflect$StringConstant$.apply(QuotesImpl.scala:2541)
9
9
| at scala.quoted.ToExpr$StringToExpr.apply(ToExpr.scala:82)
Original file line number Diff line number Diff line change @@ -85,6 +85,9 @@ val experimentalDefinitionInLibrary = Set(
85
85
" scala.quoted.Quotes.reflectModule.RenameSelectorModule.apply" ,
86
86
" scala.quoted.Quotes.reflectModule.SimpleSelectorModule.apply" ,
87
87
88
+ // New feature: fromNullable for explicit nulls
89
+ " scala.Predef$.fromNullable" ,
90
+
88
91
// New feature: modularity
89
92
" scala.Precise" ,
90
93
" scala.annotation.internal.WitnessNames" ,
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ object Example:
28
28
import scala .quoted .*
29
29
given OptionFromExpr [T ](using Type [T ], FromExpr [T ]): FromExpr [Option [T ]] with
30
30
def unapply (x : Expr [Option [T ]])(using Quotes ) = x match
31
- case ' { Option [T ]($ {Expr (y)}) } => Some (Option (y))
31
+ case ' { Option [T ]($ {Expr (y)}: T ) } => Some (Option (y))
32
32
case ' { None } => Some (None )
33
33
case ' { $ {Expr (opt)} : Some [T ] } => Some (opt)
34
34
case _ => None
@@ -37,7 +37,7 @@ object ExampleWithoutWith:
37
37
import scala .quoted .*
38
38
given [T ] => (Type [T ], FromExpr [T ]) => FromExpr [Option [T ]]:
39
39
def unapply (x : Expr [Option [T ]])(using Quotes ) = x match
40
- case ' { Option [T ]($ {Expr (y)}) } => Some (Option (y))
40
+ case ' { Option [T ]($ {Expr (y)}: T ) } => Some (Option (y))
41
41
case ' { None } => Some (None )
42
42
case ' { $ {Expr (opt)} : Some [T ] } => Some (opt)
43
43
case _ => None
You can’t perform that action at this time.
0 commit comments