diff options
author | Iulian Dragos <jaguarul@gmail.com> | 2006-11-27 13:27:44 +0000 |
---|---|---|
committer | Iulian Dragos <jaguarul@gmail.com> | 2006-11-27 13:27:44 +0000 |
commit | 23a59cf62969eb4f0ba46b6e3e3567f0697050d3 (patch) | |
tree | 1752ebad8f1aae8150334c33dd00c444e983dd26 /src/compiler/scala/tools/nsc/backend/ScalaPrimitives.scala | |
parent | 722d82d18a9f452bcb58b8523db14840fbb8c0d9 (diff) | |
download | scala-23a59cf62969eb4f0ba46b6e3e3567f0697050d3.tar.gz scala-23a59cf62969eb4f0ba46b6e3e3567f0697050d3.tar.bz2 scala-23a59cf62969eb4f0ba46b6e3e3567f0697050d3.zip |
Fixed bug ivolving corecions and default conver...
Fixed bug ivolving corecions and default conversions.
Diffstat (limited to 'src/compiler/scala/tools/nsc/backend/ScalaPrimitives.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/backend/ScalaPrimitives.scala | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/ScalaPrimitives.scala b/src/compiler/scala/tools/nsc/backend/ScalaPrimitives.scala index c544aa8337..b665e3fbc1 100644 --- a/src/compiler/scala/tools/nsc/backend/ScalaPrimitives.scala +++ b/src/compiler/scala/tools/nsc/backend/ScalaPrimitives.scala @@ -546,6 +546,17 @@ abstract class ScalaPrimitives { case _ => false } + /** If code is a coercion primitive, the result type */ + def generatedKind(code: Int): TypeKind = code match { + case B2B | C2B | S2B | I2B | L2B | F2B | D2B => BYTE + case B2C | C2C | S2C | I2C | L2C | F2C | D2C => CHAR + case B2S | C2S | S2S | I2S | L2S | F2S | D2S => SHORT + case B2I | C2I | S2I | I2I | L2I | F2I | D2I => INT + case B2L | C2L | S2L | I2L | L2L | F2L | D2L => LONG + case B2F | C2F | S2F | I2F | L2F | F2F | D2F => FLOAT + case B2D | C2D | S2D | I2D | L2D | F2D | D2D => DOUBLE + } + def isPrimitive(sym: Symbol): Boolean = primitives contains sym /** Return the code for the givem symbol. */ |