I'm updating some broken Timber lints to work better with Kotlin consumers and noticed an interesting phenomenon when running the "usingAndroidLogWithThreeArguments" test on this Kotlin source:
package foo
import android.util.Log
class Example {
fun log() {
Log.d("TAG", "msg", Exception())
}
}
Expected quickfix suggestion:
|Fix for src/foo/Example.kt line 5: Replace with Timber.d(Exception(), "msg"):
|@@ -5 +5
|- Log.d("TAG", "msg", Exception())
|+ Timber.d(Exception(), "msg")
Actual quickfix suggestion:
|Fix for src/foo/Example.kt line 5: Replace with Timber.d(<init>(), "msg"):
|@@ -5 +5
|- Log.d("TAG", "msg", <init>())
|+ Timber.d(<init>(), "msg")
The issue goes away if I use an Exception overload (i.e., Exception(String) or Exception(Throwable)).
Any idea why the empty constructor overload of Exception would resolve to <init>()?