diff options
author | buraq <buraq@epfl.ch> | 2003-07-09 11:51:40 +0000 |
---|---|---|
committer | buraq <buraq@epfl.ch> | 2003-07-09 11:51:40 +0000 |
commit | 04e4c7ee186590b54a88ef33290d319d4cd4b60d (patch) | |
tree | 8402648647893ca98cffaa1fdc4fdcad14491a1d /sources/scalac/transformer/matching/CodeFactory.java | |
parent | 933de9aa0335840340f0838e245faf5a9383a3d9 (diff) | |
download | scala-04e4c7ee186590b54a88ef33290d319d4cd4b60d.tar.gz scala-04e4c7ee186590b54a88ef33290d319d4cd4b60d.tar.bz2 scala-04e4c7ee186590b54a88ef33290d319d4cd4b60d.zip |
removed at, fixed code for Literals
Diffstat (limited to 'sources/scalac/transformer/matching/CodeFactory.java')
-rw-r--r-- | sources/scalac/transformer/matching/CodeFactory.java | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/sources/scalac/transformer/matching/CodeFactory.java b/sources/scalac/transformer/matching/CodeFactory.java index dc311408d0..0633b01c12 100644 --- a/sources/scalac/transformer/matching/CodeFactory.java +++ b/sources/scalac/transformer/matching/CodeFactory.java @@ -172,13 +172,13 @@ class CodeFactory extends PatternTool { Tree ignoreValue( Type asType ) { if( asType.isSameAs(defs.BYTE_TYPE )) - return make.Literal(Position.NOPOS, new Long( 0 )) + return make.Literal(Position.NOPOS, new Integer( 0 )) .setType( defs.INT_TYPE ); else if( asType.isSameAs( defs.CHAR_TYPE )) - return make.Literal(Position.NOPOS, new Long( 0 )) + return make.Literal(Position.NOPOS, new Character( 'a' )) .setType( defs.CHAR_TYPE ); else if( asType.isSameAs(defs.SHORT_TYPE )) - return make.Literal(Position.NOPOS, new Long( 0 )) + return make.Literal(Position.NOPOS, new Integer/*Short?*/( 0 )) .setType( defs.SHORT_TYPE ); else if( asType.isSameAs(defs.INT_TYPE )) return Int( 0 ); @@ -186,10 +186,10 @@ class CodeFactory extends PatternTool { return make.Literal(Position.NOPOS, new Long( 0 )) .setType( defs.LONG_TYPE ); else if( asType.isSameAs(defs.FLOAT_TYPE )) - return make.Literal(Position.NOPOS, new Long( 0 )) + return make.Literal(Position.NOPOS, new Float( 0 )) .setType( defs.FLOAT_TYPE ); else if( asType.isSameAs(defs.DOUBLE_TYPE )) - return make.Literal(Position.NOPOS, new Long( 0 )) + return make.Literal(Position.NOPOS, new Double( 0 )) .setType( defs.DOUBLE_TYPE ); else if( asType.isSameAs(defs.BOOLEAN_TYPE )) return gen.mkBooleanLit(Position.NOPOS, false); @@ -230,12 +230,13 @@ class CodeFactory extends PatternTool { /** creates an scala.Int constant */ Tree Int( int val ) { - return make.Literal(Position.NOPOS, new Long((long)val)) - .setType( defs.INT_TYPE ); + return Int( new Integer( val )); } Tree Int( Integer valI ) { - return Int( valI.intValue() ); + return make.Literal( Position.NOPOS, valI ) + .setType( defs.INT_TYPE ); + } /** code `new SeqTraceCons[ elemType ]( state, head, tail )' |