@@ -40,11 +40,15 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
4040 def Super (qual : Tree , mixName : TypeName , inConstrCall : Boolean , mixinClass : Symbol = NoSymbol )(implicit ctx : Context ): Super =
4141 Super (qual, if (mixName.isEmpty) untpd.EmptyTypeIdent else untpd.Ident (mixName), inConstrCall, mixinClass)
4242
43- def Apply (fn : Tree , args : List [Tree ])(implicit ctx : Context ): Apply =
43+ def Apply (fn : Tree , args : List [Tree ])(implicit ctx : Context ): Apply = {
44+ assert(fn.isInstanceOf [RefTree ] || fn.isInstanceOf [GenericApply [_]])
4445 ta.assignType(untpd.Apply (fn, args), fn, args)
46+ }
4547
46- def TypeApply (fn : Tree , args : List [Tree ])(implicit ctx : Context ): TypeApply =
48+ def TypeApply (fn : Tree , args : List [Tree ])(implicit ctx : Context ): TypeApply = {
49+ assert(fn.isInstanceOf [RefTree ] || fn.isInstanceOf [GenericApply [_]])
4750 ta.assignType(untpd.TypeApply (fn, args), fn, args)
51+ }
4852
4953 def Literal (const : Constant )(implicit ctx : Context ): Literal =
5054 ta.assignType(untpd.Literal (const))
@@ -181,8 +185,10 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
181185 def Alternative (trees : List [Tree ])(implicit ctx : Context ): Alternative =
182186 ta.assignType(untpd.Alternative (trees), trees)
183187
184- def UnApply (fun : Tree , implicits : List [Tree ], patterns : List [Tree ], proto : Type )(implicit ctx : Context ): UnApply =
188+ def UnApply (fun : Tree , implicits : List [Tree ], patterns : List [Tree ], proto : Type )(implicit ctx : Context ): UnApply = {
189+ assert(fun.isInstanceOf [RefTree ] || fun.isInstanceOf [GenericApply [_]])
185190 ta.assignType(untpd.UnApply (fun, implicits, patterns), proto)
191+ }
186192
187193 def ValDef (sym : TermSymbol , rhs : LazyTree = EmptyTree )(implicit ctx : Context ): ValDef =
188194 ta.assignType(untpd.ValDef (sym.name, TypeTree (sym.info), rhs), sym)
0 commit comments