Skip to content

Commit 6b345cc

Browse files
committed
Update validation rule of splice pattern with type args
1 parent 51e645f commit 6b345cc

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala

+5-4
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,11 @@ trait QuotesAndSplices {
190190
val splice1 = typedSplicePattern(splice, ProtoTypes.PolyProto(typedArgs, defn.FunctionOf(argTypes, pt)))
191191
val typedTypeApply = untpd.cpy.TypeApply(typeApplyTree)(splice1.select(nme.apply), typedTypeargs)
192192
untpd.cpy.Apply(tree)(typedTypeApply, typedArgs).withType(pt)
193-
else // $x(...) higher-order quasipattern
194-
// TODO-18271: Case for highr-order quasi-quote pattern with type params
195-
if typeargs.isEmpty || args.isEmpty then
196-
report.error("Missing arguments for open pattern", tree.srcPos)
193+
else // $x[...](...) higher-order quasipattern
194+
// Empty args is allowed
195+
if typeargs.isEmpty then
196+
// TODO-18271: Better error message
197+
report.error("Missing type arguments for open pattern", tree.srcPos)
197198
typedSplicePattern(untpd.cpy.SplicePattern(tree)(splice.body, typeargs, args), pt)
198199
}
199200

0 commit comments

Comments
 (0)