Unit.VALUE -> Unit in testData
This commit is contained in:
@@ -12,5 +12,5 @@ fun test() : Unit {
|
||||
y <warning>as?</warning> Int : Int?
|
||||
x <warning>as?</warning> Int? : Int?
|
||||
y <warning>as?</warning> Int? : Int?
|
||||
Unit.VALUE
|
||||
}
|
||||
Unit
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
fun Int?.optint() : Unit {}
|
||||
val Int?.optval : Unit get() = Unit.VALUE
|
||||
val Int?.optval : Unit get() = Unit
|
||||
|
||||
fun <T: Any, E> T.foo(<warning>x</warning> : E, y : A) : T {
|
||||
y.plus(1)
|
||||
|
||||
@@ -4,7 +4,7 @@ fun unitEmptyInfer() {}
|
||||
fun unitEmpty() : Unit {}
|
||||
fun unitEmptyReturn() : Unit {return}
|
||||
fun unitIntReturn() : Unit {return <error>1</error>}
|
||||
fun unitUnitReturn() : Unit {return Unit.VALUE}
|
||||
fun unitUnitReturn() : Unit {return Unit}
|
||||
fun test1() : Any = { <error>return</error> }
|
||||
fun test2() : Any = @a {<error>return@a 1</error>}
|
||||
fun test3() : Any { <error>return</error> }
|
||||
@@ -22,7 +22,7 @@ fun foo(<warning>expr</warning>: StringBuilder): Int {
|
||||
}
|
||||
|
||||
|
||||
fun unitShort() : Unit = Unit.VALUE
|
||||
fun unitShort() : Unit = Unit
|
||||
fun unitShortConv() : Unit = <error>1</error>
|
||||
fun unitShortNull() : Unit = <error>null</error>
|
||||
|
||||
@@ -39,7 +39,7 @@ fun intFunctionLiteral(): Int = <error>{ 10 }</error>
|
||||
fun blockReturnUnitMismatch() : Int {<error>return</error>}
|
||||
fun blockReturnValueTypeMismatch() : Int {return <error>3.4</error>}
|
||||
fun blockReturnValueTypeMatch() : Int {return 1}
|
||||
fun blockReturnValueTypeMismatchUnit() : Int {return <error>Unit.VALUE</error>}
|
||||
fun blockReturnValueTypeMismatchUnit() : Int {return <error>Unit</error>}
|
||||
|
||||
fun blockAndAndMismatch() : Int {
|
||||
true && false
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -19,7 +19,7 @@ fun f9(a : A?) {
|
||||
a<info>?.</info><error descr="[UNRESOLVED_REFERENCE] Unresolved reference: bar">bar</error>()
|
||||
a<info>?.</info>foo()
|
||||
}
|
||||
if (!(a is B) || <info descr="Automatically cast to B">a</info>.bar() == Unit.VALUE) {
|
||||
if (!(a is B) || <info descr="Automatically cast to B">a</info>.bar() == Unit) {
|
||||
a<info>?.</info><error descr="[UNRESOLVED_REFERENCE] Unresolved reference: bar">bar</error>()
|
||||
}
|
||||
if (!(a is B)) {
|
||||
@@ -97,7 +97,7 @@ fun f13(a : A?) {
|
||||
}
|
||||
|
||||
a<info>?.</info>foo()
|
||||
if (a is B && <info descr="Automatically cast to B">a</info>.foo() == Unit.VALUE) {
|
||||
if (a is B && <info descr="Automatically cast to B">a</info>.foo() == Unit) {
|
||||
<info descr="Automatically cast to B">a</info>.foo()
|
||||
<info descr="Automatically cast to B">a</info>.bar()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user