Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6152821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:59:09+00:00 2026-05-23T19:59:09+00:00

On migrating our code to Scala 2.9 we’ve found large swathes of it that

  • 0

On migrating our code to Scala 2.9 we’ve found large swathes of it that didn’t work and failed silently. We tracked it down to case classes that extend Proxy not being equal. In our code we don’t extend Proxy directly, we just extend classes in libraries that extend Proxy.

Any help would be greatly appreciated.

In 2.8

scala> case class Test(a:String) extends Proxy {
     |   def self = a
     | }
defined class Test

scala> 

scala> val label = new Test("bla")
label: Test = bla

scala> println(label == label) // this is TRUE
true

scala> println(label == "bla")
true

In 2.9

scala> case class Test(a:String) extends Proxy {
     |   def self = a
     | }
defined class Test

scala> 

scala> val label = new Test("bla")
label: Test = bla

scala> println(label == label) // this is now FALSE
false

scala> println(label == "bla")
true

Update

I think this can only be a bug in Scala 2.9. Otherwise if you have a case class that extends any other class you have to investigate that base class’s hierarchy to make sure at no point is it extending Proxy. We won’t be able to do this in our code, we’ll just be able to fix the more obvious bugs. If this is intended behaviour then a compiler warning is a must. Does that sound about right?

Update

Also being discussed on the scala mailing list.

Update

I’ve filed a bug

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T19:59:11+00:00Added an answer on May 23, 2026 at 7:59 pm

    In 2.9 they changed the equals method from:

    override def equals(that: Any): Boolean = 
      if(that == null) false 
      else that equals self
    

    to

    override def equals(that: Any): Boolean = that match {
     case null       => false
     case x: Equals  => (x canEqual self) && (x equals self)
     case x          => (x equals self)
    }
    

    x: Equals doesn’t equal self for some reason.

    You can override the equals method to fix it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We're finally migrating our unit test code base from JUnit 3 to JUnit 4.
How much of an impact will migrating to Flex 4 have on our code
We are migrating our web sites from Win2003/IIS6 to Win2008/IIS7. Our .NET code is
My DBA just lost some development work that he did on our development database.
We are currently considering migrating our database code in php to Doctrine2. It seems
We have custom code that wipes and initializes our test database by creating a
I am migrating some code from Scala 2.10-M5 to Scala 2.10-M7 . I have
I have been working on migrating our code base onto Glassfish 3.1.2 using Java
We're migrating to svn, but once we do, our code history won't be available
I'm in the process of migrating some of our old code into Java and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.