diff --git a/compiler/testData/codegen/box/controlStructures/kt2062.kt b/compiler/testData/codegen/box/controlStructures/kt2062.kt index 4f0bce4a8a6..cd44f191da7 100644 --- a/compiler/testData/codegen/box/controlStructures/kt2062.kt +++ b/compiler/testData/codegen/box/controlStructures/kt2062.kt @@ -1,5 +1,5 @@ fun box(): String { val a = if(true) { } - return if (a.toString() == "Unit.VALUE") "OK" else "fail" + return if (a.toString() == "kotlin.Unit") "OK" else "fail" } diff --git a/compiler/testData/codegen/box/controlStructures/kt237.kt b/compiler/testData/codegen/box/controlStructures/kt237.kt index e07c8bfdbfa..4f4178e4025 100644 --- a/compiler/testData/codegen/box/controlStructures/kt237.kt +++ b/compiler/testData/codegen/box/controlStructures/kt237.kt @@ -1,9 +1,9 @@ fun main(args: Array?) { - val y: Unit = Unit.VALUE //do not compile + val y: Unit = Unit //do not compile A() //do not compile - C(Unit.VALUE) //do not compile + C(Unit) //do not compile //do not compile - System.out?.println(fff(Unit.VALUE)) //do not compile + System.out?.println(fff(Unit)) //do not compile System.out?.println(id(y)) //do not compile System.out?.println(fff(id(y)) == id(foreach(Array(0,{0}),{(e : Int) : Unit -> }))) //do not compile } diff --git a/compiler/testData/codegen/box/delegatedProperty/propertyMetadataShouldBeCached.kt b/compiler/testData/codegen/box/delegatedProperty/propertyMetadataShouldBeCached.kt index de5710ed11b..8af9886fee9 100644 --- a/compiler/testData/codegen/box/delegatedProperty/propertyMetadataShouldBeCached.kt +++ b/compiler/testData/codegen/box/delegatedProperty/propertyMetadataShouldBeCached.kt @@ -14,7 +14,7 @@ val baz: String by StringHandler val metadatas = IdentityHashMap() -fun record(p: PropertyMetadata) = metadatas.put(p, Unit.VALUE) +fun record(p: PropertyMetadata) = metadatas.put(p, Unit) object IntHandler { fun get(t: Any?, p: PropertyMetadata): Int { record(p); return 42 } diff --git a/compiler/testData/codegen/box/functions/kt3214.kt b/compiler/testData/codegen/box/functions/kt3214.kt index 88dbc15f878..b675ae4f3cd 100644 --- a/compiler/testData/codegen/box/functions/kt3214.kt +++ b/compiler/testData/codegen/box/functions/kt3214.kt @@ -15,7 +15,7 @@ fun test2(a: A): Int { } fun test3(b: B): Int { - return b[Unit.VALUE, Unit.VALUE] + return b[Unit, Unit] } @@ -30,4 +30,4 @@ fun box() : String { if (result != 2) return "fail3: $result" return "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/box/functions/tailRecursion/tailCallInBlockInParentheses.kt b/compiler/testData/codegen/box/functions/tailRecursion/tailCallInBlockInParentheses.kt index 2e27bbba44e..222571ed482 100644 --- a/compiler/testData/codegen/box/functions/tailRecursion/tailCallInBlockInParentheses.kt +++ b/compiler/testData/codegen/box/functions/tailRecursion/tailCallInBlockInParentheses.kt @@ -2,10 +2,10 @@ tailRecursive fun foo(x: Int) { return if (x > 0) { (foo(x - 1)) } - else Unit.VALUE + else Unit } fun box(): String { foo(1000000) return "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/box/properties/kt4383.kt b/compiler/testData/codegen/box/properties/kt4383.kt index c29f6d42147..2002a7ed776 100644 --- a/compiler/testData/codegen/box/properties/kt4383.kt +++ b/compiler/testData/codegen/box/properties/kt4383.kt @@ -3,14 +3,14 @@ class D { } object P { - val u = Unit.VALUE + val u = Unit val v by D() - var w = Unit.VALUE + var w = Unit } fun box(): String { if (P.u != P.v) return "Fail uv" - P.w = Unit.VALUE + P.w = Unit if (P.w != P.u) return "Fail w" return "OK" } diff --git a/compiler/testData/codegen/box/unit/UnitValue.kt b/compiler/testData/codegen/box/unit/UnitValue.kt index 341f0304bc7..243b563dba8 100644 --- a/compiler/testData/codegen/box/unit/UnitValue.kt +++ b/compiler/testData/codegen/box/unit/UnitValue.kt @@ -1,5 +1,5 @@ fun foo() {} fun box(): String { - return if (foo() == Unit.VALUE) "OK" else "Fail" + return if (foo() == Unit) "OK" else "Fail" } diff --git a/compiler/testData/codegen/box/unit/kt3634.kt b/compiler/testData/codegen/box/unit/kt3634.kt index 77b98db3c26..4dcbf3f5bfe 100644 --- a/compiler/testData/codegen/box/unit/kt3634.kt +++ b/compiler/testData/codegen/box/unit/kt3634.kt @@ -1,4 +1,4 @@ -val c = Unit.VALUE +val c = Unit val d = c fun box(): String { diff --git a/compiler/testData/codegen/box/unit/kt4212.kt b/compiler/testData/codegen/box/unit/kt4212.kt index d8edbfacdf5..5d9db4097e7 100644 --- a/compiler/testData/codegen/box/unit/kt4212.kt +++ b/compiler/testData/codegen/box/unit/kt4212.kt @@ -11,7 +11,7 @@ fun quux(): Unit? = bar() fun box(): String { foo() - if (foo() != Unit.VALUE) return "Fail 1" + if (foo() != Unit) return "Fail 1" if (foo() != bar()) return "Fail 2" if (bar() != baz()) return "Fail 3" if (baz() != quux()) return "Fail 4" diff --git a/compiler/testData/codegen/box/unit/unitClassObject.kt b/compiler/testData/codegen/box/unit/unitClassObject.kt index 03de0ed559d..e4cdbacbe14 100644 --- a/compiler/testData/codegen/box/unit/unitClassObject.kt +++ b/compiler/testData/codegen/box/unit/unitClassObject.kt @@ -7,7 +7,5 @@ fun box(): String { if (Unit != Unit) return "Fail Unit != Unit" - if (a.VALUE != Unit.VALUE) return "Fail a.VALUE != Unit.VALUE" - return "OK" } diff --git a/compiler/testData/codegen/boxWithStdlib/dataClasses/tostring/unitComponent.kt b/compiler/testData/codegen/boxWithStdlib/dataClasses/tostring/unitComponent.kt index 602cb8d897b..72e5965b320 100644 --- a/compiler/testData/codegen/boxWithStdlib/dataClasses/tostring/unitComponent.kt +++ b/compiler/testData/codegen/boxWithStdlib/dataClasses/tostring/unitComponent.kt @@ -1,6 +1,6 @@ data class A(val x: Unit) fun box(): String { - val a = A(Unit.VALUE) - return if ("$a" == "A(x=Unit.VALUE)") "OK" else "$a" + val a = A(Unit) + return if ("$a" == "A(x=kotlin.Unit)") "OK" else "$a" } diff --git a/compiler/testData/codegen/boxWithStdlib/dataClasses/unitComponent.kt b/compiler/testData/codegen/boxWithStdlib/dataClasses/unitComponent.kt index 0246cebd88a..b70b461ab91 100644 --- a/compiler/testData/codegen/boxWithStdlib/dataClasses/unitComponent.kt +++ b/compiler/testData/codegen/boxWithStdlib/dataClasses/unitComponent.kt @@ -1,6 +1,6 @@ data class A(val x: Unit) fun box(): String { - val a = A(Unit.VALUE) + val a = A(Unit) return if (a.component1() is Unit) "OK" else "Fail ${a.component1()}" } diff --git a/compiler/testData/codegen/boxWithStdlib/regressions/kt344.kt b/compiler/testData/codegen/boxWithStdlib/regressions/kt344.kt index 63bb6247617..89725ca7f27 100644 --- a/compiler/testData/codegen/boxWithStdlib/regressions/kt344.kt +++ b/compiler/testData/codegen/boxWithStdlib/regressions/kt344.kt @@ -27,7 +27,7 @@ fun t1() : Boolean { x = x + "45" + y x = x.substring(3) x += "aaa" - Unit.VALUE + Unit } foo() @@ -43,7 +43,7 @@ fun t2() : Boolean { x = x + 5 + y x += 5 x++ - Unit.VALUE + Unit } foo() x -= 55 @@ -55,7 +55,7 @@ fun t3() : Boolean { var x = true val foo = { x = false - Unit.VALUE + Unit } foo() return !x @@ -67,7 +67,7 @@ fun t4() : Boolean { val foo = { x = x + 200.toFloat() + y x += 18 - Unit.VALUE + Unit } foo() System.out?.println(x) @@ -80,7 +80,7 @@ fun t5() : Boolean { val foo = { x = x + 200.toDouble() + y x -= 22 - Unit.VALUE + Unit } foo() System.out?.println(x) @@ -94,7 +94,7 @@ fun t6() : Boolean { x = (x + 20.toByte() + y).toByte() x += 2 x-- - Unit.VALUE + Unit } foo() System.out?.println(x) @@ -105,7 +105,7 @@ fun t7() : Boolean { var x : Char = 'a' val foo = { x = 'b' - Unit.VALUE + Unit } foo() System.out?.println(x) @@ -117,10 +117,10 @@ fun t8() : Boolean { val foo = { val bar = { x = 30.toShort() - Unit.VALUE + Unit } bar() - Unit.VALUE + Unit } foo() return x == 30.toShort() diff --git a/compiler/testData/diagnostics/tests/Casts.kt b/compiler/testData/diagnostics/tests/Casts.kt index 0dd2247542a..5c9ea9fb549 100644 --- a/compiler/testData/diagnostics/tests/Casts.kt +++ b/compiler/testData/diagnostics/tests/Casts.kt @@ -12,5 +12,5 @@ fun test() : Unit { y as? Int : Int? x as? Int? : Int? y as? Int? : Int? - Unit.VALUE + Unit } diff --git a/compiler/testData/diagnostics/tests/FunctionReturnTypes.kt b/compiler/testData/diagnostics/tests/FunctionReturnTypes.kt index d4e0fbdcfcc..f3af710b86e 100644 --- a/compiler/testData/diagnostics/tests/FunctionReturnTypes.kt +++ b/compiler/testData/diagnostics/tests/FunctionReturnTypes.kt @@ -6,7 +6,7 @@ fun unitEmptyInfer() {} fun unitEmpty() : Unit {} fun unitEmptyReturn() : Unit {return} fun unitIntReturn() : Unit {return 1} -fun unitUnitReturn() : Unit {return Unit.VALUE} +fun unitUnitReturn() : Unit {return Unit} fun test1() : Any = {return} fun test2() : Any = @a {return@a 1} fun test3() : Any { return } @@ -27,7 +27,7 @@ fun foo(expr: StringBuilder): Int { } -fun unitShort() : Unit = Unit.VALUE +fun unitShort() : Unit = Unit fun unitShortConv() : Unit = 1 fun unitShortNull() : Unit = null @@ -44,7 +44,7 @@ fun intFunctionLiteral(): Int = { 10 } fun blockReturnUnitMismatch() : Int {return} fun blockReturnValueTypeMismatch() : Int {return 3.4} fun blockReturnValueTypeMatch() : Int {return 1} -fun blockReturnValueTypeMismatchUnit() : Int {return Unit.VALUE} +fun blockReturnValueTypeMismatchUnit() : Int {return Unit} fun blockAndAndMismatch() : Int { true && false @@ -205,4 +205,4 @@ fun testFunctionLiterals() { object A {} } -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/LValueAssignment.kt b/compiler/testData/diagnostics/tests/LValueAssignment.kt index dd41b22982e..14318e92be3 100644 --- a/compiler/testData/diagnostics/tests/LValueAssignment.kt +++ b/compiler/testData/diagnostics/tests/LValueAssignment.kt @@ -43,7 +43,7 @@ fun cannotBe() { z = 30; "" = ""; - foo() = Unit.VALUE; + foo() = Unit; (i as Int) = 34 (i is Int) = false diff --git a/compiler/testData/diagnostics/tests/Nullability.kt b/compiler/testData/diagnostics/tests/Nullability.kt index b2d1e26221f..2fea9a21e83 100644 --- a/compiler/testData/diagnostics/tests/Nullability.kt +++ b/compiler/testData/diagnostics/tests/Nullability.kt @@ -39,7 +39,7 @@ fun test() { out.println(); } - if (out == null || out.println(0) == Unit.VALUE) { + if (out == null || out.println(0) == Unit) { out?.println(1) out.println(1) } @@ -47,21 +47,21 @@ fun test() { out.println(2) } - if (out != null && out.println() == Unit.VALUE) { + if (out != null && out.println() == Unit) { out.println(); } else { out?.println(); } - if (out == null || out.println() == Unit.VALUE) { + if (out == null || out.println() == Unit) { out?.println(); } else { out.println(); } - if (1 == 2 || out != null && out.println(1) == Unit.VALUE) { + if (1 == 2 || out != null && out.println(1) == Unit) { out?.println(2); out.println(2); } @@ -98,7 +98,7 @@ fun test() { out.println(); } - if (out == null || out.println(0) == Unit.VALUE) { + if (out == null || out.println(0) == Unit) { out?.println(1) out.println(1) } @@ -106,7 +106,7 @@ fun test() { out.println(2) } - if (out != null && out.println() == Unit.VALUE) { + if (out != null && out.println() == Unit) { out.println(); } else { @@ -114,7 +114,7 @@ fun test() { out.println(); } - if (out == null || out.println() == Unit.VALUE) { + if (out == null || out.println() == Unit) { out?.println(); out.println(); } @@ -122,7 +122,7 @@ fun test() { out.println(); } - if (1 == 2 || out != null && out.println(1) == Unit.VALUE) { + if (1 == 2 || out != null && out.println(1) == Unit) { out?.println(2); out.println(2); } diff --git a/compiler/testData/diagnostics/tests/UnitValue.kt b/compiler/testData/diagnostics/tests/UnitValue.kt index 720a081353e..d61e28efb25 100644 --- a/compiler/testData/diagnostics/tests/UnitValue.kt +++ b/compiler/testData/diagnostics/tests/UnitValue.kt @@ -1,3 +1,3 @@ fun test() { - return Unit.VALUE : Unit -} \ No newline at end of file + return Unit : Unit +} diff --git a/compiler/testData/diagnostics/tests/dataFlow/EmptyIf.kt b/compiler/testData/diagnostics/tests/dataFlow/EmptyIf.kt index 21b2b1cef50..e1145fadc55 100644 --- a/compiler/testData/diagnostics/tests/dataFlow/EmptyIf.kt +++ b/compiler/testData/diagnostics/tests/dataFlow/EmptyIf.kt @@ -17,6 +17,6 @@ fun f3(s: Number?) { fun f4(s: Int?) { var u = if (s!! == 42); - if (u == Unit.VALUE) u = if (s == 239); + if (u == Unit) u = if (s == 239); return u } diff --git a/compiler/testData/diagnostics/tests/extensions/ExtensionFunctions.kt b/compiler/testData/diagnostics/tests/extensions/ExtensionFunctions.kt index a7611533027..3b4d5c9b005 100644 --- a/compiler/testData/diagnostics/tests/extensions/ExtensionFunctions.kt +++ b/compiler/testData/diagnostics/tests/extensions/ExtensionFunctions.kt @@ -2,7 +2,7 @@ package outer fun Int?.optint() : Unit {} -val Int?.optval : Unit get() = Unit.VALUE +val Int?.optval : Unit get() = Unit fun T.foo(x : E, y : A) : T { y.plus(1) diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnUnit.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnUnit.kt index 18edcdb3aa9..fc34f6e0c87 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnUnit.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnUnit.kt @@ -1,9 +1,9 @@ fun test(a: Int) { val x = run @f{ if (a > 0) return@f - else return@f Unit.VALUE + else return@f Unit } x: Unit } -fun run(f: () -> T): T { return f() } \ No newline at end of file +fun run(f: () -> T): T { return f() } diff --git a/compiler/testData/diagnostics/tests/infos/Autocasts.kt b/compiler/testData/diagnostics/tests/infos/Autocasts.kt index b661293e910..6f4745aa2b0 100644 --- a/compiler/testData/diagnostics/tests/infos/Autocasts.kt +++ b/compiler/testData/diagnostics/tests/infos/Autocasts.kt @@ -20,7 +20,7 @@ fun f9(init : A?) { a?.bar() a?.foo() } - if (!(a is B) || a.bar() == Unit.VALUE) { + if (!(a is B) || a.bar() == Unit) { a?.bar() } if (!(a is B)) { @@ -102,7 +102,7 @@ fun f13(a : A?) { } a?.foo() - if (a is B && a.foo() == Unit.VALUE) { + if (a is B && a.foo() == Unit) { a.foo() a.bar() } @@ -216,4 +216,4 @@ fun foo(aa: Any): Int { return a } return 1 -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/j+k/OverrideVararg.kt b/compiler/testData/diagnostics/tests/j+k/OverrideVararg.kt index 428e4005c7a..2d26101c4ee 100644 --- a/compiler/testData/diagnostics/tests/j+k/OverrideVararg.kt +++ b/compiler/testData/diagnostics/tests/j+k/OverrideVararg.kt @@ -8,5 +8,5 @@ public abstract class Aaa { // FILE: bbb.kt class Bbb() : Aaa() { - override fun foo(vararg args: String?) = Unit.VALUE + override fun foo(vararg args: String?) = Unit } diff --git a/compiler/testData/diagnostics/tests/override/EqualityOfIntersectionTypes.kt b/compiler/testData/diagnostics/tests/override/EqualityOfIntersectionTypes.kt index fd53cf12a9f..7f312dd056f 100644 --- a/compiler/testData/diagnostics/tests/override/EqualityOfIntersectionTypes.kt +++ b/compiler/testData/diagnostics/tests/override/EqualityOfIntersectionTypes.kt @@ -4,12 +4,12 @@ trait Bar trait A { fun foo() where T : Foo, T : Bar - = Unit.VALUE + = Unit } class B : A { override fun foo() where T : Foo, T : Bar - = Unit.VALUE + = Unit -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/override/NonGenerics.kt b/compiler/testData/diagnostics/tests/override/NonGenerics.kt index 345a3073a14..c18de73a498 100644 --- a/compiler/testData/diagnostics/tests/override/NonGenerics.kt +++ b/compiler/testData/diagnostics/tests/override/NonGenerics.kt @@ -15,8 +15,8 @@ open class MyClass() : MyTrait, MyAbstractClass() { override fun foo() {} override fun bar() {} - override val pr : Unit = Unit.VALUE - override val prr : Unit = Unit.VALUE + override val pr : Unit = Unit + override val prr : Unit = Unit } class MyChildClass() : MyClass() {} @@ -25,14 +25,14 @@ class MyIllegalClass : MyTrait, MyAbstract class MyIllegalClass2() : MyTrait, MyAbstractClass() { override fun foo() {} - override val pr : Unit = Unit.VALUE - override val prr : Unit = Unit.VALUE + override val pr : Unit = Unit + override val prr : Unit = Unit } class MyIllegalClass3() : MyTrait, MyAbstractClass() { override fun bar() {} - override val pr : Unit = Unit.VALUE - override val prr : Unit = Unit.VALUE + override val pr : Unit = Unit + override val prr : Unit = Unit } class MyIllegalClass4() : MyTrait, MyAbstractClass() { @@ -44,7 +44,7 @@ class MyIllegalClass4() : MyTrait, MyAbstr class MyChildClass1() : MyClass() { fun foo() {} - val pr : Unit = Unit.VALUE + val pr : Unit = Unit override fun bar() {} - override val prr : Unit = Unit.VALUE -} \ No newline at end of file + override val prr : Unit = Unit +} diff --git a/compiler/testData/diagnostics/tests/regressions/kt353.kt b/compiler/testData/diagnostics/tests/regressions/kt353.kt index a986e31c000..1f6e74143d5 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt353.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt353.kt @@ -20,7 +20,7 @@ fun foo(a: A) { a.gen() // unit can be inferred } else { - Unit.VALUE + Unit } } @@ -29,4 +29,4 @@ fun foo(a: A) { } a.gen() // Shouldn't work: no info for inference -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/testsWithStdLib/callableReference/property/memberFromExtension.kt b/compiler/testData/diagnostics/testsWithStdLib/callableReference/property/memberFromExtension.kt index 624022a2b87..fa4cbc568e1 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/callableReference/property/memberFromExtension.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/callableReference/property/memberFromExtension.kt @@ -1,7 +1,7 @@ import kotlin.reflect.* class A { - val foo: Unit = Unit.VALUE + val foo: Unit = Unit var bar: String = "" var self: A get() = this diff --git a/compiler/testData/loadJava/compiledJavaCompareWithKotlin/MethodTypePOneUpperBound.kt b/compiler/testData/loadJava/compiledJavaCompareWithKotlin/MethodTypePOneUpperBound.kt index f9d94a8e6d4..2d0e909abfc 100644 --- a/compiler/testData/loadJava/compiledJavaCompareWithKotlin/MethodTypePOneUpperBound.kt +++ b/compiler/testData/loadJava/compiledJavaCompareWithKotlin/MethodTypePOneUpperBound.kt @@ -1,5 +1,5 @@ package test public open class MethodTypePOneUpperBound() : java.lang.Object() { - public open fun bar() : Unit = Unit.VALUE + public open fun bar() : Unit = Unit } diff --git a/compiler/testData/loadJava/compiledJavaCompareWithKotlin/MethodWithTypeP.kt b/compiler/testData/loadJava/compiledJavaCompareWithKotlin/MethodWithTypeP.kt index f8607ada2ed..0a120a659e2 100644 --- a/compiler/testData/loadJava/compiledJavaCompareWithKotlin/MethodWithTypeP.kt +++ b/compiler/testData/loadJava/compiledJavaCompareWithKotlin/MethodWithTypeP.kt @@ -1,5 +1,5 @@ package test public class MethodWithTypeP() : java.lang.Object() { - public fun

f() : Unit = Unit.VALUE + public fun

f() : Unit = Unit } diff --git a/compiler/testData/loadJava/compiledJavaCompareWithKotlin/MethodWithTypePP.kt b/compiler/testData/loadJava/compiledJavaCompareWithKotlin/MethodWithTypePP.kt index de7bbff43fe..7fb1ba2839a 100644 --- a/compiler/testData/loadJava/compiledJavaCompareWithKotlin/MethodWithTypePP.kt +++ b/compiler/testData/loadJava/compiledJavaCompareWithKotlin/MethodWithTypePP.kt @@ -1,5 +1,5 @@ package test public class MethodWithTypePP() : java.lang.Object() { - public fun f() : Unit = Unit.VALUE + public fun f() : Unit = Unit } diff --git a/compiler/testData/loadJava/compiledJavaCompareWithKotlin/MethodWithTypePRefClassP.kt b/compiler/testData/loadJava/compiledJavaCompareWithKotlin/MethodWithTypePRefClassP.kt index 79ca5eb33bf..a0a6ee37de3 100644 --- a/compiler/testData/loadJava/compiledJavaCompareWithKotlin/MethodWithTypePRefClassP.kt +++ b/compiler/testData/loadJava/compiledJavaCompareWithKotlin/MethodWithTypePRefClassP.kt @@ -1,5 +1,5 @@ package test public open class MethodWithTypePRefClassP

