From d2faeb9ae60389668f1b5f45eb91c73127401e40 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Thu, 23 May 2013 09:25:11 +0200 Subject: SI-7507 Fix lookup of private[this] member in presence of self type. In the following code: trait Cake extends Slice trait Slice { self: Cake => // must have self type that extends `Slice` private[this] val bippy = () // must be private[this] locally(bippy) } `ThisType()`.findMember(bippy)` excluded the private local member on the grounds that the first class in the base type sequence, `Cake`, was not contained in `Slice`. scala> val thisType = typeOf[Slice].typeSymbol.thisType thisType: $r.intp.global.Type = Slice.this.type scala> thisType.baseClasses res6: List[$r.intp.global.Symbol] = List(trait Cake, trait Slice, class Object, class Any) This commit changes `findMember` to use the symbol of the `ThisType`, rather than the first base class, as the location of the selection. --- test/files/neg/t7507.check | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 test/files/neg/t7507.check (limited to 'test/files/neg/t7507.check') diff --git a/test/files/neg/t7507.check b/test/files/neg/t7507.check new file mode 100644 index 0000000000..d402869fd4 --- /dev/null +++ b/test/files/neg/t7507.check @@ -0,0 +1,4 @@ +t7507.scala:6: error: value bippy in trait Cake cannot be accessed in Cake + locally(bippy) + ^ +one error found -- cgit v1.2.3