aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/CheckRealizable.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-02-09 13:31:51 +0100
committerMartin Odersky <odersky@gmail.com>2016-02-19 14:02:17 +0100
commitcecaa4baa7ed1e42d2d6788b334925e2ba6ae809 (patch)
treecd3d4cfd3bf1d037f0d4f2719ad3d2bd23e86c37 /src/dotty/tools/dotc/core/CheckRealizable.scala
parent8158279b556bc9f39d59adadefeb85d44c93433e (diff)
downloaddotty-cecaa4baa7ed1e42d2d6788b334925e2ba6ae809.tar.gz
dotty-cecaa4baa7ed1e42d2d6788b334925e2ba6ae809.tar.bz2
dotty-cecaa4baa7ed1e42d2d6788b334925e2ba6ae809.zip
Remove unused method, fix comments.
Addendum to change-isVolatile. Changes did not make it in by accident before that branch was merged.
Diffstat (limited to 'src/dotty/tools/dotc/core/CheckRealizable.scala')
-rw-r--r--src/dotty/tools/dotc/core/CheckRealizable.scala23
1 files changed, 5 insertions, 18 deletions
diff --git a/src/dotty/tools/dotc/core/CheckRealizable.scala b/src/dotty/tools/dotc/core/CheckRealizable.scala
index 6e6efa549..11fd6786a 100644
--- a/src/dotty/tools/dotc/core/CheckRealizable.scala
+++ b/src/dotty/tools/dotc/core/CheckRealizable.scala
@@ -63,23 +63,6 @@ class CheckRealizable(implicit ctx: Context) {
*/
private def isLateInitialized(sym: Symbol) = sym.is(Lazy, butNot = Module)
- /** Is this type a path with some part that is initialized on use?
- */
- private def isLateInitialized(tp: Type): Boolean = tp.dealias match {
- case tp: TermRef =>
- isLateInitialized(tp.symbol) || isLateInitialized(tp.prefix)
- case _: SingletonType | NoPrefix =>
- false
- case tp: TypeRef =>
- true
- case tp: TypeProxy =>
- isLateInitialized(tp.underlying)
- case tp: AndOrType =>
- isLateInitialized(tp.tp1) || isLateInitialized(tp.tp2)
- case _ =>
- true
- }
-
/** The realizability status of given type `tp`*/
def realizability(tp: Type): Realizability = tp.dealias match {
case tp: TermRef =>
@@ -121,13 +104,17 @@ class CheckRealizable(implicit ctx: Context) {
}
}
- /** `Realizable` if `tp` all of `tp`'s non-struct fields have realizable types,
+ /** `Realizable` if all of `tp`'s non-struct fields have realizable types,
* a `HasProblemField` instance pointing to a bad field otherwise.
*/
private def memberRealizability(tp: Type) = {
def checkField(sofar: Realizability, fld: SingleDenotation): Realizability =
sofar andAlso {
if (checkedFields.contains(fld.symbol) || fld.symbol.is(Private | Mutable | Lazy))
+ // if field is private it cannot be part of a visible path
+ // if field is mutable it cannot be part of a path
+ // if field is lazy it does not need to be initialized when the owning object is
+ // so in all cases the field does not influence realizability of the enclosing object.
Realizable
else {
checkedFields += fld.symbol