How to access compiler settings from a Scala 3 macro?

In Scala 2, given a blackbox.Context or whitebox.Context, we could could call c.compilerSettings and access compiler flags and other settings.

Is there a way to achieve the same thing in Scala 3 ?

Thanks in advance !

I searched about that for one of my projects and it seems there is no interface for this. However, you can use Java properties (-Dprop=foo) instead.

Giving this a bump hoping that someone found a solution during the two years that have passed.

In my specific case, I’m looking for a way to access the value of Xmaxinlines (during derivation of type classes).

Appropriative discussion item: add the ability to read more environmet information. (list of compiler plugins, target JVM version) · lampepfl/dotty · Discussion #18074 · GitHub

1 Like