@@ -5,6 +5,7 @@ package core
55import Periods ._ , Contexts ._ , Symbols ._ , Denotations ._ , Names ._ , NameOps ._ , Annotations ._
66import Types ._ , Flags ._ , Decorators ._ , DenotTransformers ._ , StdNames ._ , Scopes ._ , Comments ._
77import NameOps ._ , NameKinds ._ , Phases ._
8+ import TypeApplications .TypeParamInfo
89import Scopes .Scope
910import collection .mutable
1011import collection .BitSet
@@ -1915,6 +1916,11 @@ object SymDenotations {
19151916 override def complete (denot : SymDenotation )(implicit ctx : Context ) = self.complete(denot)
19161917 }
19171918
1919+ /** The type parameters computed by the completer before completion has finished */
1920+ def completerTypeParams (sym : Symbol )(implicit ctx : Context ): List [TypeParamInfo ] =
1921+ if (sym is Touched ) Nil // return `Nil` instead of throwing a cyclic reference
1922+ else sym.info.typeParams
1923+
19181924 def decls : Scope = myDecls
19191925 def sourceModule (implicit ctx : Context ): Symbol = mySourceModuleFn(ctx)
19201926 def moduleClass (implicit ctx : Context ): Symbol = myModuleClassFn(ctx)
@@ -1924,12 +1930,12 @@ object SymDenotations {
19241930 def withModuleClass (moduleClassFn : Context => Symbol ): this .type = { myModuleClassFn = moduleClassFn; this }
19251931 }
19261932
1927- /** A subclass of LazyTypes where type parameters can be completed independently of
1928- * the info.
1933+ /** A subtrait of LazyTypes where completerTypeParams yields a List[TypeSymbol], which
1934+ * should be completed independently of the info.
19291935 */
19301936 trait TypeParamsCompleter extends LazyType {
1931- /** The type parameters computed by the completer before completion has finished */
1932- def completerTypeParams ( sym : Symbol )( implicit ctx : Context ) : List [ TypeSymbol ]
1937+ override def completerTypeParams ( sym : Symbol )( implicit ctx : Context ) : List [ TypeSymbol ] =
1938+ unsupported( " completerTypeParams " ) // should be abstract, but Scala-2 will then compute the wrong type for it
19331939 }
19341940
19351941 val NoSymbolFn = (ctx : Context ) => NoSymbol
0 commit comments