Skip to content

False positive unused import in 3.7 nightly for value only used for export #22983

Closed
@mrdziuban

Description

@mrdziuban

Compiler version

3.7.0-RC2 and latest nightly 3.7.1-RC1-bin-20250411-98c84c3-NIGHTLY

Minimized code

object test1 {
  object foo {
    type X = Int
  }
}

object test2 {
  import test1.foo

  export foo.X
}

Output

-- [E198] Unused Symbol Warning: -----------------------------------------------
8 |  import test1.foo
  |               ^^^
  |               unused import

Expectation

The import should not be reported unused since it's required for the export foo.X statement.

Metadata

Metadata

Assignees

Labels

area:lintingLinting warnings enabled with -W or -Xlintitype:bugregressionThis worked in a previous version but doesn't anymore

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions