File tree Expand file tree Collapse file tree 2 files changed +14
-8
lines changed
compiler/src/dotty/tools/dotc/ast
library/src/scala/internal/quoted Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -1234,12 +1234,15 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
1234
1234
override def inlineContext (call : Tree )(implicit ctx : Context ): Context = {
1235
1235
// We assume enclosingInlineds is already normalized, and only process the new call with the head.
1236
1236
val oldIC = enclosingInlineds
1237
- val newIC = (call, oldIC) match {
1238
- case (t, t1 :: ts2) if t.isEmpty =>
1239
- assert(! t1.isEmpty)
1240
- ts2
1241
- case _ => call :: oldIC
1242
- }
1237
+
1238
+ val newIC =
1239
+ if call.isEmpty then
1240
+ oldIC match
1241
+ case t1 :: ts2 => ts2
1242
+ case _ => oldIC
1243
+ else
1244
+ call :: oldIC
1245
+
1243
1246
ctx.fresh.setProperty(InlinedCalls , newIC)
1244
1247
}
1245
1248
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ private[quoted] object Matcher {
33
33
if (hasTypeSplices) {
34
34
val ctx : Context = internal.Context_GADT_setFreshGADTBounds (rootContext)
35
35
given Context = ctx
36
- val matchings = scrutineeTerm.underlyingArgument =?= patternTerm.underlyingArgument
36
+ val matchings = scrutineeTerm =?= patternTerm
37
37
// After matching and doing all subtype checks, we have to approximate all the type bindings
38
38
// that we have found and seal them in a quoted.Type
39
39
matchings.asOptionOfTuple.map { tup =>
@@ -44,7 +44,7 @@ private[quoted] object Matcher {
44
44
}
45
45
}
46
46
else {
47
- scrutineeTerm.underlyingArgument =?= patternTerm.underlyingArgument
47
+ scrutineeTerm =?= patternTerm
48
48
}
49
49
}
50
50
@@ -286,6 +286,9 @@ private[quoted] object Matcher {
286
286
case (_, Annotated (tpt, _)) =>
287
287
scrutinee =?= tpt
288
288
289
+ case (NamedArg (name1, arg1), NamedArg (name2, arg2)) if name1 == name2 =>
290
+ arg1 =?= arg2
291
+
289
292
// No Match
290
293
case _ =>
291
294
if (debug)
You can’t perform that action at this time.
0 commit comments