Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0f5165f

Browse files
Vasily KirichenkoVasily Kirichenko
Vasily Kirichenko
authored and
Vasily Kirichenko
committed
use proper error message
1 parent6581790 commit0f5165f

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

‎src/fsharp/FSComp.txt‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1334,5 +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,nameofNotPermitted,"The nameof operator is not allowed in this position."
1338-
3217,wrongNameofArgument,"Only identifiers are allowed as argument for nameof operator."
1337+
3216,nameofNotPermitted,"The nameof operator is not allowed in this position."

‎src/fsharp/TypeChecker.fs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8268,7 +8268,7 @@ and TcFunctionApplicationThen cenv overallTy env tpenv mExprAndArg expr exprty (
82688268
// generate fake `range` for the constant the `nameof(..)` we are substituting
82698269
let constRange = mkRange r.FileName r.Start (mkPos r.StartLine (r.StartColumn + argIdent.idText.Length + 2)) // `2` are for quotes
82708270
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
8271-
| _ -> error (Error(FSComp.SR.wrongNameofArgument(), synArg.Range))
8271+
| _ -> error (Error(FSComp.SR.expressionHasNoName(), synArg.Range))
82728272
| _ ->
82738273
// Notice the special case 'seq { ... }'. In this case 'seq' is actually a function in the F# library.
82748274
// Set a flag in the syntax tree to say we noticed a leading 'seq'

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp