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

Self type get ignored when used with type alias #7967

Closed
scabug opened this issue Nov 12, 2013 · 4 comments
Closed

Self type get ignored when used with type alias #7967

scabug opened this issue Nov 12, 2013 · 4 comments
Assignees
Milestone

Comments

@scabug
Copy link

@scabug scabug commented Nov 12, 2013

Below code compiles:

Welcome to Scala version 2.10.3 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_4
5).
Type in expressions to have them evaluated.
Type :help for more information.

scala> object A {
     | trait B
     | trait C {self: B =>}
     | }
defined module A

scala> trait Alias {
     | type B = A.B
     | type C = A.C
     | }
defined trait Alias

scala> new Alias { new C{} }
res0: Alias = $anon$1@5636bc0a
@scabug
Copy link
Author

@scabug scabug commented Nov 12, 2013

Imported From: https://issues.scala-lang.org/browse/SI-7967?orig=1
Reporter: Junhai Zheng (junhz)
Affected Versions: 2.10.3

@scabug
Copy link
Author

@scabug scabug commented Nov 12, 2013

@retronym said:
Could you please elaborate on why you believe there is a bug here? I don't see one.

@scabug
Copy link
Author

@scabug scabug commented Nov 12, 2013

@retronym said:
Oh, I see it now:

trait B
trait C {self: B =>}

object Test {
  new C {} // fails
  type CC = C
  new CC {} // should fail, doesn't
}

@scabug
Copy link
Author

@scabug scabug commented Nov 13, 2013

@scabug scabug closed this Nov 25, 2013
@scabug scabug added the critical label Apr 7, 2017
@scabug scabug added this to the 2.11.0-M8 milestone Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants