I've had this hugely annoying AS bug for about 6 m...
# android-studio
m
I've had this hugely annoying AS bug for about 6 months now where there's a false-positive compiler error. It shows as a red underline but the code compiles and runs fine. The only workaround is to randomly edit the line (I add and remove a space) and then the red underline disappears only to reappear maybe a minute later. I haven't reported it because I always assumed I couldn't be the only one getting this, so it would be fixed quickly.
Copy code
Argument type mismatch: actual type is 'String', but '() -> String' was expected.
Here are the relevant code:
Copy code
interface FooLogger {
    fun logw(message: String, t: Throwable? = null)
    fun logw(lazyMessage: () -> String)

    companion object {
        operator fun invoke(name: String): FooLogger = FooLoggerBridge(name)
    }
}

internal object ModuleLogger: FooLogger by FooLogger("BarModule")
I assume it's something to do with the way this
ModuleLogger
implements
FooLogger
EDIT: interestingly, if I use
ModuleLogger.logw
(instead of
logw
with import), it doesn't have a problem.