Skip to content

Add virtual classes #634

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
scabug opened this issue Mar 14, 2008 · 8 comments
Closed

Add virtual classes #634

scabug opened this issue Mar 14, 2008 · 8 comments

Comments

@scabug
Copy link

scabug commented Mar 14, 2008

Finish implementing virtual classes based upon the current proposal.

@scabug
Copy link
Author

scabug commented Mar 14, 2008

Imported From: https://issues.scala-lang.org/browse/SI-634?orig=1
Reporter: Geoffrey Alan Washburn (washburn)

@scabug
Copy link
Author

scabug commented Jul 22, 2008

Geoffrey Alan Washburn (washburn) said:
Lots of problems with this at present. Maybe the visiting student this fall can come up with something.

@scabug
Copy link
Author

scabug commented Aug 21, 2008

Geoffrey Alan Washburn (washburn) said:
Visiting student has materialized, so I assign it to him.

@scabug
Copy link
Author

scabug commented Jan 14, 2009

@odersky said:
Milestone next_feature deleted

@scabug
Copy link
Author

scabug commented Jul 3, 2010

@paulp said:
Given that a bunch of less ambitious tickets have been closed as requiring a SID, I'm closing this as requiring a SID. Or at least requiring something other than a limbo ticket.

@scabug
Copy link
Author

scabug commented Dec 11, 2013

@soc said:
An example where things currently behave in a way which seems to violate a lot of reasonable expectations:

  class Foo {
    class Bar {
      def foo = 1
    }
  }
 
  class SubFoo extends Foo {
    class Bar {
      def foo = 42
    }
  }

// Let's create some instances:
  val foo = new Foo
  val fooBar = new foo.Bar
  fooBar.foo                                      //> res0: Int = 1
  // ok

  val subFoo = new SubFoo
  val subFooBar = new subFoo.Bar
  subFooBar.foo                                   //> res1: Int = 42
  // ok

  val superFoo: Foo = subFoo
  val superFooBar = new superFoo.Bar
  superFooBar.foo                                 //> res2: Int = 1
  // NOT OK!

The last result is scary, because the syntax looks like things are dynamically bound, but the method is called on the static type instead.

Mailing list: https://groups.google.com/d/topic/scala-language/vQYwywr0LL4/discussion

@scabug
Copy link
Author

scabug commented Feb 11, 2014

@soc said:
I'm assigning this to me for now. I'll ping the person who wanted to work on virtual classes for Scala and see what's his status.
Otherwise, I'll look into it for 2.12 myself.

@scabug
Copy link
Author

scabug commented Feb 11, 2014

@soc said:
Reopening, so that I don't forget to look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant