K2 Scripting: support sam-with-receiver in scripting plugin

This commit is contained in:
Ilya Chernikov
2022-12-06 15:53:31 +01:00
committed by Space Team
parent baf90178ad
commit 90a4f6002e
4 changed files with 68 additions and 8 deletions
@@ -37,8 +37,8 @@ class FeaturesTest : TestCase() {
when (res) {
is ResultWithDiagnostics.Success -> fail("Expecting \"Unresolved reference\" error, got successful compilation")
is ResultWithDiagnostics.Failure ->
if (res.reports.none { it.message.contains("Unresolved reference") }) {
fail("Expecting \"Unresolved reference\" error, got:\n ${res.reports.joinToString("\n ")}")
if (res.reports.none { it.message.contains("Unresolved reference") || it.message.contains("'this' is not defined in this context") }) {
fail("Expecting \"Unresolved reference\" or \"'this' is not defined in this context\" error, got:\n ${res.reports.joinToString("\n ")}")
}
}
}