File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
compiler/src/dotty/tools/dotc/ast Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -45,19 +45,21 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
4545 def Apply (fn : Tree , args : List [Tree ])(using Context ): Apply = fn match
4646 case Block (Nil , expr) =>
4747 Apply (expr, args)
48- case _ : RefTree | _ : GenericApply | _ : Inlined | _ : Hole =>
49- ta.assignType(untpd.Apply (fn, args), fn, args)
5048 case _ =>
51- assert(ctx.reporter.errorsReported)
49+ assert(
50+ fn.isInstanceOf [RefTree | GenericApply | Inlined | Hole ] || ctx.reporter.errorsReported,
51+ s " Illegal Apply function prefix: $fn"
52+ )
5253 ta.assignType(untpd.Apply (fn, args), fn, args)
5354
5455 def TypeApply (fn : Tree , args : List [Tree ])(using Context ): TypeApply = fn match
5556 case Block (Nil , expr) =>
5657 TypeApply (expr, args)
57- case _ : RefTree | _ : GenericApply =>
58- ta.assignType(untpd.TypeApply (fn, args), fn, args)
5958 case _ =>
60- assert(ctx.reporter.errorsReported)
59+ assert(
60+ fn.isInstanceOf [RefTree | GenericApply ] || ctx.reporter.errorsReported,
61+ s " Illegal TypeApply function prefix: $fn"
62+ )
6163 ta.assignType(untpd.TypeApply (fn, args), fn, args)
6264
6365 def Literal (const : Constant )(using Context ): Literal =
You can’t perform that action at this time.
0 commit comments