summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/ConstantFolder.scala
Commit message (Collapse)AuthorAgeFilesLines
* SI-9516 remove now-unneeded codeSeth Tisue2016-10-241-3/+3
| | | | now that STARR includes the relevant fix
* Emit a warning when a constant expression evaluates to an ↵Olli Helenius2016-05-021-7/+5
| | | | ArithmeticException (#5123)
* SI-9516 Fix the behavior of Int shift Long operations. (#5117)Sébastien Doeraene2016-04-231-3/+3
| | | | | | | | | | | In any shift operation where the lhs is an Int (or smaller) and the rhs is a Long, the result kind must be Int, and not Long. This is important because the lhs must *not* be promoted to a Long, as that causes an opcode for long shift to be emitted. This uses an rhs modulo 64, instead of int shifts which use an rhs module 32. Instead, the rhs must be downgraded to an Int. The new behavior is consistent with the same operations in the Java programming language.
* SI-8462: Integral shift Long result type correctedSom Snytt2015-01-091-7/+13
| | | | | | | | | | | Constant folding was incorrectly promoting to Long when the operand was Long, as with other binary ops, but the result type depends on the receiver. Per SLS 12.2.1. This fixes ((1 << 2L): Int) and the other shift ops and the other integral types.
* Absolutized paths involving the scala package.Paul Phillips2013-05-031-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Confusing, now-it-happens now-it-doesn't mysteries lurk in the darkness. When scala packages are declared like this: package scala.collection.mutable Then paths relative to scala can easily be broken via the unlucky presence of an empty (or nonempty) directory. Example: // a.scala package scala.foo class Bar { new util.Random } % scalac ./a.scala % mkdir util % scalac ./a.scala ./a.scala:4: error: type Random is not a member of package util new util.Random ^ one error found There are two ways to play defense against this: - don't use relative paths; okay sometimes, less so others - don't "opt out" of the scala package This commit mostly pursues the latter, with occasional doses of the former. I created a scratch directory containing these empty directories: actors annotation ant api asm beans cmd collection compat concurrent control convert docutil dtd duration event factory forkjoin generic hashing immutable impl include internal io logging macros man1 matching math meta model mutable nsc parallel parsing partest persistent process pull ref reflect reify remote runtime scalap scheduler script swing sys text threadpool tools transform unchecked util xml I stopped when I could compile the main src directories even with all those empties on my classpath.
* Removing ancient comments and pointless comments.Paul Phillips2012-11-191-3/+0
| | | | | | | | | | Translating <code></code> into backticks. Removed the "@param tree ..." blocks which have been taunting me for half a decade now. Removed commented-out blocks of code which had been sitting there for two years or more.
* Removed unused imports.Paul Phillips2012-11-061-2/+0
| | | | | | | | | A dizzying number of unused imports, limited to files in src/compiler. I especially like that the unused import option (not quite ready for checkin itself) finds places where feature implicits have been imported which are no longer necessary, e.g. this commit includes half a dozen removals of "import scala.language.implicitConversions".
* Brings all copyrights (in comments) up-to-date, from 2011/12 to 2013Heather Miller2012-11-021-1/+1
|
* update and normalize copyright noticeAdriaan Moors2012-08-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are the regexp replacements performed: Sxcala -> Scala Copyright (\d*) LAMP/EPFL -> Copyright $1-2012 LAMP/EPFL Copyright (\d*)-(\d*)(,?) LAMP/EPFL -> Copyright $1-2012 LAMP/EPFL Copyright (\d*)-(\d*) Scala Solutions and LAMP/EPFL -> Copyright $1-2012 Scala Solutions and LAMP/EPFL \(C\) (\d*)-(\d*) LAMP/EPFL -> (C) $1-2012 LAMP/EPFL Copyright \(c\) (\d*)-(\d*)(.*?)EPFL -> Copyright (c) $1-2012$3EPFL The last one was needed for two HTML-ified copyright notices. Here's the summarized diff: Created using ``` git diff -w | grep ^- | sort | uniq | mate git diff -w | grep ^+ | sort | uniq | mate ``` ``` - <div id="footer">Scala programming documentation. Copyright (c) 2003-2011 <a href="http://www.epfl.ch" target="_top">EPFL</a>, with contributions from <a href="http://typesafe.com" target="_top">Typesafe</a>.</div> - copyright.string=Copyright 2002-2011, LAMP/EPFL - <meta name="Copyright" content="(C) 2002-2011 LAMP/EPFL"/> - * Copyright 2002-2011 LAMP/EPFL - * Copyright 2004-2011 LAMP/EPFL - * Copyright 2005 LAMP/EPFL - * Copyright 2005-2011 LAMP/EPFL - * Copyright 2006-2011 LAMP/EPFL - * Copyright 2007 LAMP/EPFL - * Copyright 2007-2011 LAMP/EPFL - * Copyright 2009-2011 Scala Solutions and LAMP/EPFL - * Copyright 2009-2011 Scxala Solutions and LAMP/EPFL - * Copyright 2010-2011 LAMP/EPFL - * Copyright 2012 LAMP/EPFL -# Copyright 2002-2011, LAMP/EPFL -* Copyright 2005-2011 LAMP/EPFL -/* NSC -- new Scala compiler -- Copyright 2007-2011 LAMP/EPFL */ -rem # Copyright 2002-2011, LAMP/EPFL ``` ``` + <div id="footer">Scala programming documentation. Copyright (c) 2003-2012 <a href="http://www.epfl.ch" target="_top">EPFL</a>, with contributions from <a href="http://typesafe.com" target="_top">Typesafe</a>.</div> + copyright.string=Copyright 2002-2012 LAMP/EPFL + <meta name="Copyright" content="(C) 2002-2012 LAMP/EPFL"/> + * Copyright 2002-2012 LAMP/EPFL + * Copyright 2004-2012 LAMP/EPFL + * Copyright 2005-2012 LAMP/EPFL + * Copyright 2006-2012 LAMP/EPFL + * Copyright 2007-2012 LAMP/EPFL + * Copyright 2009-2012 Scala Solutions and LAMP/EPFL + * Copyright 2010-2012 LAMP/EPFL + * Copyright 2011-2012 LAMP/EPFL +# Copyright 2002-2012 LAMP/EPFL +* Copyright 2005-2012 LAMP/EPFL +/* NSC -- new Scala compiler -- Copyright 2007-2012 LAMP/EPFL */ +rem # Copyright 2002-2012 LAMP/EPFL ```
* Fixes #4490 and #4467.Kato Kazuyoshi2011-06-181-1/+1
|
* Updated copyright notices to 2011Antonio Cunei2011-01-201-1/+1
|
* Solved problem that -3.0 is not recognized as a...Martin Odersky2010-06-061-1/+1
| | | | | Solved problem that -3.0 is not recognized as a constant in annotations
* Removed more than 3400 svn '$Id' keywords and r...Antonio Cunei2010-05-121-1/+0
| | | | | Removed more than 3400 svn '$Id' keywords and related junk.
* lifted out core compiler data structures into r...Martin Odersky2010-02-011-1/+1
| | | | | | lifted out core compiler data structures into reflect.generic package. Made Unpickler work on generic data.
* more performance improvements; eliminated mk......Martin Odersky2010-01-191-1/+1
| | | | | more performance improvements; eliminated mk...Type function in Types.
* Updated copyright notices to 2010Antonio Cunei2009-12-071-1/+1
|
* More world-shaking deprecation work.Paul Phillips2009-11-201-1/+1
| | | | | | | object, updating some @deprecated messages to give realistic alternatives, properly resolving the semantic mismatch between List.-- and diff, its once-recommended but inequivalent alternative.
* Breaks down the hash function in BoxesRunTime b...Paul Phillips2009-11-091-6/+0
| | | | | | | | | | | | | | | | Breaks down the hash function in BoxesRunTime by type so we can do as much as possible at compile time. Documents various trouble points I've identified with trying to get the hashCodes aligned. Test case exercises the hashCode functions. Deleted all the code associated with previous equality adventures. Don't worry, I can put anything back if it turns out we have to change course again, but for now it's noise. Also, gives return types to the box and unbox methods which are added to the primitive companions, so e.g. Int.box(5) now returns a j.l.Integer instead of an Object.
* Broke up foldBinOp logic a little bit looking t...Paul Phillips2009-11-071-99/+99
| | | | | | | Broke up foldBinOp logic a little bit looking to reduce the likelihood of inliner pathology. This also knocked about two minutes off my time to build optimised locker.
* Sped up build times by three minutes with a bri...Paul Phillips2009-11-071-4/+5
| | | | | | Sped up build times by three minutes with a brilliant optimization I like to call "comment out offending code."
* Whole bunch of code for people interested in eq...Paul Phillips2009-10-281-0/+6
| | | | | | | | Whole bunch of code for people interested in equality. This includes four command line options you can use to alter equality semantics and the various levels of babbling and panicking which the runtime has to offer when confronted with a boxed primitive comparison.
* switch to unnested packages.Martin Odersky2009-07-241-1/+2
|
* Updated (all) copyright notices to 2009Antonio Cunei2009-01-131-1/+1
|
* Removed Pair(...), Triple(...).Martin Odersky2007-02-211-12/+12
|
* fixed unary_opsMartin Odersky2007-02-161-11/+11
|
* changed tuple syntax to (...)Martin Odersky2007-02-131-12/+12
|
* changed pair(...) to {...}Martin Odersky2007-02-051-12/+12
|
* made pattern constructors termsymbolsMartin Odersky2007-01-311-1/+1
|
* Replaced == null()eq null(ne null)mihaylov2006-11-131-1/+1
|
* Refactored portability supportmihaylov2006-11-011-0/+3
|
* removed leading/trailing tabs/blanks in typeche...michelou2006-08-301-7/+18
| | | | | removed leading/trailing tabs/blanks in typechecker/*.scala
* Fixed bug 697Martin Odersky2006-08-141-6/+9
|
* (no commit message)Martin Odersky2006-02-221-1/+3
|
* avoid crashing the compiler if folding constantsLex Spoon2006-02-211-3/+10
| | | | | raises an arithmetic exception
* Switching to the new build system and to the ne...Gilles Dubochet2005-12-191-0/+145
Switching to the new build system and to the new build system. This is a MAJOR commit, so be careful when updating.