File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed
compiler/src/dotty/tools/dotc/ast Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -1181,9 +1181,13 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
1181
1181
/** An extractor for typed splices */
1182
1182
object Splice {
1183
1183
def apply (tree : Tree )(implicit ctx : Context ): Tree = {
1184
+ val baseType = tree.tpe.baseType(defn.QuotedExprClass )
1184
1185
val argType =
1185
- if (tree.tpe.widen.isError) tree.tpe.widen
1186
- else tree.tpe.baseType(defn.QuotedExprClass ).argTypesHi.head
1186
+ if (baseType != NoType ) baseType.argTypesHi.head
1187
+ else {
1188
+ assert(ctx.reporter.hasErrors)
1189
+ defn.NothingType
1190
+ }
1187
1191
ref(defn.InternalQuoted_exprSplice ).appliedToType(argType).appliedTo(tree)
1188
1192
}
1189
1193
def unapply (tree : Tree )(implicit ctx : Context ): Option [Tree ] = tree match {
Original file line number Diff line number Diff line change
1
+ import scala .quoted ._
2
+ object Test {
3
+ def impl (receiver : Expr [StringContext ])(implicit reflect : scala.tasty.Reflection ) = {
4
+ import reflect .Repeated
5
+ receiver match {
6
+ case ' { StringContext ($ {Repeated (parts)}: _* ) } => // error
7
+ }
8
+ }
9
+ }
You can’t perform that action at this time.
0 commit comments