-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
Description
Compiler version
3.8.1-RC1-bin-20251205-cd32c6f-NIGHTLY
Minimized code
def example(a: AnyRef^, b: AnyRef^, c: AnyRef^) =
abstract class Root:
this: Root^{a,b} =>
class Sub extends Root:
val f: AnyRef^ = cOutput
This compiles.
Expectation
It shouldn't: Judging by the language reference, we expect the capture set of a self
type to restrict the captures of subclasses. This example seems counter to this intuition. Oddly enough, if we make the self of Sub explicit, like so:
class Sub extends Root:
this: Sub^ =>
val fld: AnyRef^ = cThen we get an error, as desired.