File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
compiler/src/dotty/tools/dotc/quoted Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,13 @@ object QuotePatterns:
76
76
new tpd.TreeTraverser {
77
77
override def traverse (tree : tpd.Tree )(using Context ): Unit = tree match {
78
78
case tree : SplicePattern =>
79
- def uncapturedTypeVars (arg : tpd.Tree , capturedTypeVars : List [tpd.Tree ]) =
79
+ def uncapturedTypeVars (arg : tpd.Tree , capturedTypeVars : List [tpd.Tree ]): Set [Type ] =
80
+ /* Sometimes arg is untyped when a splice pattern is ill-formed.
81
+ * Return early in such case.
82
+ * Refer to QuoteAndSplices::typedSplicePattern
83
+ */
84
+ if ! arg.hasType then return Set .empty
85
+
80
86
val capturedTypeVarsSet = capturedTypeVars.map(_.symbol).toSet
81
87
new TypeAccumulator [Set [Type ]] {
82
88
def apply (x : Set [Type ], tp : Type ): Set [Type ] =
You can’t perform that action at this time.
0 commit comments