Report UNUSED_PARAMETER on main parameter in 1.3+ #KT-26999 Fixed
This commit is contained in:
@@ -671,7 +671,7 @@ class ControlFlowInformationProvider private constructor(
|
|||||||
val mainFunctionDetector = MainFunctionDetector(trace.bindingContext, languageVersionSettings)
|
val mainFunctionDetector = MainFunctionDetector(trace.bindingContext, languageVersionSettings)
|
||||||
val isMain = owner is KtNamedFunction && mainFunctionDetector.isMain(owner)
|
val isMain = owner is KtNamedFunction && mainFunctionDetector.isMain(owner)
|
||||||
val functionName = functionDescriptor.name
|
val functionName = functionDescriptor.name
|
||||||
if (isMain
|
if (isMain && !languageVersionSettings.supportsFeature(LanguageFeature.ExtendedMainConvention)
|
||||||
|| functionDescriptor.isOverridableOrOverrides
|
|| functionDescriptor.isOverridableOrOverrides
|
||||||
|| owner.hasModifier(KtTokens.OVERRIDE_KEYWORD)
|
|| owner.hasModifier(KtTokens.OVERRIDE_KEYWORD)
|
||||||
|| OperatorNameConventions.GET_VALUE == functionName
|
|| OperatorNameConventions.GET_VALUE == functionName
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ fun box(): String {
|
|||||||
return "OK"
|
return "OK"
|
||||||
}
|
}
|
||||||
|
|
||||||
fun main(args: Array<String>) {
|
fun main(<!UNUSED_PARAMETER!>args<!>: Array<String>) {
|
||||||
D.foo(array())
|
D.foo(array())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ class Test: ATest(), ITest {
|
|||||||
<!CANNOT_CHANGE_ACCESS_PRIVILEGE, SETTER_VISIBILITY_INCONSISTENT_WITH_PROPERTY_VISIBILITY!>internal<!> set(<!UNUSED_PARAMETER!>value<!>) {}
|
<!CANNOT_CHANGE_ACCESS_PRIVILEGE, SETTER_VISIBILITY_INCONSISTENT_WITH_PROPERTY_VISIBILITY!>internal<!> set(<!UNUSED_PARAMETER!>value<!>) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun main(args: Array<String>) {
|
fun main() {
|
||||||
val test = Test()
|
val test = Test()
|
||||||
<!INVISIBLE_SETTER!>test.prop<!> = 12
|
<!INVISIBLE_SETTER!>test.prop<!> = 12
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
public fun main(): kotlin.Unit
|
||||||
|
|
||||||
public abstract class ATest {
|
public abstract class ATest {
|
||||||
public constructor ATest()
|
public constructor ATest()
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ val xsss = foo.<!NO_COMPANION_OBJECT!>X<!>
|
|||||||
val xssss = <!EXPRESSION_EXPECTED_PACKAGE_FOUND!>foo<!>
|
val xssss = <!EXPRESSION_EXPECTED_PACKAGE_FOUND!>foo<!>
|
||||||
val f = { <!NO_COMPANION_OBJECT!>System<!> }
|
val f = { <!NO_COMPANION_OBJECT!>System<!> }
|
||||||
|
|
||||||
fun main(args : Array<String>) {
|
fun main() {
|
||||||
<!EXPRESSION_EXPECTED_PACKAGE_FOUND!>java<!> = null
|
<!EXPRESSION_EXPECTED_PACKAGE_FOUND!>java<!> = null
|
||||||
<!NO_COMPANION_OBJECT!>System<!> = null
|
<!NO_COMPANION_OBJECT!>System<!> = null
|
||||||
<!NO_COMPANION_OBJECT!>System<!>!!
|
<!NO_COMPANION_OBJECT!>System<!>!!
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ package foo {
|
|||||||
public val xss: [ERROR : Type for java.lang.System]
|
public val xss: [ERROR : Type for java.lang.System]
|
||||||
public val xsss: [ERROR : Type for foo.X]
|
public val xsss: [ERROR : Type for foo.X]
|
||||||
public val xssss: [ERROR : Type for foo]
|
public val xssss: [ERROR : Type for foo]
|
||||||
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
public fun main(): kotlin.Unit
|
||||||
|
|
||||||
public final class X {
|
public final class X {
|
||||||
public constructor X()
|
public constructor X()
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@ class C<T>() {
|
|||||||
fun foo(<!UNUSED_PARAMETER!>c<!>: C<Int>) {}
|
fun foo(<!UNUSED_PARAMETER!>c<!>: C<Int>) {}
|
||||||
fun <T> bar() : C<T> {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
fun <T> bar() : C<T> {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||||
|
|
||||||
fun main(args : Array<String>) {
|
fun main() {
|
||||||
val <!UNUSED_VARIABLE!>a<!> : C<Int> = C();
|
val <!UNUSED_VARIABLE!>a<!> : C<Int> = C();
|
||||||
val <!UNUSED_VARIABLE!>x<!> : C<in String> = C()
|
val <!UNUSED_VARIABLE!>x<!> : C<in String> = C()
|
||||||
val <!UNUSED_VARIABLE!>y<!> : C<out String> = C()
|
val <!UNUSED_VARIABLE!>y<!> : C<out String> = C()
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@ package
|
|||||||
|
|
||||||
public fun </*0*/ T> bar(): C<T>
|
public fun </*0*/ T> bar(): C<T>
|
||||||
public fun foo(/*0*/ c: C<kotlin.Int>): kotlin.Unit
|
public fun foo(/*0*/ c: C<kotlin.Int>): kotlin.Unit
|
||||||
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
public fun main(): kotlin.Unit
|
||||||
|
|
||||||
public final class C</*0*/ T> {
|
public final class C</*0*/ T> {
|
||||||
public constructor C</*0*/ T>()
|
public constructor C</*0*/ T>()
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@ import java.lang.SuppressWarnings as suppresswarnings
|
|||||||
|
|
||||||
<!DEPRECATED_JAVA_ANNOTATION!>@deprecated<!> @suppresswarnings val s: String = "";
|
<!DEPRECATED_JAVA_ANNOTATION!>@deprecated<!> @suppresswarnings val s: String = "";
|
||||||
|
|
||||||
<!DEPRECATED_JAVA_ANNOTATION!>@deprecated<!> @suppresswarnings fun main(args : Array<String>) {
|
<!DEPRECATED_JAVA_ANNOTATION!>@deprecated<!> @suppresswarnings fun main() {
|
||||||
System.out.println("Hello, world!")
|
System.out.println("Hello, world!")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@ package
|
|||||||
|
|
||||||
package a {
|
package a {
|
||||||
@field:java.lang.Deprecated @field:java.lang.SuppressWarnings(value = {}) public val s: kotlin.String = ""
|
@field:java.lang.Deprecated @field:java.lang.SuppressWarnings(value = {}) public val s: kotlin.String = ""
|
||||||
@java.lang.Deprecated @java.lang.SuppressWarnings(value = {}) public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
@java.lang.Deprecated @java.lang.SuppressWarnings(value = {}) public fun main(): kotlin.Unit
|
||||||
|
|
||||||
public final class Test {
|
public final class Test {
|
||||||
public constructor Test(/*0*/ @java.lang.Deprecated s: kotlin.String, /*1*/ @java.lang.SuppressWarnings(value = {}) x: kotlin.Int)
|
public constructor Test(/*0*/ @java.lang.Deprecated s: kotlin.String, /*1*/ @java.lang.SuppressWarnings(value = {}) x: kotlin.Int)
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
fun <T> array1(vararg a : T) = a
|
fun <T> array1(vararg a : T) = a
|
||||||
|
|
||||||
fun main(args : Array<String>) {
|
fun main() {
|
||||||
val a = array1("a", "b")
|
val a = array1("a", "b")
|
||||||
val b = array1(1, 1)
|
val b = array1(1, 1)
|
||||||
join(1)
|
join(1)
|
||||||
|
|||||||
@@ -4,4 +4,4 @@ public fun </*0*/ T> array1(/*0*/ vararg a: T /*kotlin.Array<out T>*/): kotlin.A
|
|||||||
public fun join(/*0*/ x: kotlin.Int, /*1*/ vararg a: kotlin.String /*kotlin.Array<out kotlin.String>*/): kotlin.String
|
public fun join(/*0*/ x: kotlin.Int, /*1*/ vararg a: kotlin.String /*kotlin.Array<out kotlin.String>*/): kotlin.String
|
||||||
public fun </*0*/ T> joinG(/*0*/ x: kotlin.Int, /*1*/ vararg a: T /*kotlin.Array<out T>*/): kotlin.String
|
public fun </*0*/ T> joinG(/*0*/ x: kotlin.Int, /*1*/ vararg a: T /*kotlin.Array<out T>*/): kotlin.String
|
||||||
public fun </*0*/ T : kotlin.Any> joinT(/*0*/ x: kotlin.Int, /*1*/ vararg a: T /*kotlin.Array<out T>*/): T?
|
public fun </*0*/ T : kotlin.Any> joinT(/*0*/ x: kotlin.Int, /*1*/ vararg a: T /*kotlin.Array<out T>*/): T?
|
||||||
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
public fun main(): kotlin.Unit
|
||||||
|
|||||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
fun main(args: Array<String>) {
|
fun main() {
|
||||||
"".run {
|
"".run {
|
||||||
<!UNUSED_EXPRESSION!>""<!>
|
<!UNUSED_EXPRESSION!>""<!>
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
public fun main(): kotlin.Unit
|
||||||
public fun </*0*/ T> T.run(/*0*/ f: (T) -> kotlin.Unit): kotlin.Unit
|
public fun </*0*/ T> T.run(/*0*/ f: (T) -> kotlin.Unit): kotlin.Unit
|
||||||
|
|||||||
+1
-1
@@ -11,7 +11,7 @@ fun box(): Int {
|
|||||||
return local()
|
return local()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun main(args: Array<String>) {
|
fun main() {
|
||||||
box()
|
box()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -2,5 +2,5 @@ package
|
|||||||
|
|
||||||
package f {
|
package f {
|
||||||
public fun box(): kotlin.Int
|
public fun box(): kotlin.Int
|
||||||
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
public fun main(): kotlin.Unit
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
//KT-2369 Variable is not marked as uninitialized in 'finally' section
|
//KT-2369 Variable is not marked as uninitialized in 'finally' section
|
||||||
|
|
||||||
fun main(args: Array<String>) {
|
fun main() {
|
||||||
var x : Int
|
var x : Int
|
||||||
try {
|
try {
|
||||||
throw Exception()
|
throw Exception()
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
public fun doSmth(/*0*/ a: kotlin.Any?): kotlin.Any?
|
public fun doSmth(/*0*/ a: kotlin.Any?): kotlin.Any?
|
||||||
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
public fun main(): kotlin.Unit
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
package kt843
|
package kt843
|
||||||
|
|
||||||
fun main(args : Array<String>) {
|
fun main() {
|
||||||
// Integer type
|
// Integer type
|
||||||
val<!SYNTAX!><!> // this word is grey, which looks strange
|
val<!SYNTAX!><!> // this word is grey, which looks strange
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
package kt843 {
|
package kt843 {
|
||||||
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
public fun main(): kotlin.Unit
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
// !LANGUAGE: -ExtendedMainConvention
|
||||||
|
|
||||||
|
fun main(args: Array<String>) {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
package
|
||||||
|
|
||||||
|
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fun main(<!UNUSED_PARAMETER!>args<!>: Array<String>) {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
package
|
||||||
|
|
||||||
|
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
||||||
compiler/testData/diagnostics/tests/controlStructures/catchingLocalClassesCapturingTypeParameters.kt
Vendored
+1
-1
@@ -15,7 +15,7 @@ fun <T> foo(x: Throwable, z: T, b: (T) -> Unit) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun main(args: Array<String>) {
|
fun main() {
|
||||||
foo(RuntimeException(), 1) { throw IllegalStateException() }
|
foo(RuntimeException(), 1) { throw IllegalStateException() }
|
||||||
foo(global!!, "") { it.length } // (*)
|
foo(global!!, "") { it.length } // (*)
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -3,5 +3,5 @@ package
|
|||||||
package test {
|
package test {
|
||||||
public var global: kotlin.Throwable?
|
public var global: kotlin.Throwable?
|
||||||
public fun </*0*/ T> foo(/*0*/ x: kotlin.Throwable, /*1*/ z: T, /*2*/ b: (T) -> kotlin.Unit): kotlin.Unit
|
public fun </*0*/ T> foo(/*0*/ x: kotlin.Throwable, /*1*/ z: T, /*2*/ b: (T) -> kotlin.Unit): kotlin.Unit
|
||||||
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
public fun main(): kotlin.Unit
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@ package kt770_351_735
|
|||||||
|
|
||||||
|
|
||||||
//KT-770 Reference is not resolved to anything, but is not marked unresolved
|
//KT-770 Reference is not resolved to anything, but is not marked unresolved
|
||||||
fun main(args : Array<String>) {
|
fun main() {
|
||||||
var i = 0
|
var i = 0
|
||||||
when (i) {
|
when (i) {
|
||||||
1 -> i--
|
1 -> i--
|
||||||
|
|||||||
+1
-1
@@ -9,7 +9,7 @@ package kt770_351_735 {
|
|||||||
public fun fooWithAnuNullableResult(/*0*/ s: kotlin.String?, /*1*/ name: kotlin.String, /*2*/ optional: kotlin.Boolean): kotlin.Any?
|
public fun fooWithAnuNullableResult(/*0*/ s: kotlin.String?, /*1*/ name: kotlin.String, /*2*/ optional: kotlin.Boolean): kotlin.Any?
|
||||||
public fun fooWithAnyArg(/*0*/ arg: kotlin.Any): kotlin.Unit
|
public fun fooWithAnyArg(/*0*/ arg: kotlin.Any): kotlin.Unit
|
||||||
public fun fooWithAnyNullableArg(/*0*/ arg: kotlin.Any?): kotlin.Unit
|
public fun fooWithAnyNullableArg(/*0*/ arg: kotlin.Any?): kotlin.Unit
|
||||||
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
public fun main(): kotlin.Unit
|
||||||
public fun test1(): kotlin.Unit
|
public fun test1(): kotlin.Unit
|
||||||
public fun test2(): kotlin.Unit
|
public fun test2(): kotlin.Unit
|
||||||
public fun testCoercionToAny(): kotlin.Unit
|
public fun testCoercionToAny(): kotlin.Unit
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ import outer.*
|
|||||||
fun Any?.equals1(<!UNUSED_PARAMETER!>other<!> : Any?) : Boolean = true
|
fun Any?.equals1(<!UNUSED_PARAMETER!>other<!> : Any?) : Boolean = true
|
||||||
fun Any.equals2(<!UNUSED_PARAMETER!>other<!> : Any?) : Boolean = true
|
fun Any.equals2(<!UNUSED_PARAMETER!>other<!> : Any?) : Boolean = true
|
||||||
|
|
||||||
fun main(args: Array<String>) {
|
fun main() {
|
||||||
|
|
||||||
System.out.print(1)
|
System.out.print(1)
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
package null_safety {
|
package null_safety {
|
||||||
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
public fun main(): kotlin.Unit
|
||||||
public fun parse(/*0*/ cmd: kotlin.String): null_safety.Command?
|
public fun parse(/*0*/ cmd: kotlin.String): null_safety.Command?
|
||||||
public fun kotlin.Any.equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
public fun kotlin.Any.equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
public fun kotlin.Any?.equals1(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
public fun kotlin.Any?.equals1(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ operator fun <T : Any> T?.iterator() = object : MyIterator<T> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun main(args : Array<String>) {
|
fun main() {
|
||||||
val i : Int? = 1
|
val i : Int? = 1
|
||||||
for (x in i) {
|
for (x in i) {
|
||||||
System.out.println(x)
|
System.out.println(x)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
public fun main(): kotlin.Unit
|
||||||
public operator fun </*0*/ T : kotlin.Any> T?.iterator(): MyIterator<T>
|
public operator fun </*0*/ T : kotlin.Any> T?.iterator(): MyIterator<T>
|
||||||
public fun </*0*/ T> java.util.Enumeration<T>.iterator(): kotlin.collections.Iterator<T>
|
public fun </*0*/ T> java.util.Enumeration<T>.iterator(): kotlin.collections.Iterator<T>
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -8,7 +8,7 @@ class Foo {
|
|||||||
companion object : JPAEntityClass<Foo>
|
companion object : JPAEntityClass<Foo>
|
||||||
}
|
}
|
||||||
|
|
||||||
fun main(args: Array<String>) {
|
fun main() {
|
||||||
with("", {
|
with("", {
|
||||||
Foo.<!UNRESOLVED_REFERENCE!>findByName<!>("")
|
Foo.<!UNRESOLVED_REFERENCE!>findByName<!>("")
|
||||||
})
|
})
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
public fun main(): kotlin.Unit
|
||||||
|
|
||||||
public final class Foo {
|
public final class Foo {
|
||||||
public constructor Foo()
|
public constructor Foo()
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ public interface Predicate<T extends CharSequence> {
|
|||||||
}
|
}
|
||||||
// FILE: Main.kt
|
// FILE: Main.kt
|
||||||
fun process(<!UNUSED_PARAMETER!>x<!>: Predicate<String>) {}
|
fun process(<!UNUSED_PARAMETER!>x<!>: Predicate<String>) {}
|
||||||
fun main(args: Array<String>) {
|
fun main() {
|
||||||
process(Predicate { x -> x checkType { _<String>() }
|
process(Predicate { x -> x checkType { _<String>() }
|
||||||
true
|
true
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
public fun main(): kotlin.Unit
|
||||||
public fun process(/*0*/ x: Predicate<kotlin.String>): kotlin.Unit
|
public fun process(/*0*/ x: Predicate<kotlin.String>): kotlin.Unit
|
||||||
|
|
||||||
public interface Predicate</*0*/ T : kotlin.CharSequence!> {
|
public interface Predicate</*0*/ T : kotlin.CharSequence!> {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ public fun foo2(bar: () -> Unit) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun main(args: Array<String>) {
|
fun main() {
|
||||||
foo1 { println ("foo1")} // prints "foo1"
|
foo1 { println ("foo1")} // prints "foo1"
|
||||||
foo2 { println ("foo2")} // prints "foo2"
|
foo2 { println ("foo2")} // prints "foo2"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,6 @@ package
|
|||||||
package bug {
|
package bug {
|
||||||
public fun foo1(/*0*/ bar: () -> kotlin.Unit): kotlin.Unit
|
public fun foo1(/*0*/ bar: () -> kotlin.Unit): kotlin.Unit
|
||||||
public fun foo2(/*0*/ bar: () -> kotlin.Unit): kotlin.Unit
|
public fun foo2(/*0*/ bar: () -> kotlin.Unit): kotlin.Unit
|
||||||
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
public fun main(): kotlin.Unit
|
||||||
public fun println(/*0*/ s: kotlin.String): kotlin.String
|
public fun println(/*0*/ s: kotlin.String): kotlin.String
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// KT-3343 Type mismatch when function literal consists of try-catch with Int returning call, and Unit is expected
|
// KT-3343 Type mismatch when function literal consists of try-catch with Int returning call, and Unit is expected
|
||||||
|
|
||||||
fun main(args : Array<String>) {
|
fun main() {
|
||||||
"hello world".prt{
|
"hello world".prt{
|
||||||
try{
|
try{
|
||||||
print(it)
|
print(it)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
public fun log(/*0*/ str: kotlin.String): kotlin.Int
|
public fun log(/*0*/ str: kotlin.String): kotlin.Int
|
||||||
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
public fun main(): kotlin.Unit
|
||||||
public fun print(/*0*/ obj: kotlin.Any): kotlin.Unit
|
public fun print(/*0*/ obj: kotlin.Any): kotlin.Unit
|
||||||
public fun kotlin.String.prt(/*0*/ action: (kotlin.String) -> kotlin.Unit): kotlin.Unit
|
public fun kotlin.String.prt(/*0*/ action: (kotlin.String) -> kotlin.Unit): kotlin.Unit
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ class G {
|
|||||||
infix fun foo(bar: (Int) -> Int) = bar
|
infix fun foo(bar: (Int) -> Int) = bar
|
||||||
}
|
}
|
||||||
|
|
||||||
fun main(args: Array<String>) {
|
fun main() {
|
||||||
use(
|
use(
|
||||||
G().foo {it + 11} // no error
|
G().foo {it + 11} // no error
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
public fun main(): kotlin.Unit
|
||||||
public fun use(/*0*/ a: kotlin.Any?): kotlin.Any?
|
public fun use(/*0*/ a: kotlin.Any?): kotlin.Any?
|
||||||
|
|
||||||
public final class G {
|
public final class G {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
fun main(args : Array<String>) {
|
fun main() {
|
||||||
var list = listOf(1)
|
var list = listOf(1)
|
||||||
|
|
||||||
val a: Int? = 2
|
val a: Int? = 2
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
public fun </*0*/ T> listOf(/*0*/ vararg values: T /*kotlin.Array<out T>*/): kotlin.collections.List<T>
|
public fun </*0*/ T> listOf(/*0*/ vararg values: T /*kotlin.Array<out T>*/): kotlin.collections.List<T>
|
||||||
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
public fun main(): kotlin.Unit
|
||||||
public operator fun </*0*/ T> kotlin.collections.Iterable<T>.plus(/*0*/ element: T): kotlin.collections.List<T>
|
public operator fun </*0*/ T> kotlin.collections.Iterable<T>.plus(/*0*/ element: T): kotlin.collections.List<T>
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
fun main(args: Array<String>) {
|
fun main() {
|
||||||
"".run {
|
"".run {
|
||||||
<!UNUSED_LAMBDA_EXPRESSION!>{}<!>
|
<!UNUSED_LAMBDA_EXPRESSION!>{}<!>
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
public fun main(): kotlin.Unit
|
||||||
public fun </*0*/ T> T.run(/*0*/ f: (T) -> kotlin.Unit): kotlin.Unit
|
public fun </*0*/ T> T.run(/*0*/ f: (T) -> kotlin.Unit): kotlin.Unit
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@
|
|||||||
import java.util.stream.Collectors
|
import java.util.stream.Collectors
|
||||||
import java.util.stream.IntStream
|
import java.util.stream.IntStream
|
||||||
|
|
||||||
fun main(args: Array<String>) {
|
fun main() {
|
||||||
val xs = IntStream.<!INTERFACE_STATIC_METHOD_CALL_FROM_JAVA6_TARGET_ERROR!>range<!>(0, 10).mapToObj { it.toString() }
|
val xs = IntStream.<!INTERFACE_STATIC_METHOD_CALL_FROM_JAVA6_TARGET_ERROR!>range<!>(0, 10).mapToObj { it.toString() }
|
||||||
.collect(Collectors.toList())
|
.collect(Collectors.toList())
|
||||||
xs[0]
|
xs[0]
|
||||||
|
|||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
public fun main(): kotlin.Unit
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ interface Stream<T> {
|
|||||||
}
|
}
|
||||||
fun stream(): Stream<String> = null!!
|
fun stream(): Stream<String> = null!!
|
||||||
|
|
||||||
fun main(args: Array<String>) {
|
fun main() {
|
||||||
val stream: Stream<String> = stream()
|
val stream: Stream<String> = stream()
|
||||||
val xs = stream.collect(toList())
|
val xs = stream.collect(toList())
|
||||||
xs.foo()
|
xs.foo()
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
public fun main(): kotlin.Unit
|
||||||
public fun stream(): Stream<kotlin.String>
|
public fun stream(): Stream<kotlin.String>
|
||||||
public fun </*0*/ T> toList(): Collector<T, A<T>>
|
public fun </*0*/ T> toList(): Collector<T, A<T>>
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import java.util.ArrayList
|
|||||||
|
|
||||||
class ListOfLists<T>(public val x : ArrayList<ArrayList<T>>)
|
class ListOfLists<T>(public val x : ArrayList<ArrayList<T>>)
|
||||||
|
|
||||||
fun main(args : Array<String>) {
|
fun main() {
|
||||||
val a : ArrayList<ArrayList<String>> = ArrayList()
|
val a : ArrayList<ArrayList<String>> = ArrayList()
|
||||||
val b : ListOfLists<String> = ListOfLists(a)
|
val b : ListOfLists<String> = ListOfLists(a)
|
||||||
val c : ListOfLists<*> = b
|
val c : ListOfLists<*> = b
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
public fun main(): kotlin.Unit
|
||||||
|
|
||||||
public final class ListOfLists</*0*/ T> {
|
public final class ListOfLists</*0*/ T> {
|
||||||
public constructor ListOfLists</*0*/ T>(/*0*/ x: java.util.ArrayList<java.util.ArrayList<T>>)
|
public constructor ListOfLists</*0*/ T>(/*0*/ x: java.util.ArrayList<java.util.ArrayList<T>>)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package b
|
package b
|
||||||
|
|
||||||
fun main(args : Array<String>) {
|
fun main() {
|
||||||
var ints : Array<Int?> = arrayOfNulls<Int>(31)
|
var ints : Array<Int?> = arrayOfNulls<Int>(31)
|
||||||
|
|
||||||
ints[0] = 4; ints[11] = 5; ints[2] =7
|
ints[0] = 4; ints[11] = 5; ints[2] =7
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
package b {
|
package b {
|
||||||
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
public fun main(): kotlin.Unit
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
// !WITH_NEW_INFERENCE
|
// !WITH_NEW_INFERENCE
|
||||||
package bar
|
package bar
|
||||||
|
|
||||||
fun main(args : Array<String>) {
|
fun main() {
|
||||||
class Some
|
class Some
|
||||||
|
|
||||||
<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!><!NO_COMPANION_OBJECT!>Some<!>[<!SYNTAX!><!>]<!> <!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>names<!> <!DEBUG_INFO_MISSING_UNRESOLVED!><!SYNTAX!>=<!> ["ads"]<!>
|
<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!><!NO_COMPANION_OBJECT!>Some<!>[<!SYNTAX!><!>]<!> <!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>names<!> <!DEBUG_INFO_MISSING_UNRESOLVED!><!SYNTAX!>=<!> ["ads"]<!>
|
||||||
|
|||||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
package bar {
|
package bar {
|
||||||
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
public fun main(): kotlin.Unit
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@ class Square() {
|
|||||||
private set
|
private set
|
||||||
}
|
}
|
||||||
|
|
||||||
fun main(args : Array<String>) {
|
fun main() {
|
||||||
val s = Square()
|
val s = Square()
|
||||||
|
|
||||||
s.size = 2.0
|
s.size = 2.0
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
package h {
|
package h {
|
||||||
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
public fun main(): kotlin.Unit
|
||||||
|
|
||||||
public final class Square {
|
public final class Square {
|
||||||
public constructor Square()
|
public constructor Square()
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ fun sum(a : IntArray) : Int {
|
|||||||
for (e in a)
|
for (e in a)
|
||||||
<!UNRESOLVED_REFERENCE!>res<!> <!DEBUG_INFO_MISSING_UNRESOLVED!>+=<!><!SYNTAX!><!>
|
<!UNRESOLVED_REFERENCE!>res<!> <!DEBUG_INFO_MISSING_UNRESOLVED!>+=<!><!SYNTAX!><!>
|
||||||
}
|
}
|
||||||
fun main(args : Array<String>) {
|
fun main() {
|
||||||
test(0)
|
test(0)
|
||||||
test(1, 1)
|
test(1, 1)
|
||||||
test(-1, -1, 0)
|
test(-1, -1, 0)
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@ package
|
|||||||
|
|
||||||
package sum {
|
package sum {
|
||||||
public fun </*0*/ T : kotlin.Any> assertEquals(/*0*/ actual: T?, /*1*/ expected: T?, /*2*/ message: kotlin.Any? = ...): kotlin.Unit
|
public fun </*0*/ T : kotlin.Any> assertEquals(/*0*/ actual: T?, /*1*/ expected: T?, /*2*/ message: kotlin.Any? = ...): kotlin.Unit
|
||||||
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
public fun main(): kotlin.Unit
|
||||||
public fun sum(/*0*/ a: kotlin.IntArray): kotlin.Int
|
public fun sum(/*0*/ a: kotlin.IntArray): kotlin.Int
|
||||||
public fun test(/*0*/ expectedSum: kotlin.Int, /*1*/ vararg data: kotlin.Int /*kotlin.IntArray*/): kotlin.Unit
|
public fun test(/*0*/ expectedSum: kotlin.Int, /*1*/ vararg data: kotlin.Int /*kotlin.IntArray*/): kotlin.Unit
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
package kt1293
|
package kt1293
|
||||||
|
|
||||||
fun main(args : Array<String>) {
|
fun main() {
|
||||||
val intArray = arrayOfNulls<Int>(10)
|
val intArray = arrayOfNulls<Int>(10)
|
||||||
val <!UNUSED_VARIABLE!>i<!> : Int = <!NI;TYPE_MISMATCH, TYPE_MISMATCH!>intArray[0]<!>
|
val <!UNUSED_VARIABLE!>i<!> : Int = <!NI;TYPE_MISMATCH, TYPE_MISMATCH!>intArray[0]<!>
|
||||||
requiresInt(<!TYPE_MISMATCH!>intArray[0]<!>)
|
requiresInt(<!TYPE_MISMATCH!>intArray[0]<!>)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
package kt1293 {
|
package kt1293 {
|
||||||
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
public fun main(): kotlin.Unit
|
||||||
public fun requiresInt(/*0*/ i: kotlin.Int): kotlin.Unit
|
public fun requiresInt(/*0*/ i: kotlin.Int): kotlin.Unit
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@ private fun <T> test(value: T, extf: String.(value: T)->Unit) {
|
|||||||
"".extf(value)
|
"".extf(value)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun main(args: Array<String>) {
|
fun main() {
|
||||||
test(1, {value -> println(value)})
|
test(1, {value -> println(value)})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
package a {
|
package a {
|
||||||
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
public fun main(): kotlin.Unit
|
||||||
public fun println(/*0*/ message: kotlin.Any?): kotlin.Unit
|
public fun println(/*0*/ message: kotlin.Any?): kotlin.Unit
|
||||||
private fun </*0*/ T> test(/*0*/ value: T, /*1*/ extf: kotlin.String.(value: T) -> kotlin.Unit): kotlin.Unit
|
private fun </*0*/ T> test(/*0*/ value: T, /*1*/ extf: kotlin.String.(value: T) -> kotlin.Unit): kotlin.Unit
|
||||||
public fun tests(): kotlin.Unit
|
public fun tests(): kotlin.Unit
|
||||||
|
|||||||
@@ -5,6 +5,6 @@ package d
|
|||||||
|
|
||||||
fun <T> asList(<!UNUSED_PARAMETER!>t<!>: T) : List<T>? {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
fun <T> asList(<!UNUSED_PARAMETER!>t<!>: T) : List<T>? {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||||
|
|
||||||
fun main(args : Array<String>) {
|
fun main() {
|
||||||
val <!UNUSED_VARIABLE!>list<!> : List<String> = <!NI;TYPE_MISMATCH, NI;TYPE_MISMATCH, OI;TYPE_INFERENCE_EXPECTED_TYPE_MISMATCH!>asList("")<!>
|
val <!UNUSED_VARIABLE!>list<!> : List<String> = <!NI;TYPE_MISMATCH, NI;TYPE_MISMATCH, OI;TYPE_INFERENCE_EXPECTED_TYPE_MISMATCH!>asList("")<!>
|
||||||
}
|
}
|
||||||
@@ -2,5 +2,5 @@ package
|
|||||||
|
|
||||||
package d {
|
package d {
|
||||||
public fun </*0*/ T> asList(/*0*/ t: T): kotlin.collections.List<T>?
|
public fun </*0*/ T> asList(/*0*/ t: T): kotlin.collections.List<T>?
|
||||||
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
public fun main(): kotlin.Unit
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
//KT-2200 array(array()) breaks compiler
|
//KT-2200 array(array()) breaks compiler
|
||||||
package n
|
package n
|
||||||
|
|
||||||
fun main(args: Array<String>) {
|
fun main() {
|
||||||
val <!UNUSED_VARIABLE!>a<!> = <!OI;TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>array<!>(<!OI;TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>array<!>())
|
val <!UNUSED_VARIABLE!>a<!> = <!OI;TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>array<!>(<!OI;TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>array<!>())
|
||||||
val <!UNUSED_VARIABLE!>a0<!> : Array<Array<Int>> = array(array())
|
val <!UNUSED_VARIABLE!>a0<!> : Array<Array<Int>> = array(array())
|
||||||
val a1 = array(array<Int>())
|
val a1 = array(array<Int>())
|
||||||
|
|||||||
@@ -2,5 +2,5 @@ package
|
|||||||
|
|
||||||
package n {
|
package n {
|
||||||
@kotlin.Suppress(names = {"UNCHECKED_CAST"}) public fun </*0*/ T> array(/*0*/ vararg t: T /*kotlin.Array<out T>*/): kotlin.Array<T>
|
@kotlin.Suppress(names = {"UNCHECKED_CAST"}) public fun </*0*/ T> array(/*0*/ vararg t: T /*kotlin.Array<out T>*/): kotlin.Array<T>
|
||||||
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
public fun main(): kotlin.Unit
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
//KT-2445 Calling method with function with generic parameter causes compile-time exception
|
//KT-2445 Calling method with function with generic parameter causes compile-time exception
|
||||||
package a
|
package a
|
||||||
|
|
||||||
fun main(args: Array<String>) {
|
fun main() {
|
||||||
<!OI;TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>test<!> {
|
<!OI;TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>test<!> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
package a {
|
package a {
|
||||||
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
public fun main(): kotlin.Unit
|
||||||
public fun </*0*/ R> test(/*0*/ callback: (R) -> kotlin.Unit): kotlin.Unit
|
public fun </*0*/ R> test(/*0*/ callback: (R) -> kotlin.Unit): kotlin.Unit
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ fun <T> Thread.use(block: Thread.() -> T): T = block()
|
|||||||
|
|
||||||
fun <T: Closeable, R> T.use(block: (T)-> R) : R = block(this)
|
fun <T: Closeable, R> T.use(block: (T)-> R) : R = block(this)
|
||||||
|
|
||||||
fun main(args: Array<String>) {
|
fun main() {
|
||||||
Thread().use { } // compilation error: Type inference failed
|
Thread().use { } // compilation error: Type inference failed
|
||||||
Thread().use { 5 + 5 } // compilation error: Type inference failed
|
Thread().use { 5 + 5 } // compilation error: Type inference failed
|
||||||
Thread().use<Unit> { } // compiles okay
|
Thread().use<Unit> { } // compiles okay
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
package kt2514 {
|
package kt2514 {
|
||||||
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
public fun main(): kotlin.Unit
|
||||||
public fun </*0*/ T : java.io.Closeable, /*1*/ R> T.use(/*0*/ block: (T) -> R): R
|
public fun </*0*/ T : java.io.Closeable, /*1*/ R> T.use(/*0*/ block: (T) -> R): R
|
||||||
public fun </*0*/ T> java.lang.Thread.use(/*0*/ block: java.lang.Thread.() -> T): T
|
public fun </*0*/ T> java.lang.Thread.use(/*0*/ block: java.lang.Thread.() -> T): T
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ public inline fun <T: Closeable, R> T.use1(block: (T)-> R) : R {
|
|||||||
return block(this)
|
return block(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun main(args: Array<String>) {
|
fun main() {
|
||||||
C().use1 {
|
C().use1 {
|
||||||
<!UNUSED_ANONYMOUS_PARAMETER!>w<!> -> // ERROR here
|
<!UNUSED_ANONYMOUS_PARAMETER!>w<!> -> // ERROR here
|
||||||
<!UNRESOLVED_REFERENCE!>x<!>
|
<!UNRESOLVED_REFERENCE!>x<!>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
package a {
|
package a {
|
||||||
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
public fun main(): kotlin.Unit
|
||||||
public inline fun </*0*/ T : a.Closeable, /*1*/ R> T.use1(/*0*/ block: (T) -> R): R
|
public inline fun </*0*/ T : a.Closeable, /*1*/ R> T.use1(/*0*/ block: (T) -> R): R
|
||||||
|
|
||||||
public final class C : a.Closeable {
|
public final class C : a.Closeable {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
class Foo<T>
|
class Foo<T>
|
||||||
fun <T> Foo<T>.bar(): T = throw Exception()
|
fun <T> Foo<T>.bar(): T = throw Exception()
|
||||||
|
|
||||||
fun main(args: Array<String>) {
|
fun main() {
|
||||||
val f: Foo<out String> = Foo()
|
val f: Foo<out String> = Foo()
|
||||||
f.bar() checkType { _<String>() }
|
f.bar() checkType { _<String>() }
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
public fun main(): kotlin.Unit
|
||||||
public fun </*0*/ T> Foo<T>.bar(): T
|
public fun </*0*/ T> Foo<T>.bar(): T
|
||||||
|
|
||||||
public final class Foo</*0*/ T> {
|
public final class Foo</*0*/ T> {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ fun <T, G> A<T>.foo(x: (T)-> G): G {
|
|||||||
return x(this.p)
|
return x(this.p)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun main(args: Array<String>) {
|
fun main() {
|
||||||
val a = A(1)
|
val a = A(1)
|
||||||
val t: String = <!NI;TYPE_MISMATCH!>a.<!OI;TYPE_INFERENCE_EXPECTED_TYPE_MISMATCH!>foo({p -> <!NI;TYPE_MISMATCH, OI;TYPE_MISMATCH!>p<!>})<!><!>
|
val t: String = <!NI;TYPE_MISMATCH!>a.<!OI;TYPE_INFERENCE_EXPECTED_TYPE_MISMATCH!>foo({p -> <!NI;TYPE_MISMATCH, OI;TYPE_MISMATCH!>p<!>})<!><!>
|
||||||
checkSubtype<String>(t)
|
checkSubtype<String>(t)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
package a {
|
package a {
|
||||||
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
public fun main(): kotlin.Unit
|
||||||
public fun </*0*/ T, /*1*/ G> a.A<T>.foo(/*0*/ x: (T) -> G): G
|
public fun </*0*/ T, /*1*/ G> a.A<T>.foo(/*0*/ x: (T) -> G): G
|
||||||
|
|
||||||
public final class A</*0*/ T> {
|
public final class A</*0*/ T> {
|
||||||
|
|||||||
Vendored
+1
-1
@@ -2,7 +2,7 @@ package a
|
|||||||
|
|
||||||
fun <T, R, S> foo(block: (T)-> R, <!UNUSED_PARAMETER!>second<!>: (T)-> S) = block
|
fun <T, R, S> foo(block: (T)-> R, <!UNUSED_PARAMETER!>second<!>: (T)-> S) = block
|
||||||
|
|
||||||
fun main(args: Array<String>) {
|
fun main() {
|
||||||
val fff = { <!UNUSED_ANONYMOUS_PARAMETER!>x<!>: Int -> <!UNRESOLVED_REFERENCE!>aaa<!> }
|
val fff = { <!UNUSED_ANONYMOUS_PARAMETER!>x<!>: Int -> <!UNRESOLVED_REFERENCE!>aaa<!> }
|
||||||
foo(<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>fff<!>, { x -> x + 1 })
|
foo(<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>fff<!>, { x -> x + 1 })
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+1
-1
@@ -2,5 +2,5 @@ package
|
|||||||
|
|
||||||
package a {
|
package a {
|
||||||
public fun </*0*/ T, /*1*/ R, /*2*/ S> foo(/*0*/ block: (T) -> R, /*1*/ second: (T) -> S): (T) -> R
|
public fun </*0*/ T, /*1*/ R, /*2*/ S> foo(/*0*/ block: (T) -> R, /*1*/ second: (T) -> S): (T) -> R
|
||||||
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
public fun main(): kotlin.Unit
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@ fun <T: Closeable, R> T.foo(block: (T)-> R) = block
|
|||||||
|
|
||||||
fun <T: Closeable, R> T.foo(block: (T, T)-> R) = block
|
fun <T: Closeable, R> T.foo(block: (T, T)-> R) = block
|
||||||
|
|
||||||
fun main(args: Array<String>) {
|
fun main() {
|
||||||
C().foo { // no ambiguity here
|
C().foo { // no ambiguity here
|
||||||
<!UNUSED_ANONYMOUS_PARAMETER!>www<!> ->
|
<!UNUSED_ANONYMOUS_PARAMETER!>www<!> ->
|
||||||
<!UNRESOLVED_REFERENCE!>xs<!>
|
<!UNRESOLVED_REFERENCE!>xs<!>
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
package a {
|
package a {
|
||||||
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
public fun main(): kotlin.Unit
|
||||||
public fun </*0*/ T : a.Closeable, /*1*/ R> T.foo(/*0*/ block: (T) -> R): (T) -> R
|
public fun </*0*/ T : a.Closeable, /*1*/ R> T.foo(/*0*/ block: (T) -> R): (T) -> R
|
||||||
public fun </*0*/ T : a.Closeable, /*1*/ R> T.foo(/*0*/ block: (T, T) -> R): (T, T) -> R
|
public fun </*0*/ T : a.Closeable, /*1*/ R> T.foo(/*0*/ block: (T, T) -> R): (T, T) -> R
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ public inline fun <K,V1, V: V1> Map<K,V>.getOrElse1(key: K, defaultValue: ()-> V
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun main(args: Array<String>) {
|
fun main() {
|
||||||
val map = HashMap<Int, Int>()
|
val map = HashMap<Int, Int>()
|
||||||
println(map.getOrElse1(2, { null })) // Error
|
println(map.getOrElse1(2, { null })) // Error
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
package d {
|
package d {
|
||||||
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
public fun main(): kotlin.Unit
|
||||||
public fun println(/*0*/ message: kotlin.Any?): kotlin.Unit
|
public fun println(/*0*/ message: kotlin.Any?): kotlin.Unit
|
||||||
public inline fun </*0*/ K, /*1*/ V1, /*2*/ V : V1> kotlin.collections.Map<K, V>.getOrElse1(/*0*/ key: K, /*1*/ defaultValue: () -> V1): V1
|
public inline fun </*0*/ K, /*1*/ V1, /*2*/ V : V1> kotlin.collections.Map<K, V>.getOrElse1(/*0*/ key: K, /*1*/ defaultValue: () -> V1): V1
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
fun main(args: Array<String>) {
|
fun main() {
|
||||||
<!NOT_YET_SUPPORTED_IN_INLINE!>inline<!> fun a(){
|
<!NOT_YET_SUPPORTED_IN_INLINE!>inline<!> fun a(){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
public fun main(): kotlin.Unit
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
// !DIAGNOSTICS: -NOTHING_TO_INLINE
|
// !DIAGNOSTICS: -NOTHING_TO_INLINE
|
||||||
fun main(args: Array<String>) {
|
fun main() {
|
||||||
test {
|
test {
|
||||||
<!RETURN_NOT_ALLOWED!>return<!>
|
<!RETURN_NOT_ALLOWED!>return<!>
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
public fun main(): kotlin.Unit
|
||||||
public inline fun test(/*0*/ noinline lambda: () -> kotlin.Unit): kotlin.Unit
|
public inline fun test(/*0*/ noinline lambda: () -> kotlin.Unit): kotlin.Unit
|
||||||
|
|||||||
@@ -3,6 +3,6 @@
|
|||||||
<!UNRESOLVED_REFERENCE!>unresolved<!>().<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>another<!>()
|
<!UNRESOLVED_REFERENCE!>unresolved<!>().<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>another<!>()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun main(args: Array<String>) {
|
fun main() {
|
||||||
foo()
|
foo()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
public inline fun foo(): kotlin.Unit
|
public inline fun foo(): kotlin.Unit
|
||||||
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
public fun main(): kotlin.Unit
|
||||||
|
|||||||
+1
-1
@@ -16,7 +16,7 @@ public class C implements I {
|
|||||||
|
|
||||||
class K : C()
|
class K : C()
|
||||||
|
|
||||||
fun main(args: Array<String>) {
|
fun main() {
|
||||||
I.a
|
I.a
|
||||||
I.<!INTERFACE_STATIC_METHOD_CALL_FROM_JAVA6_TARGET_ERROR!>foo<!>()
|
I.<!INTERFACE_STATIC_METHOD_CALL_FROM_JAVA6_TARGET_ERROR!>foo<!>()
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
public fun main(): kotlin.Unit
|
||||||
|
|
||||||
public open class C : I {
|
public open class C : I {
|
||||||
public constructor C()
|
public constructor C()
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
//FILE: foo.kt
|
//FILE: foo.kt
|
||||||
fun main(args: Array<String>) {
|
fun main() {
|
||||||
val c: Type
|
val c: Type
|
||||||
<!NON_EXHAUSTIVE_WHEN!>when<!> (<!UNINITIALIZED_VARIABLE, UNUSED_EXPRESSION!>c<!>) {
|
<!NON_EXHAUSTIVE_WHEN!>when<!> (<!UNINITIALIZED_VARIABLE, UNUSED_EXPRESSION!>c<!>) {
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
public fun main(): kotlin.Unit
|
||||||
|
|
||||||
public final enum class Type : kotlin.Enum<Type!> {
|
public final enum class Type : kotlin.Enum<Type!> {
|
||||||
enum entry TYPE
|
enum entry TYPE
|
||||||
|
|||||||
+1
-1
@@ -12,7 +12,7 @@ public class Super {
|
|||||||
public class Sub: Super() {
|
public class Sub: Super() {
|
||||||
}
|
}
|
||||||
|
|
||||||
fun main(args: Array<String>) {
|
fun main() {
|
||||||
val x = Sub()
|
val x = Sub()
|
||||||
x.foo = true
|
x.foo = true
|
||||||
x.bar = true
|
x.bar = true
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
public fun main(): kotlin.Unit
|
||||||
|
|
||||||
public final class Sub : Super {
|
public final class Sub : Super {
|
||||||
public constructor Sub()
|
public constructor Sub()
|
||||||
|
|||||||
@@ -13,6 +13,6 @@ public class Foo {
|
|||||||
|
|
||||||
// FILE: 1.kt
|
// FILE: 1.kt
|
||||||
|
|
||||||
fun main(args: Array<String>) {
|
fun main() {
|
||||||
javaPackage.Foo.<!INVISIBLE_REFERENCE!>Bar<!>.<!INVISIBLE_MEMBER!>doSmth<!>()
|
javaPackage.Foo.<!INVISIBLE_REFERENCE!>Bar<!>.<!INVISIBLE_MEMBER!>doSmth<!>()
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
public fun main(): kotlin.Unit
|
||||||
|
|
||||||
package javaPackage {
|
package javaPackage {
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -14,7 +14,7 @@ public class Observable<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FILE: 1.kt
|
// FILE: 1.kt
|
||||||
fun main(args: Array<String>) {
|
fun main() {
|
||||||
BehaviorSubject.create<String>(null)
|
BehaviorSubject.create<String>(null)
|
||||||
BehaviorSubject.create<Int> { }
|
BehaviorSubject.create<Int> { }
|
||||||
}
|
}
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
public fun main(): kotlin.Unit
|
||||||
|
|
||||||
public open class BehaviorSubject</*0*/ T : kotlin.Any!> : Observable<T!> {
|
public open class BehaviorSubject</*0*/ T : kotlin.Any!> : Observable<T!> {
|
||||||
public constructor BehaviorSubject</*0*/ T : kotlin.Any!>()
|
public constructor BehaviorSubject</*0*/ T : kotlin.Any!>()
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user