diff options
author | Antonio Cunei <antonio.cunei@epfl.ch> | 2009-11-12 17:02:43 +0000 |
---|---|---|
committer | Antonio Cunei <antonio.cunei@epfl.ch> | 2009-11-12 17:02:43 +0000 |
commit | df03c236d1802d27dcb97b54303affccebede18a (patch) | |
tree | 74fbbee2856aa003cb1781f6c4082767152f715f /test/files/pos/t2305.scala | |
parent | c71cd0ef9a7e455e3a13526c2893d98b14582bbb (diff) | |
download | scala-df03c236d1802d27dcb97b54303affccebede18a.tar.gz scala-df03c236d1802d27dcb97b54303affccebede18a.tar.bz2 scala-df03c236d1802d27dcb97b54303affccebede18a.zip |
Merged revisions 19567,19569-19570 via svnmerge...
Merged revisions 19567,19569-19570 via svnmerge from
https://lampsvn.epfl.ch/svn-repos/scala/scala/trunk
........
r19567 | odersky | 2009-11-12 17:12:16 +0100 (Thu, 12 Nov 2009) | 4 lines
Fixed #2517
Fixed #2606
Fixed #2598
Fixed #1836
........
r19569 | moors | 2009-11-12 17:56:31 +0100 (Thu, 12 Nov 2009) | 8 lines
fixed #2587
two underlying problems:
- isAsSpecific did not skolemize lower (left) type in subtyping check (instead used withTypeVar on left and right)
- withTypeVars did not clone the symbols of the type params (so they were not fresh)
(the second fix is not essential due to the first fix, it "improves correctness", but should check whether performance is not impacted too severely)
applied martin's documentation diff
........
r19570 | moors | 2009-11-12 17:56:33 +0100 (Thu, 12 Nov 2009) | 1 line
fixed #2454
........
Diffstat (limited to 'test/files/pos/t2305.scala')
-rw-r--r-- | test/files/pos/t2305.scala | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/files/pos/t2305.scala b/test/files/pos/t2305.scala new file mode 100644 index 0000000000..8b5abccbe0 --- /dev/null +++ b/test/files/pos/t2305.scala @@ -0,0 +1,26 @@ +import java.util.ArrayList + +trait Bind[Z[_]] + +class MySerializable[X] extends java.io.Serializable + +object Bind { + implicit val JavaArrayListBind: Bind[ArrayList] = new Bind[ArrayList] {} + implicit val MySerializableBind: Bind[MySerializable] = new Bind[MySerializable] {} +} + +object works { + // this works fine: + def runbind(implicit bind: Bind[MySerializable]) {} + runbind +} + +object breaks { + def runbind(implicit bind: Bind[ArrayList]) {} + runbind + /*java.lang.AssertionError: assertion failed: java.io.Serializable + at scala.Predef$.assert(Predef.scala:107) + at scala.tools.nsc.symtab.Types$TypeRef.transform(Types.scala:1417) + at scala.tools.nsc.symtab.Types$TypeRef.baseType(Types.scala:1559) + */ +} |