@@ -41,15 +41,17 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
4141 def Super (qual : Tree , mixName : TypeName , mixinClass : Symbol = NoSymbol )(using Context ): Super =
4242 Super (qual, if (mixName.isEmpty) untpd.EmptyTypeIdent else untpd.Ident (mixName), mixinClass)
4343
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)
5355
5456 def Literal (const : Constant )(using Context ): Literal =
5557 ta.assignType(untpd.Literal (const))
0 commit comments