Skip to content

Position of Some type generates warning #21672

Closed
@MateuszKubuszok

Description

@MateuszKubuszok

Compiler version

3.3.4

Minimized code

//> using scala 3.3.4
//> using option -Xcheck-macros
//> using test.dep org.scalameta::munit:1.0.2

object Repro {

  inline def apply(): Unit = ${ applyImpl }

  import scala.quoted.*
  def applyImpl(using q: Quotes): Expr[Unit] = {
   import q.*, q.reflect.*
   report.info(TypeRepr.of[Some[String]].typeSymbol.pos.toString)
   '{ () }
  }
}
class Test extends munit.FunSuite {

  test("sdfsdf") {
    Repro()
  }
}

Output

[warn] ./test.test.scala:4:5
[warn] Missing symbol position (defaulting to position 0): class Some
[warn] This is a compiler bug. Please report it.
[warn]     Repro()
[warn]     ^^^^^^^

Expectation

No warning.

This might be troublesome for macro libraries with -Xcheck-macros and -Xfatal-warnings.

The bug might be older than 3.3.4, since 3.3.4 just added the check, 3.3.3 might have the same issue but there was no check for it.

Metadata

Metadata

Assignees

Labels

area:reportingError reporting including formatting, implicit suggestions, etcitype: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