Dotty Documentation

0.5.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 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 checkImplicitParamsNotSingletons ( vparamss: List [ List [ ValDef ] ] ) ( implicit ctx: Context ) : Unit

Check that a non-implicit parameter making up the first parameter section of an implicit conversion is not a singleton type.

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

Check that tree is a pure expression of constant type

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

Check that class does not define 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 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 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.