summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@epfl.ch>2009-06-03 18:33:36 +0000
committerLukas Rytz <lukas.rytz@epfl.ch>2009-06-03 18:33:36 +0000
commitf09e35944abb3dfa172948c8971edf77a654740d (patch)
tree89bb96ac33ed736d311b16a5c57f885c027430b8
parent56b22f27d03cd964d2bbb9f72e0c2b5bc9d8f4cf (diff)
downloadscala-f09e35944abb3dfa172948c8971edf77a654740d.tar.gz
scala-f09e35944abb3dfa172948c8971edf77a654740d.tar.bz2
scala-f09e35944abb3dfa172948c8971edf77a654740d.zip
removed code for parsing old pickle format.
-rw-r--r--lib/msil.jar.desired.sha12
-rw-r--r--lib/scala-compiler.jar.desired.sha12
-rw-r--r--lib/scala-library-src.jar.desired.sha12
-rw-r--r--lib/scala-library.jar.desired.sha12
-rw-r--r--src/compiler/scala/tools/nsc/symtab/classfile/PickleFormat.scala40
-rw-r--r--src/compiler/scala/tools/nsc/symtab/classfile/UnPickler.scala134
-rw-r--r--src/compiler/scala/tools/nsc/util/ShowPickled.scala9
-rw-r--r--test/files/neg/names-defaults-neg.check7
-rw-r--r--test/files/neg/names-defaults-neg.scala3
-rw-r--r--test/files/run/names-defaults.check3
-rw-r--r--test/files/run/names-defaults.scala15
11 files changed, 48 insertions, 171 deletions
diff --git a/lib/msil.jar.desired.sha1 b/lib/msil.jar.desired.sha1
index 80334bd170..2ea40184d0 100644
--- a/lib/msil.jar.desired.sha1
+++ b/lib/msil.jar.desired.sha1
@@ -1 +1 @@
-6c73420b6ee648e25edaecb8c856655c1df955b0 ?msil.jar
+ccbc6793fe7fbf83ddbc97ae8bc0a26d12d134a5 ?msil.jar
diff --git a/lib/scala-compiler.jar.desired.sha1 b/lib/scala-compiler.jar.desired.sha1
index 69c8fd64ed..8051a73a5a 100644
--- a/lib/scala-compiler.jar.desired.sha1
+++ b/lib/scala-compiler.jar.desired.sha1
@@ -1 +1 @@
-5295337f88c84b1f07f775fe7e8d162d7e644527 ?scala-compiler.jar
+ae6af5a4339a4365b4adf8335dfce4112aaeb285 ?scala-compiler.jar
diff --git a/lib/scala-library-src.jar.desired.sha1 b/lib/scala-library-src.jar.desired.sha1
index 8ae8be8ca8..bab1989738 100644
--- a/lib/scala-library-src.jar.desired.sha1
+++ b/lib/scala-library-src.jar.desired.sha1
@@ -1 +1 @@
-2102b9b5276b87ff16cba61e15a840d68a3882a9 ?scala-library-src.jar
+97b1023d52e97e62982f2069e2ca201f9ccfee19 ?scala-library-src.jar
diff --git a/lib/scala-library.jar.desired.sha1 b/lib/scala-library.jar.desired.sha1
index b88926659d..fc4b0eef05 100644
--- a/lib/scala-library.jar.desired.sha1
+++ b/lib/scala-library.jar.desired.sha1
@@ -1 +1 @@
-ba8fc9f41a722f5f49729bbcd4d22b981d2b14a9 ?scala-library.jar
+4a7b31691489868a9675630fa83d30ad79769a19 ?scala-library.jar
diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/PickleFormat.scala b/src/compiler/scala/tools/nsc/symtab/classfile/PickleFormat.scala
index 0e0575b4b1..aa27b8628d 100644
--- a/src/compiler/scala/tools/nsc/symtab/classfile/PickleFormat.scala
+++ b/src/compiler/scala/tools/nsc/symtab/classfile/PickleFormat.scala
@@ -26,7 +26,6 @@ object PickleFormat {
* | 5 ALIASsym len_Nat SymbolInfo
* | 6 CLASSsym len_Nat SymbolInfo [thistype_Ref]
* | 7 MODULEsym len_Nat SymbolInfo
- * | 8 VALsym len_Nat SymbolInfo [alias_Ref] // old VALsym, unPickling supported (checkin if minor version < 2) ** @LUC TODO remove
* | 8 VALsym len_Nat [defaultGetter_Ref] SymbolInfo [alias_Ref]
* | 9 EXTref len_Nat name_Ref [owner_Ref]
* | 10 EXTMODCLASSref len_Nat name_Ref [owner_Ref]
@@ -39,8 +38,7 @@ object PickleFormat {
* | 17 TYPEBOUNDStpe len_Nat tpe_Ref tpe_Ref
* | 18 REFINEDtpe len_Nat classsym_Ref {tpe_Ref}
* | 19 CLASSINFOtpe len_Nat classsym_Ref {tpe_Ref}
- * | 20 METHODtpe len_Nat tpe_Ref {tpe_Ref} // old method type, unPickling still supported ** @LUC TODO remove
- * | 20 METHODtpe len_Nat tpe_Ref {sym_Ref} // new method type
+ * | 20 METHODtpe len_Nat tpe_Ref {sym_Ref}
* | 21 POLYTtpe len_Nat tpe_Ref {sym_Ref}
* | 22 IMPLICITMETHODtpe len_Nat tpe_Ref {tpe_Ref}
* | 52 SUPERtpe len_Nat tpe_Ref tpe_Ref
@@ -56,12 +54,10 @@ object PickleFormat {
* | 33 LITERALstring len_Nat name_Ref
* | 34 LITERALnull len_Nat
* | 35 LITERALclass len_Nat type_Ref
- * | 40 SYMANNOT len_Nat sym_Ref info_Ref {AnnotArg_Ref} {name_Ref AnnotArg_Ref} // old symbolAnnot, unpickling still works @LUC TODO remove for 2.8.0
- * | 40 SYMANNOT len_Nat sym_Ref info_Ref {annotArg_Ref} {name_Ref constAnnotArg_Ref}
+ * | 40 SYMANNOT len_Nat sym_Ref AnnotInfoBody
* | 41 CHILDREN len_Nat sym_Ref {sym_Ref}
* | 42 ANNOTATEDtpe len_Nat [sym_Ref] tpe_Ref {annotinfo_Ref}
- * | 43 ANNOTINFO len_Nat info_Ref numConstrArgs_Nat {annotArg_Ref} {name_Ref annotArg_Ref} // old annot info, unpickling still works @LUC TODO remove
- * | 43 ANNOTINFO len_Nat info_Ref {annotArg_Ref} {name_Ref constAnnotArg_Ref}
+ * | 43 ANNOTINFO len_Nat AnnotInfoBody
* | 44 ANNOTARGARRAY len_Nat {constAnnotArg_Ref}
* | 47 DEBRUIJNINDEXtpe len_Nat level_Nat index_Nat
* | 48 EXISTENTIALtpe len_Nat type_Ref {symbol_Ref}
@@ -74,7 +70,6 @@ object PickleFormat {
* | 49 TREE len_Nat 7 TYPEDEFtree type_Ref sym_Ref mods_Ref name_Ref tree_Ref {tree_Ref}
* | 49 TREE len_Nat 8 LABELtree type_Ref sym_Ref tree_Ref {tree_Ref}
* | 49 TREE len_Nat 9 IMPORTtree type_Ref sym_Ref tree_Ref {name_Ref name_Ref}
- * | 49 TREE len_Nat 10 ANNOTATIONtree type_Ref sym_Ref tree_Ref {tree_Ref} // still unpickled @LUC TODO remove
* | 49 TREE len_Nat 11 DOCDEFtree type_Ref sym_Ref string_Ref tree_Ref
* | 49 TREE len_Nat 12 TEMPLATEtree type_Ref sym_Ref numparents_Nat {tree_Ref} tree_Ref {tree_Ref}
* | 49 TREE len_Nat 13 BLOCKtree type_Ref tree_Ref {tree_Ref}
@@ -110,17 +105,12 @@ object PickleFormat {
* | 49 TREE len_Nat 43 APPLIEDTYPEtree type_Ref tree_Ref {tree_Ref}
* | 49 TREE len_Nat 44 TYPEBOUNDStree type_Ref tree_Ref tree_Ref
* | 49 TREE len_Nat 45 EXISTENTIALTYPEtree type_Ref tree_Ref {tree_Ref}
- * | 50 MODIFIERS len_Nat flags_Long privateWithin_Ref {Annotation_Ref} // still unpickled, @LUC TODO: remove Annotation_Ref's
* | 50 MODIFIERS len_Nat flags_Long privateWithin_Ref
- * | 68 PosTYPEsym len_Nat pos_Nat SymbolInfo
- * | 69 PosALIASsym len_Nat pos_Nat SymbolInfo
- * | 70 PosCLASSsym len_Nat pos_Nat SymbolInfo [thistype_Ref]
- * | 71 PosMODULEsym len_Nat pos_Nat SymbolInfo
- * | 72 PosVALsym len_Nat pos_Nat SymbolInfo [alias_Ref]
* SymbolInfo = name_Ref owner_Ref flags_LongNat [privateWithin_Ref] info_Ref
* NameInfo = <character sequence of length len_Nat in Utf8 format>
* NumInfo = <len_Nat-byte signed number in big endian format>
* Ref = Nat
+ * AnnotInfoBody = info_Ref {annotArg_Ref} {name_Ref constAnnotArg_Ref}
* AnnotArg = Tree | Constant
* ConstAnnotArg = Constant | AnnotInfo | AnnotArgArray
*
@@ -171,15 +161,7 @@ object PickleFormat {
final val ANNOTINFO = 43
final val ANNOTARGARRAY = 44
- final val REFLTREE = 44 // @LUC TODO remove; prefix saying that a reflect tree is coming
- // support dropped in September of 2007, remove for 2.8.0
-
- final val REFLTYPE = 45 // prefix code that means a reflect type is coming
- // support dropped in September of 2007, remove for 2.8.0
-
- final val REFLSYM = 46 // prefix code that means a reflect symbol is coming
- // support dropped in September of 2007, remove for 2.8.0
-
+ final val SUPERtpe = 46
final val DEBRUIJNINDEXtpe = 47
final val EXISTENTIALtpe = 48
@@ -193,7 +175,6 @@ object PickleFormat {
final val TYPEDEFtree = 7
final val LABELtree = 8
final val IMPORTtree = 9
- final val ANNOTATIONtree = 10 // @LUC TODO remove (still unpickling now)
final val DOCDEFtree = 11
final val TEMPLATEtree = 12
final val BLOCKtree = 13
@@ -231,23 +212,14 @@ object PickleFormat {
final val EXISTENTIALTYPEtree = 45
final val MODIFIERS = 50
- final val SUPERtpe = 52
final val firstSymTag = NONEsym
final val lastSymTag = VALsym
final val lastExtSymTag = EXTMODCLASSref
- //The following two are no longer accurate, because ATTRIBUTEDtpe,
+ //The following two are no longer accurate, because ANNOTATEDtpe,
//SUPERtpe, ... are not in the same range as the other types
//final val firstTypeTag = NOtpe
//final val lastTypeTag = POLYtpe
-
- /** no longer emitted since September 2007, remove for 2.8.0 */
- final val PosOffset = 64
- final val PosTYPEsym = PosOffset + TYPEsym
- final val PosALIASsym = PosOffset + ALIASsym
- final val PosCLASSsym = PosOffset + CLASSsym
- final val PosMODULEsym = PosOffset + MODULEsym
- final val PosVALsym = PosOffset + VALsym
}
diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/UnPickler.scala b/src/compiler/scala/tools/nsc/symtab/classfile/UnPickler.scala
index 853a2d0ca0..1db8304e9b 100644
--- a/src/compiler/scala/tools/nsc/symtab/classfile/UnPickler.scala
+++ b/src/compiler/scala/tools/nsc/symtab/classfile/UnPickler.scala
@@ -47,8 +47,6 @@ abstract class UnPickler {
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)
- var major = 0
- var minor = 0
checkVersion(filename)
/** A map from entry numbers to array offsets */
@@ -64,7 +62,7 @@ abstract class UnPickler {
if (isSymbolEntry(i))
at(i, readSymbol)
else if (isSymbolAnnotationEntry(i))
- at(i, {() => if (major == 4) readOldSymbolAnnotation() else readSymbolAnnotation(); null}) //@LUC todo remove for 2.8
+ at(i, {() => readSymbolAnnotation(); null})
else if (isChildrenEntry(i))
at(i, {() => readChildren(); null})
}
@@ -72,24 +70,8 @@ abstract class UnPickler {
if (settings.debug.value) global.log("unpickled " + classRoot + ":" + classRoot.rawInfo + ", " + moduleRoot + ":" + moduleRoot.rawInfo);//debug
private def checkVersion(filename: String) {
- major = readNat()
- minor = readNat()
-
-// remove the portion below, between "cut here", before releasing the first 2.8 beta
-
-//---cut here---
-
-/*
- // transiently, use this bit as long as stability fails.
- if (major != 4 && major != 5)
-*/
-
- // once stability is restored, use the following bit instead:
- if (major == 4) { // !!! temporarily accept 4 as version.
- println("WARNING: old class format, please recompile "+filename)
- } else
-
-//---cut here---
+ val major = readNat()
+ val minor = readNat()
if (major != MajorVersion || minor > MinorVersion)
throw new IOException("Scala signature " + classRoot.name +
" has wrong version\n expected: " +
@@ -112,14 +94,14 @@ abstract class UnPickler {
/** Does entry represent an (internal) symbol */
private def isSymbolEntry(i: Int): Boolean = {
- val tag = bytes(index(i)) % PosOffset // @LUC TODO remove posOffset by 2.8.0
+ val tag = bytes(index(i))
(firstSymTag <= tag && tag <= lastSymTag &&
(tag != CLASSsym || !isRefinementSymbolEntry(i)))
}
/** Does entry represent an (internal or external) symbol */
private def isSymbolRef(i: Int): Boolean = {
- val tag = bytes(index(i)) % PosOffset // @LUC TODO remove posOffset by 2.8.0
+ val tag = bytes(index(i))
(firstSymTag <= tag && tag <= lastExtSymTag)
}
@@ -148,9 +130,8 @@ abstract class UnPickler {
val savedIndex = readIndex
readIndex = index(i)
val tag = readByte()
- if (tag % PosOffset != CLASSsym) assert(false) // @LUC TODO remove posOffset by 2.8.0
+ if (tag != CLASSsym) assert(false)
readNat(); // read length
- if (tag > PosOffset) readNat(); // @LUC TODO read position, remove posOffset by 2.8.0
val result = readNameRef() == nme.REFINE_CLASS_NAME.toTypeName
readIndex = savedIndex
result
@@ -210,11 +191,6 @@ abstract class UnPickler {
case NONEsym =>
sym = NoSymbol
case _ => // symbols that were pickled with Pickler.writeSymInfo
- // @LUC TODO remove posOffset by 2.8.0
- val unusedPos : Int = {
- if (tag > PosOffset) readNat
- else -1
- }
var defaultGetter: Symbol = NoSymbol
var nameref = readNat()
if (tag == VALsym && isSymbolRef(nameref)) {
@@ -230,7 +206,7 @@ abstract class UnPickler {
privateWithin = at(inforef, readSymbol)
inforef = readNat()
}
- (tag % PosOffset) match { // @LUC TODO remove posOffset by 2.8.0
+ tag match {
case TYPEsym =>
sym = owner.newAbstractType(NoPosition, name)
case ALIASsym =>
@@ -276,26 +252,6 @@ abstract class UnPickler {
sym
}
- /** To avoid cutting and pasting between METHODtpe and IMPLICITMETHODtpe */
- private def readMethodParams(isImplicit: Boolean, end: Int): List[Symbol] = {
- if (readIndex == end)
- return Nil
-
- val index = readNat()
- if (isSymbolRef(index))
- at(index, readSymbol) :: until(end, readSymbolRef)
- else {
- val formals =
- if (isImplicit) until(end, readTypeRef)
- else at(index, readType) :: until(end, readTypeRef)
-
- // @LUC TODO the owner should be the method symbol, and newSyntheticValueParams
- // should only be called once, not separately for each parameter list
- val dummyMethod = new TermSymbol(NoSymbol, NoPosition, "unPickler$dummy")
- dummyMethod.newSyntheticValueParams(formals)
- }
- }
-
/** Read a type */
private def readType(): Type = {
val tag = readByte()
@@ -337,8 +293,7 @@ abstract class UnPickler {
ClassInfoType(until(end, readTypeRef), symScope(clazz), clazz)
case METHODtpe =>
val restpe = readTypeRef()
- // compatibility with old format. TODO replace by "until(end, readSymbolRef)"
- val params = readMethodParams(false, end)
+ val params = until(end, readSymbolRef)
// if the method is overloaded, the params cannot be determined (see readSymbol) => return NoType.
// Only happen for trees, "case Apply" in readTree() takes care of selecting the correct
// alternative after parsing the arguments.
@@ -346,7 +301,7 @@ abstract class UnPickler {
else MethodType(params, restpe)
case IMPLICITMETHODtpe =>
val restpe = readTypeRef()
- val params = readMethodParams(true, end)
+ val params = until(end, readSymbolRef)
ImplicitMethodType(params, restpe)
case POLYtpe =>
val restpe = readTypeRef()
@@ -413,11 +368,7 @@ abstract class UnPickler {
* Tree's for its arguments.
*/
private def readAnnotationArg(): AnnotationArgument = {
- // @LUC TODO Warning about reflection trees in pickle. Remove for 2.8.0
- if (peekByte() == REFLTREE) {
- reflectAnnotationWarning()
- new AnnotationArgument(EmptyTree)
- } else if (peekByte() == TREE) {
+ if (peekByte() == TREE) {
val tree = readTree()
new AnnotationArgument(tree)
} else {
@@ -460,20 +411,6 @@ abstract class UnPickler {
AnnotationInfo(atp, args.toList, assocs.toList)
}
- /** Old-style annotation infos. Deprecated in June 2008,
- * @LUC TODO remove for 2.8.0
- */
- private def readOldAnnotationInfo(end: Int): AnnotationInfo = {
- val atp = readTypeRef()
- val numargs = readNat()
- val args = times(numargs, readAnnotationArgRef)
- val assocs =
- until(end, () => {
- val name = readNameRef()
- val arg = readAnnotationArgRef
- (name, arg)})
- AnnotationInfo(atp, args, List())
- }
/** Read an annotation and as a side effect store it into
* the symbol it requests. Called at top-level, for all
@@ -487,27 +424,6 @@ abstract class UnPickler {
target.addAnnotation(readAnnotationInfo(end))
}
- /** @LUC TODO Old-style symbol annotations, deprecated by June 2008, remove for 2.8.0 */
- private def readOldSymbolAnnotation() {
- val tag = readByte()
- if (tag != SYMANNOT)
- errorBadSignature("symbol annotation expected ("+ tag +")")
- val end = readNat() + readIndex
- val target = readSymbolRef()
- val attrType = readTypeRef()
- val args = new ListBuffer[AnnotationArgument]
- val assocs = new ListBuffer[(Name, AnnotationArgument)]
- while (readIndex != end) {
- val argref = readNat()
- if (isNameEntry(argref))
- assocs += ((at(argref, readName), readAnnotationArgRef))
- else
- args += at(argref, readAnnotationArg)
- }
- val attr = AnnotationInfo(attrType, args.toList, List())
- target.addAnnotation(attr)
- }
-
/** Read an annotation and return it. Only called when
* unpickling an ANNOTATED(WSELF)tpe. */
private def readAnnotation(): AnnotationInfo = {
@@ -515,22 +431,14 @@ abstract class UnPickler {
if (tag != ANNOTINFO)
errorBadSignature("annotation expected (" + tag + ")")
val end = readNat() + readIndex
- if (major == 4) { // @LUC TODO deprecated by June 2008, remove for 2.8.0
- readOldAnnotationInfo(end)
- } else {
- readAnnotationInfo(end)
- }
+ readAnnotationInfo(end)
}
- private def readTree(): Tree = readTree(false) // @LUC TODO remove
-
/* Read an abstract syntax tree */
- private def readTree(skipTag: Boolean): Tree = {
- if (!skipTag) { // @LUC TODO remove skipTag
+ private def readTree(): Tree = {
val outerTag = readByte()
if (outerTag != TREE)
errorBadSignature("tree expected (" + outerTag + ")")
- }
val end = readNat() + readIndex
val tag = readByte()
val tpe =
@@ -628,13 +536,6 @@ abstract class UnPickler {
setSymbol(symbol).
setType(tpe))
- // @LUC TODO remove for 2.8.0 (no longer pickled)
- case ANNOTATIONtree =>
- val constr = readTreeRef()
- val elements = until(end, readTreeRef)
- //(Annotation(constr, elements).setType(tpe))
- EmptyTree
-
case DOCDEFtree =>
val comment = readConstantRef match {
case Constant(com: String) => com
@@ -843,7 +744,6 @@ abstract class UnPickler {
val pflags = (pflagsHi.toLong << 32) + pflagsLo
val flags = pickledToRawFlags(pflags)
val privateWithin = readNameRef()
- val annotations = until(end, () => at(readNat(), () => readTree(true))) // @LUC TODO remove this line
Modifiers(flags, privateWithin, Nil)
}
@@ -898,16 +798,6 @@ abstract class UnPickler {
private def errorBadSignature(msg: String) =
throw new RuntimeException("malformed Scala signature of " + classRoot.name + " at " + readIndex + "; " + msg)
- /** @LUC TODO Warning about reflection trees in pickle. Remove for 2.8.0 */
- private var printedReflectAnnotationWarning = false
- private def reflectAnnotationWarning() {
- if (!printedReflectAnnotationWarning) {
- global.warning(
- "warning: dropping a legacy format annotation in " + classRoot.name)
- printedReflectAnnotationWarning = true
- }
- }
-
private class LazyTypeRef(i: Int) extends LazyType {
private val definedAtRunId = currentRunId
// In IDE, captures class files dependencies so they can be reloaded when their dependencies change.
diff --git a/src/compiler/scala/tools/nsc/util/ShowPickled.scala b/src/compiler/scala/tools/nsc/util/ShowPickled.scala
index a98fee2848..713c5b164d 100644
--- a/src/compiler/scala/tools/nsc/util/ShowPickled.scala
+++ b/src/compiler/scala/tools/nsc/util/ShowPickled.scala
@@ -53,11 +53,6 @@ object ShowPickled extends Names {
case LITERALnull => "LITERALnull"
case LITERALclass => "LITERALclass"
case CHILDREN => "CHILDREN"
- case PosTYPEsym => "PosTYPEsym"
- case PosALIASsym => "PosALIASsym"
- case PosCLASSsym => "PosCLASSsym"
- case PosMODULEsym => "PosMODULEsym"
- case PosVALsym => "PosVALsym"
case _ => "***BAD TAG***(" + tag + ")"
}
@@ -109,10 +104,6 @@ object ShowPickled extends Names {
case TYPEsym | ALIASsym | CLASSsym | MODULEsym | VALsym =>
printSymInfo()
if (tag == CLASSsym && (buf.readIndex < end)) printTypeRef()
- case PosTYPEsym | PosALIASsym | PosCLASSsym | PosMODULEsym | PosVALsym =>
- printNat()
- printSymInfo()
- if (tag == CLASSsym && (buf.readIndex < end)) printTypeRef()
case EXTref | EXTMODCLASSref =>
printNameRef()
if (buf.readIndex < end) { printSymbolRef() }
diff --git a/test/files/neg/names-defaults-neg.check b/test/files/neg/names-defaults-neg.check
index c7f7b80ade..d4331ab63f 100644
--- a/test/files/neg/names-defaults-neg.check
+++ b/test/files/neg/names-defaults-neg.check
@@ -97,4 +97,9 @@ names-defaults-neg.scala:99: error: using named or default arguments in a self c
names-defaults-neg.scala:105: error: using named or default arguments in a self constructor call is not allowed
this(sep + b + sep)
^
-25 errors found
+names-defaults-neg.scala:112: error: type mismatch;
+ found : java.lang.Object
+ required: java.lang.String
+class B5 extends A5 { override def foo(a: Object = new Object) = 1 }
+ ^
+26 errors found \ No newline at end of file
diff --git a/test/files/neg/names-defaults-neg.scala b/test/files/neg/names-defaults-neg.scala
index 26663fe60d..29db82924c 100644
--- a/test/files/neg/names-defaults-neg.scala
+++ b/test/files/neg/names-defaults-neg.scala
@@ -107,3 +107,6 @@ class A3(x: String, y: Int = 11) {
}
case class Fact(a: Int, b: String)(c: Int*)
+
+class A5 { def foo(a: Object = "dlkf") = 0 }
+class B5 extends A5 { override def foo(a: Object = new Object) = 1 }
diff --git a/test/files/run/names-defaults.check b/test/files/run/names-defaults.check
index 643615368d..3fed6e601a 100644
--- a/test/files/run/names-defaults.check
+++ b/test/files/run/names-defaults.check
@@ -91,4 +91,5 @@ Fact2(10,blabla)
test5
2
test5
-3 \ No newline at end of file
+3
+slkdfj1 \ No newline at end of file
diff --git a/test/files/run/names-defaults.scala b/test/files/run/names-defaults.scala
index 38ba317029..482c4f2f7b 100644
--- a/test/files/run/names-defaults.scala
+++ b/test/files/run/names-defaults.scala
@@ -175,6 +175,12 @@ object Test extends Application {
println(argName) // should be 3
+ // dependent types and copy method
+ val a11 = new A2
+ val b11 = a11.B2(new a11.C2)(1)
+ println(b11.copy()())
+
+
// DEFINITIONS
def test1(a: Int, b: String) = println(a +": "+ b)
def test2(u: Int, v: Int)(k: String, l: Int) = println(l +": "+ k +", "+ (u + v))
@@ -229,3 +235,12 @@ class MN extends M {
case class Factory(x: Int = 1, y: String)(z: String = y)
case class Fact2[T, +U](x: T = "ju", y: U = 1)(z: T = 2)
+
+
+// dependent types and copy method
+class A2 {
+ case class B2(x: C2)(y: Int) extends A2 {
+ override def toString = "slkdfj" + y
+ }
+ class C2
+}