diff options
author | Paul Phillips <paulp@improving.org> | 2012-05-03 23:11:05 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-05-04 01:22:23 -0700 |
commit | 01f6ed8e22d02811fe62b9183d9f84bdda5ede4b (patch) | |
tree | 6cc9b5a4847ba7940ddd8313a1a906b06024b5bf /test/files/neg/logImplicits.check | |
parent | aad6deae7204a7fc95b59ede61b188bb62f51188 (diff) | |
download | scala-01f6ed8e22d02811fe62b9183d9f84bdda5ede4b.tar.gz scala-01f6ed8e22d02811fe62b9183d9f84bdda5ede4b.tar.bz2 scala-01f6ed8e22d02811fe62b9183d9f84bdda5ede4b.zip |
Fix for one of the oldest open soundness bugs.
Closes SI-963, since it was one of my random 30 it won the prize.
The trick after adding the stability check (which has been sitting
there commented out for 3+ years) was that implicit search depended
on the wrongness, because memberWildcardType would create scopes
with members of the form
?{ val name: tp }
And since a def shouldn't match that, fixing it broke everything
until I flipped it around: memberWildcardType should be seeking
?{ def name: tp }
It could also search for a mutable value: the relevant quality
is that it not be stable so it doesn't have a tighter type than
the members it hopes to match.
Diffstat (limited to 'test/files/neg/logImplicits.check')
-rw-r--r-- | test/files/neg/logImplicits.check | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/files/neg/logImplicits.check b/test/files/neg/logImplicits.check index d98422dacb..54afc6f86d 100644 --- a/test/files/neg/logImplicits.check +++ b/test/files/neg/logImplicits.check @@ -1,16 +1,16 @@ -logImplicits.scala:2: applied implicit conversion from xs.type to ?{val size: ?} = implicit def byteArrayOps(xs: Array[Byte]): scala.collection.mutable.ArrayOps[Byte] +logImplicits.scala:2: applied implicit conversion from xs.type to ?{def size: ?} = implicit def byteArrayOps(xs: Array[Byte]): scala.collection.mutable.ArrayOps[Byte] def f(xs: Array[Byte]) = xs.size ^ -logImplicits.scala:7: applied implicit conversion from String("abc") to ?{val map: ?} = implicit def augmentString(x: String): scala.collection.immutable.StringOps +logImplicits.scala:7: applied implicit conversion from String("abc") to ?{def map: ?} = implicit def augmentString(x: String): scala.collection.immutable.StringOps def f = "abc" map (_ + 1) ^ logImplicits.scala:15: inferred view from String("abc") to Int = C.this.convert:(p: String("abc"))Int math.max(122, x: Int) ^ -logImplicits.scala:19: applied implicit conversion from Int(1) to ?{val ->: ?} = implicit def any2ArrowAssoc[A](x: A): ArrowAssoc[A] +logImplicits.scala:19: applied implicit conversion from Int(1) to ?{def ->: ?} = implicit def any2ArrowAssoc[A](x: A): ArrowAssoc[A] def f = (1 -> 2) + "c" ^ -logImplicits.scala:19: applied implicit conversion from (Int, Int) to ?{val +: ?} = implicit def any2stringadd(x: Any): scala.runtime.StringAdd +logImplicits.scala:19: applied implicit conversion from (Int, Int) to ?{def +: ?} = implicit def any2stringadd(x: Any): scala.runtime.StringAdd def f = (1 -> 2) + "c" ^ logImplicits.scala:22: error: class Un needs to be abstract, since method unimplemented is not defined |