Skip to content

Commit

Permalink
Update validation rule of splice pattern with type args
Browse files Browse the repository at this point in the history
  • Loading branch information
zeptometer committed Jul 24, 2023
1 parent bf9063f commit 988087c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,11 @@ trait QuotesAndSplices {
val splice1 = typedSplicePattern(splice, ProtoTypes.PolyProto(typedArgs, defn.FunctionOf(argTypes, pt)))
val typedTypeApply = untpd.cpy.TypeApply(typeApplyTree)(splice1.select(nme.apply), typedTypeargs)
untpd.cpy.Apply(tree)(typedTypeApply, typedArgs).withType(pt)
else // $x(...) higher-order quasipattern
// TODO-18271: Case for highr-order quasi-quote pattern with type params
if typeargs.isEmpty || args.isEmpty then
report.error("Missing arguments for open pattern", tree.srcPos)
else // $x[...](...) higher-order quasipattern
// Empty args is allowed
if typeargs.isEmpty then
// TODO-18271: Better error message
report.error("Missing type arguments for open pattern", tree.srcPos)
typedSplicePattern(untpd.cpy.SplicePattern(tree)(splice.body, typeargs, args), pt)
}

Expand Down

0 comments on commit 988087c

Please sign in to comment.