File tree 1 file changed +8
-6
lines changed
compiler/src/dotty/tools/dotc/ast
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 {
45
45
def Apply (fn : Tree , args : List [Tree ])(using Context ): Apply = fn match
46
46
case Block (Nil , expr) =>
47
47
Apply (expr, args)
48
- case _ : RefTree | _ : GenericApply | _ : Inlined | _ : Hole =>
49
- ta.assignType(untpd.Apply (fn, args), fn, args)
50
48
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
+ )
52
53
ta.assignType(untpd.Apply (fn, args), fn, args)
53
54
54
55
def TypeApply (fn : Tree , args : List [Tree ])(using Context ): TypeApply = fn match
55
56
case Block (Nil , expr) =>
56
57
TypeApply (expr, args)
57
- case _ : RefTree | _ : GenericApply =>
58
- ta.assignType(untpd.TypeApply (fn, args), fn, args)
59
58
case _ =>
60
- assert(ctx.reporter.errorsReported)
59
+ assert(
60
+ fn.isInstanceOf [RefTree | GenericApply ] || ctx.reporter.errorsReported,
61
+ s " Illegal TypeApply function prefix: $fn"
62
+ )
61
63
ta.assignType(untpd.TypeApply (fn, args), fn, args)
62
64
63
65
def Literal (const : Constant )(using Context ): Literal =
You can’t perform that action at this time.
0 commit comments