K2 Scripting: add annotation resolving for scripts
#KT-62400 fixed
This commit is contained in:
committed by
Space Team
parent
31f9e9e7a8
commit
02dc3c4ddb
+11
@@ -33,6 +33,17 @@ class ScriptCompilerTest : TestCase() {
|
||||
assertTrue(res.reports.none { it.message.contains("nonsense") })
|
||||
}
|
||||
|
||||
fun testDeprecationAnnotation() {
|
||||
val res = compile("""
|
||||
@Deprecated("BECAUSE")
|
||||
fun deprecatedFunction() {}
|
||||
deprecatedFunction()
|
||||
""".trimIndent().toScriptSource()) {}
|
||||
|
||||
assertTrue(res is ResultWithDiagnostics.Success)
|
||||
assertTrue(res.reports.any { it.message.contains("deprecatedFunction(): Unit' is deprecated. BECAUSE") })
|
||||
}
|
||||
|
||||
fun testSimpleVarAccess() {
|
||||
val res = compileToClass(
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user