- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Nested object regression
Sorry I didn't find this sooner, but this one is a silent killer:
https://lampsvn.epfl.ch/trac/scala/ticket/4565
scala> def foo = { object A; def a(x: Any) = x == A; a(A)}
foo: Boolean
scala> foo
res9: Boolean = true
scala> trait T { def foo = { object A; def a(x: Any) = x == A; a(A)} };
defined trait T
scala> new T{}.foo
res10: Boolean = false
-jason










Re: Nested object regression
I just noticed that it also regressed from 2.8.1 to 2.8.2. Jira seems to be out of action right now, but I'll reopen the ticket when it's back.
-jason
Welcome to Scala version 2.8.2.final (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_29).Type in expressions to have them evaluated.Type :help for more information.
scala> def foo = { object A; def a(x: Any) = x == A; a(A)}foo: Boolean
scala> foores0: Boolean = true
scala> trait T { def foo = { object A; def a(x: Any) = x == A; a(A)} }; defined trait T
scala> new T{}.foores1: Boolean = false
On Wed, May 11, 2011 at 7:43 AM, Jason Zaugg <jzaugg [at] gmail [dot] com> wrote:
Re: Nested object regression
On 05/11/2011 07:43 AM, Jason Zaugg wrote:
> Sorry I didn't find this sooner, but this one is a silent killer:
>
> https://lampsvn.epfl.ch/trac/scala/ticket/4565
>
> scala> def foo = { object A; def a(x: Any) = x == A; a(A)}
> foo: Boolean
>
> scala> foo
> res9: Boolean = true
>
> scala> trait T { def foo = { object A; def a(x: Any) = x == A; a(A)} };
> defined trait T
>
> scala> new T{}.foo
> res10: Boolean = false
>
> -jason
Fixed. Thanks for reporting it.
hubert
Re: Nested object regression
On Wed, May 11, 2011 at 2:40 PM, Hubert Plociniczak <hubert [dot] plociniczak [at] epfl [dot] ch> wrote:
Woot! Yay for Hubert!
--
Viktor Klang,
Director of Research and Development
Scalable Solutions
Code: github.com/viktorklang
Follow: twitter.com/viktorklang
Read: klangism.tumblr.com
Re: Nested object regression
2011/5/11 √iktor Ҡlang :
>
>
> On Wed, May 11, 2011 at 2:40 PM, Hubert Plociniczak
> wrote:
>> Fixed. Thanks for reporting it.
>
> Woot! Yay for Hubert!
And Iulian, by the looks, for the epic test case.
http://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/test/files/run/t45...
Great work!
-jason
Re: Nested object regression
On Wed, May 11, 2011 at 3:27 PM, Jason Zaugg wrote:
> 2011/5/11 √iktor Ҡlang :
>>
>>
>> On Wed, May 11, 2011 at 2:40 PM, Hubert Plociniczak
>> wrote:
>>> Fixed. Thanks for reporting it.
>>
>> Woot! Yay for Hubert!
>
> And Iulian, by the looks, for the epic test case.
>
> http://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/test/files/run/t4565_2.scala?rev=24923
Even better one, in
http://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/test/files/run/inn...
(unfortunately the 3-level deep test that I initially provided
couldn't 'scale' to multithreaded tests and more nesting contexts)..
iulian
>
> Great work!
>
> -jason
>
Re: Nested object regression
On Wed, May 11, 2011 at 7:43 AM, Jason Zaugg <jzaugg [at] gmail [dot] com> wrote:
Ouch. Thanks for uncovering this. We will work on a fix immediately.
-- Martin