dwickern / scala-nameof

Get the name of an variable, function, class member, or type as a string--at compile-time!
MIT License
131 stars 23 forks source link

doesn't work for Java compile-time constants #5

Closed dwickern closed 3 years ago

dwickern commented 6 years ago
public class JavaConstants {
    public static final int FOO = 42;
}
nameOf(JavaConstants.FOO) // compile error

The identifier is replaced with the constant value 42 before the macro evaluates.