() : java.lang.Object() { - public fun f() : Unit = Unit.VALUE + public fun f() : Unit = Unit } diff --git a/compiler/testData/loadJava/compiledJavaCompareWithKotlin/MethosWithPRefTP.kt b/compiler/testData/loadJava/compiledJavaCompareWithKotlin/MethosWithPRefTP.kt index 2fed7f5b4e8..fce8538f540 100644 --- a/compiler/testData/loadJava/compiledJavaCompareWithKotlin/MethosWithPRefTP.kt +++ b/compiler/testData/loadJava/compiledJavaCompareWithKotlin/MethosWithPRefTP.kt @@ -1,5 +1,5 @@ package test public final class MethosWithPRefTP() : java.lang.Object() { - public fun

f(p0: P?) : Unit = Unit.VALUE + public fun

f(p0: P?) : Unit = Unit } diff --git a/compiler/testData/loadJava/compiledJavaCompareWithKotlin/vararg/VarargInt.kt b/compiler/testData/loadJava/compiledJavaCompareWithKotlin/vararg/VarargInt.kt index 01574c53407..f7477dfee1f 100644 --- a/compiler/testData/loadJava/compiledJavaCompareWithKotlin/vararg/VarargInt.kt +++ b/compiler/testData/loadJava/compiledJavaCompareWithKotlin/vararg/VarargInt.kt @@ -1,5 +1,5 @@ package test public open class VarargInt() : java.lang.Object() { - public open fun vararg(vararg p0: Int): Unit = Unit.VALUE + public open fun vararg(vararg p0: Int): Unit = Unit } diff --git a/compiler/testData/loadJava/compiledJavaCompareWithKotlin/vararg/VarargString.kt b/compiler/testData/loadJava/compiledJavaCompareWithKotlin/vararg/VarargString.kt index 657b08c7a98..267e6a316aa 100644 --- a/compiler/testData/loadJava/compiledJavaCompareWithKotlin/vararg/VarargString.kt +++ b/compiler/testData/loadJava/compiledJavaCompareWithKotlin/vararg/VarargString.kt @@ -1,5 +1,5 @@ package test public open class VarargString() : java.lang.Object() { - public open fun vararg(vararg p0: String?): Unit = Unit.VALUE + public open fun vararg(vararg p0: String?): Unit = Unit } diff --git a/compiler/testData/loadJava/compiledKotlin/fun/genericWithTypeVariables/FunParamTwoUpperBounds.kt b/compiler/testData/loadJava/compiledKotlin/fun/genericWithTypeVariables/FunParamTwoUpperBounds.kt index e2973f3cd05..3941dd674d9 100644 --- a/compiler/testData/loadJava/compiledKotlin/fun/genericWithTypeVariables/FunParamTwoUpperBounds.kt +++ b/compiler/testData/loadJava/compiledKotlin/fun/genericWithTypeVariables/FunParamTwoUpperBounds.kt @@ -5,4 +5,4 @@ trait Bar fun foo(): Unit where T : Foo, T : Bar - = Unit.VALUE + = Unit diff --git a/compiler/testData/loadJava/compiledKotlin/type/Unit.kt b/compiler/testData/loadJava/compiledKotlin/type/Unit.kt index 26dc2ce533c..12fd902a1bf 100644 --- a/compiler/testData/loadJava/compiledKotlin/type/Unit.kt +++ b/compiler/testData/loadJava/compiledKotlin/type/Unit.kt @@ -1,4 +1,4 @@ //ALLOW_AST_ACCESS package test -fun unit() = Unit.VALUE +fun unit() = Unit diff --git a/compiler/testData/loadJava/javaAgainstKotlin/signaturePropagation/InheritExtensionFunction/Super.kt b/compiler/testData/loadJava/javaAgainstKotlin/signaturePropagation/InheritExtensionFunction/Super.kt index 0a8d5f24cd7..dc1b1d53749 100644 --- a/compiler/testData/loadJava/javaAgainstKotlin/signaturePropagation/InheritExtensionFunction/Super.kt +++ b/compiler/testData/loadJava/javaAgainstKotlin/signaturePropagation/InheritExtensionFunction/Super.kt @@ -1,6 +1,6 @@ package test public open class Super { - public fun String.foo() = Unit.VALUE + public fun String.foo() = Unit public abstract fun String.bar(p: String) -} \ No newline at end of file +} diff --git a/compiler/testData/psi/SimpleExpressions.kt b/compiler/testData/psi/SimpleExpressions.kt index c1d311829d3..e581ab7004c 100644 --- a/compiler/testData/psi/SimpleExpressions.kt +++ b/compiler/testData/psi/SimpleExpressions.kt @@ -1,5 +1,5 @@ fun a( - a : foo = Unit.VALUE, + a : foo = Unit, a : foo = 10, a : foo = 0x10, a : foo = '1', @@ -43,4 +43,4 @@ fun a( continue @la continue @la -} \ No newline at end of file +} diff --git a/compiler/testData/psi/SimpleExpressions.txt b/compiler/testData/psi/SimpleExpressions.txt index a464a2d6d62..1894e2190d3 100644 --- a/compiler/testData/psi/SimpleExpressions.txt +++ b/compiler/testData/psi/SimpleExpressions.txt @@ -20,12 +20,8 @@ JetFile: SimpleExpressions.kt PsiWhiteSpace(' ') PsiElement(EQ)('=') PsiWhiteSpace(' ') - DOT_QUALIFIED_EXPRESSION - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('Unit') - PsiElement(DOT)('.') - REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('VALUE') + REFERENCE_EXPRESSION + PsiElement(IDENTIFIER)('Unit') PsiElement(COMMA)(',') PsiWhiteSpace('\n ') VALUE_PARAMETER @@ -728,4 +724,4 @@ JetFile: SimpleExpressions.kt LABEL PsiElement(LABEL_IDENTIFIER)('@la') PsiWhiteSpace('\n') - PsiElement(RBRACE)('}') \ No newline at end of file + PsiElement(RBRACE)('}') diff --git a/idea/testData/checker/Casts.kt b/idea/testData/checker/Casts.kt index d6203aec635..b67ec918273 100644 --- a/idea/testData/checker/Casts.kt +++ b/idea/testData/checker/Casts.kt @@ -12,5 +12,5 @@ fun test() : Unit { y as? Int : Int? x as? Int? : Int? y as? Int? : Int? - Unit.VALUE -} \ No newline at end of file + Unit +} diff --git a/idea/testData/checker/ExtensionFunctions.kt b/idea/testData/checker/ExtensionFunctions.kt index 56f06271db4..6f0f7701ac7 100644 --- a/idea/testData/checker/ExtensionFunctions.kt +++ b/idea/testData/checker/ExtensionFunctions.kt @@ -1,5 +1,5 @@ fun Int?.optint() : Unit {} -val Int?.optval : Unit get() = Unit.VALUE +val Int?.optval : Unit get() = Unit fun T.foo(x : E, y : A) : T { y.plus(1) diff --git a/idea/testData/checker/FunctionReturnTypes.kt b/idea/testData/checker/FunctionReturnTypes.kt index 6ec18678986..0a175e753be 100644 --- a/idea/testData/checker/FunctionReturnTypes.kt +++ b/idea/testData/checker/FunctionReturnTypes.kt @@ -4,7 +4,7 @@ fun unitEmptyInfer() {} fun unitEmpty() : Unit {} fun unitEmptyReturn() : Unit {return} fun unitIntReturn() : Unit {return 1} -fun unitUnitReturn() : Unit {return Unit.VALUE} +fun unitUnitReturn() : Unit {return Unit} fun test1() : Any = { return } fun test2() : Any = @a {return@a 1} fun test3() : Any { return } @@ -22,7 +22,7 @@ fun foo(expr: StringBuilder): Int { } -fun unitShort() : Unit = Unit.VALUE +fun unitShort() : Unit = Unit fun unitShortConv() : Unit = 1 fun unitShortNull() : Unit = null @@ -39,7 +39,7 @@ fun intFunctionLiteral(): Int = { 10 } fun blockReturnUnitMismatch() : Int {return} fun blockReturnValueTypeMismatch() : Int {return 3.4} fun blockReturnValueTypeMatch() : Int {return 1} -fun blockReturnValueTypeMismatchUnit() : Int {return Unit.VALUE} +fun blockReturnValueTypeMismatchUnit() : Int {return Unit} fun blockAndAndMismatch() : Int { true && false diff --git a/idea/testData/checker/Nullability.kt b/idea/testData/checker/Nullability.kt index ef418de3b99..b2c32fb7e98 100644 --- a/idea/testData/checker/Nullability.kt +++ b/idea/testData/checker/Nullability.kt @@ -38,28 +38,28 @@ fun test() { out.println(); } - if (out == null || out.println(0) == Unit.VALUE) { + if (out == null || out.println(0) == Unit) { out?.println(1) } else { out.println(2) } - if (out != null && out.println() == Unit.VALUE) { + if (out != null && out.println() == Unit) { out.println(); } else { out?.println(); } - if (out == null || out.println() == Unit.VALUE) { + if (out == null || out.println() == Unit) { out?.println(); } else { out.println(); } - if (1 == 2 || out != null && out.println(1) == Unit.VALUE) { + if (1 == 2 || out != null && out.println(1) == Unit) { out?.println(2); } else { @@ -94,28 +94,28 @@ fun test() { out.println(); } - if (out == null || out.println(0) == Unit.VALUE) { + if (out == null || out.println(0) == Unit) { out?.println(1) } else { out.println(2) } - if (out != null && out.println() == Unit.VALUE) { + if (out != null && out.println() == Unit) { out.println(); } else { out?.println(); } - if (out == null || out.println() == Unit.VALUE) { + if (out == null || out.println() == Unit) { out?.println(); } else { out.println(); } - if (1 == 2 || out != null && out.println(1) == Unit.VALUE) { + if (1 == 2 || out != null && out.println(1) == Unit) { out?.println(2); } else { diff --git a/idea/testData/checker/infos/Autocasts.kt b/idea/testData/checker/infos/Autocasts.kt index 482d520c211..3f4d5dd1005 100644 --- a/idea/testData/checker/infos/Autocasts.kt +++ b/idea/testData/checker/infos/Autocasts.kt @@ -19,7 +19,7 @@ fun f9(a : A?) { a?.bar() a?.foo() } - if (!(a is B) || a.bar() == Unit.VALUE) { + if (!(a is B) || a.bar() == Unit) { a?.bar() } if (!(a is B)) { @@ -97,7 +97,7 @@ fun f13(a : A?) { } a?.foo() - if (a is B && a.foo() == Unit.VALUE) { + if (a is B && a.foo() == Unit) { a.foo() a.bar() } diff --git a/idea/testData/intentions/attributeCallReplacements/replaceInvokeIntention/extensionFunction.kt b/idea/testData/intentions/attributeCallReplacements/replaceInvokeIntention/extensionFunction.kt index 28bc6e83874..81d7eb5ef16 100644 --- a/idea/testData/intentions/attributeCallReplacements/replaceInvokeIntention/extensionFunction.kt +++ b/idea/testData/intentions/attributeCallReplacements/replaceInvokeIntention/extensionFunction.kt @@ -1,7 +1,7 @@ fun test() { class Test() - fun Test.invoke(): Unit = Unit.VALUE + fun Test.invoke(): Unit = Unit val test = Test() test.invoke() diff --git a/idea/testData/intentions/attributeCallReplacements/replaceInvokeIntention/extensionFunction.kt.after b/idea/testData/intentions/attributeCallReplacements/replaceInvokeIntention/extensionFunction.kt.after index 185e12cad3d..d3de243e691 100644 --- a/idea/testData/intentions/attributeCallReplacements/replaceInvokeIntention/extensionFunction.kt.after +++ b/idea/testData/intentions/attributeCallReplacements/replaceInvokeIntention/extensionFunction.kt.after @@ -1,7 +1,7 @@ fun test() { class Test() - fun Test.invoke(): Unit = Unit.VALUE + fun Test.invoke(): Unit = Unit val test = Test() test() diff --git a/idea/testData/intentions/specifyType/unitType.kt b/idea/testData/intentions/specifyType/unitType.kt index bd24acedade..c61ffb21d71 100644 --- a/idea/testData/intentions/specifyType/unitType.kt +++ b/idea/testData/intentions/specifyType/unitType.kt @@ -1 +1 @@ -val x = Unit.VALUE \ No newline at end of file +val x = Unit diff --git a/idea/testData/intentions/specifyType/unitType.kt.after b/idea/testData/intentions/specifyType/unitType.kt.after index eed5f8f383b..87073e2bab5 100644 --- a/idea/testData/intentions/specifyType/unitType.kt.after +++ b/idea/testData/intentions/specifyType/unitType.kt.after @@ -1 +1 @@ -val x: Unit = Unit.VALUE \ No newline at end of file +val x: Unit = Unit diff --git a/idea/testData/javaFacade/wrapFunWithDefaultParam.kt b/idea/testData/javaFacade/wrapFunWithDefaultParam.kt index 6c02fa0beb6..0d05d477e34 100644 --- a/idea/testData/javaFacade/wrapFunWithDefaultParam.kt +++ b/idea/testData/javaFacade/wrapFunWithDefaultParam.kt @@ -1 +1 @@ -fun test(a : Int = 1) = Unit.VALUE \ No newline at end of file +fun test(a : Int = 1) = Unit