Skip to content

Cyclic macro dependencies "caused" by a dash (-) in the filename? #22670

Open
@TomasMikula

Description

@TomasMikula

Compiler version

3.6.3

Minimized code

my-macro.scala (if renamed to myMacro.scala, works fine)

import scala.quoted.*

transparent inline def foo =
  ${ fooImpl }

def fooImpl(using Quotes): Expr[Any] =
  Expr("hello")

test.scala

val x = foo

Output

% scalac my-macro.scala test.scala
Cyclic macro dependencies in test.scala.
Compilation stopped since no further progress can be made.

To fix this, place macros in one set of files and their callers in another.

Compile with -Xprint-suspension for information.
1 error found

Expectation

Should compile, just like when renamed to myMacro.scala:

% cp my-macro.scala myMacro.scala 
% scalac myMacro.scala test.scala
% echo $?
0

Metadata

Metadata

Assignees

Labels

area:metaprogramming:otherIssues tied to metaprogramming/macros not covered by the other labels.itype:bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions