@@ -40,11 +40,15 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
40
40
def Super (qual : Tree , mixName : TypeName , inConstrCall : Boolean , mixinClass : Symbol = NoSymbol )(implicit ctx : Context ): Super =
41
41
Super (qual, if (mixName.isEmpty) untpd.EmptyTypeIdent else untpd.Ident (mixName), inConstrCall, mixinClass)
42
42
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 [_]])
44
45
ta.assignType(untpd.Apply (fn, args), fn, args)
46
+ }
45
47
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 [_]])
47
50
ta.assignType(untpd.TypeApply (fn, args), fn, args)
51
+ }
48
52
49
53
def Literal (const : Constant )(implicit ctx : Context ): Literal =
50
54
ta.assignType(untpd.Literal (const))
@@ -181,8 +185,10 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
181
185
def Alternative (trees : List [Tree ])(implicit ctx : Context ): Alternative =
182
186
ta.assignType(untpd.Alternative (trees), trees)
183
187
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 [_]])
185
190
ta.assignType(untpd.UnApply (fun, implicits, patterns), proto)
191
+ }
186
192
187
193
def ValDef (sym : TermSymbol , rhs : LazyTree = EmptyTree )(implicit ctx : Context ): ValDef =
188
194
ta.assignType(untpd.ValDef (sym.name, TypeTree (sym.info), rhs), sym)
0 commit comments