No arithmetic for Chars (except for '-')
This commit is contained in:
@@ -104,7 +104,8 @@ public class PrimitiveTypesTest extends CodegenTestCase {
|
||||
}
|
||||
|
||||
public void testChar() throws Exception {
|
||||
binOpTest("fun foo(a: Char, b: Char): Int = a + b", 'A', (char) 3, (int) 'D');
|
||||
// '+' is not available for Chars
|
||||
binOpTest("fun foo(a: Char, b: Char): Int = a - b", 'D', (char) 3, (int) 'A');
|
||||
}
|
||||
|
||||
public void testFloat() throws Exception {
|
||||
|
||||
@@ -395,7 +395,7 @@ public class JetTypeCheckerTest extends JetLiteFixture {
|
||||
assertType("'1'.plus(1.flt)", "Float");
|
||||
assertType("'1'.plus(1.lng)", "Long");
|
||||
assertType("'1'.plus(1)", "Int");
|
||||
assertType("'1'.plus('1')", "Int");
|
||||
assertType("'1'.minus('1')", "Int"); // Plus is not available for char
|
||||
|
||||
assertType("(1:Short).plus(1.dbl)", "Double");
|
||||
assertType("(1:Short).plus(1.flt)", "Float");
|
||||
|
||||
Reference in New Issue
Block a user