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

Type alias for generic is lost in repl #5177

Open
abeln opened this issue Sep 27, 2018 · 0 comments · May be fixed by #14586
Open

Type alias for generic is lost in repl #5177

abeln opened this issue Sep 27, 2018 · 0 comments · May be fixed by #14586

Comments

@abeln
Copy link
Contributor

abeln commented Sep 27, 2018

In the repl:

scala> class C[T]
// defined class C

scala> type B = C
// defined alias type B = C

scala> def b: B[String] = ??? 
def b: C[String]

Notice that b's type is displayed as C[String], as opposed to the declared B[String].

This seems to be a repl issue, because -Xprint:frontend in the compiler shows:

  class Foo() extends Object() { 
    class C[T >: Nothing <: Any]() extends Object() { 
       T
    }
    type B = C
    def c: Foo.this.C[String] = ???
    def b: Foo.this.B[String] = this.c
  }
}

Which seems fine.

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

Successfully merging a pull request may close this issue.

2 participants