Skip to content

Constructor proxies of classes with type parameters are not exported #14160

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
dcascaval opened this issue Dec 21, 2021 · 1 comment · Fixed by #14681
Closed

Constructor proxies of classes with type parameters are not exported #14160

dcascaval opened this issue Dec 21, 2021 · 1 comment · Fixed by #14681

Comments

@dcascaval
Copy link

Compiler version

3.1.0

Minimized code

object api:
  export impl.*

object impl:
  class Bar[T](foo: T)

object Test1:
  import api.*
  val value = Bar(0) // Not Found: Bar

object Test2:
  import impl.*
  val value = Bar(0) // Works

object Test3:
  import api.*
  val value = new Bar[Int](0) // Works

Output

[error] 10 |  val value = Bar(0) // Not Found: Bar
[error]    |              ^^^
[error]    |              Not found: Bar

Expectation

When exporting a class that has a type parameter via a facade object, should be able to construct that class without error, having T be inferred rather than explicitly specified, as is the case when the class is imported directly from the implementation object.

@smarter
Copy link
Member

smarter commented Dec 21, 2021

It works if you do new Bar(0), it looks like #12311 needs to be extended to handle exporting constructor proxies of classes with type parameters too.

@smarter smarter changed the title Constructing generic classes exported via facade object fails Constructor proxies of classes with type parameters are not exported Dec 21, 2021
odersky added a commit to dotty-staging/dotty that referenced this issue Mar 13, 2022
@Kordyjan Kordyjan added this to the 3.1.3 milestone Aug 1, 2023
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.

3 participants