diff --git a/src/fsharp/FSComp.txt b/src/fsharp/FSComp.txt index 31bb9f3ae8f..096f76e140b 100644 --- a/src/fsharp/FSComp.txt +++ b/src/fsharp/FSComp.txt @@ -977,7 +977,7 @@ lexUnexpectedChar,"Unexpected character '%s'" 1153,lexInvalidFloat,"Invalid floating point number" 1154,lexOusideDecimal,"This number is outside the allowable range for decimal literals" 1155,lexOusideThirtyTwoBitFloat,"This number is outside the allowable range for 32-bit floats" -1156,lexInvalidNumericLiteral,"This is not a valid numeric literal. Sample formats include 4, 0x4, 0b0100, 4L, 4UL, 4u, 4s, 4us, 4y, 4uy, 4.0, 4.0f, 4I." +1156,lexInvalidNumericLiteral,"This is not a valid numeric literal. Valid numeric literals include 1, 0x1, 0b0001 (int), 1u (uint32), 1L (int64), 1UL (uint64), 1s (int16), 1y (sbyte), 1ui (byte), 1.0 (float), 1.0f (float32), 1.0m (decimal), 1I (BigInteger)." 1157,lexInvalidByteLiteral,"This is not a valid byte literal" 1158,lexInvalidCharLiteral,"This is not a valid character literal" 1159,lexThisUnicodeOnlyInStringLiterals,"This Unicode encoding is only valid in string literals" diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/IdentifiersAndKeywords/E_InvalidIdentifier01.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/IdentifiersAndKeywords/E_InvalidIdentifier01.fs index f4051d9f2d5..59debddb561 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/IdentifiersAndKeywords/E_InvalidIdentifier01.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/IdentifiersAndKeywords/E_InvalidIdentifier01.fs @@ -2,7 +2,7 @@ #light // Test invalid identifiers -//This is not a valid numeric literal. Sample formats include 4, 0x4, 0b0100, 4L, 4UL, 4u, 4s +//This is not a valid numeric literal. Valid numeric literals include let 0leaderingzero = false diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/LineDirectives/Line01.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/LineDirectives/Line01.fs index e7b577955b8..b76513ad2ef 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/LineDirectives/Line01.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/LineDirectives/Line01.fs @@ -5,7 +5,7 @@ open System // Test setting the 'line', which we validate by checking the line/col span in errors -//This is not a valid numeric literal\. Sample formats include 4, 0x4, 0b0100, 4L, 4UL, 4u, 4s, 4us, 4y, 4uy, 4\.0, 4\.0f, 4I +//This is not a valid numeric literal. Valid numeric literals include # 1000 "Line01.fs" // 1000 diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingIEEE-lf-LF03a.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingIEEE-lf-LF03a.fs index 22e328760fc..0a564fd2e81 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingIEEE-lf-LF03a.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingIEEE-lf-LF03a.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #LexicalAnalysis #Constants // Number type specifier // IEEE32/IEEE64 - lF is illegal -//This is not a valid numeric literal\. Sample formats include 4, 0x4, 0b0100, 4L, 4UL, 4u, 4s, 4us, 4y, 4uy, 4\.0, 4\.0f, 4I\.$ +//This is not a valid numeric literal. Valid numeric literals include let x = 0X5lF diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingIEEE-lf-LF03b.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingIEEE-lf-LF03b.fs index e1c287811c0..4602d7cb54a 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingIEEE-lf-LF03b.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingIEEE-lf-LF03b.fs @@ -1,6 +1,6 @@ // #Regression #Conformance #LexicalAnalysis #Constants // Number type specifier // IEEE32/IEEE64 - Lf is illegal -//This is not a valid numeric literal\. Sample formats include 4, 0x4, 0b0100, 4L, 4UL, 4u, 4s, 4us, 4y, 4uy, 4\.0, 4\.0f, 4I +//This is not a valid numeric literal. Valid numeric literals include let y = 0X5Lf diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/AutoProperties/E_IllegalName01.fs b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/AutoProperties/E_IllegalName01.fs index 83dcce50a4f..dc2ebe4e4f8 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/AutoProperties/E_IllegalName01.fs +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/AutoProperties/E_IllegalName01.fs @@ -1,5 +1,5 @@ // #Conformance #ObjectOrientedTypes #Classes #MethodsAndProperties -// This is not a valid numeric literal\. Sample formats include 4, 0x4, 0b0100, 4L, 4UL, 4u, 4s, 4us, 4y, 4uy, 4\.0, 4\.0f, 4I\. +// This is not a valid numeric literal. Valid numeric literals include type T() = member val 1P = [] with get,set diff --git a/tests/fsharpqa/Source/Warnings/WrongNumericLiteral.fs b/tests/fsharpqa/Source/Warnings/WrongNumericLiteral.fs new file mode 100644 index 00000000000..c6b3514e1ce --- /dev/null +++ b/tests/fsharpqa/Source/Warnings/WrongNumericLiteral.fs @@ -0,0 +1,6 @@ +// #Warnings +//This is not a valid numeric literal. Valid numeric literals include + +let foo = 1up + +exit 0 \ No newline at end of file diff --git a/tests/fsharpqa/Source/Warnings/env.lst b/tests/fsharpqa/Source/Warnings/env.lst new file mode 100644 index 00000000000..d96a004c59c --- /dev/null +++ b/tests/fsharpqa/Source/Warnings/env.lst @@ -0,0 +1 @@ + SOURCE=WrongNumericLiteral.fs # WrongNumericLiteral.fs \ No newline at end of file diff --git a/tests/fsharpqa/Source/test.lst b/tests/fsharpqa/Source/test.lst index fdde0f09980..f3c33e0f7e2 100644 --- a/tests/fsharpqa/Source/test.lst +++ b/tests/fsharpqa/Source/test.lst @@ -280,6 +280,7 @@ Misc01 Libraries\Core\NativeInterop\stackalloc Misc01 Libraries\Core\Operators Misc01 Libraries\Core\Reflection Misc01 Libraries\Core\Unchecked +Misc01 Warnings Misc02 Libraries\Portable Misc02 Misc