@@ -5,6 +5,7 @@ package core
5
5
import Periods ._ , Contexts ._ , Symbols ._ , Denotations ._ , Names ._ , NameOps ._ , Annotations ._
6
6
import Types ._ , Flags ._ , Decorators ._ , DenotTransformers ._ , StdNames ._ , Scopes ._ , Comments ._
7
7
import NameOps ._ , NameKinds ._ , Phases ._
8
+ import TypeApplications .TypeParamInfo
8
9
import Scopes .Scope
9
10
import collection .mutable
10
11
import collection .BitSet
@@ -1915,6 +1916,11 @@ object SymDenotations {
1915
1916
override def complete (denot : SymDenotation )(implicit ctx : Context ) = self.complete(denot)
1916
1917
}
1917
1918
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
+
1918
1924
def decls : Scope = myDecls
1919
1925
def sourceModule (implicit ctx : Context ): Symbol = mySourceModuleFn(ctx)
1920
1926
def moduleClass (implicit ctx : Context ): Symbol = myModuleClassFn(ctx)
@@ -1924,12 +1930,12 @@ object SymDenotations {
1924
1930
def withModuleClass (moduleClassFn : Context => Symbol ): this .type = { myModuleClassFn = moduleClassFn; this }
1925
1931
}
1926
1932
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.
1929
1935
*/
1930
1936
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
1933
1939
}
1934
1940
1935
1941
val NoSymbolFn = (ctx : Context ) => NoSymbol
0 commit comments