Skip to content

Commit 5657759

Browse files
fix QA tests
1 parent c9a64b2 commit 5657759

File tree

12 files changed

+12
-12
lines changed

12 files changed

+12
-12
lines changed

src/fsharp/FSComp.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1334,4 +1334,4 @@ tcGlobalsSystemTypeNotFound,"The system type '%s' was required but no referenced
13341334
3213,typrelMemberHasMultiplePossibleDispatchSlots,"The member '%s' matches multiple overloads of the same method.\nPlease restrict it to one of the following:%s."
13351335
3214,methodIsNotStatic,"Method or object constructor '%s' is not static"
13361336
3215,expressionHasNoName,"This expression does not have a name."
1337-
3216,chkNoFirstClassNameOf,"First-class uses of the 'nameof' operator is not permitted"
1337+
3216,chkNoFirstClassNameOf,"First-class uses of the 'nameof' operator is not permitted."

src/fsharp/TypeChecker.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8269,7 +8269,7 @@ and TcFunctionApplicationThen cenv overallTy env tpenv mExprAndArg expr exprty (
82698269
// generate fake `range` for the constant the `nameof(..)` we are substituting
82708270
let constRange = mkRange r.FileName r.Start (mkPos r.StartLine (r.StartColumn + argIdent.idText.Length + 2)) // `2` are for quotes
82718271
TcDelayed cenv overallTy env tpenv mExprAndArg (ApplicableExpr(cenv, Expr.Const(Const.String(argIdent.idText), constRange, cenv.g.string_ty), true)) cenv.g.string_ty ExprAtomicFlag.Atomic delayed
8272-
| _ -> error (Error(FSComp.SR.expressionHasNoName(), synArg.Range))
8272+
| _ -> error (Error(FSComp.SR.expressionHasNoName(), expr.Range))
82738273
| _ ->
82748274
// Notice the special case 'seq { ... }'. In this case 'seq' is actually a function in the F# library.
82758275
// Set a flag in the syntax tree to say we noticed a leading 'seq'

tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/NameOf/E_NameOfAdditionExpr.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// #Regression #Conformance #DataExpressions
22
// Verify that nameof doesn't work on const string
3-
//<Expects id="FS3199" span="(5,9)" status="error">This expression does not have a name.</Expects>
3+
//<Expects id="FS3215" span="(5,9)" status="error">This expression does not have a name.</Expects>
44

55
let x = nameof(1+2)
66

tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/NameOf/E_NameOfAppliedFunction.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// #Regression #Conformance #DataExpressions
22
// Verify that nameof doesn't work on applied functions
3-
//<Expects id="FS3199" span="(6,9)" status="error">This expression does not have a name.</Expects>
3+
//<Expects id="FS3215" span="(6,9)" status="error">This expression does not have a name.</Expects>
44

55
let f() = 1
66
let x = nameof(f())

tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/NameOf/E_NameOfAsAFunction.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// #Regression #Conformance #DataExpressions
22
// Verify that nameof can't be used as a function.
3-
//<Expects id="FS3199" span="(5,9)" status="error">This expression does not have a name.</Expects>
3+
//<Expects id="FS3216" span="(5,9)" status="error">First-class uses of the 'nameof' operator is not permitted</Expects>
44

55
let f = nameof
66

tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/NameOf/E_NameOfDictLookup.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// #Regression #Conformance #DataExpressions
22
// Verify that nameof doesn't work on dictionary lookup
3-
//<Expects id="FS3199" span="(6,9)" status="error">This expression does not have a name.</Expects>
3+
//<Expects id="FS3215" span="(6,9)" status="error">This expression does not have a name.</Expects>
44

55
let dict = new System.Collections.Generic.Dictionary<int,string>()
66
let b = nameof(dict.[2])

tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/NameOf/E_NameOfIntConst.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// #Regression #Conformance #DataExpressions
22
// Verify that nameof doesn't work on const int
3-
//<Expects id="FS3199" span="(5,9)" status="error">This expression does not have a name.</Expects>
3+
//<Expects id="FS3215" span="(5,9)" status="error">This expression does not have a name.</Expects>
44

55
let x = nameof 1
66

tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/NameOf/E_NameOfIntegerAppliedFunction.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// #Regression #Conformance #DataExpressions
22
// Verify that nameof doesn't work on applied functions
3-
//<Expects id="FS3199" span="(6,9)" status="error">This expression does not have a name.</Expects>
3+
//<Expects id="FS3215" span="(6,9)" status="error">This expression does not have a name.</Expects>
44

55
let f x = 1 * x
66
let x = nameof(f 2)

tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/NameOf/E_NameOfParameterAppliedFunction.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// #Regression #Conformance #DataExpressions
22
// Verify that nameof doesn't work on applied functions
3-
//<Expects id="FS3199" span="(7,9)" status="error">This expression does not have a name.</Expects>
3+
//<Expects id="FS3215" span="(7,9)" status="error">This expression does not have a name.</Expects>
44

55
let f x y = x y
66
let z x = 1 * x

tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/NameOf/E_NameOfPartiallyAppliedFunction.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// #Regression #Conformance #DataExpressions
22
// Verify that nameof doesn't work on partially applied functions
3-
//<Expects id="FS3199" span="(6,9)" status="error">This expression does not have a name.</Expects>
3+
//<Expects id="FS3215" span="(6,9)" status="error">This expression does not have a name.</Expects>
44

55
let f x y = y * x
66
let x = nameof(f 2)

0 commit comments

Comments
 (0)