@@ -8252,19 +8252,23 @@ and TcFunctionApplicationThen cenv overallTy env tpenv mExprAndArg expr exprty (
82528252 | _ -> expr
82538253
82548254 match stripParens expr with
8255+ | SynExpr.Ident ident -> Some ident
82558256 | SynExpr.LongIdent(_, LongIdentWithDots(idents, _), _, _) -> List.tryLast idents
82568257 | _ -> None
82578258
82588259 // If the type of 'synArg' unifies as a function type, then this is a function application, otherwise
82598260 // it is an error or a computation expression
82608261 match UnifyFunctionTypeUndoIfFailed cenv denv mFunExpr exprty with
82618262 | Some (domainTy,resultTy) ->
8262- match expr, synArg with
8263- | (ApplicableExpr(_, NameOfExpr cenv.g _, _), LastPartOfLongIdentStripParens argIdent) ->
8264- let r = expr.Range
8265- // generate fake `range` for the constant the `nameof(..)` we are substituting
8266- let constRange = mkRange r.FileName r.Start (mkPos r.StartLine (r.StartColumn + argIdent.idText.Length + 2)) // `2` are for quotes
8267- 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
8263+ match expr with
8264+ | ApplicableExpr(_, NameOfExpr cenv.g _, _) ->
8265+ match synArg with
8266+ | LastPartOfLongIdentStripParens argIdent ->
8267+ let r = expr.Range
8268+ // generate fake `range` for the constant the `nameof(..)` we are substituting
8269+ let constRange = mkRange r.FileName r.Start (mkPos r.StartLine (r.StartColumn + argIdent.idText.Length + 2)) // `2` are for quotes
8270+ 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))
82688272 | _ ->
82698273 // Notice the special case 'seq { ... }'. In this case 'seq' is actually a function in the F# library.
82708274 // Set a flag in the syntax tree to say we noticed a leading 'seq'