diff --git a/compiler/frontend/builtins/jet/Boolean.kotlin_class b/compiler/frontend/builtins/jet/Boolean.kotlin_class index 8b472b4bbd5..48876f24ce9 100644 Binary files a/compiler/frontend/builtins/jet/Boolean.kotlin_class and b/compiler/frontend/builtins/jet/Boolean.kotlin_class differ diff --git a/compiler/frontend/builtins/jet/Byte.kotlin_class b/compiler/frontend/builtins/jet/Byte.kotlin_class index b9b56a89c2b..96e16f171d7 100644 Binary files a/compiler/frontend/builtins/jet/Byte.kotlin_class and b/compiler/frontend/builtins/jet/Byte.kotlin_class differ diff --git a/compiler/frontend/builtins/jet/Char.kotlin_class b/compiler/frontend/builtins/jet/Char.kotlin_class index d77e9cc4aa7..a3ff15dabad 100644 Binary files a/compiler/frontend/builtins/jet/Char.kotlin_class and b/compiler/frontend/builtins/jet/Char.kotlin_class differ diff --git a/compiler/frontend/builtins/jet/Double.kotlin_class b/compiler/frontend/builtins/jet/Double.kotlin_class index 34f9c8fdb66..a8e5be96986 100644 Binary files a/compiler/frontend/builtins/jet/Double.kotlin_class and b/compiler/frontend/builtins/jet/Double.kotlin_class differ diff --git a/compiler/frontend/builtins/jet/Float.kotlin_class b/compiler/frontend/builtins/jet/Float.kotlin_class index 8bfc8a34359..98d14ff176f 100644 Binary files a/compiler/frontend/builtins/jet/Float.kotlin_class and b/compiler/frontend/builtins/jet/Float.kotlin_class differ diff --git a/compiler/frontend/builtins/jet/Int.kotlin_class b/compiler/frontend/builtins/jet/Int.kotlin_class index ccaeee9b1d1..3805607e7b5 100644 Binary files a/compiler/frontend/builtins/jet/Int.kotlin_class and b/compiler/frontend/builtins/jet/Int.kotlin_class differ diff --git a/compiler/frontend/builtins/jet/Long.kotlin_class b/compiler/frontend/builtins/jet/Long.kotlin_class index 9c512a4f466..03202abda2e 100644 Binary files a/compiler/frontend/builtins/jet/Long.kotlin_class and b/compiler/frontend/builtins/jet/Long.kotlin_class differ diff --git a/compiler/frontend/builtins/jet/Short.kotlin_class b/compiler/frontend/builtins/jet/Short.kotlin_class index c89f298c2db..d6f9b5f14a2 100644 Binary files a/compiler/frontend/builtins/jet/Short.kotlin_class and b/compiler/frontend/builtins/jet/Short.kotlin_class differ diff --git a/compiler/testData/builtin-classes.txt b/compiler/testData/builtin-classes.txt index 35ab534a698..174badbe091 100644 --- a/compiler/testData/builtin-classes.txt +++ b/compiler/testData/builtin-classes.txt @@ -54,7 +54,7 @@ public abstract class BooleanIterator : jet.Iterator { } public final class Byte : jet.Number, jet.Comparable { - /*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.Progression { } public final class Char : jet.Number, jet.Comparable { - /*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 { } public final class Double : jet.Number, jet.Comparable { - /*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 { - /*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 { - /*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 : jet.Iterator { } public final class Long : jet.Number, jet.Comparable { - /*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 : jet.Collection { } public final class Short : jet.Number, jet.Comparable { - /*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 diff --git a/compiler/testData/diagnostics/tests/ConstructorsOfPrimitives.kt b/compiler/testData/diagnostics/tests/ConstructorsOfPrimitives.kt new file mode 100644 index 00000000000..adfb57f794b --- /dev/null +++ b/compiler/testData/diagnostics/tests/ConstructorsOfPrimitives.kt @@ -0,0 +1,10 @@ +fun test() { + Double() + Float() + Long() + Int() + Short() + Byte() + Char() + Boolean() +} \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java b/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java index cc4183dce25..b222706d282 100644 --- a/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java +++ b/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java @@ -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"); diff --git a/idea/builtinsSrc/jet/Library.kt b/idea/builtinsSrc/jet/Library.kt index fe19c3f8db0..2050b98dba6 100644 --- a/idea/builtinsSrc/jet/Library.kt +++ b/idea/builtinsSrc/jet/Library.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 diff --git a/idea/builtinsSrc/jet/Numbers.kt b/idea/builtinsSrc/jet/Numbers.kt index 728d49f64d9..52ddf64bc8d 100644 --- a/idea/builtinsSrc/jet/Numbers.kt +++ b/idea/builtinsSrc/jet/Numbers.kt @@ -17,7 +17,7 @@ public abstract class Number : Hashable { // fun equals(other : Char) : Boolean } -public class Double : Number, Comparable { +public class Double private () : Number, Comparable { 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 { public override fun equals(other : Any?) : Boolean } -public class Float : Number, Comparable { +public class Float private () : Number, Comparable { 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 { public override fun equals(other : Any?) : Boolean } -public class Long : Number, Comparable { +public class Long private () : Number, Comparable { 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 { public override fun equals(other : Any?) : Boolean } -public class Int : Number, Comparable { +public class Int private () : Number, Comparable { 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 { public override fun equals(other : Any?) : Boolean } -public class Char : Number, Comparable { +public class Char private () : Number, Comparable { 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 { public override fun equals(other : Any?) : Boolean } -public class Short : Number, Comparable { +public class Short private () : Number, Comparable { 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 { public override fun equals(other : Any?) : Boolean } -public class Byte : Number, Comparable { +public class Byte private () : Number, Comparable { public fun compareTo(other : Double) : Int public fun compareTo(other : Float) : Int public fun compareTo(other : Long) : Int