aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Types.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-01-30 20:22:41 +0100
committerMartin Odersky <odersky@gmail.com>2016-02-09 09:40:53 +0100
commit322bcfef33834eb1e57c874c5a745faf65e1b8bc (patch)
treeee7bfd6f07b778da90abe97d84edf955d355d509 /src/dotty/tools/dotc/core/Types.scala
parent7ccd02c2cd23e4187f3e3a378973704cecd6459a (diff)
downloaddotty-322bcfef33834eb1e57c874c5a745faf65e1b8bc.tar.gz
dotty-322bcfef33834eb1e57c874c5a745faf65e1b8bc.tar.bz2
dotty-322bcfef33834eb1e57c874c5a745faf65e1b8bc.zip
Move realizability logic from Types to TypeOps.
Types is already big enough.
Diffstat (limited to 'src/dotty/tools/dotc/core/Types.scala')
-rw-r--r--src/dotty/tools/dotc/core/Types.scala39
1 files changed, 0 insertions, 39 deletions
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala
index 0a5050148..8595da640 100644
--- a/src/dotty/tools/dotc/core/Types.scala
+++ b/src/dotty/tools/dotc/core/Types.scala
@@ -127,32 +127,6 @@ object Types {
false
}
- /** The realizibility status of this type */
- def realizability(implicit ctx: Context): Realizability = dealias match {
- case tp: TermRef =>
- if (tp.symbol.isRealizable) Realizable else NotStable
- case _: SingletonType | NoPrefix =>
- Realizable
- case tp =>
- def isConcrete(tp: Type): Boolean = tp.dealias match {
- case tp: TypeRef => tp.symbol.isClass
- case tp: TypeProxy => isConcrete(tp.underlying)
- case tp: AndOrType => isConcrete(tp.tp1) && isConcrete(tp.tp2)
- case _ => false
- }
- if (!isConcrete(tp)) NotConcrete
- else {
- def hasBadBounds(mbr: SingleDenotation) = {
- val bounds = mbr.info.bounds
- !(bounds.lo <:< bounds.hi)
- }
- tp.nonClassTypeMembers.find(hasBadBounds) match {
- case Some(mbr) => new HasProblemBounds(mbr)
- case _ => Realizable
- }
- }
- }
-
/** Does this type refer exactly to class symbol `sym`, instead of to a subclass of `sym`?
* Implemented like `isRef`, but follows more types: all type proxies as well as and- and or-types
*/
@@ -3436,19 +3410,6 @@ object Types {
def apply(pre: Type, name: Name)(implicit ctx: Context): Boolean = true
}
- // ----- Realizibility Status -----------------------------------------------------
-
- abstract class Realizability(val msg: String)
-
- object Realizable extends Realizability("")
-
- object NotConcrete extends Realizability("is not a concrete type")
-
- object NotStable extends Realizability("is not a stable reference")
-
- class HasProblemBounds(mbr: SingleDenotation)(implicit ctx: Context)
- extends Realizability(i"has a member $mbr with possibly empty bounds ${mbr.info.bounds.lo} .. ${mbr.info.bounds.hi}")
-
// ----- Exceptions -------------------------------------------------------------
class TypeError(msg: String) extends Exception(msg)