diff options
author | Paul Phillips <paulp@improving.org> | 2013-05-27 12:02:45 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2013-05-27 12:54:58 -0700 |
commit | a2e8f9e001356a993da4e01235c12583d97163d3 (patch) | |
tree | c52920518cedd2ed8c38682e014dbcab683b6597 /src/reflect/scala/reflect/internal/Symbols.scala | |
parent | e42991f40707023d563f43bf66f3d8b9a637aa1b (diff) | |
download | scala-a2e8f9e001356a993da4e01235c12583d97163d3.tar.gz scala-a2e8f9e001356a993da4e01235c12583d97163d3.tar.bz2 scala-a2e8f9e001356a993da4e01235c12583d97163d3.zip |
Make all numeric coercions explicit.
Optimistically, this is preparation for a day when we don't
let numeric types drift with the winds. Even without the optimism
it's a good idea. It flushed out an undocumented change in
the math package object relative to the methods being forwarded (a
type is widened from what is returned in java) so I documented
the intentionality of it.
Managing type coercions manually is a bit tedious, no doubt,
but it's not tedious enough to warrant abandoning type safety
just because java did it.
Diffstat (limited to 'src/reflect/scala/reflect/internal/Symbols.scala')
-rw-r--r-- | src/reflect/scala/reflect/internal/Symbols.scala | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/reflect/scala/reflect/internal/Symbols.scala b/src/reflect/scala/reflect/internal/Symbols.scala index 1db9c5c78f..f3cea1fd00 100644 --- a/src/reflect/scala/reflect/internal/Symbols.scala +++ b/src/reflect/scala/reflect/internal/Symbols.scala @@ -269,7 +269,7 @@ trait Symbols extends api.Symbols { self: SymbolTable => val newName = nme.moduleVarName(accessor.name.toTermName) val newFlags = MODULEVAR | ( if (this.isClass) PrivateLocal | SYNTHETIC else 0 ) val newInfo = accessor.tpe.finalResultType - val mval = newVariable(newName, accessor.pos.focus, newFlags) addAnnotation VolatileAttr + val mval = newVariable(newName, accessor.pos.focus, newFlags.toLong) addAnnotation VolatileAttr if (this.isClass) mval setInfoAndEnter newInfo @@ -627,6 +627,8 @@ trait Symbols extends api.Symbols { self: SymbolTable => if (!isCompilerUniverse && needsInitialize(isFlagRelated = true, mask = mask)) initialize (flags & mask) != 0 } + def hasFlag(mask: Int): Boolean = hasFlag(mask.toLong) + /** Does symbol have ALL the flags in `mask` set? */ final def hasAllFlags(mask: Long): Boolean = { if (!isCompilerUniverse && needsInitialize(isFlagRelated = true, mask = mask)) initialize @@ -2967,7 +2969,7 @@ trait Symbols extends api.Symbols { self: SymbolTable => // a type symbol bound by an existential type, for instance the T in // List[T] forSome { type T } override def isExistentialSkolem = this hasFlag EXISTENTIAL - override def isGADTSkolem = this hasAllFlags GADT_SKOLEM_FLAGS + override def isGADTSkolem = this hasAllFlags GADT_SKOLEM_FLAGS.toLong override def isTypeSkolem = this hasFlag PARAM override def isAbstractType = this hasFlag DEFERRED |