From 01f6ed8e22d02811fe62b9183d9f84bdda5ede4b Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Thu, 3 May 2012 23:11:05 -0700 Subject: 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. --- test/files/buildmanager/t2556_3/t2556_3.check | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/files/buildmanager/t2556_3') diff --git a/test/files/buildmanager/t2556_3/t2556_3.check b/test/files/buildmanager/t2556_3/t2556_3.check index 37808d2b31..34f90f7f9b 100644 --- a/test/files/buildmanager/t2556_3/t2556_3.check +++ b/test/files/buildmanager/t2556_3/t2556_3.check @@ -9,10 +9,10 @@ invalidate B.scala because it references invalid (no longer inherited) definitio compiling Set(B.scala, C.scala) B.scala:3: error: type mismatch; found : C - required: ?{val x: ?} + required: ?{def x: ?} Note that implicit conversions are not applicable because they are ambiguous: both method any2Ensuring in object Predef of type [A](x: A)Ensuring[A] and method any2ArrowAssoc in object Predef of type [A](x: A)ArrowAssoc[A] - are possible conversion functions from C to ?{val x: ?} + are possible conversion functions from C to ?{def x: ?} println( (new C).x ) ^ -- cgit v1.2.3