NamerOps

dotty.tools.dotc.core.NamerOps
object NamerOps

Operations that are shared between Namer and TreeUnpickler

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
NamerOps.type

Members list

Type members

Classlikes

class ApplyProxyCompleter(constr: Symbol)(using x$2: Context) extends LazyType

The completer of a constructor proxy apply method

The completer of a constructor proxy apply method

Attributes

Supertypes
class LazyType
trait Symbol => LazyType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Show all

Value members

Concrete methods

def addConstructorApplies(scope: MutableScope, cls: ClassSymbol, modcls: ClassSymbol)(using Context): scope.type

Add constructor proxy apply methods to scope. Proxies are for constructors in cls and they reside in modcls.

Add constructor proxy apply methods to scope. Proxies are for constructors in cls and they reside in modcls.

Attributes

Add all necessary constructor proxy symbols for members of class cls. This means:

Add all necessary constructor proxy symbols for members of class cls. This means:

  • if a member is a class, or type alias, that needs a constructor companion, add one, provided no member with the same name exists.
  • if cls is a companion object of a class that needs a constructor companion, and cls does not already define or inherit an apply method, add apply methods for all constructors of the companion class.

Attributes

def addContextBoundCompanionFor(tsym: Symbol, witnessNames: List[TermName], params: List[Symbol])(using Context): Unit

Create a context-bound companion for type symbol tsym, which has a context bound that defines a set of witnesses with names witnessNames.

Create a context-bound companion for type symbol tsym, which has a context bound that defines a set of witnesses with names witnessNames.

Value parameters

params

If tsym is a type parameter, a list of parameter symbols that includes all witnesses, otherwise the empty list. The context-bound companion has as name the name of tsym translated to a term name. We create a synthetic val of the form val A: <context-bound-companion>[witnessRef1 | ... | witnessRefN] where is the CBCompanion type created in Definitions withnessRefK is a reference to the K'th witness. The companion has the same access flags as the original type.

Attributes

Add context bound companions to all context-bound types declared in this class. This assumes that these types already have their WitnessNames annotation set even before they are completed. This is the case for unpickling but currently not for Namer. So the method is only called during unpickling.

Add context bound companions to all context-bound types declared in this class. This assumes that these types already have their WitnessNames annotation set even before they are completed. This is the case for unpickling but currently not for Namer. So the method is only called during unpickling.

Attributes

def addParamRefinements(resType: Type, paramss: List[List[Symbol]])(using Context): Type

Given a method with tracked term-parameters p1, ..., pn, and result type R, add the refinements R { p1 = p1' } ... { pn = pn' }, where pi' is the TermParamRef of the parameter and pi is its name. This matters only under experimental.modularity, since without it there are no tracked parameters. Parameter refinements are added for constructors and given companion methods.

Given a method with tracked term-parameters p1, ..., pn, and result type R, add the refinements R { p1 = p1' } ... { pn = pn' }, where pi' is the TermParamRef of the parameter and pi is its name. This matters only under experimental.modularity, since without it there are no tracked parameters. Parameter refinements are added for constructors and given companion methods.

Attributes

def adjustModuleCompleter(completer: LazyType, name: Name)(using Context): LazyType

Add moduleClass or sourceModule functionality to completer for a module or module class

Add moduleClass or sourceModule functionality to completer for a module or module class

Attributes

A new symbol that is the constructor companion for class cls

A new symbol that is the constructor companion for class cls

Attributes

The completer of a constructor companion for class cls, where modul is the companion symbol and modcls is its class.

The completer of a constructor companion for class cls, where modul is the companion symbol and modcls is its class.

Attributes

def effectiveResultType(ctor: Symbol, paramss: List[List[Symbol]])(using Context): Type

The type of the constructed instance is returned

The type of the constructed instance is returned

Value parameters

ctor

the constructor

Attributes

def findModuleBuddy(name: Name, scope: Scope, alternate: Name)(using Context): Symbol

Find moduleClass/sourceModule in effective scope

Find moduleClass/sourceModule in effective scope

Attributes

For secondary constructors, make it known in the context that their type parameters are aliases of the class type parameters.

For secondary constructors, make it known in the context that their type parameters are aliases of the class type parameters.

Attributes

Returns

if sym is a secondary constructor, a fresh context that contains GADT constraints linking the type parameters.

def linkConstructorParams(sym: Symbol, tparams: List[Symbol], rhsCtx: Context)(using Context): Unit

For secondary constructor sym, make it known in the given context rhsCtx that their type parameters are aliases of the class type parameters. This is done by (ab?)-using GADT constraints. See pos/i941.scala.

For secondary constructor sym, make it known in the given context rhsCtx that their type parameters are aliases of the class type parameters. This is done by (ab?)-using GADT constraints. See pos/i941.scala.

Attributes

Turn modul into a constructor companion for class cls

Turn modul into a constructor companion for class cls

Attributes

def methodType(paramss: List[List[Symbol]], resultType: Type, isJava: Boolean)(using Context): Type

The method type corresponding to given parameters and result type

The method type corresponding to given parameters and result type

Attributes

Does symbol sym need constructor proxies to be generated?

Does symbol sym need constructor proxies to be generated?

Attributes

def normalizeIfConstructor(paramss: List[List[Symbol]], isConstructor: Boolean)(using Context): List[List[Symbol]]

If isConstructor, make sure it has at least one non-implicit parameter list This is done by adding a () in front of a leading old style implicit parameter, or by adding a () as last -- or only -- parameter list if the constructor has only using clauses as parameters.

If isConstructor, make sure it has at least one non-implicit parameter list This is done by adding a () in front of a leading old style implicit parameter, or by adding a () as last -- or only -- parameter list if the constructor has only using clauses as parameters.

Attributes

def typeConstructorCompanion(tsym: Symbol, prefix: Type, proxy: Symbol)(using Context): TermSymbol

Concrete fields

The flags of an apply method that serves as a constructor proxy

The flags of an apply method that serves as a constructor proxy

Attributes

Extensions

Extensions

extension (tp: Type)
def separateRefinements(cls: ClassSymbol, refinements: LinkedHashMap[Name, Type] | Null)(using Context): Type

Split dependent class refinements off parent type. Add them to refinements, unless it is null.

Split dependent class refinements off parent type. Add them to refinements, unless it is null.

Attributes