diff --git a/src/Compiler/Checking/Expressions/CheckExpressions.fs b/src/Compiler/Checking/Expressions/CheckExpressions.fs index 83e172628b5..e0478dac679 100644 --- a/src/Compiler/Checking/Expressions/CheckExpressions.fs +++ b/src/Compiler/Checking/Expressions/CheckExpressions.fs @@ -2054,28 +2054,28 @@ let BuildFieldMap (cenv: cenv) env isPartial ty (flds: ((Ident list * Ident) * ' | _ -> error(Error(FSComp.SR.tcRecordFieldInconsistentTypes(), m))) Some(tinst, tcref, fldsmap, List.rev rfldsList) -let ApplyUnionCaseOrExn (makerForUnionCase, makerForExnTag) m (cenv: cenv) env overallTy item = +let ApplyUnionCaseOrExn (makerForUnionCase, makerForExnTag) m mItemIdent (cenv: cenv) env overallTy item = let g = cenv.g let ad = env.eAccessRights match item with | Item.ExnCase ecref -> - CheckEntityAttributes g ecref m |> CommitOperationResult + CheckEntityAttributes g ecref mItemIdent |> CommitOperationResult UnifyTypes cenv env m overallTy g.exn_ty - CheckTyconAccessible cenv.amap m ad ecref |> ignore + CheckTyconAccessible cenv.amap mItemIdent ad ecref |> ignore let mkf = makerForExnTag ecref mkf, recdFieldTysOfExnDefRef ecref, [ for f in (recdFieldsOfExnDefRef ecref) -> f.Id ] | Item.UnionCase(ucinfo, showDeprecated) -> if showDeprecated then - let diagnostic = Deprecated(FSComp.SR.nrUnionTypeNeedsQualifiedAccess(ucinfo.DisplayName, ucinfo.Tycon.DisplayName) |> snd, m) + let diagnostic = Deprecated(FSComp.SR.nrUnionTypeNeedsQualifiedAccess(ucinfo.DisplayName, ucinfo.Tycon.DisplayName) |> snd, mItemIdent) if g.langVersion.SupportsFeature(LanguageFeature.ErrorOnDeprecatedRequireQualifiedAccess) then errorR(diagnostic) else warning(diagnostic) let ucref = ucinfo.UnionCaseRef - CheckUnionCaseAttributes g ucref m |> CommitOperationResult - CheckUnionCaseAccessible cenv.amap m ad ucref |> ignore + CheckUnionCaseAttributes g ucref mItemIdent |> CommitOperationResult + CheckUnionCaseAccessible cenv.amap mItemIdent ad ucref |> ignore let resTy = actualResultTyOfUnionCase ucinfo.TypeInst ucref let inst = mkTyparInst ucref.TyconRef.TyparsNoRange ucinfo.TypeInst UnifyTypes cenv env m overallTy resTy @@ -2083,9 +2083,9 @@ let ApplyUnionCaseOrExn (makerForUnionCase, makerForExnTag) m (cenv: cenv) env o mkf, actualTysOfUnionCaseFields inst ucref, [ for f in ucref.AllFieldsAsList -> f.Id ] | _ -> invalidArg "item" "not a union case or exception reference" -let ApplyUnionCaseOrExnTypes m (cenv: cenv) env overallTy c = +let ApplyUnionCaseOrExnTypes m mItemIdent (cenv: cenv) env overallTy c = ApplyUnionCaseOrExn ((fun (a, b) mArgs args -> mkUnionCaseExpr(a, b, args, unionRanges m mArgs)), - (fun a mArgs args -> mkExnExpr (a, args, unionRanges m mArgs))) m cenv env overallTy c + (fun a mArgs args -> mkExnExpr (a, args, unionRanges m mArgs))) m mItemIdent cenv env overallTy c let UnionCaseOrExnCheck (env: TcEnv) numArgTys numArgs m = if numArgs <> numArgTys then error (UnionCaseWrongArguments(env.DisplayEnv, numArgTys, numArgs, m)) @@ -2096,7 +2096,8 @@ let TcUnionCaseOrExnField (cenv: cenv) (env: TcEnv) ty1 m longId fieldNum funcs let mkf, argTys, _argNames = match ResolvePatternLongIdent cenv.tcSink cenv.nameResolver AllIdsOK false m ad env.eNameResEnv TypeNameResolutionInfo.Default longId ExtraDotAfterIdentifier.No with | Item.UnionCase _ | Item.ExnCase _ as item -> - ApplyUnionCaseOrExn funcs m cenv env ty1 item + // mItemIdent = m: pattern context has no separate terminal-ident range + ApplyUnionCaseOrExn funcs m m cenv env ty1 item | _ -> error(Error(FSComp.SR.tcUnknownUnion(), m)) if fieldNum >= argTys.Length then @@ -8667,7 +8668,7 @@ and TcNameOfExpr (cenv: cenv) env tpenv (synArg: SynExpr) = let nameResolutionResult = ResolveLongIdentAsExprAndComputeRange cenv.tcSink cenv.nameResolver (rangeOfLid longId) ad env.eNameResEnv typeNameResInfo longId None let resolvesAsExpr = match nameResolutionResult with - | Result (tinstEnclosing, item, mItem, mItemIdent, rest, afterRes) + | Result (_, item, _, _, _, _ as res) when (match item with | Item.DelegateCtor _ @@ -8678,7 +8679,7 @@ and TcNameOfExpr (cenv: cenv) env tpenv (synArg: SynExpr) = | _ -> true | _ -> true) -> let overallTy = match overallTyOpt with None -> MustEqual (NewInferenceType g) | Some t -> t - let _, _ = TcItemThen cenv overallTy env tpenv (tinstEnclosing, item, mItem, mItemIdent, rest, afterRes) None delayed + let _, _ = TcItemThen cenv overallTy env tpenv res None delayed true | _ -> false @@ -8905,11 +8906,11 @@ and TcLongIdentThen (cenv: cenv) (overallTy: OverallTy) env tpenv (SynLongIdent( let ad = env.eAccessRights let typeNameResInfo = GetLongIdentTypeNameInfo delayed - let (tinstEnclosing, item, mItem, mItemIdent, rest, afterResolution) = + let nameResolutionResult = let maybeAppliedArgExpr = DelayedItem.maybeAppliedArgForPreferExtensionOverProperty delayed ResolveLongIdentAsExprAndComputeRange cenv.tcSink cenv.nameResolver (rangeOfLid longId) ad env.eNameResEnv typeNameResInfo longId maybeAppliedArgExpr |> ForceRaise - TcItemThen cenv overallTy env tpenv (tinstEnclosing, item, mItem, mItemIdent, rest, afterResolution) None delayed + TcItemThen cenv overallTy env tpenv nameResolutionResult None delayed //------------------------------------------------------------------------- // Typecheck "item+projections" @@ -8921,7 +8922,7 @@ and TcItemThen (cenv: cenv) (overallTy: OverallTy) env tpenv (tinstEnclosing, it match item with // x where x is a union case or active pattern result tag. | Item.UnionCase _ | Item.ExnCase _ | Item.ActivePatternResult _ as item -> - TcUnionCaseOrExnCaseOrActivePatternResultItemThen cenv overallTy env item tpenv mItem delayed + TcUnionCaseOrExnCaseOrActivePatternResultItemThen cenv overallTy env item tpenv mItem mItemIdent delayed | Item.Types(nm, ty :: _) -> TcTypeItemThen cenv overallTy env nm ty tpenv mItem tinstEnclosing delayed @@ -8942,26 +8943,26 @@ and TcItemThen (cenv: cenv) (overallTy: OverallTy) env tpenv (tinstEnclosing, it TcDelegateCtorItemThen cenv overallTy env ty tinstEnclosing tpenv mItem delayed | Item.Value vref -> - TcValueItemThen cenv overallTy env vref tpenv mItem afterResolution delayed + TcValueItemThen cenv overallTy env vref tpenv mItem mItemIdent afterResolution delayed | Item.Property (nm, pinfos, _) -> TcPropertyItemThen cenv overallTy env nm pinfos tpenv mItem mItemIdent afterResolution staticTyOpt delayed | Item.ILField finfo -> - TcILFieldItemThen cenv overallTy env finfo tpenv mItem delayed + TcILFieldItemThen cenv overallTy env finfo tpenv mItem mItemIdent delayed | Item.RecdField rfinfo -> - TcRecdFieldItemThen cenv overallTy env rfinfo tpenv mItem delayed + TcRecdFieldItemThen cenv overallTy env rfinfo tpenv mItem mItemIdent delayed | Item.Event einfo -> - TcEventItemThen cenv overallTy env tpenv mItem mItem None einfo delayed + TcEventItemThen cenv overallTy env tpenv mItem mItemIdent mItem None einfo delayed | Item.CustomOperation (nm, usageTextOpt, _) -> // 'delayed' is about to be dropped on the floor, first do rudimentary checking to get name resolutions in its body RecordNameAndTypeResolutionsDelayed cenv env tpenv delayed match usageTextOpt() with - | None -> error(Error(FSComp.SR.tcCustomOperationNotUsedCorrectly nm, mItem)) - | Some usageText -> error(Error(FSComp.SR.tcCustomOperationNotUsedCorrectly2(nm, usageText), mItem)) + | None -> error(Error(FSComp.SR.tcCustomOperationNotUsedCorrectly nm, mItemIdent)) + | Some usageText -> error(Error(FSComp.SR.tcCustomOperationNotUsedCorrectly2(nm, usageText), mItemIdent)) // These items are not expected here - they are only used for reporting symbols from name resolution to language service | Item.ActivePatternCase _ @@ -8975,13 +8976,13 @@ and TcItemThen (cenv: cenv) (overallTy: OverallTy) env tpenv (tinstEnclosing, it | Item.UnionCaseField _ | Item.UnqualifiedType _ | Item.Types(_, []) -> - error(Error(FSComp.SR.tcLookupMayNotBeUsedHere(), mItem)) + error(Error(FSComp.SR.tcLookupMayNotBeUsedHere(), mItemIdent)) /// Type check the application of a union case. Also used to cover constructions of F# exception values, and /// applications of active pattern result labels. // // NOTE: the code for this is all a bit convoluted and should really be simplified/regularized. -and TcUnionCaseOrExnCaseOrActivePatternResultItemThen (cenv: cenv) overallTy env item tpenv mItem delayed = +and TcUnionCaseOrExnCaseOrActivePatternResultItemThen (cenv: cenv) overallTy env item tpenv mItem mItemIdent delayed = let g = cenv.g let ad = env.eAccessRights // ucaseAppTy is the type of the union constructor applied to its (optional) argument @@ -8998,9 +8999,9 @@ and TcUnionCaseOrExnCaseOrActivePatternResultItemThen (cenv: cenv) overallTy env let ucref = mkChoiceCaseRef g m aparity n let _, _, tinst, _ = FreshenTyconRef2 g mItem ucref.TyconRef let ucinfo = UnionCaseInfo (tinst, ucref) - ApplyUnionCaseOrExnTypes mItem cenv env ucaseAppTy (Item.UnionCase(ucinfo, false)) + ApplyUnionCaseOrExnTypes mItem mItemIdent cenv env ucaseAppTy (Item.UnionCase(ucinfo, false)) | _ -> - ApplyUnionCaseOrExnTypes mItem cenv env ucaseAppTy item + ApplyUnionCaseOrExnTypes mItem mItemIdent cenv env ucaseAppTy item let numArgTys = List.length argTys // Subsumption at data constructions if argument type is nominal prior to equations for any arguments or return types @@ -9220,7 +9221,7 @@ and TcMethodItemThen (cenv: cenv) overallTy env item methodName minfos tpenv mIt | _ -> #if !NO_TYPEPROVIDERS if not minfos.IsEmpty && minfos[0].ProvidedStaticParameterInfo.IsSome then - error(Error(FSComp.SR.etMissingStaticArgumentsToMethod(), mItem)) + error(Error(FSComp.SR.etMissingStaticArgumentsToMethod(), mItemIdent)) #endif TcMethodApplicationThen cenv env overallTy None tpenv None [] mItem mItemIdent methodName ad NeverMutates false meths afterResolution NormalValUse [] ExprAtomicFlag.Atomic staticTyOpt delayed @@ -9482,7 +9483,7 @@ and TcDelegateCtorItemThen cenv overallTy env ty tinstEnclosing tpenv mItem dela | _ -> error(Error(FSComp.SR.tcInvalidUseOfDelegate(), mItem)) -and TcValueItemThen cenv overallTy env vref tpenv mItem afterResolution delayed = +and TcValueItemThen cenv overallTy env vref tpenv mItem mItemIdent afterResolution delayed = let g = cenv.g match delayed with // Mutable value set: 'v <- e' @@ -9490,8 +9491,8 @@ and TcValueItemThen cenv overallTy env vref tpenv mItem afterResolution delayed if not (isNil otherDelayed) then error(Error(FSComp.SR.tcInvalidAssignment(), mStmt)) UnifyTypes cenv env mStmt overallTy.Commit g.unit_ty vref.Deref.SetHasBeenReferenced() - CheckValAccessible mItem env.AccessRights vref - CheckValAttributes g vref mItem |> CommitOperationResult + CheckValAccessible mItemIdent env.AccessRights vref + CheckValAttributes g vref mItemIdent |> CommitOperationResult let vTy = vref.Type let vty2 = if isByrefTy g vTy then @@ -9598,7 +9599,7 @@ and TcPropertyItemThen cenv overallTy env nm pinfos tpenv mItem mItemIdent after ExprAtomicFlag.Atomic, None, [mkSynUnit mItem], delayed, tpenv if not pinfo.IsStatic then - error (Error (FSComp.SR.tcPropertyIsNotStatic nm, mItem)) + error (Error (FSComp.SR.tcPropertyIsNotStatic nm, mItemIdent)) match delayed with | DelayedSet(expr2, mStmt) :: otherDelayed -> @@ -9614,28 +9615,28 @@ and TcPropertyItemThen cenv overallTy env nm pinfos tpenv mItem mItemIdent after let isByrefMethReturnSetter = meths |> List.exists (function _,Some pinfo -> isByrefTy g (pinfo.GetPropertyType(cenv.amap,mItem)) | _ -> false) if not isByrefMethReturnSetter then - errorR (Error (FSComp.SR.tcPropertyCannotBeSet1 nm, mItem)) + errorR (Error (FSComp.SR.tcPropertyCannotBeSet1 nm, mItemIdent)) // x.P <- ... byref setter - if isNil meths then error (Error (FSComp.SR.tcPropertyIsNotReadable nm, mItem)) + if isNil meths then error (Error (FSComp.SR.tcPropertyIsNotReadable nm, mItemIdent)) TcMethodApplicationThen cenv env overallTy None tpenv tyArgsOpt [] mItem mItemIdent nm ad NeverMutates true meths afterResolution NormalValUse args ExprAtomicFlag.Atomic staticTyOpt delayed else let args = if pinfo.IsIndexer then args else [] if isNil meths then - errorR (Error (FSComp.SR.tcPropertyCannotBeSet1 nm, mItem)) + errorR (Error (FSComp.SR.tcPropertyCannotBeSet1 nm, mItemIdent)) // Note: static calls never mutate a struct object argument TcMethodApplicationThen cenv env overallTy None tpenv tyArgsOpt [] mStmt mItemIdent nm ad NeverMutates true meths afterResolution NormalValUse (args@[expr2]) ExprAtomicFlag.NonAtomic staticTyOpt otherDelayed | _ -> // Static Property Get (possibly indexer) let meths = pinfos |> GettersOfPropInfos - if isNil meths then error (Error (FSComp.SR.tcPropertyIsNotReadable nm, mItem)) + if isNil meths then error (Error (FSComp.SR.tcPropertyIsNotReadable nm, mItemIdent)) // Note: static calls never mutate a struct object argument TcMethodApplicationThen cenv env overallTy None tpenv tyArgsOpt [] mItem mItemIdent nm ad NeverMutates true meths afterResolution NormalValUse args ExprAtomicFlag.Atomic staticTyOpt delayed -and TcILFieldItemThen cenv overallTy env finfo tpenv mItem delayed = +and TcILFieldItemThen cenv overallTy env finfo tpenv mItem mItemIdent delayed = let g = cenv.g let ad = env.eAccessRights - ILFieldStaticChecks g cenv.amap cenv.infoReader ad mItem finfo + ILFieldStaticChecks g cenv.amap cenv.infoReader ad mItemIdent finfo let fref = finfo.ILFieldRef let exprTy = finfo.FieldType(cenv.amap, mItem) match delayed with @@ -9679,13 +9680,13 @@ and TcILFieldItemThen cenv overallTy env finfo tpenv mItem delayed = PropagateThenTcDelayed cenv overallTy env tpenv mItem exprFlex exprTy ExprAtomicFlag.Atomic delayed -and TcRecdFieldItemThen cenv overallTy env rfinfo tpenv mItem delayed = +// Get static F# field or literal +and TcRecdFieldItemThen cenv overallTy env rfinfo tpenv mItem mItemIdent delayed = let g = cenv.g let ad = env.eAccessRights - // Get static F# field or literal - CheckRecdFieldInfoAccessible cenv.amap mItem ad rfinfo - if not rfinfo.IsStatic then error (Error (FSComp.SR.tcFieldIsNotStatic(rfinfo.DisplayName), mItem)) - CheckRecdFieldInfoAttributes g rfinfo mItem |> CommitOperationResult + CheckRecdFieldInfoAccessible cenv.amap mItemIdent ad rfinfo + if not rfinfo.IsStatic then error (Error (FSComp.SR.tcFieldIsNotStatic(rfinfo.DisplayName), mItemIdent)) + CheckRecdFieldInfoAttributes g rfinfo mItemIdent |> CommitOperationResult let fref = rfinfo.RecdFieldRef let fieldTy = rfinfo.FieldType match delayed with @@ -9693,7 +9694,7 @@ and TcRecdFieldItemThen cenv overallTy env rfinfo tpenv mItem delayed = if not (isNil otherDelayed) then error(Error(FSComp.SR.tcInvalidAssignment(), mStmt)) // Set static F# field - CheckRecdFieldMutation mItem env.DisplayEnv rfinfo + CheckRecdFieldMutation mItemIdent env.DisplayEnv rfinfo UnifyTypes cenv env mStmt overallTy.Commit g.unit_ty let fieldTy = rfinfo.FieldType // Always allow subsumption on assignment to fields @@ -9775,7 +9776,7 @@ and TcLookupItemThen cenv overallTy env tpenv mObjExpr objExpr objExprTy delayed match minfos with | minfo :: _ -> // Check if we have properties with "init-only" setters, which we try to call after init is done. - CheckInitProperties g minfo methodName mItem + CheckInitProperties g minfo methodName mItemIdent | _ -> () #if !NO_TYPEPROVIDERS @@ -9788,7 +9789,7 @@ and TcLookupItemThen cenv overallTy env tpenv mObjExpr objExpr objExprTy delayed TcMethodApplicationThen cenv env overallTy None tpenv None objArgs mExprAndItem mItemIdent methodName ad mutates false [(minfoAfterStaticArguments, None)] afterResolution NormalValUse args atomicFlag None delayed | None -> if not minfos.IsEmpty && minfos[0].ProvidedStaticParameterInfo.IsSome then - error(Error(FSComp.SR.etMissingStaticArgumentsToMethod(), mItem)) + error(Error(FSComp.SR.etMissingStaticArgumentsToMethod(), mItemIdent)) #endif let tyArgsOpt, tpenv = TcMemberTyArgsOpt cenv env tpenv tyArgsOpt @@ -9806,7 +9807,7 @@ and TcLookupItemThen cenv overallTy env tpenv mObjExpr objExpr objExprTy delayed if pinfo.IsIndexer then GetMemberApplicationArgs delayed cenv env tpenv else ExprAtomicFlag.Atomic, None, [mkSynUnit mItem], delayed, tpenv - if pinfo.IsStatic then error (Error (FSComp.SR.tcPropertyIsStatic nm, mItem)) + if pinfo.IsStatic then error (Error (FSComp.SR.tcPropertyIsStatic nm, mItemIdent)) match delayed with @@ -9819,14 +9820,14 @@ and TcLookupItemThen cenv overallTy env tpenv mObjExpr objExpr objExprTy delayed let meths = pinfos |> GettersOfPropInfos let isByrefMethReturnSetter = meths |> List.exists (function _,Some pinfo -> isByrefTy g (pinfo.GetPropertyType(cenv.amap,mItem)) | _ -> false) if not isByrefMethReturnSetter then - errorR (Error (FSComp.SR.tcPropertyCannotBeSet1 nm, mItem)) + errorR (Error (FSComp.SR.tcPropertyCannotBeSet1 nm, mItemIdent)) // x.P <- ... byref setter - if isNil meths then error (Error (FSComp.SR.tcPropertyIsNotReadable nm, mItem)) + if isNil meths then error (Error (FSComp.SR.tcPropertyIsNotReadable nm, mItemIdent)) TcMethodApplicationThen cenv env overallTy None tpenv tyArgsOpt objArgs mExprAndItem mItemIdent nm ad PossiblyMutates true meths afterResolution NormalValUse args atomicFlag None delayed else if g.langVersion.SupportsFeature(LanguageFeature.RequiredPropertiesSupport) && pinfo.IsSetterInitOnly then - errorR (Error (FSComp.SR.tcInitOnlyPropertyCannotBeSet1 nm, mItem)) + errorR (Error (FSComp.SR.tcInitOnlyPropertyCannotBeSet1 nm, mItemIdent)) let args = if pinfo.IsIndexer then args else [] let mut = (if isStructTy g (tyOfExpr g objExpr) then DefinitelyMutates else PossiblyMutates) @@ -9834,12 +9835,12 @@ and TcLookupItemThen cenv overallTy env tpenv mObjExpr objExpr objExprTy delayed | _ -> // Instance property getter let meths = GettersOfPropInfos pinfos - if isNil meths then error (Error (FSComp.SR.tcPropertyIsNotReadable nm, mItem)) + if isNil meths then error (Error (FSComp.SR.tcPropertyIsNotReadable nm, mItemIdent)) TcMethodApplicationThen cenv env overallTy None tpenv tyArgsOpt objArgs mExprAndItem mItemIdent nm ad PossiblyMutates true meths afterResolution NormalValUse args atomicFlag None delayed | Item.RecdField rfinfo -> // Get or set instance F# field or literal - RecdFieldInstanceChecks g cenv.amap ad mItem rfinfo + RecdFieldInstanceChecks g cenv.amap ad mItemIdent rfinfo let tgtTy = rfinfo.DeclaringType let boxity = isStructTy g tgtTy AddCxTypeMustSubsumeType ContextInfo.NoContext env.DisplayEnv cenv.css mItem NoTrace tgtTy objExprTy @@ -9848,8 +9849,8 @@ and TcLookupItemThen cenv overallTy env tpenv mObjExpr objExpr objExprTy delayed match delayed with | DelayedSet(expr2, mStmt) :: otherDelayed -> // Mutable value set: 'v <- e' - if not (isNil otherDelayed) then error(Error(FSComp.SR.tcInvalidAssignment(), mItem)) - CheckRecdFieldMutation mItem env.DisplayEnv rfinfo + if not (isNil otherDelayed) then error(Error(FSComp.SR.tcInvalidAssignment(), mItemIdent)) + CheckRecdFieldMutation mItemIdent env.DisplayEnv rfinfo UnifyTypes cenv env mStmt overallTy.Commit g.unit_ty // Always allow subsumption on assignment to fields let expr2R, tpenv = TcExprFlex cenv true false fieldTy env tpenv expr2 @@ -9867,7 +9868,7 @@ and TcLookupItemThen cenv overallTy env tpenv mObjExpr objExpr objExprTy delayed let fieldTy = List.item n tinst match delayed with | DelayedSet _ :: _otherDelayed -> - error(Error(FSComp.SR.tcInvalidAssignment(),mItem)) + error(Error(FSComp.SR.tcInvalidAssignment(),mItemIdent)) | _ -> // Instance F# Anonymous Record let objExpr' = mkAnonRecdFieldGet g (anonInfo,objExpr,tinst,n,mExprAndItem) @@ -9875,7 +9876,7 @@ and TcLookupItemThen cenv overallTy env tpenv mObjExpr objExpr objExprTy delayed | Item.ILField finfo -> // Get or set instance IL field - ILFieldInstanceChecks g cenv.amap ad mItem finfo + ILFieldInstanceChecks g cenv.amap ad mItemIdent finfo let exprTy = finfo.FieldType(cenv.amap, mItem) match delayed with @@ -9892,12 +9893,12 @@ and TcLookupItemThen cenv overallTy env tpenv mObjExpr objExpr objExprTy delayed | Item.Event einfo -> // Instance IL event (fake up event-as-value) - TcEventItemThen cenv overallTy env tpenv mItem mExprAndItem (Some(objExpr, objExprTy)) einfo delayed + TcEventItemThen cenv overallTy env tpenv mItem mItemIdent mExprAndItem (Some(objExpr, objExprTy)) einfo delayed | Item.Trait traitInfo -> TcTraitItemThen cenv overallTy env (Some objExpr) traitInfo tpenv mItem delayed - | Item.DelegateCtor _ -> error (Error (FSComp.SR.tcConstructorsCannotBeFirstClassValues(), mItem)) + | Item.DelegateCtor _ -> error (Error (FSComp.SR.tcConstructorsCannotBeFirstClassValues(), mItemIdent)) | Item.UnionCase(info, _) -> let clashingNames = info.Tycon.MembersOfFSharpTyconSorted |> List.tryFind(fun mem -> mem.DisplayNameCore = info.DisplayNameCore) @@ -9907,7 +9908,7 @@ and TcLookupItemThen cenv overallTy env tpenv mObjExpr objExpr objExprTy delayed let kind = if value.IsMember then "member" else "value" errorR (NameClash(info.DisplayNameCore, kind, info.DisplayNameCore, value.Range, FSComp.SR.typeInfoUnionCase(), info.DisplayNameCore, value.Range)) - error (Error (FSComp.SR.tcSyntaxFormUsedOnlyWithRecordLabelsPropertiesAndFields(), mItem)) + error (Error (FSComp.SR.tcSyntaxFormUsedOnlyWithRecordLabelsPropertiesAndFields(), mItemIdent)) // These items are not expected here - they can't be the result of a instance member dot-lookup "expr.Ident" | Item.ActivePatternResult _ | Item.CustomOperation _ @@ -9926,31 +9927,31 @@ and TcLookupItemThen cenv overallTy env tpenv mObjExpr objExpr objExprTy delayed | Item.CustomBuilder _ | Item.OtherName _ | Item.ActivePatternCase _ -> - error (Error (FSComp.SR.tcSyntaxFormUsedOnlyWithRecordLabelsPropertiesAndFields(), mItem)) + error (Error (FSComp.SR.tcSyntaxFormUsedOnlyWithRecordLabelsPropertiesAndFields(), mItemIdent)) // Instance IL event (fake up event-as-value) -and TcEventItemThen (cenv: cenv) overallTy env tpenv mItem mExprAndItem objDetails (einfo: EventInfo) delayed = +and TcEventItemThen (cenv: cenv) overallTy env tpenv mItem mItemIdent mExprAndItem objDetails (einfo: EventInfo) delayed = let g = cenv.g let ad = env.eAccessRights let nm = einfo.EventName match objDetails, einfo.IsStatic with - | Some _, true -> error (Error (FSComp.SR.tcEventIsStatic nm, mItem)) - | None, false -> error (Error (FSComp.SR.tcEventIsNotStatic nm, mItem)) + | Some _, true -> error (Error (FSComp.SR.tcEventIsStatic nm, mItemIdent)) + | None, false -> error (Error (FSComp.SR.tcEventIsNotStatic nm, mItemIdent)) | _ -> () // The F# wrappers around events are null safe (impl is in FSharp.Core). Therefore, from an F# perspective, the type of the delegate can be considered Not Null. let delTy = einfo.GetDelegateType(cenv.amap, mItem) |> replaceNullnessOfTy KnownWithoutNull let (SigOfFunctionForDelegate(delInvokeMeth, delArgTys, _, _)) = GetSigOfFunctionForDelegate cenv.infoReader delTy mItem ad let objArgs = Option.toList (Option.map fst objDetails) - MethInfoChecks g cenv.amap true None objArgs env.eAccessRights mItem delInvokeMeth + MethInfoChecks g cenv.amap true None objArgs env.eAccessRights mItemIdent delInvokeMeth - CheckILEventAttributes g einfo.DeclaringTyconRef (einfo.GetCustomAttrs()) mItem |> CommitOperationResult + CheckILEventAttributes g einfo.DeclaringTyconRef (einfo.GetCustomAttrs()) mItemIdent |> CommitOperationResult // This checks for and drops the 'object' sender let argsTy = ArgsTypeOfEventInfo cenv.infoReader mItem ad einfo - if not (slotSigHasVoidReturnTy (delInvokeMeth.GetSlotSig(cenv.amap, mItem))) then errorR (nonStandardEventError einfo.EventName mItem) + if not (slotSigHasVoidReturnTy (delInvokeMeth.GetSlotSig(cenv.amap, mItem))) then errorR (nonStandardEventError einfo.EventName mItemIdent) let delEventTy = mkIEventType g delTy argsTy let bindObjArgs f = diff --git a/src/Compiler/Checking/NameResolution.fs b/src/Compiler/Checking/NameResolution.fs index 898dc78aa75..f2e636d3e44 100644 --- a/src/Compiler/Checking/NameResolution.fs +++ b/src/Compiler/Checking/NameResolution.fs @@ -4293,8 +4293,7 @@ let ResolveLongIdentAsExprAndComputeRange (sink: TcResultsSink) (ncenv: NameReso // #16621 match refinedItem with | Item.Property(_, pinfos, _) -> - let propIdentRange = if rest.IsEmpty then (List.last lid).idRange else itemRange - RegisterUnionCaseTesterForProperty sink propIdentRange pinfos + RegisterUnionCaseTesterForProperty sink itemIdentRange pinfos | _ -> () let callSinkWithSpecificOverload (minfo: MethInfo, pinfoOpt: PropInfo option, tpinst) = @@ -4369,8 +4368,7 @@ let ResolveExprDotLongIdentAndComputeRange (sink: TcResultsSink) (ncenv: NameRes // #16621 match refinedItem with | Item.Property(_, pinfos, _) -> - let propIdentRange = if rest.IsEmpty then (List.last lid).idRange else itemRange - RegisterUnionCaseTesterForProperty sink propIdentRange pinfos + RegisterUnionCaseTesterForProperty sink itemIdentRange pinfos | _ -> () let callSinkWithSpecificOverload (minfo: MethInfo, pinfoOpt: PropInfo option, tpinst) = diff --git a/src/Compiler/Checking/NameResolution.fsi b/src/Compiler/Checking/NameResolution.fsi index 1dc02a2245b..a3b6869d9d6 100755 --- a/src/Compiler/Checking/NameResolution.fsi +++ b/src/Compiler/Checking/NameResolution.fsi @@ -878,7 +878,7 @@ val internal ResolvePartialLongIdentToClassOrRecdFields: val internal ResolveRecordOrClassFieldsOfType: NameResolver -> range -> AccessorDomain -> TType -> bool -> Item list /// Resolve a long identifier occurring in an expression position. -/// Also returns the terminal identifier range for error diagnostics (#14284). +/// Returns the terminal identifier range (#14284). val internal ResolveLongIdentAsExprAndComputeRange: sink: TcResultsSink -> ncenv: NameResolver -> @@ -891,7 +891,7 @@ val internal ResolveLongIdentAsExprAndComputeRange: ResultOrException /// Resolve a long identifier occurring in an expression position, qualified by a type. -/// Also returns the terminal identifier range for error diagnostics (#14284). +/// Returns the terminal identifier range (#14284). val internal ResolveExprDotLongIdentAndComputeRange: sink: TcResultsSink -> ncenv: NameResolver -> diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/AccessibilityAnnotations/Basic/Basic.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/AccessibilityAnnotations/Basic/Basic.fs index f76552ba8d9..486316c3126 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/AccessibilityAnnotations/Basic/Basic.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/AccessibilityAnnotations/Basic/Basic.fs @@ -109,7 +109,7 @@ module AccessibilityAnnotations_Basic = |> verifyCompile |> shouldFail |> withDiagnostics [ - (Error 1096, Line 11, Col 9, Line 11, Col 24, "The record, struct or class field 'foo' is not accessible from this code location") + (Error 1096, Line 11, Col 21, Line 11, Col 24, "The record, struct or class field 'foo' is not accessible from this code location") ] //SOURCE=E_PrivateImplicitCtor01.fs SCFLAGS="--test:ErrorRanges" # E_PrivateImplicitCtor01.fs diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/AccessibilityAnnotations/OnTypeMembers/OnTypeMembers.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/AccessibilityAnnotations/OnTypeMembers/OnTypeMembers.fs index 49c79c2600d..810ae5ecc20 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/AccessibilityAnnotations/OnTypeMembers/OnTypeMembers.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/AccessibilityAnnotations/OnTypeMembers/OnTypeMembers.fs @@ -67,12 +67,12 @@ module AccessibilityAnnotations_OnTypeMembers = (Error 491, Line 42, Col 19, Line 42, Col 26, "The member or object constructor 'test2' is not accessible. Private members may only be accessed from within the declaring type. Protected members may only be accessed from an extending type and cannot be accessed from inner lambda expressions.") (Error 491, Line 42, Col 29, Line 42, Col 36, "The member or object constructor 'test5' is not accessible. Private members may only be accessed from within the declaring type. Protected members may only be accessed from an extending type and cannot be accessed from inner lambda expressions.") (Error 491, Line 42, Col 40, Line 42, Col 47, "The member or object constructor 'test6' is not accessible. Private members may only be accessed from within the declaring type. Protected members may only be accessed from an extending type and cannot be accessed from inner lambda expressions.") - (Error 807, Line 42, Col 60, Line 42, Col 67, "Property 'test8' is not readable") + (Error 807, Line 42, Col 62, Line 42, Col 67, "Property 'test8' is not readable") (Error 491, Line 43, Col 1, Line 43, Col 13, "The member or object constructor 'test3' is not accessible. Private members may only be accessed from within the declaring type. Protected members may only be accessed from an extending type and cannot be accessed from inner lambda expressions.") (Error 491, Line 44, Col 1, Line 44, Col 13, "The member or object constructor 'test4' is not accessible. Private members may only be accessed from within the declaring type. Protected members may only be accessed from an extending type and cannot be accessed from inner lambda expressions.") (Error 491, Line 45, Col 1, Line 45, Col 13, "The member or object constructor 'test5' is not accessible. Private members may only be accessed from within the declaring type. Protected members may only be accessed from an extending type and cannot be accessed from inner lambda expressions.") (Error 491, Line 46, Col 1, Line 46, Col 13, "The member or object constructor 'test6' is not accessible. Private members may only be accessed from within the declaring type. Protected members may only be accessed from an extending type and cannot be accessed from inner lambda expressions.") - (Error 810, Line 47, Col 1, Line 47, Col 8, "Property 'test7' cannot be set") + (Error 810, Line 47, Col 3, Line 47, Col 8, "Property 'test7' cannot be set") (Error 257, Line 47, Col 1, Line 47, Col 8, "Invalid mutation of a constant expression. Consider copying the expression to a mutable local, e.g. 'let mutable x = ...'.") ] diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/RecordTypes.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/RecordTypes.fs index e5fefa0b7c2..3bae9db5802 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/RecordTypes.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/RecordTypes.fs @@ -115,9 +115,9 @@ module RecordTypes = |> withDiagnostics [ (Warning 464, Line 15, Col 22, Line 15, Col 28, "This code is less generic than indicated by its annotations. A unit-of-measure specified using '_' has been determined to be '1', i.e. dimensionless. Consider making the code generic, or removing the use of '_'.") (Warning 464, Line 15, Col 35, Line 15, Col 42, "This code is less generic than indicated by its annotations. A unit-of-measure specified using '_' has been determined to be '1', i.e. dimensionless. Consider making the code generic, or removing the use of '_'.") - (Error 5, Line 17, Col 1, Line 17, Col 5, "This field is not mutable") + (Error 5, Line 17, Col 4, Line 17, Col 5, "This field is not mutable") (Error 1, Line 17, Col 16, Line 17, Col 22, "The type 'float' does not match the type 'decimal'") - (Error 5, Line 18, Col 1, Line 18, Col 5, "This field is not mutable") + (Error 5, Line 18, Col 4, Line 18, Col 5, "This field is not mutable") (Error 1, Line 18, Col 16, Line 18, Col 21, "This expression was expected to have type\n 'float' \nbut here has type\n 'decimal' ") ] diff --git a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/OverloadResolutionErrorRangeTests.fs b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/OverloadResolutionErrorRangeTests.fs index 95d45931a16..57f286a8cf3 100644 --- a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/OverloadResolutionErrorRangeTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/OverloadResolutionErrorRangeTests.fs @@ -224,9 +224,9 @@ T.Instance.OldMethod() |> shouldFail |> withDiagnostics [ - // First: narrowed to "OldMethod" via mItem (Col 12-21), not the full "T.Instance.OldMethod" + // Narrowed to terminal ident "OldMethod" via mItemIdent (Warning 44, Line 8, Col 12, Line 8, Col 21, "This construct is deprecated. old method") - // Second: pre-existing duplicate from name resolution attribute check (whole application range) + // Pre-existing duplicate from name-resolution attribute check (whole application range) (Warning 44, Line 8, Col 1, Line 8, Col 23, "This construct is deprecated. old method") ] @@ -245,9 +245,9 @@ M.Svc.OldMethod() |> shouldFail |> withDiagnostics [ - // First: narrowed to "OldMethod" via mItem (Col 7-16), not "M.Svc.OldMethod" + // Narrowed to terminal ident "OldMethod" via mItemIdent (Warning 44, Line 7, Col 7, Line 7, Col 16, "This construct is deprecated. use NewMethod instead") - // Second: pre-existing duplicate from name resolution attribute check (whole expression range) + // Pre-existing duplicate from name-resolution attribute check (whole application range) (Warning 44, Line 7, Col 1, Line 7, Col 18, "This construct is deprecated. use NewMethod instead") ] diff --git a/tests/FSharp.Compiler.ComponentTests/Interop/RequiredAndInitOnlyProperties.fs b/tests/FSharp.Compiler.ComponentTests/Interop/RequiredAndInitOnlyProperties.fs index 68d8022cc8d..1885328b541 100644 --- a/tests/FSharp.Compiler.ComponentTests/Interop/RequiredAndInitOnlyProperties.fs +++ b/tests/FSharp.Compiler.ComponentTests/Interop/RequiredAndInitOnlyProperties.fs @@ -181,7 +181,7 @@ let main _ = |> compile |> shouldFail |> withDiagnostics [ - Error 810, Line 9, Col 5, Line 9, Col 17, "Init-only property 'GetInit' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization" + Error 810, Line 9, Col 10, Line 9, Col 17, "Init-only property 'GetInit' cannot be set outside the initialization code. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization" ] [] @@ -209,7 +209,7 @@ let main _ = |> compile |> shouldFail |> withDiagnostics [ - Error 810, Line 9, Col 5, Line 9, Col 21, "Cannot call 'set_GetInit' - a setter for init-only property, please use object initialization instead. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization" + Error 810, Line 9, Col 10, Line 9, Col 21, "Cannot call 'set_GetInit' - a setter for init-only property, please use object initialization instead. See https://aka.ms/fsharp-assigning-values-to-properties-at-initialization" ] [] diff --git a/tests/FSharp.Compiler.ComponentTests/Interop/VisibilityTests.fs b/tests/FSharp.Compiler.ComponentTests/Interop/VisibilityTests.fs index 8bb17ccb8ac..f88577d9e8f 100644 --- a/tests/FSharp.Compiler.ComponentTests/Interop/VisibilityTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Interop/VisibilityTests.fs @@ -163,8 +163,8 @@ type MyFSharpClass () = |> compile |> shouldFail |> withDiagnostics [ - (Error 810, Line 21, Col 9, Line 21, Col 33, "Property 'GetPublicSetPrivate' cannot be set") - (Error 807, Line 28, Col 17, Line 28, Col 41, "Property 'SetPublicGetPrivate' is not readable")] + (Error 810, Line 21, Col 14, Line 21, Col 33, "Property 'GetPublicSetPrivate' cannot be set") + (Error 807, Line 28, Col 22, Line 28, Col 41, "Property 'SetPublicGetPrivate' is not readable")] [] let ``F# class F# non-derived class - access public`` () = @@ -192,4 +192,4 @@ type MyFSharpClass () = |> withReferences [csharpLib] |> compile |> shouldFail - |> withSingleDiagnostic (Error 810, Line 21, Col 9, Line 21, Col 31, "Property 'GetPublicSetPrivate' cannot be set") + |> withSingleDiagnostic (Error 810, Line 21, Col 12, Line 21, Col 31, "Property 'GetPublicSetPrivate' cannot be set") diff --git a/tests/FSharp.Compiler.ComponentTests/Language/DotLambdaTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/DotLambdaTests.fs index 500e03089ca..bc939111cf7 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/DotLambdaTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/DotLambdaTests.fs @@ -326,7 +326,7 @@ let onlyIdC (ids: MyId list) = ids |> List.choose _.IdC |> shouldFail |> withDiagnostics [ (Error 23, Line 7, Col 17, Line 7, Col 20, "The member 'IdA' cannot be defined because the name 'IdA' clashes with the union case 'IdA' in this type or module"); - (Error 812, Line 22, Col 51, Line 22, Col 56, "The syntax 'expr.id' may only be used with record labels, properties and fields"); + (Error 812, Line 22, Col 53, Line 22, Col 56, "The syntax 'expr.id' may only be used with record labels, properties and fields"); (Error 23, Line 17, Col 17, Line 17, Col 20, "The member 'IdC' cannot be defined because the name 'IdC' clashes with the union case 'IdC' in this type or module"); - (Error 812, Line 24, Col 51, Line 24, Col 56, "The syntax 'expr.id' may only be used with record labels, properties and fields") + (Error 812, Line 24, Col 53, Line 24, Col 56, "The syntax 'expr.id' may only be used with record labels, properties and fields") ] \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/Language/ObsoleteAttributeCheckingTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/ObsoleteAttributeCheckingTests.fs index 085cbc3599e..b6efad6eea6 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/ObsoleteAttributeCheckingTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/ObsoleteAttributeCheckingTests.fs @@ -602,7 +602,7 @@ let c = Color.Red |> compile |> shouldFail |> withDiagnostics [ - (Error 101, Line 7, Col 9, Line 7, Col 18, "This construct is deprecated. Use B instead") + (Error 101, Line 7, Col 15, Line 7, Col 18, "This construct is deprecated. Use B instead") ] [] @@ -618,7 +618,7 @@ let c = Color.Red |> compile |> shouldFail |> withDiagnostics [ - (Warning 44, Line 7, Col 9, Line 7, Col 18, "This construct is deprecated. Use B instead") + (Warning 44, Line 7, Col 15, Line 7, Col 18, "This construct is deprecated. Use B instead") ] [] @@ -653,7 +653,7 @@ let c = Color.Red |> compile |> shouldFail |> withDiagnostics [ - (Error 101, Line 8, Col 9, Line 8, Col 18, "This construct is deprecated. Use B instead") + (Error 101, Line 8, Col 15, Line 8, Col 18, "This construct is deprecated. Use B instead") ] [] @@ -670,7 +670,7 @@ let c = Color.Red |> compile |> shouldFail |> withDiagnostics [ - (Warning 44, Line 8, Col 9, Line 8, Col 18, "This construct is deprecated. Use B instead") + (Warning 44, Line 8, Col 15, Line 8, Col 18, "This construct is deprecated. Use B instead") ] [] @@ -1332,10 +1332,10 @@ Class.ObsoleteEvent |> ignore |> compile |> shouldFail |> withDiagnostics [ - (Warning 44, Line 3, Col 1, Line 3, Col 20, "This construct is deprecated. Field is obsolete"); + (Warning 44, Line 3, Col 7, Line 3, Col 20, "This construct is deprecated. Field is obsolete"); (Warning 44, Line 4, Col 7, Line 4, Col 21, "This construct is deprecated. Method is obsolete"); (Warning 44, Line 5, Col 7, Line 5, Col 23, "This construct is deprecated. Property is obsolete") - (Warning 44, Line 6, Col 1, Line 6, Col 20, "This construct is deprecated. Event is obsolete") + (Warning 44, Line 6, Col 7, Line 6, Col 20, "This construct is deprecated. Event is obsolete") ] [] @@ -1371,10 +1371,10 @@ Class.ObsoleteEvent |> ignore |> compile |> shouldFail |> withDiagnostics [ - (Error 101, Line 3, Col 1, Line 3, Col 20, "This construct is deprecated. Field is obsolete"); + (Error 101, Line 3, Col 7, Line 3, Col 20, "This construct is deprecated. Field is obsolete"); (Error 101, Line 4, Col 7, Line 4, Col 21, "This construct is deprecated. Method is obsolete"); (Error 101, Line 5, Col 7, Line 5, Col 23, "This construct is deprecated. Property is obsolete") - (Error 101, Line 6, Col 1, Line 6, Col 20, "This construct is deprecated. Event is obsolete") + (Error 101, Line 6, Col 7, Line 6, Col 20, "This construct is deprecated. Event is obsolete") ] [] diff --git a/tests/fsharp/typecheck/sigs/neg10.bsl b/tests/fsharp/typecheck/sigs/neg10.bsl index 1a0f32e060c..3db874c5aef 100644 --- a/tests/fsharp/typecheck/sigs/neg10.bsl +++ b/tests/fsharp/typecheck/sigs/neg10.bsl @@ -132,19 +132,19 @@ neg10.fs(297,22,297,24): typecheck error FS1187: An indexer property must be giv neg10.fs(298,22,298,24): typecheck error FS1187: An indexer property must be given at least one argument -neg10.fs(299,17,299,24): typecheck error FS0807: Property 'S2' is not readable +neg10.fs(299,22,299,24): typecheck error FS0807: Property 'S2' is not readable -neg10.fs(300,17,300,24): typecheck error FS0807: Property 'S3' is not readable +neg10.fs(300,22,300,24): typecheck error FS0807: Property 'S3' is not readable -neg10.fs(301,17,301,24): typecheck error FS0807: Property 'S4' is not readable +neg10.fs(301,22,301,24): typecheck error FS0807: Property 'S4' is not readable -neg10.fs(303,17,303,22): typecheck error FS0807: Property 'SS2' is not readable +neg10.fs(303,19,303,22): typecheck error FS0807: Property 'SS2' is not readable -neg10.fs(304,17,304,22): typecheck error FS0807: Property 'SS3' is not readable +neg10.fs(304,19,304,22): typecheck error FS0807: Property 'SS3' is not readable -neg10.fs(305,17,305,22): typecheck error FS0807: Property 'SS4' is not readable +neg10.fs(305,19,305,22): typecheck error FS0807: Property 'SS4' is not readable -neg10.fs(316,17,316,28): typecheck error FS0807: Property 'X' is not readable +neg10.fs(316,27,316,28): typecheck error FS0807: Property 'X' is not readable neg10.fs(324,28,324,29): typecheck error FS1187: An indexer property must be given at least one argument diff --git a/tests/fsharp/typecheck/sigs/neg15.bsl b/tests/fsharp/typecheck/sigs/neg15.bsl index e82c0042d11..3c6fa8ff9ec 100644 --- a/tests/fsharp/typecheck/sigs/neg15.bsl +++ b/tests/fsharp/typecheck/sigs/neg15.bsl @@ -1,9 +1,9 @@ neg15.fs(102,17,102,31): typecheck error FS1094: The value 'privateValue' is not accessible from this code location -neg15.fs(103,18,103,43): typecheck error FS1092: The type 'PrivateUnionType' is not accessible from this code location +neg15.fs(103,20,103,43): typecheck error FS1092: The type 'PrivateUnionType' is not accessible from this code location -neg15.fs(106,18,106,66): typecheck error FS1093: The union cases or fields of the type 'UnionTypeWithPrivateRepresentation' are not accessible from this code location +neg15.fs(106,20,106,66): typecheck error FS1093: The union cases or fields of the type 'UnionTypeWithPrivateRepresentation' are not accessible from this code location neg15.fs(107,17,107,41): typecheck error FS0491: The member or object constructor 'PrivateProperty' is not accessible. Private members may only be accessed from within the declaring type. Protected members may only be accessed from an extending type and cannot be accessed from inner lambda expressions. @@ -49,7 +49,7 @@ neg15.fs(185,1,185,5): typecheck error FS0491: The member or object constructor neg15.fs(186,1,186,7): typecheck error FS0491: The member or object constructor 'SM' is not accessible. Private members may only be accessed from within the declaring type. Protected members may only be accessed from an extending type and cannot be accessed from inner lambda expressions. -neg15.fs(187,1,187,6): typecheck error FS1096: The record, struct or class field 'f' is not accessible from this code location +neg15.fs(187,5,187,6): typecheck error FS1096: The record, struct or class field 'f' is not accessible from this code location neg15.fs(188,1,188,6): typecheck error FS0491: The member or object constructor 'P' is not accessible. Private members may only be accessed from within the declaring type. Protected members may only be accessed from an extending type and cannot be accessed from inner lambda expressions. diff --git a/tests/fsharp/typecheck/sigs/neg17.bsl b/tests/fsharp/typecheck/sigs/neg17.bsl index c09ddb99bb8..7974d02dc2e 100644 --- a/tests/fsharp/typecheck/sigs/neg17.bsl +++ b/tests/fsharp/typecheck/sigs/neg17.bsl @@ -3,7 +3,7 @@ neg17.fs(84,17,84,33): typecheck error FS0292: The type definitions for type 'Pr neg17b.fs(7,17,7,31): typecheck error FS1094: The value 'privateValue' is not accessible from this code location -neg17b.fs(8,18,8,43): typecheck error FS1092: The type 'PrivateUnionType' is not accessible from this code location +neg17b.fs(8,20,8,43): typecheck error FS1092: The type 'PrivateUnionType' is not accessible from this code location neg17b.fs(11,26,11,41): typecheck error FS0039: The type 'Type' does not define a field, constructor, or member named 'PrivateProperty'. diff --git a/tests/fsharp/typecheck/sigs/neg90.bsl b/tests/fsharp/typecheck/sigs/neg90.bsl index d04c6f2b059..7fc5ba3ede1 100644 --- a/tests/fsharp/typecheck/sigs/neg90.bsl +++ b/tests/fsharp/typecheck/sigs/neg90.bsl @@ -3,6 +3,6 @@ neg90.fs(4,9,4,12): typecheck error FS0001: A generic construct requires that th neg90.fs(7,22,7,25): typecheck error FS0039: The type 'foo' is not defined. -neg90.fs(16,9,16,21): typecheck error FS0035: This construct is deprecated: The union type for union case 'Member' was defined with the RequireQualifiedAccessAttribute. Include the name of the union type ('DU') in the name you are using. +neg90.fs(16,15,16,21): typecheck error FS0035: This construct is deprecated: The union type for union case 'Member' was defined with the RequireQualifiedAccessAttribute. Include the name of the union type ('DU') in the name you are using. neg90.fs(28,9,28,41): typecheck error FS0035: This construct is deprecated: The record type for the record field 'Field1' was defined with the RequireQualifiedAccessAttribute. Include the name of the record type ('Record1') in the name you are using. diff --git a/tests/fsharp/typecheck/sigs/neg91.bsl b/tests/fsharp/typecheck/sigs/neg91.bsl index 8cb3e21f836..7ac51180563 100644 --- a/tests/fsharp/typecheck/sigs/neg91.bsl +++ b/tests/fsharp/typecheck/sigs/neg91.bsl @@ -3,13 +3,13 @@ neg91.fs(7,9,7,30): typecheck error FS0896: Enumerations cannot have members neg91.fs(10,10,10,15): typecheck error FS0956: Members that extend interface, delegate or enum types must be placed in a module separate to the definition of the type. This module must either have the AutoOpen attribute or be opened explicitly by client code to bring the extension members into scope. -neg91.fs(24,13,24,16): typecheck error FS1094: The value 'x' is not accessible from this code location +neg91.fs(24,15,24,16): typecheck error FS1094: The value 'x' is not accessible from this code location -neg91.fs(34,13,34,16): typecheck error FS0044: This construct is deprecated. Don't touch me +neg91.fs(34,15,34,16): typecheck error FS0044: This construct is deprecated. Don't touch me -neg91.fs(44,13,44,16): typecheck error FS3003: Don't touch me +neg91.fs(44,15,44,16): typecheck error FS3003: Don't touch me -neg91.fs(54,13,54,16): typecheck error FS0057: This construct is experimental. It was just an experiment!. This warning can be disabled using '--nowarn:57' or '#nowarn "57"'. +neg91.fs(54,15,54,16): typecheck error FS0057: This construct is experimental. It was just an experiment!. This warning can be disabled using '--nowarn:57' or '#nowarn "57"'. neg91.fs(63,11,63,27): typecheck error FS3191: This literal pattern does not take arguments