Skip to content

Commit 988087c

Browse files
committed
Update validation rule of splice pattern with type args
1 parent bf9063f commit 988087c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

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

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

0 commit comments

Comments
 (0)