Skip to content

False unused local definition for lambda and inline #24265

@eejbyfeldt

Description

@eejbyfeldt

Compiler version

3.7.4-RC2 and 3.8.0-RC1-bin-20251027-520668f-NIGHTLY

Minimized code

//> using options -Wall -Werror

object test {
  inline def f(testFun: => Any) = testFun

  f {
    val i = 1
    summon[i.type <:< Int]
  }
}

Output

-- [E198] Unused Symbol Warning: /home/ejbyfeldt/dev/scala_playground/only_tpe.scala:5:8 
5 |    val i = 1
  |        ^
  |        unused local definition
1 warning found

Expectation

No warning is produced.

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