8000 Exporting `this.xxx` in `this` compiles without warning · Issue #22147 · scala/scala3 · GitHub
[go: up one dir, main page]

Skip to content
Exporting this.xxx in this compiles without warning #22147
@EugeneFlesselle

Description

@EugeneFlesselle

Compiler version

Scala compiler version 3.6.4-RC1-bin-SNAPSHOT-nonbootstrapped-git-bd07317 -- Copyright 2002-2024, LAMP/EPFL

Minimized example

trait P:
  def foo: Int

class A extends P:
  export this.foo

Output

No error or warning.
We generate the following cyclic definition:

class A() extends Object(), Test.P {
  export this.foo
  final def foo: Int = this.foo
}

Expectation

I would expect at least a warning here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    SpreeSuitable for a future Spreearea:exportarea:reportingError reporting including formatting, implicit suggestions, etcitype:bug

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0