KT-4209 Make constructors of primitives private
#KT-4209 Fixed
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -54,7 +54,7 @@ public abstract class BooleanIterator : jet.Iterator<jet.Boolean> {
|
||||
}
|
||||
|
||||
public final class Byte : jet.Number, jet.Comparable<jet.Byte> {
|
||||
/*primary*/ public constructor Byte()
|
||||
/*primary*/ private constructor Byte()
|
||||
public open override /*1*/ fun compareTo(/*0*/ other: jet.Byte): jet.Int
|
||||
public final fun compareTo(/*0*/ other: jet.Char): jet.Int
|
||||
public final fun compareTo(/*0*/ other: jet.Double): jet.Int
|
||||
@@ -167,7 +167,7 @@ public final class ByteRange : jet.Range<jet.Byte>, jet.Progression<jet.Byte> {
|
||||
}
|
||||
|
||||
public final class Char : jet.Number, jet.Comparable<jet.Char> {
|
||||
/*primary*/ public constructor Char()
|
||||
/*primary*/ private constructor Char()
|
||||
public final fun compareTo(/*0*/ other: jet.Byte): jet.Int
|
||||
public open override /*1*/ fun compareTo(/*0*/ other: jet.Char): jet.Int
|
||||
public final fun compareTo(/*0*/ other: jet.Double): jet.Int
|
||||
@@ -291,7 +291,7 @@ public trait Comparable</*0*/ in T> {
|
||||
}
|
||||
|
||||
public final class Double : jet.Number, jet.Comparable<jet.Double> {
|
||||
/*primary*/ public constructor Double()
|
||||
/*primary*/ private constructor Double()
|
||||
public final fun compareTo(/*0*/ other: jet.Byte): jet.Int
|
||||
public final fun compareTo(/*0*/ other: jet.Char): jet.Int
|
||||
public open override /*1*/ fun compareTo(/*0*/ other: jet.Double): jet.Int
|
||||
@@ -501,7 +501,7 @@ public trait ExtensionFunction9</*0*/ in T, /*1*/ in P1, /*2*/ in P2, /*3*/ in P
|
||||
}
|
||||
|
||||
public final class Float : jet.Number, jet.Comparable<jet.Float> {
|
||||
/*primary*/ public constructor Float()
|
||||
/*primary*/ private constructor Float()
|
||||
public final fun compareTo(/*0*/ other: jet.Byte): jet.Int
|
||||
public final fun compareTo(/*0*/ other: jet.Char): jet.Int
|
||||
public final fun compareTo(/*0*/ other: jet.Double): jet.Int
|
||||
@@ -711,7 +711,7 @@ public trait Hashable {
|
||||
}
|
||||
|
||||
public final class Int : jet.Number, jet.Comparable<jet.Int> {
|
||||
/*primary*/ public constructor Int()
|
||||
/*primary*/ private constructor Int()
|
||||
public final fun and(/*0*/ other: jet.Int): jet.Int
|
||||
public final fun compareTo(/*0*/ other: jet.Byte): jet.Int
|
||||
public final fun compareTo(/*0*/ other: jet.Char): jet.Int
|
||||
@@ -1141,7 +1141,7 @@ public trait ListIterator</*0*/ out T> : jet.Iterator<T> {
|
||||
}
|
||||
|
||||
public final class Long : jet.Number, jet.Comparable<jet.Long> {
|
||||
/*primary*/ public constructor Long()
|
||||
/*primary*/ private constructor Long()
|
||||
public final fun and(/*0*/ other: jet.Long): jet.Long
|
||||
public final fun compareTo(/*0*/ other: jet.Byte): jet.Int
|
||||
public final fun compareTo(/*0*/ other: jet.Char): jet.Int
|
||||
@@ -1438,7 +1438,7 @@ public trait Set</*0*/ out E> : jet.Collection<E> {
|
||||
}
|
||||
|
||||
public final class Short : jet.Number, jet.Comparable<jet.Short> {
|
||||
/*primary*/ public constructor Short()
|
||||
/*primary*/ private constructor Short()
|
||||
public final fun compareTo(/*0*/ other: jet.Byte): jet.Int
|
||||
public final fun compareTo(/*0*/ other: jet.Char): jet.Int
|
||||
public final fun compareTo(/*0*/ other: jet.Double): jet.Int
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
fun test() {
|
||||
<!INVISIBLE_MEMBER!>Double<!>()
|
||||
<!INVISIBLE_MEMBER!>Float<!>()
|
||||
<!INVISIBLE_MEMBER!>Long<!>()
|
||||
<!INVISIBLE_MEMBER!>Int<!>()
|
||||
<!INVISIBLE_MEMBER!>Short<!>()
|
||||
<!INVISIBLE_MEMBER!>Byte<!>()
|
||||
<!INVISIBLE_MEMBER!>Char<!>()
|
||||
<!INVISIBLE_MEMBER!>Boolean<!>()
|
||||
}
|
||||
@@ -134,6 +134,11 @@ public class JetDiagnosticsTestGenerated extends AbstractDiagnosticsTestWithEage
|
||||
doTest("compiler/testData/diagnostics/tests/Constructors.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("ConstructorsOfPrimitives.kt")
|
||||
public void testConstructorsOfPrimitives() throws Exception {
|
||||
doTest("compiler/testData/diagnostics/tests/ConstructorsOfPrimitives.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("CovariantOverrideType.kt")
|
||||
public void testCovariantOverrideType() throws Exception {
|
||||
doTest("compiler/testData/diagnostics/tests/CovariantOverrideType.kt");
|
||||
|
||||
@@ -29,7 +29,7 @@ public trait Hashable {
|
||||
public fun equals(other : Any?) : Boolean
|
||||
}
|
||||
|
||||
public class Boolean {
|
||||
public class Boolean private () {
|
||||
public fun not() : Boolean
|
||||
|
||||
public fun and(other : Boolean) : Boolean
|
||||
|
||||
@@ -17,7 +17,7 @@ public abstract class Number : Hashable {
|
||||
// fun equals(other : Char) : Boolean
|
||||
}
|
||||
|
||||
public class Double : Number, Comparable<Double> {
|
||||
public class Double private () : Number, Comparable<Double> {
|
||||
public override fun compareTo(other : Double) : Int
|
||||
public fun compareTo(other : Float) : Int
|
||||
public fun compareTo(other : Long) : Int
|
||||
@@ -90,7 +90,7 @@ public class Double : Number, Comparable<Double> {
|
||||
public override fun equals(other : Any?) : Boolean
|
||||
}
|
||||
|
||||
public class Float : Number, Comparable<Float> {
|
||||
public class Float private () : Number, Comparable<Float> {
|
||||
public fun compareTo(other : Double) : Int
|
||||
public override fun compareTo(other : Float) : Int
|
||||
public fun compareTo(other : Long) : Int
|
||||
@@ -164,7 +164,7 @@ public class Float : Number, Comparable<Float> {
|
||||
public override fun equals(other : Any?) : Boolean
|
||||
}
|
||||
|
||||
public class Long : Number, Comparable<Long> {
|
||||
public class Long private () : Number, Comparable<Long> {
|
||||
public fun compareTo(other : Double) : Int
|
||||
public fun compareTo(other : Float) : Int
|
||||
public override fun compareTo(other : Long) : Int
|
||||
@@ -246,7 +246,7 @@ public class Long : Number, Comparable<Long> {
|
||||
public override fun equals(other : Any?) : Boolean
|
||||
}
|
||||
|
||||
public class Int : Number, Comparable<Int> {
|
||||
public class Int private () : Number, Comparable<Int> {
|
||||
public fun compareTo(other : Double) : Int
|
||||
public fun compareTo(other : Float) : Int
|
||||
public fun compareTo(other : Long) : Int
|
||||
@@ -328,7 +328,7 @@ public class Int : Number, Comparable<Int> {
|
||||
public override fun equals(other : Any?) : Boolean
|
||||
}
|
||||
|
||||
public class Char : Number, Comparable<Char> {
|
||||
public class Char private () : Number, Comparable<Char> {
|
||||
public fun compareTo(other : Double) : Int
|
||||
public fun compareTo(other : Float) : Int
|
||||
public fun compareTo(other : Long) : Int
|
||||
@@ -396,7 +396,7 @@ public class Char : Number, Comparable<Char> {
|
||||
public override fun equals(other : Any?) : Boolean
|
||||
}
|
||||
|
||||
public class Short : Number, Comparable<Short> {
|
||||
public class Short private () : Number, Comparable<Short> {
|
||||
public fun compareTo(other : Double) : Int
|
||||
public fun compareTo(other : Float) : Int
|
||||
public fun compareTo(other : Long) : Int
|
||||
@@ -470,7 +470,7 @@ public class Short : Number, Comparable<Short> {
|
||||
public override fun equals(other : Any?) : Boolean
|
||||
}
|
||||
|
||||
public class Byte : Number, Comparable<Byte> {
|
||||
public class Byte private () : Number, Comparable<Byte> {
|
||||
public fun compareTo(other : Double) : Int
|
||||
public fun compareTo(other : Float) : Int
|
||||
public fun compareTo(other : Long) : Int
|
||||
|
||||
Reference in New Issue
Block a user