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

Forward reference through type alias goes undetected #11177

Open
Jasper-M opened this issue Sep 28, 2018 · 1 comment
Open

Forward reference through type alias goes undetected #11177

Jasper-M opened this issue Sep 28, 2018 · 1 comment
Labels
compiler crash fixed in Scala 3 This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/)
Milestone

Comments

@Jasper-M
Copy link
Member

scala> class Foo { 
     |   class Bar
     |   def foo = { 
     |     type T = b.Bar
     |     val a = new T
     |     val b = new Foo 
     |   } 
     | }
error: Error while emitting <console>
value b
@SethTisue
Copy link
Member

Welcome to Scala 3.2.2 (17.0.6, Java OpenJDK 64-Bit Server VM).
Type in expressions for evaluation. Or try :help.
                                                                                                    
scala> class Foo:
     |   class Bar
     |   def foo =
     |     type T = b.Bar
     |     val a = new T
     |     val b = new Foo
     | 
-- [E039] Reference Error: -----------------------------------------------------
5 |    val a = new T
  |                ^
  |               b is a forward reference extending over the definition of a
  |
  | longer explanation available when compiling with `-explain`
1 error found

@SethTisue SethTisue added this to the Backlog milestone Feb 21, 2023
@SethTisue SethTisue added the fixed in Scala 3 This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/) label Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler crash fixed in Scala 3 This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/)
Projects
None yet
Development

No branches or pull requests

3 participants