Fix rangeTo between Float and Long

Float.rangeTo(Long) and Long.rangeTo(Float) now both return FloatRange for
consistency with other binary operations between floats and longs which, in
turn, return float to be consistent with Java
This commit is contained in:
Alexander Udalov
2014-02-10 23:01:08 +04:00
parent 7b642c9e37
commit 8c97d9ebb3
4 changed files with 4 additions and 6 deletions
+1 -1
View File
@@ -585,7 +585,7 @@ public final class Float : jet.Number, jet.Comparable<jet.Float> {
public final fun rangeTo(/*0*/ other: jet.Double): jet.DoubleRange public final fun rangeTo(/*0*/ other: jet.Double): jet.DoubleRange
public final fun rangeTo(/*0*/ other: jet.Float): jet.FloatRange public final fun rangeTo(/*0*/ other: jet.Float): jet.FloatRange
public final fun rangeTo(/*0*/ other: jet.Int): jet.FloatRange public final fun rangeTo(/*0*/ other: jet.Int): jet.FloatRange
public final fun rangeTo(/*0*/ other: jet.Long): jet.DoubleRange public final fun rangeTo(/*0*/ other: jet.Long): jet.FloatRange
public final fun rangeTo(/*0*/ other: jet.Short): jet.FloatRange public final fun rangeTo(/*0*/ other: jet.Short): jet.FloatRange
public final fun times(/*0*/ other: jet.Byte): jet.Float public final fun times(/*0*/ other: jet.Byte): jet.Float
public final fun times(/*0*/ other: jet.Char): jet.Float public final fun times(/*0*/ other: jet.Char): jet.Float
+1 -1
View File
@@ -141,7 +141,7 @@ public class Float private () : Number, Comparable<Float> {
public fun rangeTo(other : Double) : DoubleRange public fun rangeTo(other : Double) : DoubleRange
public fun rangeTo(other : Float) : FloatRange public fun rangeTo(other : Float) : FloatRange
public fun rangeTo(other : Long) : DoubleRange public fun rangeTo(other : Long) : FloatRange
public fun rangeTo(other : Int) : FloatRange public fun rangeTo(other : Int) : FloatRange
public fun rangeTo(other : Short) : FloatRange public fun rangeTo(other : Short) : FloatRange
public fun rangeTo(other : Byte) : FloatRange public fun rangeTo(other : Byte) : FloatRange
+2 -3
View File
@@ -1,5 +1,5 @@
/* /*
* Copyright 2010-2013 JetBrains s.r.o. * Copyright 2010-2014 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -14,12 +14,11 @@
* limitations under the License. * limitations under the License.
*/ */
package jet.runtime; package jet.runtime;
import jet.*; import jet.*;
/* This file is generated by org.jetbrains.jet.generators.runtime.GenerateRanges. DO NOT EDIT! */ /* This file is generated by org.jetbrains.jet.generators.builtins.GenerateRangeIntrinsics. DO NOT EDIT! */
public class Ranges { public class Ranges {
public static ByteRange rangeTo(byte from, byte to) { public static ByteRange rangeTo(byte from, byte to) {
return new ByteRange(from, to); return new ByteRange(from, to);
@@ -38,7 +38,6 @@ public class GenerateRangeIntrinsics {
try { try {
String copyright = "injector-generator/copyright.txt"; String copyright = "injector-generator/copyright.txt";
out.println(FileUtil.loadFile(new File(copyright))); out.println(FileUtil.loadFile(new File(copyright)));
out.println();
out.println("package jet.runtime;"); out.println("package jet.runtime;");
out.println(); out.println();