Number rename: xxxValue() --> toXxx(), test
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
public class FortyTwoExtractor {
|
||||
private Number fortyTwo = new FortyTwo();
|
||||
|
||||
public int intValue() {
|
||||
return fortyTwo.intValue();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
class FortyTwo : Number() {
|
||||
override fun toByte() = 42.toByte()
|
||||
|
||||
override fun toShort() = 42.toShort()
|
||||
|
||||
override fun toInt() = 42
|
||||
|
||||
override fun toLong() = 42L
|
||||
|
||||
override fun toFloat() = 42.0f
|
||||
|
||||
override fun toDouble() = 42.0
|
||||
|
||||
override fun toChar() = 42.toChar()
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val extractor = FortyTwoExtractor()
|
||||
if (extractor.intValue() != 42) return "FAIL"
|
||||
return "OK"
|
||||
}
|
||||
+6
@@ -77,6 +77,12 @@ public class BlackBoxWithJavaCodegenTestGenerated extends AbstractBlackBoxCodege
|
||||
doTestWithJava(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("number")
|
||||
public void testNumber() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxWithJava/number/");
|
||||
doTestWithJava(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("platformName")
|
||||
public void testPlatformName() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxWithJava/platformName/");
|
||||
|
||||
Reference in New Issue
Block a user