Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions compiler/src/dotty/tools/dotc/typer/Checking.scala
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,7 @@ object Checking {
checkCombination(Private, Protected)
checkCombination(Abstract, Override)
checkCombination(Private, Override)
checkCombination(Private, Opaque)
checkCombination(Lazy, Inline)
// The issue with `erased inline` is that the erased semantics get lost
// as the code is inlined and the reference is removed before the erased usage check.
Expand Down
2 changes: 2 additions & 0 deletions docs/_docs/reference/other-new-features/opaques-details.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ object o:
def id(x: o.T): o.T = x
```

Opaque type aliases cannot be `private` and cannot overridden in subclasses.

## Type Parameters of Opaque Types

Opaque type aliases can have a single type parameter list. The following aliases
Expand Down
2 changes: 2 additions & 0 deletions tests/neg/i14660.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class Bar:
private opaque type Baz = Int // error