Dotty Documentation

0.11.0-bin-SNAPSHOT

trait Checking
extends Object

[-] Constructors

[-] Members

[+] def checkCaseInheritance ( parent: Symbol , caseCls: ClassSymbol , pos: Position ) ( implicit ctx: Context ) : Unit

Check that case classes are not inherited by case classes.

[+] def checkClassType ( tp: Type , pos: Position , traitReq: Boolean , stablePrefixReq: Boolean ) ( implicit ctx: Context ) : Type

Check that tp is a class type. Also, if traitReq is true, check that tp is a trait. Also, if stablePrefixReq is true and phase is not after RefChecks, check that class prefix is stable.

[+] def checkDerivedValueClass ( clazz: Symbol , stats: List [ Tree ] ) ( implicit ctx: Context ) : Unit

Verify classes extending AnyVal meet the requirements

[+] def checkEnum ( cdef: TypeDef , cls: Symbol , parent: Symbol ) ( implicit ctx: Context ) : Unit

Check that all case classes that extend scala.Enum are enum cases

[+] private def checkEnumCaseRefsLegal ( cdef: TypeDef , enumCtx: Context ) ( implicit ctx: Context ) : Unit

Check that all references coming from enum cases in an enum companion object are legal.

[+] def checkEnumCompanions ( stats: List [ Tree ] , enumContexts: Map [ Symbol, Context ] ) ( implicit ctx: Context ) : List [ Tree ]

Check all enum cases in all enum companions in stats for legal accesses.

[+] def checkFeasibleParent ( tp: Type , pos: Position , where: => String ) ( implicit ctx: Context ) : Type

Check that tp is a class type and that any top-level type arguments in this type are feasible, i.e. that their lower bound conforms to their upper bound. If a type argument is infeasible, issue and error and continue with upper bound.

[+] def checkFeasibleParent$default$3 : String

Check that tp is a class type and that any top-level type arguments in this type are feasible, i.e. that their lower bound conforms to their upper bound. If a type argument is infeasible, issue and error and continue with upper bound.

[+] def checkFeature ( base: ClassSymbol , name: TermName , description: => String , featureUseSite: Symbol , pos: Position ) ( implicit ctx: Context ) : Unit

Issue a feature warning if feature is not enabled

[+] def checkImplicitConversionDefOK ( sym: Symbol ) ( implicit ctx: Context ) : Unit

If sym is an implicit conversion, check that implicit conversions are enabled.

[+] def checkImplicitConversionUseOK ( sym: Symbol , pos: Position ) ( implicit ctx: Context ) : Unit

If sym is an implicit conversion, check that that implicit conversions are enabled, unless - it is synthetic - it is has the same owner as one of the classes it converts to (modulo companions) - it is defined in Predef - it is the scala.reflect.Selectable.reflectiveSelectable conversion

[+] def checkInInlineContext ( what: String , pos: Position ) ( implicit ctx: Context ) : Unit

Check that we are in an inline context (inside an inline method or in inline code)

[+] def checkInlineConformant ( tree: Tree , isFinal: Boolean , what: => String ) ( implicit ctx: Context ) : Unit

Check that tree can be right hand-side or argument to inline value or parameter.

[+] def checkMembersOK ( tp: Type , pos: Position ) ( implicit ctx: Context ) : Type

Check that all named types that form part of this type have a denotation. Called on inferred (result) types of ValDefs and DefDefs. This could fail for types where the member was originally available as part of the self type, yet is no longer visible once the this has been replaced by some other prefix. See neg/i3083.scala

[+] def checkNoDoubleDeclaration ( cls: Symbol ) ( implicit ctx: Context ) : Unit

Check that class does not declare same symbol twice

[+] def checkNoForwardDependencies ( vparams: List [ ValDef ] ) ( implicit ctx: Context ) : Unit

Check that method parameter types do not reference their own parameter or later parameters in the same parameter section.

[+] def checkNonCyclic ( sym: Symbol , info: TypeBounds , reportErrors: Boolean ) ( implicit ctx: Context ) : Type
[+] def checkNonCyclicInherited ( joint: Type , parents: List [ Type ] , decls: Scope , pos: Position ) ( implicit ctx: Context ) : Unit
[+] def checkNotSingleton ( tpt: Tree , where: String ) ( implicit ctx: Context ) : Tree

Check that tpt does not refer to a singleton type

[+] def checkParentCall ( call: Tree , caller: ClassSymbol ) ( implicit ctx: Context ) : Unit
[+] def checkRealizableBounds ( cls: Symbol , pos: Position ) ( implicit ctx: Context ) : Unit

Check that all type members of tp have realizable bounds

[+] def checkRefsLegal ( tree: Tree , badOwner: Symbol , allowed: (Name, Symbol) => Boolean , where: String ) ( implicit ctx: Context ) : Unit

Check that all non-synthetic references of the form <ident> or this.<ident> in tree that refer to a member of badOwner are allowed. Also check that there are no other explicit this references to badOwner.

[+] def checkSimpleKinded ( tpt: Tree ) ( implicit ctx: Context ) : Tree

Check that tpt does not define a higher-kinded type

[+] def checkStable ( tp: Type , pos: Position ) ( implicit ctx: Context ) : Unit

Check that type tp is stable.

[+] def checkTraitInheritance ( parent: Symbol , cls: ClassSymbol , pos: Position ) ( implicit ctx: Context ) : Unit

Given a parent parent of a class cls, if parent is a trait check that the superclass of cls derived from the superclass of parent.

An exception is made if cls extends Any, and parent is java.io.Serializable or java.lang.Comparable. These two classes are treated by Scala as universal traits. E.g. the following is OK:

... extends Any with java.io.Serializable

The standard library relies on this idiom.

[+] def checkValue ( tree: Tree , proto: Type ) ( implicit ctx: Context ) : tree.type

Check that Java statics and packages can only be used in selections.

[+] def excludeFromDoubleDeclCheck ( sym: Symbol ) ( implicit ctx: Context ) : Boolean

A hook to exclude selected symbols from double declaration check