Introduce language feature: underscores in numeric literals
#KT-2964 Fixed
This commit is contained in:
+19
@@ -0,0 +1,19 @@
|
||||
// !DIAGNOSTICS: -UNUSED_EXPRESSION
|
||||
|
||||
fun foo() {
|
||||
<!ILLEGAL_UNDERSCORE!>1_<!>
|
||||
<!ILLEGAL_UNDERSCORE!>0x_f<!>
|
||||
<!ILLEGAL_UNDERSCORE!>0X_f<!>
|
||||
<!ILLEGAL_UNDERSCORE!>0b_1<!>
|
||||
<!ILLEGAL_UNDERSCORE!>0B_1<!>
|
||||
<!ILLEGAL_UNDERSCORE!>1.0_<!>
|
||||
<!ILLEGAL_UNDERSCORE!>1_.1<!>
|
||||
<!ILLEGAL_UNDERSCORE!>1._1<!>
|
||||
<!ILLEGAL_UNDERSCORE!>1_._1<!>
|
||||
<!ILLEGAL_UNDERSCORE!>1.0_e1<!>
|
||||
<!ILLEGAL_UNDERSCORE!>1.0E_1<!>
|
||||
<!ILLEGAL_UNDERSCORE!>0Xe_<!>
|
||||
<!ILLEGAL_UNDERSCORE!>1.1_e-1_23<!>
|
||||
<!ILLEGAL_UNDERSCORE!>1.0e+_0<!>
|
||||
<!ILLEGAL_UNDERSCORE!>1.0e-_0<!>
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package
|
||||
|
||||
public fun foo(): kotlin.Unit
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// !LANGUAGE: -UnderscoresInNumericLiterals
|
||||
// !DIAGNOSTICS: -UNUSED_EXPRESSION
|
||||
|
||||
fun foo() {
|
||||
<!UNSUPPORTED_FEATURE!>100_1<!>
|
||||
<!UNSUPPORTED_FEATURE!>3_.1<!>
|
||||
<!UNSUPPORTED_FEATURE!>3_._1<!>
|
||||
<!UNSUPPORTED_FEATURE!>2___4<!>
|
||||
<!UNSUPPORTED_FEATURE!>123_<!>
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package
|
||||
|
||||
public fun foo(): kotlin.Unit
|
||||
Reference in New Issue
Block a user