lampepfl / dotty-feature-requests

Historical feature requests. Please create new feature requests at https://github.com/lampepfl/dotty/discussions/new?category=feature-requests
31 stars 2 forks source link

can't define case class with experimental constructor #267

Closed bishabosha closed 1 year ago

bishabosha commented 3 years ago

Compiler version

3.1.0

Minimized code

case class Bar @annotation.experimental private ()

Output

Two errors are outputted

-- Error:
1 |case class Bar @annotation.experimental private ()
  |^
  |constructor Bar is marked @experimental and therefore may only be used in an experimental scope.
-- Error:
1 |case class Bar @annotation.experimental private ()
  |           ^
  |constructor Bar is marked @experimental and therefore may only be used in an experimental scope.

Expectation

no errors, e.g. if I remove case it works.

Maybe related to https://github.com/lampepfl/dotty/issues/13848 in that annotations are apparently not copied to Bar.apply or Bar.copy

odersky commented 2 years ago

Let's deal with it once we have a real pressing need.