How to distinguish compiler-inferred implicit conversion from explicitly invoked one?
问题 Let's imagine passing these two equivalent expressions to a Scala macro: with compiler-inferred implicit conversion: 1+"foo" with explicitly invoked implicit conversion: any2stringadd(1)+"foo" Is there a way to distinguish between these two inside the macro? 回答1: First of all, the 1 + "foo" case is going to be tricky because there isn't actually any implicit conversion happening there: Int itself really, truly does have this + method (unfortunately). So you're out of luck if that's your use