summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAntonio Cunei <antonio.cunei@epfl.ch>2009-05-12 17:48:29 +0000
committerAntonio Cunei <antonio.cunei@epfl.ch>2009-05-12 17:48:29 +0000
commit7cfc53fb4b77f70af5de28a057b1d333bee415d8 (patch)
tree1119db4d6ecfcd34db6a643669f7afb3f4bace9a /src
parentc8ad9ef2d129e29c945ca86144b8ee875ad72a9b (diff)
downloadscala-7cfc53fb4b77f70af5de28a057b1d333bee415d8.tar.gz
scala-7cfc53fb4b77f70af5de28a057b1d333bee415d8.tar.bz2
scala-7cfc53fb4b77f70af5de28a057b1d333bee415d8.zip
The compiler will complain when trying to
compile against binaries created prior to this revision, which are however still transitionally accepted. That is done in preparation for future 2.8 releases, which will be binary incompatible. Includes new starr, aligned with r17713.
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/symtab/classfile/PickleFormat.scala4
-rw-r--r--src/compiler/scala/tools/nsc/symtab/classfile/UnPickler.scala18
2 files changed, 14 insertions, 8 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/PickleFormat.scala b/src/compiler/scala/tools/nsc/symtab/classfile/PickleFormat.scala
index 0b74201a96..28accffa02 100644
--- a/src/compiler/scala/tools/nsc/symtab/classfile/PickleFormat.scala
+++ b/src/compiler/scala/tools/nsc/symtab/classfile/PickleFormat.scala
@@ -119,8 +119,8 @@ object PickleFormat {
*
* len is remaining length after `len'.
*/
- val MajorVersion = 4
- val MinorVersion = 1
+ val MajorVersion = 5
+ val MinorVersion = 0
final val TERMname = 1
final val TYPEname = 2
diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/UnPickler.scala b/src/compiler/scala/tools/nsc/symtab/classfile/UnPickler.scala
index 490db843e5..c09136e9a5 100644
--- a/src/compiler/scala/tools/nsc/symtab/classfile/UnPickler.scala
+++ b/src/compiler/scala/tools/nsc/symtab/classfile/UnPickler.scala
@@ -35,7 +35,7 @@ abstract class UnPickler {
*/
def unpickle(bytes: Array[Byte], offset: Int, classRoot: Symbol, moduleRoot: Symbol, filename: String) {
try {
- new UnPickle(bytes, offset, classRoot, moduleRoot)
+ new UnPickle(bytes, offset, classRoot, moduleRoot, filename)
} catch {
case ex: IOException =>
throw ex
@@ -45,9 +45,9 @@ abstract class UnPickler {
}
}
- private class UnPickle(bytes: Array[Byte], offset: Int, classRoot: Symbol, moduleRoot: Symbol) extends PickleBuffer(bytes, offset, -1) {
+ private class UnPickle(bytes: Array[Byte], offset: Int, classRoot: Symbol, moduleRoot: Symbol, filename: String) extends PickleBuffer(bytes, offset, -1) {
if (settings.debug.value) global.log("unpickle " + classRoot + " and " + moduleRoot)
- checkVersion()
+ checkVersion(filename)
/** A map from entry numbers to array offsets */
private val index = createIndex
@@ -65,14 +65,20 @@ abstract class UnPickler {
if (settings.debug.value) global.log("unpickled " + classRoot + ":" + classRoot.rawInfo + ", " + moduleRoot + ":" + moduleRoot.rawInfo);//debug
- private def checkVersion() {
+ private def checkVersion(filename: String) {
val major = readNat()
val minor = readNat()
- if (major < 4 /*!= MajorVersion*/ || minor > MinorVersion) // !!! temporarily accept 4 as version.
+//---cut here---
+ if (major == 4) { // !!! temporarily accept 4 as version.
+ println("WARNING: old class format, please recompile "+filename)
+ } else
+//---cut here---
+ if (major != MajorVersion || minor > MinorVersion)
throw new IOException("Scala signature " + classRoot.name +
" has wrong version\n expected: " +
MajorVersion + "." + MinorVersion +
- "\n found: " + major + "." + minor)
+ "\n found: " + major + "." + minor +
+ " in "+filename)
}
/** The `decls' scope associated with given symbol */