Skip to content
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

Rules for typing seem to have changed #8

Closed
scabug opened this issue Aug 28, 2007 · 2 comments
Closed

Rules for typing seem to have changed #8

scabug opened this issue Aug 28, 2007 · 2 comments
Assignees

Comments

@scabug
Copy link

scabug commented Aug 28, 2007

Aladdin: [http://scala-webapps.epfl.ch/bugtracking/bugs/displayItem.do?id=1292 bug 1292], [http://scala-webapps.epfl.ch/bugtracking/contribs/display.do?id=764 contrib 764]

== Code ==

trait Foo[T <: Foo[T, Enum], Enum <: Enumeration] {
  type StV = Enum#Value  
  type Meta = MegaFoo[T, Enum]

  type Slog <: Enumeration

  def getSingleton: Meta
}

trait MegaFoo[T <: Foo[T, Enum], Enum <: Enumeration] extends Foo[T, Enum] {
  def doSomething(what: T, misc: StV, dog: Meta#Event) = None
  abstract class Event
  object Event

  def stateEnumeration: Slog
  def se2: Enum
}

object E extends Enumeration {
  val A = Value
  val B = Value
}

class RFoo extends Foo[RFoo, E.type] {
  def getSingleton = MegaRFoo

  type Slog = E.type
}

object MegaRFoo extends RFoo with MegaFoo[RFoo, E.type] {
  def stateEnumeration = E
  def se2 = E
}

== What happened ==

bad.scala:31: error: error overriding method stateEnumeration in trait MegaFoo of type => MegaRFoo.this.Slog;
 method stateEnumeration has incompatible type => object E
  def stateEnumeration = E
  ^
bad.scala:32: error: error overriding method se2 in trait MegaFoo of type => E.type;
 method se2 has incompatible type => object E
  def se2 = E
  ^
two errors found

== What expected ==

Clean Compile

@scabug
Copy link
Author

scabug commented Aug 28, 2007

Imported From: https://issues.scala-lang.org/browse/SI-8?orig=1
Reporter: @michelou
Attachments:

  • acq.html (created on Sep 26, 2010 9:58:47 AM UTC, 12183 bytes)

@scabug
Copy link
Author

scabug commented Jan 14, 2009

@odersky said:
Milestone 2.6.0 deleted

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

No branches or pull requests

2 participants