@@ -41,15 +41,17 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
41
41
def Super (qual : Tree , mixName : TypeName , mixinClass : Symbol = NoSymbol )(using Context ): Super =
42
42
Super (qual, if (mixName.isEmpty) untpd.EmptyTypeIdent else untpd.Ident (mixName), mixinClass)
43
43
44
- def Apply (fn : Tree , args : List [Tree ])(using Context ): Apply = {
45
- assert(fn.isInstanceOf [RefTree ] || fn.isInstanceOf [GenericApply ] || fn.isInstanceOf [Inlined ] || fn.isInstanceOf [tasty.TreePickler .Hole ])
46
- ta.assignType(untpd.Apply (fn, args), fn, args)
47
- }
48
-
49
- def TypeApply (fn : Tree , args : List [Tree ])(using Context ): TypeApply = {
50
- assert(fn.isInstanceOf [RefTree ] || fn.isInstanceOf [GenericApply ])
51
- ta.assignType(untpd.TypeApply (fn, args), fn, args)
52
- }
44
+ def Apply (fn : Tree , args : List [Tree ])(using Context ): Apply = fn match
45
+ case Block (Nil , expr) =>
46
+ Apply (expr, args)
47
+ case _ : RefTree | _ : GenericApply | _ : Inlined | _ : tasty.TreePickler .Hole =>
48
+ ta.assignType(untpd.Apply (fn, args), fn, args)
49
+
50
+ def TypeApply (fn : Tree , args : List [Tree ])(using Context ): TypeApply = fn match
51
+ case Block (Nil , expr) =>
52
+ TypeApply (expr, args)
53
+ case _ : RefTree | _ : GenericApply =>
54
+ ta.assignType(untpd.TypeApply (fn, args), fn, args)
53
55
54
56
def Literal (const : Constant )(using Context ): Literal =
55
57
ta.assignType(untpd.Literal (const))
0 commit comments