@@ -944,28 +944,27 @@ class Namer { typer: Typer =>
944
944
private var nestedCtx : Context = null
945
945
assert(! original.isClassDef)
946
946
947
- override def completerTypeParams (sym : Symbol )(implicit ctx : Context ): List [TypeSymbol ] = {
948
- if ( myTypeParams == null ) {
947
+ override def completerTypeParams (sym : Symbol )(implicit ctx : Context ): List [TypeSymbol ] =
948
+ if myTypeParams == null then
949
949
// println(i"completing type params of $sym in ${sym.owner}")
950
950
nestedCtx = localContext(sym).setNewScope
951
- myTypeParams = {
952
- implicit val ctx = nestedCtx
953
- def typeParamTrees (tdef : Tree ): List [TypeDef ] = tdef match {
954
- case TypeDef (_, original) =>
955
- original match {
956
- case LambdaTypeTree (tparams, _) => tparams
957
- case original : DerivedFromParamTree => typeParamTrees(original.watched)
958
- case _ => Nil
959
- }
960
- case _ => Nil
961
- }
962
- val tparams = typeParamTrees(original)
963
- completeParams(tparams)
964
- tparams.map(symbolOfTree(_).asType)
965
- }
966
- }
951
+ given Context = nestedCtx
952
+
953
+ def typeParamTrees (tdef : Tree ): List [TypeDef ] = tdef match
954
+ case TypeDef (_, original) =>
955
+ original match
956
+ case LambdaTypeTree (tparams, _) => tparams
957
+ case original : DerivedFromParamTree => typeParamTrees(original.watched)
958
+ case _ => Nil
959
+ case _ => Nil
960
+
961
+ val tparams = typeParamTrees(original)
962
+ index(tparams)
963
+ myTypeParams = tparams.map(symbolOfTree(_).asType)
964
+ for param <- tparams do typedAheadExpr(param)
965
+ end if
967
966
myTypeParams
968
- }
967
+ end completerTypeParams
969
968
970
969
override protected def typeSig (sym : Symbol ): Type =
971
970
typeDefSig(original, sym, completerTypeParams(sym)(ictx))(nestedCtx)
0 commit comments