Fix "Unexpected message" from daemon when CompilerMessageLocation is null

Recently the CompilerMessageLocation.NO_LOCATION was replaced with a null value.
This caused daemon clients to report "Unexpected message" for compiler messages without location.
This commit is contained in:
Alexey Tsvetkov
2017-04-12 19:18:41 +03:00
parent e160931ec5
commit 6b315259d3
2 changed files with 10 additions and 32 deletions
@@ -65,8 +65,8 @@ fun MessageCollector.reportFromDaemon(outputsCollector: ((File, List<File>) -> U
ReportSeverity.DEBUG -> CompilerMessageSeverity.LOGGING
else -> throw IllegalStateException("Unexpected compiler message report severity $severity")
}
if (message != null && attachment is CompilerMessageLocation?) {
report(compilerSeverity, message, attachment)
if (message != null) {
report(compilerSeverity, message, attachment as? CompilerMessageLocation)
}
else {
reportUnexpected(category, severity, message, attachment)