[FIR-TEST] Update some testdata

This commit is contained in:
Dmitriy Novozhilov
2020-02-07 12:51:44 +03:00
parent 4b6c2f7a65
commit 5ceb68f19f
16 changed files with 52 additions and 51 deletions
@@ -486,7 +486,8 @@ interface ConeTypeContext : TypeSystemContext, TypeSystemOptimizationContext, Ty
getClassFqNameUnsafe()?.startsWith(Name.identifier("kotlin")) == true getClassFqNameUnsafe()?.startsWith(Name.identifier("kotlin")) == true
override fun TypeConstructorMarker.getClassFqNameUnsafe(): FqNameUnsafe? { override fun TypeConstructorMarker.getClassFqNameUnsafe(): FqNameUnsafe? {
return toFirRegularClass()?.symbol?.toLookupTag()?.classId?.asSingleFqName()?.toUnsafe() if (this !is FirClassLikeSymbol<*>) return null
return toLookupTag().classId.asSingleFqName().toUnsafe()
} }
override fun TypeParameterMarker.getName() = (this as FirTypeParameterSymbol).name override fun TypeParameterMarker.getName() = (this as FirTypeParameterSymbol).name
@@ -5,5 +5,5 @@ class Foo {
fun test() { fun test() {
var f = Foo() var f = Foo()
<!ASSIGN_OPERATOR_AMBIGUITY!>f += f<!> <!ASSIGN_OPERATOR_AMBIGUITY, ASSIGN_OPERATOR_AMBIGUITY, ASSIGN_OPERATOR_AMBIGUITY!>f += f<!>
} }
@@ -1,13 +1,13 @@
fun test(c : Char) { fun test(c : Char) {
test(<!INFERENCE_ERROR!>''<!>) test('')
test('a') test('a')
test(<!INFERENCE_ERROR!>'aa'<!>) test('aa')
<!INAPPLICABLE_CANDIDATE!>test<!>(<!INFERENCE_ERROR!>'a)<!> <!INAPPLICABLE_CANDIDATE!>test<!>('a)
<!UNRESOLVED_REFERENCE!>test<!>(<!INFERENCE_ERROR!>'<!> <!UNRESOLVED_REFERENCE!>test<!>('
<!UNRESOLVED_REFERENCE!>test<!>(0<!INFERENCE_ERROR!><!SYNTAX!><!>'<!> <!UNRESOLVED_REFERENCE!>test<!>(0<!SYNTAX!><!>'
<!UNRESOLVED_REFERENCE!>test<!>('\n') <!UNRESOLVED_REFERENCE!>test<!>('\n')
<!UNRESOLVED_REFERENCE!>test<!>('\\') <!UNRESOLVED_REFERENCE!>test<!>('\\')
<!UNRESOLVED_REFERENCE!>test<!>(<!INFERENCE_ERROR!>''<!><!INFERENCE_ERROR!><!SYNTAX!><!>''<!>) <!UNRESOLVED_REFERENCE!>test<!>(''<!SYNTAX!><!>'')
test('\'') test('\'')
test('\"') test('\"')
} }
@@ -2,11 +2,11 @@
// KT-451 Incorrect character literals cause assertion failures // KT-451 Incorrect character literals cause assertion failures
fun ff() { fun ff() {
val b = <!INFERENCE_ERROR, INFERENCE_ERROR!>''<!> val b = ''
val c = <!INFERENCE_ERROR, INFERENCE_ERROR!>'23'<!> val c = '23'
val d = <!INFERENCE_ERROR, INFERENCE_ERROR!>'a<!> val d = 'a
val e = <!INFERENCE_ERROR, INFERENCE_ERROR!>'ab<!> val e = 'ab
val f = <!INFERENCE_ERROR, INFERENCE_ERROR!>'\'<!> val f = '\'
} }
fun test() { fun test() {
@@ -19,19 +19,19 @@ fun test() {
'\'' '\''
'\\' '\\'
'\$' '\$'
<!INFERENCE_ERROR!>'\x'<!> '\x'
<!INFERENCE_ERROR!>'\123'<!> '\123'
<!INFERENCE_ERROR!>'\ra'<!> '\ra'
<!INFERENCE_ERROR!>'\000'<!> '\000'
<!INFERENCE_ERROR!>'\000'<!> '\000'
'\u0000' '\u0000'
'\u000a' '\u000a'
'\u000A' '\u000A'
<!INFERENCE_ERROR!>'\u'<!> '\u'
<!INFERENCE_ERROR!>'\u0'<!> '\u0'
<!INFERENCE_ERROR!>'\u00'<!> '\u00'
<!INFERENCE_ERROR!>'\u000'<!> '\u000'
<!INFERENCE_ERROR!>'\u000z'<!> '\u000z'
<!INFERENCE_ERROR!>'\\u000'<!> '\\u000'
<!INFERENCE_ERROR, INFERENCE_ERROR!>'\'<!> '\'
} }
@@ -11,7 +11,7 @@ fun test(a: Any) {
a foo"asd${a}sfsa" a foo"asd${a}sfsa"
a foo"""sdf""" a foo"""sdf"""
a foo'd' a foo'd'
a foo<!INFERENCE_ERROR!>''<!> a foo''
a foo""foo a a foo""foo a
a foo"asd"foo a a foo"asd"foo a
@@ -19,17 +19,17 @@ fun test(a: Any) {
a foo"asd${a}sfsa"foo a a foo"asd${a}sfsa"foo a
a foo"""sdf"""foo a a foo"""sdf"""foo a
a foo'd'foo a a foo'd'foo a
a foo<!INFERENCE_ERROR!>''<!>foo a a foo''foo a
a in"foo" a in"foo"
a in"""foo""" a in"""foo"""
a in's' a in's'
a in<!INFERENCE_ERROR!>''<!> a in''
a !in"foo" a !in"foo"
a !in"""foo""" a !in"""foo"""
a !in's' a !in's'
a !in<!INFERENCE_ERROR!>''<!> a !in''
if("s"is Any) {} if("s"is Any) {}
if("s"is Any) {} if("s"is Any) {}
@@ -9,7 +9,7 @@ annotation class Foo(
annotation class Bar( annotation class Bar(
val a: Array<String> = [' '], val a: Array<String> = [' '],
val b: Array<String> = ["", <!INFERENCE_ERROR!>''<!>], val b: Array<String> = ["", ''],
val c: Array<String> = [1] val c: Array<String> = [1]
) )
@@ -1,5 +1,5 @@
fun foo1() = <!INFERENCE_ERROR, INFERENCE_ERROR, INFERENCE_ERROR!>while (b()) {}<!> fun foo1() = while (b()) {}
fun foo2() = <!UNRESOLVED_REFERENCE, UNRESOLVED_REFERENCE, UNRESOLVED_REFERENCE!>for (i in 10) {}<!> fun foo2() = <!UNRESOLVED_REFERENCE, UNRESOLVED_REFERENCE, UNRESOLVED_REFERENCE!>for (i in 10) {}<!>
@@ -15,7 +15,7 @@ fun main() {
} }
//KT-351 Distinguish statement and expression positions //KT-351 Distinguish statement and expression positions
val w = <!INFERENCE_ERROR, INFERENCE_ERROR, INFERENCE_ERROR!>while (true) {}<!> val w = while (true) {}
fun foo() { fun foo() {
var z = 2 var z = 2
@@ -152,12 +152,12 @@ fun bar(a: Unit) {}
fun testStatementInExpressionContext() { fun testStatementInExpressionContext() {
var z = 34 var z = 34
val a1: Unit = <!INFERENCE_ERROR!>z = 334<!> val a1: Unit = z = 334
val f = for (i in 1..10) {} val f = for (i in 1..10) {}
if (true) return <!INFERENCE_ERROR, INFERENCE_ERROR!>z = 34<!> if (true) return z = 34
return <!INFERENCE_ERROR, INFERENCE_ERROR!>while (true) {}<!> return while (true) {}
} }
fun testStatementInExpressionContext2() { fun testStatementInExpressionContext2() {
val a2: Unit = <!INFERENCE_ERROR!>while(true) {}<!> val a2: Unit = while(true) {}
} }
@@ -4,7 +4,7 @@
fun foo(block: () -> (() -> Int)) {} fun foo(block: () -> (() -> Int)) {}
fun test() { fun test() {
val x = <!INFERENCE_ERROR, INFERENCE_ERROR, INFERENCE_ERROR!>fun named1(x: Int): Int { return 1 }<!> val x = fun named1(x: Int): Int { return 1 }
x <!INAPPLICABLE_CANDIDATE!>checkType<!> { <!UNRESOLVED_REFERENCE!>_<!><Function1<Int, Int>>() } x <!INAPPLICABLE_CANDIDATE!>checkType<!> { <!UNRESOLVED_REFERENCE!>_<!><Function1<Int, Int>>() }
foo { fun named2(): Int {return 1} } foo { fun named2(): Int {return 1} }
@@ -45,12 +45,12 @@ fun test() {
x4 checkType { <!UNRESOLVED_REFERENCE!>_<!><Function1<Int, Unit>>() } x4 checkType { <!UNRESOLVED_REFERENCE!>_<!><Function1<Int, Unit>>() }
{ y: Int -> fun named14(): Int {return 1} } { y: Int -> fun named14(): Int {return 1} }
val b = <!UNRESOLVED_REFERENCE!>(<!INFERENCE_ERROR!>fun named15(): Boolean { return true }<!>)()<!> val b = <!UNRESOLVED_REFERENCE!>(fun named15(): Boolean { return true })()<!>
baz(<!INFERENCE_ERROR!>fun named16(){}<!>) baz(fun named16(){})
} }
fun bar() = <!INFERENCE_ERROR, INFERENCE_ERROR, INFERENCE_ERROR!>fun named() {}<!> fun bar() = fun named() {}
fun <T> run(block: () -> T): T = null!! fun <T> run(block: () -> T): T = null!!
fun run2(block: () -> Unit): Unit = null!! fun run2(block: () -> Unit): Unit = null!!
@@ -5,5 +5,5 @@ fun foo() {
fun A.foo() {} fun A.foo() {}
(fun A.foo() {}) (fun A.foo() {})
run(<!INFERENCE_ERROR!>fun foo() {}<!>) run(fun foo() {})
} }
@@ -6,12 +6,12 @@ fun foo(i: Int) = i
fun bar(l: Long) = l fun bar(l: Long) = l
fun main() { fun main() {
val i = <!ILLEGAL_CONST_EXPRESSION, INFERENCE_ERROR, INFERENCE_ERROR!>111111111111111777777777777777<!> val i = <!ILLEGAL_CONST_EXPRESSION, ILLEGAL_CONST_EXPRESSION, ILLEGAL_CONST_EXPRESSION!>111111111111111777777777777777<!>
//todo add diagnostic text messages //todo add diagnostic text messages
//report only 'The value is out of range' //report only 'The value is out of range'
//not 'An integer literal does not conform to the expected type Int/Long' //not 'An integer literal does not conform to the expected type Int/Long'
val l: Long = <!ILLEGAL_CONST_EXPRESSION, INFERENCE_ERROR!>1111111111111117777777777777777<!> val l: Long = <!ILLEGAL_CONST_EXPRESSION, ILLEGAL_CONST_EXPRESSION!>1111111111111117777777777777777<!>
foo(<!ILLEGAL_CONST_EXPRESSION, INFERENCE_ERROR!>11111111111111177777777777777<!>) foo(<!ILLEGAL_CONST_EXPRESSION, ILLEGAL_CONST_EXPRESSION!>11111111111111177777777777777<!>)
bar(<!ILLEGAL_CONST_EXPRESSION, INFERENCE_ERROR!>11111111111111177777777777777<!>) bar(<!ILLEGAL_CONST_EXPRESSION, ILLEGAL_CONST_EXPRESSION!>11111111111111177777777777777<!>)
} }
@@ -8,5 +8,5 @@ operator fun RemAndRemAssign.remAssign(x: Int) {}
fun test() { fun test() {
var c = RemAndRemAssign var c = RemAndRemAssign
<!ASSIGN_OPERATOR_AMBIGUITY!>c %= 1<!> <!ASSIGN_OPERATOR_AMBIGUITY, ASSIGN_OPERATOR_AMBIGUITY, ASSIGN_OPERATOR_AMBIGUITY!>c %= 1<!>
} }
@@ -11,7 +11,7 @@ fun test(m: MyInt) {
m += m m += m
var i = 1 var i = 1
<!ASSIGN_OPERATOR_AMBIGUITY!>i += 34<!> <!ASSIGN_OPERATOR_AMBIGUITY, ASSIGN_OPERATOR_AMBIGUITY, ASSIGN_OPERATOR_AMBIGUITY!>i += 34<!>
} }
@@ -9,5 +9,5 @@ fun test() {
val c = C() val c = C()
c += "" c += ""
var c1 = C() var c1 = C()
<!ASSIGN_OPERATOR_AMBIGUITY!>c1 += ""<!> <!ASSIGN_OPERATOR_AMBIGUITY, ASSIGN_OPERATOR_AMBIGUITY, ASSIGN_OPERATOR_AMBIGUITY!>c1 += ""<!>
} }
@@ -15,5 +15,5 @@ fun test() {
val c = C() val c = C()
c.c += "" c.c += ""
var c1 = C1() var c1 = C1()
<!ASSIGN_OPERATOR_AMBIGUITY!>c1.c += ""<!> <!ASSIGN_OPERATOR_AMBIGUITY, ASSIGN_OPERATOR_AMBIGUITY, ASSIGN_OPERATOR_AMBIGUITY!>c1.c += ""<!>
} }
@@ -13,11 +13,11 @@ fun box() : Boolean {
var c = A() var c = A()
val d = c; val d = c;
c %= A(); c %= A();
return (c != d) && <!INFERENCE_ERROR!>(c.p = "yeah")<!> return (c != d) && (c.p = "yeah")
} }
fun box2() : Boolean { fun box2() : Boolean {
var c = A() var c = A()
return <!INFERENCE_ERROR!>(c.p = "yeah")<!> && true return (c.p = "yeah") && true
} }