fix a few more tests
This commit is contained in:
@@ -15,7 +15,7 @@ val parenthesizedParameters2 = { (<!UNRESOLVED_REFERENCE!>b<!>) <!SYNTAX!>-><!>
|
||||
val none = { -> }
|
||||
|
||||
|
||||
val parameterWithFunctionType = { <!UNRESOLVED_REFERENCE!>a<!><!SYNTAX!>: ((Int) -> Int) -><!> } // todo fix parser
|
||||
val parameterWithFunctionType = { a: ((Int) -> Int) -> <!SYNTAX!><!>} // todo fix parser
|
||||
|
||||
val newSyntax = { a: Int -> }
|
||||
val newSyntax1 = { <!CANNOT_INFER_PARAMETER_TYPE!>a<!>, <!CANNOT_INFER_PARAMETER_TYPE!>b<!> -> }
|
||||
|
||||
@@ -6,7 +6,7 @@ public val newSyntax2: (kotlin.Int, kotlin.Int) -> kotlin.Unit
|
||||
public val newSyntax3: (???, kotlin.Int) -> kotlin.Unit
|
||||
public val newSyntax4: (kotlin.Int, ???) -> kotlin.Unit
|
||||
public val none: () -> kotlin.Unit
|
||||
public val parameterWithFunctionType: () -> ???
|
||||
public val parameterWithFunctionType: (((kotlin.Int) -> kotlin.Int) -> [ERROR : No type element]) -> kotlin.Unit
|
||||
public val parenthesizedParameters: () -> ???
|
||||
public val parenthesizedParameters2: () -> ???
|
||||
public val receiver: () -> ???
|
||||
|
||||
+4
-4
@@ -1,10 +1,10 @@
|
||||
public class KOuter: Outer() {
|
||||
public inner class X(bar: String? = (this@KOuter : Outer).A().bar): Outer.A() {
|
||||
var next: Outer.A? = (this@KOuter : Outer).A()
|
||||
val myBar: String? = (this@KOuter : Outer).A().bar
|
||||
public inner class X(bar: String? = (this@KOuter as Outer).A().bar): Outer.A() {
|
||||
var next: Outer.A? = (this@KOuter as Outer).A()
|
||||
val myBar: String? = (this@KOuter as Outer).A().bar
|
||||
|
||||
init {
|
||||
(this@KOuter : Outer).A().bar = ""
|
||||
(this@KOuter as Outer).A().bar = ""
|
||||
}
|
||||
|
||||
fun foo(a: Outer.A) {
|
||||
|
||||
+6
-6
@@ -1,15 +1,15 @@
|
||||
Class/object property type (3: 25) var next: Outer.A? = (this@KOuter : Outer).A()
|
||||
Class/object property type (3: 25) var next: Outer.A? = (this@KOuter as Outer).A()
|
||||
Function return types (15: 30) fun getNext(): Outer.A? {
|
||||
Function return types (29: 22) fun Any.toA(): Outer.A? {
|
||||
Local variable declaration (11: 27) val aa: Outer.A = a
|
||||
New instance creation (25: 39) fun KOuter.X.bar(a: Outer.A = Outer().A()) {
|
||||
New instance creation (2: 63) public inner class X(bar: String? = (this@KOuter : Outer).A().bar): Outer.A() {
|
||||
New instance creation (3: 52) var next: Outer.A? = (this@KOuter : Outer).A()
|
||||
New instance creation (4: 52) val myBar: String? = (this@KOuter : Outer).A().bar
|
||||
New instance creation (7: 35) (this@KOuter : Outer).A().bar = ""
|
||||
New instance creation (2: 64) public inner class X(bar: String? = (this@KOuter as Outer).A().bar): Outer.A() {
|
||||
New instance creation (3: 53) var next: Outer.A? = (this@KOuter as Outer).A()
|
||||
New instance creation (4: 53) val myBar: String? = (this@KOuter as Outer).A().bar
|
||||
New instance creation (7: 36) (this@KOuter as Outer).A().bar = ""
|
||||
Parameter type (10: 26) fun foo(a: Outer.A) {
|
||||
Parameter type (25: 27) fun KOuter.X.bar(a: Outer.A = Outer().A()) {
|
||||
Super type qualifier (20: 25) super<Outer.A>.foo()
|
||||
Supertype (2: 79) public inner class X(bar: String? = (this@KOuter : Outer).A().bar): Outer.A() {
|
||||
Supertype (2: 80) public inner class X(bar: String? = (this@KOuter as Outer).A().bar): Outer.A() {
|
||||
Target type of 'is' operation (30: 30) return if (this is Outer.A) this as Outer.A else null
|
||||
Usage in cast target type (30: 47) return if (this is Outer.A) this as Outer.A else null
|
||||
|
||||
@@ -47,5 +47,5 @@ fun Any.asServer(): Server? {
|
||||
when (this) {
|
||||
is Server -> println("Server!")
|
||||
}
|
||||
return if (this is Server) this: Server else this as? Server
|
||||
return if (this is Server) this as Server else this as? Server
|
||||
}
|
||||
+3
-3
@@ -12,11 +12,11 @@ Supertype (23: 23) companion object: Server() {
|
||||
Supertype (28: 22) object ClientObject: Server() {
|
||||
Supertype (5: 43) class Client(name: String = Server.NAME): Server() {
|
||||
Target type of 'is' operation (48: 12) is Server -> println("Server!")
|
||||
Target type of 'is' operation (50: 24) return if (this is Server) this: Server else this as? Server
|
||||
Target type of 'is' operation (50: 24) return if (this is Server) this as Server else this as? Server
|
||||
Type parameter (32: 25) class Servers: Iterator<Server> {
|
||||
Type parameter (36: 14) fun Iterator<Server>.f(p: Iterator<Server>): Iterator<Server> = this
|
||||
Type parameter (36: 36) fun Iterator<Server>.f(p: Iterator<Server>): Iterator<Server> = this
|
||||
Type parameter (36: 55) fun Iterator<Server>.f(p: Iterator<Server>): Iterator<Server> = this
|
||||
Usage in cast target type (50: 38) return if (this is Server) this: Server else this as? Server
|
||||
Usage in cast target type (50: 59) return if (this is Server) this: Server else this as? Server
|
||||
Usage in cast target type (50: 40) return if (this is Server) this as Server else this as? Server
|
||||
Usage in cast target type (50: 61) return if (this is Server) this as Server else this as? Server
|
||||
Usage in import (3: 15) import server.Server
|
||||
|
||||
+4
-4
@@ -3,12 +3,12 @@ package b
|
||||
import a.Outer
|
||||
|
||||
public class KOuter: Outer() {
|
||||
public inner class X(bar: String? = (this@KOuter : Outer).A().bar): Outer.A() {
|
||||
var next: Outer.A? = (this@KOuter : Outer).A()
|
||||
val myBar: String? = (this@KOuter : Outer).A().bar
|
||||
public inner class X(bar: String? = (this@KOuter as Outer).A().bar): Outer.A() {
|
||||
var next: Outer.A? = (this@KOuter as Outer).A()
|
||||
val myBar: String? = (this@KOuter as Outer).A().bar
|
||||
|
||||
init {
|
||||
(this@KOuter : Outer).A().bar = ""
|
||||
(this@KOuter as Outer).A().bar = ""
|
||||
}
|
||||
|
||||
fun foo(a: Outer.A) {
|
||||
|
||||
+6
-6
@@ -1,17 +1,17 @@
|
||||
[kotlinInnerClassAllUsages.1.kt] Class/object property type (7: 25) var next: Outer.A? = (this@KOuter : Outer).A()
|
||||
[kotlinInnerClassAllUsages.1.kt] Class/object property type (7: 25) var next: Outer.A? = (this@KOuter as Outer).A()
|
||||
[kotlinInnerClassAllUsages.1.kt] Function return types (19: 30) fun getNext(): Outer.A? {
|
||||
[kotlinInnerClassAllUsages.1.kt] Function return types (33: 22) fun Any.toA(): Outer.A? {
|
||||
[kotlinInnerClassAllUsages.1.kt] Function return types (37: 27) fun Any.asServer(): Outer.A? {
|
||||
[kotlinInnerClassAllUsages.1.kt] Local variable declaration (15: 27) val aa: Outer.A = a
|
||||
[kotlinInnerClassAllUsages.1.kt] New instance creation (11: 35) (this@KOuter : Outer).A().bar = ""
|
||||
[kotlinInnerClassAllUsages.1.kt] New instance creation (11: 36) (this@KOuter as Outer).A().bar = ""
|
||||
[kotlinInnerClassAllUsages.1.kt] New instance creation (29: 39) fun KOuter.X.bar(a: Outer.A = Outer().A()) {
|
||||
[kotlinInnerClassAllUsages.1.kt] New instance creation (6: 63) public inner class X(bar: String? = (this@KOuter : Outer).A().bar): Outer.A() {
|
||||
[kotlinInnerClassAllUsages.1.kt] New instance creation (7: 52) var next: Outer.A? = (this@KOuter : Outer).A()
|
||||
[kotlinInnerClassAllUsages.1.kt] New instance creation (8: 52) val myBar: String? = (this@KOuter : Outer).A().bar
|
||||
[kotlinInnerClassAllUsages.1.kt] New instance creation (6: 64) public inner class X(bar: String? = (this@KOuter as Outer).A().bar): Outer.A() {
|
||||
[kotlinInnerClassAllUsages.1.kt] New instance creation (7: 53) var next: Outer.A? = (this@KOuter as Outer).A()
|
||||
[kotlinInnerClassAllUsages.1.kt] New instance creation (8: 53) val myBar: String? = (this@KOuter as Outer).A().bar
|
||||
[kotlinInnerClassAllUsages.1.kt] Parameter type (14: 26) fun foo(a: Outer.A) {
|
||||
[kotlinInnerClassAllUsages.1.kt] Parameter type (29: 27) fun KOuter.X.bar(a: Outer.A = Outer().A()) {
|
||||
[kotlinInnerClassAllUsages.1.kt] Super type qualifier (24: 25) super<Outer.A>.foo()
|
||||
[kotlinInnerClassAllUsages.1.kt] Supertype (6: 79) public inner class X(bar: String? = (this@KOuter : Outer).A().bar): Outer.A() {
|
||||
[kotlinInnerClassAllUsages.1.kt] Supertype (6: 80) public inner class X(bar: String? = (this@KOuter as Outer).A().bar): Outer.A() {
|
||||
[kotlinInnerClassAllUsages.1.kt] Target type of 'is' operation (34: 30) return if (this is Outer.A) this as Outer.A else null
|
||||
[kotlinInnerClassAllUsages.1.kt] Target type of 'is' operation (38: 30) return if (this is Outer.A) this as Outer.A else null
|
||||
[kotlinInnerClassAllUsages.1.kt] Usage in cast target type (34: 47) return if (this is Outer.A) this as Outer.A else null
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// IS_APPLICABLE: true
|
||||
fun foo() {
|
||||
<caret>bar({ 2 * it } as (Int) -> Int)
|
||||
<caret>bar({ i: Int -> 2 * i })
|
||||
}
|
||||
|
||||
fun bar<T>(t: T): Int = 1
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// IS_APPLICABLE: true
|
||||
fun foo() {
|
||||
bar<(Int) -> Int>({ 2 * it } as (Int) -> Int)
|
||||
bar<(Int) -> Int>({ i: Int -> 2 * i })
|
||||
}
|
||||
|
||||
fun bar<T>(t: T): Int = 1
|
||||
@@ -1,10 +1,6 @@
|
||||
// "Suppress 'REDUNDANT_NULLABLE' for statement " "true"
|
||||
// "Suppress 'USELESS_CAST' for statement " "true"
|
||||
|
||||
fun foo() {
|
||||
var v = Box<String?>()
|
||||
(v as Box<String?<caret>?>)++
|
||||
val arr = IntArray(1)
|
||||
arr[1 a<caret>s Int]++
|
||||
}
|
||||
|
||||
class Box<T> {
|
||||
fun inc() = this
|
||||
}
|
||||
@@ -1,11 +1,7 @@
|
||||
// "Suppress 'REDUNDANT_NULLABLE' for statement " "true"
|
||||
// "Suppress 'USELESS_CAST' for statement " "true"
|
||||
|
||||
fun foo() {
|
||||
var v = Box<String?>()
|
||||
@Suppress("REDUNDANT_NULLABLE")
|
||||
(v: Box<String?<caret>?>)++
|
||||
val arr = IntArray(1)
|
||||
@Suppress("USELESS_CAST")
|
||||
arr[1 as Int]++
|
||||
}
|
||||
|
||||
class Box<T> {
|
||||
fun inc() = this
|
||||
}
|
||||
@@ -1,10 +1,6 @@
|
||||
// "Suppress 'REDUNDANT_NULLABLE' for statement " "true"
|
||||
// "Suppress 'USELESS_CAST' for statement " "true"
|
||||
|
||||
fun foo() {
|
||||
var v = Box<String?>()
|
||||
++(v as Box<String?<caret>?>)
|
||||
val arr = IntArray(1)
|
||||
++arr[1 a<caret>s Int]
|
||||
}
|
||||
|
||||
class Box<T> {
|
||||
fun inc() = this
|
||||
}
|
||||
@@ -1,11 +1,7 @@
|
||||
// "Suppress 'REDUNDANT_NULLABLE' for statement " "true"
|
||||
// "Suppress 'USELESS_CAST' for statement " "true"
|
||||
|
||||
fun foo() {
|
||||
var v = Box<String?>()
|
||||
@Suppress("REDUNDANT_NULLABLE")
|
||||
++(v: Box<String?<caret>?>)
|
||||
val arr = IntArray(1)
|
||||
@Suppress("USELESS_CAST")
|
||||
++arr[1 as Int]
|
||||
}
|
||||
|
||||
class Box<T> {
|
||||
fun inc() = this
|
||||
}
|
||||
Reference in New Issue
Block a user