From ae9e48f30eaea17609ca0ba31263faa1d154a68f Mon Sep 17 00:00:00 2001 From: dotnet bot Date: Thu, 15 Mar 2018 10:54:30 -0700 Subject: [PATCH 001/150] always emit the local scope's start offset (#4531) --- src/absil/ilwritepdb.fs | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/src/absil/ilwritepdb.fs b/src/absil/ilwritepdb.fs index f8baa3aea4..760ac9e428 100644 --- a/src/absil/ilwritepdb.fs +++ b/src/absil/ilwritepdb.fs @@ -423,22 +423,15 @@ let generatePortablePdb (embedAllSource:bool) (embedSourceList:string list) (sou list.ToArray() |> Array.sortWith scopeSorter collectScopes scope |> Seq.iter(fun s -> - if s.Children.Length = 0 then - metadata.AddLocalScope(MetadataTokens.MethodDefinitionHandle(minfo.MethToken), - Unchecked.defaultof, - nextHandle lastLocalVariableHandle, - Unchecked.defaultof, - 0, s.EndOffset - s.StartOffset ) |>ignore - else - metadata.AddLocalScope(MetadataTokens.MethodDefinitionHandle(minfo.MethToken), - Unchecked.defaultof, - nextHandle lastLocalVariableHandle, - Unchecked.defaultof, - s.StartOffset, s.EndOffset - s.StartOffset) |>ignore - - for localVariable in s.Locals do - lastLocalVariableHandle <- metadata.AddLocalVariable(LocalVariableAttributes.None, localVariable.Index, metadata.GetOrAddString(localVariable.Name)) - ) + metadata.AddLocalScope(MetadataTokens.MethodDefinitionHandle(minfo.MethToken), + Unchecked.defaultof, + nextHandle lastLocalVariableHandle, + Unchecked.defaultof, + s.StartOffset, s.EndOffset - s.StartOffset ) |>ignore + + for localVariable in s.Locals do + lastLocalVariableHandle <- metadata.AddLocalVariable(LocalVariableAttributes.None, localVariable.Index, metadata.GetOrAddString(localVariable.Name)) + ) match minfo.RootScope with | None -> () From dbdd73a42c8c5bd3bac8c81d018750443345a1c3 Mon Sep 17 00:00:00 2001 From: dotnet bot Date: Thu, 15 Mar 2018 10:55:02 -0700 Subject: [PATCH 002/150] Merge dev15.7 to dev15.8 (#4529) From 8b52c979aeba077a6436d21abda30a3fbb6579e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Victor=20Peter=20Rouven=20M=C3=BCller?= Date: Thu, 15 Mar 2018 20:35:38 +0100 Subject: [PATCH 003/150] Code Lens and Line Lens (#3608) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Found a workaround for the heavy code lens bug. Merged master into the branch. Signed-off-by: realvictorprm * Fixes a deadlock due to context changes + started removing mutex. This is from yesterday! Review is NOT applied yet! Signed-off-by: realvictorprm * Small fixes, applied a part of the reviews The UI is still buggy. This is very annoying. @saul I should report the bug you read about in my comments. . . Signed-off-by: realvictorprm * Fixed CodeLens layout updates. Added possibility to enforce a re-layout of the visible code lens for the next layout-changed call. Applied suggestions from the reviews (could be that I missed one or two). Small cleanup. Small documentation additions. More checks. Removed some debug code. Added some debug code, most only appears if exceptions are thrown. The caching is still a small bit broken. At least I found out it's only a bit broken. Signed-off-by: realvictorprm * Fixing removal of Code Lens. Reuse of elements still needs to be finished. I started it months ago but didn't finish it. Signed-off-by: realvictorprm * Fixing fatal UI logic. Finally activated code for using cache results (so fixed a bug which included that code lens could be lost for us). Small cleanup to reduce confusion and decreased chance of introducing bugs due to this. Changing TaggerProvider to a more appropriate one. Discovered bugs in the visitor logic. * Added Line-Lens Added Options page to disable Code-Lens and to switch between Code-Lens and Line-Lens More caching fixes. Minimal UI fixes Signed-off-by: realvictorprm * Fixed caching completely. Also fixed with this UI issues. Big cleanup. Now it's ready for another round of reviews! Signed-off-by: realvictorprm * Added prefix option Signed-off-by: realvictorprm * Fixing bug reported by Vasily Fixing cache bug. Fixing ui-offset bug. Fixing multi-view bug. Fixing build. Fixing signature bug reported by @saul Signed-off-by: realvictorprm * Fixing KeyNotFoundException. Signed-off-by: realvictorprm * Another UI fix. Code Lens are now hidden as soon as their line isn't visible anymore due to inserting new lines. Signed-off-by: realvictorprm * Applied some review comments. Heavy performance improvements, now layouting isn't done every time due to that Visual Studio just transforms everything together (it's not viewport relative anymore, it's owner controlled but still in the wpf-text-view-coordinate-system)! The UI should now be fine in my opinion. It wasn't able for me to find a better workaround as just subtracting one pixel from the top position of the adornments. Signed-off-by: realvictorprm * Another round of small cleanup. Signed-off-by: realvictorprm * Another UI layout fix. Now weird code lens anymore :P Signed-off-by: realvictorprm * Fixing merge * start working on color option * use darker gray à la normal CodeLens * Bind only from XAML. Fixes issue where "prefix" option was not saved * Undo unintended whitespace change * Should be part of previous commit * start working on color option * use darker gray à la normal CodeLens * Undo unintended whitespace change * Should be part of previous commit * fix value names * Applied review + small workaround for a bug. Merry Christmas! Signed-off-by: realvictorprm * Removed old files * trying to fix CI Signed-off-by: realvictorprm * First fix for member and constructor signatures! Signed-off-by: realvictorprm --- src/fsharp/NicePrint.fs | 1 + src/fsharp/service/service.fs | 11 + src/fsharp/service/service.fsi | 3 + src/fsharp/symbols/Symbols.fs | 23 +- src/fsharp/symbols/Symbols.fsi | 6 + .../AbstractCodeLensDisplayService.fs | 273 +++++++++++++ .../CodeLens/CodeLensGeneralTagger.fs | 153 +++++++ .../CodeLens/CodeLensProvider.fs | 109 +++++ .../CodeLens/FSharpCodeLensService.fs | 385 ++++++++++++++++++ .../CodeLens/LineLensDisplayService.fs | 67 +++ .../src/FSharp.Editor/Common/Constants.fs | 4 + .../src/FSharp.Editor/Common/RoslynHelpers.fs | 11 + .../src/FSharp.Editor/FSharp.Editor.fsproj | 5 + .../LanguageService/LanguageService.fs | 1 + .../FSharp.Editor/Options/EditorOptions.fs | 22 +- .../src/FSharp.Editor/Options/UIHelpers.fs | 2 +- .../CodeLensOptionControl.xaml | 45 ++ .../CodeLensOptionControl.xaml.cs | 28 ++ .../FSharp.UIResources.csproj | 2 +- .../FSharp.UIResources/Strings.Designer.cs | 45 ++ .../src/FSharp.UIResources/Strings.resx | 16 +- .../src/FSharp.UIResources/xlf/Strings.cs.xlf | 25 ++ .../src/FSharp.UIResources/xlf/Strings.de.xlf | 25 ++ .../src/FSharp.UIResources/xlf/Strings.en.xlf | 25 ++ .../src/FSharp.UIResources/xlf/Strings.es.xlf | 25 ++ .../src/FSharp.UIResources/xlf/Strings.fr.xlf | 25 ++ .../src/FSharp.UIResources/xlf/Strings.it.xlf | 25 ++ .../src/FSharp.UIResources/xlf/Strings.ja.xlf | 25 ++ .../src/FSharp.UIResources/xlf/Strings.ko.xlf | 25 ++ .../src/FSharp.UIResources/xlf/Strings.pl.xlf | 25 ++ .../FSharp.UIResources/xlf/Strings.pt-BR.xlf | 25 ++ .../src/FSharp.UIResources/xlf/Strings.ru.xlf | 25 ++ .../src/FSharp.UIResources/xlf/Strings.tr.xlf | 25 ++ .../xlf/Strings.zh-Hans.xlf | 25 ++ .../xlf/Strings.zh-Hant.xlf | 25 ++ 35 files changed, 1556 insertions(+), 6 deletions(-) create mode 100644 vsintegration/src/FSharp.Editor/CodeLens/AbstractCodeLensDisplayService.fs create mode 100644 vsintegration/src/FSharp.Editor/CodeLens/CodeLensGeneralTagger.fs create mode 100644 vsintegration/src/FSharp.Editor/CodeLens/CodeLensProvider.fs create mode 100644 vsintegration/src/FSharp.Editor/CodeLens/FSharpCodeLensService.fs create mode 100644 vsintegration/src/FSharp.Editor/CodeLens/LineLensDisplayService.fs create mode 100644 vsintegration/src/FSharp.UIResources/CodeLensOptionControl.xaml create mode 100644 vsintegration/src/FSharp.UIResources/CodeLensOptionControl.xaml.cs diff --git a/src/fsharp/NicePrint.fs b/src/fsharp/NicePrint.fs index d311665060..195c373f73 100755 --- a/src/fsharp/NicePrint.fs +++ b/src/fsharp/NicePrint.fs @@ -1970,6 +1970,7 @@ let isGeneratedExceptionField pos f = TastDefinitionPrinting.isGeneratedExce let stringOfTyparConstraint denv tpc = stringOfTyparConstraints denv [tpc] let stringOfTy denv x = x |> PrintTypes.layoutType denv |> showL let prettyLayoutOfType denv x = x |> PrintTypes.prettyLayoutOfType denv +let prettyLayoutOfTypeNoCx denv x = x |> PrintTypes.prettyLayoutOfTypeNoConstraints denv let prettyStringOfTy denv x = x |> PrintTypes.prettyLayoutOfType denv |> showL let prettyStringOfTyNoCx denv x = x |> PrintTypes.prettyLayoutOfTypeNoConstraints denv |> showL let stringOfRecdField denv x = x |> TastDefinitionPrinting.layoutRecdField false denv |> showL diff --git a/src/fsharp/service/service.fs b/src/fsharp/service/service.fs index 38e95e816d..3ed5f832a0 100644 --- a/src/fsharp/service/service.fs +++ b/src/fsharp/service/service.fs @@ -908,6 +908,9 @@ type TypeCheckInfo match item with | Item.Types _ | Item.ModuleOrNamespaces _ -> true | _ -> false + + /// Find the most precise display context for the given line and column. + member __.GetBestDisplayEnvForPos cursorPos = GetBestEnvForPos cursorPos member __.GetVisibleNamespacesAndModulesAtPosition(cursorPos: pos) : ModuleOrNamespaceRef list = let (nenv, ad), m = GetBestEnvForPos cursorPos @@ -1982,6 +1985,7 @@ type FSharpCheckFileResults(filename: string, errors: FSharpErrorInfo[], scopeOp | _ -> async.Return dflt + member info.GetToolTipText(line, colAtEndOfNames, lineStr, names, tokenTag, userOpName) = info.GetStructuredToolTipText(line, colAtEndOfNames, lineStr, names, tokenTag, ?userOpName=userOpName) |> Tooltips.Map Tooltips.ToFSharpToolTipText @@ -2093,6 +2097,13 @@ type FSharpCheckFileResults(filename: string, errors: FSharpErrorInfo[], scopeOp RequireCompilationThread ctok scope.IsRelativeNameResolvableFromSymbol(pos, plid, symbol)) + member info.GetDisplayEnvForPos(pos: pos) : Async = + let userOpName = "CodeLens" + reactorOp userOpName "GetDisplayContextAtPos" None (fun ctok scope -> + DoesNotRequireCompilerThreadTokenAndCouldPossiblyBeMadeConcurrent ctok + let (nenv, _), _ = scope.GetBestDisplayEnvForPos pos + Some nenv.DisplayEnv) + member info.ImplementationFiles = if not keepAssemblyContents then invalidOp "The 'keepAssemblyContents' flag must be set to true on the FSharpChecker in order to access the checked contents of assemblies" scopeOptX diff --git a/src/fsharp/service/service.fsi b/src/fsharp/service/service.fsi index 82a1a563ea..df75679414 100755 --- a/src/fsharp/service/service.fsi +++ b/src/fsharp/service/service.fsi @@ -242,6 +242,9 @@ type public FSharpCheckFileResults = member internal GetVisibleNamespacesAndModulesAtPoint : pos -> Async + /// Find the most precise display environment for the given line and column. + member internal GetDisplayEnvForPos : pos : pos -> Async + /// Determines if a long ident is resolvable at a specific point. /// An optional string used for tracing compiler operations associated with this request. member internal IsRelativeNameResolvable: cursorPos : pos * plid : string list * item: Item * ?userOpName: string -> Async diff --git a/src/fsharp/symbols/Symbols.fs b/src/fsharp/symbols/Symbols.fs index 74aa51c9e2..944c4d8b69 100644 --- a/src/fsharp/symbols/Symbols.fs +++ b/src/fsharp/symbols/Symbols.fs @@ -1844,6 +1844,23 @@ and FSharpMemberOrFunctionOrValue(cenv, d:FSharpMemberOrValData, item) = prefix + x.LogicalName with _ -> "??" + member x.FormatLayout (denv:FSharpDisplayContext) = + match x.IsMember, d with + | true, V v -> + NicePrint.prettyLayoutOfValOrMemberNoInst { (denv.Contents cenv.g) with showMemberContainers=true } v.Deref + | _,_ -> + checkIsResolved() + let ty = + match d with + | E e -> e.GetDelegateType(cenv.amap, range0) + | P p -> p.GetPropertyType(cenv.amap, range0) + | M m | C m -> + let rty = m.GetFSharpReturnTy(cenv.amap, range0, m.FormalMethodInst) + let argtysl = m.GetParamTypes(cenv.amap, range0, m.FormalMethodInst) + mkIteratedFunTy (List.map (mkRefTupledTy cenv.g) argtysl) rty + | V v -> v.TauType + NicePrint.prettyLayoutOfTypeNoCx (denv.Contents cenv.g) ty + and FSharpType(cenv, typ:TType) = @@ -1989,7 +2006,11 @@ and FSharpType(cenv, typ:TType) = member x.Format(denv: FSharpDisplayContext) = protect <| fun () -> - NicePrint.prettyStringOfTyNoCx (denv.Contents cenv.g) typ + NicePrint.prettyStringOfTyNoCx (denv.Contents cenv.g) typ + + member x.FormatLayout(denv: FSharpDisplayContext) = + protect <| fun () -> + NicePrint.prettyLayoutOfTypeNoCx (denv.Contents cenv.g) typ override x.ToString() = protect <| fun () -> diff --git a/src/fsharp/symbols/Symbols.fsi b/src/fsharp/symbols/Symbols.fsi index 55c1a6fbb2..34b3e15610 100644 --- a/src/fsharp/symbols/Symbols.fsi +++ b/src/fsharp/symbols/Symbols.fsi @@ -819,6 +819,9 @@ and [] public FSharpMemberOrFunctionOrValue = /// Indicates if this is a constructor. member IsConstructor : bool + + /// Format the type using the rules of the given display context + member FormatLayout : context: FSharpDisplayContext -> Layout /// A subtype of FSharpSymbol that represents a parameter @@ -931,6 +934,9 @@ and [] public FSharpType = /// Format the type using the rules of the given display context member Format : context: FSharpDisplayContext -> string + /// Format the type using the rules of the given display context + member FormatLayout : context: FSharpDisplayContext -> Layout + /// Instantiate generic type parameters in a type member Instantiate : (FSharpGenericParameter * FSharpType) list -> FSharpType diff --git a/vsintegration/src/FSharp.Editor/CodeLens/AbstractCodeLensDisplayService.fs b/vsintegration/src/FSharp.Editor/CodeLens/AbstractCodeLensDisplayService.fs new file mode 100644 index 0000000000..df364bb876 --- /dev/null +++ b/vsintegration/src/FSharp.Editor/CodeLens/AbstractCodeLensDisplayService.fs @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace rec Microsoft.VisualStudio.FSharp.Editor + +open System +open System.Windows.Controls +open Microsoft.VisualStudio.Text +open Microsoft.VisualStudio.Text.Editor +open Microsoft.VisualStudio.Text.Formatting +open System.Threading +open System.Windows +open System.Collections.Generic + +open Microsoft.VisualStudio.FSharp.Editor.Logging + +[] +type CodeLensDisplayService (view : IWpfTextView, buffer : ITextBuffer, layerName) as self = + + // Add buffer changed event handler + do ( + buffer.Changed.Add self.handleBufferChanged + view.LayoutChanged.Add self.handleLayoutChanged + ) + + /// + /// Enqueing an unit signals to the tagger that all visible line lens must be layouted again, + /// to respect single line changes. + /// + member val RelayoutRequested : Queue<_> = Queue() with get + + member val WpfView = view + + member val TextBuffer = buffer + + /// Saves the ui context to switch context for ui related work. + member val uiContext = SynchronizationContext.Current + + // Tracks the created ui elements per TrackingSpan + member val uiElements = Dictionary<_,Grid>() + + member val trackingSpanUiParent = HashSet() + + member val uiElementNeighbour = Dictionary() + + /// Caches the current used trackingSpans per line. One line can contain multiple trackingSpans + member val trackingSpans = Dictionary>() + /// Text view for accessing the adornment layer. + member val view: IWpfTextView = view + /// The code lens layer for adding and removing adornments. + member val codeLensLayer = view.GetAdornmentLayer layerName + /// Tracks the recent first + last visible line numbers for adornment layout logic. + member val recentFirstVsblLineNmbr = 0 with get, set + + member val recentLastVsblLineNmbr = 0 with get, set + /// Tracks the adornments on the layer. + member val addedAdornments = HashSet() + /// Cancellation token source for the layout changed event. Needed to abort previous async-work. + member val layoutChangedCts = new CancellationTokenSource() with get, set + + /// Tracks the last used buffer snapshot, should be preferred used in combination with mutex. + member val currentBufferSnapshot = null with get, set + + /// Helper method which returns the start line number of a tracking span + member __.getTrackingSpanStartLine (snapshot:ITextSnapshot) (trackingSpan:ITrackingSpan) = + snapshot.GetLineNumberFromPosition(trackingSpan.GetStartPoint(snapshot).Position) + + /// Helper method which returns the start line number of a tracking span + member __.tryGetTSpanStartLine (snapshot:ITextSnapshot) (trackingSpan:ITrackingSpan) = + let pos = trackingSpan.GetStartPoint(snapshot).Position + if snapshot.Length - 1 < pos then None + else pos |> snapshot.GetLineNumberFromPosition |> Some + + member self.updateTrackingSpansFast (snapshot:ITextSnapshot) lineNumber = + if lineNumber |> self.trackingSpans.ContainsKey then + let currentTrackingSpans = self.trackingSpans.[lineNumber] |> ResizeArray // We need a copy because we modify the list. + for trackingSpan in currentTrackingSpans do + let newLineOption = self.tryGetTSpanStartLine snapshot trackingSpan + match newLineOption with + | None -> () + | Some newLine -> + if newLine <> lineNumber then + // We're on a new line and need to check whether we're currently in another grid + // (because somehow there were multiple trackingSpans per line). + if self.trackingSpanUiParent.Contains trackingSpan then + self.trackingSpanUiParent.Remove trackingSpan |> ignore + self.uiElementNeighbour.Remove self.uiElements.[trackingSpan] |> ignore + // remove our entry in the line cache dictionary + self.trackingSpans.[lineNumber].Remove(trackingSpan) |> ignore + // if the cache entry for the old line is now empty remove it completely + if self.trackingSpans.[lineNumber].Count = 0 then + self.trackingSpans.Remove lineNumber |> ignore + // now re-register our tracking span in the cache dict. + // Check whether the new line has no existing entry to add a fresh one. + // If there is already one we put our grid into the grid of the first entry of the line. + if newLine |> self.trackingSpans.ContainsKey |> not then + self.trackingSpans.[newLine] <- ResizeArray() + else + let neighbour = + self.uiElements.[self.trackingSpans.[newLine] |> Seq.last] // This fails if a tracking span has no ui element! + self.uiElementNeighbour.[self.uiElements.[trackingSpan]] <- neighbour + self.trackingSpanUiParent.Add trackingSpan |> ignore + // And finally add us to the cache again. + self.trackingSpans.[newLine].Add(trackingSpan) + // Be sure that the uiElement of the trackingSpan is visible if the new line is in the visible line space. + if newLine < self.recentFirstVsblLineNmbr || newLine > self.recentLastVsblLineNmbr then + if self.uiElements.ContainsKey trackingSpan then + let mutable element = self.uiElements.[trackingSpan] + element.Visibility <- Visibility.Hidden + + member __.createDefaultStackPanel () = + let grid = Grid(Visibility = Visibility.Hidden) + Canvas.SetLeft(grid, 0.) + Canvas.SetTop(grid, 0.) + grid + + /// Helper methods which invokes every action which is needed for new trackingSpans + member self.addTrackingSpan (trackingSpan:ITrackingSpan)= + let snapshot = buffer.CurrentSnapshot + let startLineNumber = snapshot.GetLineNumberFromPosition(trackingSpan.GetStartPoint(snapshot).Position) + let uiElement = + if self.uiElements.ContainsKey trackingSpan then + logErrorf "Added a tracking span twice, this is not allowed and will result in invalid values! %A" (trackingSpan.GetText snapshot) + self.uiElements.[trackingSpan] + else + let defaultStackPanel = self.createDefaultStackPanel() + self.uiElements.[trackingSpan] <- defaultStackPanel + defaultStackPanel + if self.trackingSpans.ContainsKey startLineNumber then + self.trackingSpans.[startLineNumber].Add trackingSpan + let neighbour = + self.uiElements.[self.trackingSpans.[startLineNumber] |> Seq.last] // This fails if a tracking span has no ui element! + self.uiElementNeighbour.[uiElement] <- neighbour + self.trackingSpanUiParent.Add trackingSpan |> ignore + else + self.trackingSpans.[startLineNumber] <- ResizeArray() + self.trackingSpans.[startLineNumber].Add trackingSpan + uiElement + + + member self.handleBufferChanged(e:TextContentChangedEventArgs) = + try + let oldSnapshot = e.Before + let snapshot = e.After + self.currentBufferSnapshot <- snapshot + for line in oldSnapshot.Lines do + let lineNumber = line.LineNumber + self.updateTrackingSpansFast snapshot lineNumber + let firstLine = view.TextViewLines.FirstVisibleLine + view.DisplayTextLineContainingBufferPosition (firstLine.Start, 0., ViewRelativePosition.Top) + self.RelayoutRequested.Enqueue(()) + with e -> logErrorf "Error in line lens provider: %A" e + + /// Public non-thread-safe method to add line lens for a given tracking span. + /// Returns an UIElement which can be used to add Ui elements and to remove the line lens later. + + member self.AddCodeLens (trackingSpan:ITrackingSpan) = + if trackingSpan.TextBuffer <> buffer then failwith "TrackingSpan text buffer does not equal with CodeLens text buffer" + let Grid = self.addTrackingSpan trackingSpan + self.RelayoutRequested.Enqueue(()) + Grid :> UIElement + + /// Public non-thread-safe method to remove line lens for a given tracking span. + member self.RemoveCodeLens (trackingSpan:ITrackingSpan) = + if self.uiElements.ContainsKey trackingSpan then + let Grid = self.uiElements.[trackingSpan] + Grid.Children.Clear() + self.uiElements.Remove trackingSpan |> ignore + try + self.codeLensLayer.RemoveAdornment(Grid) + with e -> + logExceptionWithContext(e, "Removing line lens") + else + logWarningf "No ui element is attached to this tracking span!" + let lineNumber = + (trackingSpan.GetStartPoint self.currentBufferSnapshot).Position + |> self.currentBufferSnapshot.GetLineNumberFromPosition + if self.trackingSpans.ContainsKey lineNumber then + if self.trackingSpans.[lineNumber].Remove trackingSpan |> not then + logWarningf "No tracking span is accociated with this line number %d!" lineNumber + if self.trackingSpans.[lineNumber].Count = 0 then + self.trackingSpans.Remove lineNumber |> ignore + else + logWarningf "No tracking span is accociated with this line number %d!" lineNumber + + abstract member AddUiElementToCodeLens : ITrackingSpan * UIElement -> unit + default self.AddUiElementToCodeLens (trackingSpan:ITrackingSpan, uiElement:UIElement) = + let Grid = self.uiElements.[trackingSpan] + Grid.Children.Add uiElement |> ignore + + abstract member AddUiElementToCodeLensOnce : ITrackingSpan * UIElement -> unit + default self.AddUiElementToCodeLensOnce (trackingSpan:ITrackingSpan, uiElement:UIElement)= + let Grid = self.uiElements.[trackingSpan] + if uiElement |> Grid.Children.Contains |> not then + self.AddUiElementToCodeLens (trackingSpan, uiElement) + + abstract member RemoveUiElementFromCodeLens : ITrackingSpan * UIElement -> unit + default self.RemoveUiElementFromCodeLens (trackingSpan:ITrackingSpan, uiElement:UIElement) = + let Grid = self.uiElements.[trackingSpan] + Grid.Children.Remove(uiElement) |> ignore + + member self.handleLayoutChanged (e:TextViewLayoutChangedEventArgs) = + try + let buffer = e.NewSnapshot + let recentVisibleLineNumbers = Set [self.recentFirstVsblLineNmbr .. self.recentLastVsblLineNmbr] + let firstVisibleLineNumber, lastVisibleLineNumber = + let first, last = + view.TextViewLines.FirstVisibleLine, + view.TextViewLines.LastVisibleLine + buffer.GetLineNumberFromPosition(first.Start.Position), + buffer.GetLineNumberFromPosition(last.Start.Position) + let visibleLineNumbers = Set [firstVisibleLineNumber .. lastVisibleLineNumber] + let nonVisibleLineNumbers = Set.difference recentVisibleLineNumbers visibleLineNumbers + let newVisibleLineNumbers = Set.difference visibleLineNumbers recentVisibleLineNumbers + + let applyFuncOnLineStackPanels (line:IWpfTextViewLine) (func:Grid -> unit) = + let lineNumber = line.Snapshot.GetLineNumberFromPosition(line.Start.Position) + if (self.trackingSpans.ContainsKey lineNumber) && (self.trackingSpans.[lineNumber]) |> (Seq.isEmpty >> not) then + for trackingSpan in self.trackingSpans.[lineNumber] do + let success, ui = self.uiElements.TryGetValue trackingSpan + if success then + func ui + + if nonVisibleLineNumbers.Count > 0 || newVisibleLineNumbers.Count > 0 then + for lineNumber in nonVisibleLineNumbers do + if lineNumber > 0 && lineNumber < buffer.LineCount then + try + let line = + (buffer.GetLineFromLineNumber lineNumber).Start + |> view.GetTextViewLineContainingBufferPosition + applyFuncOnLineStackPanels line (fun ui -> + ui.Visibility <- Visibility.Hidden + ) + with e -> logErrorf "Error in non visible lines iteration %A" e + for lineNumber in newVisibleLineNumbers do + try + let line = + (buffer.GetLineFromLineNumber lineNumber).Start + |> view.GetTextViewLineContainingBufferPosition + applyFuncOnLineStackPanels line (fun ui -> + ui.Visibility <- Visibility.Visible + self.layoutUIElementOnLine view line ui + ) + with e -> logErrorf "Error in new visible lines iteration %A" e + if not e.VerticalTranslation && e.NewViewState.ViewportHeight <> e.OldViewState.ViewportHeight then + self.RelayoutRequested.Enqueue() // Unfortunately zooming requires a relayout too, to ensure that no weird layout happens due to unkown reasons. + if self.RelayoutRequested.Count > 0 then + self.RelayoutRequested.Dequeue() |> ignore + for lineNumber in visibleLineNumbers do + let line = + (buffer.GetLineFromLineNumber lineNumber).Start + |> view.GetTextViewLineContainingBufferPosition + applyFuncOnLineStackPanels line (fun ui -> + ui.Visibility <- Visibility.Visible + self.layoutUIElementOnLine view line ui + ) + // Save the new first and last visible lines for tracking + self.recentFirstVsblLineNmbr <- firstVisibleLineNumber + self.recentLastVsblLineNmbr <- lastVisibleLineNumber + // We can cancel existing stuff because the algorithm supports abortion without any data loss + self.layoutChangedCts.Cancel() + self.layoutChangedCts.Dispose() + self.layoutChangedCts <- new CancellationTokenSource() + + self.asyncCustomLayoutOperation visibleLineNumbers buffer + |> RoslynHelpers.StartAsyncSafe self.layoutChangedCts.Token + with e -> logExceptionWithContext (e, "Layout changed") + + abstract layoutUIElementOnLine : IWpfTextView -> ITextViewLine -> Grid -> unit + + abstract asyncCustomLayoutOperation : int Set -> ITextSnapshot -> unit Async + + + diff --git a/vsintegration/src/FSharp.Editor/CodeLens/CodeLensGeneralTagger.fs b/vsintegration/src/FSharp.Editor/CodeLens/CodeLensGeneralTagger.fs new file mode 100644 index 0000000000..3d3a2a61f5 --- /dev/null +++ b/vsintegration/src/FSharp.Editor/CodeLens/CodeLensGeneralTagger.fs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace rec Microsoft.VisualStudio.FSharp.Editor + +open System +open System.Windows.Controls +open Microsoft.VisualStudio.Text +open Microsoft.VisualStudio.Text.Editor +open Microsoft.VisualStudio.Text.Formatting +open System.Windows +open System.Collections.Generic +open Microsoft.VisualStudio.Text.Tagging + +open Microsoft.VisualStudio.FSharp.Editor.Logging + +type CodeLensGeneralTag(width, topSpace, baseline, textHeight, bottomSpace, affinity, tag:obj, providerTag:obj) = + inherit SpaceNegotiatingAdornmentTag(width, topSpace, baseline, textHeight, bottomSpace, affinity, tag, providerTag) + +/// Class which provides support for general code lens +/// Use the methods AddCodeLens and RemoveCodeLens +type CodeLensGeneralTagger (view, buffer) as self = + inherit CodeLensDisplayService(view, buffer, "CodeLens") + + /// The tags changed event to notify if the data for the tags has changed. + let tagsChangedEvent = new Event,SnapshotSpanEventArgs>() + + /// Layouts all stack panels on the line + override self.layoutUIElementOnLine (view:IWpfTextView) (line:ITextViewLine) (ui:Grid) = + let left, top = + match self.uiElementNeighbour.TryGetValue ui with + | true, parent -> + let left = Canvas.GetLeft parent + let top = Canvas.GetTop parent + let width = parent.ActualWidth + logInfof "Width of parent: %.4f" width + left + width, top + | _ -> + try + // Get the real offset so that the code lens are placed respectively to their content + let offset = + [0..line.Length - 1] |> Seq.tryFind (fun i -> not (Char.IsWhiteSpace (line.Start.Add(i).GetChar()))) + |> Option.defaultValue 0 + + let realStart = line.Start.Add(offset) + let g = view.TextViewLines.GetCharacterBounds(realStart) + // WORKAROUND VS BUG, left cannot be zero if the offset is creater than zero! + // Calling the method twice fixes this bug and ensures that all values are correct. + // Okay not really :( Must be replaced later with an own calculation depending on editor font settings! + if 7 * offset > int g.Left then + logErrorf "Incorrect return from geometry measure" + Canvas.GetLeft ui, g.Top + else + g.Left, g.Top + with e -> + logExceptionWithContext (e, "Error in layout ui element on line") + Canvas.GetLeft ui, Canvas.GetTop ui + Canvas.SetLeft(ui, left) + Canvas.SetTop(ui, top) + + override self.asyncCustomLayoutOperation _ _ = + asyncMaybe { + // Suspend 16 ms, instantly applying the layout to the adornment elements isn't needed + // and would consume too much performance + do! Async.Sleep(16) |> liftAsync // Skip at least one frames + do! Async.SwitchToContext self.uiContext |> liftAsync + let layer = self.codeLensLayer + + do! Async.Sleep(495) |> liftAsync + + // WORKAROUND FOR VS BUG + // The layout changed event may not provide us all real changed lines so + // we take care of this on our own. + let visibleSpan = + let first, last = + view.TextViewLines.FirstVisibleLine, + view.TextViewLines.LastVisibleLine + SnapshotSpan(first.Start, last.End) + let customVisibleLines = view.TextViewLines.GetTextViewLinesIntersectingSpan visibleSpan + let isLineVisible (line:ITextViewLine) = line.IsValid + let linesToProcess = customVisibleLines |> Seq.filter isLineVisible + + for line in linesToProcess do + try + match line.GetAdornmentTags self |> Seq.tryHead with + | Some (:? seq as stackPanels) -> + for stackPanel in stackPanels do + if stackPanel |> self.addedAdornments.Contains |> not then + layer.AddAdornment(AdornmentPositioningBehavior.OwnerControlled, Nullable(), + self, stackPanel, AdornmentRemovedCallback(fun _ _ -> ())) |> ignore + self.addedAdornments.Add stackPanel |> ignore + | _ -> () + with e -> logExceptionWithContext (e, "LayoutChanged, processing new visible lines") + } |> Async.Ignore + + override self.AddUiElementToCodeLens (trackingSpan:ITrackingSpan, uiElement:UIElement)= + base.AddUiElementToCodeLens (trackingSpan, uiElement) // We do the same as the base call execpt that we need to notify that the tag needs to be refreshed. + tagsChangedEvent.Trigger(self, SnapshotSpanEventArgs(trackingSpan.GetSpan(buffer.CurrentSnapshot))) + + override self.RemoveUiElementFromCodeLens (trackingSpan:ITrackingSpan, uiElement:UIElement) = + base.RemoveUiElementFromCodeLens (trackingSpan, uiElement) + tagsChangedEvent.Trigger(self, SnapshotSpanEventArgs(trackingSpan.GetSpan(buffer.CurrentSnapshot))) // Need to refresh the tag. + + interface ITagger with + [] + override __.TagsChanged = tagsChangedEvent.Publish + + /// Returns the tags which reserve the correct space for adornments + /// Notice, it's asumed that the data in the collection is valid. + override __.GetTags spans = + try + seq { + for span in spans do + let snapshot = span.Snapshot + let lineNumber = + try + snapshot.GetLineNumberFromPosition(span.Start.Position) + with e -> logExceptionWithContext (e, "line number tagging"); 0 + if self.trackingSpans.ContainsKey(lineNumber) && self.trackingSpans.[lineNumber] |> Seq.isEmpty |> not then + + let tagSpan = snapshot.GetLineFromLineNumber(lineNumber).Extent + let stackPanels = + self.trackingSpans.[lineNumber] + |> Seq.map (fun trackingSpan -> + let success, res = self.uiElements.TryGetValue trackingSpan + if success then res else null + ) + |> Seq.filter (isNull >> not) + let span = + try + tagSpan.TranslateTo(span.Snapshot, SpanTrackingMode.EdgeExclusive) + with e -> logExceptionWithContext (e, "tag span translation"); tagSpan + let sizes = + try + stackPanels |> Seq.map (fun ui -> + ui.Measure(Size(10000., 10000.)) + ui.DesiredSize ) + with e -> logExceptionWithContext (e, "internal tagging"); Seq.empty + let height = + try + sizes + |> Seq.map (fun size -> size.Height) + |> Seq.sortDescending + |> Seq.tryHead + |> Option.defaultValue 0. + with e -> logExceptionWithContext (e, "height tagging"); 0. + + yield TagSpan(span, CodeLensGeneralTag(0., height, 0., 0., 0., PositionAffinity.Predecessor, stackPanels, self)) :> ITagSpan + } + with e -> + logErrorf "Error in code lens get tags %A" e + Seq.empty + + diff --git a/vsintegration/src/FSharp.Editor/CodeLens/CodeLensProvider.fs b/vsintegration/src/FSharp.Editor/CodeLens/CodeLensProvider.fs new file mode 100644 index 0000000000..b5092b32cd --- /dev/null +++ b/vsintegration/src/FSharp.Editor/CodeLens/CodeLensProvider.fs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace rec Microsoft.VisualStudio.FSharp.Editor + + +open System +open Microsoft.VisualStudio.Text +open Microsoft.VisualStudio.Text.Editor +open System.ComponentModel.Composition +open Microsoft.VisualStudio.Utilities +open Microsoft.CodeAnalysis +open Microsoft.VisualStudio.Shell +open Microsoft.VisualStudio +open Microsoft.VisualStudio.LanguageServices +open System.Collections.Generic +open Microsoft.CodeAnalysis.Editor.Shared.Utilities +open Microsoft.VisualStudio.Text.Tagging +open Microsoft.VisualStudio.Text.Classification +open Microsoft.VisualStudio.ComponentModelHost +open System.Threading +open Microsoft.VisualStudio.FSharp.Editor.Logging + +[)>] +[)>] +[)>] +[] +[] +type internal CodeLensProvider + [] + ( + textDocumentFactory: ITextDocumentFactoryService, + checkerProvider: FSharpCheckerProvider, + projectInfoManager: FSharpProjectOptionsManager, + typeMap : ClassificationTypeMap Lazy, + gotoDefinitionService: FSharpGoToDefinitionService + ) = + + let lineLensProvider = ResizeArray() + let taggers = ResizeArray() + let componentModel = Package.GetGlobalService(typeof) :?> ComponentModelHost.IComponentModel + let workspace = componentModel.GetService() + + /// Returns an provider for the textView if already one has been created. Else create one. + let addCodeLensProviderOnce wpfView buffer = + let res = taggers |> Seq.tryFind(fun (view, _) -> view = wpfView) + match res with + | Some (_, (tagger, _)) -> tagger + | None -> + let documentId = + lazy ( + match textDocumentFactory.TryGetTextDocument(buffer) with + | true, textDocument -> + Seq.tryHead (workspace.CurrentSolution.GetDocumentIdsWithFilePath(textDocument.FilePath)) + | _ -> None + |> Option.get + ) + + let tagger = CodeLensGeneralTagger(wpfView, buffer) + let service = FSharpCodeLensService(workspace, documentId, buffer, checkerProvider.Checker, projectInfoManager, componentModel.GetService(), typeMap, gotoDefinitionService, tagger) + let provider = (wpfView, (tagger, service)) + wpfView.Closed.Add (fun _ -> taggers.Remove provider |> ignore) + taggers.Add((wpfView, (tagger, service))) + tagger + + /// Returns an provider for the textView if already one has been created. Else create one. + let addLineLensProviderOnce wpfView buffer = + let res = lineLensProvider |> Seq.tryFind(fun (view, _) -> view = wpfView) + match res with + | None -> + let documentId = + lazy ( + match textDocumentFactory.TryGetTextDocument(buffer) with + | true, textDocument -> + Seq.tryHead (workspace.CurrentSolution.GetDocumentIdsWithFilePath(textDocument.FilePath)) + | _ -> None + |> Option.get + ) + let service = FSharpCodeLensService(workspace, documentId, buffer, checkerProvider.Checker, projectInfoManager, componentModel.GetService(), typeMap, gotoDefinitionService, LineLensDisplayService(wpfView, buffer)) + let provider = (wpfView, service) + wpfView.Closed.Add (fun _ -> lineLensProvider.Remove provider |> ignore) + lineLensProvider.Add(provider) + | _ -> () + + [); Name("CodeLens"); + Order(Before = PredefinedAdornmentLayers.Text); + TextViewRole(PredefinedTextViewRoles.Document)>] + member val CodeLensAdornmentLayerDefinition : AdornmentLayerDefinition = null with get, set + + [); Name("LineLens"); + Order(Before = PredefinedAdornmentLayers.Text); + TextViewRole(PredefinedTextViewRoles.Document)>] + member val LineLensAdornmentLayerDefinition : AdornmentLayerDefinition = null with get, set + + interface IViewTaggerProvider with + override __.CreateTagger(view, buffer) = + if Settings.CodeLens.Enabled && not Settings.CodeLens.ReplaceWithLineLens then + let wpfView = + match view with + | :? IWpfTextView as view -> view + | _ -> failwith "error" + + box(addCodeLensProviderOnce wpfView buffer) :?> _ + else + null + + interface IWpfTextViewCreationListener with + override __.TextViewCreated view = + if Settings.CodeLens.Enabled && Settings.CodeLens.ReplaceWithLineLens then + addLineLensProviderOnce view (view.TextBuffer) |> ignore diff --git a/vsintegration/src/FSharp.Editor/CodeLens/FSharpCodeLensService.fs b/vsintegration/src/FSharp.Editor/CodeLens/FSharpCodeLensService.fs new file mode 100644 index 0000000000..79e2d0045f --- /dev/null +++ b/vsintegration/src/FSharp.Editor/CodeLens/FSharpCodeLensService.fs @@ -0,0 +1,385 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace rec Microsoft.VisualStudio.FSharp.Editor + + +open System +open System.Windows.Controls +open System.Windows.Media +open Microsoft.VisualStudio.Text +open Microsoft.VisualStudio.Text.Formatting +open Microsoft.CodeAnalysis +open System.Threading +open Microsoft.FSharp.Compiler.SourceCodeServices +open System.Windows +open System.Collections.Generic +open Microsoft.FSharp.Compiler.Range +open Microsoft.FSharp.Compiler +open Microsoft.FSharp.Compiler.Ast +open Microsoft.CodeAnalysis.Editor.Shared.Extensions +open Microsoft.CodeAnalysis.Editor.Shared.Utilities +open Microsoft.CodeAnalysis.Classification +open Internal.Utilities.StructuredFormat +open System.Windows.Media.Animation + +open Microsoft.VisualStudio.FSharp.Editor.Logging +open Microsoft.VisualStudio.Text.Classification + +type internal CodeLens(taggedText, computed, fullTypeSignature, uiElement) = + member val TaggedText: Async<(ResizeArray * QuickInfoNavigation) option> = taggedText + member val Computed: bool = computed with get, set + member val FullTypeSignature: string = fullTypeSignature + member val UiElement: UIElement = uiElement with get, set + +type internal FSharpCodeLensService + ( + workspace: Workspace, + documentId: Lazy, + buffer: ITextBuffer, + checker: FSharpChecker, + projectInfoManager: FSharpProjectOptionsManager, + classificationFormatMapService: IClassificationFormatMapService, + typeMap: Lazy, + gotoDefinitionService: FSharpGoToDefinitionService, + codeLens : CodeLensDisplayService + ) as self = + + let lineLens = codeLens + + let visit pos parseTree = + AstTraversal.Traverse(pos, parseTree, { new AstTraversal.AstVisitorBase<_>() with + member __.VisitExpr(_path, traverseSynExpr, defaultTraverse, expr) = + defaultTraverse(expr) + + override __.VisitInheritSynMemberDefn (_, _, _, _, range) = Some range + + override __.VisitTypeAbbrev( _, range) = Some range + + override __.VisitLetOrUse(binding, range) = Some range + + override __.VisitBinding (fn, binding) = + Some binding.RangeOfBindingAndRhs + }) + + let formatMap = lazy classificationFormatMapService.GetClassificationFormatMap "tooltip" + + let mutable lastResults = Dictionary() + let mutable firstTimeChecked = false + let mutable bufferChangedCts = new CancellationTokenSource() + let uiContext = SynchronizationContext.Current + + let layoutTagToFormatting (layoutTag: LayoutTag) = + layoutTag + |> RoslynHelpers.roslynTag + |> ClassificationTags.GetClassificationTypeName + |> typeMap.Value.GetClassificationType + |> formatMap.Value.GetTextProperties + + let createTextBox (lens:CodeLens) = + async { + do! Async.SwitchToContext uiContext + let! res = lens.TaggedText + match res with + | Some (taggedText, navigation) -> + logInfof "Tagged text %A" taggedText + let textBlock = new TextBlock(Background = Brushes.AliceBlue, Opacity = 0.0, TextTrimming = TextTrimming.None) + DependencyObjectExtensions.SetDefaultTextProperties(textBlock, formatMap.Value) + + let prefix = Documents.Run Settings.CodeLens.Prefix + prefix.Foreground <- SolidColorBrush(Color.FromRgb(153uy, 153uy, 153uy)) + textBlock.Inlines.Add prefix + + for text in taggedText do + + let coloredProperties = layoutTagToFormatting text.Tag + let actualProperties = + if Settings.CodeLens.UseColors + then + // If color is gray (R=G=B), change to correct gray color. + // Otherwise, use the provided color. + match coloredProperties.ForegroundBrush with + | :? SolidColorBrush as b -> + let c = b.Color + if c.R = c.G && c.R = c.B + then coloredProperties.SetForeground(Color.FromRgb(153uy, 153uy, 153uy)) + else coloredProperties + | _ -> coloredProperties + else + coloredProperties.SetForeground(Color.FromRgb(153uy, 153uy, 153uy)) + + let run = Documents.Run text.Text + DependencyObjectExtensions.SetTextProperties (run, actualProperties) + + let inl = + match text with + | :? Layout.NavigableTaggedText as nav when navigation.IsTargetValid nav.Range -> + let h = Documents.Hyperlink(run, ToolTip = nav.Range.FileName) + h.Click.Add (fun _ -> + navigation.NavigateTo nav.Range) + h :> Documents.Inline + | _ -> run :> _ + DependencyObjectExtensions.SetTextProperties (inl, actualProperties) + textBlock.Inlines.Add inl + + + textBlock.Measure(Size(Double.PositiveInfinity, Double.PositiveInfinity)) + lens.Computed <- true + lens.UiElement <- textBlock + return true + | _ -> + return false + } + + let StartAsyncSafe cancellationToken context computation = + let computation = + async { + try + return! computation + with e -> + logExceptionWithContext(e, context) + return Unchecked.defaultof<_> + } + Async.Start (computation, cancellationToken) + + let executeCodeLenseAsync () = + asyncMaybe { + do! Async.Sleep 800 |> liftAsync + logInfof "Rechecking code due to buffer edit!" + let! document = workspace.CurrentSolution.GetDocument(documentId.Value) |> Option.ofObj + let! _, options = projectInfoManager.TryGetOptionsForEditingDocumentOrProject(document) + let! _, parsedInput, checkFileResults = checker.ParseAndCheckDocument(document, options, true, "LineLens") + logInfof "Getting uses of all symbols!" + let! symbolUses = checkFileResults.GetAllUsesOfAllSymbolsInFile() |> liftAsync + let textSnapshot = buffer.CurrentSnapshot + logInfof "Updating due to buffer edit!" + + // Clear existing data and cache flags + // The results which are left. + let oldResults = Dictionary(lastResults) + + let newResults = Dictionary() + // Symbols which cache wasn't found yet + let unattachedSymbols = ResizeArray() + // Tags which are new or need to be updated due to changes. + let tagsToUpdate = Dictionary() + let codeLensToAdd = ResizeArray() + + let useResults (displayContext: FSharpDisplayContext, func: FSharpMemberOrFunctionOrValue, realPosition: range) = + async { + try + let textSnapshot = buffer.CurrentSnapshot + let lineNumber = Line.toZ func.DeclarationLocation.StartLine + if (lineNumber >= 0 || lineNumber < textSnapshot.LineCount) then + match func.FullTypeSafe with + | Some ty -> + let! displayEnv = checkFileResults.GetDisplayEnvForPos func.DeclarationLocation.Start + + let displayContext = + match displayEnv with + | Some denv -> FSharpDisplayContext(fun _ -> denv) + | None -> displayContext + + let typeLayout = func.FormatLayout displayContext + let taggedText = ResizeArray() + + Layout.renderL (Layout.taggedTextListR taggedText.Add) typeLayout |> ignore + let navigation = QuickInfoNavigation(gotoDefinitionService, document, realPosition) + // Because the data is available notify that this line should be updated, displaying the results + return Some (taggedText, navigation) + | None -> + logWarningf "Couldn't acquire CodeLens data for function %A" func + return None + else return None + with e -> + logErrorf "Error in lazy line lens computation. %A" e + return None + } + + let inline setNewResultsAndWarnIfOverriden fullDeclarationText value = + if newResults.ContainsKey fullDeclarationText then + logWarningf "New results already contains: %A" fullDeclarationText + newResults.[fullDeclarationText] <- value + + for symbolUse in symbolUses do + if symbolUse.IsFromDefinition then + match symbolUse.Symbol with + | :? FSharpMemberOrFunctionOrValue as func when func.IsModuleValueOrMember || func.IsProperty -> + let funcID = func.FullName + let fullDeclarationText = funcID // (textSnapshot.GetText declarationSpan).Replace(func.CompiledName, funcID) + let fullTypeSignature = func.FullType.ToString() + // Try to re-use the last results + if lastResults.ContainsKey fullDeclarationText then + // Make sure that the results are usable + let inline setNewResultsAndWarnIfOverridenLocal value = setNewResultsAndWarnIfOverriden fullDeclarationText value + let lastTrackingSpan, codeLens as lastResult = lastResults.[fullDeclarationText] + if codeLens.FullTypeSignature = fullTypeSignature then + setNewResultsAndWarnIfOverridenLocal lastResult + oldResults.Remove fullDeclarationText |> ignore + else + let declarationLine, range = + match visit func.DeclarationLocation.Start parsedInput with + | Some range -> range.StartLine - 1, range + | _ -> func.DeclarationLocation.StartLine - 1, func.DeclarationLocation + // Track the old element for removal + let declarationSpan = + let line = textSnapshot.GetLineFromLineNumber declarationLine + let offset = line.GetText() |> Seq.findIndex (Char.IsWhiteSpace >> not) + SnapshotSpan(line.Start.Add offset, line.End).Span + let newTrackingSpan = + textSnapshot.CreateTrackingSpan(declarationSpan, SpanTrackingMode.EdgeExclusive) + // Push back the new results + let res = + CodeLens( Async.cache (useResults (symbolUse.DisplayContext, func, range)), + false, + fullTypeSignature, + null) + // The old results aren't computed at all, because the line might have changed create new results + tagsToUpdate.[lastTrackingSpan] <- (newTrackingSpan, fullDeclarationText, res) + setNewResultsAndWarnIfOverridenLocal (newTrackingSpan, res) + + oldResults.Remove fullDeclarationText |> ignore + else + // The symbol might be completely new or has slightly changed. + // We need to track this and iterate over the left entries to ensure that there isn't anything + unattachedSymbols.Add((symbolUse, func, fullDeclarationText, fullTypeSignature)) + | _ -> () + + // In best case this works quite `covfefe` fine because often enough we change only a small part of the file and not the complete. + for unattachedSymbol in unattachedSymbols do + let symbolUse, func, fullDeclarationText, fullTypeSignature = unattachedSymbol + let declarationLine, range = + match visit func.DeclarationLocation.Start parsedInput with + | Some range -> range.StartLine - 1, range + | _ -> func.DeclarationLocation.StartLine - 1, func.DeclarationLocation + + let test (v:KeyValuePair<_, _>) = + let _, (codeLens:CodeLens) = v.Value + codeLens.FullTypeSignature = fullTypeSignature + match oldResults |> Seq.tryFind test with + | Some res -> + let (trackingSpan : ITrackingSpan), (codeLens : CodeLens) = res.Value + let declarationSpan = + let line = textSnapshot.GetLineFromLineNumber declarationLine + let offset = line.GetText() |> Seq.findIndex (Char.IsWhiteSpace >> not) + SnapshotSpan(line.Start.Add offset, line.End).Span + let newTrackingSpan = + textSnapshot.CreateTrackingSpan(declarationSpan, SpanTrackingMode.EdgeExclusive) + if codeLens.Computed && (isNull codeLens.UiElement |> not) then + newResults.[fullDeclarationText] <- (newTrackingSpan, codeLens) + tagsToUpdate.[trackingSpan] <- (newTrackingSpan, fullDeclarationText, codeLens) + else + let res = + CodeLens( + Async.cache (useResults (symbolUse.DisplayContext, func, range)), + false, + fullTypeSignature, + null) + // The tag might be still valid but it hasn't been computed yet so create fresh results + tagsToUpdate.[trackingSpan] <- (newTrackingSpan, fullDeclarationText, res) + newResults.[fullDeclarationText] <- (newTrackingSpan, res) + let key = res.Key + oldResults.Remove key |> ignore // no need to check this entry again + | None -> + // This function hasn't got any cache and so it's completely new. + // So create completely new results + // And finally add a tag for this. + let res = + CodeLens( + Async.cache (useResults (symbolUse.DisplayContext, func, range)), + false, + fullTypeSignature, + null) + try + let declarationSpan = + let line = textSnapshot.GetLineFromLineNumber declarationLine + let offset = line.GetText() |> Seq.findIndex (Char.IsWhiteSpace >> not) + SnapshotSpan(line.Start.Add offset, line.End).Span + let trackingSpan = + textSnapshot.CreateTrackingSpan(declarationSpan, SpanTrackingMode.EdgeExclusive) + codeLensToAdd.Add (trackingSpan, res) + newResults.[fullDeclarationText] <- (trackingSpan, res) + with e -> logExceptionWithContext (e, "Line Lens tracking tag span creation") + () + lastResults <- newResults + do! Async.SwitchToContext uiContext |> liftAsync + let createCodeLensUIElement (codeLens:CodeLens) trackingSpan _ = + if codeLens.Computed |> not then + async { + let! res = createTextBox codeLens + if res then + do! Async.SwitchToContext uiContext + logInfof "Adding ui element for %A" (codeLens.TaggedText) + let uiElement = codeLens.UiElement + let animation = + DoubleAnimation( + To = Nullable 0.8, + Duration = (TimeSpan.FromMilliseconds 800. |> Duration.op_Implicit), + EasingFunction = QuadraticEase() + ) + let sb = Storyboard() + Storyboard.SetTarget(sb, uiElement) + Storyboard.SetTargetProperty(sb, PropertyPath Control.OpacityProperty) + sb.Children.Add animation + lineLens.AddUiElementToCodeLensOnce (trackingSpan, uiElement) + lineLens.RelayoutRequested.Enqueue () + sb.Begin() + else + logWarningf "Couldn't retrieve code lens information for %A" codeLens.FullTypeSignature + // logInfo "Adding text box!" + } |> StartAsyncSafe CancellationToken.None "UIElement creation" + + for value in tagsToUpdate do + let trackingSpan, (newTrackingSpan, _, codeLens) = value.Key, value.Value + // logInfof "Adding ui element for %A" (codeLens.TaggedText) + lineLens.RemoveCodeLens trackingSpan |> ignore + let Grid = lineLens.AddCodeLens newTrackingSpan + // logInfof "Trackingspan %A is being added." trackingSpan + if codeLens.Computed && (isNull codeLens.UiElement |> not) then + let uiElement = codeLens.UiElement + lineLens.AddUiElementToCodeLensOnce (newTrackingSpan, uiElement) + else + Grid.IsVisibleChanged + |> Event.filter (fun eventArgs -> eventArgs.NewValue :?> bool) + |> Event.add (createCodeLensUIElement codeLens newTrackingSpan) + + for value in codeLensToAdd do + let trackingSpan, codeLens = value + let Grid = lineLens.AddCodeLens trackingSpan + logInfof "Trackingspan %A is being added." trackingSpan + + Grid.IsVisibleChanged + |> Event.filter (fun eventArgs -> eventArgs.NewValue :?> bool) + |> Event.add (createCodeLensUIElement codeLens trackingSpan) + + for oldResult in oldResults do + let trackingSpan, _ = oldResult.Value + // logInfof "removing trackingSpan %A" trackingSpan + lineLens.RemoveCodeLens trackingSpan |> ignore + + logInfof "Finished updating line lens." + + if not firstTimeChecked then + firstTimeChecked <- true + } |> Async.Ignore + + do + begin + buffer.Changed.AddHandler(fun _ e -> (self.BufferChanged e)) + async { + let mutable numberOfFails = 0 + while not firstTimeChecked && numberOfFails < 10 do + try + do! executeCodeLenseAsync() + do! Async.Sleep(1000) + with + | e -> logErrorf "Line Lens startup failed with: %A" e + numberOfFails <- numberOfFails + 1 + } |> Async.Start + end + + member __.BufferChanged ___ = + bufferChangedCts.Cancel() // Stop all ongoing async workflow. + bufferChangedCts.Dispose() + bufferChangedCts <- new CancellationTokenSource() + executeCodeLenseAsync () |> Async.Ignore |> RoslynHelpers.StartAsyncSafe bufferChangedCts.Token + diff --git a/vsintegration/src/FSharp.Editor/CodeLens/LineLensDisplayService.fs b/vsintegration/src/FSharp.Editor/CodeLens/LineLensDisplayService.fs new file mode 100644 index 0000000000..be49b79d03 --- /dev/null +++ b/vsintegration/src/FSharp.Editor/CodeLens/LineLensDisplayService.fs @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace rec Microsoft.VisualStudio.FSharp.Editor + + +open System +open System.Windows.Controls +open Microsoft.VisualStudio.Text +open Microsoft.VisualStudio.Text.Editor +open Microsoft.VisualStudio.Text.Formatting +open System.Windows +open System.Collections.Generic + +open Microsoft.VisualStudio.FSharp.Editor.Logging + +type internal LineLensDisplayService (view, buffer) = + inherit CodeLensDisplayService(view, buffer, "LineLens") + + /// Layouts all stack panels on the line + override self.layoutUIElementOnLine _ (line:ITextViewLine) (ui:Grid) = + let left, top = + match self.uiElementNeighbour.TryGetValue ui with + | true, parent -> + let left = Canvas.GetLeft parent + let top = Canvas.GetTop parent + let width = parent.ActualWidth + left + width, top + | _ -> + try + let bounds = line.GetCharacterBounds(line.Start) + line.TextRight + 5.0, bounds.Top - 1. + with e -> + logExceptionWithContext (e, "Error in layout ui element on line") + Canvas.GetLeft ui, Canvas.GetTop ui + Canvas.SetLeft(ui, left) + Canvas.SetTop(ui, top) + + override self.asyncCustomLayoutOperation visibleLineNumbers buffer = + asyncMaybe { + // Suspend 5 ms, instantly applying the layout to the adornment elements isn't needed + // and would consume too much performance + do! Async.Sleep(5) |> liftAsync // Skip at least one frames + do! Async.SwitchToContext self.uiContext |> liftAsync + let layer = self.codeLensLayer + do! Async.Sleep(495) |> liftAsync + try + for visibleLineNumber in visibleLineNumbers do + if self.trackingSpans.ContainsKey visibleLineNumber then + self.trackingSpans.[visibleLineNumber] + |> Seq.map (fun trackingSpan -> + let success, res = self.uiElements.TryGetValue trackingSpan + if success then + res + else null + ) + |> Seq.filter (fun ui -> not(isNull ui) && not(self.addedAdornments.Contains ui)) + |> Seq.iter(fun grid -> + layer.AddAdornment(AdornmentPositioningBehavior.OwnerControlled, Nullable(), + self, grid, AdornmentRemovedCallback(fun _ _ -> self.addedAdornments.Remove grid |> ignore)) |> ignore + self.addedAdornments.Add grid |> ignore + let line = + let l = buffer.GetLineFromLineNumber visibleLineNumber + view.GetTextViewLineContainingBufferPosition l.Start + self.layoutUIElementOnLine view line grid + ) + with e -> logExceptionWithContext (e, "LayoutChanged, processing new visible lines") + } |> Async.Ignore \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/Common/Constants.fs b/vsintegration/src/FSharp.Editor/Common/Constants.fs index ec876ff9d5..bc9b33b50c 100644 --- a/vsintegration/src/FSharp.Editor/Common/Constants.fs +++ b/vsintegration/src/FSharp.Editor/Common/Constants.fs @@ -64,6 +64,10 @@ module internal Guids = [] /// "9A66EB6A-DE52-4169-BC26-36FBD4312FD7" let codeFixesOptionPageIdString = "9A66EB6A-DE52-4169-BC26-36FBD4312FD7" + + [] + /// "00BE7FD9-8145-4A2E-A1BF-3BAF0F4F47DD" + let codeLensOptionPageIdString = "00BE7FD9-8145-4A2E-A1BF-3BAF0F4F47DD" [] /// "8FDA964A-263D-4B4E-9560-29897535217C" diff --git a/vsintegration/src/FSharp.Editor/Common/RoslynHelpers.fs b/vsintegration/src/FSharp.Editor/Common/RoslynHelpers.fs index feb1e89e57..880d14362c 100644 --- a/vsintegration/src/FSharp.Editor/Common/RoslynHelpers.fs +++ b/vsintegration/src/FSharp.Editor/Common/RoslynHelpers.fs @@ -159,6 +159,17 @@ module internal RoslynHelpers = let linePositionSpan = LinePositionSpan(LinePosition(Line.toZ r.StartLine, r.StartColumn), LinePosition(Line.toZ r.EndLine, r.EndColumn)) let textSpan = sourceText.Lines.GetTextSpan linePositionSpan Location.Create(filePath, textSpan, linePositionSpan) + + let StartAsyncSafe cancellationToken computation = + let computation = + async { + try + return! computation + with e -> + Assert.Exception(e) + return Unchecked.defaultof<_> + } + Async.Start (computation, cancellationToken) module internal OpenDeclarationHelper = diff --git a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj index 6d64030df3..eb2fb6ac56 100644 --- a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj +++ b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj @@ -90,6 +90,11 @@ + + + + + diff --git a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs index 20bac47a9d..86caf043b5 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs @@ -286,6 +286,7 @@ type [, "F#", null, "QuickInfo", "6009")>] [, "F#", null, "Code Fixes", "6010")>] [, "F#", null, "Performance", "6011")>] + [, "F#", null, "Code Lens", "6012")>] [, "F#", null, "Advanced", "6012")>] [] [, diff --git a/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs b/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs index 8444a3c157..c157908fba 100644 --- a/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs +++ b/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs @@ -42,10 +42,15 @@ type LanguageServicePerformanceOptions = ProjectCheckCacheSize: int } [] +type CodeLensOptions = + { Enabled : bool + ReplaceWithLineLens: bool + UseColors: bool + Prefix : string } + type AdvancedOptions = { IsBlockStructureEnabled: bool IsOutliningEnabled: bool } - [)>] type internal Settings [](store: SettingsStore) = do // Initialize default settings @@ -75,12 +80,19 @@ type internal Settings [](store: SettingsStore) = { IsBlockStructureEnabled = true IsOutliningEnabled = true } + store.RegisterDefault + { Enabled = true + UseColors = false + ReplaceWithLineLens = true + Prefix = "// " } + interface ISettings static member IntelliSense : IntelliSenseOptions = getSettings() static member QuickInfo : QuickInfoOptions = getSettings() static member CodeFixes : CodeFixesOptions = getSettings() static member LanguageServicePerformance : LanguageServicePerformanceOptions = getSettings() + static member CodeLens : CodeLensOptions = getSettings() static member Advanced: AdvancedOptions = getSettings() module internal OptionsUI = @@ -116,9 +128,15 @@ module internal OptionsUI = inherit AbstractOptionPage() override this.CreateView() = upcast LanguageServicePerformanceOptionControl() + + [] + type internal CodeLensOptionPage() = + inherit AbstractOptionPage() + override this.CreateView() = + upcast CodeLensOptionControl() [] type internal AdvancedSettingsOptionPage() = inherit AbstractOptionPage() override __.CreateView() = - upcast AdvancedOptionsControl() \ No newline at end of file + upcast AdvancedOptionsControl() diff --git a/vsintegration/src/FSharp.Editor/Options/UIHelpers.fs b/vsintegration/src/FSharp.Editor/Options/UIHelpers.fs index 2fb2fe303f..122fb5c51d 100644 --- a/vsintegration/src/FSharp.Editor/Options/UIHelpers.fs +++ b/vsintegration/src/FSharp.Editor/Options/UIHelpers.fs @@ -64,7 +64,7 @@ module internal OptionsUIHelpers = let bindCheckBox (checkBox: CheckBox) (path: string) = checkBox.SetBinding(CheckBox.IsCheckedProperty, path) |> ignore - + // some helpers to create option views in code instead of XAML let ( *** ) (control : #IAddChild) (children: UIElement list) = children |> List.iter control.AddChild diff --git a/vsintegration/src/FSharp.UIResources/CodeLensOptionControl.xaml b/vsintegration/src/FSharp.UIResources/CodeLensOptionControl.xaml new file mode 100644 index 0000000000..955c105c7f --- /dev/null +++ b/vsintegration/src/FSharp.UIResources/CodeLensOptionControl.xaml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vsintegration/src/FSharp.UIResources/CodeLensOptionControl.xaml.cs b/vsintegration/src/FSharp.UIResources/CodeLensOptionControl.xaml.cs new file mode 100644 index 0000000000..ad1a0ecf1a --- /dev/null +++ b/vsintegration/src/FSharp.UIResources/CodeLensOptionControl.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Microsoft.VisualStudio.FSharp.UIResources +{ + /// + /// Interaction logic for CodeLensOptionPage.xaml + /// + internal partial class CodeLensOptionControl : UserControl + { + public CodeLensOptionControl() + { + InitializeComponent(); + } + } +} diff --git a/vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj b/vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj index b17e3baa8e..c3bfe6eaf0 100644 --- a/vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj +++ b/vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj @@ -45,7 +45,7 @@ $(VS150COMNTOOLS)\..\..\MSBuild\$(VisualStudioVersion)\Bin $(VSMSBuildBinDir)\Microsoft.CSharp.targets - + false diff --git a/vsintegration/src/FSharp.UIResources/Strings.Designer.cs b/vsintegration/src/FSharp.UIResources/Strings.Designer.cs index 75234c04d7..9ca24307b1 100644 --- a/vsintegration/src/FSharp.UIResources/Strings.Designer.cs +++ b/vsintegration/src/FSharp.UIResources/Strings.Designer.cs @@ -87,6 +87,51 @@ public static string Code_Fixes { } } + /// + /// Looks up a localized string similar to CodeLens. + /// + public static string CodeLens { + get { + return ResourceManager.GetString("CodeLens", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Annotation prefix. + /// + public static string CodeLens_Prefix { + get { + return ResourceManager.GetString("CodeLens_Prefix", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Show annotations to the right instead of above the line. + /// + public static string CodeLens_Replace_LineLens { + get { + return ResourceManager.GetString("CodeLens_Replace_LineLens", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Show type signature annotations in the editor. + /// + public static string CodeLens_Switch { + get { + return ResourceManager.GetString("CodeLens_Switch", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Use colors in annotations. + /// + public static string CodeLens_UseColors { + get { + return ResourceManager.GetString("CodeLens_UseColors", resourceCulture); + } + } + /// /// Looks up a localized string similar to Completion Lists. /// diff --git a/vsintegration/src/FSharp.UIResources/Strings.resx b/vsintegration/src/FSharp.UIResources/Strings.resx index ebe45bf732..721e028dba 100644 --- a/vsintegration/src/FSharp.UIResources/Strings.resx +++ b/vsintegration/src/FSharp.UIResources/Strings.resx @@ -53,7 +53,6 @@ value : The object must be serialized with : System.Runtime.Serialization.Formatters.Soap.SoapFormatter : and then encoded with base64 encoding. - mimetype: application/x-microsoft.net.object.bytearray.base64 value : The object must be serialized into a byte array : using a System.ComponentModel.TypeConverter @@ -180,4 +179,19 @@ Show outlining and collapsable nodes for F# code + + CodeLens + + + Show annotations to the right instead of above the line + + + Show type signature annotations in the editor + + + Annotation prefix + + + Use colors in annotations + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf index 0ff8ba88f5..181456b7d0 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf @@ -107,6 +107,31 @@ Show outlining and collapsable nodes for F# code + + CodeLens + CodeLens + + + + Show annotations to the right instead of above the line + Show annotations to the right instead of above the line + + + + Show type signature annotations in the editor + Show type signature annotations in the editor + + + + Annotation prefix + Annotation prefix + + + + Use colors in annotations + Use colors in annotations + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf index a1a39ef28f..399ea69d83 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf @@ -107,6 +107,31 @@ Show outlining and collapsable nodes for F# code + + CodeLens + CodeLens + + + + Show annotations to the right instead of above the line + Show annotations to the right instead of above the line + + + + Show type signature annotations in the editor + Show type signature annotations in the editor + + + + Annotation prefix + Annotation prefix + + + + Use colors in annotations + Use colors in annotations + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.en.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.en.xlf index a9f0ba0ac1..58e0be7f3e 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.en.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.en.xlf @@ -107,6 +107,31 @@ Show outlining and collapsable nodes for F# code + + CodeLens + CodeLens + + + + Show annotations to the right instead of above the line + Show annotations to the right instead of above the line + + + + Show type signature annotations in the editor + Show type signature annotations in the editor + + + + Annotation prefix + Annotation prefix + + + + Use colors in annotations + Use colors in annotations + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf index 2d1c825ffa..f8408f9ff8 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf @@ -107,6 +107,31 @@ Show outlining and collapsable nodes for F# code + + CodeLens + CodeLens + + + + Show annotations to the right instead of above the line + Show annotations to the right instead of above the line + + + + Show type signature annotations in the editor + Show type signature annotations in the editor + + + + Annotation prefix + Annotation prefix + + + + Use colors in annotations + Use colors in annotations + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf index ab96737ba5..40710d3ee2 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf @@ -107,6 +107,31 @@ Show outlining and collapsable nodes for F# code + + CodeLens + CodeLens + + + + Show annotations to the right instead of above the line + Show annotations to the right instead of above the line + + + + Show type signature annotations in the editor + Show type signature annotations in the editor + + + + Annotation prefix + Annotation prefix + + + + Use colors in annotations + Use colors in annotations + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf index 76a71c8f91..24e7bc2c33 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf @@ -107,6 +107,31 @@ Show outlining and collapsable nodes for F# code + + CodeLens + CodeLens + + + + Show annotations to the right instead of above the line + Show annotations to the right instead of above the line + + + + Show type signature annotations in the editor + Show type signature annotations in the editor + + + + Annotation prefix + Annotation prefix + + + + Use colors in annotations + Use colors in annotations + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf index df5c9da7b3..e8efd6b87a 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf @@ -107,6 +107,31 @@ Show outlining and collapsable nodes for F# code + + CodeLens + CodeLens + + + + Show annotations to the right instead of above the line + Show annotations to the right instead of above the line + + + + Show type signature annotations in the editor + Show type signature annotations in the editor + + + + Annotation prefix + Annotation prefix + + + + Use colors in annotations + Use colors in annotations + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf index 2dd3b97e0e..6bc2cde2ac 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf @@ -107,6 +107,31 @@ Show outlining and collapsable nodes for F# code + + CodeLens + CodeLens + + + + Show annotations to the right instead of above the line + Show annotations to the right instead of above the line + + + + Show type signature annotations in the editor + Show type signature annotations in the editor + + + + Annotation prefix + Annotation prefix + + + + Use colors in annotations + Use colors in annotations + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf index 44ceba824a..1af3abf04a 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf @@ -107,6 +107,31 @@ Show outlining and collapsable nodes for F# code + + CodeLens + CodeLens + + + + Show annotations to the right instead of above the line + Show annotations to the right instead of above the line + + + + Show type signature annotations in the editor + Show type signature annotations in the editor + + + + Annotation prefix + Annotation prefix + + + + Use colors in annotations + Use colors in annotations + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf index 0b33aa390e..e7c09d8244 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf @@ -107,6 +107,31 @@ Show outlining and collapsable nodes for F# code + + CodeLens + CodeLens + + + + Show annotations to the right instead of above the line + Show annotations to the right instead of above the line + + + + Show type signature annotations in the editor + Show type signature annotations in the editor + + + + Annotation prefix + Annotation prefix + + + + Use colors in annotations + Use colors in annotations + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf index 3b63e1caa6..31cb447f90 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf @@ -107,6 +107,31 @@ Show outlining and collapsable nodes for F# code + + CodeLens + CodeLens + + + + Show annotations to the right instead of above the line + Show annotations to the right instead of above the line + + + + Show type signature annotations in the editor + Show type signature annotations in the editor + + + + Annotation prefix + Annotation prefix + + + + Use colors in annotations + Use colors in annotations + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf index 5eb169a55b..261cc6dcf5 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf @@ -107,6 +107,31 @@ Show outlining and collapsable nodes for F# code + + CodeLens + CodeLens + + + + Show annotations to the right instead of above the line + Show annotations to the right instead of above the line + + + + Show type signature annotations in the editor + Show type signature annotations in the editor + + + + Annotation prefix + Annotation prefix + + + + Use colors in annotations + Use colors in annotations + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf index 1a47f8d75c..98761fb0c9 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf @@ -107,6 +107,31 @@ Show outlining and collapsable nodes for F# code + + CodeLens + CodeLens + + + + Show annotations to the right instead of above the line + Show annotations to the right instead of above the line + + + + Show type signature annotations in the editor + Show type signature annotations in the editor + + + + Annotation prefix + Annotation prefix + + + + Use colors in annotations + Use colors in annotations + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf index 7fcb1a2d20..ef4bf62e9b 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf @@ -107,6 +107,31 @@ Show outlining and collapsable nodes for F# code + + CodeLens + CodeLens + + + + Show annotations to the right instead of above the line + Show annotations to the right instead of above the line + + + + Show type signature annotations in the editor + Show type signature annotations in the editor + + + + Annotation prefix + Annotation prefix + + + + Use colors in annotations + Use colors in annotations + + \ No newline at end of file From 62d4cf03e21930aa132768964d0815bc801690d1 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Thu, 15 Mar 2018 13:26:52 -0700 Subject: [PATCH 004/150] remove comment (#4538) --- .../src/FSharp.Editor/CodeLens/FSharpCodeLensService.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vsintegration/src/FSharp.Editor/CodeLens/FSharpCodeLensService.fs b/vsintegration/src/FSharp.Editor/CodeLens/FSharpCodeLensService.fs index 79e2d0045f..9be718fed9 100644 --- a/vsintegration/src/FSharp.Editor/CodeLens/FSharpCodeLensService.fs +++ b/vsintegration/src/FSharp.Editor/CodeLens/FSharpCodeLensService.fs @@ -205,7 +205,7 @@ type internal FSharpCodeLensService match symbolUse.Symbol with | :? FSharpMemberOrFunctionOrValue as func when func.IsModuleValueOrMember || func.IsProperty -> let funcID = func.FullName - let fullDeclarationText = funcID // (textSnapshot.GetText declarationSpan).Replace(func.CompiledName, funcID) + let fullDeclarationText = funcID let fullTypeSignature = func.FullType.ToString() // Try to re-use the last results if lastResults.ContainsKey fullDeclarationText then From 48076b16e2a4e11a2205bf85e86d554c5f722c08 Mon Sep 17 00:00:00 2001 From: Kevin Ransom Date: Thu, 15 Mar 2018 15:32:33 -0700 Subject: [PATCH 005/150] Tweaks --- .../AbstractCodeLensDisplayService.fs | 181 +++++++++--------- .../CodeLens/CodeLensGeneralTagger.fs | 20 +- .../CodeLens/FSharpCodeLensService.fs | 17 +- .../CodeLens/LineLensDisplayService.fs | 24 +-- .../src/FSharp.Editor/Common/RoslynHelpers.fs | 8 +- 5 files changed, 120 insertions(+), 130 deletions(-) diff --git a/vsintegration/src/FSharp.Editor/CodeLens/AbstractCodeLensDisplayService.fs b/vsintegration/src/FSharp.Editor/CodeLens/AbstractCodeLensDisplayService.fs index df364bb876..e6d60baf09 100644 --- a/vsintegration/src/FSharp.Editor/CodeLens/AbstractCodeLensDisplayService.fs +++ b/vsintegration/src/FSharp.Editor/CodeLens/AbstractCodeLensDisplayService.fs @@ -15,13 +15,13 @@ open Microsoft.VisualStudio.FSharp.Editor.Logging [] type CodeLensDisplayService (view : IWpfTextView, buffer : ITextBuffer, layerName) as self = - + // Add buffer changed event handler do ( - buffer.Changed.Add self.handleBufferChanged - view.LayoutChanged.Add self.handleLayoutChanged + buffer.Changed.Add self.HandleBufferChanged + view.LayoutChanged.Add self.HandleLayoutChanged ) - + /// /// Enqueing an unit signals to the tagger that all visible line lens must be layouted again, /// to respect single line changes. @@ -33,118 +33,122 @@ type CodeLensDisplayService (view : IWpfTextView, buffer : ITextBuffer, layerNam member val TextBuffer = buffer /// Saves the ui context to switch context for ui related work. - member val uiContext = SynchronizationContext.Current + member val UiContext = SynchronizationContext.Current // Tracks the created ui elements per TrackingSpan - member val uiElements = Dictionary<_,Grid>() + member val UiElements = Dictionary<_,Grid>() - member val trackingSpanUiParent = HashSet() + member val TrackingSpanUiParent = HashSet() - member val uiElementNeighbour = Dictionary() + member val UiElementNeighbour = Dictionary() + + /// Caches the current used TrackingSpans per line. One line can contain multiple trackingSpans + member val TrackingSpans = Dictionary>() - /// Caches the current used trackingSpans per line. One line can contain multiple trackingSpans - member val trackingSpans = Dictionary>() /// Text view for accessing the adornment layer. - member val view: IWpfTextView = view - /// The code lens layer for adding and removing adornments. - member val codeLensLayer = view.GetAdornmentLayer layerName + member val View: IWpfTextView = view + + member val CodeLensLayer = view.GetAdornmentLayer layerName + /// Tracks the recent first + last visible line numbers for adornment layout logic. - member val recentFirstVsblLineNmbr = 0 with get, set + member val RecentFirstVsblLineNmbr = 0 with get, set + + member val RecentLastVsblLineNmbr = 0 with get, set - member val recentLastVsblLineNmbr = 0 with get, set /// Tracks the adornments on the layer. - member val addedAdornments = HashSet() + member val AddedAdornments = HashSet() + /// Cancellation token source for the layout changed event. Needed to abort previous async-work. - member val layoutChangedCts = new CancellationTokenSource() with get, set + member val LayoutChangedCts = new CancellationTokenSource() with get, set /// Tracks the last used buffer snapshot, should be preferred used in combination with mutex. - member val currentBufferSnapshot = null with get, set + member val CurrentBufferSnapshot = null with get, set /// Helper method which returns the start line number of a tracking span - member __.getTrackingSpanStartLine (snapshot:ITextSnapshot) (trackingSpan:ITrackingSpan) = + member __.GetTrackingSpanStartLine (snapshot:ITextSnapshot) (trackingSpan:ITrackingSpan) = snapshot.GetLineNumberFromPosition(trackingSpan.GetStartPoint(snapshot).Position) /// Helper method which returns the start line number of a tracking span - member __.tryGetTSpanStartLine (snapshot:ITextSnapshot) (trackingSpan:ITrackingSpan) = + member __.TryGetTSpanStartLine (snapshot:ITextSnapshot) (trackingSpan:ITrackingSpan) = let pos = trackingSpan.GetStartPoint(snapshot).Position if snapshot.Length - 1 < pos then None else pos |> snapshot.GetLineNumberFromPosition |> Some - - member self.updateTrackingSpansFast (snapshot:ITextSnapshot) lineNumber = - if lineNumber |> self.trackingSpans.ContainsKey then - let currentTrackingSpans = self.trackingSpans.[lineNumber] |> ResizeArray // We need a copy because we modify the list. + + member self.UpdateTrackingSpansFast (snapshot:ITextSnapshot) lineNumber = + if lineNumber |> self.TrackingSpans.ContainsKey then + let currentTrackingSpans = self.TrackingSpans.[lineNumber] |> ResizeArray // We need a copy because we modify the list. for trackingSpan in currentTrackingSpans do - let newLineOption = self.tryGetTSpanStartLine snapshot trackingSpan + let newLineOption = self.TryGetTSpanStartLine snapshot trackingSpan match newLineOption with | None -> () | Some newLine -> if newLine <> lineNumber then // We're on a new line and need to check whether we're currently in another grid // (because somehow there were multiple trackingSpans per line). - if self.trackingSpanUiParent.Contains trackingSpan then - self.trackingSpanUiParent.Remove trackingSpan |> ignore - self.uiElementNeighbour.Remove self.uiElements.[trackingSpan] |> ignore + if self.TrackingSpanUiParent.Contains trackingSpan then + self.TrackingSpanUiParent.Remove trackingSpan |> ignore + self.UiElementNeighbour.Remove self.UiElements.[trackingSpan] |> ignore // remove our entry in the line cache dictionary - self.trackingSpans.[lineNumber].Remove(trackingSpan) |> ignore + self.TrackingSpans.[lineNumber].Remove(trackingSpan) |> ignore // if the cache entry for the old line is now empty remove it completely - if self.trackingSpans.[lineNumber].Count = 0 then - self.trackingSpans.Remove lineNumber |> ignore + if self.TrackingSpans.[lineNumber].Count = 0 then + self.TrackingSpans.Remove lineNumber |> ignore // now re-register our tracking span in the cache dict. // Check whether the new line has no existing entry to add a fresh one. // If there is already one we put our grid into the grid of the first entry of the line. - if newLine |> self.trackingSpans.ContainsKey |> not then - self.trackingSpans.[newLine] <- ResizeArray() + if newLine |> self.TrackingSpans.ContainsKey |> not then + self.TrackingSpans.[newLine] <- ResizeArray() else let neighbour = - self.uiElements.[self.trackingSpans.[newLine] |> Seq.last] // This fails if a tracking span has no ui element! - self.uiElementNeighbour.[self.uiElements.[trackingSpan]] <- neighbour - self.trackingSpanUiParent.Add trackingSpan |> ignore + self.UiElements.[self.TrackingSpans.[newLine] |> Seq.last] // This fails if a tracking span has no ui element! + self.UiElementNeighbour.[self.UiElements.[trackingSpan]] <- neighbour + self.TrackingSpanUiParent.Add trackingSpan |> ignore // And finally add us to the cache again. - self.trackingSpans.[newLine].Add(trackingSpan) - // Be sure that the uiElement of the trackingSpan is visible if the new line is in the visible line space. - if newLine < self.recentFirstVsblLineNmbr || newLine > self.recentLastVsblLineNmbr then - if self.uiElements.ContainsKey trackingSpan then - let mutable element = self.uiElements.[trackingSpan] + self.TrackingSpans.[newLine].Add(trackingSpan) + // Be sure that the uiElement of the trackingSpan is viRecentLastVsblLineNmbr the visible line space. + if newLine < self.RecentFirstVsblLineNmbr || newLine > self.RecentLastVsblLineNmbr then + if self.UiElements.ContainsKey trackingSpan then + let mutable element = self.UiElements.[trackingSpan] element.Visibility <- Visibility.Hidden - member __.createDefaultStackPanel () = + member __.CreateDefaultStackPanel () = let grid = Grid(Visibility = Visibility.Hidden) Canvas.SetLeft(grid, 0.) Canvas.SetTop(grid, 0.) grid /// Helper methods which invokes every action which is needed for new trackingSpans - member self.addTrackingSpan (trackingSpan:ITrackingSpan)= + member self.AddTrackingSpan (trackingSpan:ITrackingSpan)= let snapshot = buffer.CurrentSnapshot let startLineNumber = snapshot.GetLineNumberFromPosition(trackingSpan.GetStartPoint(snapshot).Position) let uiElement = - if self.uiElements.ContainsKey trackingSpan then + if self.UiElements.ContainsKey trackingSpan then logErrorf "Added a tracking span twice, this is not allowed and will result in invalid values! %A" (trackingSpan.GetText snapshot) - self.uiElements.[trackingSpan] + self.UiElements.[trackingSpan] else - let defaultStackPanel = self.createDefaultStackPanel() - self.uiElements.[trackingSpan] <- defaultStackPanel + let defaultStackPanel = self.CreateDefaultStackPanel() + self.UiElements.[trackingSpan] <- defaultStackPanel defaultStackPanel - if self.trackingSpans.ContainsKey startLineNumber then - self.trackingSpans.[startLineNumber].Add trackingSpan + if self.TrackingSpans.ContainsKey startLineNumber then + self.TrackingSpans.[startLineNumber].Add trackingSpan let neighbour = - self.uiElements.[self.trackingSpans.[startLineNumber] |> Seq.last] // This fails if a tracking span has no ui element! - self.uiElementNeighbour.[uiElement] <- neighbour - self.trackingSpanUiParent.Add trackingSpan |> ignore + self.UiElements.[self.TrackingSpans.[startLineNumber] |> Seq.last] // This fails if a tracking span has no ui element! + self.UiElementNeighbour.[uiElement] <- neighbour + self.TrackingSpanUiParent.Add trackingSpan |> ignore else - self.trackingSpans.[startLineNumber] <- ResizeArray() - self.trackingSpans.[startLineNumber].Add trackingSpan + self.TrackingSpans.[startLineNumber] <- ResizeArray() + self.TrackingSpans.[startLineNumber].Add trackingSpan uiElement - member self.handleBufferChanged(e:TextContentChangedEventArgs) = + member self.HandleBufferChanged(e:TextContentChangedEventArgs) = try let oldSnapshot = e.Before let snapshot = e.After - self.currentBufferSnapshot <- snapshot + self.CurrentBufferSnapshot <- snapshot for line in oldSnapshot.Lines do let lineNumber = line.LineNumber - self.updateTrackingSpansFast snapshot lineNumber + self.UpdateTrackingSpansFast snapshot lineNumber let firstLine = view.TextViewLines.FirstVisibleLine view.DisplayTextLineContainingBufferPosition (firstLine.Start, 0., ViewRelativePosition.Top) self.RelayoutRequested.Enqueue(()) @@ -155,53 +159,53 @@ type CodeLensDisplayService (view : IWpfTextView, buffer : ITextBuffer, layerNam member self.AddCodeLens (trackingSpan:ITrackingSpan) = if trackingSpan.TextBuffer <> buffer then failwith "TrackingSpan text buffer does not equal with CodeLens text buffer" - let Grid = self.addTrackingSpan trackingSpan + let Grid = self.AddTrackingSpan trackingSpan self.RelayoutRequested.Enqueue(()) Grid :> UIElement /// Public non-thread-safe method to remove line lens for a given tracking span. member self.RemoveCodeLens (trackingSpan:ITrackingSpan) = - if self.uiElements.ContainsKey trackingSpan then - let Grid = self.uiElements.[trackingSpan] + if self.UiElements.ContainsKey trackingSpan then + let Grid = self.UiElements.[trackingSpan] Grid.Children.Clear() - self.uiElements.Remove trackingSpan |> ignore + self.UiElements.Remove trackingSpan |> ignore try - self.codeLensLayer.RemoveAdornment(Grid) + self.CodeLensLayer.RemoveAdornment(Grid) with e -> logExceptionWithContext(e, "Removing line lens") else logWarningf "No ui element is attached to this tracking span!" let lineNumber = - (trackingSpan.GetStartPoint self.currentBufferSnapshot).Position - |> self.currentBufferSnapshot.GetLineNumberFromPosition - if self.trackingSpans.ContainsKey lineNumber then - if self.trackingSpans.[lineNumber].Remove trackingSpan |> not then + (trackingSpan.GetStartPoint self.CurrentBufferSnapshot).Position + |> self.CurrentBufferSnapshot.GetLineNumberFromPosition + if self.TrackingSpans.ContainsKey lineNumber then + if self.TrackingSpans.[lineNumber].Remove trackingSpan |> not then logWarningf "No tracking span is accociated with this line number %d!" lineNumber - if self.trackingSpans.[lineNumber].Count = 0 then - self.trackingSpans.Remove lineNumber |> ignore + if self.TrackingSpans.[lineNumber].Count = 0 then + self.TrackingSpans.Remove lineNumber |> ignore else logWarningf "No tracking span is accociated with this line number %d!" lineNumber abstract member AddUiElementToCodeLens : ITrackingSpan * UIElement -> unit default self.AddUiElementToCodeLens (trackingSpan:ITrackingSpan, uiElement:UIElement) = - let Grid = self.uiElements.[trackingSpan] + let Grid = self.UiElements.[trackingSpan] Grid.Children.Add uiElement |> ignore abstract member AddUiElementToCodeLensOnce : ITrackingSpan * UIElement -> unit default self.AddUiElementToCodeLensOnce (trackingSpan:ITrackingSpan, uiElement:UIElement)= - let Grid = self.uiElements.[trackingSpan] + let Grid = self.UiElements.[trackingSpan] if uiElement |> Grid.Children.Contains |> not then self.AddUiElementToCodeLens (trackingSpan, uiElement) abstract member RemoveUiElementFromCodeLens : ITrackingSpan * UIElement -> unit default self.RemoveUiElementFromCodeLens (trackingSpan:ITrackingSpan, uiElement:UIElement) = - let Grid = self.uiElements.[trackingSpan] + let Grid = self.UiElements.[trackingSpan] Grid.Children.Remove(uiElement) |> ignore - member self.handleLayoutChanged (e:TextViewLayoutChangedEventArgs) = + member self.HandleLayoutChanged (e:TextViewLayoutChangedEventArgs) = try let buffer = e.NewSnapshot - let recentVisibleLineNumbers = Set [self.recentFirstVsblLineNmbr .. self.recentLastVsblLineNmbr] + let recentVisibleLineNumbers = Set [self.RecentLastVsblLineNmbr .. self.RecentLastVsblLineNmbr] let firstVisibleLineNumber, lastVisibleLineNumber = let first, last = view.TextViewLines.FirstVisibleLine, @@ -214,9 +218,9 @@ type CodeLensDisplayService (view : IWpfTextView, buffer : ITextBuffer, layerNam let applyFuncOnLineStackPanels (line:IWpfTextViewLine) (func:Grid -> unit) = let lineNumber = line.Snapshot.GetLineNumberFromPosition(line.Start.Position) - if (self.trackingSpans.ContainsKey lineNumber) && (self.trackingSpans.[lineNumber]) |> (Seq.isEmpty >> not) then - for trackingSpan in self.trackingSpans.[lineNumber] do - let success, ui = self.uiElements.TryGetValue trackingSpan + if (self.TrackingSpans.ContainsKey lineNumber) && (self.TrackingSpans.[lineNumber]) |> (Seq.isEmpty >> not) then + for trackingSpan in self.TrackingSpans.[lineNumber] do + let success, ui = self.UiElements.TryGetValue trackingSpan if success then func ui @@ -238,7 +242,7 @@ type CodeLensDisplayService (view : IWpfTextView, buffer : ITextBuffer, layerNam |> view.GetTextViewLineContainingBufferPosition applyFuncOnLineStackPanels line (fun ui -> ui.Visibility <- Visibility.Visible - self.layoutUIElementOnLine view line ui + self.LayoutUIElementOnLine view line ui ) with e -> logErrorf "Error in new visible lines iteration %A" e if not e.VerticalTranslation && e.NewViewState.ViewportHeight <> e.OldViewState.ViewportHeight then @@ -251,23 +255,20 @@ type CodeLensDisplayService (view : IWpfTextView, buffer : ITextBuffer, layerNam |> view.GetTextViewLineContainingBufferPosition applyFuncOnLineStackPanels line (fun ui -> ui.Visibility <- Visibility.Visible - self.layoutUIElementOnLine view line ui + self.LayoutUIElementOnLine view line ui ) // Save the new first and last visible lines for tracking - self.recentFirstVsblLineNmbr <- firstVisibleLineNumber - self.recentLastVsblLineNmbr <- lastVisibleLineNumber + self.RecentFirstVsblLineNmbr <- firstVisibleLineNumber + self.RecentLastVsblLineNmbr <- lastVisibleLineNumber // We can cancel existing stuff because the algorithm supports abortion without any data loss - self.layoutChangedCts.Cancel() - self.layoutChangedCts.Dispose() - self.layoutChangedCts <- new CancellationTokenSource() + self.LayoutChangedCts.Cancel() + self.LayoutChangedCts.Dispose() + self.LayoutChangedCts <- new CancellationTokenSource() - self.asyncCustomLayoutOperation visibleLineNumbers buffer - |> RoslynHelpers.StartAsyncSafe self.layoutChangedCts.Token + self.AsyncCustomLayoutOperation visibleLineNumbers buffer + |> RoslynHelpers.StartAsyncSafe self.LayoutChangedCts.Token "HandleLayoutChanged" with e -> logExceptionWithContext (e, "Layout changed") - abstract layoutUIElementOnLine : IWpfTextView -> ITextViewLine -> Grid -> unit - - abstract asyncCustomLayoutOperation : int Set -> ITextSnapshot -> unit Async - - + abstract LayoutUIElementOnLine : IWpfTextView -> ITextViewLine -> Grid -> unit + abstract AsyncCustomLayoutOperation : int Set -> ITextSnapshot -> unit Async diff --git a/vsintegration/src/FSharp.Editor/CodeLens/CodeLensGeneralTagger.fs b/vsintegration/src/FSharp.Editor/CodeLens/CodeLensGeneralTagger.fs index 3d3a2a61f5..9ed05edf0a 100644 --- a/vsintegration/src/FSharp.Editor/CodeLens/CodeLensGeneralTagger.fs +++ b/vsintegration/src/FSharp.Editor/CodeLens/CodeLensGeneralTagger.fs @@ -25,9 +25,9 @@ type CodeLensGeneralTagger (view, buffer) as self = let tagsChangedEvent = new Event,SnapshotSpanEventArgs>() /// Layouts all stack panels on the line - override self.layoutUIElementOnLine (view:IWpfTextView) (line:ITextViewLine) (ui:Grid) = + override self.LayoutUIElementOnLine (view:IWpfTextView) (line:ITextViewLine) (ui:Grid) = let left, top = - match self.uiElementNeighbour.TryGetValue ui with + match self.UiElementNeighbour.TryGetValue ui with | true, parent -> let left = Canvas.GetLeft parent let top = Canvas.GetTop parent @@ -57,13 +57,13 @@ type CodeLensGeneralTagger (view, buffer) as self = Canvas.SetLeft(ui, left) Canvas.SetTop(ui, top) - override self.asyncCustomLayoutOperation _ _ = + override self.AsyncCustomLayoutOperation _ _ = asyncMaybe { // Suspend 16 ms, instantly applying the layout to the adornment elements isn't needed // and would consume too much performance do! Async.Sleep(16) |> liftAsync // Skip at least one frames - do! Async.SwitchToContext self.uiContext |> liftAsync - let layer = self.codeLensLayer + do! Async.SwitchToContext self.UiContext |> liftAsync + let layer = self.CodeLensLayer do! Async.Sleep(495) |> liftAsync @@ -84,10 +84,10 @@ type CodeLensGeneralTagger (view, buffer) as self = match line.GetAdornmentTags self |> Seq.tryHead with | Some (:? seq as stackPanels) -> for stackPanel in stackPanels do - if stackPanel |> self.addedAdornments.Contains |> not then + if stackPanel |> self.AddedAdornments.Contains |> not then layer.AddAdornment(AdornmentPositioningBehavior.OwnerControlled, Nullable(), self, stackPanel, AdornmentRemovedCallback(fun _ _ -> ())) |> ignore - self.addedAdornments.Add stackPanel |> ignore + self.AddedAdornments.Add stackPanel |> ignore | _ -> () with e -> logExceptionWithContext (e, "LayoutChanged, processing new visible lines") } |> Async.Ignore @@ -115,13 +115,13 @@ type CodeLensGeneralTagger (view, buffer) as self = try snapshot.GetLineNumberFromPosition(span.Start.Position) with e -> logExceptionWithContext (e, "line number tagging"); 0 - if self.trackingSpans.ContainsKey(lineNumber) && self.trackingSpans.[lineNumber] |> Seq.isEmpty |> not then + if self.TrackingSpans.ContainsKey(lineNumber) && self.TrackingSpans.[lineNumber] |> Seq.isEmpty |> not then let tagSpan = snapshot.GetLineFromLineNumber(lineNumber).Extent let stackPanels = - self.trackingSpans.[lineNumber] + self.TrackingSpans.[lineNumber] |> Seq.map (fun trackingSpan -> - let success, res = self.uiElements.TryGetValue trackingSpan + let success, res = self.UiElements.TryGetValue trackingSpan if success then res else null ) |> Seq.filter (isNull >> not) diff --git a/vsintegration/src/FSharp.Editor/CodeLens/FSharpCodeLensService.fs b/vsintegration/src/FSharp.Editor/CodeLens/FSharpCodeLensService.fs index 9be718fed9..2d9484ec26 100644 --- a/vsintegration/src/FSharp.Editor/CodeLens/FSharpCodeLensService.fs +++ b/vsintegration/src/FSharp.Editor/CodeLens/FSharpCodeLensService.fs @@ -130,17 +130,6 @@ type internal FSharpCodeLensService return false } - let StartAsyncSafe cancellationToken context computation = - let computation = - async { - try - return! computation - with e -> - logExceptionWithContext(e, context) - return Unchecked.defaultof<_> - } - Async.Start (computation, cancellationToken) - let executeCodeLenseAsync () = asyncMaybe { do! Async.Sleep 800 |> liftAsync @@ -171,7 +160,7 @@ type internal FSharpCodeLensService let lineNumber = Line.toZ func.DeclarationLocation.StartLine if (lineNumber >= 0 || lineNumber < textSnapshot.LineCount) then match func.FullTypeSafe with - | Some ty -> + | Some _ -> let! displayEnv = checkFileResults.GetDisplayEnvForPos func.DeclarationLocation.Start let displayContext = @@ -326,7 +315,7 @@ type internal FSharpCodeLensService else logWarningf "Couldn't retrieve code lens information for %A" codeLens.FullTypeSignature // logInfo "Adding text box!" - } |> StartAsyncSafe CancellationToken.None "UIElement creation" + } |> (RoslynHelpers.StartAsyncSafe CancellationToken.None) "UIElement creation" for value in tagsToUpdate do let trackingSpan, (newTrackingSpan, _, codeLens) = value.Key, value.Value @@ -381,5 +370,5 @@ type internal FSharpCodeLensService bufferChangedCts.Cancel() // Stop all ongoing async workflow. bufferChangedCts.Dispose() bufferChangedCts <- new CancellationTokenSource() - executeCodeLenseAsync () |> Async.Ignore |> RoslynHelpers.StartAsyncSafe bufferChangedCts.Token + executeCodeLenseAsync () |> Async.Ignore |> RoslynHelpers.StartAsyncSafe bufferChangedCts.Token "Buffer Changed" diff --git a/vsintegration/src/FSharp.Editor/CodeLens/LineLensDisplayService.fs b/vsintegration/src/FSharp.Editor/CodeLens/LineLensDisplayService.fs index be49b79d03..138c5ac785 100644 --- a/vsintegration/src/FSharp.Editor/CodeLens/LineLensDisplayService.fs +++ b/vsintegration/src/FSharp.Editor/CodeLens/LineLensDisplayService.fs @@ -17,9 +17,9 @@ type internal LineLensDisplayService (view, buffer) = inherit CodeLensDisplayService(view, buffer, "LineLens") /// Layouts all stack panels on the line - override self.layoutUIElementOnLine _ (line:ITextViewLine) (ui:Grid) = + override self.LayoutUIElementOnLine _ (line:ITextViewLine) (ui:Grid) = let left, top = - match self.uiElementNeighbour.TryGetValue ui with + match self.UiElementNeighbour.TryGetValue ui with | true, parent -> let left = Canvas.GetLeft parent let top = Canvas.GetTop parent @@ -35,33 +35,33 @@ type internal LineLensDisplayService (view, buffer) = Canvas.SetLeft(ui, left) Canvas.SetTop(ui, top) - override self.asyncCustomLayoutOperation visibleLineNumbers buffer = + override self.AsyncCustomLayoutOperation visibleLineNumbers buffer = asyncMaybe { // Suspend 5 ms, instantly applying the layout to the adornment elements isn't needed // and would consume too much performance do! Async.Sleep(5) |> liftAsync // Skip at least one frames - do! Async.SwitchToContext self.uiContext |> liftAsync - let layer = self.codeLensLayer + do! Async.SwitchToContext self.UiContext |> liftAsync + let layer = self.CodeLensLayer do! Async.Sleep(495) |> liftAsync try for visibleLineNumber in visibleLineNumbers do - if self.trackingSpans.ContainsKey visibleLineNumber then - self.trackingSpans.[visibleLineNumber] + if self.TrackingSpans.ContainsKey visibleLineNumber then + self.TrackingSpans.[visibleLineNumber] |> Seq.map (fun trackingSpan -> - let success, res = self.uiElements.TryGetValue trackingSpan + let success, res = self.UiElements.TryGetValue trackingSpan if success then res else null ) - |> Seq.filter (fun ui -> not(isNull ui) && not(self.addedAdornments.Contains ui)) + |> Seq.filter (fun ui -> not(isNull ui) && not(self.AddedAdornments.Contains ui)) |> Seq.iter(fun grid -> layer.AddAdornment(AdornmentPositioningBehavior.OwnerControlled, Nullable(), - self, grid, AdornmentRemovedCallback(fun _ _ -> self.addedAdornments.Remove grid |> ignore)) |> ignore - self.addedAdornments.Add grid |> ignore + self, grid, AdornmentRemovedCallback(fun _ _ -> self.AddedAdornments.Remove grid |> ignore)) |> ignore + self.AddedAdornments.Add grid |> ignore let line = let l = buffer.GetLineFromLineNumber visibleLineNumber view.GetTextViewLineContainingBufferPosition l.Start - self.layoutUIElementOnLine view line grid + self.LayoutUIElementOnLine view line grid ) with e -> logExceptionWithContext (e, "LayoutChanged, processing new visible lines") } |> Async.Ignore \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/Common/RoslynHelpers.fs b/vsintegration/src/FSharp.Editor/Common/RoslynHelpers.fs index 880d14362c..141a7657d8 100644 --- a/vsintegration/src/FSharp.Editor/Common/RoslynHelpers.fs +++ b/vsintegration/src/FSharp.Editor/Common/RoslynHelpers.fs @@ -15,6 +15,7 @@ open Microsoft.FSharp.Compiler.Layout open Microsoft.FSharp.Compiler.SourceCodeServices open Microsoft.FSharp.Compiler.Range open Microsoft.VisualStudio.FSharp.LanguageService +open Microsoft.VisualStudio.FSharp.Editor.Logging [] module internal RoslynHelpers = @@ -159,19 +160,18 @@ module internal RoslynHelpers = let linePositionSpan = LinePositionSpan(LinePosition(Line.toZ r.StartLine, r.StartColumn), LinePosition(Line.toZ r.EndLine, r.EndColumn)) let textSpan = sourceText.Lines.GetTextSpan linePositionSpan Location.Create(filePath, textSpan, linePositionSpan) - - let StartAsyncSafe cancellationToken computation = + + let StartAsyncSafe cancellationToken context computation = let computation = async { try return! computation with e -> - Assert.Exception(e) + logExceptionWithContext(e, context) return Unchecked.defaultof<_> } Async.Start (computation, cancellationToken) - module internal OpenDeclarationHelper = /// /// Inserts open declaration into `SourceText`. From 453df4d797c046a3c5ffc286454bda95d9888ec6 Mon Sep 17 00:00:00 2001 From: Gen Lu Date: Fri, 30 Mar 2018 13:29:27 -0700 Subject: [PATCH 006/150] Update AssemblyVersions.props (#4647) --- build/targets/AssemblyVersions.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/targets/AssemblyVersions.props b/build/targets/AssemblyVersions.props index 63e5f4426c..24596a9d90 100644 --- a/build/targets/AssemblyVersions.props +++ b/build/targets/AssemblyVersions.props @@ -22,7 +22,7 @@ 4.4.3.0 10.1.1.0 10.1.4 - 15.7.0.0 + 15.8.0.0 $(FSCoreVersion) From 9e5e058eb84bebfa0f1ed91bbcba9ade4f3f90e2 Mon Sep 17 00:00:00 2001 From: dotnet bot Date: Fri, 13 Apr 2018 18:48:50 -0700 Subject: [PATCH 007/150] Reduced allocation by reading from a stream into an array for ILResource (#4689) (#4721) * Reduced allocation by reading from a stream into an array for ILResource * GetRawFSharpSignatureData is now lazy getting bytes. This is what GetRawFSharpOptimizationData does * Using File.ReadBinaryChunk --- src/absil/il.fs | 3 ++- src/absil/illib.fs | 2 +- src/fsharp/CompileOps.fs | 11 +++++------ src/fsharp/CompileOps.fsi | 2 +- src/fsharp/service/IncrementalBuild.fs | 3 +-- 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/absil/il.fs b/src/absil/il.fs index 32e1812c52..ae24b2dc86 100644 --- a/src/absil/il.fs +++ b/src/absil/il.fs @@ -8,6 +8,7 @@ module Microsoft.FSharp.Compiler.AbstractIL.IL open System +open System.IO open System.Collections open System.Collections.Generic open System.Collections.Concurrent @@ -1986,7 +1987,7 @@ type ILResource = member r.GetBytes() = match r.Location with | ILResourceLocation.LocalIn (file, start, len) -> - FileSystem.ReadAllBytesShim(file).[start .. start + len - 1] + File.ReadBinaryChunk(file, start, len) | ILResourceLocation.LocalOut bytes -> bytes | _ -> failwith "GetBytes" diff --git a/src/absil/illib.fs b/src/absil/illib.fs index 01aa270788..877ba1d1e2 100644 --- a/src/absil/illib.fs +++ b/src/absil/illib.fs @@ -1291,7 +1291,7 @@ module Shim = static member ReadBinaryChunk (fileName, start, len) = use stream = FileSystem.FileStreamReadShim fileName stream.Seek(int64 start, SeekOrigin.Begin) |> ignore - let buffer = Array.zeroCreate len + let buffer = Array.zeroCreate len let mutable n = 0 while n < len do n <- n + stream.Read(buffer, n, len-n) diff --git a/src/fsharp/CompileOps.fs b/src/fsharp/CompileOps.fs index 144fd3a65c..5398db121b 100644 --- a/src/fsharp/CompileOps.fs +++ b/src/fsharp/CompileOps.fs @@ -2098,7 +2098,7 @@ type IRawFSharpAssemblyData = /// in the language service abstract TryGetILModuleDef : unit -> ILModuleDef option /// The raw F# signature data in the assembly, if any - abstract GetRawFSharpSignatureData : range * ilShortAssemName: string * fileName: string -> (string * byte[]) list + abstract GetRawFSharpSignatureData : range * ilShortAssemName: string * fileName: string -> (string * (unit -> byte[])) list /// The raw F# optimization data in the assembly, if any abstract GetRawFSharpOptimizationData : range * ilShortAssemName: string * fileName: string -> (string * (unit -> byte[])) list /// The table of type forwarders in the assembly @@ -3795,7 +3795,7 @@ let PickleToResource inMem file g scope rname p x = MetadataIndex = NoMetadataIdx } let GetSignatureData (file, ilScopeRef, ilModule, byteReader) : PickledDataWithReferences = - unpickleObjWithDanglingCcus file ilScopeRef ilModule unpickleCcuInfo byteReader + unpickleObjWithDanglingCcus file ilScopeRef ilModule unpickleCcuInfo (byteReader()) let WriteSignatureData (tcConfig: TcConfig, tcGlobals, exportRemapping, ccu: CcuThunk, file, inMem) : ILResource = let mspec = ccu.Contents @@ -3831,16 +3831,15 @@ type RawFSharpAssemblyDataBackedByFileOnDisk (ilModule: ILModuleDef, ilAssemblyR let sigDataReaders = [ for iresource in resources do if IsSignatureDataResource iresource then - let ccuName = GetSignatureDataResourceName iresource - let bytes = iresource.GetBytes() - yield (ccuName, bytes) ] + let ccuName = GetSignatureDataResourceName iresource + yield (ccuName, fun () -> iresource.GetBytes()) ] let sigDataReaders = if sigDataReaders.IsEmpty && List.contains ilShortAssemName externalSigAndOptData then let sigFileName = Path.ChangeExtension(filename, "sigdata") if not (FileSystem.SafeExists sigFileName) then error(Error(FSComp.SR.buildExpectedSigdataFile (FileSystem.GetFullPathShim sigFileName), m)) - [ (ilShortAssemName, FileSystem.ReadAllBytesShim sigFileName)] + [ (ilShortAssemName, fun () -> FileSystem.ReadAllBytesShim sigFileName)] else sigDataReaders sigDataReaders diff --git a/src/fsharp/CompileOps.fsi b/src/fsharp/CompileOps.fsi index 50f2add519..b7ceb11c41 100755 --- a/src/fsharp/CompileOps.fsi +++ b/src/fsharp/CompileOps.fsi @@ -149,7 +149,7 @@ type IRawFSharpAssemblyData = abstract HasAnyFSharpSignatureDataAttribute: bool abstract HasMatchingFSharpSignatureDataAttribute: ILGlobals -> bool /// The raw F# signature data in the assembly, if any - abstract GetRawFSharpSignatureData: range * ilShortAssemName: string * fileName: string -> (string * byte[]) list + abstract GetRawFSharpSignatureData: range * ilShortAssemName: string * fileName: string -> (string * (unit -> byte[])) list /// The raw F# optimization data in the assembly, if any abstract GetRawFSharpOptimizationData: range * ilShortAssemName: string * fileName: string -> (string * (unit -> byte[])) list /// The table of type forwarders in the assembly diff --git a/src/fsharp/service/IncrementalBuild.fs b/src/fsharp/service/IncrementalBuild.fs index 494ad478f3..b1533ea889 100755 --- a/src/fsharp/service/IncrementalBuild.fs +++ b/src/fsharp/service/IncrementalBuild.fs @@ -1172,8 +1172,7 @@ type RawFSharpAssemblyDataBackedByLanguageService (tcConfig, tcGlobals, tcState: let _sigDataAttributes, sigDataResources = Driver.EncodeInterfaceData(tcConfig, tcGlobals, exportRemapping, generatedCcu, outfile, true) [ for r in sigDataResources do let ccuName = GetSignatureDataResourceName r - let bytes = r.GetBytes() - yield (ccuName, bytes) ] + yield (ccuName, (fun () -> r.GetBytes())) ] let autoOpenAttrs = topAttrs.assemblyAttrs |> List.choose (List.singleton >> TryFindFSharpStringAttribute tcGlobals tcGlobals.attrib_AutoOpenAttribute) let ivtAttrs = topAttrs.assemblyAttrs |> List.choose (List.singleton >> TryFindFSharpStringAttribute tcGlobals tcGlobals.attrib_InternalsVisibleToAttribute) From 5c2e85e9d3db345ed4270ab4444014eb77d78b29 Mon Sep 17 00:00:00 2001 From: dotnet bot Date: Thu, 19 Apr 2018 09:53:00 -0700 Subject: [PATCH 008/150] Sign nupkgs (#4748) From 2544d9125ec6480af5a3c59f00ca565543868802 Mon Sep 17 00:00:00 2001 From: dotnet bot Date: Thu, 19 Apr 2018 17:36:15 -0700 Subject: [PATCH 009/150] Merge master to dev15.8 (#4749) * remove DiaSymReader package dependencies since they're not used * Fix #4534 - build with spaces in path (#4724) * build fixes for spaces in path --- FSharpTests.Directory.Build.targets | 2 - build.cmd | 8 +- src/FSharpSource.Settings.targets | 4 + src/buildfromsource.cmd | 12 +- src/buildfromsource/BuildFromSource.targets | 2 +- .../FSharp.Compiler.Private.fsproj | 276 ++++++++++-------- tests/scripts/compiler-perf-results.txt | 3 + 7 files changed, 166 insertions(+), 141 deletions(-) diff --git a/FSharpTests.Directory.Build.targets b/FSharpTests.Directory.Build.targets index 112d5abbe2..e5b000ce51 100644 --- a/FSharpTests.Directory.Build.targets +++ b/FSharpTests.Directory.Build.targets @@ -12,8 +12,6 @@ - - diff --git a/build.cmd b/build.cmd index b1dd088c0a..15c5b7d891 100644 --- a/build.cmd +++ b/build.cmd @@ -643,7 +643,7 @@ if "%RestorePackages%" == "true" ( ) if not "%SIGN_TYPE%" == "" ( - set signtoolnugetoptions=-PackagesDirectory %USERPROFILE%\.nuget\packages -ConfigFile %_nugetconfig% + set signtoolnugetoptions=-PackagesDirectory "%USERPROFILE%\.nuget\packages" -ConfigFile %_nugetconfig% if not "%PB_RESTORESOURCE%" == "" set signtoolnugetoptions=!signtoolnugetoptions! -FallbackSource %PB_RESTORESOURCE% %_nugetexe% restore build\config\packages.config !signtoolnugetoptions! @if ERRORLEVEL 1 echo Error: Nuget restore failed && goto :failure @@ -661,7 +661,7 @@ if "%RestorePackages%" == "true" ( if "%NEEDS_DOTNET_CLI_TOOLS%" == "1" ( :: Restore the Tools directory - call %~dp0init-tools.cmd + call "%~dp0init-tools.cmd" ) set _dotnetcliexe=%~dp0Tools\dotnetcli\dotnet.exe set _dotnet20exe=%~dp0Tools\dotnet20\dotnet.exe @@ -785,8 +785,8 @@ echo ---------------- Done with build, starting assembly version checks -------- set asmvercheckpath=%~dp0tests\fsharpqa\testenv\src\AssemblyVersionCheck if "%BUILD_NET40%" == "1" ( - echo "%~dp0%BUILD_CONFIG%\net40\bin\fsi.exe" %asmvercheckpath%\AssemblyVersionCheck.fsx -- "%~dp0build\config\AssemblySignToolData.json" "%~dp0%BUILD_CONFIG%" - "%~dp0%BUILD_CONFIG%\net40\bin\fsi.exe" %asmvercheckpath%\AssemblyVersionCheck.fsx -- "%~dp0build\config\AssemblySignToolData.json" "%~dp0%BUILD_CONFIG%" + echo "%~dp0%BUILD_CONFIG%\net40\bin\fsi.exe" "%asmvercheckpath%\AssemblyVersionCheck.fsx" -- "%~dp0build\config\AssemblySignToolData.json" "%~dp0%BUILD_CONFIG%" + "%~dp0%BUILD_CONFIG%\net40\bin\fsi.exe" "%asmvercheckpath%\AssemblyVersionCheck.fsx" -- "%~dp0build\config\AssemblySignToolData.json" "%~dp0%BUILD_CONFIG%" if ERRORLEVEL 1 echo Error verifying assembly versions and commit hashes. && goto :failure ) diff --git a/src/FSharpSource.Settings.targets b/src/FSharpSource.Settings.targets index 8dc0560e25..6ecd5f0612 100644 --- a/src/FSharpSource.Settings.targets +++ b/src/FSharpSource.Settings.targets @@ -94,6 +94,10 @@ 15.3.23 15.3.15 + + obj\$(Configuration)\$(TargetDotnetProfile)\ + obj\$(Configuration)\$(TargetDotnetProfile)\$(PortableProfileBeingReferenced)\ + 4.1.19 4.1 diff --git a/src/buildfromsource.cmd b/src/buildfromsource.cmd index 3cb67b19a3..ed0892e4e0 100644 --- a/src/buildfromsource.cmd +++ b/src/buildfromsource.cmd @@ -3,19 +3,19 @@ set __scriptpath=%~dp0 rem build tools -dotnet restore %__scriptpath%buildtools\fslex\fslex.fsproj +dotnet restore "%__scriptpath%buildtools\fslex\fslex.fsproj" if ERRORLEVEL 1 echo Error: failed && goto :failure -dotnet publish %__scriptpath%buildtools\fslex\fslex.fsproj -o %__scriptpath%..\Tools\fslex +dotnet publish "%__scriptpath%buildtools\fslex\fslex.fsproj" -o "%__scriptpath%..\Tools\fslex" if ERRORLEVEL 1 echo Error: failed && goto :failure -dotnet restore %__scriptpath%buildtools\fsyacc\fsyacc.fsproj +dotnet restore "%__scriptpath%buildtools\fsyacc\fsyacc.fsproj" if ERRORLEVEL 1 echo Error: failed && goto :failure -dotnet publish %__scriptpath%buildtools\fsyacc\fsyacc.fsproj -o %__scriptpath%..\Tools\fsyacc +dotnet publish "%__scriptpath%buildtools\fsyacc\fsyacc.fsproj" -o "%__scriptpath%..\Tools\fsyacc" if ERRORLEVEL 1 echo Error: failed && goto :failure rem build and pack tools -dotnet restore %__scriptpath%buildfromsource\FSharp.Compiler.nuget\FSharp.Compiler.nuget.fsproj +dotnet restore "%__scriptpath%buildfromsource\FSharp.Compiler.nuget\FSharp.Compiler.nuget.fsproj" if ERRORLEVEL 1 echo Error: failed && goto :failure -dotnet pack %__scriptpath%buildfromsource\FSharp.Compiler.nuget\FSharp.Compiler.nuget.fsproj -c Release +dotnet pack "%__scriptpath%buildfromsource\FSharp.Compiler.nuget\FSharp.Compiler.nuget.fsproj" -c Release if ERRORLEVEL 1 echo Error: failed && goto :failure goto :success diff --git a/src/buildfromsource/BuildFromSource.targets b/src/buildfromsource/BuildFromSource.targets index cd4f63874a..98612399b1 100644 --- a/src/buildfromsource/BuildFromSource.targets +++ b/src/buildfromsource/BuildFromSource.targets @@ -15,7 +15,7 @@ $(MSBuildThisFileDirectory)../buildtools/keys/MSFT.snk true - $(OtherFlags) --publicsign --keyfile:$(KeyFile) + $(OtherFlags) --publicsign --keyfile:"$(KeyFile)" $(OtherFlags) --nocopyfsharpcore dotnet diff --git a/src/buildfromsource/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj b/src/buildfromsource/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj index ca2ff7e24c..6e863bbdef 100644 --- a/src/buildfromsource/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj +++ b/src/buildfromsource/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj @@ -19,7 +19,7 @@ FSComp.resx - + FSStrings.resx @@ -36,10 +36,10 @@ ErrorText\sformat.fs - + ErrorText\sr.fsi - + ErrorText\sr.fs @@ -108,37 +108,37 @@ Utilities\bytes.fs - + Utilities\InternalCollections.fsi - + Utilities\InternalCollections.fs - + Utilities\QueueList.fs - + Utilities\lib.fs - + Utilities\rational.fsi - + Utilities\rational.fs - + ErrorLogging\range.fsi - + ErrorLogging\range.fs - + ErrorLogging\ErrorLogger.fs - + ErrorLogging\ErrorResolutionHints.fs - + ReferenceResolution\ReferenceResolver.fs @@ -224,7 +224,7 @@ CompilerLocation\CompilerLocationUtils.fs - + PrettyNaming\PrettyNaming.fs @@ -242,35 +242,35 @@ ILXErase\EraseUnions.fs - + --unicode --lexlib Internal.Utilities.Text.Lexing ParserAndUntypedAST\pplex.fsl - + --module Microsoft.FSharp.Compiler.PPParser --open Microsoft.FSharp.Compiler --internal --lexlib Internal.Utilities.Text.Lexing --parslib Internal.Utilities.Text.Parsing ParserAndUntypedAST\pppars.fsy - + --unicode --lexlib Internal.Utilities.Text.Lexing ParserAndUntypedAST\lex.fsl - + --module Microsoft.FSharp.Compiler.Parser --open Microsoft.FSharp.Compiler --internal --lexlib Internal.Utilities.Text.Lexing --parslib Internal.Utilities.Text.Parsing ParserAndUntypedAST\pars.fsy - + ParserAndUntypedAST\UnicodeLexing.fsi - + ParserAndUntypedAST\UnicodeLexing.fs - + ParserAndUntypedAST\layout.fsi - + ParserAndUntypedAST\layout.fs - + ParserAndUntypedAST\ast.fs @@ -279,10 +279,10 @@ ParserAndUntypedAST\pars.fs - + ParserAndUntypedAST\lexhelp.fsi - + ParserAndUntypedAST\lexhelp.fs @@ -291,309 +291,309 @@ ParserAndUntypedAST\lex.fs - + ParserAndUntypedAST\lexfilter.fs - + TypedAST\tainted.fsi - + TypedAST\tainted.fs - + TypedAST\ExtensionTyping.fsi - + TypedAST\ExtensionTyping.fs - + TypedAST\QuotationPickler.fsi - + TypedAST\QuotationPickler.fs - + TypedAST\tast.fs - + TypedAST\TcGlobals.fs - + TypedAST\TastOps.fsi - + TypedAST\TastOps.fs - + TypedAST\TastPickle.fsi - + TypedAST\TastPickle.fs - + Logic\import.fsi - + Logic\import.fs - + Logic\infos.fs - + Logic\AccessibilityLogic.fs - + Logic\AttributeChecking.fs - + Logic\InfoReader.fs - + Logic\NicePrint.fs - + Logic\AugmentWithHashCompare.fsi - + Logic\AugmentWithHashCompare.fs - + Logic\NameResolution.fsi - + Logic\NameResolution.fs - + Logic\TypeRelations.fs - + Logic\SignatureConformance.fs - + Logic\MethodOverrides.fs - + Logic\MethodCalls.fs - + Logic\PatternMatchCompilation.fsi - + Logic\PatternMatchCompilation.fs - + Logic\ConstraintSolver.fsi - + Logic\ConstraintSolver.fs - + Logic\CheckFormatStrings.fsi - + Logic\CheckFormatStrings.fs - + Logic\FindUnsolved.fs - + Logic\QuotationTranslator.fsi - + Logic\QuotationTranslator.fs - + Logic\PostInferenceChecks.fsi - + Logic\PostInferenceChecks.fs - + Logic\TypeChecker.fsi - + Logic\TypeChecker.fs - + Optimize\Optimizer.fsi - + Optimize\Optimizer.fs - + Optimize\DetupleArgs.fsi - + Optimize\DetupleArgs.fs - + Optimize\InnerLambdasToTopLevelFuncs.fsi - + Optimize\InnerLambdasToTopLevelFuncs.fs - + Optimize\LowerCallsAndSeqs.fs - + Optimize\autobox.fs - + CodeGen\IlxGen.fsi - + CodeGen\IlxGen.fs - + Driver\CompileOps.fsi - + Driver\CompileOps.fs - + Driver\CompileOptions.fsi - + Driver\CompileOptions.fs - + Driver\fsc.fsi - + Driver\fsc.fs - + Symbols/SymbolHelpers.fsi - + Symbols/SymbolHelpers.fs - + Symbols/Symbols.fsi - + Symbols/Symbols.fs - + Symbols/Exprs.fsi - + Symbols/Exprs.fs - + Symbols/SymbolPatterns.fsi - + Symbols/SymbolPatterns.fs - + Service/IncrementalBuild.fsi - + Service/IncrementalBuild.fs - + Service/Reactor.fsi - + Service/Reactor.fs - + Service/ServiceConstants.fs - + Service/ServiceDeclarationLists.fsi - + Service/ServiceDeclarationLists.fs - + Service/ServiceLexing.fsi - + Service/ServiceLexing.fs - + Service/ServiceParseTreeWalk.fs - + Service/ServiceNavigation.fsi - + Service/ServiceNavigation.fs - + Service/ServiceParamInfoLocations.fsi - + Service/ServiceParamInfoLocations.fs - + Service/ServiceUntypedParse.fsi - + Service/ServiceUntypedParse.fs - + Service/ServiceAssemblyContent.fsi - + Service/ServiceAssemblyContent.fs - + Service/ServiceXmlDocParser.fsi - + Service/ServiceXmlDocParser.fs Service/reshapedmsbuild.fs - + Service/SimulatedMSBuildReferenceResolver.fs - + Service/ExternalSymbol.fsi - + Service/ExternalSymbol.fs - + Service/QuickParse.fsi - + Service/QuickParse.fs - + Service/service.fsi - + Service/service.fs - + Service/ServiceInterfaceStubGenerator.fsi - + Service/ServiceInterfaceStubGenerator.fs - + Service/ServiceStructure.fsi - + Service/ServiceStructure.fs - + Service/ServiceAnalysis.fsi - + Service/ServiceAnalysis.fs @@ -601,18 +601,18 @@ FSIstrings.resx - + InteractiveSession\fsi.fsi - + InteractiveSession\fsi.fs - + Misc/MSBuildReferenceResolver.fs - + Misc/LegacyHostedCompilerForTesting.fs @@ -641,4 +641,24 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/tests/scripts/compiler-perf-results.txt b/tests/scripts/compiler-perf-results.txt index f8fd0b2492..fabdbd6f88 100644 --- a/tests/scripts/compiler-perf-results.txt +++ b/tests/scripts/compiler-perf-results.txt @@ -144,3 +144,6 @@ https://github.com/Microsoft/visualfsharp master 65d8 https://github.com/Microsoft/visualfsharp master ff078e94deff66e548efb668465fcdd601cc158d ff078e94deff66e548efb668465fcdd601cc158d MSRC-3617253 262.60 10.60 34.99 47.73 59.08 58.46 https://github.com/AviAvni/visualfsharp.git fcs-memory-3 d91dbc81ce304a88a4e3c07032781421c71e3bab ff078e94deff66e548efb668465fcdd601cc158d MSRC-3617253 263.83 10.70 35.24 47.30 59.09 59.14 +https://github.com/AviAvni/visualfsharp.git fcs-memory-3 d91dbc81ce304a88a4e3c07032781421c71e3bab 284cb2ff115adb8ff5b1febe1c305a10c933172e MSRC-3617253 263.53 10.34 35.19 48.32 58.79 59.08 +https://github.com/dsyme/visualfsharp.git range1 46be8bee06180324b63a3b808cf4a90492a5f095 284cb2ff115adb8ff5b1febe1c305a10c933172e MSRC-3617253 262.84 10.55 35.17 48.54 59.51 59.15 +https://github.com/Microsoft/visualfsharp master 284cb2ff115adb8ff5b1febe1c305a10c933172e 284cb2ff115adb8ff5b1febe1c305a10c933172e MSRC-3617253 262.07 10.58 34.79 48.58 58.51 58.31 From 2bd48e8575e747b64a328c1179cf73d75a0590d7 Mon Sep 17 00:00:00 2001 From: dotnet bot Date: Tue, 8 May 2018 09:42:32 -0700 Subject: [PATCH 010/150] Fix #3737 - allow inheriting from FSharpFunc (#4804) (#4853) * allow inheriting from FSharpFunc * allow inheriting from FSharpFunc * fix #4569 * fix tests * fix test * fix error --- src/fsharp/InfoReader.fs | 16 ++++--- src/fsharp/TastOps.fs | 6 ++- src/fsharp/TypeChecker.fs | 10 +++++ tests/fsharp/core/subtype/test.fsx | 45 +++++++++++++++++++ .../E_AreYouMissingAnArgumentToAFunction01.fs | 3 +- 5 files changed, 72 insertions(+), 8 deletions(-) diff --git a/src/fsharp/InfoReader.fs b/src/fsharp/InfoReader.fs index 9d37aaf9fa..baad78b4b1 100644 --- a/src/fsharp/InfoReader.fs +++ b/src/fsharp/InfoReader.fs @@ -68,11 +68,17 @@ let rec GetImmediateIntrinsicMethInfosOfTypeAux (optFilter,ad) g amap m origTy m mdefs |> List.map (fun mdef -> MethInfo.CreateILMeth(amap, m, origTy, mdef)) | FSharpOrArrayOrByrefOrTupleOrExnTypeMetadata -> - // Tuple types also support the properties Item1-8, Rest from the compiled tuple type + // Tuple types also support the methods get_Item1-8, get_Rest from the compiled tuple type. // In this case convert to the .NET Tuple type that carries metadata and try again if isAnyTupleTy g metadataTy then let betterMetadataTy = helpEnsureTypeHasMetadata g metadataTy GetImmediateIntrinsicMethInfosOfTypeAux (optFilter,ad) g amap m origTy betterMetadataTy + // Function types support methods FSharpFunc<_,_>.FromConverter and friends from .NET metadata, + // but not instance methods (you can't write "f.Invoke(x)", you have to write "f x") + elif isFunTy g metadataTy then + let betterMetadataTy = helpEnsureTypeHasMetadata g metadataTy + GetImmediateIntrinsicMethInfosOfTypeAux (optFilter,ad) g amap m origTy betterMetadataTy + |> List.filter (fun minfo -> not minfo.IsInstance) else match tryDestAppTy g metadataTy with | None -> [] @@ -158,7 +164,7 @@ let rec GetImmediateIntrinsicPropInfosOfTypeAux (optFilter,ad) g amap m origTy m | FSharpOrArrayOrByrefOrTupleOrExnTypeMetadata -> // Tuple types also support the properties Item1-8, Rest from the compiled tuple type // In this case convert to the .NET Tuple type that carries metadata and try again - if isAnyTupleTy g metadataTy then + if isAnyTupleTy g metadataTy || isFunTy g metadataTy then let betterMetadataTy = helpEnsureTypeHasMetadata g metadataTy GetImmediateIntrinsicPropInfosOfTypeAux (optFilter,ad) g amap m origTy betterMetadataTy else @@ -456,9 +462,9 @@ let rec GetIntrinsicConstructorInfosOfTypeAux (infoReader:InfoReader) m origTy m |> List.map (fun mdef -> MethInfo.CreateILMeth (amap, m, origTy, mdef)) | FSharpOrArrayOrByrefOrTupleOrExnTypeMetadata -> - // Tuple types also support the properties Item1-8, Rest from the compiled tuple type - // In this case convert to the .NET Tuple type that carries metadata and try again - if isAnyTupleTy g metadataTy then + // Tuple types also support constructors. In this case convert to the .NET Tuple type that carries metadata and try again + // Function types also support constructors. In this case convert to the FSharpFunc type that carries metadata and try again + if isAnyTupleTy g metadataTy || isFunTy g metadataTy then let betterMetadataTy = helpEnsureTypeHasMetadata g metadataTy GetIntrinsicConstructorInfosOfTypeAux infoReader m origTy betterMetadataTy else diff --git a/src/fsharp/TastOps.fs b/src/fsharp/TastOps.fs index 80e3dec9af..55dd3af045 100644 --- a/src/fsharp/TastOps.fs +++ b/src/fsharp/TastOps.fs @@ -799,9 +799,11 @@ let helpEnsureTypeHasMetadata g ty = if isAnyTupleTy g ty then let (tupInfo, tupElemTys) = destAnyTupleTy g ty mkOuterCompiledTupleTy g (evalTupInfoIsStruct tupInfo) tupElemTys + elif isFunTy g ty then + let (a,b) = destFunTy g ty + mkAppTy g.fastFunc_tcr [a; b] else ty - - + //--------------------------------------------------------------------------- // Equivalence of types up to alpha-equivalence //--------------------------------------------------------------------------- diff --git a/src/fsharp/TypeChecker.fs b/src/fsharp/TypeChecker.fs index 66fd8c1889..b2afcc0b0b 100755 --- a/src/fsharp/TypeChecker.fs +++ b/src/fsharp/TypeChecker.fs @@ -13285,6 +13285,7 @@ module MutRecBindingChecking = // Phase2B: typecheck the argument to an 'inherits' call and build the new object expr for the inherit-call | Phase2AInherit (synBaseTy, arg, baseValOpt, m) -> let baseTy, tpenv = TcType cenv NoNewTypars CheckCxs ItemOccurence.Use envInstance tpenv synBaseTy + let baseTy = baseTy |> helpEnsureTypeHasMetadata cenv.g let inheritsExpr, tpenv = TcNewExpr cenv envInstance tpenv baseTy (Some synBaseTy.Range) true arg m let envInstance = match baseValOpt with Some baseVal -> AddLocalVal cenv.tcSink scopem baseVal envInstance | None -> envInstance let envNonRec = match baseValOpt with Some baseVal -> AddLocalVal cenv.tcSink scopem baseVal envNonRec | None -> envNonRec @@ -15093,6 +15094,15 @@ module EstablishTypeDefinitionCores = | SynTypeDefnSimpleRepr.Enum _ -> Some(cenv.g.system_Enum_typ) + // Allow super type to be a function type but convert back to FSharpFunc to make sure it has metadata + // (We don't apply the same rule to tuple types, i.e. no F#-declared inheritors of those are permitted) + let super = + super |> Option.map (fun ty -> + if isFunTy cenv.g ty then + let (a,b) = destFunTy cenv.g ty + mkAppTy cenv.g.fastFunc_tcr [a; b] + else ty) + // Publish the super type tycon.TypeContents.tcaug_super <- super diff --git a/tests/fsharp/core/subtype/test.fsx b/tests/fsharp/core/subtype/test.fsx index c82441caaf..b33a35e5f8 100644 --- a/tests/fsharp/core/subtype/test.fsx +++ b/tests/fsharp/core/subtype/test.fsx @@ -1873,6 +1873,51 @@ module InferenceRegression4040C = printfn "%A" (Foo.Test 42) +module TestInheritFunc = + type Foo() = + inherit FSharpFunc() + override __.Invoke(a:int) = a + 1 + + check "cnwcki1" ((Foo() |> box |> unbox int> ) 5) 6 + +module TestInheritFuncGeneric = + type Foo<'T,'U>() = + inherit FSharpFunc<'T,'T>() + override __.Invoke(a:'T) = a + + check "cnwcki2" ((Foo() |> box |> unbox int> ) 5) 5 + + +module TestInheritFunc2 = + type Foo() = + inherit OptimizedClosures.FSharpFunc() + override f.Invoke(a:int) = (fun u -> f.Invoke(a,u)) + override __.Invoke(a:int,b:int) = a + b + 1 + + check "cnwcki3" ((Foo() |> box |> unbox int -> int> ) 5 6) 12 + +module TestInheritFunc3 = + type Foo() = + inherit OptimizedClosures.FSharpFunc() + override f.Invoke(t) = (fun u v -> f.Invoke(t,u,v)) + override __.Invoke(a:int,b:int,c:int) = a + b + c + 1 + + check "cnwcki4" ((Foo() |> box |> unbox int -> int -> int> ) 5 6 7) 19 + +#if !NETCOREAPP1_0 + +module TestConverter = + open System + + let fromConverter (f: Converter<'T1,'X>) = FSharp.Core.FSharpFunc.FromConverter f + let implicitConv (f: Converter<'T1,'X>) = FSharp.Core.FSharpFunc.op_Implicit f + let toConverter (f: 'T1 -> 'X) = FSharp.Core.FSharpFunc.ToConverter f + let toConverter2 (f: FSharpFunc<'T1, 'X>) = FSharp.Core.FSharpFunc.ToConverter f + + test "cenwceoiwe1" ((id |> toConverter |> fromConverter) 6 = 6) + test "cenwceoiwe2" ((id |> toConverter |> fromConverter |> toConverter2 |> implicitConv) 6 = 6) +#endif + #if TESTS_AS_APP let RUN() = !failures diff --git a/tests/fsharpqa/Source/Diagnostics/General/E_AreYouMissingAnArgumentToAFunction01.fs b/tests/fsharpqa/Source/Diagnostics/General/E_AreYouMissingAnArgumentToAFunction01.fs index 4a8ec32f1c..408fc71293 100644 --- a/tests/fsharpqa/Source/Diagnostics/General/E_AreYouMissingAnArgumentToAFunction01.fs +++ b/tests/fsharpqa/Source/Diagnostics/General/E_AreYouMissingAnArgumentToAFunction01.fs @@ -1,7 +1,8 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:2804 // Make sure we don't emit ?. (notice that the error message changed a bit since the bug was opened) -//Expecting a type supporting the operator 'op_Explicit' but given a function type\. You may be missing an argument to a function\.$ +//This expression was expected to have type +//This expression was expected to have type let f (x : int list) = int32 (x>>32) From 521e0a66ee51386caae0977e08065cb130c9b25b Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Mon, 14 May 2018 09:49:47 -0700 Subject: [PATCH 011/150] ensure primitive types are defined before auto-generated resources that might consume them --- src/buildfromsource/FSharp.Core/FSharp.Core.fsproj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/buildfromsource/FSharp.Core/FSharp.Core.fsproj b/src/buildfromsource/FSharp.Core/FSharp.Core.fsproj index 0cfe37a5cc..b807b3a0be 100644 --- a/src/buildfromsource/FSharp.Core/FSharp.Core.fsproj +++ b/src/buildfromsource/FSharp.Core/FSharp.Core.fsproj @@ -19,12 +19,12 @@ FSCore.resx - + Primitives/prim-types-prelude.fsi - - + + Primitives/prim-types-prelude.fs - + Primitives/SR.fs From c30b3f5799cf68e8fcae45b37ad23de2ca6aca07 Mon Sep 17 00:00:00 2001 From: TIHan Date: Mon, 14 May 2018 15:27:41 -0700 Subject: [PATCH 012/150] Removed updating project info on document open and document changed --- .../src/FSharp.Editor/LanguageService/LanguageService.fs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs index 8ebd33535e..4e38070ef5 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs @@ -57,10 +57,10 @@ type internal FSharpCheckerProvider let mmd = amd.GetModules().[0] let mmr = mmd.GetMetadataReader() - // "lifetime is timed to Metadata you got from the GetMetadata(). As long as you hold it strongly, raw + // "lifetime is timed to Metadata you got from the GetMetadata(…). As long as you hold it strongly, raw // memory we got from metadata reader will be alive. Once you are done, just let everything go and // let finalizer handle resource rather than calling Dispose from Metadata directly. It is shared metadata. - // You shouldnt dispose it directly." + // You shouldn’t dispose it directly." let objToHold = box md @@ -425,7 +425,6 @@ type internal FSharpLanguageService(package : FSharpPackage) = member private this.OnProjectAdded(projectId:ProjectId) = projectInfoManager.UpdateProjectInfoWithProjectId(projectId, "OnProjectAdded", invalidateConfig=true) member private this.OnProjectReloaded(projectId:ProjectId) = projectInfoManager.UpdateProjectInfoWithProjectId(projectId, "OnProjectReloaded", invalidateConfig=true) member private this.OnDocumentAdded(projectId:ProjectId, documentId:DocumentId) = projectInfoManager.UpdateDocumentInfoWithProjectId(projectId, documentId, "OnDocumentAdded", invalidateConfig=true) - member private this.OnDocumentChanged(projectId:ProjectId, documentId:DocumentId) = projectInfoManager.UpdateDocumentInfoWithProjectId(projectId, documentId, "OnDocumentChanged", invalidateConfig=false) member private this.OnDocumentReloaded(projectId:ProjectId, documentId:DocumentId) = projectInfoManager.UpdateDocumentInfoWithProjectId(projectId, documentId, "OnDocumentReloaded", invalidateConfig=true) override this.Initialize() = @@ -437,7 +436,6 @@ type internal FSharpLanguageService(package : FSharpPackage) = | WorkspaceChangeKind.ProjectAdded -> this.OnProjectAdded(args.ProjectId) | WorkspaceChangeKind.ProjectReloaded -> this.OnProjectReloaded(args.ProjectId) | WorkspaceChangeKind.DocumentAdded -> this.OnDocumentAdded(args.ProjectId, args.DocumentId) - | WorkspaceChangeKind.DocumentChanged -> this.OnDocumentChanged(args.ProjectId, args.DocumentId) | WorkspaceChangeKind.DocumentReloaded -> this.OnDocumentReloaded(args.ProjectId, args.DocumentId) | WorkspaceChangeKind.DocumentRemoved | WorkspaceChangeKind.ProjectRemoved @@ -672,8 +670,7 @@ type internal FSharpLanguageService(package : FSharpPackage) = if not (h.IsCapabilityMatch("CPS")) then let fileContents = VsTextLines.GetFileContents(textLines, textViewAdapter) this.SetupStandAloneFile(filename, fileContents, this.Workspace, hier) - | id -> - projectInfoManager.UpdateProjectInfoWithProjectId(id.ProjectId, "SetupNewTextView", invalidateConfig=true) + | _ -> () | _ -> let fileContents = VsTextLines.GetFileContents(textLines, textViewAdapter) this.SetupStandAloneFile(filename, fileContents, this.Workspace, hier) From bd69791a81ecc44c75dd47bb50ebb3df92ed9974 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Thu, 17 May 2018 16:32:40 -0700 Subject: [PATCH 013/150] re-add attribute that got lost in a merge somewhere --- vsintegration/src/FSharp.Editor/Options/EditorOptions.fs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs b/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs index 6167a94309..a2e2feb8dc 100644 --- a/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs +++ b/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs @@ -52,9 +52,11 @@ type CodeLensOptions = UseColors: bool Prefix : string } +[] type AdvancedOptions = { IsBlockStructureEnabled: bool IsOutliningEnabled: bool } + [)>] type internal Settings [](store: SettingsStore) = do // Initialize default settings From fa1cd8a0f662b32a6cd3b03fb0f70f4c0872d34b Mon Sep 17 00:00:00 2001 From: Phillip Carter Date: Mon, 21 May 2018 11:31:47 -0700 Subject: [PATCH 014/150] [15.8] Enable the codelens settings (#4950) * Enable the codelens settings * Update EditorOptions.fs * Gray out options when disabled * herp * Label experimental --- .../LanguageService/LanguageService.fs | 1 + .../FSharp.Editor/Options/EditorOptions.fs | 4 +- .../CodeLensOptionControl.xaml | 43 +++++++++++-------- .../src/FSharp.UIResources/Strings.resx | 3 +- .../src/FSharp.UIResources/xlf/Strings.cs.xlf | 4 +- .../src/FSharp.UIResources/xlf/Strings.de.xlf | 4 +- .../src/FSharp.UIResources/xlf/Strings.en.xlf | 4 +- .../src/FSharp.UIResources/xlf/Strings.es.xlf | 4 +- .../src/FSharp.UIResources/xlf/Strings.fr.xlf | 4 +- .../src/FSharp.UIResources/xlf/Strings.it.xlf | 4 +- .../src/FSharp.UIResources/xlf/Strings.ja.xlf | 4 +- .../src/FSharp.UIResources/xlf/Strings.ko.xlf | 4 +- .../src/FSharp.UIResources/xlf/Strings.pl.xlf | 4 +- .../FSharp.UIResources/xlf/Strings.pt-BR.xlf | 4 +- .../src/FSharp.UIResources/xlf/Strings.ru.xlf | 4 +- .../src/FSharp.UIResources/xlf/Strings.tr.xlf | 4 +- .../xlf/Strings.zh-Hans.xlf | 4 +- .../xlf/Strings.zh-Hant.xlf | 4 +- 18 files changed, 58 insertions(+), 49 deletions(-) diff --git a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs index ee3d66e9ed..26c4ea7e53 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs @@ -328,6 +328,7 @@ type internal FSharpCheckerWorkspaceServiceFactory [, "F#", null, "Code Fixes", "6010")>] [, "F#", null, "Performance", "6011")>] [, "F#", null, "Advanced", "6012")>] +[, "F#", null, "CodeLens", "6013")>] [] // 64 represents a hex number. It needs to be greater than 37 so the TextMate editor will not be chosen as higher priority. [, ".fs", 64)>] diff --git a/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs b/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs index a2e2feb8dc..9d5451e8ef 100644 --- a/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs +++ b/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs @@ -87,9 +87,9 @@ type internal Settings [](store: SettingsStore) = IsOutliningEnabled = true } store.RegisterDefault - { Enabled = true + { Enabled = false UseColors = false - ReplaceWithLineLens = true + ReplaceWithLineLens = true Prefix = "// " } interface ISettings diff --git a/vsintegration/src/FSharp.UIResources/CodeLensOptionControl.xaml b/vsintegration/src/FSharp.UIResources/CodeLensOptionControl.xaml index 955c105c7f..7e62f575fd 100644 --- a/vsintegration/src/FSharp.UIResources/CodeLensOptionControl.xaml +++ b/vsintegration/src/FSharp.UIResources/CodeLensOptionControl.xaml @@ -19,24 +19,31 @@ - - - - - - - - - + + + + + + + + + + + + + diff --git a/vsintegration/src/FSharp.UIResources/Strings.resx b/vsintegration/src/FSharp.UIResources/Strings.resx index 721e028dba..d8d0660c15 100644 --- a/vsintegration/src/FSharp.UIResources/Strings.resx +++ b/vsintegration/src/FSharp.UIResources/Strings.resx @@ -53,6 +53,7 @@ value : The object must be serialized with : System.Runtime.Serialization.Formatters.Soap.SoapFormatter : and then encoded with base64 encoding. + mimetype: application/x-microsoft.net.object.bytearray.base64 value : The object must be serialized into a byte array : using a System.ComponentModel.TypeConverter @@ -186,7 +187,7 @@ Show annotations to the right instead of above the line - Show type signature annotations in the editor + Enable CodeLens (Experimental) Annotation prefix diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf index 23594aa2a0..64f36038e2 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf @@ -118,8 +118,8 @@ - Show type signature annotations in the editor - Show type signature annotations in the editor + Enable CodeLens (Experimental) + Enable CodeLens (Experimental) diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf index 4a06b1b6f9..d02f0bcc0a 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf @@ -118,8 +118,8 @@ - Show type signature annotations in the editor - Show type signature annotations in the editor + Enable CodeLens (Experimental) + Enable CodeLens (Experimental) diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.en.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.en.xlf index 58e0be7f3e..e64366da69 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.en.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.en.xlf @@ -118,8 +118,8 @@ - Show type signature annotations in the editor - Show type signature annotations in the editor + Enable CodeLens (Experimental) + Enable CodeLens (Experimental) diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf index e2c4d5b911..ed976a6676 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf @@ -118,8 +118,8 @@ - Show type signature annotations in the editor - Show type signature annotations in the editor + Enable CodeLens (Experimental) + Enable CodeLens (Experimental) diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf index 791db1628f..1d052aa1c2 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf @@ -118,8 +118,8 @@ - Show type signature annotations in the editor - Show type signature annotations in the editor + Enable CodeLens (Experimental) + Enable CodeLens (Experimental) diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf index 7ec6526107..71a7c1c705 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf @@ -118,8 +118,8 @@ - Show type signature annotations in the editor - Show type signature annotations in the editor + Enable CodeLens (Experimental) + Enable CodeLens (Experimental) diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf index 983570100b..2a6a8d1cce 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf @@ -118,8 +118,8 @@ - Show type signature annotations in the editor - Show type signature annotations in the editor + Enable CodeLens (Experimental) + Enable CodeLens (Experimental) diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf index 37fe273ced..8909316936 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf @@ -118,8 +118,8 @@ - Show type signature annotations in the editor - Show type signature annotations in the editor + Enable CodeLens (Experimental) + Enable CodeLens (Experimental) diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf index fb7bcd1d16..7b440197e9 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf @@ -118,8 +118,8 @@ - Show type signature annotations in the editor - Show type signature annotations in the editor + Enable CodeLens (Experimental) + Enable CodeLens (Experimental) diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf index e4cd1e6d2e..764bb31eed 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf @@ -118,8 +118,8 @@ - Show type signature annotations in the editor - Show type signature annotations in the editor + Enable CodeLens (Experimental) + Enable CodeLens (Experimental) diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf index f8a7046f4c..176ca7882e 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf @@ -118,8 +118,8 @@ - Show type signature annotations in the editor - Show type signature annotations in the editor + Enable CodeLens (Experimental) + Enable CodeLens (Experimental) diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf index da4b3b409d..0a8fdb6e98 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf @@ -118,8 +118,8 @@ - Show type signature annotations in the editor - Show type signature annotations in the editor + Enable CodeLens (Experimental) + Enable CodeLens (Experimental) diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf index 0ac1cccdf3..62d03c75ac 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf @@ -118,8 +118,8 @@ - Show type signature annotations in the editor - Show type signature annotations in the editor + Enable CodeLens (Experimental) + Enable CodeLens (Experimental) diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf index bf7a84dec5..f1f1d69ca7 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf @@ -118,8 +118,8 @@ - Show type signature annotations in the editor - Show type signature annotations in the editor + Enable CodeLens (Experimental) + Enable CodeLens (Experimental) From 03724f9651b3eb3a832a6d06a79f49be6fac6190 Mon Sep 17 00:00:00 2001 From: Will Smith Date: Mon, 21 May 2018 14:50:39 -0700 Subject: [PATCH 015/150] Removing what looks like code to help debugging, but caused out of index exceptions (#4940) --- .../src/FSharp.Editor/InlineRename/InlineRenameService.fs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/vsintegration/src/FSharp.Editor/InlineRename/InlineRenameService.fs b/vsintegration/src/FSharp.Editor/InlineRename/InlineRenameService.fs index cde09f1dbe..9a03d6971f 100644 --- a/vsintegration/src/FSharp.Editor/InlineRename/InlineRenameService.fs +++ b/vsintegration/src/FSharp.Editor/InlineRename/InlineRenameService.fs @@ -53,12 +53,6 @@ type internal InlineRenameLocationSet(locations: InlineRenameLocation [], origin async { let! newSolution = applyChanges originalSolution (locations |> Array.toList |> List.groupBy (fun x -> x.Document)) - // > debug - let newDoc = newSolution.GetDocument(locations.[0].Document.Id) - let! newSource = newDoc.GetTextAsync(cancellationToken) |> Async.AwaitTask - let newText = newSource.ToString() - let _ = newText - // < debug return { new IInlineRenameReplacementInfo with member __.NewSolution = newSolution From c9c10e1c1c52d626b0899b275c94287b9d1dcce3 Mon Sep 17 00:00:00 2001 From: dotnet bot Date: Wed, 23 May 2018 16:37:27 -0700 Subject: [PATCH 016/150] No need to setify fully (#4975) (#4987) --- src/fsharp/TypeChecker.fs | 2 +- src/fsharp/lib.fs | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/fsharp/TypeChecker.fs b/src/fsharp/TypeChecker.fs index c3f4412a20..d1a1220a63 100755 --- a/src/fsharp/TypeChecker.fs +++ b/src/fsharp/TypeChecker.fs @@ -1631,7 +1631,7 @@ let ChooseCanonicalDeclaredTyparsAfterInference g denv declaredTypars m = let declaredTypars = NormalizeDeclaredTyparsForEquiRecursiveInference g declaredTypars - if (ListSet.setify typarEq declaredTypars).Length <> declaredTypars.Length then + if ListSet.hasDuplicates typarEq declaredTypars then errorR(Error(FSComp.SR.tcConstrainedTypeVariableCannotBeGeneralized(), m)) declaredTypars diff --git a/src/fsharp/lib.fs b/src/fsharp/lib.fs index 99b8a0ccab..3d5e854aff 100755 --- a/src/fsharp/lib.fs +++ b/src/fsharp/lib.fs @@ -230,6 +230,23 @@ module ListSet = // Note: if duplicates appear, keep the ones toward the _front_ of the list let setify f l = List.foldBack (insert f) (List.rev l) [] |> List.rev + let hasDuplicates f l = + match l with + | [] -> false + | [_] -> false + | [x; y] -> f x y + | x::rest -> + let rec loop acc l = + match l with + | [] -> false + | x::rest -> + if contains f x acc then + true + else + loop (x::acc) rest + + loop [x] rest + //------------------------------------------------------------------------- // Library: pairs //------------------------------------------------------------------------ From a1f4569e0ee4d8cc476cc567620c5cc3f92965c3 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Thu, 24 May 2018 14:17:59 -0700 Subject: [PATCH 017/150] Rev Dev15.8 to build F# 4.5, FSharp.Core 4.5.0.0 (#4988) * Update to F# 4.5 * typo --- build/targets/AssemblyVersions.props | 6 +++--- setup/FSharp.SDK/FSharp.SDK.wxs | 2 +- setup/Swix/Microsoft.FSharp.SDK.Core/Files.swr | 2 +- setup/Swix/Microsoft.FSharp.SDK.Resources/Empty.swr | 2 +- setup/Swix/Microsoft.FSharp.SDK.Resources/Files.swr | 2 +- src/FSharpSource.Settings.targets | 12 ++++++------ src/buildfromsource/BuildFromSource.targets | 2 +- src/buildfromsource/FSharp.Build/AssemblyInfo.fs | 6 +++--- .../AssemblyInfo.fs | 6 +++--- .../FSharp.Compiler.Private/AssemblyInfo.fs | 6 +++--- .../FSharp.Compiler.nuget.fsproj | 2 +- src/buildfromsource/FSharp.Core/AssemblyInfo.fs | 6 +++--- src/buildfromsource/Fsc/AssemblyInfo.fs | 6 +++--- src/buildfromsource/Fsi/AssemblyInfo.fs | 6 +++--- .../FSharp.Core.nuget/FSharp.Core.LatestNuget.nuspec | 6 +++--- src/fsharp/Fsc/app.config | 2 +- src/fsharp/fsi/app.config | 2 +- src/fsharp/fsiAnyCpu/app.config | 2 +- src/utils/CompilerLocationUtils.fs | 2 +- vsintegration/Vsix/RegisterFsharpPackage.pkgdef | 2 +- .../src/FSharp.ProjectSystem.FSharp/Project.fs | 2 +- .../src/FSharp.ProjectSystem.FSharp/VSPackage.resx | 6 +++--- .../FSharp.ProjectSystem.FSharp/xlf/VSPackage.cs.xlf | 12 ++++++------ .../FSharp.ProjectSystem.FSharp/xlf/VSPackage.de.xlf | 12 ++++++------ .../FSharp.ProjectSystem.FSharp/xlf/VSPackage.en.xlf | 12 ++++++------ .../FSharp.ProjectSystem.FSharp/xlf/VSPackage.es.xlf | 12 ++++++------ .../FSharp.ProjectSystem.FSharp/xlf/VSPackage.fr.xlf | 12 ++++++------ .../FSharp.ProjectSystem.FSharp/xlf/VSPackage.it.xlf | 12 ++++++------ .../FSharp.ProjectSystem.FSharp/xlf/VSPackage.ja.xlf | 12 ++++++------ .../FSharp.ProjectSystem.FSharp/xlf/VSPackage.ko.xlf | 12 ++++++------ .../FSharp.ProjectSystem.FSharp/xlf/VSPackage.pl.xlf | 12 ++++++------ .../xlf/VSPackage.pt-BR.xlf | 12 ++++++------ .../FSharp.ProjectSystem.FSharp/xlf/VSPackage.ru.xlf | 12 ++++++------ .../FSharp.ProjectSystem.FSharp/xlf/VSPackage.tr.xlf | 12 ++++++------ .../xlf/VSPackage.zh-Hans.xlf | 12 ++++++------ .../xlf/VSPackage.zh-Hant.xlf | 12 ++++++------ vsintegration/update-vsintegration.cmd | 2 +- 37 files changed, 130 insertions(+), 130 deletions(-) diff --git a/build/targets/AssemblyVersions.props b/build/targets/AssemblyVersions.props index 24596a9d90..2e1a254852 100644 --- a/build/targets/AssemblyVersions.props +++ b/build/targets/AssemblyVersions.props @@ -19,9 +19,9 @@ <_Build_Number>$(BUILD_BUILDNUMBER.Substring(9)) $(_Build_Year).$(_Build_Month).$(_Build_Day).$(_Build_Number) - 4.4.3.0 - 10.1.1.0 - 10.1.4 + 4.5.0.0 + 10.2.0.0 + 10.2.0 15.8.0.0 $(FSCoreVersion) diff --git a/setup/FSharp.SDK/FSharp.SDK.wxs b/setup/FSharp.SDK/FSharp.SDK.wxs index 21faef5e33..6c4958611f 100644 --- a/setup/FSharp.SDK/FSharp.SDK.wxs +++ b/setup/FSharp.SDK/FSharp.SDK.wxs @@ -2,7 +2,7 @@ - + diff --git a/setup/Swix/Microsoft.FSharp.SDK.Core/Files.swr b/setup/Swix/Microsoft.FSharp.SDK.Core/Files.swr index 2ce5288a19..e2ba96ac4b 100644 --- a/setup/Swix/Microsoft.FSharp.SDK.Core/Files.swr +++ b/setup/Swix/Microsoft.FSharp.SDK.Core/Files.swr @@ -3,7 +3,7 @@ use vs package name=Microsoft.FSharp.SDK.Core version=$(FSharpPackageVersion) vs.package.type=msi - vs.package.providerKey=Microsoft.FSharp.SDK.Core,v10.1 + vs.package.providerKey=Microsoft.FSharp.SDK.Core,v10.2 vs.installSize SystemDrive=194670592 diff --git a/setup/Swix/Microsoft.FSharp.SDK.Resources/Empty.swr b/setup/Swix/Microsoft.FSharp.SDK.Resources/Empty.swr index bfb98e5723..c0aa187b53 100644 --- a/setup/Swix/Microsoft.FSharp.SDK.Resources/Empty.swr +++ b/setup/Swix/Microsoft.FSharp.SDK.Resources/Empty.swr @@ -4,4 +4,4 @@ package name=Microsoft.FSharp.SDK.Resources version=$(FSharpPackageVersion) vs.package.language=$(LocaleSpecificCulture) vs.package.installSize=1 - vs.package.providerKey=Microsoft.FSharp.SDK.Resources,$(LocaleSpecificCulture),v10.1 + vs.package.providerKey=Microsoft.FSharp.SDK.Resources,$(LocaleSpecificCulture),v10.2 diff --git a/setup/Swix/Microsoft.FSharp.SDK.Resources/Files.swr b/setup/Swix/Microsoft.FSharp.SDK.Resources/Files.swr index d68202aac6..4d51347f59 100644 --- a/setup/Swix/Microsoft.FSharp.SDK.Resources/Files.swr +++ b/setup/Swix/Microsoft.FSharp.SDK.Resources/Files.swr @@ -4,7 +4,7 @@ package name=Microsoft.FSharp.SDK.Resources version=$(FSharpPackageVersion) vs.package.type=msi vs.package.language=$(LocaleSpecificCulture) - vs.package.providerKey=Microsoft.FSharp.SDK.Resources,$(LocaleSpecificCulture),v10.1 + vs.package.providerKey=Microsoft.FSharp.SDK.Resources,$(LocaleSpecificCulture),v10.2 vs.installSize SystemDrive=12681438 diff --git a/src/FSharpSource.Settings.targets b/src/FSharpSource.Settings.targets index ef284990aa..3fb2ba1bc6 100644 --- a/src/FSharpSource.Settings.targets +++ b/src/FSharpSource.Settings.targets @@ -20,9 +20,9 @@ - 4.4.3.0 - 10.1.1.0 - 10.1.4 + 4.5.0.0 + 10.2.0.0 + 10.2.0 15.7.0.0 @@ -101,8 +101,8 @@ 4.1.19 4.1 - 4.3.5 - 4.3 + 4.5.0 + 4.5 obj\$(Configuration)\$(TargetDotnetProfile)\ @@ -111,7 +111,7 @@ 10.1.0 10.2.0 - 10.1 + 10.2 3.5.0 diff --git a/src/buildfromsource/BuildFromSource.targets b/src/buildfromsource/BuildFromSource.targets index 2f6e19195e..bfcd3d48e8 100644 --- a/src/buildfromsource/BuildFromSource.targets +++ b/src/buildfromsource/BuildFromSource.targets @@ -3,7 +3,7 @@ - 4.4.3.0 + 4.5.0.0 $(MSBuildThisFileDirectory)../../BuildFromSource/$(Configuration)/bin $(MSBuildThisFileDirectory).. diff --git a/src/buildfromsource/FSharp.Build/AssemblyInfo.fs b/src/buildfromsource/FSharp.Build/AssemblyInfo.fs index a4e379030c..5eb0475d85 100644 --- a/src/buildfromsource/FSharp.Build/AssemblyInfo.fs +++ b/src/buildfromsource/FSharp.Build/AssemblyInfo.fs @@ -8,7 +8,7 @@ open System.Reflection [] [] [] -[] -[] -[] +[] +[] +[] do() diff --git a/src/buildfromsource/FSharp.Compiler.Interactive.Settings/AssemblyInfo.fs b/src/buildfromsource/FSharp.Compiler.Interactive.Settings/AssemblyInfo.fs index 0b84de0ded..9477e27f15 100644 --- a/src/buildfromsource/FSharp.Compiler.Interactive.Settings/AssemblyInfo.fs +++ b/src/buildfromsource/FSharp.Compiler.Interactive.Settings/AssemblyInfo.fs @@ -10,7 +10,7 @@ open System.Runtime.InteropServices [] [] [] -[] -[] -[] +[] +[] +[] do() diff --git a/src/buildfromsource/FSharp.Compiler.Private/AssemblyInfo.fs b/src/buildfromsource/FSharp.Compiler.Private/AssemblyInfo.fs index 48330e2d1a..3b6e5c9279 100644 --- a/src/buildfromsource/FSharp.Compiler.Private/AssemblyInfo.fs +++ b/src/buildfromsource/FSharp.Compiler.Private/AssemblyInfo.fs @@ -10,7 +10,7 @@ open System.Runtime.InteropServices [] [] [] -[] -[] -[] +[] +[] +[] do() diff --git a/src/buildfromsource/FSharp.Compiler.nuget/FSharp.Compiler.nuget.fsproj b/src/buildfromsource/FSharp.Compiler.nuget/FSharp.Compiler.nuget.fsproj index 95c6a02315..92144d8db0 100644 --- a/src/buildfromsource/FSharp.Compiler.nuget/FSharp.Compiler.nuget.fsproj +++ b/src/buildfromsource/FSharp.Compiler.nuget/FSharp.Compiler.nuget.fsproj @@ -20,7 +20,7 @@ Microsoft and F# Software Foundation Visual F# Compiler FSharp functional programming -rc-$(BuildRevision.Trim())-0 - 10.1.1$(PreReleaseSuffix) + 10.2.0$(PreReleaseSuffix) -prop "licenseUrl=$(PackageLicenceUrl)" -prop "version=$(PackageVersion)" -prop "authors=$(PackageAuthors)" -prop "projectUrl=$(PackageProjectUrl)" -prop "tags=$(PackageTags)" diff --git a/src/buildfromsource/FSharp.Core/AssemblyInfo.fs b/src/buildfromsource/FSharp.Core/AssemblyInfo.fs index f938f0e1b3..91e6683026 100644 --- a/src/buildfromsource/FSharp.Core/AssemblyInfo.fs +++ b/src/buildfromsource/FSharp.Core/AssemblyInfo.fs @@ -16,8 +16,8 @@ open System.Runtime.InteropServices [] #endif -[] -[] -[] +[] +[] +[] do() diff --git a/src/buildfromsource/Fsc/AssemblyInfo.fs b/src/buildfromsource/Fsc/AssemblyInfo.fs index 22b900dc0b..42f7feb94b 100644 --- a/src/buildfromsource/Fsc/AssemblyInfo.fs +++ b/src/buildfromsource/Fsc/AssemblyInfo.fs @@ -10,7 +10,7 @@ open System.Runtime.InteropServices [] [] [] -[] -[] -[] +[] +[] +[] do() diff --git a/src/buildfromsource/Fsi/AssemblyInfo.fs b/src/buildfromsource/Fsi/AssemblyInfo.fs index 30f157707b..2103574e81 100644 --- a/src/buildfromsource/Fsi/AssemblyInfo.fs +++ b/src/buildfromsource/Fsi/AssemblyInfo.fs @@ -7,7 +7,7 @@ open System.Reflection [] [] [] -[] -[] -[] +[] +[] +[] do() diff --git a/src/fsharp/FSharp.Core.nuget/FSharp.Core.LatestNuget.nuspec b/src/fsharp/FSharp.Core.nuget/FSharp.Core.LatestNuget.nuspec index 5949778c64..44ae12b44f 100644 --- a/src/fsharp/FSharp.Core.nuget/FSharp.Core.LatestNuget.nuspec +++ b/src/fsharp/FSharp.Core.nuget/FSharp.Core.LatestNuget.nuspec @@ -3,10 +3,10 @@ FSharp.Core - FSharp.Core for F# 4.1 - FSharp.Core for F# 4.1 + FSharp.Core for F# 4.5 + FSharp.Core for F# 4.5 - FSharp.Core redistributables from Visual F# Tools version 10.1 For F# 4.1 + FSharp.Core redistributables from Visual F# Tools version 10.2 For F# 4.5 Supported Platforms: .NET 4.5+ (net45) netstandard1.6 (netstandard1.6) diff --git a/src/fsharp/Fsc/app.config b/src/fsharp/Fsc/app.config index 4e10e78a90..f8b3fb396b 100644 --- a/src/fsharp/Fsc/app.config +++ b/src/fsharp/Fsc/app.config @@ -6,7 +6,7 @@ - + diff --git a/src/fsharp/fsi/app.config b/src/fsharp/fsi/app.config index 6409add7b6..df4baf6b49 100644 --- a/src/fsharp/fsi/app.config +++ b/src/fsharp/fsi/app.config @@ -5,7 +5,7 @@ - + diff --git a/src/fsharp/fsiAnyCpu/app.config b/src/fsharp/fsiAnyCpu/app.config index 75abd58318..231a002c17 100644 --- a/src/fsharp/fsiAnyCpu/app.config +++ b/src/fsharp/fsiAnyCpu/app.config @@ -6,7 +6,7 @@ - + diff --git a/src/utils/CompilerLocationUtils.fs b/src/utils/CompilerLocationUtils.fs index 9bfcbf3fc2..20d6d8ce9b 100644 --- a/src/utils/CompilerLocationUtils.fs +++ b/src/utils/CompilerLocationUtils.fs @@ -12,7 +12,7 @@ open System.Runtime.InteropServices module internal FSharpEnvironment = /// The F# version reported in the banner - let FSharpBannerVersion = "10.1.0 for F# 4.1" + let FSharpBannerVersion = "10.2.0 for F# 4.5" let versionOf<'t> = #if FX_RESHAPED_REFLECTION diff --git a/vsintegration/Vsix/RegisterFsharpPackage.pkgdef b/vsintegration/Vsix/RegisterFsharpPackage.pkgdef index be452176e4..e7daeb0df0 100644 --- a/vsintegration/Vsix/RegisterFsharpPackage.pkgdef +++ b/vsintegration/Vsix/RegisterFsharpPackage.pkgdef @@ -52,7 +52,7 @@ "1"="{92EF0900-2251-11D2-B72E-0000F87572EF}" [$RootKey$\Packages\{91a04a73-4f2c-4e7c-ad38-c1a68e7da05c}] -"ProductVersion"="10.1" +"ProductVersion"="10.2" "ProductName"="Visual F#" "CompanyName"="Microsoft Corp." diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/Project.fs b/vsintegration/src/FSharp.ProjectSystem.FSharp/Project.fs index 50a6e786b1..bfcd836d6b 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/Project.fs +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/Project.fs @@ -45,7 +45,7 @@ namespace rec Microsoft.VisualStudio.FSharp.ProjectSystem [] [] [] - [] + [] do () module internal VSHiveUtilities = diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/VSPackage.resx b/vsintegration/src/FSharp.ProjectSystem.FSharp/VSPackage.resx index 96eb52761e..a95a21700c 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/VSPackage.resx +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/VSPackage.resx @@ -468,10 +468,10 @@ Customizes the environment to maximize code editor screen space and improve the visibility of F# commands and tool windows. - Microsoft Visual F# Tools 10.1 for F# 4.1 + Microsoft Visual F# Tools 10.2 for F# 4.5 - Microsoft Visual F# Tools 10.1 for F# 4.1 + Microsoft Visual F# Tools 10.2 for F# 4.5 1.0 @@ -480,7 +480,7 @@ Microsoft Visual F# Tools - Visual F# Tools 10.1 for F# 4.1 + Visual F# Tools 10.2 for F# 4.5 F# Interactive diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.cs.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.cs.xlf index e0b731bc07..1b719ea9b1 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.cs.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.cs.xlf @@ -433,13 +433,13 @@ - Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# Tools 10.1 pro F# 4.1 + Microsoft Visual F# Tools 10.2 for F# 4.5 + Microsoft Visual F# Tools 10.1 pro F# 4.1 - Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# Tools 10.1 pro F# 4.1 + Microsoft Visual F# Tools 10.2 for F# 4.5 + Microsoft Visual F# Tools 10.1 pro F# 4.1 @@ -453,8 +453,8 @@ - Visual F# Tools 10.1 for F# 4.1 - Visual F# Tools 10.1 pro F# 4.1 + Visual F# Tools 10.2 for F# 4.5 + Visual F# Tools 10.1 pro F# 4.1 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.de.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.de.xlf index 02cbc8a503..5474db71e8 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.de.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.de.xlf @@ -433,13 +433,13 @@ - Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# Tools 10.1 für F# 4.1 + Microsoft Visual F# Tools 10.2 for F# 4.5 + Microsoft Visual F# Tools 10.1 für F# 4.1 - Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# Tools 10.1 für F# 4.1 + Microsoft Visual F# Tools 10.2 for F# 4.5 + Microsoft Visual F# Tools 10.1 für F# 4.1 @@ -453,8 +453,8 @@ - Visual F# Tools 10.1 for F# 4.1 - Visual F# Tools 10.1 für F# 4.1 + Visual F# Tools 10.2 for F# 4.5 + Visual F# Tools 10.1 für F# 4.1 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.en.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.en.xlf index 47c5e09b12..8086770938 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.en.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.en.xlf @@ -433,13 +433,13 @@ - Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# Tools 10.1 for F# 4.1 + Microsoft Visual F# Tools 10.2 for F# 4.5 + Microsoft Visual F# Tools 10.2 for F# 4.5 - Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# Tools 10.1 for F# 4.1 + Microsoft Visual F# Tools 10.2 for F# 4.5 + Microsoft Visual F# Tools 10.2 for F# 4.5 @@ -453,8 +453,8 @@ - Visual F# Tools 10.1 for F# 4.1 - Visual F# Tools 10.1 for F# 4.1 + Visual F# Tools 10.2 for F# 4.5 + Visual F# Tools 10.2 for F# 4.5 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.es.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.es.xlf index acf633e91f..886374afa9 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.es.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.es.xlf @@ -433,13 +433,13 @@ - Microsoft Visual F# Tools 10.1 for F# 4.1 - Herramientas de Microsoft Visual F# 10.1 para F# 4.1 + Microsoft Visual F# Tools 10.2 for F# 4.5 + Herramientas de Microsoft Visual F# 10.1 para F# 4.1 - Microsoft Visual F# Tools 10.1 for F# 4.1 - Herramientas de Microsoft Visual F# 10.1 para F# 4.1 + Microsoft Visual F# Tools 10.2 for F# 4.5 + Herramientas de Microsoft Visual F# 10.1 para F# 4.1 @@ -453,8 +453,8 @@ - Visual F# Tools 10.1 for F# 4.1 - Herramientas de Visual F# 10.1 para F# 4.1 + Visual F# Tools 10.2 for F# 4.5 + Herramientas de Visual F# 10.1 para F# 4.1 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.fr.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.fr.xlf index 7e044d3523..1ca00b8517 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.fr.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.fr.xlf @@ -433,13 +433,13 @@ - Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# Tools 10.1 pour F# 4.1 + Microsoft Visual F# Tools 10.2 for F# 4.5 + Microsoft Visual F# Tools 10.1 pour F# 4.1 - Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# Tools 10.1 pour F# 4.1 + Microsoft Visual F# Tools 10.2 for F# 4.5 + Microsoft Visual F# Tools 10.1 pour F# 4.1 @@ -453,8 +453,8 @@ - Visual F# Tools 10.1 for F# 4.1 - Visual F# Tools 10.1 pour F# 4.1 + Visual F# Tools 10.2 for F# 4.5 + Visual F# Tools 10.1 pour F# 4.1 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.it.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.it.xlf index e7f5739ea4..db792158ea 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.it.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.it.xlf @@ -433,13 +433,13 @@ - Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# Tools 10.1 per F# 4.1 + Microsoft Visual F# Tools 10.2 for F# 4.5 + Microsoft Visual F# Tools 10.1 per F# 4.1 - Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# Tools 10.1 per F# 4.1 + Microsoft Visual F# Tools 10.2 for F# 4.5 + Microsoft Visual F# Tools 10.1 per F# 4.1 @@ -453,8 +453,8 @@ - Visual F# Tools 10.1 for F# 4.1 - Visual F# Tools 10.1 per F# 4.1 + Visual F# Tools 10.2 for F# 4.5 + Visual F# Tools 10.1 per F# 4.1 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ja.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ja.xlf index a93164380e..03b6524888 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ja.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ja.xlf @@ -433,13 +433,13 @@ - Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# Tools 10.1 for F# 4.1 + Microsoft Visual F# Tools 10.2 for F# 4.5 + Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# Tools 10.1 for F# 4.1 + Microsoft Visual F# Tools 10.2 for F# 4.5 + Microsoft Visual F# Tools 10.1 for F# 4.1 @@ -453,8 +453,8 @@ - Visual F# Tools 10.1 for F# 4.1 - Visual F# Tools 10.1 for F# 4.1 + Visual F# Tools 10.2 for F# 4.5 + Visual F# Tools 10.1 for F# 4.1 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ko.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ko.xlf index 01446eb80d..3dd3e7aa0c 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ko.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ko.xlf @@ -433,13 +433,13 @@ - Microsoft Visual F# Tools 10.1 for F# 4.1 - F# 4.1용 Microsoft Visual F# Tools 10.1 + Microsoft Visual F# Tools 10.2 for F# 4.5 + F# 4.1용 Microsoft Visual F# Tools 10.1 - Microsoft Visual F# Tools 10.1 for F# 4.1 - F# 4.1용 Microsoft Visual F# Tools 10.1 + Microsoft Visual F# Tools 10.2 for F# 4.5 + F# 4.1용 Microsoft Visual F# Tools 10.1 @@ -453,8 +453,8 @@ - Visual F# Tools 10.1 for F# 4.1 - F# 4.1용 Visual F# Tools 10.1 + Visual F# Tools 10.2 for F# 4.5 + F# 4.1용 Visual F# Tools 10.1 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pl.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pl.xlf index 5fc2d93bc8..da8ae1cd0e 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pl.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pl.xlf @@ -433,13 +433,13 @@ - Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# Tools 10.1 for F# 4.1 + Microsoft Visual F# Tools 10.2 for F# 4.5 + Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# Tools 10.1 for F# 4.1 + Microsoft Visual F# Tools 10.2 for F# 4.5 + Microsoft Visual F# Tools 10.1 for F# 4.1 @@ -453,8 +453,8 @@ - Visual F# Tools 10.1 for F# 4.1 - Visual F# Tools 10.1 for F# 4.1 + Visual F# Tools 10.2 for F# 4.5 + Visual F# Tools 10.1 for F# 4.1 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pt-BR.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pt-BR.xlf index 83d2731d30..a5cb2f38cd 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pt-BR.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pt-BR.xlf @@ -433,13 +433,13 @@ - Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# Tools 10.1 para F# 4.1 + Microsoft Visual F# Tools 10.2 for F# 4.5 + Microsoft Visual F# Tools 10.1 para F# 4.1 - Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# Tools 10.1 para F# 4.1 + Microsoft Visual F# Tools 10.2 for F# 4.5 + Microsoft Visual F# Tools 10.1 para F# 4.1 @@ -453,8 +453,8 @@ - Visual F# Tools 10.1 for F# 4.1 - Visual F# Tools 10.1 para F# 4.1 + Visual F# Tools 10.2 for F# 4.5 + Visual F# Tools 10.1 para F# 4.1 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ru.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ru.xlf index 5d5828acf8..48f092dc32 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ru.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ru.xlf @@ -433,13 +433,13 @@ - Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# Tools 10.1 для F# 4.1 + Microsoft Visual F# Tools 10.2 for F# 4.5 + Microsoft Visual F# Tools 10.1 для F# 4.1 - Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# Tools 10.1 для F# 4.1 + Microsoft Visual F# Tools 10.2 for F# 4.5 + Microsoft Visual F# Tools 10.1 для F# 4.1 @@ -453,8 +453,8 @@ - Visual F# Tools 10.1 for F# 4.1 - Visual F# Tools 10.1 для F# 4.1 + Visual F# Tools 10.2 for F# 4.5 + Visual F# Tools 10.1 для F# 4.1 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.tr.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.tr.xlf index ec718c3ec1..c899228bd2 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.tr.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.tr.xlf @@ -433,13 +433,13 @@ - Microsoft Visual F# Tools 10.1 for F# 4.1 - F# 4.1 için Microsoft Visual F# Tools 10.1 + Microsoft Visual F# Tools 10.2 for F# 4.5 + F# 4.1 için Microsoft Visual F# Tools 10.1 - Microsoft Visual F# Tools 10.1 for F# 4.1 - F# 4.1 için Microsoft Visual F# Tools 10.1 + Microsoft Visual F# Tools 10.2 for F# 4.5 + F# 4.1 için Microsoft Visual F# Tools 10.1 @@ -453,8 +453,8 @@ - Visual F# Tools 10.1 for F# 4.1 - F# 4.1 için Visual F# Araçları 10.1 + Visual F# Tools 10.2 for F# 4.5 + F# 4.1 için Visual F# Araçları 10.1 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hans.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hans.xlf index 898b3599dc..1b5a8fc623 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hans.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hans.xlf @@ -433,13 +433,13 @@ - Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# Tools 10.1 for F# 4.1 + Microsoft Visual F# Tools 10.2 for F# 4.5 + Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# Tools 10.1 for F# 4.1 + Microsoft Visual F# Tools 10.2 for F# 4.5 + Microsoft Visual F# Tools 10.1 for F# 4.1 @@ -453,8 +453,8 @@ - Visual F# Tools 10.1 for F# 4.1 - Visual F# Tools 10.1 for F# 4.1 + Visual F# Tools 10.2 for F# 4.5 + Visual F# Tools 10.1 for F# 4.1 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hant.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hant.xlf index b2cb3abbc2..15a3ad825d 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hant.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hant.xlf @@ -433,13 +433,13 @@ - Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# Tools 10.1 for F# 4.1 + Microsoft Visual F# Tools 10.2 for F# 4.5 + Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# Tools 10.1 for F# 4.1 + Microsoft Visual F# Tools 10.2 for F# 4.5 + Microsoft Visual F# Tools 10.1 for F# 4.1 @@ -453,8 +453,8 @@ - Visual F# Tools 10.1 for F# 4.1 - Visual F# Tools 10.1 for F# 4.1 + Visual F# Tools 10.2 for F# 4.5 + Visual F# Tools 10.1 for F# 4.1 diff --git a/vsintegration/update-vsintegration.cmd b/vsintegration/update-vsintegration.cmd index 7ae78630c3..3e2564d30a 100644 --- a/vsintegration/update-vsintegration.cmd +++ b/vsintegration/update-vsintegration.cmd @@ -83,7 +83,7 @@ GOTO :start echo. echo Installs or restores F# SDK bits, which applies system-wide to all Visual Studio -echo 2017 installations. After running this, each project targeting F# 4.1 will use +echo 2017 installations. After running this, each project targeting F# 4.5 will use echo your locally built FSC.exe. It will not update other F# tools, see remarks below. echo. echo Requires Administrator privileges for removing/restoring strong-naming. From 28e0bf59b1789d92c46212a8b4f21936a0906abc Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Thu, 24 May 2018 14:21:40 -0700 Subject: [PATCH 018/150] Switch legacy project System Templates to use nuget. (#4977) * Switch legacy templates to use nuget. * Change template names * Revert testing mod --- packages.config | 1 + .../Template/ConsoleApplication.fsproj | 35 +++++-------------- .../Template/ConsoleApplication.vstemplate | 3 +- .../LibraryProject/Template/Library.fsproj | 35 +++++-------------- .../Template/Library.vstemplate | 5 +-- .../TutorialProject/Template/Tutorial.fsproj | 33 ++++------------- .../Template/Tutorial.vstemplate | 3 +- .../VisualFSharpFull/VisualFSharpFull.csproj | 5 +++ .../VSPackage.resx | 7 ++-- .../xlf/VSPackage.cs.xlf | 12 +++---- .../xlf/VSPackage.de.xlf | 12 +++---- .../xlf/VSPackage.en.xlf | 12 +++---- .../xlf/VSPackage.es.xlf | 12 +++---- .../xlf/VSPackage.fr.xlf | 12 +++---- .../xlf/VSPackage.it.xlf | 12 +++---- .../xlf/VSPackage.ja.xlf | 12 +++---- .../xlf/VSPackage.ko.xlf | 12 +++---- .../xlf/VSPackage.pl.xlf | 12 +++---- .../xlf/VSPackage.pt-BR.xlf | 12 +++---- .../xlf/VSPackage.ru.xlf | 12 +++---- .../xlf/VSPackage.tr.xlf | 12 +++---- .../xlf/VSPackage.zh-Hans.xlf | 12 +++---- .../xlf/VSPackage.zh-Hant.xlf | 12 +++---- 23 files changed, 123 insertions(+), 172 deletions(-) diff --git a/packages.config b/packages.config index a137d8a900..246defcf43 100644 --- a/packages.config +++ b/packages.config @@ -19,6 +19,7 @@ + diff --git a/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.fsproj b/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.fsproj index ccd1f912b9..b7d0837dde 100644 --- a/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.fsproj +++ b/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.fsproj @@ -12,11 +12,6 @@ v$targetframeworkversion$ true true - $if$ ($targetframeworkversion$ >= 4.0) - 4.4.3.0 - $else$ - 2.3.0.0 - $endif$ true @@ -43,22 +38,17 @@ + + + - FSharp.Core - FSharp.Core.dll - $(MSBuildProgramFiles32)\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\$(TargetFSharpCoreVersion)\FSharp.Core.dll + ..\packages\FSharp.Core.4.3.4\lib\net45\FSharp.Core.dll + True ..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll True - - $if$ ($targetframeworkversion$ >= 3.5) - - $endif$ - $if$ ($targetframeworkversion$ > 3.5) - - $endif$ @@ -68,18 +58,9 @@ 11 - - - - $(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets - - - - - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets - - - + + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets + ValueNone * fix surface area * fix build * update baselines * fix baselines * fix baselines * fix baselines * fix baselines * fix build --- src/absil/illib.fs | 14 +- src/fsharp/AttributeChecking.fs | 4 +- src/fsharp/FSharp.Core/async.fs | 673 ++++++++++-------- src/fsharp/FSharp.Core/async.fsi | 163 +++-- src/fsharp/FSharp.Core/mailbox.fs | 2 +- src/fsharp/FSharp.Core/prim-types.fs | 28 +- src/fsharp/FSharp.Core/prim-types.fsi | 34 + src/fsharp/IlxGen.fs | 4 +- src/fsharp/MethodOverrides.fs | 3 +- src/fsharp/NameResolution.fs | 4 +- src/fsharp/TastOps.fs | 8 +- src/fsharp/TypeChecker.fs | 16 +- src/fsharp/infos.fs | 2 +- src/fsharp/tast.fs | 54 +- .../Microsoft.FSharp.Core/OptionModule.fs | 35 +- .../SurfaceArea.coreclr.fs | 54 ++ .../SurfaceArea.net40.fs | 56 +- tests/fsharp/TypeProviderTests.fs | 2 + tests/fsharp/core/asyncStackTraces/test.fsx | 170 +++++ tests/fsharp/tests.fs | 15 +- .../AsyncExpressionSteppingTest1.il.bsl | 12 +- .../AsyncExpressionSteppingTest2.il.bsl | 12 +- .../AsyncExpressionSteppingTest3.il.bsl | 69 +- .../AsyncExpressionSteppingTest4.il.bsl | 172 ++++- .../AsyncExpressionSteppingTest5.il.bsl | 148 +++- .../AsyncExpressionSteppingTest6.il.bsl | 534 +++++++++++--- .../OverloadingMembers/E_OverloadMismatch.fs | 14 + .../OverloadingMembers/env.lst | 1 + .../fsharpqa/Source/Misc/LongSourceFile01.fs | 1 + 29 files changed, 1716 insertions(+), 588 deletions(-) create mode 100644 tests/fsharp/core/asyncStackTraces/test.fsx create mode 100644 tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/E_OverloadMismatch.fs diff --git a/src/absil/illib.fs b/src/absil/illib.fs index a1adb372e9..8e8d878595 100644 --- a/src/absil/illib.fs +++ b/src/absil/illib.fs @@ -448,16 +448,16 @@ module List = [] type ValueOption<'T> = - | VSome of 'T - | VNone - member x.IsSome = match x with VSome _ -> true | VNone -> false - member x.IsNone = match x with VSome _ -> false | VNone -> true - member x.Value = match x with VSome r -> r | VNone -> failwith "ValueOption.Value: value is None" + | ValueSome of 'T + | ValueNone + member x.IsSome = match x with ValueSome _ -> true | ValueNone -> false + member x.IsNone = match x with ValueSome _ -> false | ValueNone -> true + member x.Value = match x with ValueSome r -> r | ValueNone -> failwith "ValueOption.Value: value is None" [] module ValueOption = - let inline ofOption x = match x with Some x -> VSome x | None -> VNone - let inline bind f x = match x with VSome x -> f x | VNone -> VNone + let inline ofOption x = match x with Some x -> ValueSome x | None -> ValueNone + let inline bind f x = match x with ValueSome x -> f x | ValueNone -> ValueNone module String = let indexNotFound() = raise (new KeyNotFoundException("An index for the character was not found in the string")) diff --git a/src/fsharp/AttributeChecking.fs b/src/fsharp/AttributeChecking.fs index 4da9fe21b3..d8bce9785d 100644 --- a/src/fsharp/AttributeChecking.fs +++ b/src/fsharp/AttributeChecking.fs @@ -511,7 +511,7 @@ let IsSecurityAttribute (g: TcGlobals) amap (casmap : Dictionary) ( | None -> false | Some attr -> match attr.TyconRef.TryDeref with - | VSome _ -> + | ValueSome _ -> let tcs = tcref.Stamp match casmap.TryGetValue(tcs) with | true, c -> c @@ -519,7 +519,7 @@ let IsSecurityAttribute (g: TcGlobals) amap (casmap : Dictionary) ( let exists = ExistsInEntireHierarchyOfType (fun t -> typeEquiv g t (mkAppTy attr.TyconRef [])) g amap m AllowMultiIntfInstantiations.Yes (mkAppTy tcref []) casmap.[tcs] <- exists exists - | VNone -> false + | ValueNone -> false let IsSecurityCriticalAttribute g (Attrib(tcref, _, _, _, _, _, _)) = (tyconRefEq g tcref g.attrib_SecurityCriticalAttribute.TyconRef || tyconRefEq g tcref g.attrib_SecuritySafeCriticalAttribute.TyconRef) diff --git a/src/fsharp/FSharp.Core/async.fs b/src/fsharp/FSharp.Core/async.fs index e2f87857f4..2d87a60078 100644 --- a/src/fsharp/FSharp.Core/async.fs +++ b/src/fsharp/FSharp.Core/async.fs @@ -78,31 +78,25 @@ namespace Microsoft.FSharp.Control [] type Trampoline() = - let unfake FakeUnit = () + let unfake (_ : AsyncReturn) = () [] static let bindLimitBeforeHijack = 300 - [] - [] + [] static val mutable private thisThreadHasTrampoline : bool static member ThisThreadHasTrampoline = Trampoline.thisThreadHasTrampoline let mutable storedCont = None + let mutable storedExnCont = None let mutable bindCount = 0 /// Use this trampoline on the synchronous stack if none exists, and execute /// the given function. The function might write its continuation into the trampoline. + [] member __.Execute (firstAction : unit -> AsyncReturn) = - let rec loop action = - action() |> unfake - match storedCont with - | None -> () - | Some newAction -> - storedCont <- None - loop newAction let thisIsTopTrampoline = if Trampoline.thisThreadHasTrampoline then @@ -111,11 +105,31 @@ namespace Microsoft.FSharp.Control Trampoline.thisThreadHasTrampoline <- true true try - loop firstAction + let mutable keepGoing = true + let mutable action = firstAction + while keepGoing do + try + action() |> unfake + match storedCont with + | None -> + keepGoing <- false + | Some cont -> + storedCont <- None + action <- cont + // Let the exception propagate all the way to the trampoline to get a full .StackTrace entry + with exn -> + match storedExnCont with + | None -> + reraise() + | Some econt -> + storedExnCont <- None + let edi = ExceptionDispatchInfo.RestoreOrCapture exn + action <- (fun () -> econt edi) + finally if thisIsTopTrampoline then Trampoline.thisThreadHasTrampoline <- false - FakeUnit + Unchecked.defaultof /// Increment the counter estimating the size of the synchronous stack and /// return true if time to jump on trampoline. @@ -130,13 +144,16 @@ namespace Microsoft.FSharp.Control bindCount <- 0 storedCont <- Some action | _ -> failwith "Internal error: attempting to install continuation twice" - FakeUnit + Unchecked.defaultof + /// Save the exception continuation during propagation of an exception, or prior to raising an exception + member __.OnExceptionRaised (action: econt) = + storedExnCont <- Some action type TrampolineHolder() as this = let mutable trampoline = null - static let unfake FakeUnit = () + static let unfake (_: AsyncReturn) = () // Preallocate this delegate and keep it in the trampoline holder. let sendOrPostCallbackWithTrampoline = @@ -159,18 +176,19 @@ namespace Microsoft.FSharp.Control #endif /// Execute an async computation after installing a trampoline on its synchronous stack. + [] member __.ExecuteWithTrampoline firstAction = trampoline <- new Trampoline() trampoline.Execute firstAction member this.PostWithTrampoline (syncCtxt: SynchronizationContext) (f : unit -> AsyncReturn) = syncCtxt.Post (sendOrPostCallbackWithTrampoline, state=(f |> box)) - FakeUnit + Unchecked.defaultof member this.QueueWorkItemWithTrampoline (f: unit -> AsyncReturn) = if not (ThreadPool.QueueUserWorkItem(waitCallbackForQueueWorkItemWithTrampoline, f |> box)) then failwith "failed to queue user work item" - FakeUnit + Unchecked.defaultof member this.PostOrQueueWithTrampoline (syncCtxt : SynchronizationContext) f = match syncCtxt with @@ -184,16 +202,20 @@ namespace Microsoft.FSharp.Control this.QueueWorkItemWithTrampoline(f) #else (new Thread((fun _ -> this.Execute f |> unfake), IsBackground=true)).Start() - FakeUnit + Unchecked.defaultof #endif #else // This should be the only call to Thread.Start in this library. We must always install a trampoline. member __.StartThreadWithTrampoline (f : unit -> AsyncReturn) = (new Thread(threadStartCallbackForStartThreadWithTrampoline,IsBackground=true)).Start(f|>box) - FakeUnit + Unchecked.defaultof #endif + /// Save the exception continuation during propagation of an exception, or prior to raising an exception + member inline __.OnExceptionRaised(econt) = + trampoline.OnExceptionRaised econt + /// Call a continuation, but first check if an async computation should trampoline on its synchronous stack. member inline __.HijackCheckThenCall (cont : 'T -> AsyncReturn) res = if trampoline.IncrementBindCount() then @@ -206,26 +228,59 @@ namespace Microsoft.FSharp.Control [] /// Represents rarely changing components of an in-flight async computation type AsyncActivationAux = - { token : CancellationToken + { /// The active cancellation token + token : CancellationToken + /// The exception continuation econt : econt + /// The cancellation continuation ccont : ccont + /// Holds some commonly-allocated callbacks and a mutable location to use for a trampoline trampolineHolder : TrampolineHolder } [] [] - /// Represents an in-flight async computation - type AsyncActivation<'T> = - { cont : cont<'T> + /// Represents context for an in-flight async computation + type AsyncActivationContents<'T> = + { /// The success continuation + cont : cont<'T> + /// The rarely changing components aux : AsyncActivationAux } - member ctxt.IsCancellationRequested = ctxt.aux.token.IsCancellationRequested + /// A struct wrapper around AsyncActivationContents. Using a struct wrapper allows us to change representation of the + /// contents at a later point, e.g. to change the contents to a .NET Task or some other representation. + [] + type AsyncActivation<'T>(contents: AsyncActivationContents<'T>) = + + member ctxt.WithCancellationContinuation ccont = AsyncActivation<_> { contents with aux = { ctxt.aux with ccont = ccont } } + + member ctxt.WithExceptionContinuation econt = AsyncActivation<_> { contents with aux = { ctxt.aux with econt = econt } } + + member ctxt.WithContinuation(cont) = AsyncActivation<_> { cont = cont; aux = contents.aux } + + member ctxt.WithContinuations(cont, econt) = AsyncActivation<_> { cont = cont; aux = { contents.aux with econt = econt } } + + member ctxt.WithContinuations(cont, econt, ccont) = AsyncActivation<_> { contents with cont = cont; aux = { ctxt.aux with econt = econt; ccont = ccont } } + + member ctxt.aux = contents.aux + + member ctxt.cont = contents.cont + + member ctxt.econt = contents.aux.econt + + member ctxt.ccont = contents.aux.ccont + + member ctxt.token = contents.aux.token + + member ctxt.trampolineHolder = contents.aux.trampolineHolder + + member ctxt.IsCancellationRequested = contents.aux.token.IsCancellationRequested /// Call the cancellation continuation of the active computation member ctxt.OnCancellation () = - ctxt.aux.ccont (new OperationCanceledException (ctxt.aux.token)) + contents.aux.ccont (new OperationCanceledException (contents.aux.token)) member inline ctxt.HijackCheckThenCall cont arg = - ctxt.aux.trampolineHolder.HijackCheckThenCall cont arg + contents.aux.trampolineHolder.HijackCheckThenCall cont arg member ctxt.OnSuccess result = if ctxt.IsCancellationRequested then @@ -235,16 +290,25 @@ namespace Microsoft.FSharp.Control /// Call the exception continuation directly member ctxt.CallExceptionContinuation edi = - ctxt.aux.econt edi + contents.aux.econt edi + + /// Save the exception continuation during propagation of an exception, or prior to raising an exception + member ctxt.OnExceptionRaised() = + contents.aux.trampolineHolder.OnExceptionRaised contents.aux.econt + + /// Make an initial async activation. + static member Create cancellationToken trampolineHolder cont econt ccont : AsyncActivation<'T> = + AsyncActivation { cont = cont; aux = { token = cancellationToken; econt = econt; ccont = ccont; trampolineHolder = trampolineHolder } } + member ctxt.QueueContinuationWithTrampoline (result: 'T) = + let ctxt = ctxt ctxt.aux.trampolineHolder.QueueWorkItemWithTrampoline(fun () -> ctxt.cont result) member ctxt.CallContinuation(result: 'T) = ctxt.cont result - [] - [] + [] type Async<'T> = { Invoke : (AsyncActivation<'T> -> AsyncReturn) } @@ -254,14 +318,12 @@ namespace Microsoft.FSharp.Control member __.Proceed = not isStopped member __.Stop() = isStopped <- true - [] - [] + [] type Latch() = let mutable i = 0 member this.Enter() = Interlocked.CompareExchange(&i, 1, 0) = 0 - [] - [] + [] type Once() = let latch = Latch() member this.Do f = @@ -274,6 +336,7 @@ namespace Microsoft.FSharp.Control | Error of ExceptionDispatchInfo | Canceled of OperationCanceledException + [] member res.Commit () = match res with | AsyncResult.Ok res -> res @@ -282,186 +345,230 @@ namespace Microsoft.FSharp.Control module AsyncPrimitives = - let fake () = FakeUnit - let unfake FakeUnit = () + let fake () = Unchecked.defaultof + + let unfake (_: AsyncReturn) = () let mutable defaultCancellationTokenSource = new CancellationTokenSource() - /// Apply userCode to x and call either the continuation or exception continuation depending what happens - let inline ProtectUserCodePlusHijackCheck (trampolineHolder:TrampolineHolder) userCode x econt (cont : 'T -> AsyncReturn) : AsyncReturn = - // This is deliberately written in a allocation-free style, except when the trampoline is taken + /// Primitive to invoke an async computation. + // + // Note: direct calls to this function may end up in user assemblies via inlining + [] + let Invoke (computation: Async<'T>) (ctxt: AsyncActivation<_>) : AsyncReturn = + ctxt.HijackCheckThenCall computation.Invoke ctxt + + /// Apply userCode to x. If no exception is raised then call the normal continuation. Used to implement + /// 'finally' and 'when cancelled'. + [] + let CallThenContinue userCode arg (ctxt: AsyncActivation<_>) : AsyncReturn = let mutable result = Unchecked.defaultof<_> - let mutable edi = null + let mutable ok = false try - result <- userCode x - with exn -> - edi <- ExceptionDispatchInfo.RestoreOrCapture(exn) + result <- userCode arg + ok <- true + finally + if not ok then + ctxt.OnExceptionRaised() - match edi with - | null -> - // NOTE: this must be a tailcall - trampolineHolder.HijackCheckThenCall cont result - | _ -> - // NOTE: this must be a tailcall - trampolineHolder.HijackCheckThenCall econt edi + if ok then + ctxt.HijackCheckThenCall ctxt.cont result + else + Unchecked.defaultof - // Apply userCode to x and call either the continuation or exception continuation depending what happens - let inline ProtectUserCodeThenInvoke userCode x econt (cont : 'T -> AsyncReturn) : AsyncReturn = - // This is deliberately written in a allocation-free style + /// Apply 'part2' to 'result1' and invoke the resulting computation. + // + // Note: direct calls to this function end up in user assemblies via inlining + [] + let CallThenInvoke (ctxt: AsyncActivation<_>) result1 part2 : AsyncReturn = let mutable result = Unchecked.defaultof<_> - let mutable edi = null + let mutable ok = false try - result <- userCode x - with exn -> - edi <- ExceptionDispatchInfo.RestoreOrCapture(exn) + result <- part2 result1 + ok <- true + finally + if not ok then + ctxt.OnExceptionRaised() - match edi with - | null -> - // NOTE: this must be a tailcall - cont result - | exn -> - // NOTE: this must be a tailcall - econt exn + if ok then + Invoke result ctxt + else + Unchecked.defaultof + /// Like `CallThenInvoke` but does not do a hijack check for historical reasons (exact code compat) + [] + let CallThenInvokeNoHijackCheck (ctxt: AsyncActivation<_>) userCode result1 = + let mutable res = Unchecked.defaultof<_> + let mutable ok = false + + try + res <- userCode result1 + ok <- true + finally + if not ok then + ctxt.OnExceptionRaised() + + if ok then + res.Invoke ctxt + else + Unchecked.defaultof + + /// Apply 'catchFilter' to 'arg'. If the result is 'Some' invoke the resulting computation. If the result is 'None' + /// then send 'result1' to the exception continuation. + [] + let CallFilterThenInvoke (ctxt: AsyncActivation<'T>) catchFilter (edi: ExceptionDispatchInfo) : AsyncReturn = + let mutable resOpt = Unchecked.defaultof<_> + let mutable ok = false + + try + resOpt <- catchFilter (edi.GetAssociatedSourceException()) + ok <- true + finally + if not ok then + ctxt.OnExceptionRaised() + + if ok then + match resOpt with + | None -> + ctxt.HijackCheckThenCall ctxt.econt edi + | Some res -> + Invoke res ctxt + else + Unchecked.defaultof + + /// Internal way of making an async from code, for exact code compat. /// Perform a cancellation check and ensure that any exceptions raised by /// the immediate execution of "userCode" are sent to the exception continuation. - let ProtectUserCode (ctxt: AsyncActivation<_>) userCode = + [] + let ProtectedCode (ctxt: AsyncActivation<'T>) userCode = if ctxt.IsCancellationRequested then ctxt.OnCancellation () else + let mutable ok = false try - userCode ctxt - with exn -> - let edi = ExceptionDispatchInfo.RestoreOrCapture(exn) - ctxt.CallExceptionContinuation edi + let res = userCode ctxt + ok <- true + res + finally + if not ok then + ctxt.OnExceptionRaised() - /// Make an initial asyc activation. - [] - let CreateAsyncActivation cancellationToken trampolineHolder cont econt ccont = - { cont = cont; aux = { token = cancellationToken; econt = econt; ccont = ccont; trampolineHolder = trampolineHolder } } - /// Build a primitive without any exception or resync protection + [] let MakeAsync body = { Invoke = body } - // Use this to recover ExceptionDispatchInfo when outside the "with" part of a try/with block. - // This indicates all the places where we lose a stack trace. - // - // Stack trace losses come when interoperating with other code that only provide us with an exception value, - // notably .NET 4.x tasks and user exceptions passed to the exception continuation in Async.FromContinuations. - let MayLoseStackTrace exn = ExceptionDispatchInfo.RestoreOrCapture(exn) - - // Call the exception continuation - let errorT args edi = - args.aux.econt edi + [] + // Note: direct calls to this function end up in user assemblies via inlining + let Bind (ctxt: AsyncActivation<'T>) (part1: Async<'U>) (part2: 'U -> Async<'T>) : AsyncReturn = + if ctxt.IsCancellationRequested then + ctxt.OnCancellation () + else + Invoke part1 (ctxt.WithContinuation(fun result1 -> CallThenInvokeNoHijackCheck ctxt part2 result1 )) - let protectedPrimitiveCore ctxt f = - if ctxt.aux.token.IsCancellationRequested then + [] + /// Re-route all continuations to execute the finally function. + let TryFinally (ctxt: AsyncActivation<'T>) computation finallyFunction = + if ctxt.IsCancellationRequested then ctxt.OnCancellation () else - try - f ctxt - with exn -> - let edi = ExceptionDispatchInfo.RestoreOrCapture(exn) - errorT ctxt edi + // The new continuation runs the finallyFunction and resumes the old continuation + // If an exception is thrown we continue with the previous exception continuation. + let cont result = + CallThenContinue finallyFunction () (ctxt.WithContinuation(fun () -> ctxt.cont result)) + // The new exception continuation runs the finallyFunction and then runs the previous exception continuation. + // If an exception is thrown we continue with the previous exception continuation. + let econt exn = + CallThenContinue finallyFunction () (ctxt.WithContinuation(fun () -> ctxt.econt exn)) + // The cancellation continuation runs the finallyFunction and then runs the previous cancellation continuation. + // If an exception is thrown we continue with the previous cancellation continuation (the exception is lost) + let ccont cexn = + CallThenContinue finallyFunction () (ctxt.WithContinuations(cont=(fun () -> ctxt.ccont cexn), econt = (fun _ -> ctxt.ccont cexn))) + let newCtxt = ctxt.WithContinuations(cont=cont, econt=econt, ccont=ccont) + computation.Invoke newCtxt + + /// Re-route the exception continuation to call to catchFunction. If catchFunction returns None then call the exception continuation. + /// If it returns Some, invoke the resulting async. + [] + let TryWith (ctxt: AsyncActivation<'T>) computation catchFunction = + if ctxt.IsCancellationRequested then + ctxt.OnCancellation () + else + let newCtxt = + ctxt.WithExceptionContinuation(fun edi -> + if ctxt.IsCancellationRequested then + ctxt.OnCancellation () + else + CallFilterThenInvoke ctxt catchFunction edi) + computation.Invoke newCtxt - // When run, ensures that any exceptions raised by the immediate execution of "f" are - // sent to the exception continuation. - // + /// Internal way of making an async from code, for exact code compat. + /// When run, ensures that any exceptions raised by the immediate execution of "f" are + /// sent to the exception continuation. let CreateProtectedAsync f = - MakeAsync (fun ctxt -> ProtectUserCode ctxt f) + MakeAsync (fun ctxt -> ProtectedCode ctxt f) + /// Internal way of making an async from result, for exact code compat. let CreateAsyncResultAsync res = MakeAsync (fun ctxt -> match res with | AsyncResult.Ok r -> ctxt.cont r | AsyncResult.Error edi -> ctxt.CallExceptionContinuation edi - | AsyncResult.Canceled oce -> ctxt.aux.ccont oce) + | AsyncResult.Canceled oce -> ctxt.ccont oce) // Generate async computation which calls its continuation with the given result - let CreateReturnAsync x = - MakeAsync (fun ctxt -> - if ctxt.IsCancellationRequested then - ctxt.OnCancellation () - else - ctxt.HijackCheckThenCall ctxt.cont x) - + let inline CreateReturnAsync res = + // Note: this code ends up in user assemblies via inlining + MakeAsync (fun ctxt -> ctxt.OnSuccess res) + // The primitive bind operation. Generate a process that runs the first process, takes // its result, applies f and then runs the new process produced. Hijack if necessary and // run 'f' with exception protection - let CreateBindAsync p1 f = - MakeAsync (fun ctxt -> - if ctxt.IsCancellationRequested then - ctxt.OnCancellation () - else - - let ctxt = - let cont a = ProtectUserCodeThenInvoke f a ctxt.aux.econt (fun p2 -> p2.Invoke ctxt) - { cont=cont; - aux = ctxt.aux - } - // Trampoline the continuation onto a new work item every so often - ctxt.HijackCheckThenCall p1.Invoke ctxt) + let inline CreateBindAsync part1 part2 = + // Note: this code ends up in user assemblies via inlining + MakeAsync (fun ctxt -> + Bind ctxt part1 part2) // Call the given function with exception protection, but first // check for cancellation. - let CreateCallAsync f x = - MakeAsync (fun ctxt -> - if ctxt.aux.token.IsCancellationRequested then + let inline CreateCallAsync part2 result1 = + // Note: this code ends up in user assemblies via inlining + MakeAsync (fun ctxt -> + if ctxt.IsCancellationRequested then ctxt.OnCancellation () else - ProtectUserCodePlusHijackCheck ctxt.aux.trampolineHolder f x ctxt.aux.econt (fun p2 -> p2.Invoke ctxt) - ) + CallThenInvoke ctxt result1 part2) - let CreateDelayAsync f = CreateCallAsync f () + let inline CreateDelayAsync computation = + // Note: this code ends up in user assemblies via inlining + CreateCallAsync computation () - let CreateSequentialAsync p1 p2 = - CreateBindAsync p1 (fun () -> p2) + /// Implements the sequencing construct of async computation expressions + let inline CreateSequentialAsync part1 part2 = + // Note: this code ends up in user assemblies via inlining + CreateBindAsync part1 (fun () -> part2) - // Call p but augment the normal, exception and cancel continuations with a call to finallyFunction. - // If the finallyFunction raises an exception then call the original exception continuation - // with the new exception. If exception is raised after a cancellation, exception is ignored - // and cancel continuation is called. - let CreateTryFinallyAsync finallyFunction computation = - MakeAsync (fun ctxt -> - if ctxt.aux.token.IsCancellationRequested then - ctxt.OnCancellation () - else - let trampolineHolder = ctxt.aux.trampolineHolder - // The new continuation runs the finallyFunction and resumes the old continuation - // If an exception is thrown we continue with the previous exception continuation. - let cont b = ProtectUserCodePlusHijackCheck trampolineHolder finallyFunction () ctxt.aux.econt (fun () -> ctxt.cont b) - // The new exception continuation runs the finallyFunction and then runs the previous exception continuation. - // If an exception is thrown we continue with the previous exception continuation. - let econt exn = ProtectUserCodePlusHijackCheck trampolineHolder finallyFunction () ctxt.aux.econt (fun () -> ctxt.aux.econt exn) - // The cancellation continuation runs the finallyFunction and then runs the previous cancellation continuation. - // If an exception is thrown we continue with the previous cancellation continuation (the exception is lost) - let ccont cexn = ProtectUserCodePlusHijackCheck trampolineHolder finallyFunction () (fun _ -> ctxt.aux.ccont cexn) (fun () -> ctxt.aux.ccont cexn) - computation.Invoke { ctxt with cont = cont; aux = { ctxt.aux with econt = econt; ccont = ccont } }) - - // Re-route the exception continuation to call to catchFunction. If catchFunction or the new process fail - // then call the original exception continuation with the failure. - let CreateTryWithDispatchInfoAsync catchFunction computation = - MakeAsync (fun ctxt -> - if ctxt.aux.token.IsCancellationRequested then - ctxt.OnCancellation () - else - let econt (edi: ExceptionDispatchInfo) = - let ecomputation = CreateCallAsync catchFunction edi - ecomputation.Invoke ctxt - let newCtxt = { ctxt with aux = { ctxt.aux with econt = econt } } - computation.Invoke newCtxt) + /// Create an async for a try/finally + let inline CreateTryFinallyAsync finallyFunction computation = + MakeAsync (fun ctxt -> TryFinally ctxt computation finallyFunction) - let CreateTryWithAsync catchFunction computation = - computation |> CreateTryWithDispatchInfoAsync (fun edi -> catchFunction (edi.GetAssociatedSourceException())) + /// Create an async for a try/with filtering exceptions through a pattern match + let inline CreateTryWithFilterAsync catchFunction computation = + MakeAsync (fun ctxt -> TryWith ctxt computation (fun edi -> catchFunction edi)) - /// Call the finallyFunction if the computation results in a cancellation + /// Create an async for a try/with filtering + let inline CreateTryWithAsync catchFunction computation = + CreateTryWithFilterAsync (fun exn -> Some (catchFunction exn)) computation + + /// Call the finallyFunction if the computation results in a cancellation, and then continue with cancellation. + /// If the finally function gives an exception then continue with cancellation regardless. let CreateWhenCancelledAsync (finallyFunction : OperationCanceledException -> unit) computation = MakeAsync (fun ctxt -> - let aux = ctxt.aux - let ccont exn = ProtectUserCodePlusHijackCheck aux.trampolineHolder finallyFunction exn (fun _ -> aux.ccont exn) (fun _ -> aux.ccont exn) - let newCtxt = { ctxt with aux = { aux with ccont = ccont } } + let ccont = ctxt.ccont + let newCtxt = + ctxt.WithCancellationContinuation(fun exn -> + CallThenContinue finallyFunction exn (ctxt.WithContinuations(cont = (fun _ -> ccont exn), econt = (fun _ -> ccont exn)))) computation.Invoke newCtxt) /// A single pre-allocated computation that fetched the current cancellation token @@ -480,18 +587,20 @@ namespace Microsoft.FSharp.Control Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicFunctions.Dispose resource CreateTryFinallyAsync disposeFunction (CreateCallAsync computation resource) |> CreateWhenCancelledAsync disposeFunction - let CreateIgnoreAsync computation = + let inline CreateIgnoreAsync computation = CreateBindAsync computation (fun _ -> unitAsync) - /// Implement the while loop construct of async commputation expressions - let rec CreateWhileAsync guardFunc computation = + /// Implement the while loop construct of async computation expressions + let CreateWhileAsync guardFunc computation = if guardFunc() then - CreateBindAsync computation (fun () -> CreateWhileAsync guardFunc computation) + let mutable whileAsync = Unchecked.defaultof<_> + whileAsync <- CreateBindAsync computation (fun () -> if guardFunc() then whileAsync else unitAsync) + whileAsync else unitAsync /// Implement the for loop construct of async commputation expressions - let rec CreateForLoopAsync (source: seq<_>) computation = + let CreateForLoopAsync (source: seq<_>) computation = CreateUsingAsync (source.GetEnumerator()) (fun ie -> CreateWhileAsync (fun () -> ie.MoveNext()) @@ -499,33 +608,29 @@ namespace Microsoft.FSharp.Control let CreateSwitchToAsync (syncCtxt: SynchronizationContext) = CreateProtectedAsync (fun ctxt -> - ctxt.aux.trampolineHolder.PostWithTrampoline syncCtxt ctxt.cont) + ctxt.trampolineHolder.PostWithTrampoline syncCtxt ctxt.cont) let CreateSwitchToNewThreadAsync() = CreateProtectedAsync (fun ctxt -> - ctxt.aux.trampolineHolder.StartThreadWithTrampoline ctxt.cont) + ctxt.trampolineHolder.StartThreadWithTrampoline ctxt.cont) let CreateSwitchToThreadPoolAsync() = CreateProtectedAsync (fun ctxt -> - ctxt.aux.trampolineHolder.QueueWorkItemWithTrampoline ctxt.cont) + ctxt.trampolineHolder.QueueWorkItemWithTrampoline ctxt.cont) - let delimitSyncContext ctxt = + /// Post back to the sync context regardless of which continuation is taken + let DelimitSyncContext (ctxt: AsyncActivation<_>) = match SynchronizationContext.Current with | null -> ctxt | syncCtxt -> - let aux = ctxt.aux - let trampolineHolder = aux.trampolineHolder - { ctxt with - cont = (fun x -> trampolineHolder.PostWithTrampoline syncCtxt (fun () -> ctxt.cont x)) - aux = { aux with - econt = (fun x -> trampolineHolder.PostWithTrampoline syncCtxt (fun () -> aux.econt x)) - ccont = (fun x -> trampolineHolder.PostWithTrampoline syncCtxt (fun () -> aux.ccont x)) } - } + ctxt.WithContinuations(cont = (fun x -> ctxt.trampolineHolder.PostWithTrampoline syncCtxt (fun () -> ctxt.cont x)), + econt = (fun x -> ctxt.trampolineHolder.PostWithTrampoline syncCtxt (fun () -> ctxt.econt x)), + ccont = (fun x -> ctxt.trampolineHolder.PostWithTrampoline syncCtxt (fun () -> ctxt.ccont x))) // When run, ensures that each of the continuations of the process are run in the same synchronization context. let CreateDelimitedUserCodeAsync f = CreateProtectedAsync (fun ctxt -> - let ctxtWithSync = delimitSyncContext ctxt + let ctxtWithSync = DelimitSyncContext ctxt f ctxtWithSync) [] @@ -539,7 +644,7 @@ namespace Microsoft.FSharp.Control | null -> null // saving a thread-local access | _ -> Thread.CurrentThread - let trampolineHolder = ctxt.aux.trampolineHolder + let trampolineHolder = ctxt.trampolineHolder member __.ContinueImmediate res = let action () = ctxt.cont res @@ -608,7 +713,7 @@ namespace Microsoft.FSharp.Control resEvent <- null) interface IDisposable with - member x.Dispose() = x.Close() // ; System.GC.SuppressFinalize(x) + member x.Dispose() = x.Close() member x.GrabResult() = match result with @@ -641,7 +746,7 @@ namespace Microsoft.FSharp.Control // Run the action outside the lock match grabbedConts with - | [] -> FakeUnit + | [] -> Unchecked.defaultof | [cont] -> if reuseThread then cont.ContinueImmediate(res) @@ -673,7 +778,7 @@ namespace Microsoft.FSharp.Control ) match resOpt with | Some res -> ctxt.cont res - | None -> FakeUnit + | None -> Unchecked.defaultof ) member x.TryWaitForResultSynchronously (?timeout) : 'T option = @@ -717,13 +822,15 @@ namespace Microsoft.FSharp.Control let invokeMeth = (typeof>).GetMethod("Invoke", BindingFlags.Public ||| BindingFlags.NonPublic ||| BindingFlags.Instance) System.Delegate.CreateDelegate(typeof<'Delegate>, obj, invokeMeth) :?> 'Delegate + [] let QueueAsync cancellationToken cont econt ccont computation = let trampolineHolder = new TrampolineHolder() trampolineHolder.QueueWorkItemWithTrampoline (fun () -> - let ctxt = CreateAsyncActivation cancellationToken trampolineHolder cont econt ccont + let ctxt = AsyncActivation.Create cancellationToken trampolineHolder cont econt ccont computation.Invoke ctxt) /// Run the asynchronous workflow and wait for its result. + [] let RunSynchronouslyInAnotherThread (token:CancellationToken,computation,timeout) = let token,innerCTS = // If timeout is provided, we govern the async by our own CTS, to cancel @@ -759,14 +866,15 @@ namespace Microsoft.FSharp.Control | None -> () res.Commit() - let RunSynchronouslyInCurrentThread (token:CancellationToken,computation) = + [] + let RunSynchronouslyInCurrentThread (cancellationToken:CancellationToken,computation) = use resultCell = new ResultCell>() - let trampolineHolder = TrampolineHolder() + let trampolineHolder = new TrampolineHolder() trampolineHolder.ExecuteWithTrampoline (fun () -> let ctxt = - CreateAsyncActivation - token + AsyncActivation.Create + cancellationToken trampolineHolder (fun res -> resultCell.RegisterResult(AsyncResult.Ok(res),reuseThread=true)) (fun edi -> resultCell.RegisterResult(AsyncResult.Error(edi),reuseThread=true)) @@ -777,6 +885,7 @@ namespace Microsoft.FSharp.Control let res = resultCell.TryWaitForResultSynchronously().Value res.Commit() + [] let RunSynchronously cancellationToken (computation: Async<'T>) timeout = // Reuse the current ThreadPool thread if possible. Unfortunately // Thread.IsThreadPoolThread isn't available on all profiles so @@ -794,23 +903,26 @@ namespace Microsoft.FSharp.Control // for the cancellation and run the computation in another thread. | _ -> RunSynchronouslyInAnotherThread (cancellationToken, computation, timeout) - let Start cancellationToken computation = + [] + let Start cancellationToken (computation:Async) = QueueAsync cancellationToken - (fun () -> FakeUnit) // nothing to do on success + (fun () -> Unchecked.defaultof) // nothing to do on success (fun edi -> edi.ThrowAny()) // raise exception in child - (fun _ -> FakeUnit) // ignore cancellation in child + (fun _ -> Unchecked.defaultof) // ignore cancellation in child computation |> unfake + [] let StartWithContinuations cancellationToken (computation:Async<'T>) cont econt ccont = let trampolineHolder = new TrampolineHolder() trampolineHolder.ExecuteWithTrampoline (fun () -> - let ctxt = CreateAsyncActivation cancellationToken trampolineHolder (cont >> fake) (econt >> fake) (ccont >> fake) + let ctxt = AsyncActivation.Create cancellationToken trampolineHolder (cont >> fake) (econt >> fake) (ccont >> fake) computation.Invoke ctxt) |> unfake - - let StartAsTask cancellationToken computation taskCreationOptions = + + [] + let StartAsTask cancellationToken (computation:Async<'T>) taskCreationOptions = let taskCreationOptions = defaultArg taskCreationOptions TaskCreationOptions.None let tcs = new TaskCompletionSource<_>(taskCreationOptions) @@ -828,11 +940,10 @@ namespace Microsoft.FSharp.Control task // Helper to attach continuation to the given task. - // Should be invoked as a part of CreateProtectedAsync(withResync) call - let taskContinueWith (task : Task<'T>) ctxt useCcontForTaskCancellation = + let taskContinueWith (task : Task<'T>) (ctxt: AsyncActivation<'T>) useCcontForTaskCancellation = let continuation (completedTask: Task<_>) : unit = - ctxt.aux.trampolineHolder.ExecuteWithTrampoline (fun () -> + ctxt.trampolineHolder.ExecuteWithTrampoline (fun () -> if completedTask.IsCanceled then if useCcontForTaskCancellation then ctxt.OnCancellation () @@ -840,17 +951,18 @@ namespace Microsoft.FSharp.Control let edi = ExceptionDispatchInfo.Capture(new TaskCanceledException(completedTask)) ctxt.CallExceptionContinuation edi elif completedTask.IsFaulted then - let edi = MayLoseStackTrace(completedTask.Exception) + let edi = ExceptionDispatchInfo.RestoreOrCapture(completedTask.Exception) ctxt.CallExceptionContinuation edi else ctxt.cont completedTask.Result) |> unfake task.ContinueWith(Action>(continuation)) |> ignore |> fake - let taskContinueWithUnit (task: Task) ctxt useCcontForTaskCancellation = + [] + let taskContinueWithUnit (task: Task) (ctxt: AsyncActivation) useCcontForTaskCancellation = let continuation (completedTask: Task) : unit = - ctxt.aux.trampolineHolder.ExecuteWithTrampoline (fun () -> + ctxt.trampolineHolder.ExecuteWithTrampoline (fun () -> if completedTask.IsCanceled then if useCcontForTaskCancellation then ctxt.OnCancellation () @@ -858,7 +970,7 @@ namespace Microsoft.FSharp.Control let edi = ExceptionDispatchInfo.Capture(new TaskCanceledException(completedTask)) ctxt.CallExceptionContinuation edi elif completedTask.IsFaulted then - let edi = MayLoseStackTrace(completedTask.Exception) + let edi = ExceptionDispatchInfo.RestoreOrCapture(completedTask.Exception) ctxt.CallExceptionContinuation edi else ctxt.cont ()) |> unfake @@ -956,11 +1068,11 @@ namespace Microsoft.FSharp.Control member __.Delay generator = CreateDelayAsync generator - member __.Return value = CreateReturnAsync value + member inline __.Return value = CreateReturnAsync value - member __.ReturnFrom (computation: Async<_>) = computation + member inline __.ReturnFrom (computation:Async<_>) = computation - member __.Bind (computation, binder) = CreateBindAsync computation binder + member inline __.Bind (computation, binder) = CreateBindAsync computation binder member __.Using (resource, binder) = CreateUsingAsync resource binder @@ -968,17 +1080,18 @@ namespace Microsoft.FSharp.Control member __.For (sequence, body) = CreateForLoopAsync sequence body - member __.Combine (computation1, computation2) = CreateSequentialAsync computation1 computation2 + member inline __.Combine (computation1, computation2) = CreateSequentialAsync computation1 computation2 - member __.TryFinally (computation, compensation) = CreateTryFinallyAsync compensation computation + member inline __.TryFinally (computation, compensation) = CreateTryFinallyAsync compensation computation - member __.TryWith (computation, catchHandler) = CreateTryWithAsync catchHandler computation + member inline __.TryWith (computation, catchHandler) = CreateTryWithAsync catchHandler computation - module AsyncImpl = + // member inline __.TryWithFilter (computation, catchHandler) = CreateTryWithFilterAsync catchHandler computation + + [] + module AsyncBuilderImpl = let async = AsyncBuilder() - open AsyncImpl - [] [] type Async = @@ -996,28 +1109,27 @@ namespace Microsoft.FSharp.Control let mutable contToTailCall = None let thread = Thread.CurrentThread let latch = Latch() - let aux = ctxt.aux let once cont x = if not(latch.Enter()) then invalidOp(SR.GetString(SR.controlContinuationInvokedMultipleTimes)) if Thread.CurrentThread.Equals(thread) && underCurrentThreadStack then contToTailCall <- Some(fun () -> cont x) else if Trampoline.ThisThreadHasTrampoline then let syncCtxt = SynchronizationContext.Current - aux.trampolineHolder.PostOrQueueWithTrampoline syncCtxt (fun () -> cont x) |> unfake + ctxt.trampolineHolder.PostOrQueueWithTrampoline syncCtxt (fun () -> cont x) |> unfake else - aux.trampolineHolder.ExecuteWithTrampoline (fun () -> cont x ) |> unfake + ctxt.trampolineHolder.ExecuteWithTrampoline (fun () -> cont x ) |> unfake try - callback (once ctxt.cont, (fun exn -> once aux.econt (MayLoseStackTrace(exn))), once aux.ccont) + callback (once ctxt.cont, (fun exn -> once ctxt.econt (ExceptionDispatchInfo.RestoreOrCapture(exn))), once ctxt.ccont) with exn -> if not(latch.Enter()) then invalidOp(SR.GetString(SR.controlContinuationInvokedMultipleTimes)) let edi = ExceptionDispatchInfo.RestoreOrCapture(exn) - aux.econt edi |> unfake + ctxt.econt edi |> unfake underCurrentThreadStack <- false match contToTailCall with | Some k -> k() - | _ -> FakeUnit) + | _ -> Unchecked.defaultof) static member DefaultCancellationToken = defaultCancellationTokenSource.Token @@ -1034,10 +1146,10 @@ namespace Microsoft.FSharp.Control static member Catch (computation: Async<'T>) = MakeAsync (fun ctxt -> - let cont = (Choice1Of2 >> ctxt.cont) - let econt (edi: ExceptionDispatchInfo) = ctxt.cont (Choice2Of2 (edi.GetAssociatedSourceException())) - let ctxt = { cont = cont; aux = { ctxt.aux with econt = econt } } - computation.Invoke ctxt) + // Turn the success or exception into data + let newCtxt = ctxt.WithContinuations(cont = (fun res -> ctxt.cont (Choice1Of2 res)), + econt = (fun edi -> ctxt.cont (Choice2Of2 (edi.GetAssociatedSourceException())))) + computation.Invoke newCtxt) static member RunSynchronously (computation: Async<'T>,?timeout,?cancellationToken:CancellationToken) = let timeout, cancellationToken = @@ -1071,49 +1183,48 @@ namespace Microsoft.FSharp.Control match result with | Some r -> r | None -> - if tasks.Length = 0 then - ctxt.cont [| |] - else // must not be in a 'protect' if we call cont explicitly; if cont throws, it should unwind the stack, preserving Dev10 behavior - ProtectUserCode ctxt (fun ctxt -> - let ctxtWithSync = delimitSyncContext ctxt // manually resync - let aux = ctxtWithSync.aux - let count = ref tasks.Length - let firstExn = ref None + if tasks.Length = 0 then + // must not be in a 'protect' if we call cont explicitly; if cont throws, it should unwind the stack, preserving Dev10 behavior + ctxt.cont [| |] + else + ProtectedCode ctxt (fun ctxt -> + let ctxtWithSync = DelimitSyncContext ctxt // manually resync + let mutable count = tasks.Length + let mutable firstExn = None let results = Array.zeroCreate tasks.Length // Attempt to cancel the individual operations if an exception happens on any of the other threads - let innerCTS = new LinkedSubSource(aux.token) - let trampolineHolder = aux.trampolineHolder + let innerCTS = new LinkedSubSource(ctxtWithSync.token) let finishTask(remaining) = if (remaining = 0) then innerCTS.Dispose() - match (!firstExn) with - | None -> trampolineHolder.ExecuteWithTrampoline (fun () -> ctxtWithSync.cont results) - | Some (Choice1Of2 exn) -> trampolineHolder.ExecuteWithTrampoline (fun () -> aux.econt exn) - | Some (Choice2Of2 cexn) -> trampolineHolder.ExecuteWithTrampoline (fun () -> aux.ccont cexn) + match firstExn with + | None -> ctxtWithSync.trampolineHolder.ExecuteWithTrampoline (fun () -> ctxtWithSync.cont results) + | Some (Choice1Of2 exn) -> ctxtWithSync.trampolineHolder.ExecuteWithTrampoline (fun () -> ctxtWithSync.econt exn) + | Some (Choice2Of2 cexn) -> ctxtWithSync.trampolineHolder.ExecuteWithTrampoline (fun () -> ctxtWithSync.ccont cexn) else - FakeUnit + Unchecked.defaultof // recordSuccess and recordFailure between them decrement count to 0 and // as soon as 0 is reached dispose innerCancellationSource let recordSuccess i res = - results.[i] <- res; - finishTask(Interlocked.Decrement count) + results.[i] <- res + finishTask(Interlocked.Decrement &count) let recordFailure exn = // capture first exception and then decrement the counter to avoid race when // - thread 1 decremented counter and preempted by the scheduler // - thread 2 decremented counter and called finishTask // since exception is not yet captured - finishtask will fall into success branch - match Interlocked.CompareExchange(firstExn, Some exn, None) with + match Interlocked.CompareExchange(&firstExn, Some exn, None) with | None -> // signal cancellation before decrementing the counter - this guarantees that no other thread can sneak to finishTask and dispose innerCTS // NOTE: Cancel may introduce reentrancy - i.e. when handler registered for the cancellation token invokes cancel continuation that will call 'recordFailure' // to correctly handle this we need to return decremented value, not the current value of 'count' otherwise we may invoke finishTask with value '0' several times innerCTS.Cancel() | _ -> () - finishTask(Interlocked.Decrement count) + finishTask(Interlocked.Decrement &count) tasks |> Array.iteri (fun i p -> QueueAsync @@ -1125,8 +1236,8 @@ namespace Microsoft.FSharp.Control // on cancellation... (fun cexn -> recordFailure (Choice2Of2 cexn)) p - |> unfake); - FakeUnit)) + |> unfake) + Unchecked.defaultof)) static member Choice(computations : Async<'T option> seq) : Async<'T option> = MakeAsync (fun ctxt -> @@ -1138,44 +1249,42 @@ namespace Microsoft.FSharp.Control | Choice2Of2 edi -> ctxt.CallExceptionContinuation edi | Choice1Of2 [||] -> ctxt.cont None | Choice1Of2 computations -> - ProtectUserCode ctxt (fun ctxt -> - let ctxtWithSync = delimitSyncContext ctxt - let aux = ctxtWithSync.aux + ProtectedCode ctxt (fun ctxt -> + let ctxtWithSync = DelimitSyncContext ctxt let noneCount = ref 0 let exnCount = ref 0 - let innerCts = new LinkedSubSource(aux.token) - let trampolineHolder = aux.trampolineHolder + let innerCts = new LinkedSubSource(ctxtWithSync.token) let scont (result : 'T option) = match result with | Some _ -> if Interlocked.Increment exnCount = 1 then - innerCts.Cancel(); trampolineHolder.ExecuteWithTrampoline (fun () -> ctxtWithSync.cont result) + innerCts.Cancel(); ctxtWithSync.trampolineHolder.ExecuteWithTrampoline (fun () -> ctxtWithSync.cont result) else - FakeUnit + Unchecked.defaultof | None -> if Interlocked.Increment noneCount = computations.Length then - innerCts.Cancel(); trampolineHolder.ExecuteWithTrampoline (fun () -> ctxtWithSync.cont None) + innerCts.Cancel(); ctxtWithSync.trampolineHolder.ExecuteWithTrampoline (fun () -> ctxtWithSync.cont None) else - FakeUnit + Unchecked.defaultof let econt (exn : ExceptionDispatchInfo) = if Interlocked.Increment exnCount = 1 then - innerCts.Cancel(); trampolineHolder.ExecuteWithTrampoline (fun () -> ctxtWithSync.aux.econt exn) + innerCts.Cancel(); ctxtWithSync.trampolineHolder.ExecuteWithTrampoline (fun () -> ctxtWithSync.econt exn) else - FakeUnit + Unchecked.defaultof let ccont (exn : OperationCanceledException) = if Interlocked.Increment exnCount = 1 then - innerCts.Cancel(); trampolineHolder.ExecuteWithTrampoline (fun () -> ctxtWithSync.aux.ccont exn) + innerCts.Cancel(); ctxtWithSync.trampolineHolder.ExecuteWithTrampoline (fun () -> ctxtWithSync.ccont exn) else - FakeUnit + Unchecked.defaultof for c in computations do QueueAsync innerCts.Token scont econt ccont c |> unfake - FakeUnit)) + Unchecked.defaultof)) type Async with @@ -1193,8 +1302,8 @@ namespace Microsoft.FSharp.Control let task = ts.Task Async.StartWithContinuations( computation, - (fun (k) -> ts.SetResult(k)), - (fun exn -> ts.SetException(exn)), + (fun k -> ts.SetResult k), + (fun exn -> ts.SetException exn), (fun _ -> ts.SetCanceled()), cancellationToken) task @@ -1205,50 +1314,48 @@ namespace Microsoft.FSharp.Control static member Sleep(millisecondsDueTime) : Async = CreateDelimitedUserCodeAsync (fun ctxt -> - let aux = ctxt.aux - let timer = ref (None : Timer option) - let savedCont = ctxt.cont - let savedCCont = aux.ccont + let mutable timer = None : Timer option + let cont = ctxt.cont + let ccont = ctxt.ccont let latch = new Latch() let registration = - aux.token.Register( + ctxt.token.Register( (fun _ -> if latch.Enter() then - match !timer with + match timer with | None -> () | Some t -> t.Dispose() - aux.trampolineHolder.ExecuteWithTrampoline (fun () -> savedCCont(new OperationCanceledException(aux.token))) |> unfake - ), + ctxt.trampolineHolder.ExecuteWithTrampoline (fun () -> ccont(new OperationCanceledException(ctxt.token))) |> unfake), null) let mutable edi = null try - timer := new Timer((fun _ -> + timer <- new Timer((fun _ -> if latch.Enter() then // NOTE: If the CTS for the token would have been disposed, disposal of the registration would throw // However, our contract is that until async computation ceases execution (and invokes ccont) // the CTS will not be disposed. Execution of savedCCont is guarded by latch, so we are safe unless // user violates the contract. registration.Dispose() - // Try to Dispose of the TImer. + // Try to Dispose of the Timer. // Note: there is a race here: the Timer time very occasionally // calls the callback _before_ the timer object has been recorded anywhere. This makes it difficult to dispose the // timer in this situation. In this case we just let the timer be collected by finalization. - match !timer with + match timer with | None -> () | Some t -> t.Dispose() // Now we're done, so call the continuation - aux.trampolineHolder.ExecuteWithTrampoline (fun () -> savedCont()) |> unfake), + ctxt.trampolineHolder.ExecuteWithTrampoline (fun () -> cont()) |> unfake), null, dueTime=millisecondsDueTime, period = -1) |> Some with exn -> if latch.Enter() then - edi <- ExceptionDispatchInfo.RestoreOrCapture(exn) // post exception to econt only if we successfully enter the latch (no other continuations were called) + // post exception to econt only if we successfully enter the latch (no other continuations were called) + edi <- ExceptionDispatchInfo.RestoreOrCapture(exn) match edi with | null -> - FakeUnit + Unchecked.defaultof | _ -> - aux.econt edi - ) + ctxt.econt edi) /// Wait for a wait handle. Both timeout and cancellation are supported static member AwaitWaitHandle(waitHandle: WaitHandle, ?millisecondsTimeout:int) = @@ -1279,7 +1386,7 @@ namespace Microsoft.FSharp.Control match !rwh with | None -> () | Some rwh -> rwh.Unregister(null) |> ignore) - Async.Start (async { do (aux.ccont (OperationCanceledException(aux.token)) |> unfake) })) + Async.Start (async { do (ctxt.ccont (OperationCanceledException(aux.token)) |> unfake) })) and registration : CancellationTokenRegistration = aux.token.Register(cancelHandler, null) @@ -1293,17 +1400,17 @@ namespace Microsoft.FSharp.Control lock rwh (fun () -> rwh.Value.Value.Unregister(null) |> ignore) rwh := None registration.Dispose() - aux.trampolineHolder.ExecuteWithTrampoline (fun () -> savedCont (not timeOut)) |> unfake), + ctxt.trampolineHolder.ExecuteWithTrampoline (fun () -> savedCont (not timeOut)) |> unfake), state=null, millisecondsTimeOutInterval=millisecondsTimeout, executeOnlyOnce=true)); - FakeUnit) + Unchecked.defaultof) with _ -> if latch.Enter() then registration.Dispose() reraise() // reraise exception only if we successfully enter the latch (no other continuations were called) else - FakeUnit + Unchecked.defaultof ) static member AwaitIAsyncResult(iar: IAsyncResult, ?millisecondsTimeout): Async = @@ -1319,7 +1426,7 @@ namespace Microsoft.FSharp.Control (match result with | Ok v -> ctxt.cont v | Error exn -> ctxt.CallExceptionContinuation exn - | Canceled exn -> ctxt.aux.ccont exn) ) + | Canceled exn -> ctxt.ccont exn) ) /// Await and use the result of a result cell. The resulting async doesn't support cancellation /// or timeout directly, rather the underlying computation must fill the result if cancellation @@ -1603,18 +1710,18 @@ namespace Microsoft.FSharp.Control let canceled = ref false // WebException with Status = WebExceptionStatus.RequestCanceled can be raised in other situations except cancellation, use flag to filter out false positives - // Use CreateTryWithDispatchInfoAsync to allow propagation of ExceptionDispatchInfo + // Use CreateTryWithFilterAsync to allow propagation of exception without losing stack Async.FromBeginEnd(beginAction=req.BeginGetResponse, endAction = req.EndGetResponse, cancelAction = fun() -> canceled := true; req.Abort()) - |> CreateTryWithDispatchInfoAsync (fun edi -> - match edi.SourceException with + |> CreateTryWithFilterAsync (fun exn -> + match exn with | :? System.Net.WebException as webExn when webExn.Status = System.Net.WebExceptionStatus.RequestCanceled && !canceled -> - Async.BindResult(AsyncResult.Canceled (OperationCanceledException webExn.Message)) + Some (Async.BindResult(AsyncResult.Canceled (OperationCanceledException webExn.Message))) | _ -> - edi.ThrowAny()) + None) #if !FX_NO_WEB_CLIENT diff --git a/src/fsharp/FSharp.Core/async.fsi b/src/fsharp/FSharp.Core/async.fsi index 9ce73b10cc..53f6877628 100644 --- a/src/fsharp/FSharp.Core/async.fsi +++ b/src/fsharp/FSharp.Core/async.fsi @@ -25,9 +25,7 @@ namespace Microsoft.FSharp.Control /// computation expressions can check the cancellation condition regularly. Synchronous /// computations within an asynchronous computation do not automatically check this condition. - [] - [] - [] + [] type Async<'T> /// This static class holds members for creating and manipulating asynchronous computations. @@ -417,7 +415,6 @@ namespace Microsoft.FSharp.Control static member StartImmediate: computation:Async * ?cancellationToken:CancellationToken-> unit - /// Runs an asynchronous computation, starting immediately on the current operating system, /// but also returns the execution as System.Threading.Tasks.Task /// @@ -435,6 +432,112 @@ namespace Microsoft.FSharp.Control computation:Async<'T> * ?cancellationToken:CancellationToken-> Task<'T> + /// The F# compiler emits references to this type to implement F# async expressions. + type AsyncReturn + + /// The F# compiler emits references to this type to implement F# async expressions. + [] + type AsyncActivation<'T> = + + /// The F# compiler emits calls to this function to implement F# async expressions. + /// + /// A value indicating asynchronous execution. + member IsCancellationRequested: bool + + /// The F# compiler emits calls to this function to implement F# async expressions. + /// + /// A value indicating asynchronous execution. + member OnSuccess: 'T -> AsyncReturn + + /// The F# compiler emits calls to this function to implement F# async expressions. + member OnExceptionRaised: unit -> unit + + /// The F# compiler emits calls to this function to implement F# async expressions. + /// + /// A value indicating asynchronous execution. + member OnCancellation: unit -> AsyncReturn + + /// Used by MailboxProcessor + member internal QueueContinuationWithTrampoline: 'T -> AsyncReturn + /// Used by MailboxProcessor + member internal CallContinuation: 'T -> AsyncReturn + + [] + // Internals used by MailboxProcessor + type internal AsyncResult<'T> = + | Ok of 'T + | Error of ExceptionDispatchInfo + | Canceled of OperationCanceledException + + [] + /// Entry points for generated code + module AsyncPrimitives = + + /// The F# compiler emits calls to this function to implement F# async expressions. + /// + /// The body of the async computation. + /// + /// The async computation. + val MakeAsync: body:(AsyncActivation<'T> -> AsyncReturn) -> Async<'T> + + /// The F# compiler emits calls to this function to implement constructs for F# async expressions. + /// + /// The async computation. + /// The async activation. + /// + /// A value indicating asynchronous execution. + val Invoke: computation: Async<'T> -> ctxt:AsyncActivation<'T> -> AsyncReturn + + /// The F# compiler emits calls to this function to implement constructs for F# async expressions. + /// + /// The async activation. + /// The result of the first part of the computation. + /// A function returning the second part of the computation. + /// + /// A value indicating asynchronous execution. + val CallThenInvoke: ctxt:AsyncActivation<'T> -> result1:'U -> part2:('U -> Async<'T>) -> AsyncReturn + + /// The F# compiler emits calls to this function to implement the let! construct for F# async expressions. + /// + /// The async activation. + /// A function returning the second part of the computation. + /// + /// An async activation suitable for running part1 of the asynchronous execution. + val Bind: ctxt:AsyncActivation<'T> -> part1:Async<'U> -> part2:('U -> Async<'T>) -> AsyncReturn + + /// The F# compiler emits calls to this function to implement the try/finally construct for F# async expressions. + /// + /// The async activation. + /// The computation to protect. + /// The finally code. + /// + /// A value indicating asynchronous execution. + val TryFinally: ctxt:AsyncActivation<'T> -> computation: Async<'T> -> finallyFunction: (unit -> unit) -> AsyncReturn + + /// The F# compiler emits calls to this function to implement the try/with construct for F# async expressions. + /// + /// The async activation. + /// The computation to protect. + /// The exception filter. + /// + /// A value indicating asynchronous execution. + val TryWith: ctxt:AsyncActivation<'T> -> computation: Async<'T> -> catchFunction: (Exception -> Async<'T> option) -> AsyncReturn + + [] + // Internals used by MailboxProcessor + type internal ResultCell<'T> = + new : unit -> ResultCell<'T> + member GetWaitHandle: unit -> WaitHandle + member Close: unit -> unit + interface IDisposable + member RegisterResult: 'T * reuseThread: bool -> AsyncReturn + member GrabResult: unit -> 'T + member ResultAvailable : bool + member AwaitResult_NoDirectCancelOrTimeout : Async<'T> + member TryWaitForResultSynchronously: ?timeout: int -> 'T option + + // Internals used by MailboxProcessor + val internal CreateAsyncResultAsync : AsyncResult<'T> -> Async<'T> [] [] @@ -473,7 +576,7 @@ namespace Microsoft.FSharp.Control /// The first part of the sequenced computation. /// The second part of the sequenced computation. /// An asynchronous computation that runs both of the computations sequentially. - member Combine : computation1:Async * computation2:Async<'T> -> Async<'T> + member inline Combine : computation1:Async * computation2:Async<'T> -> Async<'T> /// Creates an asynchronous computation that runs computation repeatedly /// until guard() becomes false. @@ -496,7 +599,7 @@ namespace Microsoft.FSharp.Control /// async { ... } computation expression syntax. /// The value to return from the computation. /// An asynchronous computation that returns value when executed. - member Return : value:'T -> Async<'T> + member inline Return : value:'T -> Async<'T> /// Delegates to the input computation. /// @@ -504,7 +607,7 @@ namespace Microsoft.FSharp.Control /// async { ... } computation expression syntax. /// The input computation. /// The input computation. - member ReturnFrom : computation:Async<'T> -> Async<'T> + member inline ReturnFrom : computation:Async<'T> -> Async<'T> /// Creates an asynchronous computation that runs generator. /// @@ -538,7 +641,7 @@ namespace Microsoft.FSharp.Control /// The function to bind the result of computation. /// An asynchronous computation that performs a monadic bind on the result /// of computation. - member Bind: computation: Async<'T> * binder: ('T -> Async<'U>) -> Async<'U> + member inline Bind: computation: Async<'T> * binder: ('T -> Async<'U>) -> Async<'U> /// Creates an asynchronous computation that runs computation. The action compensation is executed /// after computation completes, whether computation exits normally or by an exception. If compensation raises an exception itself @@ -553,7 +656,7 @@ namespace Microsoft.FSharp.Control /// exception (including cancellation). /// An asynchronous computation that executes computation and compensation afterwards or /// when an exception is raised. - member TryFinally : computation:Async<'T> * compensation:(unit -> unit) -> Async<'T> + member inline TryFinally : computation:Async<'T> * compensation:(unit -> unit) -> Async<'T> /// Creates an asynchronous computation that runs computation and returns its result. /// If an exception happens then catchHandler(exn) is called and the resulting computation executed instead. @@ -562,11 +665,14 @@ namespace Microsoft.FSharp.Control /// /// The existence of this method permits the use of try/with in the /// async { ... } computation expression syntax. + /// /// The input computation. /// The function to run when computation throws an exception. /// An asynchronous computation that executes computation and calls catchHandler if an /// exception is thrown. - member TryWith : computation:Async<'T> * catchHandler:(exn -> Async<'T>) -> Async<'T> + member inline TryWith : computation:Async<'T> * catchHandler:(exn -> Async<'T>) -> Async<'T> + + // member inline TryWithFilter : computation:Async<'T> * catchHandler:(exn -> Async<'T> option) -> Async<'T> /// Generate an object used to build asynchronous computations using F# computation expressions. The value /// 'async' is a pre-defined instance of this type. @@ -659,41 +765,6 @@ namespace Microsoft.FSharp.Control #endif // Internals used by MailboxProcessor - module internal AsyncImpl = + module internal AsyncBuilderImpl = val async : AsyncBuilder - [] - // Internals used by MailboxProcessor - type internal AsyncReturn - - [] - // Internals used by MailboxProcessor - type internal AsyncActivation<'T> = - member QueueContinuationWithTrampoline: 'T -> AsyncReturn - member CallContinuation: 'T -> AsyncReturn - - [] - // Internals used by MailboxProcessor - type internal AsyncResult<'T> = - | Ok of 'T - | Error of ExceptionDispatchInfo - | Canceled of OperationCanceledException - - // Internals used by MailboxProcessor - module internal AsyncPrimitives = - - [] - type internal ResultCell<'T> = - new : unit -> ResultCell<'T> - member GetWaitHandle: unit -> WaitHandle - member Close: unit -> unit - interface IDisposable - member RegisterResult: 'T * reuseThread: bool -> AsyncReturn - member GrabResult: unit -> 'T - member ResultAvailable : bool - member AwaitResult_NoDirectCancelOrTimeout : Async<'T> - member TryWaitForResultSynchronously: ?timeout: int -> 'T option - - val CreateAsyncResultAsync : AsyncResult<'T> -> Async<'T> - - val MakeAsync : (AsyncActivation<'T> -> AsyncReturn) -> Async<'T> diff --git a/src/fsharp/FSharp.Core/mailbox.fs b/src/fsharp/FSharp.Core/mailbox.fs index c83bc49e5f..f58a94b6f1 100644 --- a/src/fsharp/FSharp.Core/mailbox.fs +++ b/src/fsharp/FSharp.Core/mailbox.fs @@ -7,7 +7,7 @@ namespace Microsoft.FSharp.Control open Microsoft.FSharp.Core open Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicOperators open Microsoft.FSharp.Control - open Microsoft.FSharp.Control.AsyncImpl + open Microsoft.FSharp.Control.AsyncBuilderImpl open Microsoft.FSharp.Control.AsyncPrimitives open Microsoft.FSharp.Collections diff --git a/src/fsharp/FSharp.Core/prim-types.fs b/src/fsharp/FSharp.Core/prim-types.fs index 210e23841b..560f1ded17 100644 --- a/src/fsharp/FSharp.Core/prim-types.fs +++ b/src/fsharp/FSharp.Core/prim-types.fs @@ -2764,17 +2764,17 @@ namespace Microsoft.FSharp.Core // Function Values [] - type FSharpTypeFunc() = + type FSharpTypeFunc [] () = abstract Specialize<'T> : unit -> obj [] - type FSharpFunc<'T,'Res>() = + type FSharpFunc<'T,'Res> [] () = abstract Invoke : 'T -> 'Res module OptimizedClosures = [] - type FSharpFunc<'T,'U,'V>() = + type FSharpFunc<'T,'U,'V> [] () = inherit FSharpFunc<'T,('U -> 'V)>() abstract Invoke : 'T * 'U -> 'V override f.Invoke(t) = (fun u -> f.Invoke(t,u)) @@ -2787,7 +2787,7 @@ namespace Microsoft.FSharp.Core member x.Invoke(t,u) = (retype func : FSharpFunc<'T,FSharpFunc<'U,'V>>).Invoke(t).Invoke(u) } [] - type FSharpFunc<'T,'U,'V,'W>() = + type FSharpFunc<'T,'U,'V,'W> [] () = inherit FSharpFunc<'T,('U -> 'V -> 'W)>() abstract Invoke : 'T * 'U * 'V -> 'W override f.Invoke(t) = (fun u v -> f.Invoke(t,u,v)) @@ -2805,7 +2805,7 @@ namespace Microsoft.FSharp.Core member x.Invoke(t,u,v) = (retype func : FSharpFunc<'T,('U -> 'V -> 'W)>).Invoke(t) u v } [] - type FSharpFunc<'T,'U,'V,'W,'X>() = + type FSharpFunc<'T,'U,'V,'W,'X> [] () = inherit FSharpFunc<'T,('U -> 'V -> 'W -> 'X)>() abstract Invoke : 'T * 'U * 'V * 'W -> 'X static member Adapt(func : 'T -> 'U -> 'V -> 'W -> 'X) = @@ -2828,7 +2828,7 @@ namespace Microsoft.FSharp.Core override f.Invoke(t) = (fun u v w -> f.Invoke(t,u,v,w)) [] - type FSharpFunc<'T,'U,'V,'W,'X,'Y>() = + type FSharpFunc<'T,'U,'V,'W,'X,'Y> [] () = inherit FSharpFunc<'T,('U -> 'V -> 'W -> 'X -> 'Y)>() abstract Invoke : 'T * 'U * 'V * 'W * 'X -> 'Y override f.Invoke(t) = (fun u v w x -> f.Invoke(t,u,v,w,x)) @@ -2972,7 +2972,6 @@ namespace Microsoft.FSharp.Core and 'T option = Option<'T> - [] [] [] @@ -2980,6 +2979,17 @@ namespace Microsoft.FSharp.Core | Ok of ResultValue:'T | Error of ErrorValue:'TError + [] + [] + [] + type ValueOption<'T> = + | ValueNone : 'T voption + | ValueSome : 'T -> 'T voption + + member x.Value = match x with ValueSome x -> x | ValueNone -> raise (new System.InvalidOperationException("ValueOption.Value")) + + + and 'T voption = ValueOption<'T> namespace Microsoft.FSharp.Collections @@ -3345,11 +3355,11 @@ namespace Microsoft.FSharp.Core let (^) (s1: string) (s2: string) = System.String.Concat(s1, s2) - [] - [] let defaultArg arg defaultValue = match arg with None -> defaultValue | Some v -> v + [] + let defaultValueArg arg defaultValue = match arg with ValueNone -> defaultValue | ValueSome v -> v [] let inline (~-) (n: ^T) : ^T = diff --git a/src/fsharp/FSharp.Core/prim-types.fsi b/src/fsharp/FSharp.Core/prim-types.fsi index 9e9bb34c2b..599e0b0ffe 100644 --- a/src/fsharp/FSharp.Core/prim-types.fsi +++ b/src/fsharp/FSharp.Core/prim-types.fsi @@ -1733,6 +1733,33 @@ namespace Microsoft.FSharp.Core /// due to the use of null as a value representation. and 'T option = Option<'T> + /// The type of optional values, represented as structs. + /// + /// Use the constructors ValueSome and ValueNone to create values of this type. + /// Use the values in the ValueOption module to manipulate values of this type, + /// or pattern match against the values directly. + [] + [] + [] + type ValueOption<'T> = + /// The representation of "No value" + | ValueNone: 'T voption + + /// The representation of "Value of type 'T" + /// The input value. + /// An option representing the value. + | ValueSome: 'T -> 'T voption + + /// Get the value of a 'ValueSome' option. An InvalidOperationException is raised if the option is 'ValueNone'. + member Value : 'T + + /// The type of optional values, represented as structs. + /// + /// Use the constructors ValueSome and ValueNone to create values of this type. + /// Use the values in the ValueOption module to manipulate values of this type, + /// or pattern match against the values directly. + and 'T voption = ValueOption<'T> + /// Helper type for error handling without exceptions. [] [] @@ -1998,6 +2025,13 @@ namespace Microsoft.FSharp.Core [] val defaultArg : arg:'T option -> defaultValue:'T -> 'T + /// Used to specify a default value for an optional argument in the implementation of a function + /// A value option representing the argument. + /// The default value of the argument. + /// The argument value. If it is None, the defaultValue is returned. + [] + val defaultValueArg : arg:'T voption -> defaultValue:'T -> 'T + /// Concatenate two strings. The operator '+' may also be used. [] val (^): s1:string -> s2:string -> string diff --git a/src/fsharp/IlxGen.fs b/src/fsharp/IlxGen.fs index e93708737d..eac580fddc 100644 --- a/src/fsharp/IlxGen.fs +++ b/src/fsharp/IlxGen.fs @@ -714,11 +714,11 @@ let AddStorageForVal (g: TcGlobals) (v,s) eenv = | None -> eenv | Some vref -> match vref.TryDeref with - | VNone -> + | ValueNone -> //let msg = sprintf "could not dereference external value reference to something in FSharp.Core.dll during code generation, v.MangledName = '%s', v.Range = %s" v.MangledName (stringOfRange v.Range) //System.Diagnostics.Debug.Assert(false, msg) eenv - | VSome gv -> + | ValueSome gv -> { eenv with valsInScope = eenv.valsInScope.Add gv s } else eenv diff --git a/src/fsharp/MethodOverrides.fs b/src/fsharp/MethodOverrides.fs index 064006503b..77b98010d3 100644 --- a/src/fsharp/MethodOverrides.fs +++ b/src/fsharp/MethodOverrides.fs @@ -305,8 +305,7 @@ module DispatchSlotChecking = let (CompiledSig (vargtys,_,fvmtps,_)) = compiledSig if moreThanOnePossibleDispatchSlot then - // Error will be reported below in CheckOverridesAreAllUsedOnce - () + noimpl() elif argTys.Length <> vargtys.Length then fail(Error(FSComp.SR.typrelMemberDoesNotHaveCorrectNumberOfArguments(FormatOverride denv overrideBy, FormatMethInfoSig g amap m denv dispatchSlot), overrideBy.Range)) diff --git a/src/fsharp/NameResolution.fs b/src/fsharp/NameResolution.fs index 499d2cb770..3aa0c1255b 100644 --- a/src/fsharp/NameResolution.fs +++ b/src/fsharp/NameResolution.fs @@ -249,8 +249,8 @@ type Item = let valRefHash (vref: ValRef) = match vref.TryDeref with - | VNone -> 0 - | VSome v -> LanguagePrimitives.PhysicalHash v + | ValueNone -> 0 + | ValueSome v -> LanguagePrimitives.PhysicalHash v [] /// Pairs an Item with a TyparInst showing how generic type variables of the item are instantiated at diff --git a/src/fsharp/TastOps.fs b/src/fsharp/TastOps.fs index fe8f0dd49c..cf05df8794 100644 --- a/src/fsharp/TastOps.fs +++ b/src/fsharp/TastOps.fs @@ -6324,9 +6324,9 @@ let mkCallLiftValueWithName (g:TcGlobals) m ty nm e1 = let vref = ValRefForIntrinsic g.lift_value_with_name_info // Use "Expr.ValueWithName" if it exists in FSharp.Core match vref.TryDeref with - | VSome _ -> + | ValueSome _ -> mkApps g (typedExprForIntrinsic g m g.lift_value_with_name_info , [[ty]], [mkRefTupledNoTypes g m [e1; mkString g m nm]], m) - | VNone -> + | ValueNone -> mkApps g (typedExprForIntrinsic g m g.lift_value_info , [[ty]], [e1], m) let mkCallLiftValueWithDefn g m qty e1 = @@ -6335,11 +6335,11 @@ let mkCallLiftValueWithDefn g m qty e1 = let vref = ValRefForIntrinsic g.lift_value_with_defn_info // Use "Expr.WithValue" if it exists in FSharp.Core match vref.TryDeref with - | VSome _ -> + | ValueSome _ -> let copyOfExpr = copyExpr g ValCopyFlag.CloneAll e1 let quoteOfCopyOfExpr = Expr.Quote(copyOfExpr, ref None, false, m, qty) mkApps g (typedExprForIntrinsic g m g.lift_value_with_defn_info , [[ty]], [mkRefTupledNoTypes g m [e1; quoteOfCopyOfExpr]], m) - | VNone -> + | ValueNone -> Expr.Quote(e1, ref None, false, m, qty) let mkCallCheckThis g m ty e1 = diff --git a/src/fsharp/TypeChecker.fs b/src/fsharp/TypeChecker.fs index b36ab3c64e..01182d672c 100755 --- a/src/fsharp/TypeChecker.fs +++ b/src/fsharp/TypeChecker.fs @@ -10036,11 +10036,13 @@ and TcMethodArg cenv env (lambdaPropagationInfo, tpenv) (lambdaPropagationInfo // The loop variable callerLambdaTyOpt becomes None if something failed. let rec loop callerLambdaTy lambdaVarNum = if lambdaVarNum < numLambdaVars then - let col = [ for row in prefixOfLambdaArgsForEachOverload -> row.[lambdaVarNum] ] - // Check if all the rows give the same argument type - if col |> ListSet.setify (typeEquiv cenv.g) |> isSingleton then - let calledLambdaArgTy = col.[0] - // Force the caller to be a function type. + let calledLambdaArgTy = prefixOfLambdaArgsForEachOverload.[0].[lambdaVarNum] + let allRowsGiveSameArgumentType = + prefixOfLambdaArgsForEachOverload + |> Array.forall (fun row -> typeEquiv cenv.g calledLambdaArgTy row.[lambdaVarNum]) + + if allRowsGiveSameArgumentType then + // Force the caller to be a function type. match UnifyFunctionTypeUndoIfFailed cenv env.DisplayEnv mArg callerLambdaTy with | Some (callerLambdaDomainTy, callerLambdaRangeTy) -> if AddCxTypeEqualsTypeUndoIfFailed env.DisplayEnv cenv.css mArg calledLambdaArgTy callerLambdaDomainTy then @@ -16913,8 +16915,8 @@ let ApplyAssemblyLevelAutoOpenAttributeToTcEnv g amap (ccu: CcuThunk) scopem env let h, t = List.frontAndBack p let modref = mkNonLocalTyconRef (mkNonLocalEntityRef ccu (Array.ofList h)) t match modref.TryDeref with - | VNone -> warn() - | VSome _ -> + | ValueNone -> warn() + | ValueSome _ -> let openDecl = OpenDeclaration.Create ([], [modref], scopem, false) OpenModulesOrNamespaces TcResultsSink.NoSink g amap scopem root env [modref] openDecl diff --git a/src/fsharp/infos.fs b/src/fsharp/infos.fs index eb9e78ff61..10883ebabc 100755 --- a/src/fsharp/infos.fs +++ b/src/fsharp/infos.fs @@ -1095,7 +1095,7 @@ type MethInfo = | ILMeth(_,ilmeth,_) -> ilmeth.IsClassConstructor | FSMeth(_,_,vref,_) -> match vref.TryDeref with - | VSome x -> x.IsClassConstructor + | ValueSome x -> x.IsClassConstructor | _ -> false | DefaultStructCtor _ -> false #if !NO_EXTENSIONTYPING diff --git a/src/fsharp/tast.fs b/src/fsharp/tast.fs index 1252f4c1ed..79ced26c8a 100644 --- a/src/fsharp/tast.fs +++ b/src/fsharp/tast.fs @@ -2899,7 +2899,7 @@ and NonLocalEntityRef = /// Try to find the entity corresponding to the given path in the given CCU static member TryDerefEntityPath(ccu: CcuThunk, path:string[], i:int, entity:Entity) = - if i >= path.Length then VSome entity + if i >= path.Length then ValueSome entity else let next = entity.ModuleOrNamespaceType.AllEntitiesByCompiledAndLogicalMangledNames.TryFind(path.[i]) match next with @@ -2907,7 +2907,7 @@ and NonLocalEntityRef = #if !NO_EXTENSIONTYPING | None -> NonLocalEntityRef.TryDerefEntityPathViaProvidedType(ccu, path, i, entity) #else - | None -> VNone + | None -> ValueNone #endif #if !NO_EXTENSIONTYPING @@ -2925,11 +2925,11 @@ and NonLocalEntityRef = // types until i = path.Length-1. Create the Tycon's as needed let rec tryResolveNestedTypeOf(parentEntity:Entity,resolutionEnvironment,st:Tainted,i) = match st.PApply((fun st -> st.GetNestedType path.[i]),m) with - | Tainted.Null -> VNone + | Tainted.Null -> ValueNone | st -> let newEntity = Construct.NewProvidedTycon(resolutionEnvironment, st, ccu.ImportProvidedType, false, m) parentEntity.ModuleOrNamespaceType.AddProvidedTypeEntity(newEntity) - if i = path.Length-1 then VSome(newEntity) + if i = path.Length-1 then ValueSome(newEntity) else tryResolveNestedTypeOf(newEntity,resolutionEnvironment,st,i+1) tryResolveNestedTypeOf(entity,resolutionEnvironment,st,i) @@ -2987,18 +2987,18 @@ and NonLocalEntityRef = // newEntity is at 'j' NonLocalEntityRef.TryDerefEntityPath(ccu, path, (j+1), newEntity) - | [] -> VNone + | [] -> ValueNone | _ -> failwith "Unexpected" let rec tryResolvePrefixes j = - if j >= path.Length then VNone + if j >= path.Length then ValueNone else match tryResolvePrefix j with - | VNone -> tryResolvePrefixes (j+1) - | VSome res -> VSome res + | ValueNone -> tryResolvePrefixes (j+1) + | ValueSome res -> ValueSome res tryResolvePrefixes i - | _ -> VNone + | _ -> ValueNone #endif /// Try to link a non-local entity reference to an actual entity @@ -3007,11 +3007,11 @@ and NonLocalEntityRef = if canError then ccu.EnsureDerefable(path) - if ccu.IsUnresolvedReference then VNone else + if ccu.IsUnresolvedReference then ValueNone else match NonLocalEntityRef.TryDerefEntityPath(ccu, path, 0, ccu.Contents) with - | VSome _ as r -> r - | VNone -> + | ValueSome _ as r -> r + | ValueNone -> // OK, the lookup failed. Check if we can redirect through a type forwarder on this assembly. // Look for a forwarder for each prefix-path let rec tryForwardPrefixPath i = @@ -3021,7 +3021,7 @@ and NonLocalEntityRef = | Some tcref -> NonLocalEntityRef.TryDerefEntityPath(ccu, path, (i+1), tcref.Deref) | None -> tryForwardPrefixPath (i+1) else - VNone + ValueNone tryForwardPrefixPath 0 /// Get the CCU referenced by the nonlocal reference. @@ -3053,8 +3053,8 @@ and NonLocalEntityRef = /// Dereference the nonlocal reference, and raise an error if this fails. member nleref.Deref = match nleref.TryDeref(canError=true) with - | VSome res -> res - | VNone -> + | ValueSome res -> res + | ValueNone -> errorR (InternalUndefinedItemRef (FSComp.SR.tastUndefinedItemRefModuleNamespace, nleref.DisplayName, nleref.AssemblyName, "")) raise (KeyNotFoundException()) @@ -3084,9 +3084,9 @@ and member private tcr.Resolve(canError) = let res = tcr.nlr.TryDeref(canError) match res with - | VSome r -> + | ValueSome r -> tcr.binding <- nullableSlotFull r - | VNone -> + | ValueNone -> () /// Dereference the TyconRef to a Tycon. Amortize the cost of doing this. @@ -3107,11 +3107,11 @@ and | null -> tcr.Resolve(canError=false) match box tcr.binding with - | null -> VNone - | _ -> VSome tcr.binding + | null -> ValueNone + | _ -> ValueSome tcr.binding | _ -> - VSome tcr.binding + ValueSome tcr.binding /// Is the destination assembly available? member tcr.CanDeref = tcr.TryDeref.IsSome @@ -3434,8 +3434,8 @@ and let e = nlr.EnclosingEntity.Deref let possible = e.ModuleOrNamespaceType.TryLinkVal(nlr.EnclosingEntity.nlr.Ccu, nlr.ItemKey) match possible with - | VNone -> error (InternalUndefinedItemRef (FSComp.SR.tastUndefinedItemRefVal, e.DisplayNameWithStaticParameters, nlr.AssemblyName, sprintf "%+A" nlr.ItemKey.PartialKey)) - | VSome h -> h + | ValueNone -> error (InternalUndefinedItemRef (FSComp.SR.tastUndefinedItemRefVal, e.DisplayNameWithStaticParameters, nlr.AssemblyName, sprintf "%+A" nlr.ItemKey.PartialKey)) + | ValueSome h -> h vr.binding <- nullableSlotFull res res else vr.binding @@ -3445,14 +3445,14 @@ and if obj.ReferenceEquals(vr.binding, null) then let resOpt = match vr.nlr.EnclosingEntity.TryDeref with - | VNone -> VNone - | VSome e -> e.ModuleOrNamespaceType.TryLinkVal(vr.nlr.EnclosingEntity.nlr.Ccu, vr.nlr.ItemKey) + | ValueNone -> ValueNone + | ValueSome e -> e.ModuleOrNamespaceType.TryLinkVal(vr.nlr.EnclosingEntity.nlr.Ccu, vr.nlr.ItemKey) match resOpt with - | VNone -> () - | VSome res -> + | ValueNone -> () + | ValueSome res -> vr.binding <- nullableSlotFull res resOpt - else VSome vr.binding + else ValueSome vr.binding /// The type of the value. May be a TType_forall for a generic value. /// May be a type variable or type containing type variables during type inference. diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Core/OptionModule.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Core/OptionModule.fs index d5b3bbc2e9..5726775def 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Core/OptionModule.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Core/OptionModule.fs @@ -215,4 +215,37 @@ type OptionModule() = member this.MapBindEquivalenceProperties () = let fn x = x + 3 Assert.AreEqual(Option.map fn None, Option.bind (fn >> Some) None) - Assert.AreEqual(Option.map fn (Some 5), Option.bind (fn >> Some) (Some 5)) \ No newline at end of file + Assert.AreEqual(Option.map fn (Some 5), Option.bind (fn >> Some) (Some 5)) + +[] +type ValueOptionTests() = + + let assertWasNotCalledThunk () = raise (exn "Thunk should not have been called.") + + [] + member this.ValueOptionBasics () = + Assert.AreEqual( (ValueNone: int voption), (ValueNone: int voption)) + Assert.True( (ValueNone: int voption) <= (ValueNone: int voption)) + Assert.True( (ValueNone: int voption) >= (ValueNone: int voption)) + Assert.True( (ValueNone: int voption) < (ValueSome 1: int voption)) + Assert.True( (ValueSome 0: int voption) < (ValueSome 1: int voption)) + Assert.True( (ValueSome 1: int voption) > (ValueSome 0: int voption)) + Assert.False( (ValueSome 1: int voption) < (ValueNone : int voption)) + Assert.True( (ValueSome 1: int voption) <= (ValueSome 1: int voption)) + Assert.AreEqual( compare (ValueSome 1) (ValueSome 1), 0) + Assert.True( compare (ValueSome 0) (ValueSome 1) < 0) + Assert.True( compare (ValueNone: int voption) (ValueSome 1) < 0) + Assert.True( compare (ValueSome 1) (ValueNone : int voption) > 0) + Assert.AreEqual( ValueSome 1, ValueSome 1) + Assert.AreNotEqual( ValueSome 2, ValueSome 1) + Assert.AreEqual( ValueSome 2, ValueSome 2) + Assert.AreEqual( ValueSome (ValueSome 2), ValueSome (ValueSome 2)) + Assert.AreNotEqual( ValueSome (ValueSome 2), ValueSome (ValueSome 1)) + Assert.AreNotEqual( ValueSome (ValueSome 0), ValueSome ValueNone) + Assert.AreEqual( ValueSome (ValueNone: int voption), ValueSome (ValueNone: int voption)) + Assert.AreEqual( (ValueSome (ValueNone: int voption)).Value, (ValueNone: int voption)) + Assert.AreEqual( (ValueSome 1).Value, 1) + Assert.AreEqual( (ValueSome (1,2)).Value, (1,2)) + Assert.AreEqual(defaultValueArg ValueNone 1, 1) + Assert.AreEqual(defaultValueArg (ValueSome 3) 1, 3) + diff --git a/tests/FSharp.Core.UnitTests/SurfaceArea.coreclr.fs b/tests/FSharp.Core.UnitTests/SurfaceArea.coreclr.fs index bdc689385e..8920bc105a 100644 --- a/tests/FSharp.Core.UnitTests/SurfaceArea.coreclr.fs +++ b/tests/FSharp.Core.UnitTests/SurfaceArea.coreclr.fs @@ -568,6 +568,29 @@ Microsoft.FSharp.Collections.SetModule: TState FoldBack[T,TState](Microsoft.FSha Microsoft.FSharp.Collections.SetModule: TState Fold[T,TState](Microsoft.FSharp.Core.FSharpFunc`2[TState,Microsoft.FSharp.Core.FSharpFunc`2[T,TState]], TState, Microsoft.FSharp.Collections.FSharpSet`1[T]) Microsoft.FSharp.Collections.SetModule: T[] ToArray[T](Microsoft.FSharp.Collections.FSharpSet`1[T]) Microsoft.FSharp.Collections.SetModule: Void Iterate[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.Unit], Microsoft.FSharp.Collections.FSharpSet`1[T]) +Microsoft.FSharp.Control.AsyncActivation`1[T]: Boolean Equals(System.Object) +Microsoft.FSharp.Control.AsyncActivation`1[T]: Boolean IsCancellationRequested +Microsoft.FSharp.Control.AsyncActivation`1[T]: Boolean get_IsCancellationRequested() +Microsoft.FSharp.Control.AsyncActivation`1[T]: Int32 GetHashCode() +Microsoft.FSharp.Control.AsyncActivation`1[T]: Microsoft.FSharp.Control.AsyncReturn OnCancellation() +Microsoft.FSharp.Control.AsyncActivation`1[T]: Void OnExceptionRaised() +Microsoft.FSharp.Control.AsyncActivation`1[T]: Microsoft.FSharp.Control.AsyncReturn OnSuccess(T) +Microsoft.FSharp.Control.AsyncActivation`1[T]: System.String ToString() +Microsoft.FSharp.Control.AsyncActivation`1[T]: System.Type GetType() +Microsoft.FSharp.Control.AsyncPrimitives: Boolean Equals(System.Object) +Microsoft.FSharp.Control.AsyncPrimitives: Int32 GetHashCode() +Microsoft.FSharp.Control.AsyncPrimitives: Microsoft.FSharp.Control.AsyncReturn Bind[T,TResult](Microsoft.FSharp.Control.AsyncActivation`1[T], Microsoft.FSharp.Control.FSharpAsync`1[TResult], Microsoft.FSharp.Core.FSharpFunc`2[TResult,Microsoft.FSharp.Control.FSharpAsync`1[T]]) +Microsoft.FSharp.Control.AsyncPrimitives: Microsoft.FSharp.Control.AsyncReturn CallThenInvoke[T,TResult](Microsoft.FSharp.Control.AsyncActivation`1[T], TResult, Microsoft.FSharp.Core.FSharpFunc`2[TResult,Microsoft.FSharp.Control.FSharpAsync`1[T]]) +Microsoft.FSharp.Control.AsyncPrimitives: Microsoft.FSharp.Control.AsyncReturn Invoke[T](Microsoft.FSharp.Control.FSharpAsync`1[T], Microsoft.FSharp.Control.AsyncActivation`1[T]) +Microsoft.FSharp.Control.AsyncPrimitives: Microsoft.FSharp.Control.AsyncReturn TryFinally[T](Microsoft.FSharp.Control.AsyncActivation`1[T], Microsoft.FSharp.Control.FSharpAsync`1[T], Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Core.Unit]) +Microsoft.FSharp.Control.AsyncPrimitives: Microsoft.FSharp.Control.AsyncReturn TryWith[T](Microsoft.FSharp.Control.AsyncActivation`1[T], Microsoft.FSharp.Control.FSharpAsync`1[T], Microsoft.FSharp.Core.FSharpFunc`2[System.Exception,Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Control.FSharpAsync`1[T]]]) +Microsoft.FSharp.Control.AsyncPrimitives: Microsoft.FSharp.Control.FSharpAsync`1[T] MakeAsync[T](Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Control.AsyncActivation`1[T],Microsoft.FSharp.Control.AsyncReturn]) +Microsoft.FSharp.Control.AsyncPrimitives: System.String ToString() +Microsoft.FSharp.Control.AsyncPrimitives: System.Type GetType() +Microsoft.FSharp.Control.AsyncReturn: Boolean Equals(System.Object) +Microsoft.FSharp.Control.AsyncReturn: Int32 GetHashCode() +Microsoft.FSharp.Control.AsyncReturn: System.String ToString() +Microsoft.FSharp.Control.AsyncReturn: System.Type GetType() Microsoft.FSharp.Control.CommonExtensions: Boolean Equals(System.Object) Microsoft.FSharp.Control.CommonExtensions: Int32 GetHashCode() Microsoft.FSharp.Control.CommonExtensions: Microsoft.FSharp.Control.FSharpAsync`1[Microsoft.FSharp.Core.Unit] AsyncWrite(System.IO.Stream, Byte[], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32]) @@ -2117,6 +2140,36 @@ Microsoft.FSharp.Core.FSharpResult`2[T,TError]: T ResultValue Microsoft.FSharp.Core.FSharpResult`2[T,TError]: T get_ResultValue() Microsoft.FSharp.Core.FSharpResult`2[T,TError]: TError ErrorValue Microsoft.FSharp.Core.FSharpResult`2[T,TError]: TError get_ErrorValue() +Microsoft.FSharp.Core.FSharpValueOption`1+Tags[T]: Boolean Equals(System.Object) +Microsoft.FSharp.Core.FSharpValueOption`1+Tags[T]: Int32 GetHashCode() +Microsoft.FSharp.Core.FSharpValueOption`1+Tags[T]: Int32 ValueNone +Microsoft.FSharp.Core.FSharpValueOption`1+Tags[T]: Int32 ValueSome +Microsoft.FSharp.Core.FSharpValueOption`1+Tags[T]: System.String ToString() +Microsoft.FSharp.Core.FSharpValueOption`1+Tags[T]: System.Type GetType() +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Boolean Equals(Microsoft.FSharp.Core.FSharpValueOption`1[T]) +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Boolean Equals(System.Object) +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Boolean Equals(System.Object, System.Collections.IEqualityComparer) +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Int32 CompareTo(Microsoft.FSharp.Core.FSharpValueOption`1[T]) +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Int32 CompareTo(System.Object) +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Int32 CompareTo(System.Object, System.Collections.IComparer) +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Int32 GetHashCode() +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Int32 GetHashCode(System.Collections.IEqualityComparer) +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Int32 Tag +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Int32 get_Tag() +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Microsoft.FSharp.Core.FSharpValueOption`1+Tags[T] +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Microsoft.FSharp.Core.FSharpValueOption`1[T] ValueNone +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Boolean IsValueNone +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Boolean IsValueSome +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Boolean get_IsValueNone() +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Boolean get_IsValueSome() +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Microsoft.FSharp.Core.FSharpValueOption`1[T] NewValueSome(T) +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Microsoft.FSharp.Core.FSharpValueOption`1[T] get_ValueNone() +Microsoft.FSharp.Core.FSharpValueOption`1[T]: System.String ToString() +Microsoft.FSharp.Core.FSharpValueOption`1[T]: System.Type GetType() +Microsoft.FSharp.Core.FSharpValueOption`1[T]: T Item +Microsoft.FSharp.Core.FSharpValueOption`1[T]: T Value +Microsoft.FSharp.Core.FSharpValueOption`1[T]: T get_Item() +Microsoft.FSharp.Core.FSharpValueOption`1[T]: T get_Value() Microsoft.FSharp.Core.FSharpTypeFunc: Boolean Equals(System.Object) Microsoft.FSharp.Core.FSharpTypeFunc: Int32 GetHashCode() Microsoft.FSharp.Core.FSharpTypeFunc: System.Object Specialize[T]() @@ -2545,6 +2598,7 @@ Microsoft.FSharp.Core.Operators: T Ceiling[T](T) Microsoft.FSharp.Core.Operators: T Cos[T](T) Microsoft.FSharp.Core.Operators: T Cosh[T](T) Microsoft.FSharp.Core.Operators: T DefaultArg[T](Microsoft.FSharp.Core.FSharpOption`1[T], T) +Microsoft.FSharp.Core.Operators: T DefaultValueArg[T](Microsoft.FSharp.Core.FSharpValueOption`1[T], T) Microsoft.FSharp.Core.Operators: T Exit[T](Int32) Microsoft.FSharp.Core.Operators: T Exp[T](T) Microsoft.FSharp.Core.Operators: T FailWith[T](System.String) diff --git a/tests/FSharp.Core.UnitTests/SurfaceArea.net40.fs b/tests/FSharp.Core.UnitTests/SurfaceArea.net40.fs index 44e3dfdb39..2958a5f16e 100644 --- a/tests/FSharp.Core.UnitTests/SurfaceArea.net40.fs +++ b/tests/FSharp.Core.UnitTests/SurfaceArea.net40.fs @@ -555,6 +555,29 @@ Microsoft.FSharp.Collections.SetModule: TState FoldBack[T,TState](Microsoft.FSha Microsoft.FSharp.Collections.SetModule: TState Fold[T,TState](Microsoft.FSharp.Core.FSharpFunc`2[TState,Microsoft.FSharp.Core.FSharpFunc`2[T,TState]], TState, Microsoft.FSharp.Collections.FSharpSet`1[T]) Microsoft.FSharp.Collections.SetModule: T[] ToArray[T](Microsoft.FSharp.Collections.FSharpSet`1[T]) Microsoft.FSharp.Collections.SetModule: Void Iterate[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.Unit], Microsoft.FSharp.Collections.FSharpSet`1[T]) +Microsoft.FSharp.Control.AsyncActivation`1[T]: Boolean Equals(System.Object) +Microsoft.FSharp.Control.AsyncActivation`1[T]: Boolean IsCancellationRequested +Microsoft.FSharp.Control.AsyncActivation`1[T]: Boolean get_IsCancellationRequested() +Microsoft.FSharp.Control.AsyncActivation`1[T]: Int32 GetHashCode() +Microsoft.FSharp.Control.AsyncActivation`1[T]: Microsoft.FSharp.Control.AsyncReturn OnCancellation() +Microsoft.FSharp.Control.AsyncActivation`1[T]: Void OnExceptionRaised() +Microsoft.FSharp.Control.AsyncActivation`1[T]: Microsoft.FSharp.Control.AsyncReturn OnSuccess(T) +Microsoft.FSharp.Control.AsyncActivation`1[T]: System.String ToString() +Microsoft.FSharp.Control.AsyncActivation`1[T]: System.Type GetType() +Microsoft.FSharp.Control.AsyncPrimitives: Boolean Equals(System.Object) +Microsoft.FSharp.Control.AsyncPrimitives: Int32 GetHashCode() +Microsoft.FSharp.Control.AsyncPrimitives: Microsoft.FSharp.Control.AsyncReturn Bind[T,TResult](Microsoft.FSharp.Control.AsyncActivation`1[T], Microsoft.FSharp.Control.FSharpAsync`1[TResult], Microsoft.FSharp.Core.FSharpFunc`2[TResult,Microsoft.FSharp.Control.FSharpAsync`1[T]]) +Microsoft.FSharp.Control.AsyncPrimitives: Microsoft.FSharp.Control.AsyncReturn CallThenInvoke[T,TResult](Microsoft.FSharp.Control.AsyncActivation`1[T], TResult, Microsoft.FSharp.Core.FSharpFunc`2[TResult,Microsoft.FSharp.Control.FSharpAsync`1[T]]) +Microsoft.FSharp.Control.AsyncPrimitives: Microsoft.FSharp.Control.AsyncReturn Invoke[T](Microsoft.FSharp.Control.FSharpAsync`1[T], Microsoft.FSharp.Control.AsyncActivation`1[T]) +Microsoft.FSharp.Control.AsyncPrimitives: Microsoft.FSharp.Control.AsyncReturn TryFinally[T](Microsoft.FSharp.Control.AsyncActivation`1[T], Microsoft.FSharp.Control.FSharpAsync`1[T], Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Core.Unit]) +Microsoft.FSharp.Control.AsyncPrimitives: Microsoft.FSharp.Control.AsyncReturn TryWith[T](Microsoft.FSharp.Control.AsyncActivation`1[T], Microsoft.FSharp.Control.FSharpAsync`1[T], Microsoft.FSharp.Core.FSharpFunc`2[System.Exception,Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Control.FSharpAsync`1[T]]]) +Microsoft.FSharp.Control.AsyncPrimitives: Microsoft.FSharp.Control.FSharpAsync`1[T] MakeAsync[T](Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Control.AsyncActivation`1[T],Microsoft.FSharp.Control.AsyncReturn]) +Microsoft.FSharp.Control.AsyncPrimitives: System.String ToString() +Microsoft.FSharp.Control.AsyncPrimitives: System.Type GetType() +Microsoft.FSharp.Control.AsyncReturn: Boolean Equals(System.Object) +Microsoft.FSharp.Control.AsyncReturn: Int32 GetHashCode() +Microsoft.FSharp.Control.AsyncReturn: System.String ToString() +Microsoft.FSharp.Control.AsyncReturn: System.Type GetType() Microsoft.FSharp.Control.CommonExtensions: Boolean Equals(System.Object) Microsoft.FSharp.Control.CommonExtensions: Int32 GetHashCode() Microsoft.FSharp.Control.CommonExtensions: Microsoft.FSharp.Control.FSharpAsync`1[Microsoft.FSharp.Core.Unit] AsyncWrite(System.IO.Stream, Byte[], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Int32]) @@ -2197,6 +2220,36 @@ Microsoft.FSharp.Core.FSharpResult`2[T,TError]: T ResultValue Microsoft.FSharp.Core.FSharpResult`2[T,TError]: T get_ResultValue() Microsoft.FSharp.Core.FSharpResult`2[T,TError]: TError ErrorValue Microsoft.FSharp.Core.FSharpResult`2[T,TError]: TError get_ErrorValue() +Microsoft.FSharp.Core.FSharpValueOption`1+Tags[T]: Boolean Equals(System.Object) +Microsoft.FSharp.Core.FSharpValueOption`1+Tags[T]: Int32 GetHashCode() +Microsoft.FSharp.Core.FSharpValueOption`1+Tags[T]: Int32 ValueNone +Microsoft.FSharp.Core.FSharpValueOption`1+Tags[T]: Int32 ValueSome +Microsoft.FSharp.Core.FSharpValueOption`1+Tags[T]: System.String ToString() +Microsoft.FSharp.Core.FSharpValueOption`1+Tags[T]: System.Type GetType() +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Boolean Equals(Microsoft.FSharp.Core.FSharpValueOption`1[T]) +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Boolean Equals(System.Object) +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Boolean Equals(System.Object, System.Collections.IEqualityComparer) +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Int32 CompareTo(Microsoft.FSharp.Core.FSharpValueOption`1[T]) +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Int32 CompareTo(System.Object) +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Int32 CompareTo(System.Object, System.Collections.IComparer) +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Int32 GetHashCode() +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Int32 GetHashCode(System.Collections.IEqualityComparer) +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Int32 Tag +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Int32 get_Tag() +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Microsoft.FSharp.Core.FSharpValueOption`1+Tags[T] +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Microsoft.FSharp.Core.FSharpValueOption`1[T] ValueNone +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Boolean IsValueNone +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Boolean IsValueSome +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Boolean get_IsValueNone() +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Boolean get_IsValueSome() +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Microsoft.FSharp.Core.FSharpValueOption`1[T] NewValueSome(T) +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Microsoft.FSharp.Core.FSharpValueOption`1[T] get_ValueNone() +Microsoft.FSharp.Core.FSharpValueOption`1[T]: System.String ToString() +Microsoft.FSharp.Core.FSharpValueOption`1[T]: System.Type GetType() +Microsoft.FSharp.Core.FSharpValueOption`1[T]: T Item +Microsoft.FSharp.Core.FSharpValueOption`1[T]: T Value +Microsoft.FSharp.Core.FSharpValueOption`1[T]: T get_Item() +Microsoft.FSharp.Core.FSharpValueOption`1[T]: T get_Value() Microsoft.FSharp.Core.FSharpTypeFunc: Boolean Equals(System.Object) Microsoft.FSharp.Core.FSharpTypeFunc: Int32 GetHashCode() Microsoft.FSharp.Core.FSharpTypeFunc: System.Object Specialize[T]() @@ -2629,8 +2682,8 @@ Microsoft.FSharp.Core.Operators: System.Collections.Generic.IEnumerable`1[T] op_ Microsoft.FSharp.Core.Operators: System.Collections.Generic.IEnumerable`1[T] op_Range[T](T, T) Microsoft.FSharp.Core.Operators: System.Decimal ToDecimal[T](T) Microsoft.FSharp.Core.Operators: System.Exception Failure(System.String) -Microsoft.FSharp.Core.Operators: System.IO.TextReader ConsoleIn[T]() Microsoft.FSharp.Core.Operators: System.IO.TextWriter ConsoleError[T]() +Microsoft.FSharp.Core.Operators: System.IO.TextReader ConsoleIn[T]() Microsoft.FSharp.Core.Operators: System.IO.TextWriter ConsoleOut[T]() Microsoft.FSharp.Core.Operators: System.Object Box[T](T)" + #if DEBUG @@ -2653,6 +2706,7 @@ Microsoft.FSharp.Core.Operators: T Ceiling[T](T) Microsoft.FSharp.Core.Operators: T Cos[T](T) Microsoft.FSharp.Core.Operators: T Cosh[T](T) Microsoft.FSharp.Core.Operators: T DefaultArg[T](Microsoft.FSharp.Core.FSharpOption`1[T], T) +Microsoft.FSharp.Core.Operators: T DefaultValueArg[T](Microsoft.FSharp.Core.FSharpValueOption`1[T], T) Microsoft.FSharp.Core.Operators: T Exit[T](Int32) Microsoft.FSharp.Core.Operators: T Exp[T](T) Microsoft.FSharp.Core.Operators: T FailWith[T](System.String) diff --git a/tests/fsharp/TypeProviderTests.fs b/tests/fsharp/TypeProviderTests.fs index fddde1cb6a..08a39395ef 100644 --- a/tests/fsharp/TypeProviderTests.fs +++ b/tests/fsharp/TypeProviderTests.fs @@ -30,6 +30,7 @@ let FSI_BASIC = FSI_FILE let FSIANYCPU_BASIC = FSIANYCPU_FILE #endif +(* [] let diamondAssembly () = let cfg = testConfig "typeProviders/diamondAssembly" @@ -358,3 +359,4 @@ let wedgeAssembly () = peverify cfg "test3.exe" exec cfg ("." ++ "test3.exe") "" +*) diff --git a/tests/fsharp/core/asyncStackTraces/test.fsx b/tests/fsharp/core/asyncStackTraces/test.fsx new file mode 100644 index 0000000000..56b3810bf5 --- /dev/null +++ b/tests/fsharp/core/asyncStackTraces/test.fsx @@ -0,0 +1,170 @@ + +// Tests that async stack traces contain certain method names + +// See https://github.com/Microsoft/visualfsharp/pull/4867 + +// The focus of the tests is on the synchronous parts of async execution, and on exceptions. + +let mutable failures = [] +let syncObj = new obj() +let report_failure s = + stderr.WriteLine " NO"; + lock syncObj (fun () -> + failures <- s :: failures; + printfn "FAILURE: %s failed" s + ) + +let test s b = stderr.Write(s:string); if b then stderr.WriteLine " OK" else report_failure s + +let checkQuiet s x1 x2 = + if x1 <> x2 then + (test s false; + printfn "expected: %A, got %A" x2 x1) + +let check s x1 x2 = + if x1 = x2 then test s true + else (test s false; printfn "expected: %A, got %A" x2 x1) + + +let rec async_syncLoopViaTailCallFail(n) = async { + if n > 10 then + let! res = failwith "fail" + return res + else + return! async_syncLoopViaTailCallFail(n+1) +} + +let rec async_syncLoopViaNonTailCallFail(n) = async { + if n > 10 then + let! res = failwith "fail" + return Unchecked.defaultof<_> + else + let! n2 = async_syncLoopViaNonTailCallFail(n+1) + return n2 +} + +let rec async_syncWhileLoopFail() = async { + let mutable n = 0 + while true do + if n > 10 then + let! res = failwith "fail" + return res + else + n <- n + 1 +} + +let rec async_syncTryFinallyFail() = async { + try + failwith "fail" + finally + () +} + +// Raising an exception counts as an "asynchronous action" which wipes out the stack. +// +// This is because of a limitation in the .NET exception mechanism where stack traces are only populated +// up to the point where they are caught, so we need to catch them in the trampoline handler to get a good stack. +// +// This means that re-raising that exception (e.g. in a failed pattern match for a try-with) +// or throwing an exception from the "with" handler will not get a good stack. +// There is not yet any good workaround for this. +// +//let rec async_syncTryWithFail() = async { +// try +// failwith "fail" +// with _ -> () +//} + +let rec async_syncPreAsyncSleepFail() = async { + let! x = failwith "fail" // failure is in synchronous part of code + do! Async.Sleep 10 + return Unchecked.defaultof<_> +} + +let rec async_syncFail() = async { + failwith "fail" +} + +let asyncCheckEnvironmentStackTracesBottom() = async { + let stack = System.Diagnostics.StackTrace(true).ToString() + //test "vwerv0re0reer: stack = %s", stack); + test "clncw09ew09c1" (stack.Contains("asyncCheckEnvironmentStackTracesBottom")) + test "clncw09ew09c2" (stack.Contains(string (int __LINE__ - 3))) + test "clncw09ew09d3" (stack.Contains("asyncCheckEnvironmentStackTracesMid")) + test "clncw09ew09e4" (stack.Contains("asyncCheckEnvironmentStackTracesTop")) + return 1 +} + +let asyncCheckEnvironmentStackTracesMid() = async { + let! res = asyncCheckEnvironmentStackTracesBottom() + let stack = System.Diagnostics.StackTrace(true).ToString() + test "clncw09ew09d2" (stack.Contains("asyncCheckEnvironmentStackTracesMid")) + test "clncw09ew09c" (stack.Contains(string (int __LINE__ - 2))) + test "clncw09ew09e2" (stack.Contains("asyncCheckEnvironmentStackTracesTop")) + return res +} + +let asyncCheckEnvironmentStackTracesTop() = async { + let! res = asyncCheckEnvironmentStackTracesMid() + let stack = System.Diagnostics.StackTrace(true).ToString() + test "clncw09ew09f" (stack.Contains("asyncCheckEnvironmentStackTracesTop")) + test "clncw09ew09c" (stack.Contains(string (int __LINE__ - 2))) + + do! Async.Sleep 10 + let stack = System.Diagnostics.StackTrace(true).ToString() + test "clncw09ew09f" (stack.Contains("asyncCheckEnvironmentStackTracesTop")) + test "clncw09ew09c" (stack.Contains(string (int __LINE__ - 2))) + +} + +let asyncMid(f) = async { + + let! res = f() + () +} +let asyncTop2(f) = async { + + let! res = asyncMid(f) + return () +} + +let asyncTop3(f) = async { + + do! Async.Sleep 10 + let! res = asyncMid(f) + return () +} + + + +asyncCheckEnvironmentStackTracesTop() |> Async.RunSynchronously + +let testCasesThatRaiseExceptions = + [ ("async_syncFail", async_syncFail) + ("async_syncLoopViaTailCallFail", (fun () -> async_syncLoopViaTailCallFail(0))) + ("async_syncLoopViaNonTailCallFail", (fun () -> async_syncLoopViaNonTailCallFail(0))) + ("async_syncWhileLoopFail", async_syncWhileLoopFail) + ("async_syncTryFinallyFail", async_syncTryFinallyFail) + ("async_syncPreAsyncSleepFail", async_syncPreAsyncSleepFail) ] + +for (asyncTopName, asyncTop) in [("asyncTop2", asyncTop2); ("asyncTop3", asyncTop3) ] do + for functionName, asyncFunction in testCasesThatRaiseExceptions do + try + asyncTop(asyncFunction) |> Async.RunSynchronously |> ignore + failwith "should have raised exception" + with e -> + let stack = e.StackTrace + test (sprintf "case %s: clncw09ew09m0" functionName) (not (stack.Contains("line 0"))) + test (sprintf "case %s: clncw09ew09m1" functionName) (stack.Contains(functionName)) + test (sprintf "case %s: clncw09ew09n2" functionName) (stack.Contains("asyncMid")) + test (sprintf "case %s: clncw09ew09n3" functionName) (stack.Contains(asyncTopName)) + +let aa = + if not failures.IsEmpty then + stdout.WriteLine "Test Failed" + exit 1 + else + stdout.WriteLine "Test Passed" + System.IO.File.WriteAllText("test.ok","ok") + exit 0 + diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index 77138871fa..bca5bccdc4 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -170,9 +170,7 @@ module CoreTests = [] let ``attributes-FSI_BASIC`` () = singleTestBuildAndRun "core/attributes" FSI_BASIC -#endif -#if !FSHARP_SUITE_DRIVES_CORECLR_TESTS [] let byrefs () = @@ -189,6 +187,19 @@ module CoreTests = fsi cfg "" ["test.fsx"] testOkFile.CheckExists() + + [] + let asyncStackTraces () = + let cfg = testConfig "core/asyncStackTraces" + + use testOkFile = fileguard cfg "test.ok" + + fsc cfg "%s -o:test.exe -g --tailcalls- --optimize-" cfg.fsc_flags ["test.fsx"] + + exec cfg ("." ++ "test.exe") "" + + testOkFile.CheckExists() + #endif [] diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest1.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest1.il.bsl index ec794be06a..3e69ae4967 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest1.il.bsl +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest1.il.bsl @@ -13,7 +13,7 @@ .assembly extern FSharp.Core { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: - .ver 4:4:1:0 + .ver 4:4:3:0 } .assembly AsyncExpressionSteppingTest1 { @@ -29,20 +29,20 @@ } .mresource public FSharpSignatureData.AsyncExpressionSteppingTest1 { - // Offset: 0x00000000 Length: 0x0000024A + // Offset: 0x00000000 Length: 0x0000026C } .mresource public FSharpOptimizationData.AsyncExpressionSteppingTest1 { - // Offset: 0x00000250 Length: 0x000000B1 + // Offset: 0x00000270 Length: 0x000000B1 } .module AsyncExpressionSteppingTest1.dll -// MVID: {5A1F62A7-6394-B5D4-A745-0383A7621F5A} +// MVID: {5AF5DDAE-6394-B5D4-A745-0383AEDDF55A} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY -// Image base: 0x05190000 +// Image base: 0x02880000 // =============== CLASS MEMBERS DECLARATION =================== @@ -83,7 +83,7 @@ // Code size 62 (0x3e) .maxstack 8 .language '{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}' - .line 6,6 : 17,32 'C:\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\AsyncExpressionStepping\\AsyncExpressionSteppingTest1.fs' + .line 6,6 : 17,32 'C:\\GitHub\\dsyme\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\AsyncExpressionStepping\\AsyncExpressionSteppingTest1.fs' IL_0000: ldstr "hello" IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest2.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest2.il.bsl index 6a87f0671a..7bdb6a074c 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest2.il.bsl +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest2.il.bsl @@ -13,7 +13,7 @@ .assembly extern FSharp.Core { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: - .ver 4:4:1:0 + .ver 4:4:3:0 } .assembly AsyncExpressionSteppingTest2 { @@ -29,20 +29,20 @@ } .mresource public FSharpSignatureData.AsyncExpressionSteppingTest2 { - // Offset: 0x00000000 Length: 0x0000024A + // Offset: 0x00000000 Length: 0x0000026C } .mresource public FSharpOptimizationData.AsyncExpressionSteppingTest2 { - // Offset: 0x00000250 Length: 0x000000B1 + // Offset: 0x00000270 Length: 0x000000B1 } .module AsyncExpressionSteppingTest2.dll -// MVID: {5A1F62A7-6394-D499-A745-0383A7621F5A} +// MVID: {5AF5DDAE-6394-D499-A745-0383AEDDF55A} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY -// Image base: 0x00F10000 +// Image base: 0x04520000 // =============== CLASS MEMBERS DECLARATION =================== @@ -80,7 +80,7 @@ // Code size 15 (0xf) .maxstack 8 .language '{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}' - .line 6,6 : 23,29 'C:\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\AsyncExpressionStepping\\AsyncExpressionSteppingTest2.fs' + .line 6,6 : 23,29 'C:\\GitHub\\dsyme\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\AsyncExpressionStepping\\AsyncExpressionSteppingTest2.fs' IL_0000: ldarg.0 IL_0001: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 AsyncExpressionSteppingTest2/AsyncExpressionSteppingTest2/'f2@6-1'::x IL_0006: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::op_Dereference(class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1) diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest3.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest3.il.bsl index 83b7070f11..6dfebd88b1 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest3.il.bsl +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest3.il.bsl @@ -13,7 +13,7 @@ .assembly extern FSharp.Core { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: - .ver 4:4:1:0 + .ver 4:4:3:0 } .assembly AsyncExpressionSteppingTest3 { @@ -29,20 +29,20 @@ } .mresource public FSharpSignatureData.AsyncExpressionSteppingTest3 { - // Offset: 0x00000000 Length: 0x00000255 + // Offset: 0x00000000 Length: 0x00000277 } .mresource public FSharpOptimizationData.AsyncExpressionSteppingTest3 { - // Offset: 0x00000260 Length: 0x000000B1 + // Offset: 0x00000280 Length: 0x000000B1 } .module AsyncExpressionSteppingTest3.dll -// MVID: {5A1F62A7-6394-F35E-A745-0383A7621F5A} +// MVID: {5AF5DDAE-6394-F35E-A745-0383AEDDF55A} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY -// Image base: 0x01210000 +// Image base: 0x04650000 // =============== CLASS MEMBERS DECLARATION =================== @@ -55,6 +55,44 @@ extends [mscorlib]System.Object { .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .class auto ansi serializable sealed nested assembly beforefieldinit 'f3@10-1' + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn> + { + .field public int32 'value' + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method assembly specialname rtspecialname + instance void .ctor(int32 'value') cil managed + { + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 14 (0xe) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld int32 AsyncExpressionSteppingTest3/AsyncExpressionSteppingTest3/'f3@10-1'::'value' + IL_000d: ret + } // end of method 'f3@10-1'::.ctor + + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn + Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1 ctxt) cil managed + { + // Code size 14 (0xe) + .maxstack 8 + .language '{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}' + .line 10,10 : 17,25 'C:\\GitHub\\dsyme\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\AsyncExpressionStepping\\AsyncExpressionSteppingTest3.fs' + IL_0000: ldarga.s ctxt + IL_0002: ldarg.0 + IL_0003: ldfld int32 AsyncExpressionSteppingTest3/AsyncExpressionSteppingTest3/'f3@10-1'::'value' + IL_0008: call instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1::OnSuccess(!0) + IL_000d: ret + } // end of method 'f3@10-1'::Invoke + + } // end of class 'f3@10-1' + .class auto ansi serializable sealed nested assembly beforefieldinit f3@5 extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { @@ -80,13 +118,14 @@ .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed { - // Code size 57 (0x39) + // Code size 67 (0x43) .maxstack 6 .locals init ([0] class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 x, [1] class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 y, - [2] int32 z) - .language '{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}' - .line 5,5 : 17,30 'C:\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\AsyncExpressionStepping\\AsyncExpressionSteppingTest3.fs' + [2] int32 z, + [3] class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder V_3, + [4] int32 V_4) + .line 5,5 : 17,30 '' IL_0000: ldc.i4.0 IL_0001: call class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::Ref(!!0) IL_0006: stloc.0 @@ -112,10 +151,14 @@ .line 10,10 : 17,25 '' IL_002a: ldarg.0 IL_002b: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder AsyncExpressionSteppingTest3/AsyncExpressionSteppingTest3/f3@5::builder@ - IL_0030: ldloc.2 - IL_0031: tail. - IL_0033: callvirt instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder::Return(!!0) - IL_0038: ret + IL_0030: stloc.3 + IL_0031: ldloc.2 + IL_0032: stloc.s V_4 + IL_0034: ldloc.s V_4 + IL_0036: newobj instance void AsyncExpressionSteppingTest3/AsyncExpressionSteppingTest3/'f3@10-1'::.ctor(int32) + IL_003b: tail. + IL_003d: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) + IL_0042: ret } // end of method f3@5::Invoke } // end of class f3@5 diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest4.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest4.il.bsl index 02e29ae228..ce54bd4945 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest4.il.bsl +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest4.il.bsl @@ -13,7 +13,7 @@ .assembly extern FSharp.Core { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: - .ver 4:4:1:0 + .ver 4:4:3:0 } .assembly AsyncExpressionSteppingTest4 { @@ -29,20 +29,20 @@ } .mresource public FSharpSignatureData.AsyncExpressionSteppingTest4 { - // Offset: 0x00000000 Length: 0x00000255 + // Offset: 0x00000000 Length: 0x00000277 } .mresource public FSharpOptimizationData.AsyncExpressionSteppingTest4 { - // Offset: 0x00000260 Length: 0x000000B1 + // Offset: 0x00000280 Length: 0x000000B1 } .module AsyncExpressionSteppingTest4.dll -// MVID: {5A1F62A7-6394-6D4B-A745-0383A7621F5A} +// MVID: {5AF5DDAE-6394-6D4B-A745-0383AEDDF55A} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY -// Image base: 0x038C0000 +// Image base: 0x028F0000 // =============== CLASS MEMBERS DECLARATION =================== @@ -55,6 +55,44 @@ extends [mscorlib]System.Object { .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .class auto ansi serializable sealed nested assembly beforefieldinit 'f4@10-2' + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn> + { + .field public int32 'value' + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method assembly specialname rtspecialname + instance void .ctor(int32 'value') cil managed + { + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 14 (0xe) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld int32 AsyncExpressionSteppingTest4/AsyncExpressionSteppingTest4/'f4@10-2'::'value' + IL_000d: ret + } // end of method 'f4@10-2'::.ctor + + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn + Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1 ctxt) cil managed + { + // Code size 14 (0xe) + .maxstack 8 + .language '{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}' + .line 10,10 : 21,29 'C:\\GitHub\\dsyme\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\AsyncExpressionStepping\\AsyncExpressionSteppingTest4.fs' + IL_0000: ldarga.s ctxt + IL_0002: ldarg.0 + IL_0003: ldfld int32 AsyncExpressionSteppingTest4/AsyncExpressionSteppingTest4/'f4@10-2'::'value' + IL_0008: call instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1::OnSuccess(!0) + IL_000d: ret + } // end of method 'f4@10-2'::Invoke + + } // end of class 'f4@10-2' + .class auto ansi serializable sealed nested assembly beforefieldinit 'f4@7-1' extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { @@ -85,12 +123,13 @@ .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed { - // Code size 48 (0x30) + // Code size 56 (0x38) .maxstack 6 .locals init ([0] class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 y, - [1] int32 z) - .language '{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}' - .line 7,7 : 21,34 'C:\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\AsyncExpressionStepping\\AsyncExpressionSteppingTest4.fs' + [1] int32 z, + [2] class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder V_2, + [3] int32 V_3) + .line 7,7 : 21,34 '' IL_0000: ldc.i4.0 IL_0001: call class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::Ref(!!0) IL_0006: stloc.0 @@ -109,15 +148,19 @@ .line 10,10 : 21,29 '' IL_0021: ldarg.0 IL_0022: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder AsyncExpressionSteppingTest4/AsyncExpressionSteppingTest4/'f4@7-1'::builder@ - IL_0027: ldloc.1 - IL_0028: tail. - IL_002a: callvirt instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder::Return(!!0) - IL_002f: ret + IL_0027: stloc.2 + IL_0028: ldloc.1 + IL_0029: stloc.3 + IL_002a: ldloc.3 + IL_002b: newobj instance void AsyncExpressionSteppingTest4/AsyncExpressionSteppingTest4/'f4@10-2'::.ctor(int32) + IL_0030: tail. + IL_0032: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) + IL_0037: ret } // end of method 'f4@7-1'::Invoke } // end of class 'f4@7-1' - .class auto ansi serializable sealed nested assembly beforefieldinit 'f4@12-2' + .class auto ansi serializable sealed nested assembly beforefieldinit 'f4@12-3' extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 { .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 x @@ -132,9 +175,9 @@ IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::.ctor() IL_0006: ldarg.0 IL_0007: ldarg.1 - IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 AsyncExpressionSteppingTest4/AsyncExpressionSteppingTest4/'f4@12-2'::x + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 AsyncExpressionSteppingTest4/AsyncExpressionSteppingTest4/'f4@12-3'::x IL_000d: ret - } // end of method 'f4@12-2'::.ctor + } // end of method 'f4@12-3'::.ctor .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Core.Unit Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed @@ -143,7 +186,7 @@ .maxstack 8 .line 12,12 : 20,26 '' IL_0000: ldarg.0 - IL_0001: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 AsyncExpressionSteppingTest4/AsyncExpressionSteppingTest4/'f4@12-2'::x + IL_0001: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 AsyncExpressionSteppingTest4/AsyncExpressionSteppingTest4/'f4@12-3'::x IL_0006: call void [FSharp.Core]Microsoft.FSharp.Core.Operators::Increment(class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1) IL_000b: nop .line 13,13 : 20,34 '' @@ -152,9 +195,59 @@ IL_0016: tail. IL_0018: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) IL_001d: ret - } // end of method 'f4@12-2'::Invoke + } // end of method 'f4@12-3'::Invoke - } // end of class 'f4@12-2' + } // end of class 'f4@12-3' + + .class auto ansi serializable sealed nested assembly beforefieldinit 'f4@6-4' + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn> + { + .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 compensation + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method assembly specialname rtspecialname + instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 compensation) cil managed + { + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 21 (0x15) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 AsyncExpressionSteppingTest4/AsyncExpressionSteppingTest4/'f4@6-4'::computation + IL_000d: ldarg.0 + IL_000e: ldarg.2 + IL_000f: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 AsyncExpressionSteppingTest4/AsyncExpressionSteppingTest4/'f4@6-4'::compensation + IL_0014: ret + } // end of method 'f4@6-4'::.ctor + + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn + Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1 ctxt) cil managed + { + // Code size 21 (0x15) + .maxstack 8 + .line 6,6 : 17,20 '' + IL_0000: ldarg.1 + IL_0001: ldarg.0 + IL_0002: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 AsyncExpressionSteppingTest4/AsyncExpressionSteppingTest4/'f4@6-4'::computation + IL_0007: ldarg.0 + IL_0008: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 AsyncExpressionSteppingTest4/AsyncExpressionSteppingTest4/'f4@6-4'::compensation + IL_000d: tail. + IL_000f: call class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::TryFinally(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1, + class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) + IL_0014: ret + } // end of method 'f4@6-4'::Invoke + + } // end of class 'f4@6-4' .class auto ansi serializable sealed nested assembly beforefieldinit f4@5 extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> @@ -181,9 +274,12 @@ .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed { - // Code size 50 (0x32) - .maxstack 8 - .locals init ([0] class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 x) + // Code size 60 (0x3c) + .maxstack 7 + .locals init ([0] class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 x, + [1] class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder V_1, + [2] class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 V_2, + [3] class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 V_3) .line 5,5 : 17,30 '' IL_0000: ldc.i4.0 IL_0001: call class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::Ref(!!0) @@ -191,20 +287,26 @@ .line 6,6 : 17,20 '' IL_0007: ldarg.0 IL_0008: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder AsyncExpressionSteppingTest4/AsyncExpressionSteppingTest4/f4@5::builder@ - IL_000d: ldarg.0 - IL_000e: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder AsyncExpressionSteppingTest4/AsyncExpressionSteppingTest4/f4@5::builder@ - IL_0013: ldarg.0 - IL_0014: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder AsyncExpressionSteppingTest4/AsyncExpressionSteppingTest4/f4@5::builder@ - IL_0019: ldloc.0 - IL_001a: newobj instance void AsyncExpressionSteppingTest4/AsyncExpressionSteppingTest4/'f4@7-1'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder, + IL_000d: stloc.1 + IL_000e: ldarg.0 + IL_000f: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder AsyncExpressionSteppingTest4/AsyncExpressionSteppingTest4/f4@5::builder@ + IL_0014: ldarg.0 + IL_0015: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder AsyncExpressionSteppingTest4/AsyncExpressionSteppingTest4/f4@5::builder@ + IL_001a: ldloc.0 + IL_001b: newobj instance void AsyncExpressionSteppingTest4/AsyncExpressionSteppingTest4/'f4@7-1'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder, class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1) - IL_001f: callvirt instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder::Delay(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) - IL_0024: ldloc.0 - IL_0025: newobj instance void AsyncExpressionSteppingTest4/AsyncExpressionSteppingTest4/'f4@12-2'::.ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1) - IL_002a: tail. - IL_002c: callvirt instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder::TryFinally(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) - IL_0031: ret + IL_0020: callvirt instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder::Delay(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) + IL_0025: stloc.2 + IL_0026: ldloc.0 + IL_0027: newobj instance void AsyncExpressionSteppingTest4/AsyncExpressionSteppingTest4/'f4@12-3'::.ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1) + IL_002c: stloc.3 + IL_002d: ldloc.2 + IL_002e: ldloc.3 + IL_002f: newobj instance void AsyncExpressionSteppingTest4/AsyncExpressionSteppingTest4/'f4@6-4'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) + IL_0034: tail. + IL_0036: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) + IL_003b: ret } // end of method f4@5::Invoke } // end of class f4@5 diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest5.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest5.il.bsl index 50407f757c..da554a3adf 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest5.il.bsl +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest5.il.bsl @@ -13,7 +13,7 @@ .assembly extern FSharp.Core { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: - .ver 4:4:1:0 + .ver 4:4:3:0 } .assembly AsyncExpressionSteppingTest5 { @@ -29,20 +29,20 @@ } .mresource public FSharpSignatureData.AsyncExpressionSteppingTest5 { - // Offset: 0x00000000 Length: 0x00000296 + // Offset: 0x00000000 Length: 0x000002B8 } .mresource public FSharpOptimizationData.AsyncExpressionSteppingTest5 { - // Offset: 0x000002A0 Length: 0x000000BE + // Offset: 0x000002C0 Length: 0x000000BE } .module AsyncExpressionSteppingTest5.dll -// MVID: {5A1F62A7-6394-30E8-A745-0383A7621F5A} +// MVID: {5AF5DDAE-6394-30E8-A745-0383AEDDF55A} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY -// Image base: 0x00C60000 +// Image base: 0x04430000 // =============== CLASS MEMBERS DECLARATION =================== @@ -84,7 +84,7 @@ .maxstack 5 .locals init ([0] int32 x) .language '{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}' - .line 6,6 : 17,31 'C:\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\AsyncExpressionStepping\\AsyncExpressionSteppingTest5.fs' + .line 6,6 : 17,31 'C:\\GitHub\\dsyme\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\AsyncExpressionStepping\\AsyncExpressionSteppingTest5.fs' IL_0000: ldarg.1 IL_0001: stloc.0 .line 7,7 : 20,35 '' @@ -198,6 +198,91 @@ } // end of class 'f7@9-2' + .class auto ansi serializable sealed nested assembly beforefieldinit 'f7@6-4' + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> + { + .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation2 + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method assembly specialname rtspecialname + instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation2) cil managed + { + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 14 (0xe) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 AsyncExpressionSteppingTest5/AsyncExpressionSteppingTest5/'f7@6-4'::computation2 + IL_000d: ret + } // end of method 'f7@6-4'::.ctor + + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 + Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar0) cil managed + { + // Code size 7 (0x7) + .maxstack 8 + .line 6,6 : 17,31 '' + IL_0000: ldarg.0 + IL_0001: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 AsyncExpressionSteppingTest5/AsyncExpressionSteppingTest5/'f7@6-4'::computation2 + IL_0006: ret + } // end of method 'f7@6-4'::Invoke + + } // end of class 'f7@6-4' + + .class auto ansi serializable sealed nested assembly beforefieldinit 'f7@6-5' + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn> + { + .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation1 + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> part2 + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method assembly specialname rtspecialname + instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation1, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> part2) cil managed + { + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 21 (0x15) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 AsyncExpressionSteppingTest5/AsyncExpressionSteppingTest5/'f7@6-5'::computation1 + IL_000d: ldarg.0 + IL_000e: ldarg.2 + IL_000f: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> AsyncExpressionSteppingTest5/AsyncExpressionSteppingTest5/'f7@6-5'::part2 + IL_0014: ret + } // end of method 'f7@6-5'::.ctor + + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn + Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1 ctxt) cil managed + { + // Code size 21 (0x15) + .maxstack 8 + .line 6,6 : 17,31 '' + IL_0000: ldarg.1 + IL_0001: ldarg.0 + IL_0002: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 AsyncExpressionSteppingTest5/AsyncExpressionSteppingTest5/'f7@6-5'::computation1 + IL_0007: ldarg.0 + IL_0008: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> AsyncExpressionSteppingTest5/AsyncExpressionSteppingTest5/'f7@6-5'::part2 + IL_000d: tail. + IL_000f: call class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::Bind(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1, + class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) + IL_0014: ret + } // end of method 'f7@6-5'::Invoke + + } // end of class 'f7@6-5' + .class auto ansi serializable sealed nested assembly beforefieldinit f7@6 extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { @@ -223,29 +308,42 @@ .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed { - // Code size 63 (0x3f) - .maxstack 8 + // Code size 80 (0x50) + .maxstack 7 + .locals init ([0] class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder V_0, + [1] class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 V_1, + [2] class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 V_2, + [3] class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> V_3) .line 6,6 : 17,31 '' IL_0000: ldarg.0 IL_0001: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder AsyncExpressionSteppingTest5/AsyncExpressionSteppingTest5/f7@6::builder@ - IL_0006: ldarg.0 - IL_0007: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder AsyncExpressionSteppingTest5/AsyncExpressionSteppingTest5/f7@6::builder@ - IL_000c: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 AsyncExpressionSteppingTest5/AsyncExpressionSteppingTest5::get_es() - IL_0011: ldarg.0 - IL_0012: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder AsyncExpressionSteppingTest5/AsyncExpressionSteppingTest5/f7@6::builder@ - IL_0017: newobj instance void AsyncExpressionSteppingTest5/AsyncExpressionSteppingTest5/'f7@6-1'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder) - IL_001c: callvirt instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder::For(class [mscorlib]System.Collections.Generic.IEnumerable`1, + IL_0006: stloc.0 + IL_0007: ldarg.0 + IL_0008: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder AsyncExpressionSteppingTest5/AsyncExpressionSteppingTest5/f7@6::builder@ + IL_000d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 AsyncExpressionSteppingTest5/AsyncExpressionSteppingTest5::get_es() + IL_0012: ldarg.0 + IL_0013: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder AsyncExpressionSteppingTest5/AsyncExpressionSteppingTest5/f7@6::builder@ + IL_0018: newobj instance void AsyncExpressionSteppingTest5/AsyncExpressionSteppingTest5/'f7@6-1'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder) + IL_001d: callvirt instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder::For(class [mscorlib]System.Collections.Generic.IEnumerable`1, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) - IL_0021: ldarg.0 - IL_0022: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder AsyncExpressionSteppingTest5/AsyncExpressionSteppingTest5/f7@6::builder@ - IL_0027: ldarg.0 - IL_0028: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder AsyncExpressionSteppingTest5/AsyncExpressionSteppingTest5/f7@6::builder@ - IL_002d: newobj instance void AsyncExpressionSteppingTest5/AsyncExpressionSteppingTest5/'f7@9-2'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder) - IL_0032: callvirt instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder::Delay(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) - IL_0037: tail. - IL_0039: callvirt instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder::Combine(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, - class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1) - IL_003e: ret + IL_0022: stloc.1 + IL_0023: ldarg.0 + IL_0024: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder AsyncExpressionSteppingTest5/AsyncExpressionSteppingTest5/f7@6::builder@ + IL_0029: ldarg.0 + IL_002a: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder AsyncExpressionSteppingTest5/AsyncExpressionSteppingTest5/f7@6::builder@ + IL_002f: newobj instance void AsyncExpressionSteppingTest5/AsyncExpressionSteppingTest5/'f7@9-2'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder) + IL_0034: callvirt instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder::Delay(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) + IL_0039: stloc.2 + IL_003a: ldloc.2 + IL_003b: newobj instance void AsyncExpressionSteppingTest5/AsyncExpressionSteppingTest5/'f7@6-4'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1) + IL_0040: stloc.3 + IL_0041: ldloc.1 + IL_0042: ldloc.3 + IL_0043: newobj instance void AsyncExpressionSteppingTest5/AsyncExpressionSteppingTest5/'f7@6-5'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) + IL_0048: tail. + IL_004a: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) + IL_004f: ret } // end of method f7@6::Invoke } // end of class f7@6 diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest6.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest6.il.bsl index e027d17202..379ad6bbe7 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest6.il.bsl +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest6.il.bsl @@ -13,7 +13,7 @@ .assembly extern FSharp.Core { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: - .ver 4:4:1:0 + .ver 4:4:3:0 } .assembly AsyncExpressionSteppingTest6 { @@ -29,20 +29,20 @@ } .mresource public FSharpSignatureData.AsyncExpressionSteppingTest6 { - // Offset: 0x00000000 Length: 0x00000281 + // Offset: 0x00000000 Length: 0x000002A3 } .mresource public FSharpOptimizationData.AsyncExpressionSteppingTest6 { - // Offset: 0x00000288 Length: 0x000000BE + // Offset: 0x000002A8 Length: 0x000000BE } .module AsyncExpressionSteppingTest6.dll -// MVID: {5A1F62A7-6394-4FAD-A745-0383A7621F5A} +// MVID: {5AF5DDAE-6394-4FAD-A745-0383AEDDF55A} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY -// Image base: 0x03740000 +// Image base: 0x04C40000 // =============== CLASS MEMBERS DECLARATION =================== @@ -55,6 +55,44 @@ extends [mscorlib]System.Object { .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .class auto ansi serializable sealed nested assembly beforefieldinit 'f2@10-4' + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn> + { + .field public int32 'value' + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method assembly specialname rtspecialname + instance void .ctor(int32 'value') cil managed + { + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 14 (0xe) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld int32 AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f2@10-4'::'value' + IL_000d: ret + } // end of method 'f2@10-4'::.ctor + + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn + Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1 ctxt) cil managed + { + // Code size 14 (0xe) + .maxstack 8 + .language '{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}' + .line 10,10 : 17,25 'C:\\GitHub\\dsyme\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\AsyncExpressionStepping\\AsyncExpressionSteppingTest6.fs' + IL_0000: ldarga.s ctxt + IL_0002: ldarg.0 + IL_0003: ldfld int32 AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f2@10-4'::'value' + IL_0008: call instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1::OnSuccess(!0) + IL_000d: ret + } // end of method 'f2@10-4'::Invoke + + } // end of class 'f2@10-4' + .class auto ansi serializable sealed nested assembly beforefieldinit 'f2@5-3' extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { @@ -80,13 +118,14 @@ .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed { - // Code size 57 (0x39) + // Code size 67 (0x43) .maxstack 6 .locals init ([0] class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 x, [1] class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 y, - [2] int32 z) - .language '{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}' - .line 5,5 : 17,30 'C:\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\AsyncExpressionStepping\\AsyncExpressionSteppingTest6.fs' + [2] int32 z, + [3] class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder V_3, + [4] int32 V_4) + .line 5,5 : 17,30 '' IL_0000: ldc.i4.0 IL_0001: call class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::Ref(!!0) IL_0006: stloc.0 @@ -112,15 +151,56 @@ .line 10,10 : 17,25 '' IL_002a: ldarg.0 IL_002b: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f2@5-3'::builder@ - IL_0030: ldloc.2 - IL_0031: tail. - IL_0033: callvirt instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder::Return(!!0) - IL_0038: ret + IL_0030: stloc.3 + IL_0031: ldloc.2 + IL_0032: stloc.s V_4 + IL_0034: ldloc.s V_4 + IL_0036: newobj instance void AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f2@10-4'::.ctor(int32) + IL_003b: tail. + IL_003d: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) + IL_0042: ret } // end of method 'f2@5-3'::Invoke } // end of class 'f2@5-3' - .class auto ansi serializable sealed nested assembly beforefieldinit 'f3@19-5' + .class auto ansi serializable sealed nested assembly beforefieldinit 'f3@20-7' + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn> + { + .field public int32 'value' + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method assembly specialname rtspecialname + instance void .ctor(int32 'value') cil managed + { + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 14 (0xe) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld int32 AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@20-7'::'value' + IL_000d: ret + } // end of method 'f3@20-7'::.ctor + + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn + Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1 ctxt) cil managed + { + // Code size 14 (0xe) + .maxstack 8 + .line 20,20 : 17,25 '' + IL_0000: ldarga.s ctxt + IL_0002: ldarg.0 + IL_0003: ldfld int32 AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@20-7'::'value' + IL_0008: call instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1::OnSuccess(!0) + IL_000d: ret + } // end of method 'f3@20-7'::Invoke + + } // end of class 'f3@20-7' + + .class auto ansi serializable sealed nested assembly beforefieldinit 'f3@19-6' extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@ @@ -142,31 +222,33 @@ IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>::.ctor() IL_0006: ldarg.0 IL_0007: ldarg.1 - IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@19-5'::builder@ + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@19-6'::builder@ IL_000d: ldarg.0 IL_000e: ldarg.2 - IL_000f: stfld int32 AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@19-5'::x1 + IL_000f: stfld int32 AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@19-6'::x1 IL_0014: ldarg.0 IL_0015: ldarg.3 - IL_0016: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@19-5'::y + IL_0016: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@19-6'::y IL_001b: ret - } // end of method 'f3@19-5'::.ctor + } // end of method 'f3@19-6'::.ctor .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 Invoke(int32 _arg4) cil managed { - // Code size 38 (0x26) + // Code size 46 (0x2e) .maxstack 6 .locals init ([0] int32 x4, - [1] int32 z) + [1] int32 z, + [2] class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder V_2, + [3] int32 V_3) .line 18,18 : 17,31 '' IL_0000: ldarg.1 IL_0001: stloc.0 .line 19,19 : 17,37 '' IL_0002: ldarg.0 - IL_0003: ldfld int32 AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@19-5'::x1 + IL_0003: ldfld int32 AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@19-6'::x1 IL_0008: ldarg.0 - IL_0009: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@19-5'::y + IL_0009: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@19-6'::y IL_000e: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::op_Dereference(class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1) IL_0013: add IL_0014: ldloc.0 @@ -174,16 +256,70 @@ IL_0016: stloc.1 .line 20,20 : 17,25 '' IL_0017: ldarg.0 - IL_0018: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@19-5'::builder@ - IL_001d: ldloc.1 - IL_001e: tail. - IL_0020: callvirt instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder::Return(!!0) - IL_0025: ret - } // end of method 'f3@19-5'::Invoke + IL_0018: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@19-6'::builder@ + IL_001d: stloc.2 + IL_001e: ldloc.1 + IL_001f: stloc.3 + IL_0020: ldloc.3 + IL_0021: newobj instance void AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@20-7'::.ctor(int32) + IL_0026: tail. + IL_0028: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) + IL_002d: ret + } // end of method 'f3@19-6'::Invoke + + } // end of class 'f3@19-6' + + .class auto ansi serializable sealed nested assembly beforefieldinit 'f3@18-8' + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn> + { + .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> binder + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method assembly specialname rtspecialname + instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> binder) cil managed + { + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 21 (0x15) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@18-8'::computation + IL_000d: ldarg.0 + IL_000e: ldarg.2 + IL_000f: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@18-8'::binder + IL_0014: ret + } // end of method 'f3@18-8'::.ctor + + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn + Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1 ctxt) cil managed + { + // Code size 21 (0x15) + .maxstack 8 + .line 18,18 : 17,31 '' + IL_0000: ldarg.1 + IL_0001: ldarg.0 + IL_0002: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@18-8'::computation + IL_0007: ldarg.0 + IL_0008: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@18-8'::binder + IL_000d: tail. + IL_000f: call class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::Bind(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1, + class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) + IL_0014: ret + } // end of method 'f3@18-8'::Invoke - } // end of class 'f3@19-5' + } // end of class 'f3@18-8' - .class auto ansi serializable sealed nested assembly beforefieldinit 'f3@16-4' + .class auto ansi serializable sealed nested assembly beforefieldinit 'f3@16-5' extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@ @@ -203,20 +339,23 @@ IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>::.ctor() IL_0006: ldarg.0 IL_0007: ldarg.1 - IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@16-4'::builder@ + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@16-5'::builder@ IL_000d: ldarg.0 IL_000e: ldarg.2 - IL_000f: stfld int32 AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@16-4'::x1 + IL_000f: stfld int32 AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@16-5'::x1 IL_0014: ret - } // end of method 'f3@16-4'::.ctor + } // end of method 'f3@16-5'::.ctor .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 Invoke(int32 _arg3) cil managed { - // Code size 53 (0x35) - .maxstack 9 + // Code size 65 (0x41) + .maxstack 7 .locals init ([0] int32 x3, - [1] class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 y) + [1] class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 y, + [2] class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder V_2, + [3] class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 V_3, + [4] class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> V_4) .line 15,15 : 17,31 '' IL_0000: ldarg.1 IL_0001: stloc.0 @@ -230,25 +369,81 @@ IL_000f: nop .line 18,18 : 17,31 '' IL_0010: ldarg.0 - IL_0011: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@16-4'::builder@ - IL_0016: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6::f2() - IL_001b: ldarg.0 - IL_001c: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@16-4'::builder@ - IL_0021: ldarg.0 - IL_0022: ldfld int32 AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@16-4'::x1 - IL_0027: ldloc.1 - IL_0028: newobj instance void AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@19-5'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder, + IL_0011: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@16-5'::builder@ + IL_0016: stloc.2 + IL_0017: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6::f2() + IL_001c: stloc.3 + IL_001d: ldarg.0 + IL_001e: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@16-5'::builder@ + IL_0023: ldarg.0 + IL_0024: ldfld int32 AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@16-5'::x1 + IL_0029: ldloc.1 + IL_002a: newobj instance void AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@19-6'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder, int32, class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1) - IL_002d: tail. - IL_002f: callvirt instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder::Bind(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) - IL_0034: ret - } // end of method 'f3@16-4'::Invoke + IL_002f: stloc.s V_4 + IL_0031: ldloc.3 + IL_0032: ldloc.s V_4 + IL_0034: newobj instance void AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@18-8'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) + IL_0039: tail. + IL_003b: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) + IL_0040: ret + } // end of method 'f3@16-5'::Invoke + + } // end of class 'f3@16-5' + + .class auto ansi serializable sealed nested assembly beforefieldinit 'f3@15-9' + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn> + { + .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> binder + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method assembly specialname rtspecialname + instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> binder) cil managed + { + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 21 (0x15) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@15-9'::computation + IL_000d: ldarg.0 + IL_000e: ldarg.2 + IL_000f: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@15-9'::binder + IL_0014: ret + } // end of method 'f3@15-9'::.ctor - } // end of class 'f3@16-4' + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn + Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1 ctxt) cil managed + { + // Code size 21 (0x15) + .maxstack 8 + .line 15,15 : 17,31 '' + IL_0000: ldarg.1 + IL_0001: ldarg.0 + IL_0002: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@15-9'::computation + IL_0007: ldarg.0 + IL_0008: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@15-9'::binder + IL_000d: tail. + IL_000f: call class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::Bind(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1, + class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) + IL_0014: ret + } // end of method 'f3@15-9'::Invoke + + } // end of class 'f3@15-9' - .class auto ansi serializable sealed nested assembly beforefieldinit 'f3@15-3' + .class auto ansi serializable sealed nested assembly beforefieldinit 'f3@15-4' extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@ @@ -268,41 +463,100 @@ IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>::.ctor() IL_0006: ldarg.0 IL_0007: ldarg.1 - IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@15-3'::builder@ + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@15-4'::builder@ IL_000d: ldarg.0 IL_000e: ldarg.2 - IL_000f: stfld int32 AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@15-3'::x1 + IL_000f: stfld int32 AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@15-4'::x1 IL_0014: ret - } // end of method 'f3@15-3'::.ctor + } // end of method 'f3@15-4'::.ctor .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 Invoke(int32 _arg2) cil managed { - // Code size 38 (0x26) - .maxstack 8 - .locals init ([0] int32 x2) + // Code size 48 (0x30) + .maxstack 6 + .locals init ([0] int32 x2, + [1] class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder V_1, + [2] class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 V_2, + [3] class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> V_3) .line 14,14 : 17,31 '' IL_0000: ldarg.1 IL_0001: stloc.0 .line 15,15 : 17,31 '' IL_0002: ldarg.0 - IL_0003: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@15-3'::builder@ - IL_0008: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6::f2() - IL_000d: ldarg.0 - IL_000e: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@15-3'::builder@ - IL_0013: ldarg.0 - IL_0014: ldfld int32 AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@15-3'::x1 - IL_0019: newobj instance void AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@16-4'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder, + IL_0003: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@15-4'::builder@ + IL_0008: stloc.1 + IL_0009: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6::f2() + IL_000e: stloc.2 + IL_000f: ldarg.0 + IL_0010: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@15-4'::builder@ + IL_0015: ldarg.0 + IL_0016: ldfld int32 AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@15-4'::x1 + IL_001b: newobj instance void AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@16-5'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder, int32) - IL_001e: tail. - IL_0020: callvirt instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder::Bind(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) - IL_0025: ret - } // end of method 'f3@15-3'::Invoke + IL_0020: stloc.3 + IL_0021: ldloc.2 + IL_0022: ldloc.3 + IL_0023: newobj instance void AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@15-9'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) + IL_0028: tail. + IL_002a: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) + IL_002f: ret + } // end of method 'f3@15-4'::Invoke + + } // end of class 'f3@15-4' + + .class auto ansi serializable sealed nested assembly beforefieldinit 'f3@14-10' + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn> + { + .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> binder + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method assembly specialname rtspecialname + instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> binder) cil managed + { + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 21 (0x15) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@14-10'::computation + IL_000d: ldarg.0 + IL_000e: ldarg.2 + IL_000f: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@14-10'::binder + IL_0014: ret + } // end of method 'f3@14-10'::.ctor - } // end of class 'f3@15-3' + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn + Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1 ctxt) cil managed + { + // Code size 21 (0x15) + .maxstack 8 + .line 14,14 : 17,31 '' + IL_0000: ldarg.1 + IL_0001: ldarg.0 + IL_0002: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@14-10'::computation + IL_0007: ldarg.0 + IL_0008: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@14-10'::binder + IL_000d: tail. + IL_000f: call class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::Bind(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1, + class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) + IL_0014: ret + } // end of method 'f3@14-10'::Invoke - .class auto ansi serializable sealed nested assembly beforefieldinit 'f3@14-2' + } // end of class 'f3@14-10' + + .class auto ansi serializable sealed nested assembly beforefieldinit 'f3@14-3' extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@ @@ -320,37 +574,96 @@ IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>::.ctor() IL_0006: ldarg.0 IL_0007: ldarg.1 - IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@14-2'::builder@ + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@14-3'::builder@ IL_000d: ret - } // end of method 'f3@14-2'::.ctor + } // end of method 'f3@14-3'::.ctor .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 Invoke(int32 _arg1) cil managed { - // Code size 33 (0x21) - .maxstack 8 - .locals init ([0] int32 x1) + // Code size 43 (0x2b) + .maxstack 6 + .locals init ([0] int32 x1, + [1] class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder V_1, + [2] class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 V_2, + [3] class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> V_3) .line 13,13 : 17,31 '' IL_0000: ldarg.1 IL_0001: stloc.0 .line 14,14 : 17,31 '' IL_0002: ldarg.0 - IL_0003: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@14-2'::builder@ - IL_0008: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6::f2() - IL_000d: ldarg.0 - IL_000e: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@14-2'::builder@ - IL_0013: ldloc.0 - IL_0014: newobj instance void AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@15-3'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder, + IL_0003: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@14-3'::builder@ + IL_0008: stloc.1 + IL_0009: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6::f2() + IL_000e: stloc.2 + IL_000f: ldarg.0 + IL_0010: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@14-3'::builder@ + IL_0015: ldloc.0 + IL_0016: newobj instance void AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@15-4'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder, int32) - IL_0019: tail. - IL_001b: callvirt instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder::Bind(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) - IL_0020: ret - } // end of method 'f3@14-2'::Invoke + IL_001b: stloc.3 + IL_001c: ldloc.2 + IL_001d: ldloc.3 + IL_001e: newobj instance void AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@14-10'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) + IL_0023: tail. + IL_0025: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) + IL_002a: ret + } // end of method 'f3@14-3'::Invoke + + } // end of class 'f3@14-3' + + .class auto ansi serializable sealed nested assembly beforefieldinit 'f3@13-11' + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn> + { + .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> binder + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method assembly specialname rtspecialname + instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> binder) cil managed + { + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 21 (0x15) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@13-11'::computation + IL_000d: ldarg.0 + IL_000e: ldarg.2 + IL_000f: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@13-11'::binder + IL_0014: ret + } // end of method 'f3@13-11'::.ctor + + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn + Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1 ctxt) cil managed + { + // Code size 21 (0x15) + .maxstack 8 + .line 13,13 : 17,31 '' + IL_0000: ldarg.1 + IL_0001: ldarg.0 + IL_0002: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@13-11'::computation + IL_0007: ldarg.0 + IL_0008: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@13-11'::binder + IL_000d: tail. + IL_000f: call class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::Bind(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1, + class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) + IL_0014: ret + } // end of method 'f3@13-11'::Invoke - } // end of class 'f3@14-2' + } // end of class 'f3@13-11' - .class auto ansi serializable sealed nested assembly beforefieldinit 'f3@13-1' + .class auto ansi serializable sealed nested assembly beforefieldinit 'f3@13-2' extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@ @@ -368,29 +681,38 @@ IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>::.ctor() IL_0006: ldarg.0 IL_0007: ldarg.1 - IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@13-1'::builder@ + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@13-2'::builder@ IL_000d: ret - } // end of method 'f3@13-1'::.ctor + } // end of method 'f3@13-2'::.ctor .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed { - // Code size 30 (0x1e) - .maxstack 8 + // Code size 40 (0x28) + .maxstack 6 + .locals init ([0] class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder V_0, + [1] class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 V_1, + [2] class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> V_2) .line 13,13 : 17,31 '' IL_0000: ldarg.0 - IL_0001: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@13-1'::builder@ - IL_0006: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6::f2() - IL_000b: ldarg.0 - IL_000c: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@13-1'::builder@ - IL_0011: newobj instance void AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@14-2'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder) - IL_0016: tail. - IL_0018: callvirt instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder::Bind(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) - IL_001d: ret - } // end of method 'f3@13-1'::Invoke - - } // end of class 'f3@13-1' + IL_0001: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@13-2'::builder@ + IL_0006: stloc.0 + IL_0007: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6::f2() + IL_000c: stloc.1 + IL_000d: ldarg.0 + IL_000e: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@13-2'::builder@ + IL_0013: newobj instance void AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@14-3'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder) + IL_0018: stloc.2 + IL_0019: ldloc.1 + IL_001a: ldloc.2 + IL_001b: newobj instance void AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@13-11'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) + IL_0020: tail. + IL_0022: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) + IL_0027: ret + } // end of method 'f3@13-2'::Invoke + + } // end of class 'f3@13-2' .method public static class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 f2() cil managed @@ -420,7 +742,7 @@ IL_0005: stloc.0 IL_0006: ldloc.0 IL_0007: ldloc.0 - IL_0008: newobj instance void AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@13-1'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder) + IL_0008: newobj instance void AsyncExpressionSteppingTest6/AsyncExpressionSteppingTest6/'f3@13-2'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder) IL_000d: tail. IL_000f: callvirt instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder::Delay(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) IL_0014: ret diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/E_OverloadMismatch.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/E_OverloadMismatch.fs new file mode 100644 index 0000000000..6a110a839c --- /dev/null +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/E_OverloadMismatch.fs @@ -0,0 +1,14 @@ +//No implementation was given for + +open System +open System.IO +type IFoo = + abstract member Foo : t:Type * r:TextReader -> obj + abstract member Foo<'t> : TextReader -> 't + + +type Foo() = + interface IFoo with + member x.Foo(t, reader) = obj() + +exit 1 diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/env.lst b/tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/env.lst index 7a3e95f230..a738455663 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/env.lst +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/env.lst @@ -29,6 +29,7 @@ NOMONO,NoMT SOURCE=ConsumeOverloadGenericMethods.fs SCFLAGS="-r:lib.dll" PRECMD= SOURCE=SlowOverloadResolution.fs # SlowOverloadResolution.fs SOURCE=E_OverloadCurriedFunc.fs # E_OverloadCurriedFunc.fs + SOURCE=E_OverloadMismatch.fs # E_OverloadMismatch.fs SOURCE=NoWarningWhenOverloadingInSubClass01.fs SCFLAGS="--warnaserror" # NoWarningWhenOverloadingInSubClass01.fs SOURCE=E_UnsolvableConstraints01.fs SCFLAGS="--test:ErrorRanges" # E_UnsolvableConstraints01.fs diff --git a/tests/fsharpqa/Source/Misc/LongSourceFile01.fs b/tests/fsharpqa/Source/Misc/LongSourceFile01.fs index 0cf4c3e3e8..8d4c0cd35f 100644 --- a/tests/fsharpqa/Source/Misc/LongSourceFile01.fs +++ b/tests/fsharpqa/Source/Misc/LongSourceFile01.fs @@ -2287,6 +2287,7 @@ Microsoft.FSharp.Core.Operators: T Ceiling[T](T) Microsoft.FSharp.Core.Operators: T Cos[T](T) Microsoft.FSharp.Core.Operators: T Cosh[T](T) Microsoft.FSharp.Core.Operators: T DefaultArg[T](Microsoft.FSharp.Core.FSharpOption`1[T], T) +Microsoft.FSharp.Core.Operators: T DefaultValueArg[T](Microsoft.FSharp.Core.FSharpValueOption`1[T], T) Microsoft.FSharp.Core.Operators: T Exit[T](Int32) Microsoft.FSharp.Core.Operators: T Exp[T](T) Microsoft.FSharp.Core.Operators: T FailWith[T](System.String) From b3aa2708cfa7fae2410611985cdd8a2412acbd08 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Thu, 24 May 2018 16:06:35 -0700 Subject: [PATCH 022/150] add resource for option page name --- vsintegration/src/FSharp.Editor/FSharp.Editor.resx | 3 +++ vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf | 5 +++++ vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf | 5 +++++ vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.en.xlf | 5 +++++ vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf | 5 +++++ vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf | 5 +++++ vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf | 5 +++++ vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf | 5 +++++ vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf | 5 +++++ vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf | 5 +++++ vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf | 5 +++++ vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf | 5 +++++ vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf | 5 +++++ .../src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf | 5 +++++ .../src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf | 5 +++++ 15 files changed, 73 insertions(+) diff --git a/vsintegration/src/FSharp.Editor/FSharp.Editor.resx b/vsintegration/src/FSharp.Editor/FSharp.Editor.resx index d812b3320d..572a794eed 100644 --- a/vsintegration/src/FSharp.Editor/FSharp.Editor.resx +++ b/vsintegration/src/FSharp.Editor/FSharp.Editor.resx @@ -207,4 +207,7 @@ Advanced + + CodeLens + \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf index 00a7f05797..e6df03463f 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf @@ -152,6 +152,11 @@ Upřesnit + + CodeLens + CodeLens + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf index da1e2d3398..6f8a82dc3c 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf @@ -152,6 +152,11 @@ Erweitert + + CodeLens + CodeLens + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.en.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.en.xlf index 1b08ecb74b..666f3a369b 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.en.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.en.xlf @@ -152,6 +152,11 @@ Advanced + + CodeLens + CodeLens + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf index e9661c0489..0aecbe8541 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf @@ -152,6 +152,11 @@ Avanzadas + + CodeLens + CodeLens + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf index 2e41f543d2..73c43a740b 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf @@ -152,6 +152,11 @@ Avancé + + CodeLens + CodeLens + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf index 1becd43e91..908553bafe 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf @@ -152,6 +152,11 @@ Avanzate + + CodeLens + CodeLens + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf index 1ea4b48b1f..85b803b418 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf @@ -152,6 +152,11 @@ 詳細 + + CodeLens + CodeLens + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf index 5c3177f7d9..0a73238b52 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf @@ -152,6 +152,11 @@ 고급 + + CodeLens + CodeLens + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf index 50c16a27f0..4feb60afd4 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf @@ -152,6 +152,11 @@ Zaawansowane + + CodeLens + CodeLens + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf index e4362c8c3f..202d965684 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf @@ -152,6 +152,11 @@ Avançado + + CodeLens + CodeLens + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf index a31ffb183b..deb6b7d6f5 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf @@ -152,6 +152,11 @@ Дополнительно + + CodeLens + CodeLens + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf index dee92da98a..46f3718742 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf @@ -152,6 +152,11 @@ Gelişmiş + + CodeLens + CodeLens + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf index 3936d51f0d..9d5a304899 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf @@ -152,6 +152,11 @@ 高级 + + CodeLens + CodeLens + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf index 4a8801714b..64051ba68d 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf @@ -152,6 +152,11 @@ 進階 + + CodeLens + CodeLens + + \ No newline at end of file From 6a733262d5347c33d2edc469c755dd01df14ef7c Mon Sep 17 00:00:00 2001 From: Don Syme Date: Fri, 25 May 2018 07:33:53 +0200 Subject: [PATCH 023/150] [FS-1045] Add FuncConvert.FromFunc, FuncConvert.FromAction APIs (#4815) * add func overloads * adjust based on C# testing * fix test break * fix test * update surface area * fix test * align inlines * Merge error --- src/fsharp/FSharp.Core/Linq.fs | 4 - src/fsharp/FSharp.Core/prim-types.fs | 85 +++++++++++++----- src/fsharp/FSharp.Core/prim-types.fsi | 87 ++++++++++++++++--- .../SurfaceArea.coreclr.fs | 12 +++ .../SurfaceArea.net40.fs | 12 +++ tests/fsharp/core/fsfromcs/test.cs | 36 ++++++-- tests/fsharp/core/fsfromfsviacs/lib2.cs | 12 +++ tests/fsharp/core/fsfromfsviacs/test.fsx | 8 ++ tests/fsharp/tests.fs | 3 + 9 files changed, 215 insertions(+), 44 deletions(-) diff --git a/src/fsharp/FSharp.Core/Linq.fs b/src/fsharp/FSharp.Core/Linq.fs index 8c5c651326..8b6b5124c4 100644 --- a/src/fsharp/FSharp.Core/Linq.fs +++ b/src/fsharp/FSharp.Core/Linq.fs @@ -782,11 +782,7 @@ module LeafExpressionConverter = typedefof>, tyargs else let tyargs = [| vP.Type; bodyP.Type |] -#if FX_NO_CONVERTER typedefof>, tyargs -#else - typedefof>, tyargs -#endif let convType = lambdaTy.MakeGenericType tyargs let convDelegate = Expression.Lambda(convType, bodyP, [| vP |]) |> asExpr Expression.Call(typeof,"ToFSharpFunc", tyargs,[| convDelegate |]) |> asExpr diff --git a/src/fsharp/FSharp.Core/prim-types.fs b/src/fsharp/FSharp.Core/prim-types.fs index 560f1ded17..43d592c4d9 100644 --- a/src/fsharp/FSharp.Core/prim-types.fs +++ b/src/fsharp/FSharp.Core/prim-types.fs @@ -2884,40 +2884,82 @@ namespace Microsoft.FSharp.Core type FSharpFunc<'T,'Res> with -#if FX_NO_CONVERTER + + // Note: this is not made public in the signature, because of conflicts with the Converter overload. + // The method remains in case someone is calling it via reflection. [] - static member op_Implicit (func : System.Func<_,_>) : ('T -> 'Res) = (fun t -> func.Invoke(t)) + static member op_Implicit(converter : System.Func<_,_>) : ('T -> 'Res) = (fun t -> converter.Invoke(t)) + + // Note: this is not made public in the signature, because of conflicts with the Converter overload. + // The method remains in case someone is calling it via reflection. [] - static member op_Implicit (func : ('T -> 'Res) ) = new System.Func<'T,'Res>(func) -#else + static member op_Implicit(func : ('T -> 'Res) ) = new System.Func<'T,'Res>(func) + +#if !FX_NO_CONVERTER [] - static member op_Implicit (converter : System.Converter<_,_>) : ('T -> 'Res) = (fun t -> converter.Invoke(t)) + static member op_Implicit(f : System.Converter<_,_>) : ('T -> 'Res) = (fun t -> f.Invoke(t)) + [] static member op_Implicit (func : ('T -> 'Res) ) = new System.Converter<'T,'Res>(func) - static member FromConverter (converter : System.Converter<_,_>) : ('T -> 'Res) = (fun t -> converter.Invoke(t)) - static member ToConverter ( func : ('T -> 'Res) ) = new System.Converter<'T,'Res>(func) + static member FromConverter (converter: System.Converter<_,_>) : ('T -> 'Res) = (fun t -> converter.Invoke(t)) + + static member ToConverter (func: ('T -> 'Res) ) = new System.Converter<'T,'Res>(func) #endif - static member InvokeFast (func:FSharpFunc<_,_>, arg1:'T, arg2:'Res) = OptimizedClosures.invokeFast2(func, arg1, arg2) - static member InvokeFast (func:FSharpFunc<_,_>, arg1:'T, arg2:'Res, arg3) = OptimizedClosures.invokeFast3(func, arg1, arg2, arg3) - static member InvokeFast (func:FSharpFunc<_,_>, arg1:'T, arg2:'Res, arg3, arg4) = OptimizedClosures.invokeFast4(func, arg1, arg2, arg3, arg4) - static member InvokeFast (func:FSharpFunc<_,_>, arg1:'T, arg2:'Res, arg3, arg4, arg5) = OptimizedClosures.invokeFast5(func, arg1, arg2, arg3, arg4, arg5) + + static member InvokeFast (func:FSharpFunc<_,_>, arg1: 'T, arg2: 'Res) = OptimizedClosures.invokeFast2(func, arg1, arg2) + + static member InvokeFast (func:FSharpFunc<_,_>, arg1: 'T, arg2: 'Res, arg3) = OptimizedClosures.invokeFast3(func, arg1, arg2, arg3) + + static member InvokeFast (func:FSharpFunc<_,_>, arg1: 'T, arg2: 'Res, arg3, arg4) = OptimizedClosures.invokeFast4(func, arg1, arg2, arg3, arg4) + + static member InvokeFast (func:FSharpFunc<_,_>, arg1: 'T, arg2: 'Res, arg3, arg4, arg5) = OptimizedClosures.invokeFast5(func, arg1, arg2, arg3, arg4, arg5) [] [] type FuncConvert = - static member ToFSharpFunc (action: Action<_>) = (fun t -> action.Invoke(t)) -#if FX_NO_CONVERTER - static member ToFSharpFunc (converter: System.Func<_, _>) = (fun t -> converter.Invoke(t)) -#else - static member ToFSharpFunc (converter: Converter<_,_>) = (fun t -> converter.Invoke(t)) -#endif - static member FuncFromTupled (func:'T1 * 'T2 -> 'Res) = (fun a b -> func (a, b)) - static member FuncFromTupled (func:'T1 * 'T2 * 'T3 -> 'Res) = (fun a b c -> func (a, b, c)) - static member FuncFromTupled (func:'T1 * 'T2 * 'T3 * 'T4 -> 'Res) = (fun a b c d -> func (a, b, c, d)) - static member FuncFromTupled (func:'T1 * 'T2 * 'T3 * 'T4 * 'T5 -> 'Res) = (fun a b c d e-> func (a, b, c, d, e)) + static member inline ToFSharpFunc (action: Action<_>) = (fun t -> action.Invoke(t)) + +#if !FX_NO_CONVERTER + static member inline ToFSharpFunc (converter : Converter<_,_>) = (fun t -> converter.Invoke(t)) +#endif + + // Note: this is not made public in the signature, because of conflicts with the Converter overload. + // The method remains in case someone is calling it via reflection. + static member inline ToFSharpFunc (converter: System.Func<_, _>) = (fun t -> converter.Invoke(t)) + + static member inline FromFunc (func: System.Func<_>) = (fun () -> func.Invoke()) + + static member inline FromFunc (func: System.Func<_, _>) = (fun t -> func.Invoke(t)) + static member inline FromFunc (func: System.Func<_, _, _>) = (fun t1 t2 -> func.Invoke(t1,t2)) + + static member inline FromFunc (func: System.Func<_, _, _, _>) = (fun t1 t2 t3 -> func.Invoke(t1,t2,t3)) + + static member inline FromFunc (func: System.Func<_, _, _, _, _>) = (fun t1 t2 t3 t4 -> func.Invoke(t1,t2,t3,t4)) + + static member inline FromFunc (func: System.Func<_, _, _, _, _, _>) = (fun t1 t2 t3 t4 t5 -> func.Invoke(t1,t2,t3,t4,t5)) + + static member inline FromAction (action: System.Action) = (fun () -> action.Invoke()) + + static member inline FromAction (action: System.Action<_>) = (fun t -> action.Invoke(t)) + + static member inline FromAction (action: System.Action<_, _>) = (fun t1 t2 -> action.Invoke(t1,t2)) + + static member inline FromAction (action: System.Action<_, _, _>) = (fun t1 t2 t3 -> action.Invoke(t1,t2,t3)) + + static member inline FromAction (action: System.Action<_, _, _, _>) = (fun t1 t2 t3 t4 -> action.Invoke(t1,t2,t3,t4)) + + static member inline FromAction (action: System.Action<_, _, _, _, _>) = (fun t1 t2 t3 t4 t5 -> action.Invoke(t1,t2,t3,t4,t5)) + + static member inline FuncFromTupled (func: 'T1 * 'T2 -> 'Res) = (fun a b -> func (a, b)) + + static member inline FuncFromTupled (func: 'T1 * 'T2 * 'T3 -> 'Res) = (fun a b c -> func (a, b, c)) + + static member inline FuncFromTupled (func: 'T1 * 'T2 * 'T3 * 'T4 -> 'Res) = (fun a b c d -> func (a, b, c, d)) + + static member inline FuncFromTupled (func: 'T1 * 'T2 * 'T3 * 'T4 * 'T5 -> 'Res) = (fun a b c d e -> func (a, b, c, d, e)) //------------------------------------------------------------------------- // Refs @@ -5433,7 +5475,6 @@ namespace Microsoft.FSharp.Core let TanhDynamic x = TanhDynamicImplTable<_>.Result x let PowDynamic x y = PowDynamicImplTable<_,_>.Result x y - open OperatorIntrinsics let inline (..) (start:^T) (finish:^T) = diff --git a/src/fsharp/FSharp.Core/prim-types.fsi b/src/fsharp/FSharp.Core/prim-types.fsi index 599e0b0ffe..97202c3601 100644 --- a/src/fsharp/FSharp.Core/prim-types.fsi +++ b/src/fsharp/FSharp.Core/prim-types.fsi @@ -1445,16 +1445,17 @@ namespace Microsoft.FSharp.Core [] type FSharpFunc<'T,'U> = - /// Construct an instance of an F# first class function value - /// The created F# function. + /// Construct an instance of an F# first class function value + /// The created F# function. new : unit -> FSharpFunc<'T,'U> - + /// Invoke an F# first class function value with one argument /// /// 'U abstract member Invoke : func:'T -> 'U #if !FX_NO_CONVERTER + /// Convert an F# first class function value to a value of type System.Converter /// The input function. /// A System.Converter of the function type. @@ -1469,6 +1470,7 @@ namespace Microsoft.FSharp.Core /// The input function. /// System.Converter<'T,'U> static member ToConverter : func:('T -> 'U) -> System.Converter<'T,'U> + /// Convert an value of type System.Converter to a F# first class function value /// The input System.Converter. /// An F# function of the same type. @@ -1520,36 +1522,96 @@ namespace Microsoft.FSharp.Core type FuncConvert = /// Convert the given Action delegate object to an F# function value - /// The input action. + /// The input Action delegate. /// The F# function. - static member ToFSharpFunc : action:Action<'T> -> ('T -> unit) + static member inline ToFSharpFunc : action:Action<'T> -> ('T -> unit) #if !FX_NO_CONVERTER /// Convert the given Converter delegate object to an F# function value - /// The input Converter. + /// The input Converter delegate. /// The F# function. - static member ToFSharpFunc : converter:Converter<'T,'U> -> ('T -> 'U) + static member inline ToFSharpFunc : converter:Converter<'T,'U> -> ('T -> 'U) #endif + /// Convert the given Action delegate object to an F# function value + /// The input Action delegate. + /// The F# function. + static member inline FromAction : action:Action -> (unit -> unit) + + /// Convert the given Action delegate object to an F# function value + /// The input Action delegate. + /// The F# function. + static member inline FromAction : action:Action<'T> -> ('T -> unit) + + /// Convert the given Action delegate object to an F# function value + /// The input Action delegate. + /// The F#funcfunction. + static member inline FromAction : action:Action<'T1,'T2> -> ('T1 -> 'T2 -> unit) + + /// Convert the given Action delegate object to an F# function value + /// The input Action delegate. + /// The F# function. + static member inline FromAction : action:Action<'T1,'T2,'T3> -> ('T1 -> 'T2 -> 'T3 -> unit) + + /// Convert the given Action delegate object to an F# function value + /// The input Action delegate. + /// The F# function. + static member inline FromAction : action:Action<'T1,'T2,'T3,'T4> -> ('T1 -> 'T2 -> 'T3 -> 'T4 -> unit) + + /// Convert the given Action delegate object to an F# function value + /// The input Action delegate. + /// The F# function. + static member inline FromAction : action:Action<'T1,'T2,'T3,'T4,'T5> -> ('T1 -> 'T2 -> 'T3 -> 'T4 -> 'T5 -> unit) + + /// Convert the given Func delegate object to an F# function value + /// The input Func delegate. + /// The F# function. + static member inline FromFunc : func:Func<'T> -> (unit -> 'T) + + /// Convert the given Func delegate object to an F# function value + /// The input Func delegate. + /// The F# function. + static member inline FromFunc : func:Func<'T,'U> -> ('T -> 'U) + + /// Convert the given Func delegate object to an F# function value + /// The input Func delegate. + /// The F#funcfunction. + static member inline FromFunc : func:Func<'T1,'T2,'U> -> ('T1 -> 'T2 -> 'U) + + /// Convert the given Func delegate object to an F# function value + /// The input Func delegate. + /// The F# function. + static member inline FromFunc : func:Func<'T1,'T2,'T3,'U> -> ('T1 -> 'T2 -> 'T3 -> 'U) + + /// Convert the given Func delegate object to an F# function value + /// The input Func delegate. + /// The F# function. + static member inline FromFunc : func:Func<'T1,'T2,'T3,'T4,'U> -> ('T1 -> 'T2 -> 'T3 -> 'T4 -> 'U) + + /// Convert the given Func delegate object to an F# function value + /// The input Func delegate. + /// The F# function. + static member inline FromFunc : func:Func<'T1,'T2,'T3,'T4,'T5,'U> -> ('T1 -> 'T2 -> 'T3 -> 'T4 -> 'T5 -> 'U) + /// A utility function to convert function values from tupled to curried form /// The input tupled function. /// The output curried function. - static member FuncFromTupled : func:('T1 * 'T2 -> 'U) -> ('T1 -> 'T2 -> 'U) + static member inline FuncFromTupled : func:('T1 * 'T2 -> 'U) -> ('T1 -> 'T2 -> 'U) /// A utility function to convert function values from tupled to curried form /// The input tupled function. /// The output curried function. - static member FuncFromTupled : func:('T1 * 'T2 * 'T3 -> 'U) -> ('T1 -> 'T2 -> 'T3 -> 'U) + static member inline FuncFromTupled : func:('T1 * 'T2 * 'T3 -> 'U) -> ('T1 -> 'T2 -> 'T3 -> 'U) /// A utility function to convert function values from tupled to curried form /// The input tupled function. /// The output curried function. - static member FuncFromTupled : func:('T1 * 'T2 * 'T3 * 'T4 -> 'U) -> ('T1 -> 'T2 -> 'T3 -> 'T4 -> 'U) + static member inline FuncFromTupled : func:('T1 * 'T2 * 'T3 * 'T4 -> 'U) -> ('T1 -> 'T2 -> 'T3 -> 'T4 -> 'U) /// A utility function to convert function values from tupled to curried form /// The input tupled function. /// The output curried function. - static member FuncFromTupled : func:('T1 * 'T2 * 'T3 * 'T4 * 'T5 -> 'U) -> ('T1 -> 'T2 -> 'T3 -> 'T4 -> 'T5 -> 'U) + static member inline FuncFromTupled : func:('T1 * 'T2 * 'T3 * 'T4 * 'T5 -> 'U) -> ('T1 -> 'T2 -> 'T3 -> 'T4 -> 'T5 -> 'U) /// An implementation module used to hold some private implementations of function /// value invocation. @@ -1584,6 +1646,7 @@ namespace Microsoft.FSharp.Core /// typically used directly from either F# code or from other CLI languages. [] type FSharpFunc<'T1,'T2,'T3,'U> = + inherit FSharpFunc<'T1,('T2 -> 'T3 -> 'U)> /// Invoke an F# first class function value that accepts three curried arguments @@ -1626,6 +1689,7 @@ namespace Microsoft.FSharp.Core /// The input function. /// The optimized function. static member Adapt : func:('T1 -> 'T2 -> 'T3 -> 'T4 -> 'U) -> FSharpFunc<'T1,'T2,'T3,'T4,'U> + /// Construct an optimized function value that can accept four curried /// arguments without intervening execution. /// The optimized function. @@ -3204,6 +3268,7 @@ namespace Microsoft.FSharp.Control module LazyExtensions = type System.Lazy<'T> with + /// Creates a lazy computation that evaluates to the result of the given function when forced. /// The function to provide the value when needed. /// The created Lazy object. diff --git a/tests/FSharp.Core.UnitTests/SurfaceArea.coreclr.fs b/tests/FSharp.Core.UnitTests/SurfaceArea.coreclr.fs index 8920bc105a..11dbf82716 100644 --- a/tests/FSharp.Core.UnitTests/SurfaceArea.coreclr.fs +++ b/tests/FSharp.Core.UnitTests/SurfaceArea.coreclr.fs @@ -2177,6 +2177,18 @@ Microsoft.FSharp.Core.FSharpTypeFunc: System.String ToString() Microsoft.FSharp.Core.FSharpTypeFunc: System.Type GetType() Microsoft.FSharp.Core.FSharpTypeFunc: Void .ctor() Microsoft.FSharp.Core.FuncConvert: Boolean Equals(System.Object) +Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Core.Unit] FromAction(System.Action) +Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.Unit] FromAction[T](System.Action`1[T]) +Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.Unit]] FromAction[T1,T2](System.Action`2[T1,T2]) +Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[T3,Microsoft.FSharp.Core.Unit]]] FromAction[T1,T2,T3](System.Action`3[T1,T2,T3]) +Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[T3,Microsoft.FSharp.Core.FSharpFunc`2[T4,Microsoft.FSharp.Core.Unit]]]] FromAction[T1,T2,T3,T4](System.Action`4[T1,T2,T3,T4]) +Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[T3,Microsoft.FSharp.Core.FSharpFunc`2[T4,Microsoft.FSharp.Core.FSharpFunc`2[T5,Microsoft.FSharp.Core.Unit]]]]] FromAction[T1,T2,T3,T4,T5](System.Action`5[T1,T2,T3,T4,T5]) +Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,T] FromFunc[T](System.Func`1[T]) +Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] FromFunc[T,TResult](System.Func`2[T,TResult]) +Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,TResult]] FromFunc[T1,T2,TResult](System.Func`3[T1,T2,TResult]) +Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[T3,TResult]]] FromFunc[T1,T2,T3,TResult](System.Func`4[T1,T2,T3,TResult]) +Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[T3,Microsoft.FSharp.Core.FSharpFunc`2[T4,TResult]]]] FromFunc[T1,T2,T3,T4,TResult](System.Func`5[T1,T2,T3,T4,TResult]) +Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[T3,Microsoft.FSharp.Core.FSharpFunc`2[T4,Microsoft.FSharp.Core.FSharpFunc`2[T5,TResult]]]]] FromFunc[T1,T2,T3,T4,T5,TResult](System.Func`6[T1,T2,T3,T4,T5,TResult]) Microsoft.FSharp.Core.FuncConvert: Int32 GetHashCode() Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.Unit] ToFSharpFunc[T](System.Action`1[T]) Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[T3,Microsoft.FSharp.Core.FSharpFunc`2[T4,Microsoft.FSharp.Core.FSharpFunc`2[T5,TResult]]]]] FuncFromTupled[T1,T2,T3,T4,T5,TResult](Microsoft.FSharp.Core.FSharpFunc`2[System.Tuple`5[T1,T2,T3,T4,T5],TResult]) diff --git a/tests/FSharp.Core.UnitTests/SurfaceArea.net40.fs b/tests/FSharp.Core.UnitTests/SurfaceArea.net40.fs index 2958a5f16e..2071364450 100644 --- a/tests/FSharp.Core.UnitTests/SurfaceArea.net40.fs +++ b/tests/FSharp.Core.UnitTests/SurfaceArea.net40.fs @@ -2257,6 +2257,18 @@ Microsoft.FSharp.Core.FSharpTypeFunc: System.String ToString() Microsoft.FSharp.Core.FSharpTypeFunc: System.Type GetType() Microsoft.FSharp.Core.FSharpTypeFunc: Void .ctor() Microsoft.FSharp.Core.FuncConvert: Boolean Equals(System.Object) +Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Core.Unit] FromAction(System.Action) +Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.Unit] FromAction[T](System.Action`1[T]) +Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.Unit]] FromAction[T1,T2](System.Action`2[T1,T2]) +Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[T3,Microsoft.FSharp.Core.Unit]]] FromAction[T1,T2,T3](System.Action`3[T1,T2,T3]) +Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[T3,Microsoft.FSharp.Core.FSharpFunc`2[T4,Microsoft.FSharp.Core.Unit]]]] FromAction[T1,T2,T3,T4](System.Action`4[T1,T2,T3,T4]) +Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[T3,Microsoft.FSharp.Core.FSharpFunc`2[T4,Microsoft.FSharp.Core.FSharpFunc`2[T5,Microsoft.FSharp.Core.Unit]]]]] FromAction[T1,T2,T3,T4,T5](System.Action`5[T1,T2,T3,T4,T5]) +Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,T] FromFunc[T](System.Func`1[T]) +Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] FromFunc[T,TResult](System.Func`2[T,TResult]) +Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,TResult]] FromFunc[T1,T2,TResult](System.Func`3[T1,T2,TResult]) +Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[T3,TResult]]] FromFunc[T1,T2,T3,TResult](System.Func`4[T1,T2,T3,TResult]) +Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[T3,Microsoft.FSharp.Core.FSharpFunc`2[T4,TResult]]]] FromFunc[T1,T2,T3,T4,TResult](System.Func`5[T1,T2,T3,T4,TResult]) +Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[T3,Microsoft.FSharp.Core.FSharpFunc`2[T4,Microsoft.FSharp.Core.FSharpFunc`2[T5,TResult]]]]] FromFunc[T1,T2,T3,T4,T5,TResult](System.Func`6[T1,T2,T3,T4,T5,TResult]) Microsoft.FSharp.Core.FuncConvert: Int32 GetHashCode() Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.Unit] ToFSharpFunc[T](System.Action`1[T]) Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] ToFSharpFunc[T,TResult](System.Converter`2[T,TResult]) diff --git a/tests/fsharp/core/fsfromcs/test.cs b/tests/fsharp/core/fsfromcs/test.cs index ea7fd1dd12..5281b3469e 100644 --- a/tests/fsharp/core/fsfromcs/test.cs +++ b/tests/fsharp/core/fsfromcs/test.cs @@ -56,21 +56,25 @@ static int Main() { Console.WriteLine("i = {0}", i);}), myList); + // tests op_Implicit ListModule.Iterate ((Converter) delegate(int i) { Console.WriteLine("i = {0} (2nd technique)", i); return null; }, myList); + // tests op_Implicit FSharpList myList2 = ListModule.Map (FuncConvert.ToFSharpFunc((Converter) delegate(int i) { return i.ToString() + i.ToString(); }), myList); + // tests op_Implicit ListModule.Iterate (FuncConvert.ToFSharpFunc((Action) delegate(string s) { Console.WriteLine("i after duplication = {0}", s);}), myList2); + // tests op_Implicit myList2 = ListModule.Map ((Converter) delegate(int i) { return i.ToString() + i.ToString(); }, @@ -81,16 +85,34 @@ static int Main() { Console.WriteLine("i after duplication (2nd technique) = {0}", s);}), myList2); - // No Func overloads are available for FuncConvert.ToFSharpFunc - // myList2 = - // ListModule.Map - // (FuncConvert.ToFSharpFunc((Func) delegate(int i) { return i.ToString() + i.ToString(); }), - // myList); + myList2 = + ListModule.Map + (FuncConvert.ToFSharpFunc(delegate(int i) { return i.ToString() + i.ToString(); }), + myList); + + myList2 = + ListModule.Map + (FuncConvert.FromFunc((Func) delegate(int i) { return i.ToString() + i.ToString(); }), + myList); ListModule.Iterate(FuncConvert.ToFSharpFunc(s => { Console.WriteLine("s = {0}", s);}),myList2); + ListModule.Iterate(FuncConvert.FromAction(s => { Console.WriteLine("s = {0}", s);}),myList2); + ListModule.Iterate(FuncConvert.FromFunc(s => null),myList2); + + myList2 = ListModule.Map(FuncConvert.ToFSharpFunc(i => i.ToString() + i.ToString()),myList); + myList2 = ListModule.Map(FuncConvert.FromFunc(i => i.ToString() + i.ToString()),myList); + myList2 = ListModule.MapIndexed(FuncConvert.FromFunc((i,j) => i.ToString() + j),myList); + + var trans3 = FuncConvert.FromFunc((i,j,k) => i + j + k); + var trans4 = FuncConvert.FromFunc((i,j,k,l) => i + j + k + l); + var trans5 = FuncConvert.FromFunc((i,j,k,l,m) => i + j + k + l + m); + + var action3 = FuncConvert.FromAction((i,j,k) => System.Console.WriteLine("action! {0}", i + j + k)); + var action4 = FuncConvert.FromAction((i,j,k,l) => System.Console.WriteLine("action! {0}", i + j + k + l)); + var action5 = FuncConvert.FromAction((i,j,k,l,m) => System.Console.WriteLine("action! {0}", i + j + k + l + m)); + ListModule.Iterate(FuncConvert.ToFSharpFunc(s => { Console.WriteLine("i after duplication (2nd technique) = {0}", s);}),myList2); + ListModule.Iterate(FuncConvert.FromAction(s => { Console.WriteLine("i after duplication (2nd technique) = {0}", s);}),myList2); - //Note: This call becomes ambiguous if Func overloads of FuncConvert.ToFSharpFunc are added - myList2 = ListModule.Map(FuncConvert.ToFSharpFunc(i => i.ToString() + i.ToString()),myList2); } diff --git a/tests/fsharp/core/fsfromfsviacs/lib2.cs b/tests/fsharp/core/fsfromfsviacs/lib2.cs index 95671b926f..ea58238f26 100644 --- a/tests/fsharp/core/fsfromfsviacs/lib2.cs +++ b/tests/fsharp/core/fsfromfsviacs/lib2.cs @@ -97,4 +97,16 @@ public static int MethodThatImplicitlyConvertsFSharpOption(int x) return opt.Value; } } +} + +namespace FSharpFuncTests +{ + public class ApiWrapper + { + public static Func f1 = new Func((int arg) => arg + 1); + public static Func f2 = new Func((int arg1, string arg2) => arg1 + arg2.Length + 1); + public static Func f3 = new Func((int arg1, string arg2, byte arg3) => arg1 + arg2.Length + 1 + arg3); + public static Func f4 = new Func((int arg1, string arg2, byte arg3, sbyte arg4) => arg1 + arg2.Length + 1 + arg3 + arg4); + public static Func f5 = new Func((int arg1, string arg2, byte arg3, sbyte arg4, Int16 arg5) => arg1 + arg2.Length + 1 + arg3 + arg4 + arg5); + } } \ No newline at end of file diff --git a/tests/fsharp/core/fsfromfsviacs/test.fsx b/tests/fsharp/core/fsfromfsviacs/test.fsx index 1fba263ef4..8a7e7c7152 100644 --- a/tests/fsharp/core/fsfromfsviacs/test.fsx +++ b/tests/fsharp/core/fsfromfsviacs/test.fsx @@ -157,6 +157,14 @@ module TestExtensions = test "dfeweeon" (r1.ExtendFSharpType() = 5) test "dfeweeon" (Lib2().ExtendCSharpType() = 4) + +let ToFSharpFunc() = + test "vkejhwew901" (FuncConvert.FromFunc(FSharpFuncTests.ApiWrapper.f1)(3) = FSharpFuncTests.ApiWrapper.f1.Invoke(3)) + test "vkejhwew902" (FuncConvert.FromFunc(FSharpFuncTests.ApiWrapper.f2)(3)("a") = FSharpFuncTests.ApiWrapper.f2.Invoke(3, "a")) + test "vkejhwew903" (FuncConvert.FromFunc(FSharpFuncTests.ApiWrapper.f3)(3)("a")(6uy) = FSharpFuncTests.ApiWrapper.f3.Invoke(3, "a", 6uy)) + test "vkejhwew904" (FuncConvert.FromFunc(FSharpFuncTests.ApiWrapper.f4)(3)("a")(6uy)(7y) = FSharpFuncTests.ApiWrapper.f4.Invoke(3, "a", 6uy, 7y)) + test "vkejhwew905" (FuncConvert.FromFunc(FSharpFuncTests.ApiWrapper.f5)(3)("a")(6uy)(7y)(7s) = FSharpFuncTests.ApiWrapper.f5.Invoke(3, "a", 6uy, 7y, 7s)) + #endif #if TESTS_AS_APP diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index 11fbcd0520..65b09ad89a 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -381,11 +381,14 @@ module CoreTests = peverify cfg "test.exe" + exec cfg ("." ++ "test.exe") "" + // Same with library references the other way around fsc cfg "%s -r:lib.dll -r:lib3.dll -r:lib2.dll -o:test.exe -g" cfg.fsc_flags ["test.fsx"] peverify cfg "test.exe" + exec cfg ("." ++ "test.exe") "" // Same without the reference to lib.dll - testing an incomplete reference set, but only compiling a subset of the code fsc cfg "%s -r:System.Runtime.dll --noframework --define:NO_LIB_REFERENCE -r:lib3.dll -r:lib2.dll -o:test.exe -g" cfg.fsc_flags ["test.fsx"] From 0e175faa6f8b149a7f7ec9296a5a3aa301324d55 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Fri, 25 May 2018 10:11:19 -0700 Subject: [PATCH 024/150] exclude NuGet package from VSIX signing requirements --- build/config/AssemblySignToolData.json | 1 + 1 file changed, 1 insertion(+) diff --git a/build/config/AssemblySignToolData.json b/build/config/AssemblySignToolData.json index 4adf89a4ca..00dc796e59 100644 --- a/build/config/AssemblySignToolData.json +++ b/build/config/AssemblySignToolData.json @@ -57,6 +57,7 @@ } ], "exclude": [ + "FSharp.Core.4.3.4.nupkg", "FSharp.Data.TypeProviders.dll", "Microsoft.Build.Conversion.Core.dll", "Microsoft.Build.dll", From d4647f9f876d36197c80f774c4580a79fde89d97 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Tue, 29 May 2018 20:13:07 +0200 Subject: [PATCH 025/150] Fix 4790 - exception message on dynamic invocation (#4806) * Fix 4790 - exception message on dynamic invocation * fix test * Make test case localizable --- src/fsharp/IlxGen.fs | 19 ++++++++++++------- tests/fsharp/core/reflect/test2.fs | 22 ++++++++++++++++++++++ 2 files changed, 34 insertions(+), 7 deletions(-) diff --git a/src/fsharp/IlxGen.fs b/src/fsharp/IlxGen.fs index eac580fddc..d015165f32 100644 --- a/src/fsharp/IlxGen.fs +++ b/src/fsharp/IlxGen.fs @@ -3330,14 +3330,19 @@ and CommitCallSequel cenv eenv m cloc cgbuf mustGenerateUnitAfterCall sequel = else GenSequel cenv cloc cgbuf sequel +and MakeNotSupportedExnExpr cenv eenv (argExpr, m) = + let ety = mkAppTy (cenv.g.FindSysTyconRef ["System"] "NotSupportedException") [] + let ilty = GenType cenv.amap m eenv.tyenv ety + let mref = mkILCtorMethSpecForTy(ilty, [cenv.g.ilg.typ_String]).MethodRef + Expr.Op(TOp.ILCall(false,false,false,true,NormalValUse,false,false,mref,[],[],[ety]),[],[argExpr],m) + and GenTraitCall cenv cgbuf eenv (traitInfo, argExprs, m) expr sequel = let minfoOpt = CommitOperationResult (ConstraintSolver.CodegenWitnessThatTypSupportsTraitConstraint cenv.TcVal cenv.g cenv.amap m traitInfo argExprs) match minfoOpt with | None -> - let replacementExpr = - mkThrow m (tyOfExpr cenv.g expr) - (mkExnExpr(cenv.g.FindSysTyconRef ["System"] "NotSupportedException", - [ mkString cenv.g m (FSComp.SR.ilDynamicInvocationNotSupported(traitInfo.MemberName))],m)) + let exnArg = mkString cenv.g m (FSComp.SR.ilDynamicInvocationNotSupported(traitInfo.MemberName)) + let exnExpr = MakeNotSupportedExnExpr cenv eenv (exnArg, m) + let replacementExpr = mkThrow m (tyOfExpr cenv.g expr) exnExpr GenExpr cenv cgbuf eenv SPSuppress replacementExpr sequel | Some expr -> let expr = cenv.optimizeDuringCodeGen expr @@ -5162,9 +5167,9 @@ and GenMethodForBinding // However still generate the code for reflection etc. let bodyExpr = if HasFSharpAttribute cenv.g cenv.g.attrib_NoDynamicInvocationAttribute v.Attribs then - mkThrow m returnTy - (mkExnExpr(cenv.g.FindSysTyconRef ["System"] "NotSupportedException", - [ mkString cenv.g m (FSComp.SR.ilDynamicInvocationNotSupported(v.CompiledName))],m)) + let exnArg = mkString cenv.g m (FSComp.SR.ilDynamicInvocationNotSupported(v.CompiledName)) + let exnExpr = MakeNotSupportedExnExpr cenv eenv (exnArg, m) + mkThrow m returnTy exnExpr else body diff --git a/tests/fsharp/core/reflect/test2.fs b/tests/fsharp/core/reflect/test2.fs index f562e9e0b9..9faf3bf07c 100644 --- a/tests/fsharp/core/reflect/test2.fs +++ b/tests/fsharp/core/reflect/test2.fs @@ -300,6 +300,28 @@ module TEst = let _ = printany printany (* =) *) +module DynamicCall = + open System + open System.Reflection + + module Test = + type Marker = class end + + let inline call (a : ^a) = + (^a : (member Stuff : Unit -> Unit) a) + + + let genericCallMethod = typeof.DeclaringType.GetMethod "call" + let callMethod = genericCallMethod.MakeGenericMethod [| typeof |] + + try + callMethod.Invoke (null, [| Object () |]) |> ignore + failwith "expected an exception" + with :? TargetInvocationException as ex -> + // The test should cause a NotSupportedException with the Message: + // "Dynamic invocation of %s is not supported" + // %s Will be Stuff Because thats the member that is not supported. + test "wcnr0vj" (ex.InnerException.Message.Contains("Stuff") && ex.InnerException.GetType() = typeof) #if TESTS_AS_APP let RUN() = !failures From 03a0f3c00b705b0f50e5c6ff967daac3dcaaac21 Mon Sep 17 00:00:00 2001 From: Phillip Carter Date: Fri, 18 May 2018 15:47:42 -0700 Subject: [PATCH 026/150] Fix annotation view (#4938) --- .../src/FSharp.Editor/LanguageService/LanguageService.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs index 4e38070ef5..a62bde5ac2 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs @@ -663,7 +663,7 @@ type internal FSharpLanguageService(package : FSharpPackage) = match hier with | :? IProvideProjectSite as siteProvider when not (IsScript(filename)) -> this.SetupProjectFile(siteProvider, this.Workspace, "SetupNewTextView") - | h when not (IsScript(filename)) -> + | h when not (isNull h) && not (IsScript(filename)) -> let docId = this.Workspace.CurrentSolution.GetDocumentIdsWithFilePath(filename).FirstOrDefault() match docId with | null -> From 5cac4f6bcadb5a4f18f8288b798d3d30f97d3436 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Wed, 30 May 2018 18:28:49 +0200 Subject: [PATCH 027/150] [RFCs FS-1037] allow flexible inference (subsumption) at union construction (#5030) * allow flexible types for union constructor * fix tests and add a test case for structs * quotation test * fix typo * allow flexible inference (subsumption) at list/sequence/array yield points * allow flexible inference (subsumption) at list/sequence/array yield points * suppress warnings for compat purposes * fix build * do not generalize IsCompatFlex variables to ensure code compat * use compat flex for union constructor flex * use compat flex for union constructor flex --- src/fsharp/TypeChecker.fs | 55 ++++++++++++------- tests/fsharp/core/quotes/test.fsx | 24 ++++++++ tests/fsharp/typecheck/sigs/neg20.bsl | 18 ------ tests/fsharp/typecheck/sigs/neg20.fs | 6 +- .../ConstructorFlexibleWhenPiping.fsx | 8 +++ .../StructConstructorFlexibleWhenPiping.fsx | 9 +++ .../UnionTypes/env.lst | 5 +- 7 files changed, 84 insertions(+), 41 deletions(-) create mode 100644 tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/ConstructorFlexibleWhenPiping.fsx create mode 100644 tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/StructConstructorFlexibleWhenPiping.fsx diff --git a/src/fsharp/TypeChecker.fs b/src/fsharp/TypeChecker.fs index 91688878a1..b2ee344b11 100755 --- a/src/fsharp/TypeChecker.fs +++ b/src/fsharp/TypeChecker.fs @@ -2899,7 +2899,7 @@ let MakeApplicableExprNoFlex cenv expr = /// This "special" node is immediately eliminated by the use of IteratedFlexibleAdjustArityOfLambdaBody as soon as we /// first transform the tree (currently in optimization) -let MakeApplicableExprWithFlex cenv (env: TcEnv) expr = +let MakeApplicableExprWithFlex cenv (env: TcEnv) compat expr = let exprTy = tyOfExpr cenv.g expr let m = expr.Range @@ -2907,19 +2907,31 @@ let MakeApplicableExprWithFlex cenv (env: TcEnv) expr = let argTys, retTy = stripFunTy cenv.g exprTy let curriedActualTypes = argTys |> List.map (tryDestRefTupleTy cenv.g) - if (curriedActualTypes.IsEmpty || - curriedActualTypes |> List.exists (List.exists (isByrefTy cenv.g)) || - curriedActualTypes |> List.forall (List.forall isNonFlexibleType)) then - + let noFlexInserted = + (curriedActualTypes.IsEmpty || + curriedActualTypes |> List.exists (List.exists (isByrefTy cenv.g)) || + curriedActualTypes |> List.forall (List.forall isNonFlexibleType)) + + if noFlexInserted then ApplicableExpr (cenv, expr, true) else let curriedFlexibleTypes = curriedActualTypes |> List.mapSquared (fun actualType -> - if isNonFlexibleType actualType - then actualType + + if isNonFlexibleType actualType then + actualType else + let flexibleType = NewInferenceType () - AddCxTypeMustSubsumeType ContextInfo.NoContext env.DisplayEnv cenv.css m NoTrace actualType flexibleType; + + // For backwards compatibility mark some extra flexibility points as IsCompatFlex, meaning that the + // type variable will not be generalized + if compat then + let tp = destTyparTy cenv.g flexibleType + tp.SetIsCompatFlex(true) + + AddCxTypeMustSubsumeType ContextInfo.NoContext env.DisplayEnv cenv.css m NoTrace actualType flexibleType + flexibleType) // Create a coercion to represent the expansion of the application @@ -5179,7 +5191,7 @@ and TcPat warnOnUpper cenv env topValInfo vFlags (tpenv, names, takenNames) ty p let args = match args with SynConstructorArgs.Pats args -> args | _ -> error(Error(FSComp.SR.tcNamedActivePattern(apinfo.ActiveTags.[idx]), m)) // TOTAL/PARTIAL ACTIVE PATTERNS let _, vexp, _, _, tinst, _ = TcVal true cenv env tpenv vref None None m - let vexp = MakeApplicableExprWithFlex cenv env vexp + let vexp = MakeApplicableExprWithFlex cenv env false vexp let vexpty = vexp.Type let activePatArgsAsSynPats, patarg = @@ -5465,8 +5477,13 @@ and TcExprOfUnknownType cenv env tpenv expr = and TcExprFlex cenv flex compat ty (env: TcEnv) tpenv (e: SynExpr) = if flex then let argty = NewInferenceType () + + // For backwards compatibility mark some extra flexibility points as IsCompatFlex, meaning that the + // type variable will not be generalized if compat then - (destTyparTy cenv.g argty).SetIsCompatFlex(true) + let tp = destTyparTy cenv.g argty + tp.SetIsCompatFlex(true) + AddCxTypeMustSubsumeType ContextInfo.NoContext env.DisplayEnv cenv.css e.Range NoTrace ty argty let e', tpenv = TcExpr cenv argty env tpenv e let e' = mkCoerceIfNeeded cenv.g ty argty e' @@ -8583,9 +8600,9 @@ and TcItemThen cenv overallTy env tpenv (item, mItem, rest, afterResolution) del let lam = mkMultiLambda mItem vs (constrApp, tyOfExpr cenv.g constrApp) lam) UnionCaseOrExnCheck env nargtys nargs mItem - let expr = mkExpr() - let exprTy = tyOfExpr cenv.g expr - PropagateThenTcDelayed cenv overallTy env tpenv mItem (MakeApplicableExprNoFlex cenv expr) exprTy ExprAtomicFlag.Atomic delayed + let expr = MakeApplicableExprWithFlex cenv env true (mkExpr()) + let exprTy = expr.Type + PropagateThenTcDelayed cenv overallTy env tpenv mItem expr exprTy ExprAtomicFlag.Atomic delayed | Item.Types(nm, (typ::_)) -> @@ -8878,7 +8895,7 @@ and TcItemThen cenv overallTy env tpenv (item, mItem, rest, afterResolution) del // - it isn't a VSlotDirectCall (uses of base values do not take type arguments let checkTys tpenv kinds = TcTypesOrMeasures (Some kinds) cenv NewTyparsOK CheckCxs ItemOccurence.UseInType env tpenv tys mItem let _, vexp, isSpecial, _, _, tpenv = TcVal true cenv env tpenv vref (Some (NormalValUse, checkTys)) (Some afterResolution) mItem - let vexpFlex = (if isSpecial then MakeApplicableExprNoFlex cenv vexp else MakeApplicableExprWithFlex cenv env vexp) + let vexpFlex = (if isSpecial then MakeApplicableExprNoFlex cenv vexp else MakeApplicableExprWithFlex cenv env false vexp) // We need to eventually record the type resolution for an expression, but this is done // inside PropagateThenTcDelayed, so we don't have to explicitly call 'CallExprHasTypeSink' here PropagateThenTcDelayed cenv overallTy env tpenv mExprAndTypeArgs vexpFlex vexpFlex.Type ExprAtomicFlag.Atomic otherDelayed @@ -8886,7 +8903,7 @@ and TcItemThen cenv overallTy env tpenv (item, mItem, rest, afterResolution) del // Value get | _ -> let _, vexp, isSpecial, _, _, tpenv = TcVal true cenv env tpenv vref None (Some afterResolution) mItem - let vexpFlex = (if isSpecial then MakeApplicableExprNoFlex cenv vexp else MakeApplicableExprWithFlex cenv env vexp) + let vexpFlex = (if isSpecial then MakeApplicableExprNoFlex cenv vexp else MakeApplicableExprWithFlex cenv env false vexp) PropagateThenTcDelayed cenv overallTy env tpenv mItem vexpFlex vexpFlex.Type ExprAtomicFlag.Atomic delayed | Item.Property (nm, pinfos) -> @@ -8947,7 +8964,7 @@ and TcItemThen cenv overallTy env tpenv (item, mItem, rest, afterResolution) del // Add an I_nop if this is an initonly field to make sure we never recognize it as an lvalue. See mkExprAddrOfExpr. mkAsmExpr ([ mkNormalLdsfld fspec ] @ (if finfo.IsInitOnly then [ AI_nop ] else []), finfo.TypeInst, [], [exprty], mItem) - PropagateThenTcDelayed cenv overallTy env tpenv mItem (MakeApplicableExprWithFlex cenv env expr) exprty ExprAtomicFlag.Atomic delayed + PropagateThenTcDelayed cenv overallTy env tpenv mItem (MakeApplicableExprWithFlex cenv env false expr) exprty ExprAtomicFlag.Atomic delayed | Item.RecdField rfinfo -> // Get static F# field or literal @@ -8976,7 +8993,7 @@ and TcItemThen cenv overallTy env tpenv (item, mItem, rest, afterResolution) del | Some lit -> Expr.Const(lit, mItem, exprty) // Get static F# field | None -> mkStaticRecdFieldGet (fref, rfinfo.TypeInst, mItem) - PropagateThenTcDelayed cenv overallTy env tpenv mItem (MakeApplicableExprWithFlex cenv env expr) exprty ExprAtomicFlag.Atomic delayed + PropagateThenTcDelayed cenv overallTy env tpenv mItem (MakeApplicableExprWithFlex cenv env false expr) exprty ExprAtomicFlag.Atomic delayed | Item.Event einfo -> // Instance IL event (fake up event-as-value) @@ -9112,7 +9129,7 @@ and TcLookupThen cenv overallTy env tpenv mObjExpr objExpr objExprTy longId dela // Instance F# Record or Class field let objExpr' = mkRecdFieldGet cenv.g (objExpr, rfinfo.RecdFieldRef, rfinfo.TypeInst, mExprAndItem) - PropagateThenTcDelayed cenv overallTy env tpenv mExprAndItem (MakeApplicableExprWithFlex cenv env objExpr') fieldTy ExprAtomicFlag.Atomic delayed + PropagateThenTcDelayed cenv overallTy env tpenv mExprAndItem (MakeApplicableExprWithFlex cenv env false objExpr') fieldTy ExprAtomicFlag.Atomic delayed | Item.ILField finfo -> // Get or set instance IL field @@ -9129,7 +9146,7 @@ and TcLookupThen cenv overallTy env tpenv mObjExpr objExpr objExprTy longId dela expr, tpenv | _ -> let expr = BuildILFieldGet cenv.g cenv.amap mExprAndItem objExpr finfo - PropagateThenTcDelayed cenv overallTy env tpenv mExprAndItem (MakeApplicableExprWithFlex cenv env expr) exprty ExprAtomicFlag.Atomic delayed + PropagateThenTcDelayed cenv overallTy env tpenv mExprAndItem (MakeApplicableExprWithFlex cenv env false expr) exprty ExprAtomicFlag.Atomic delayed | Item.Event einfo -> // Instance IL event (fake up event-as-value) diff --git a/tests/fsharp/core/quotes/test.fsx b/tests/fsharp/core/quotes/test.fsx index 52ef066ea7..9a1dbd6169 100644 --- a/tests/fsharp/core/quotes/test.fsx +++ b/tests/fsharp/core/quotes/test.fsx @@ -1744,6 +1744,30 @@ module QuotationStructUnionTests = //test "check NewUnionCase" (<@ A1(1,2) @> |> (function NewUnionCase(unionCase,[ Int32 1; Int32 2 ]) -> true | _ -> false)) +module FlexibleUnionConstructorTests = + + [] + type T = | A of seq + + type U = | B of seq + let testList = [1..3] + let testFunction caseName x = + match x with + | Call(None, _, + [PropertyGet (None,_,_) ; + Let (_, Lambda (_, NewUnionCase(unioncase, _)), + Lambda(_, Application(_, Coerce(_, ty))))]) -> + unioncase.Name = caseName && + ty.Name = "IEnumerable`1" + | _ -> false + + test "check struct flexible union constructor" + (<@ testList |> A @> |> testFunction "A") + + test "check flexible union constructor" + (<@ testList |> B @> |> testFunction "B") + + module EqualityOnExprDoesntFail = let q = <@ 1 @> check "we09ceo" (q.Equals(1)) false diff --git a/tests/fsharp/typecheck/sigs/neg20.bsl b/tests/fsharp/typecheck/sigs/neg20.bsl index ce156bee94..76aa1692df 100644 --- a/tests/fsharp/typecheck/sigs/neg20.bsl +++ b/tests/fsharp/typecheck/sigs/neg20.bsl @@ -131,24 +131,6 @@ but here has type neg20.fs(99,26,99,33): typecheck error FS0001: All elements of a list constructor expression must have the same type. This expression was expected to have type 'B', but here has type 'A'. -neg20.fs(108,12,108,16): typecheck error FS0001: Type mismatch. Expecting a - 'B * B -> 'a' -but given a - 'A * A -> Data' -The type 'B' does not match the type 'A' - -neg20.fs(109,12,109,16): typecheck error FS0001: Type mismatch. Expecting a - 'A * B -> 'a' -but given a - 'A * A -> Data' -The type 'B' does not match the type 'A' - -neg20.fs(110,12,110,16): typecheck error FS0001: Type mismatch. Expecting a - 'B * A -> 'a' -but given a - 'A * A -> Data' -The type 'B' does not match the type 'A' - neg20.fs(128,19,128,22): typecheck error FS0001: This expression was expected to have type 'string' but here has type diff --git a/tests/fsharp/typecheck/sigs/neg20.fs b/tests/fsharp/typecheck/sigs/neg20.fs index 5d465aeea9..9d82382d7e 100644 --- a/tests/fsharp/typecheck/sigs/neg20.fs +++ b/tests/fsharp/typecheck/sigs/neg20.fs @@ -105,9 +105,9 @@ module NoSubsumptionForLists2 = let pBB = (new B(),new B()) let pAB = (new A(),new B()) let pBA = (new B(),new A()) - pBB |> Data // not permitted (questionable) - pAB |> Data // not permitted (questionable) - pBA |> Data // not permitted (questionable) + pBB |> Data // permitted + pAB |> Data // permitted + pBA |> Data // permitted pBB |> data // permitted pAB |> data // permitted pBA |> data // permitted diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/ConstructorFlexibleWhenPiping.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/ConstructorFlexibleWhenPiping.fsx new file mode 100644 index 0000000000..52752978e0 --- /dev/null +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/ConstructorFlexibleWhenPiping.fsx @@ -0,0 +1,8 @@ +// #Conformance #TypesAndModules #Unions +// DU constructor should be flexible when piping +// + +type Foo = Items of seq +[1;2;3] |> Items + +exit 0 \ No newline at end of file diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/StructConstructorFlexibleWhenPiping.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/StructConstructorFlexibleWhenPiping.fsx new file mode 100644 index 0000000000..2a630ec04b --- /dev/null +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/StructConstructorFlexibleWhenPiping.fsx @@ -0,0 +1,9 @@ +// #Conformance #TypesAndModules #Unions +// Struct DU constructor should be flexible when piping +// + +[] +type Foo = Items of seq +[1;2;3] |> Items + +exit 0 \ No newline at end of file diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/env.lst b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/env.lst index c979c25d01..b71c6edefd 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/env.lst +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/env.lst @@ -99,4 +99,7 @@ NoMT SOURCE=Overload_ToString.fs COMPILE_ONLY=1 SCFLAGS=--warnaserror+ FSIMOD SOURCE=E_UnionFieldConflictingName.fs SCFLAGS="--test:ErrorRanges" # E_UnionFieldConflictingName.fs SOURCE=E_UnionConstructorBadFieldName.fs SCFLAGS="--test:ErrorRanges" # E_UnionConstructorBadFieldName.fs SOURCE=E_FieldNameUsedMulti.fs SCFLAGS="--test:ErrorRanges" # E_FieldNameUsedMulti.fs - SOURCE=E_FieldMemberClash.fs SCFLAGS="--test:ErrorRanges" # E_FieldMemberClash.fs \ No newline at end of file + SOURCE=E_FieldMemberClash.fs SCFLAGS="--test:ErrorRanges" # E_FieldMemberClash.fs + + SOURCE=ConstructorFlexibleWhenPiping.fsx # ConstructorFlexibleWhenPiping.fsx + SOURCE=StructConstructorFlexibleWhenPiping.fsx # StructConstructorFlexibleWhenPiping.fsx \ No newline at end of file From f1c9a9875f68eb744472f072c9e6229b86163de6 Mon Sep 17 00:00:00 2001 From: dotnet bot Date: Tue, 5 Jun 2018 06:23:37 -0700 Subject: [PATCH 028/150] Merge master to dev15.8 (#5087) * Update README.md * Update README.md * Update README.md * [RFCs FS-1051, FS-1052, FS-1053] support for span, readonly refs, byref-like structs (#4888) * initial support for span, readonly refs, byref-like structs * fix proto build * make proto work with previous FSharp.Core * make proto work with previous FSharp.Core * update baselines * integrate code cleanup * integrate code cleanup * integrate code cleanup * integrate code cleanup * fix build * fix build * implicit deref of byref returns * add tests for Memory, ReadOnlySpan and ReadOnlyMemory * fix tests * simplify diff * simplify diff * remove duplicate error messages * fix build * test updates * fix build * fix build * update baselines * fix uses of NativePtr.toByRef * switch to inference using byref pointer capabilities * fix proto build * update baselines, byref extension methods * fix test errors * emit in,out,modreq attributes correctly * update tests * fix build * fix build * fix tests * fix tests * get it right silly boy * fix test * minor cleanup * add more tests * clarify overloading behaviour + test case * fix build break * fix build of tests * update tests * add more tests * byref fixes * updates for subsumption calls, error message, assign-to-return-byref * test updates, implicit deref on byref return for normal functions * update baseline * improve debug formatting, better error message on implicit deref, improve error messages * add more tests for recursive functions * update baselines * fix baselines * updates for new test cases * updates for new test cases * test updates and byref-to-byreflike * deal with 'M() <- expr' * restrict addresses of immutable top-level things * fix IsByRefLike on struct * update tests * fix test * fix test * improve check for no-return-of-struct-field-addresses * fix test case * Provide fast generic comparer for bool values (#5076) * provide fast generic comparer for bool values * formatting * no completion on name of value and function declaration (#5083) * LOC CHECKIN | Microsoft/visualfsharp master | 20180604 | Termchange (#5082) * fix merge --- DEVGUIDE.md | 1 - README.md | 12 +- packages.config | 5 + src/absil/il.fs | 82 +- src/absil/il.fsi | 2 + src/absil/illib.fs | 7 + src/absil/ilreflect.fs | 69 +- .../FSharp.Compiler.Private/FSComp.fs | 2846 +++++++++-------- .../FSharp.Compiler.Private/FSComp.resx | 36 +- src/fsharp/AttributeChecking.fs | 22 +- src/fsharp/AugmentWithHashCompare.fs | 20 +- src/fsharp/ConstraintSolver.fs | 61 +- src/fsharp/ConstraintSolver.fsi | 3 + src/fsharp/DetupleArgs.fs | 8 +- src/fsharp/FSComp.txt | 14 +- src/fsharp/FSharp.Core/nativeptr.fs | 8 + src/fsharp/FSharp.Core/nativeptr.fsi | 16 + src/fsharp/FSharp.Core/prim-types-prelude.fs | 8 +- src/fsharp/FSharp.Core/prim-types-prelude.fsi | 13 +- src/fsharp/FSharp.Core/prim-types.fs | 21 + src/fsharp/FSharp.Core/prim-types.fsi | 19 + src/fsharp/IlxGen.fs | 170 +- src/fsharp/InnerLambdasToTopLevelFuncs.fs | 7 +- src/fsharp/MethodCalls.fs | 144 +- src/fsharp/NameResolution.fs | 2 +- src/fsharp/NicePrint.fs | 19 +- src/fsharp/Optimizer.fs | 43 +- src/fsharp/PatternMatchCompilation.fs | 2 +- src/fsharp/PostInferenceChecks.fs | 1139 ++++--- src/fsharp/QuotationTranslator.fs | 12 +- src/fsharp/TastOps.fs | 479 ++- src/fsharp/TastOps.fsi | 67 +- src/fsharp/TastPickle.fs | 20 +- src/fsharp/TcGlobals.fs | 68 +- src/fsharp/TypeChecker.fs | 401 ++- src/fsharp/ast.fs | 10 +- src/fsharp/autobox.fs | 17 +- src/fsharp/fsi/xlf/FSIstrings.txt.cs.xlf | 2 +- src/fsharp/fsi/xlf/FSIstrings.txt.fr.xlf | 2 +- src/fsharp/fsi/xlf/FSIstrings.txt.it.xlf | 2 +- src/fsharp/fsi/xlf/FSIstrings.txt.ko.xlf | 2 +- src/fsharp/fsi/xlf/FSIstrings.txt.pl.xlf | 2 +- src/fsharp/fsi/xlf/FSIstrings.txt.pt-BR.xlf | 2 +- src/fsharp/fsi/xlf/FSIstrings.txt.ru.xlf | 2 +- src/fsharp/import.fs | 7 +- src/fsharp/infos.fs | 29 +- src/fsharp/service/ServiceAssemblyContent.fs | 3 + src/fsharp/service/ServiceDeclarationLists.fs | 12 +- .../service/ServiceInterfaceStubGenerator.fs | 5 + src/fsharp/service/ServiceParseTreeWalk.fs | 3 +- src/fsharp/service/ServiceStructure.fs | 10 +- src/fsharp/service/ServiceUntypedParse.fs | 19 + src/fsharp/service/service.fs | 2 +- src/fsharp/symbols/Exprs.fs | 18 +- src/fsharp/symbols/Symbols.fs | 31 +- src/fsharp/symbols/Symbols.fsi | 3 + src/fsharp/tast.fs | 515 ++- src/fsharp/xlf/FSComp.txt.cs.xlf | 64 +- src/fsharp/xlf/FSComp.txt.de.xlf | 64 +- src/fsharp/xlf/FSComp.txt.en.xlf | 64 +- src/fsharp/xlf/FSComp.txt.es.xlf | 64 +- src/fsharp/xlf/FSComp.txt.fr.xlf | 64 +- src/fsharp/xlf/FSComp.txt.it.xlf | 64 +- src/fsharp/xlf/FSComp.txt.ja.xlf | 64 +- src/fsharp/xlf/FSComp.txt.ko.xlf | 64 +- src/fsharp/xlf/FSComp.txt.pl.xlf | 64 +- src/fsharp/xlf/FSComp.txt.pt-BR.xlf | 64 +- src/fsharp/xlf/FSComp.txt.ru.xlf | 64 +- src/fsharp/xlf/FSComp.txt.tr.xlf | 64 +- src/fsharp/xlf/FSComp.txt.zh-Hans.xlf | 64 +- src/fsharp/xlf/FSComp.txt.zh-Hant.xlf | 64 +- src/scripts/scriptlib.fsx | 15 +- .../SurfaceArea.coreclr.fs | 16 + .../SurfaceArea.net40.fs | 16 + tests/fsharp/core/byrefs/test.fsx | 1005 +++++- tests/fsharp/core/fsfromfsviacs/lib2.cs | 15 + tests/fsharp/core/fsfromfsviacs/test.fsx | 20 +- tests/fsharp/core/fsiAndModifiers/prepare.fsx | 4 +- tests/fsharp/core/span/test.fsx | 401 +++ tests/fsharp/core/span/testlib.fs | 15 + tests/fsharp/tests.fs | 71 +- .../typeProviders/helloWorld/provided.fs | 3 + tests/fsharp/typecheck/sigs/neg106.bsl | 124 + tests/fsharp/typecheck/sigs/neg106.fs | 74 + tests/fsharp/typecheck/sigs/neg106.vsbsl | 124 + tests/fsharp/typecheck/sigs/neg107.bsl | 66 + tests/fsharp/typecheck/sigs/neg107.fsx | 67 + tests/fsharp/typecheck/sigs/neg107.vsbsl | 66 + tests/fsharp/typecheck/sigs/neg63.bsl | 4 +- tests/fsharp/typecheck/sigs/neg97.bsl | 2 +- tests/fsharp/typecheck/sigs/neg97.vsbsl | 28 + tests/fsharp/typecheck/sigs/neg_byref_16.bsl | 2 + tests/fsharp/typecheck/sigs/neg_byref_17.bsl | 12 +- tests/fsharp/typecheck/sigs/neg_byref_22.bsl | 12 + tests/fsharp/typecheck/sigs/neg_byref_7.bsl | 2 +- .../E_SetFieldToByref04.fs | 2 +- tests/service/ExprTests.fs | 27 +- tests/service/ProjectOptionsTests.fs | 2 +- .../UnitTests/CompletionProviderTests.fs | 26 +- 99 files changed, 6900 insertions(+), 2761 deletions(-) create mode 100644 tests/fsharp/core/span/test.fsx create mode 100644 tests/fsharp/core/span/testlib.fs create mode 100644 tests/fsharp/typecheck/sigs/neg106.bsl create mode 100644 tests/fsharp/typecheck/sigs/neg106.fs create mode 100644 tests/fsharp/typecheck/sigs/neg106.vsbsl create mode 100644 tests/fsharp/typecheck/sigs/neg107.bsl create mode 100644 tests/fsharp/typecheck/sigs/neg107.fsx create mode 100644 tests/fsharp/typecheck/sigs/neg107.vsbsl create mode 100644 tests/fsharp/typecheck/sigs/neg97.vsbsl diff --git a/DEVGUIDE.md b/DEVGUIDE.md index 8cca8f58a9..1fc0d8ec85 100644 --- a/DEVGUIDE.md +++ b/DEVGUIDE.md @@ -223,7 +223,6 @@ To do this, build the non-buildfromsource version of FSharp.Compiler.Private (sr .\build net40 copy /y src\fsharp\FSharp.Compiler.Private\obj\release\net40\FSComp.* src\buildfromsource\FSharp.Compiler.Private\ - #### Configuring proxy server diff --git a/README.md b/README.md index 93328665a1..59c5b88dfd 100644 --- a/README.md +++ b/README.md @@ -16,12 +16,12 @@ For historical reasons this repository is called "visualfsharp" and currently al ## Build Status -| | Ubuntu (Build) | Windows (Debug Build) | Windows (Release Tests 1) | Windows (Release Tests 2) | Windows (Release Tests 3) | -|:----------:|:----------------:|:----------------:|:------------------:|:-----------------------:|:---------------------:| -|**master** |[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/master/release_ubuntu14.04)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/master/job/release_ubuntu14.04/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/master/debug_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/master/job/debug_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/master/release_ci_part1_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/master/job/release_ci_part1_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/master/release_ci_part2_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/master/job/release_ci_part2_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/master/release_ci_part3_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/master/job/release_ci_part3_windows_nt/)| -|**dev15.5** |[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.5/release_ubuntu14.04)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.5/job/release_ubuntu14.04/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.5/debug_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.5/job/debug_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.5/release_ci_part1_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.5/job/release_ci_part1_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.5/release_ci_part2_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.5/job/release_ci_part2_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.5/release_ci_part3_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.5/job/release_ci_part3_windows_nt/)| -|**dev15.6** |[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.6/release_ubuntu14.04)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.6/job/release_ubuntu14.04/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.6/debug_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.6/job/debug_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.6/release_ci_part1_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.6/job/release_ci_part1_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.6/release_ci_part2_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.6/job/release_ci_part2_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.6/release_ci_part3_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.6/job/release_ci_part3_windows_nt/)| -|**dev15.7** |[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.7/release_ubuntu14.04)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.7/job/release_ubuntu14.04/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.7/debug_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.7/job/debug_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.7/release_ci_part1_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.7/job/release_ci_part1_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.7/release_ci_part2_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.7/job/release_ci_part2_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.7/release_ci_part3_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.7/job/release_ci_part3_windows_nt/)| +| | Ubuntu (Build) | Windows (Debug Build) | Windows (Release Tests 1) | Windows (Release Tests 2) | Windows (Release Tests 3) | Windows (Release Tests 4) | +|:----------:|:----------------:|:----------------:|:------------------:|:-----------------------:|:---------------------:|:---------------------:| +|**master** |[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/master/release_ubuntu14.04)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/master/job/release_ubuntu14.04/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/master/debug_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/master/job/debug_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/master/release_ci_part1_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/master/job/release_ci_part1_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/master/release_ci_part2_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/master/job/release_ci_part2_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/master/release_ci_part3_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/master/job/release_ci_part3_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/master/release_ci_part4_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/master/job/release_ci_part4_windows_nt/)| +**dev15.6** |[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.6/release_ubuntu14.04)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.6/job/release_ubuntu14.04/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.6/debug_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.6/job/debug_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.6/release_ci_part1_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.6/job/release_ci_part1_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.6/release_ci_part2_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.6/job/release_ci_part2_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.6/release_ci_part3_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.6/job/release_ci_part3_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.6/release_ci_part4_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.6/job/release_ci_part4_windows_nt/)| +**dev15.7** |[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.7/release_ubuntu14.04)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.7/job/release_ubuntu14.04/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.7/debug_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.7/job/debug_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.7/release_ci_part1_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.7/job/release_ci_part1_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.7/release_ci_part2_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.7/job/release_ci_part2_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.7/release_ci_part3_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.7/job/release_ci_part3_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.7/release_ci_part4_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.7/job/release_ci_part4_windows_nt/)| +**dev15.8** |[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.8/release_ubuntu14.04)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.8/job/release_ubuntu14.04/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.8/debug_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.8/job/debug_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.8/release_ci_part1_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.8/job/release_ci_part1_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.8/release_ci_part2_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.8/job/release_ci_part2_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.8/release_ci_part3_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.8/job/release_ci_part3_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.8/release_ci_part4_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.8/job/release_ci_part4_windows_nt/)| ## Help improve the Quality of the Tools by Using the Nightly Releases of Visual F# Tools To setup Visual Studio to use the latest nightly releases of the Visual F# Tools: diff --git a/packages.config b/packages.config index eae81ca8f2..5fa5156e43 100644 --- a/packages.config +++ b/packages.config @@ -39,6 +39,11 @@ + + + + + diff --git a/src/absil/il.fs b/src/absil/il.fs index 2a5b7cc1ff..4e047481aa 100644 --- a/src/absil/il.fs +++ b/src/absil/il.fs @@ -8,6 +8,7 @@ module Microsoft.FSharp.Compiler.AbstractIL.IL open System +open System.Diagnostics open System.IO open System.Collections open System.Collections.Generic @@ -568,7 +569,7 @@ type ILBoxity = | AsValue // IL type references have a pre-computed hash code to enable quick lookup tables during binary generation. -[] +[] type ILTypeRef = { trefScope: ILScopeRef trefEnclosing: string list @@ -637,11 +638,15 @@ type ILTypeRef = member tref.QualifiedName = tref.AddQualifiedNameExtension(tref.BasicQualifiedName) + /// For debugging + [] + member x.DebugText = x.ToString() + + /// For debugging override x.ToString() = x.FullName -and - [] +and [] ILTypeSpec = { tspecTypeRef: ILTypeRef /// The type instantiation if the type is generic. @@ -671,9 +676,13 @@ and member x.FullName=x.TypeRef.FullName + /// For debugging + [] + member x.DebugText = x.ToString() + override x.ToString() = x.TypeRef.ToString() + if isNil x.GenericArgs then "" else "<...>" -and [] +and [] ILType = | Void | Array of ILArrayShape * ILType @@ -740,6 +749,10 @@ and [] match x with | ILType.TypeVar _ -> true | _ -> false + /// For debugging + [] + member x.DebugText = x.ToString() + override x.ToString() = x.QualifiedName and [] @@ -756,6 +769,7 @@ let mkILCallSig (cc, args, ret) = { ArgTypes=args; CallingConv=cc; ReturnType=re let mkILBoxedType (tspec:ILTypeSpec) = tspec.TypeRef.AsBoxedType tspec +[] type ILMethodRef = { mrefParent: ILTypeRef mrefCallconv: ILCallingConv @@ -783,18 +797,26 @@ type ILMethodRef = static member Create(a, b, c, d, e, f) = { mrefParent= a;mrefCallconv=b;mrefName=c;mrefGenericArity=d; mrefArgs=e;mrefReturn=f } + /// For debugging + [] + member x.DebugText = x.ToString() + override x.ToString() = x.DeclaringTypeRef.ToString() + "::" + x.Name + "(...)" -[] +[] type ILFieldRef = { DeclaringTypeRef: ILTypeRef Name: string Type: ILType } + /// For debugging + [] + member x.DebugText = x.ToString() + override x.ToString() = x.DeclaringTypeRef.ToString() + "::" + x.Name -[] +[] type ILMethodSpec = { mspecMethodRef: ILMethodRef @@ -802,7 +824,7 @@ type ILMethodSpec = mspecMethodInst: ILGenericArgs } - static member Create(a, b, c) = { mspecDeclaringType=a; mspecMethodRef =b; mspecMethodInst=c } + static member Create(a, b, c) = { mspecDeclaringType=a; mspecMethodRef=b; mspecMethodInst=c } member x.MethodRef = x.mspecMethodRef @@ -820,8 +842,13 @@ type ILMethodSpec = member x.FormalReturnType = x.MethodRef.ReturnType + /// For debugging + [] + member x.DebugText = x.ToString() + override x.ToString() = x.MethodRef.ToString() + "(...)" +[] type ILFieldSpec = { FieldRef: ILFieldRef DeclaringType: ILType } @@ -832,6 +859,10 @@ type ILFieldSpec = member x.DeclaringTypeRef = x.FieldRef.DeclaringTypeRef + /// For debugging + [] + member x.DebugText = x.ToString() + override x.ToString() = x.FieldRef.ToString() // -------------------------------------------------------------------- @@ -865,6 +896,7 @@ type ILSourceDocument = member x.File=x.sourceFile +[] type ILSourceMarker = { sourceDocument: ILSourceDocument sourceLine: int @@ -889,6 +921,10 @@ type ILSourceMarker = member x.EndColumn=x.sourceEndColumn + /// For debugging + [] + member x.DebugText = x.ToString() + override x.ToString() = sprintf "(%d, %d)-(%d, %d)" x.Line x.Column x.EndLine x.EndColumn type ILAttribElem = @@ -912,11 +948,16 @@ type ILAttribElem = type ILAttributeNamedArg = (string * ILType * bool * ILAttribElem) +[] type ILAttribute = { Method: ILMethodSpec Data: byte[] Elements: ILAttribElem list } + /// For debugging + [] + member x.DebugText = x.ToString() + override x.ToString() = x.Method.ToString() + "(...)" [] @@ -1424,6 +1465,8 @@ type ILReturn = member x.CustomAttrs = x.CustomAttrsStored.GetCustomAttrs x.MetadataIndex + member x.WithCustomAttrs(customAttrs) = { x with CustomAttrsStored = storeILCustomAttrs customAttrs } + type ILOverridesSpec = | OverridesSpec of ILMethodRef * ILType @@ -1475,6 +1518,7 @@ type ILGenericVariance = | CoVariant | ContraVariant +[] type ILGenericParameterDef = { Name: string Constraints: ILTypes @@ -1487,6 +1531,10 @@ type ILGenericParameterDef = member x.CustomAttrs = x.CustomAttrsStored.GetCustomAttrs x.MetadataIndex + /// For debugging + [] + member x.DebugText = x.ToString() + override x.ToString() = x.Name type ILGenericParameterDefs = ILGenericParameterDef list @@ -1665,7 +1713,7 @@ type ILMethodDefs(f : (unit -> ILMethodDef[])) = member x.FindByNameAndArity (nm, arity) = x.FindByName nm |> List.filter (fun x -> List.length x.Parameters = arity) -[] +[] type ILEventDef(eventType: ILType option, name: string, attributes: EventAttributes, addMethod: ILMethodRef, removeMethod: ILMethodRef, fireMethod: ILMethodRef option, otherMethods: ILMethodRef list, customAttrsStored: ILAttributesStored, metadataIndex: int32) = new (eventType, name, attributes, addMethod, removeMethod, fireMethod, otherMethods, customAttrs) = @@ -1695,6 +1743,10 @@ type ILEventDef(eventType: ILType option, name: string, attributes: EventAttribu member x.IsSpecialName = (x.Attributes &&& EventAttributes.SpecialName) <> enum<_>(0) member x.IsRTSpecialName = (x.Attributes &&& EventAttributes.RTSpecialName) <> enum<_>(0) + /// For debugging + [] + member x.DebugText = x.ToString() + override x.ToString() = "event " + x.Name [] @@ -1705,7 +1757,7 @@ type ILEventDefs = member x.LookupByName s = let (ILEvents t) = x in t.[s] -[] +[] type ILPropertyDef(name: string, attributes: PropertyAttributes, setMethod: ILMethodRef option, getMethod: ILMethodRef option, callingConv: ILThisConvention, propertyType: ILType, init: ILFieldInit option, args: ILTypes, customAttrsStored: ILAttributesStored, metadataIndex: int32) = new (name, attributes, setMethod, getMethod, callingConv, propertyType, init, args, customAttrs) = @@ -1737,6 +1789,11 @@ type ILPropertyDef(name: string, attributes: PropertyAttributes, setMethod: ILMe member x.IsSpecialName = (x.Attributes &&& PropertyAttributes.SpecialName) <> enum<_>(0) member x.IsRTSpecialName = (x.Attributes &&& PropertyAttributes.RTSpecialName) <> enum<_>(0) + + /// For debugging + [] + member x.DebugText = x.ToString() + override x.ToString() = "property " + x.Name // Index table by name. @@ -2469,7 +2526,7 @@ let tname_IntPtr = "System.IntPtr" [] let tname_UIntPtr = "System.UIntPtr" -[] +[] // This data structure needs an entirely delayed implementation type ILGlobals(primaryScopeRef) = @@ -2514,6 +2571,11 @@ type ILGlobals(primaryScopeRef) = member x.typ_Double = m_typ_Double member x.typ_Bool = m_typ_Bool member x.typ_Char = m_typ_Char + + /// For debugging + [] + member x.DebugText = x.ToString() + override x.ToString() = "" let mkILGlobals primaryScopeRef = ILGlobals primaryScopeRef diff --git a/src/absil/il.fsi b/src/absil/il.fsi index 621bfb1eff..fe0bd1bdac 100644 --- a/src/absil/il.fsi +++ b/src/absil/il.fsi @@ -796,6 +796,8 @@ type ILReturn = member CustomAttrs: ILAttributes + member WithCustomAttrs: customAttrs: ILAttributes -> ILReturn + [] type ILSecurityAction = | Request diff --git a/src/absil/illib.fs b/src/absil/illib.fs index 2050634f7b..627b5151ec 100644 --- a/src/absil/illib.fs +++ b/src/absil/illib.fs @@ -135,6 +135,9 @@ module Array = loop p l 0 + let existsTrue (arr: bool[]) = + let rec loop n = (n < arr.Length) && (arr.[n] || loop (n+1)) + loop 0 let findFirstIndexWhereTrue (arr: _[]) p = let rec look lo hi = @@ -263,6 +266,10 @@ module List = let rec loop i xs = match xs with [] -> false | h::t -> f i h || loop (i+1) t loop 0 xs + let existsTrue (xs: bool list) = + let rec loop i xs = match xs with [] -> false | h::t -> h || loop (i+1) t + loop 0 xs + let lengthsEqAndForall2 p l1 l2 = List.length l1 = List.length l2 && List.forall2 p l1 l2 diff --git a/src/absil/ilreflect.fs b/src/absil/ilreflect.fs index c84a1bd36f..c62ed5a846 100644 --- a/src/absil/ilreflect.fs +++ b/src/absil/ilreflect.fs @@ -7,27 +7,22 @@ module internal Microsoft.FSharp.Compiler.AbstractIL.ILRuntimeWriter -open Internal.Utilities +open System +open System.Reflection +open System.Reflection.Emit +open System.Runtime.InteropServices +open System.Collections.Generic + open Microsoft.FSharp.Compiler.AbstractIL open Microsoft.FSharp.Compiler.AbstractIL.Internal open Microsoft.FSharp.Compiler.AbstractIL.Internal.Library open Microsoft.FSharp.Compiler.AbstractIL.Diagnostics -open Microsoft.FSharp.Compiler.AbstractIL.Extensions -open Microsoft.FSharp.Compiler.AbstractIL.Extensions.ILX -open Microsoft.FSharp.Compiler.AbstractIL.Extensions.ILX.Types open Microsoft.FSharp.Compiler.AbstractIL.IL open Microsoft.FSharp.Compiler.ErrorLogger open Microsoft.FSharp.Compiler.Range open Microsoft.FSharp.Core.Printf -open System -open System.IO -open System.Reflection -open System.Reflection.Emit -open System.Runtime.InteropServices -open System.Collections.Generic - #if FX_RESHAPED_REFLECTION open Microsoft.FSharp.Core.ReflectionAdapters #endif @@ -121,13 +116,9 @@ type System.Reflection.Emit.MethodBuilder with if logRefEmitCalls then printfn "methodBuilder%d.SetImplementationFlags(enum %d)" (abs <| hash methB) (LanguagePrimitives.EnumToValue attrs) methB.SetImplementationFlags(attrs) - member methB.SetReturnTypeAndLog(rt:System.Type) = - if logRefEmitCalls then printfn "methodBuilder%d.SetReturnType(typeof<%s>)" (abs <| hash methB) rt.FullName - methB.SetReturnType(rt) - - member methB.SetParametersAndLog(ps) = - if logRefEmitCalls then printfn "methodBuilder%d.SetParameters(%A)" (abs <| hash methB) ps - methB.SetParameters(ps) + member methB.SetSignatureAndLog(returnType, returnTypeRequiredCustomModifiers, returnTypeOptionalCustomModifiers, parameterTypes, parameterTypeRequiredCustomModifiers,parameterTypeOptionalCustomModifiers) = + if logRefEmitCalls then printfn "methodBuilder%d.SetSignature(...)" (abs <| hash methB) + methB.SetSignature(returnType, returnTypeRequiredCustomModifiers, returnTypeOptionalCustomModifiers, parameterTypes, parameterTypeRequiredCustomModifiers,parameterTypeOptionalCustomModifiers) member methB.DefineParameterAndLog(n, attr, nm) = if logRefEmitCalls then printfn "methodBuilder%d.DefineParameter(%d, enum %d, %A)" (abs <| hash methB) n (LanguagePrimitives.EnumToValue attr) nm @@ -558,11 +549,11 @@ and convTypeAux cenv emEnv preferCreated typ = baseT.MakeByRefType() | ILType.TypeVar tv -> envGetTyvar emEnv tv // Consider completing the following cases: - | ILType.Modified (false, _, modifiedTy) -> + | ILType.Modified (_, _, modifiedTy) -> + // Note, "modreq" are not being emitted. This is convTypeAux cenv emEnv preferCreated modifiedTy - | ILType.Modified (true, _, _) -> failwith "convType: modreq" - | ILType.FunctionPointer _callsig -> failwith "convType: fptr" + | ILType.FunctionPointer _callsig -> failwith "convType: fptr" // [Bug 4063]. // The convType functions convert AbsIL types into concrete Type values. @@ -598,6 +589,25 @@ let convTypesToArray cenv emEnv (typs:ILTypes) = convTypes cenv emEnv typs |> Li let convCreatedType cenv emEnv typ = convTypeAux cenv emEnv true typ let convCreatedTypeRef cenv emEnv typ = convTypeRef cenv emEnv true typ +let rec convParamModifiersOfType cenv emEnv (pty: ILType) = + [| match pty with + | ILType.Modified (modreq, ty, modifiedTy) -> + yield (modreq, convTypeRef cenv emEnv false ty) + yield! convParamModifiersOfType cenv emEnv modifiedTy + | _ -> () |] + +let splitModifiers mods = + let reqd = mods |> Array.choose (function (true, ty) -> Some ty | _ -> None) + let optional = mods |> Array.choose (function (false, ty) -> Some ty | _ -> None) + reqd, optional + +let convParamModifiers cenv emEnv (p: ILParameter) = + let mods = convParamModifiersOfType cenv emEnv p.Type + splitModifiers mods + +let convReturnModifiers cenv emEnv (p: ILReturn) = + let mods = convParamModifiersOfType cenv emEnv p.Type + splitModifiers mods //---------------------------------------------------------------------------- // convFieldInit @@ -1537,11 +1547,22 @@ let rec buildMethodPass2 cenv tref (typB:TypeBuilder) emEnv (mdef : ILMethodDef) let genArgs = getGenericArgumentsOfMethod methB let emEnv = envPushTyvars emEnv (Array.append (getGenericArgumentsOfType (typB.AsType())) genArgs) buildGenParamsPass1b cenv emEnv genArgs mdef.GenericParams; + // Set parameter and return types (may depend on generic args) - methB.SetParametersAndLog(convTypesToArray cenv emEnv mdef.ParameterTypes); - methB.SetReturnTypeAndLog(convType cenv emEnv mdef.Return.Type); + let parameterTypes = convTypesToArray cenv emEnv mdef.ParameterTypes + let parameterTypeRequiredCustomModifiers,parameterTypeOptionalCustomModifiers = + mdef.Parameters + |> List.toArray + |> Array.map (convParamModifiers cenv emEnv) + |> Array.unzip + + let returnTypeRequiredCustomModifiers, returnTypeOptionalCustomModifiers = mdef.Return |> convReturnModifiers cenv emEnv + let returnType = convType cenv emEnv mdef.Return.Type + + methB.SetSignatureAndLog(returnType, returnTypeRequiredCustomModifiers, returnTypeOptionalCustomModifiers, parameterTypes, parameterTypeRequiredCustomModifiers,parameterTypeOptionalCustomModifiers); + let emEnv = envPopTyvars emEnv - methB.SetImplementationFlagsAndLog(implflags); + methB.SetImplementationFlagsAndLog(implflags) envBindMethodRef emEnv mref methB diff --git a/src/buildfromsource/FSharp.Compiler.Private/FSComp.fs b/src/buildfromsource/FSharp.Compiler.Private/FSComp.fs index 87687dd822..c3672425eb 100644 --- a/src/buildfromsource/FSharp.Compiler.Private/FSComp.fs +++ b/src/buildfromsource/FSharp.Compiler.Private/FSComp.fs @@ -1,4 +1,4 @@ -// This is a generated file; the original input is '../FSComp.txt' +// This is a generated file; the original input is '..\FSComp.txt' namespace FSComp open Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicOperators @@ -116,4202 +116,4232 @@ type internal SR private() = // END BOILERPLATE /// The namespace '%s' is not defined. - /// (Originally from ../FSComp.txt:4) + /// (Originally from ..\FSComp.txt:4) static member undefinedNameNamespace(a0 : System.String) = (GetStringFunc("undefinedNameNamespace",",,,%s,,,") a0) /// The namespace or module '%s' is not defined. - /// (Originally from ../FSComp.txt:5) + /// (Originally from ..\FSComp.txt:5) static member undefinedNameNamespaceOrModule(a0 : System.String) = (GetStringFunc("undefinedNameNamespaceOrModule",",,,%s,,,") a0) /// The field, constructor or member '%s' is not defined. - /// (Originally from ../FSComp.txt:6) + /// (Originally from ..\FSComp.txt:6) static member undefinedNameFieldConstructorOrMember(a0 : System.String) = (GetStringFunc("undefinedNameFieldConstructorOrMember",",,,%s,,,") a0) /// The value, constructor, namespace or type '%s' is not defined. - /// (Originally from ../FSComp.txt:7) + /// (Originally from ..\FSComp.txt:7) static member undefinedNameValueConstructorNamespaceOrType(a0 : System.String) = (GetStringFunc("undefinedNameValueConstructorNamespaceOrType",",,,%s,,,") a0) /// The value or constructor '%s' is not defined. - /// (Originally from ../FSComp.txt:8) + /// (Originally from ..\FSComp.txt:8) static member undefinedNameValueOfConstructor(a0 : System.String) = (GetStringFunc("undefinedNameValueOfConstructor",",,,%s,,,") a0) /// The value, namespace, type or module '%s' is not defined. - /// (Originally from ../FSComp.txt:9) + /// (Originally from ..\FSComp.txt:9) static member undefinedNameValueNamespaceTypeOrModule(a0 : System.String) = (GetStringFunc("undefinedNameValueNamespaceTypeOrModule",",,,%s,,,") a0) /// The constructor, module or namespace '%s' is not defined. - /// (Originally from ../FSComp.txt:10) + /// (Originally from ..\FSComp.txt:10) static member undefinedNameConstructorModuleOrNamespace(a0 : System.String) = (GetStringFunc("undefinedNameConstructorModuleOrNamespace",",,,%s,,,") a0) /// The type '%s' is not defined. - /// (Originally from ../FSComp.txt:11) + /// (Originally from ..\FSComp.txt:11) static member undefinedNameType(a0 : System.String) = (GetStringFunc("undefinedNameType",",,,%s,,,") a0) /// The type '%s' is not defined in '%s'. - /// (Originally from ../FSComp.txt:12) + /// (Originally from ..\FSComp.txt:12) static member undefinedNameTypeIn(a0 : System.String, a1 : System.String) = (GetStringFunc("undefinedNameTypeIn",",,,%s,,,%s,,,") a0 a1) /// The record label or namespace '%s' is not defined. - /// (Originally from ../FSComp.txt:13) + /// (Originally from ..\FSComp.txt:13) static member undefinedNameRecordLabelOrNamespace(a0 : System.String) = (GetStringFunc("undefinedNameRecordLabelOrNamespace",",,,%s,,,") a0) /// The record label '%s' is not defined. - /// (Originally from ../FSComp.txt:14) + /// (Originally from ..\FSComp.txt:14) static member undefinedNameRecordLabel(a0 : System.String) = (GetStringFunc("undefinedNameRecordLabel",",,,%s,,,") a0) /// Maybe you want one of the following: - /// (Originally from ../FSComp.txt:15) + /// (Originally from ..\FSComp.txt:15) static member undefinedNameSuggestionsIntro() = (GetStringFunc("undefinedNameSuggestionsIntro",",,,") ) /// The type parameter %s is not defined. - /// (Originally from ../FSComp.txt:16) + /// (Originally from ..\FSComp.txt:16) static member undefinedNameTypeParameter(a0 : System.String) = (GetStringFunc("undefinedNameTypeParameter",",,,%s,,,") a0) /// The pattern discriminator '%s' is not defined. - /// (Originally from ../FSComp.txt:17) + /// (Originally from ..\FSComp.txt:17) static member undefinedNamePatternDiscriminator(a0 : System.String) = (GetStringFunc("undefinedNamePatternDiscriminator",",,,%s,,,") a0) /// Replace with '%s' - /// (Originally from ../FSComp.txt:18) + /// (Originally from ..\FSComp.txt:18) static member replaceWithSuggestion(a0 : System.String) = (GetStringFunc("replaceWithSuggestion",",,,%s,,,") a0) /// Add . for indexer access. - /// (Originally from ../FSComp.txt:19) + /// (Originally from ..\FSComp.txt:19) static member addIndexerDot() = (GetStringFunc("addIndexerDot",",,,") ) /// All elements of a list constructor expression must have the same type. This expression was expected to have type '%s', but here has type '%s'. - /// (Originally from ../FSComp.txt:20) + /// (Originally from ..\FSComp.txt:20) static member listElementHasWrongType(a0 : System.String, a1 : System.String) = (GetStringFunc("listElementHasWrongType",",,,%s,,,%s,,,") a0 a1) /// All elements of an array constructor expression must have the same type. This expression was expected to have type '%s', but here has type '%s'. - /// (Originally from ../FSComp.txt:21) + /// (Originally from ..\FSComp.txt:21) static member arrayElementHasWrongType(a0 : System.String, a1 : System.String) = (GetStringFunc("arrayElementHasWrongType",",,,%s,,,%s,,,") a0 a1) /// The 'if' expression is missing an 'else' branch. The 'then' branch has type '%s'. Because 'if' is an expression, and not a statement, add an 'else' branch which returns a value of the same type. - /// (Originally from ../FSComp.txt:22) + /// (Originally from ..\FSComp.txt:22) static member missingElseBranch(a0 : System.String) = (GetStringFunc("missingElseBranch",",,,%s,,,") a0) /// The 'if' expression needs to have type '%s' to satisfy context type requirements. It currently has type '%s'. - /// (Originally from ../FSComp.txt:23) + /// (Originally from ..\FSComp.txt:23) static member ifExpression(a0 : System.String, a1 : System.String) = (GetStringFunc("ifExpression",",,,%s,,,%s,,,") a0 a1) /// All branches of an 'if' expression must have the same type. This expression was expected to have type '%s', but here has type '%s'. - /// (Originally from ../FSComp.txt:24) + /// (Originally from ..\FSComp.txt:24) static member elseBranchHasWrongType(a0 : System.String, a1 : System.String) = (GetStringFunc("elseBranchHasWrongType",",,,%s,,,%s,,,") a0 a1) /// All branches of a pattern match expression must return values of the same type. The first branch returned a value of type '%s', but this branch returned a value of type '%s'. - /// (Originally from ../FSComp.txt:25) + /// (Originally from ..\FSComp.txt:25) static member followingPatternMatchClauseHasWrongType(a0 : System.String, a1 : System.String) = (GetStringFunc("followingPatternMatchClauseHasWrongType",",,,%s,,,%s,,,") a0 a1) /// A pattern match guard must be of type 'bool', but this 'when' expression is of type '%s'. - /// (Originally from ../FSComp.txt:26) + /// (Originally from ..\FSComp.txt:26) static member patternMatchGuardIsNotBool(a0 : System.String) = (GetStringFunc("patternMatchGuardIsNotBool",",,,%s,,,") a0) /// A ';' is used to separate field values in records. Consider replacing ',' with ';'. - /// (Originally from ../FSComp.txt:27) + /// (Originally from ..\FSComp.txt:27) static member commaInsteadOfSemicolonInRecord() = (GetStringFunc("commaInsteadOfSemicolonInRecord",",,,") ) /// The '!' operator is used to dereference a ref cell. Consider using 'not expr' here. - /// (Originally from ../FSComp.txt:28) + /// (Originally from ..\FSComp.txt:28) static member derefInsteadOfNot() = (GetStringFunc("derefInsteadOfNot",",,,") ) /// The non-generic type '%s' does not expect any type arguments, but here is given %d type argument(s) - /// (Originally from ../FSComp.txt:29) + /// (Originally from ..\FSComp.txt:29) static member buildUnexpectedTypeArgs(a0 : System.String, a1 : System.Int32) = (GetStringFunc("buildUnexpectedTypeArgs",",,,%s,,,%d,,,") a0 a1) /// Consider using 'return!' instead of 'return'. - /// (Originally from ../FSComp.txt:30) + /// (Originally from ..\FSComp.txt:30) static member returnUsedInsteadOfReturnBang() = (GetStringFunc("returnUsedInsteadOfReturnBang",",,,") ) /// Consider using 'yield!' instead of 'yield'. - /// (Originally from ../FSComp.txt:31) + /// (Originally from ..\FSComp.txt:31) static member yieldUsedInsteadOfYieldBang() = (GetStringFunc("yieldUsedInsteadOfYieldBang",",,,") ) /// \nA tuple type is required for one or more arguments. Consider wrapping the given arguments in additional parentheses or review the definition of the interface. - /// (Originally from ../FSComp.txt:32) + /// (Originally from ..\FSComp.txt:32) static member tupleRequiredInAbstractMethod() = (GetStringFunc("tupleRequiredInAbstractMethod",",,,") ) /// Invalid warning number '%s' - /// (Originally from ../FSComp.txt:33) + /// (Originally from ..\FSComp.txt:33) static member buildInvalidWarningNumber(a0 : System.String) = (203, GetStringFunc("buildInvalidWarningNumber",",,,%s,,,") a0) /// Invalid version string '%s' - /// (Originally from ../FSComp.txt:34) + /// (Originally from ..\FSComp.txt:34) static member buildInvalidVersionString(a0 : System.String) = (204, GetStringFunc("buildInvalidVersionString",",,,%s,,,") a0) /// Invalid version file '%s' - /// (Originally from ../FSComp.txt:35) + /// (Originally from ..\FSComp.txt:35) static member buildInvalidVersionFile(a0 : System.String) = (205, GetStringFunc("buildInvalidVersionFile",",,,%s,,,") a0) /// Microsoft (R) F# Compiler version %s - /// (Originally from ../FSComp.txt:36) + /// (Originally from ..\FSComp.txt:36) static member buildProductName(a0 : System.String) = (GetStringFunc("buildProductName",",,,%s,,,") a0) /// F# Compiler for F# %s - /// (Originally from ../FSComp.txt:37) + /// (Originally from ..\FSComp.txt:37) static member buildProductNameCommunity(a0 : System.String) = (GetStringFunc("buildProductNameCommunity",",,,%s,,,") a0) /// Problem with filename '%s': %s - /// (Originally from ../FSComp.txt:38) + /// (Originally from ..\FSComp.txt:38) static member buildProblemWithFilename(a0 : System.String, a1 : System.String) = (206, GetStringFunc("buildProblemWithFilename",",,,%s,,,%s,,,") a0 a1) /// No inputs specified - /// (Originally from ../FSComp.txt:39) + /// (Originally from ..\FSComp.txt:39) static member buildNoInputsSpecified() = (207, GetStringFunc("buildNoInputsSpecified",",,,") ) /// The '--pdb' option requires the '--debug' option to be used - /// (Originally from ../FSComp.txt:40) + /// (Originally from ..\FSComp.txt:40) static member buildPdbRequiresDebug() = (209, GetStringFunc("buildPdbRequiresDebug",",,,") ) /// The search directory '%s' is invalid - /// (Originally from ../FSComp.txt:41) + /// (Originally from ..\FSComp.txt:41) static member buildInvalidSearchDirectory(a0 : System.String) = (210, GetStringFunc("buildInvalidSearchDirectory",",,,%s,,,") a0) /// The search directory '%s' could not be found - /// (Originally from ../FSComp.txt:42) + /// (Originally from ..\FSComp.txt:42) static member buildSearchDirectoryNotFound(a0 : System.String) = (211, GetStringFunc("buildSearchDirectoryNotFound",",,,%s,,,") a0) /// '%s' is not a valid filename - /// (Originally from ../FSComp.txt:43) + /// (Originally from ..\FSComp.txt:43) static member buildInvalidFilename(a0 : System.String) = (212, GetStringFunc("buildInvalidFilename",",,,%s,,,") a0) /// '%s' is not a valid assembly name - /// (Originally from ../FSComp.txt:44) + /// (Originally from ..\FSComp.txt:44) static member buildInvalidAssemblyName(a0 : System.String) = (213, GetStringFunc("buildInvalidAssemblyName",",,,%s,,,") a0) /// Unrecognized privacy setting '%s' for managed resource, valid options are 'public' and 'private' - /// (Originally from ../FSComp.txt:45) + /// (Originally from ..\FSComp.txt:45) static member buildInvalidPrivacy(a0 : System.String) = (214, GetStringFunc("buildInvalidPrivacy",",,,%s,,,") a0) /// Multiple references to '%s.dll' are not permitted - /// (Originally from ../FSComp.txt:46) + /// (Originally from ..\FSComp.txt:46) static member buildMultipleReferencesNotAllowed(a0 : System.String) = (215, GetStringFunc("buildMultipleReferencesNotAllowed",",,,%s,,,") a0) /// Could not read version from mscorlib.dll - /// (Originally from ../FSComp.txt:47) + /// (Originally from ..\FSComp.txt:47) static member buildCouldNotReadVersionInfoFromMscorlib() = (GetStringFunc("buildCouldNotReadVersionInfoFromMscorlib",",,,") ) /// Unable to read assembly '%s' - /// (Originally from ../FSComp.txt:48) + /// (Originally from ..\FSComp.txt:48) static member buildCannotReadAssembly(a0 : System.String) = (218, GetStringFunc("buildCannotReadAssembly",",,,%s,,,") a0) /// Assembly resolution failure at or near this location - /// (Originally from ../FSComp.txt:49) + /// (Originally from ..\FSComp.txt:49) static member buildAssemblyResolutionFailed() = (220, GetStringFunc("buildAssemblyResolutionFailed",",,,") ) /// The declarations in this file will be placed in an implicit module '%s' based on the file name '%s'. However this is not a valid F# identifier, so the contents will not be accessible from other files. Consider renaming the file or adding a 'module' or 'namespace' declaration at the top of the file. - /// (Originally from ../FSComp.txt:50) + /// (Originally from ..\FSComp.txt:50) static member buildImplicitModuleIsNotLegalIdentifier(a0 : System.String, a1 : System.String) = (221, GetStringFunc("buildImplicitModuleIsNotLegalIdentifier",",,,%s,,,%s,,,") a0 a1) /// Files in libraries or multiple-file applications must begin with a namespace or module declaration, e.g. 'namespace SomeNamespace.SubNamespace' or 'module SomeNamespace.SomeModule'. Only the last source file of an application may omit such a declaration. - /// (Originally from ../FSComp.txt:51) + /// (Originally from ..\FSComp.txt:51) static member buildMultiFileRequiresNamespaceOrModule() = (222, GetStringFunc("buildMultiFileRequiresNamespaceOrModule",",,,") ) /// Files in libraries or multiple-file applications must begin with a namespace or module declaration. When using a module declaration at the start of a file the '=' sign is not allowed. If this is a top-level module, consider removing the = to resolve this error. - /// (Originally from ../FSComp.txt:52) + /// (Originally from ..\FSComp.txt:52) static member noEqualSignAfterModule() = (222, GetStringFunc("noEqualSignAfterModule",",,,") ) /// This file contains multiple declarations of the form 'module SomeNamespace.SomeModule'. Only one declaration of this form is permitted in a file. Change your file to use an initial namespace declaration and/or use 'module ModuleName = ...' to define your modules. - /// (Originally from ../FSComp.txt:53) + /// (Originally from ..\FSComp.txt:53) static member buildMultipleToplevelModules() = (223, GetStringFunc("buildMultipleToplevelModules",",,,") ) /// Option requires parameter: %s - /// (Originally from ../FSComp.txt:54) + /// (Originally from ..\FSComp.txt:54) static member buildOptionRequiresParameter(a0 : System.String) = (224, GetStringFunc("buildOptionRequiresParameter",",,,%s,,,") a0) /// Source file '%s' could not be found - /// (Originally from ../FSComp.txt:55) + /// (Originally from ..\FSComp.txt:55) static member buildCouldNotFindSourceFile(a0 : System.String) = (225, GetStringFunc("buildCouldNotFindSourceFile",",,,%s,,,") a0) /// The file extension of '%s' is not recognized. Source files must have extension .fs, .fsi, .fsx, .fsscript, .ml or .mli. - /// (Originally from ../FSComp.txt:56) + /// (Originally from ..\FSComp.txt:56) static member buildInvalidSourceFileExtension(a0 : System.String) = (226, GetStringFunc("buildInvalidSourceFileExtension",",,,%s,,,") a0) /// Could not resolve assembly '%s' - /// (Originally from ../FSComp.txt:57) + /// (Originally from ..\FSComp.txt:57) static member buildCouldNotResolveAssembly(a0 : System.String) = (227, GetStringFunc("buildCouldNotResolveAssembly",",,,%s,,,") a0) /// Could not resolve assembly '%s' required by '%s' - /// (Originally from ../FSComp.txt:58) + /// (Originally from ..\FSComp.txt:58) static member buildCouldNotResolveAssemblyRequiredByFile(a0 : System.String, a1 : System.String) = (228, GetStringFunc("buildCouldNotResolveAssemblyRequiredByFile",",,,%s,,,%s,,,") a0 a1) /// Error opening binary file '%s': %s - /// (Originally from ../FSComp.txt:59) + /// (Originally from ..\FSComp.txt:59) static member buildErrorOpeningBinaryFile(a0 : System.String, a1 : System.String) = (229, GetStringFunc("buildErrorOpeningBinaryFile",",,,%s,,,%s,,,") a0 a1) /// The F#-compiled DLL '%s' needs to be recompiled to be used with this version of F# - /// (Originally from ../FSComp.txt:60) + /// (Originally from ..\FSComp.txt:60) static member buildDifferentVersionMustRecompile(a0 : System.String) = (231, GetStringFunc("buildDifferentVersionMustRecompile",",,,%s,,,") a0) /// Invalid directive. Expected '#I \"\"'. - /// (Originally from ../FSComp.txt:61) + /// (Originally from ..\FSComp.txt:61) static member buildInvalidHashIDirective() = (232, GetStringFunc("buildInvalidHashIDirective",",,,") ) /// Invalid directive. Expected '#r \"\"'. - /// (Originally from ../FSComp.txt:62) + /// (Originally from ..\FSComp.txt:62) static member buildInvalidHashrDirective() = (233, GetStringFunc("buildInvalidHashrDirective",",,,") ) /// Invalid directive. Expected '#load \"\" ... \"\"'. - /// (Originally from ../FSComp.txt:63) + /// (Originally from ..\FSComp.txt:63) static member buildInvalidHashloadDirective() = (234, GetStringFunc("buildInvalidHashloadDirective",",,,") ) /// Invalid directive. Expected '#time', '#time \"on\"' or '#time \"off\"'. - /// (Originally from ../FSComp.txt:64) + /// (Originally from ..\FSComp.txt:64) static member buildInvalidHashtimeDirective() = (235, GetStringFunc("buildInvalidHashtimeDirective",",,,") ) /// Directives inside modules are ignored - /// (Originally from ../FSComp.txt:65) + /// (Originally from ..\FSComp.txt:65) static member buildDirectivesInModulesAreIgnored() = (236, GetStringFunc("buildDirectivesInModulesAreIgnored",",,,") ) /// A signature for the file or module '%s' has already been specified - /// (Originally from ../FSComp.txt:66) + /// (Originally from ..\FSComp.txt:66) static member buildSignatureAlreadySpecified(a0 : System.String) = (237, GetStringFunc("buildSignatureAlreadySpecified",",,,%s,,,") a0) /// An implementation of file or module '%s' has already been given. Compilation order is significant in F# because of type inference. You may need to adjust the order of your files to place the signature file before the implementation. In Visual Studio files are type-checked in the order they appear in the project file, which can be edited manually or adjusted using the solution explorer. - /// (Originally from ../FSComp.txt:67) + /// (Originally from ..\FSComp.txt:67) static member buildImplementationAlreadyGivenDetail(a0 : System.String) = (238, GetStringFunc("buildImplementationAlreadyGivenDetail",",,,%s,,,") a0) /// An implementation of the file or module '%s' has already been given - /// (Originally from ../FSComp.txt:68) + /// (Originally from ..\FSComp.txt:68) static member buildImplementationAlreadyGiven(a0 : System.String) = (239, GetStringFunc("buildImplementationAlreadyGiven",",,,%s,,,") a0) /// The signature file '%s' does not have a corresponding implementation file. If an implementation file exists then check the 'module' and 'namespace' declarations in the signature and implementation files match. - /// (Originally from ../FSComp.txt:69) + /// (Originally from ..\FSComp.txt:69) static member buildSignatureWithoutImplementation(a0 : System.String) = (240, GetStringFunc("buildSignatureWithoutImplementation",",,,%s,,,") a0) /// '%s' is not a valid integer argument - /// (Originally from ../FSComp.txt:70) + /// (Originally from ..\FSComp.txt:70) static member buildArgInvalidInt(a0 : System.String) = (241, GetStringFunc("buildArgInvalidInt",",,,%s,,,") a0) /// '%s' is not a valid floating point argument - /// (Originally from ../FSComp.txt:71) + /// (Originally from ..\FSComp.txt:71) static member buildArgInvalidFloat(a0 : System.String) = (242, GetStringFunc("buildArgInvalidFloat",",,,%s,,,") a0) /// Unrecognized option: '%s' - /// (Originally from ../FSComp.txt:72) + /// (Originally from ..\FSComp.txt:72) static member buildUnrecognizedOption(a0 : System.String) = (243, GetStringFunc("buildUnrecognizedOption",",,,%s,,,") a0) /// Invalid module or namespace name - /// (Originally from ../FSComp.txt:73) + /// (Originally from ..\FSComp.txt:73) static member buildInvalidModuleOrNamespaceName() = (244, GetStringFunc("buildInvalidModuleOrNamespaceName",",,,") ) /// Error reading/writing metadata for the F# compiled DLL '%s'. Was the DLL compiled with an earlier version of the F# compiler? (error: '%s'). - /// (Originally from ../FSComp.txt:74) + /// (Originally from ..\FSComp.txt:74) static member pickleErrorReadingWritingMetadata(a0 : System.String, a1 : System.String) = (GetStringFunc("pickleErrorReadingWritingMetadata",",,,%s,,,%s,,,") a0 a1) /// The type/module '%s' is not a concrete module or type - /// (Originally from ../FSComp.txt:75) + /// (Originally from ..\FSComp.txt:75) static member tastTypeOrModuleNotConcrete(a0 : System.String) = (245, GetStringFunc("tastTypeOrModuleNotConcrete",",,,%s,,,") a0) /// The type '%s' has an inline assembly code representation - /// (Originally from ../FSComp.txt:76) + /// (Originally from ..\FSComp.txt:76) static member tastTypeHasAssemblyCodeRepresentation(a0 : System.String) = (GetStringFunc("tastTypeHasAssemblyCodeRepresentation",",,,%s,,,") a0) /// A namespace and a module named '%s' both occur in two parts of this assembly - /// (Originally from ../FSComp.txt:77) + /// (Originally from ..\FSComp.txt:77) static member tastNamespaceAndModuleWithSameNameInAssembly(a0 : System.String) = (247, GetStringFunc("tastNamespaceAndModuleWithSameNameInAssembly",",,,%s,,,") a0) /// Two modules named '%s' occur in two parts of this assembly - /// (Originally from ../FSComp.txt:78) + /// (Originally from ..\FSComp.txt:78) static member tastTwoModulesWithSameNameInAssembly(a0 : System.String) = (248, GetStringFunc("tastTwoModulesWithSameNameInAssembly",",,,%s,,,") a0) /// Two type definitions named '%s' occur in namespace '%s' in two parts of this assembly - /// (Originally from ../FSComp.txt:79) + /// (Originally from ..\FSComp.txt:79) static member tastDuplicateTypeDefinitionInAssembly(a0 : System.String, a1 : System.String) = (249, GetStringFunc("tastDuplicateTypeDefinitionInAssembly",",,,%s,,,%s,,,") a0 a1) /// A module and a type definition named '%s' occur in namespace '%s' in two parts of this assembly - /// (Originally from ../FSComp.txt:80) + /// (Originally from ..\FSComp.txt:80) static member tastConflictingModuleAndTypeDefinitionInAssembly(a0 : System.String, a1 : System.String) = (250, GetStringFunc("tastConflictingModuleAndTypeDefinitionInAssembly",",,,%s,,,%s,,,") a0 a1) /// Invalid member signature encountered because of an earlier error - /// (Originally from ../FSComp.txt:81) + /// (Originally from ..\FSComp.txt:81) static member tastInvalidMemberSignature() = (251, GetStringFunc("tastInvalidMemberSignature",",,,") ) /// This value does not have a valid property setter type - /// (Originally from ../FSComp.txt:82) + /// (Originally from ..\FSComp.txt:82) static member tastValueDoesNotHaveSetterType() = (252, GetStringFunc("tastValueDoesNotHaveSetterType",",,,") ) /// Invalid form for a property getter. At least one '()' argument is required when using the explicit syntax. - /// (Originally from ../FSComp.txt:83) + /// (Originally from ..\FSComp.txt:83) static member tastInvalidFormForPropertyGetter() = (253, GetStringFunc("tastInvalidFormForPropertyGetter",",,,") ) /// Invalid form for a property setter. At least one argument is required. - /// (Originally from ../FSComp.txt:84) + /// (Originally from ..\FSComp.txt:84) static member tastInvalidFormForPropertySetter() = (254, GetStringFunc("tastInvalidFormForPropertySetter",",,,") ) /// Unexpected use of a byref-typed variable - /// (Originally from ../FSComp.txt:85) + /// (Originally from ..\FSComp.txt:85) static member tastUnexpectedByRef() = (255, GetStringFunc("tastUnexpectedByRef",",,,") ) /// A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' /// (Originally from ..\FSComp.txt:86) static member tastValueMustBeMutable() = (256, GetStringFunc("tastValueMustBeMutable",",,,") ) /// Invalid mutation of a constant expression. Consider copying the expression to a mutable local, e.g. 'let mutable x = ...'. - /// (Originally from ../FSComp.txt:87) + /// (Originally from ..\FSComp.txt:87) static member tastInvalidMutationOfConstant() = (257, GetStringFunc("tastInvalidMutationOfConstant",",,,") ) /// The value has been copied to ensure the original is not mutated by this operation or because the copy is implicit when returning a struct from a member and another member is then accessed - /// (Originally from ../FSComp.txt:88) + /// (Originally from ..\FSComp.txt:88) static member tastValueHasBeenCopied() = (GetStringFunc("tastValueHasBeenCopied",",,,") ) /// Recursively defined values cannot appear directly as part of the construction of a tuple value within a recursive binding - /// (Originally from ../FSComp.txt:89) + /// (Originally from ..\FSComp.txt:89) static member tastRecursiveValuesMayNotBeInConstructionOfTuple() = (259, GetStringFunc("tastRecursiveValuesMayNotBeInConstructionOfTuple",",,,") ) /// Recursive values cannot appear directly as a construction of the type '%s' within a recursive binding. This feature has been removed from the F# language. Consider using a record instead. - /// (Originally from ../FSComp.txt:90) + /// (Originally from ..\FSComp.txt:90) static member tastRecursiveValuesMayNotAppearInConstructionOfType(a0 : System.String) = (260, GetStringFunc("tastRecursiveValuesMayNotAppearInConstructionOfType",",,,%s,,,") a0) /// Recursive values cannot be directly assigned to the non-mutable field '%s' of the type '%s' within a recursive binding. Consider using a mutable field instead. - /// (Originally from ../FSComp.txt:91) + /// (Originally from ..\FSComp.txt:91) static member tastRecursiveValuesMayNotBeAssignedToNonMutableField(a0 : System.String, a1 : System.String) = (261, GetStringFunc("tastRecursiveValuesMayNotBeAssignedToNonMutableField",",,,%s,,,%s,,,") a0 a1) /// Unexpected decode of AutoOpenAttribute - /// (Originally from ../FSComp.txt:92) + /// (Originally from ..\FSComp.txt:92) static member tastUnexpectedDecodeOfAutoOpenAttribute() = (GetStringFunc("tastUnexpectedDecodeOfAutoOpenAttribute",",,,") ) /// Unexpected decode of InternalsVisibleToAttribute - /// (Originally from ../FSComp.txt:93) + /// (Originally from ..\FSComp.txt:93) static member tastUnexpectedDecodeOfInternalsVisibleToAttribute() = (GetStringFunc("tastUnexpectedDecodeOfInternalsVisibleToAttribute",",,,") ) /// Unexpected decode of InterfaceDataVersionAttribute - /// (Originally from ../FSComp.txt:94) + /// (Originally from ..\FSComp.txt:94) static member tastUnexpectedDecodeOfInterfaceDataVersionAttribute() = (GetStringFunc("tastUnexpectedDecodeOfInterfaceDataVersionAttribute",",,,") ) /// Active patterns cannot return more than 7 possibilities - /// (Originally from ../FSComp.txt:95) + /// (Originally from ..\FSComp.txt:95) static member tastActivePatternsLimitedToSeven() = (265, GetStringFunc("tastActivePatternsLimitedToSeven",",,,") ) /// This is not a valid constant expression or custom attribute value - /// (Originally from ../FSComp.txt:96) + /// (Originally from ..\FSComp.txt:96) static member tastNotAConstantExpression() = (267, GetStringFunc("tastNotAConstantExpression",",,,") ) /// Module '%s' contains\n %s \nbut its signature specifies\n %s \nThe mutability attributes differ - /// (Originally from ../FSComp.txt:97) + /// (Originally from ..\FSComp.txt:97) static member ValueNotContainedMutabilityAttributesDiffer(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("ValueNotContainedMutabilityAttributesDiffer",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// Module '%s' contains\n %s \nbut its signature specifies\n %s \nThe names differ - /// (Originally from ../FSComp.txt:98) + /// (Originally from ..\FSComp.txt:98) static member ValueNotContainedMutabilityNamesDiffer(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("ValueNotContainedMutabilityNamesDiffer",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// Module '%s' contains\n %s \nbut its signature specifies\n %s \nThe compiled names differ - /// (Originally from ../FSComp.txt:99) + /// (Originally from ..\FSComp.txt:99) static member ValueNotContainedMutabilityCompiledNamesDiffer(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("ValueNotContainedMutabilityCompiledNamesDiffer",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// Module '%s' contains\n %s \nbut its signature specifies\n %s \nThe display names differ - /// (Originally from ../FSComp.txt:100) + /// (Originally from ..\FSComp.txt:100) static member ValueNotContainedMutabilityDisplayNamesDiffer(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("ValueNotContainedMutabilityDisplayNamesDiffer",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// Module '%s' contains\n %s \nbut its signature specifies\n %s \nThe accessibility specified in the signature is more than that specified in the implementation - /// (Originally from ../FSComp.txt:101) + /// (Originally from ..\FSComp.txt:101) static member ValueNotContainedMutabilityAccessibilityMore(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("ValueNotContainedMutabilityAccessibilityMore",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// Module '%s' contains\n %s \nbut its signature specifies\n %s \nThe inline flags differ - /// (Originally from ../FSComp.txt:102) + /// (Originally from ..\FSComp.txt:102) static member ValueNotContainedMutabilityInlineFlagsDiffer(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("ValueNotContainedMutabilityInlineFlagsDiffer",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// Module '%s' contains\n %s \nbut its signature specifies\n %s \nThe literal constant values and/or attributes differ - /// (Originally from ../FSComp.txt:103) + /// (Originally from ..\FSComp.txt:103) static member ValueNotContainedMutabilityLiteralConstantValuesDiffer(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("ValueNotContainedMutabilityLiteralConstantValuesDiffer",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// Module '%s' contains\n %s \nbut its signature specifies\n %s \nOne is a type function and the other is not. The signature requires explicit type parameters if they are present in the implementation. - /// (Originally from ../FSComp.txt:104) + /// (Originally from ..\FSComp.txt:104) static member ValueNotContainedMutabilityOneIsTypeFunction(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("ValueNotContainedMutabilityOneIsTypeFunction",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// Module '%s' contains\n %s \nbut its signature specifies\n %s \nThe respective type parameter counts differ - /// (Originally from ../FSComp.txt:105) + /// (Originally from ..\FSComp.txt:105) static member ValueNotContainedMutabilityParameterCountsDiffer(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("ValueNotContainedMutabilityParameterCountsDiffer",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// Module '%s' contains\n %s \nbut its signature specifies\n %s \nThe types differ - /// (Originally from ../FSComp.txt:106) + /// (Originally from ..\FSComp.txt:106) static member ValueNotContainedMutabilityTypesDiffer(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("ValueNotContainedMutabilityTypesDiffer",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// Module '%s' contains\n %s \nbut its signature specifies\n %s \nOne is an extension member and the other is not - /// (Originally from ../FSComp.txt:107) + /// (Originally from ..\FSComp.txt:107) static member ValueNotContainedMutabilityExtensionsDiffer(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("ValueNotContainedMutabilityExtensionsDiffer",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// Module '%s' contains\n %s \nbut its signature specifies\n %s \nAn arity was not inferred for this value - /// (Originally from ../FSComp.txt:108) + /// (Originally from ..\FSComp.txt:108) static member ValueNotContainedMutabilityArityNotInferred(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("ValueNotContainedMutabilityArityNotInferred",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// Module '%s' contains\n %s \nbut its signature specifies\n %s \nThe number of generic parameters in the signature and implementation differ (the signature declares %s but the implementation declares %s - /// (Originally from ../FSComp.txt:109) + /// (Originally from ..\FSComp.txt:109) static member ValueNotContainedMutabilityGenericParametersDiffer(a0 : System.String, a1 : System.String, a2 : System.String, a3 : System.String, a4 : System.String) = (GetStringFunc("ValueNotContainedMutabilityGenericParametersDiffer",",,,%s,,,%s,,,%s,,,%s,,,%s,,,") a0 a1 a2 a3 a4) /// Module '%s' contains\n %s \nbut its signature specifies\n %s \nThe generic parameters in the signature and implementation have different kinds. Perhaps there is a missing [] attribute. - /// (Originally from ../FSComp.txt:110) + /// (Originally from ..\FSComp.txt:110) static member ValueNotContainedMutabilityGenericParametersAreDifferentKinds(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("ValueNotContainedMutabilityGenericParametersAreDifferentKinds",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// Module '%s' contains\n %s \nbut its signature specifies\n %s \nThe arities in the signature and implementation differ. The signature specifies that '%s' is function definition or lambda expression accepting at least %s argument(s), but the implementation is a computed function value. To declare that a computed function value is a permitted implementation simply parenthesize its type in the signature, e.g.\n\tval %s: int -> (int -> int)\ninstead of\n\tval %s: int -> int -> int. - /// (Originally from ../FSComp.txt:111) + /// (Originally from ..\FSComp.txt:111) static member ValueNotContainedMutabilityAritiesDiffer(a0 : System.String, a1 : System.String, a2 : System.String, a3 : System.String, a4 : System.String, a5 : System.String, a6 : System.String) = (GetStringFunc("ValueNotContainedMutabilityAritiesDiffer",",,,%s,,,%s,,,%s,,,%s,,,%s,,,%s,,,%s,,,") a0 a1 a2 a3 a4 a5 a6) /// Module '%s' contains\n %s \nbut its signature specifies\n %s \nThe CLI member names differ - /// (Originally from ../FSComp.txt:112) + /// (Originally from ..\FSComp.txt:112) static member ValueNotContainedMutabilityDotNetNamesDiffer(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("ValueNotContainedMutabilityDotNetNamesDiffer",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// Module '%s' contains\n %s \nbut its signature specifies\n %s \nOne is static and the other isn't - /// (Originally from ../FSComp.txt:113) + /// (Originally from ..\FSComp.txt:113) static member ValueNotContainedMutabilityStaticsDiffer(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("ValueNotContainedMutabilityStaticsDiffer",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// Module '%s' contains\n %s \nbut its signature specifies\n %s \nOne is virtual and the other isn't - /// (Originally from ../FSComp.txt:114) + /// (Originally from ..\FSComp.txt:114) static member ValueNotContainedMutabilityVirtualsDiffer(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("ValueNotContainedMutabilityVirtualsDiffer",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// Module '%s' contains\n %s \nbut its signature specifies\n %s \nOne is abstract and the other isn't - /// (Originally from ../FSComp.txt:115) + /// (Originally from ..\FSComp.txt:115) static member ValueNotContainedMutabilityAbstractsDiffer(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("ValueNotContainedMutabilityAbstractsDiffer",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// Module '%s' contains\n %s \nbut its signature specifies\n %s \nOne is final and the other isn't - /// (Originally from ../FSComp.txt:116) + /// (Originally from ..\FSComp.txt:116) static member ValueNotContainedMutabilityFinalsDiffer(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("ValueNotContainedMutabilityFinalsDiffer",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// Module '%s' contains\n %s \nbut its signature specifies\n %s \nOne is marked as an override and the other isn't - /// (Originally from ../FSComp.txt:117) + /// (Originally from ..\FSComp.txt:117) static member ValueNotContainedMutabilityOverridesDiffer(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("ValueNotContainedMutabilityOverridesDiffer",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// Module '%s' contains\n %s \nbut its signature specifies\n %s \nOne is a constructor/property and the other is not - /// (Originally from ../FSComp.txt:118) + /// (Originally from ..\FSComp.txt:118) static member ValueNotContainedMutabilityOneIsConstructor(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("ValueNotContainedMutabilityOneIsConstructor",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// Module '%s' contains\n %s \nbut its signature specifies\n %s \nThe compiled representation of this method is as a static member but the signature indicates its compiled representation is as an instance member - /// (Originally from ../FSComp.txt:119) + /// (Originally from ..\FSComp.txt:119) static member ValueNotContainedMutabilityStaticButInstance(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("ValueNotContainedMutabilityStaticButInstance",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// Module '%s' contains\n %s \nbut its signature specifies\n %s \nThe compiled representation of this method is as an instance member, but the signature indicates its compiled representation is as a static member - /// (Originally from ../FSComp.txt:120) + /// (Originally from ..\FSComp.txt:120) static member ValueNotContainedMutabilityInstanceButStatic(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("ValueNotContainedMutabilityInstanceButStatic",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// The %s definitions in the signature and implementation are not compatible because the names differ. The type is called '%s' in the signature file but '%s' in implementation. - /// (Originally from ../FSComp.txt:121) + /// (Originally from ..\FSComp.txt:121) static member DefinitionsInSigAndImplNotCompatibleNamesDiffer(a0 : System.String, a1 : System.String, a2 : System.String) = (290, GetStringFunc("DefinitionsInSigAndImplNotCompatibleNamesDiffer",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// The %s definitions for type '%s' in the signature and implementation are not compatible because the respective type parameter counts differ - /// (Originally from ../FSComp.txt:122) + /// (Originally from ..\FSComp.txt:122) static member DefinitionsInSigAndImplNotCompatibleParameterCountsDiffer(a0 : System.String, a1 : System.String) = (291, GetStringFunc("DefinitionsInSigAndImplNotCompatibleParameterCountsDiffer",",,,%s,,,%s,,,") a0 a1) /// The %s definitions for type '%s' in the signature and implementation are not compatible because the accessibility specified in the signature is more than that specified in the implementation - /// (Originally from ../FSComp.txt:123) + /// (Originally from ..\FSComp.txt:123) static member DefinitionsInSigAndImplNotCompatibleAccessibilityDiffer(a0 : System.String, a1 : System.String) = (292, GetStringFunc("DefinitionsInSigAndImplNotCompatibleAccessibilityDiffer",",,,%s,,,%s,,,") a0 a1) /// The %s definitions for type '%s' in the signature and implementation are not compatible because the signature requires that the type supports the interface %s but the interface has not been implemented - /// (Originally from ../FSComp.txt:124) + /// (Originally from ..\FSComp.txt:124) static member DefinitionsInSigAndImplNotCompatibleMissingInterface(a0 : System.String, a1 : System.String, a2 : System.String) = (293, GetStringFunc("DefinitionsInSigAndImplNotCompatibleMissingInterface",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// The %s definitions for type '%s' in the signature and implementation are not compatible because the implementation says this type may use nulls as a representation but the signature does not - /// (Originally from ../FSComp.txt:125) + /// (Originally from ..\FSComp.txt:125) static member DefinitionsInSigAndImplNotCompatibleImplementationSaysNull(a0 : System.String, a1 : System.String) = (294, GetStringFunc("DefinitionsInSigAndImplNotCompatibleImplementationSaysNull",",,,%s,,,%s,,,") a0 a1) /// The %s definitions for type '%s' in the signature and implementation are not compatible because the implementation says this type may use nulls as an extra value but the signature does not - /// (Originally from ../FSComp.txt:126) + /// (Originally from ..\FSComp.txt:126) static member DefinitionsInSigAndImplNotCompatibleImplementationSaysNull2(a0 : System.String, a1 : System.String) = (294, GetStringFunc("DefinitionsInSigAndImplNotCompatibleImplementationSaysNull2",",,,%s,,,%s,,,") a0 a1) /// The %s definitions for type '%s' in the signature and implementation are not compatible because the signature says this type may use nulls as a representation but the implementation does not - /// (Originally from ../FSComp.txt:127) + /// (Originally from ..\FSComp.txt:127) static member DefinitionsInSigAndImplNotCompatibleSignatureSaysNull(a0 : System.String, a1 : System.String) = (295, GetStringFunc("DefinitionsInSigAndImplNotCompatibleSignatureSaysNull",",,,%s,,,%s,,,") a0 a1) /// The %s definitions for type '%s' in the signature and implementation are not compatible because the signature says this type may use nulls as an extra value but the implementation does not - /// (Originally from ../FSComp.txt:128) + /// (Originally from ..\FSComp.txt:128) static member DefinitionsInSigAndImplNotCompatibleSignatureSaysNull2(a0 : System.String, a1 : System.String) = (295, GetStringFunc("DefinitionsInSigAndImplNotCompatibleSignatureSaysNull2",",,,%s,,,%s,,,") a0 a1) /// The %s definitions for type '%s' in the signature and implementation are not compatible because the implementation type is sealed but the signature implies it is not. Consider adding the [] attribute to the signature. - /// (Originally from ../FSComp.txt:129) + /// (Originally from ..\FSComp.txt:129) static member DefinitionsInSigAndImplNotCompatibleImplementationSealed(a0 : System.String, a1 : System.String) = (296, GetStringFunc("DefinitionsInSigAndImplNotCompatibleImplementationSealed",",,,%s,,,%s,,,") a0 a1) /// The %s definitions for type '%s' in the signature and implementation are not compatible because the implementation type is not sealed but signature implies it is. Consider adding the [] attribute to the implementation. - /// (Originally from ../FSComp.txt:130) + /// (Originally from ..\FSComp.txt:130) static member DefinitionsInSigAndImplNotCompatibleImplementationIsNotSealed(a0 : System.String, a1 : System.String) = (297, GetStringFunc("DefinitionsInSigAndImplNotCompatibleImplementationIsNotSealed",",,,%s,,,%s,,,") a0 a1) /// The %s definitions for type '%s' in the signature and implementation are not compatible because the implementation is an abstract class but the signature is not. Consider adding the [] attribute to the signature. - /// (Originally from ../FSComp.txt:131) + /// (Originally from ..\FSComp.txt:131) static member DefinitionsInSigAndImplNotCompatibleImplementationIsAbstract(a0 : System.String, a1 : System.String) = (298, GetStringFunc("DefinitionsInSigAndImplNotCompatibleImplementationIsAbstract",",,,%s,,,%s,,,") a0 a1) /// The %s definitions for type '%s' in the signature and implementation are not compatible because the signature is an abstract class but the implementation is not. Consider adding the [] attribute to the implementation. - /// (Originally from ../FSComp.txt:132) + /// (Originally from ..\FSComp.txt:132) static member DefinitionsInSigAndImplNotCompatibleSignatureIsAbstract(a0 : System.String, a1 : System.String) = (299, GetStringFunc("DefinitionsInSigAndImplNotCompatibleSignatureIsAbstract",",,,%s,,,%s,,,") a0 a1) /// The %s definitions for type '%s' in the signature and implementation are not compatible because the types have different base types - /// (Originally from ../FSComp.txt:133) + /// (Originally from ..\FSComp.txt:133) static member DefinitionsInSigAndImplNotCompatibleTypesHaveDifferentBaseTypes(a0 : System.String, a1 : System.String) = (300, GetStringFunc("DefinitionsInSigAndImplNotCompatibleTypesHaveDifferentBaseTypes",",,,%s,,,%s,,,") a0 a1) /// The %s definitions for type '%s' in the signature and implementation are not compatible because the number of %ss differ - /// (Originally from ../FSComp.txt:134) + /// (Originally from ..\FSComp.txt:134) static member DefinitionsInSigAndImplNotCompatibleNumbersDiffer(a0 : System.String, a1 : System.String, a2 : System.String) = (301, GetStringFunc("DefinitionsInSigAndImplNotCompatibleNumbersDiffer",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// The %s definitions for type '%s' in the signature and implementation are not compatible because the signature defines the %s '%s' but the implementation does not (or does, but not in the same order) - /// (Originally from ../FSComp.txt:135) + /// (Originally from ..\FSComp.txt:135) static member DefinitionsInSigAndImplNotCompatibleSignatureDefinesButImplDoesNot(a0 : System.String, a1 : System.String, a2 : System.String, a3 : System.String) = (302, GetStringFunc("DefinitionsInSigAndImplNotCompatibleSignatureDefinesButImplDoesNot",",,,%s,,,%s,,,%s,,,%s,,,") a0 a1 a2 a3) /// The %s definitions for type '%s' in the signature and implementation are not compatible because the implementation defines the %s '%s' but the signature does not (or does, but not in the same order) - /// (Originally from ../FSComp.txt:136) + /// (Originally from ..\FSComp.txt:136) static member DefinitionsInSigAndImplNotCompatibleImplDefinesButSignatureDoesNot(a0 : System.String, a1 : System.String, a2 : System.String, a3 : System.String) = (303, GetStringFunc("DefinitionsInSigAndImplNotCompatibleImplDefinesButSignatureDoesNot",",,,%s,,,%s,,,%s,,,%s,,,") a0 a1 a2 a3) /// The %s definitions for type '%s' in the signature and implementation are not compatible because the implementation defines a struct but the signature defines a type with a hidden representation - /// (Originally from ../FSComp.txt:137) + /// (Originally from ..\FSComp.txt:137) static member DefinitionsInSigAndImplNotCompatibleImplDefinesStruct(a0 : System.String, a1 : System.String) = (304, GetStringFunc("DefinitionsInSigAndImplNotCompatibleImplDefinesStruct",",,,%s,,,%s,,,") a0 a1) /// The %s definitions for type '%s' in the signature and implementation are not compatible because a CLI type representation is being hidden by a signature - /// (Originally from ../FSComp.txt:138) + /// (Originally from ..\FSComp.txt:138) static member DefinitionsInSigAndImplNotCompatibleDotNetTypeRepresentationIsHidden(a0 : System.String, a1 : System.String) = (305, GetStringFunc("DefinitionsInSigAndImplNotCompatibleDotNetTypeRepresentationIsHidden",",,,%s,,,%s,,,") a0 a1) /// The %s definitions for type '%s' in the signature and implementation are not compatible because a type representation is being hidden by a signature - /// (Originally from ../FSComp.txt:139) + /// (Originally from ..\FSComp.txt:139) static member DefinitionsInSigAndImplNotCompatibleTypeIsHidden(a0 : System.String, a1 : System.String) = (306, GetStringFunc("DefinitionsInSigAndImplNotCompatibleTypeIsHidden",",,,%s,,,%s,,,") a0 a1) /// The %s definitions for type '%s' in the signature and implementation are not compatible because the types are of different kinds - /// (Originally from ../FSComp.txt:140) + /// (Originally from ..\FSComp.txt:140) static member DefinitionsInSigAndImplNotCompatibleTypeIsDifferentKind(a0 : System.String, a1 : System.String) = (307, GetStringFunc("DefinitionsInSigAndImplNotCompatibleTypeIsDifferentKind",",,,%s,,,%s,,,") a0 a1) /// The %s definitions for type '%s' in the signature and implementation are not compatible because the IL representations differ - /// (Originally from ../FSComp.txt:141) + /// (Originally from ..\FSComp.txt:141) static member DefinitionsInSigAndImplNotCompatibleILDiffer(a0 : System.String, a1 : System.String) = (308, GetStringFunc("DefinitionsInSigAndImplNotCompatibleILDiffer",",,,%s,,,%s,,,") a0 a1) /// The %s definitions for type '%s' in the signature and implementation are not compatible because the representations differ - /// (Originally from ../FSComp.txt:142) + /// (Originally from ..\FSComp.txt:142) static member DefinitionsInSigAndImplNotCompatibleRepresentationsDiffer(a0 : System.String, a1 : System.String) = (309, GetStringFunc("DefinitionsInSigAndImplNotCompatibleRepresentationsDiffer",",,,%s,,,%s,,,") a0 a1) /// The %s definitions for type '%s' in the signature and implementation are not compatible because the field %s was present in the implementation but not in the signature - /// (Originally from ../FSComp.txt:143) + /// (Originally from ..\FSComp.txt:143) static member DefinitionsInSigAndImplNotCompatibleFieldWasPresent(a0 : System.String, a1 : System.String, a2 : System.String) = (311, GetStringFunc("DefinitionsInSigAndImplNotCompatibleFieldWasPresent",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// The %s definitions for type '%s' in the signature and implementation are not compatible because the order of the fields is different in the signature and implementation - /// (Originally from ../FSComp.txt:144) + /// (Originally from ..\FSComp.txt:144) static member DefinitionsInSigAndImplNotCompatibleFieldOrderDiffer(a0 : System.String, a1 : System.String) = (312, GetStringFunc("DefinitionsInSigAndImplNotCompatibleFieldOrderDiffer",",,,%s,,,%s,,,") a0 a1) /// The %s definitions for type '%s' in the signature and implementation are not compatible because the field %s was required by the signature but was not specified by the implementation - /// (Originally from ../FSComp.txt:145) + /// (Originally from ..\FSComp.txt:145) static member DefinitionsInSigAndImplNotCompatibleFieldRequiredButNotSpecified(a0 : System.String, a1 : System.String, a2 : System.String) = (313, GetStringFunc("DefinitionsInSigAndImplNotCompatibleFieldRequiredButNotSpecified",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// The %s definitions for type '%s' in the signature and implementation are not compatible because the field '%s' was present in the implementation but not in the signature. Struct types must now reveal their fields in the signature for the type, though the fields may still be labelled 'private' or 'internal'. - /// (Originally from ../FSComp.txt:146) + /// (Originally from ..\FSComp.txt:146) static member DefinitionsInSigAndImplNotCompatibleFieldIsInImplButNotSig(a0 : System.String, a1 : System.String, a2 : System.String) = (314, GetStringFunc("DefinitionsInSigAndImplNotCompatibleFieldIsInImplButNotSig",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// The %s definitions for type '%s' in the signature and implementation are not compatible because the abstract member '%s' was required by the signature but was not specified by the implementation - /// (Originally from ../FSComp.txt:147) + /// (Originally from ..\FSComp.txt:147) static member DefinitionsInSigAndImplNotCompatibleAbstractMemberMissingInImpl(a0 : System.String, a1 : System.String, a2 : System.String) = (315, GetStringFunc("DefinitionsInSigAndImplNotCompatibleAbstractMemberMissingInImpl",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// The %s definitions for type '%s' in the signature and implementation are not compatible because the abstract member '%s' was present in the implementation but not in the signature - /// (Originally from ../FSComp.txt:148) + /// (Originally from ..\FSComp.txt:148) static member DefinitionsInSigAndImplNotCompatibleAbstractMemberMissingInSig(a0 : System.String, a1 : System.String, a2 : System.String) = (316, GetStringFunc("DefinitionsInSigAndImplNotCompatibleAbstractMemberMissingInSig",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// The %s definitions for type '%s' in the signature and implementation are not compatible because the signature declares a %s while the implementation declares a %s - /// (Originally from ../FSComp.txt:149) + /// (Originally from ..\FSComp.txt:149) static member DefinitionsInSigAndImplNotCompatibleSignatureDeclaresDiffer(a0 : System.String, a1 : System.String, a2 : System.String, a3 : System.String) = (317, GetStringFunc("DefinitionsInSigAndImplNotCompatibleSignatureDeclaresDiffer",",,,%s,,,%s,,,%s,,,%s,,,") a0 a1 a2 a3) /// The %s definitions for type '%s' in the signature and implementation are not compatible because the abbreviations differ: %s versus %s - /// (Originally from ../FSComp.txt:150) + /// (Originally from ..\FSComp.txt:150) static member DefinitionsInSigAndImplNotCompatibleAbbreviationsDiffer(a0 : System.String, a1 : System.String, a2 : System.String, a3 : System.String) = (318, GetStringFunc("DefinitionsInSigAndImplNotCompatibleAbbreviationsDiffer",",,,%s,,,%s,,,%s,,,%s,,,") a0 a1 a2 a3) /// The %s definitions for type '%s' in the signature and implementation are not compatible because an abbreviation is being hidden by a signature. The abbreviation must be visible to other CLI languages. Consider making the abbreviation visible in the signature. - /// (Originally from ../FSComp.txt:151) + /// (Originally from ..\FSComp.txt:151) static member DefinitionsInSigAndImplNotCompatibleAbbreviationHiddenBySig(a0 : System.String, a1 : System.String) = (319, GetStringFunc("DefinitionsInSigAndImplNotCompatibleAbbreviationHiddenBySig",",,,%s,,,%s,,,") a0 a1) /// The %s definitions for type '%s' in the signature and implementation are not compatible because the signature has an abbreviation while the implementation does not - /// (Originally from ../FSComp.txt:152) + /// (Originally from ..\FSComp.txt:152) static member DefinitionsInSigAndImplNotCompatibleSigHasAbbreviation(a0 : System.String, a1 : System.String) = (320, GetStringFunc("DefinitionsInSigAndImplNotCompatibleSigHasAbbreviation",",,,%s,,,%s,,,") a0 a1) /// The module contains the constructor\n %s \nbut its signature specifies\n %s \nThe names differ - /// (Originally from ../FSComp.txt:153) + /// (Originally from ..\FSComp.txt:153) static member ModuleContainsConstructorButNamesDiffer(a0 : System.String, a1 : System.String) = (GetStringFunc("ModuleContainsConstructorButNamesDiffer",",,,%s,,,%s,,,") a0 a1) /// The module contains the constructor\n %s \nbut its signature specifies\n %s \nThe respective number of data fields differ - /// (Originally from ../FSComp.txt:154) + /// (Originally from ..\FSComp.txt:154) static member ModuleContainsConstructorButDataFieldsDiffer(a0 : System.String, a1 : System.String) = (GetStringFunc("ModuleContainsConstructorButDataFieldsDiffer",",,,%s,,,%s,,,") a0 a1) /// The module contains the constructor\n %s \nbut its signature specifies\n %s \nThe types of the fields differ - /// (Originally from ../FSComp.txt:155) + /// (Originally from ..\FSComp.txt:155) static member ModuleContainsConstructorButTypesOfFieldsDiffer(a0 : System.String, a1 : System.String) = (GetStringFunc("ModuleContainsConstructorButTypesOfFieldsDiffer",",,,%s,,,%s,,,") a0 a1) /// The module contains the constructor\n %s \nbut its signature specifies\n %s \nthe accessibility specified in the signature is more than that specified in the implementation - /// (Originally from ../FSComp.txt:156) + /// (Originally from ..\FSComp.txt:156) static member ModuleContainsConstructorButAccessibilityDiffers(a0 : System.String, a1 : System.String) = (GetStringFunc("ModuleContainsConstructorButAccessibilityDiffers",",,,%s,,,%s,,,") a0 a1) /// The module contains the field\n %s \nbut its signature specifies\n %s \nThe names differ - /// (Originally from ../FSComp.txt:157) + /// (Originally from ..\FSComp.txt:157) static member FieldNotContainedNamesDiffer(a0 : System.String, a1 : System.String) = (GetStringFunc("FieldNotContainedNamesDiffer",",,,%s,,,%s,,,") a0 a1) /// The module contains the field\n %s \nbut its signature specifies\n %s \nthe accessibility specified in the signature is more than that specified in the implementation - /// (Originally from ../FSComp.txt:158) + /// (Originally from ..\FSComp.txt:158) static member FieldNotContainedAccessibilitiesDiffer(a0 : System.String, a1 : System.String) = (GetStringFunc("FieldNotContainedAccessibilitiesDiffer",",,,%s,,,%s,,,") a0 a1) /// The module contains the field\n %s \nbut its signature specifies\n %s \nThe 'static' modifiers differ - /// (Originally from ../FSComp.txt:159) + /// (Originally from ..\FSComp.txt:159) static member FieldNotContainedStaticsDiffer(a0 : System.String, a1 : System.String) = (GetStringFunc("FieldNotContainedStaticsDiffer",",,,%s,,,%s,,,") a0 a1) /// The module contains the field\n %s \nbut its signature specifies\n %s \nThe 'mutable' modifiers differ - /// (Originally from ../FSComp.txt:160) + /// (Originally from ..\FSComp.txt:160) static member FieldNotContainedMutablesDiffer(a0 : System.String, a1 : System.String) = (GetStringFunc("FieldNotContainedMutablesDiffer",",,,%s,,,%s,,,") a0 a1) /// The module contains the field\n %s \nbut its signature specifies\n %s \nThe 'literal' modifiers differ - /// (Originally from ../FSComp.txt:161) + /// (Originally from ..\FSComp.txt:161) static member FieldNotContainedLiteralsDiffer(a0 : System.String, a1 : System.String) = (GetStringFunc("FieldNotContainedLiteralsDiffer",",,,%s,,,%s,,,") a0 a1) /// The module contains the field\n %s \nbut its signature specifies\n %s \nThe types differ - /// (Originally from ../FSComp.txt:162) + /// (Originally from ..\FSComp.txt:162) static member FieldNotContainedTypesDiffer(a0 : System.String, a1 : System.String) = (GetStringFunc("FieldNotContainedTypesDiffer",",,,%s,,,%s,,,") a0 a1) /// The implicit instantiation of a generic construct at or near this point could not be resolved because it could resolve to multiple unrelated types, e.g. '%s' and '%s'. Consider using type annotations to resolve the ambiguity - /// (Originally from ../FSComp.txt:163) + /// (Originally from ..\FSComp.txt:163) static member typrelCannotResolveImplicitGenericInstantiation(a0 : System.String, a1 : System.String) = (331, GetStringFunc("typrelCannotResolveImplicitGenericInstantiation",",,,%s,,,%s,,,") a0 a1) /// Could not resolve the ambiguity inherent in the use of a 'printf'-style format string - /// (Originally from ../FSComp.txt:164) + /// (Originally from ..\FSComp.txt:164) static member typrelCannotResolveAmbiguityInPrintf() = (333, GetStringFunc("typrelCannotResolveAmbiguityInPrintf",",,,") ) /// Could not resolve the ambiguity in the use of a generic construct with an 'enum' constraint at or near this position - /// (Originally from ../FSComp.txt:165) + /// (Originally from ..\FSComp.txt:165) static member typrelCannotResolveAmbiguityInEnum() = (334, GetStringFunc("typrelCannotResolveAmbiguityInEnum",",,,") ) /// Could not resolve the ambiguity in the use of a generic construct with a 'delegate' constraint at or near this position - /// (Originally from ../FSComp.txt:166) + /// (Originally from ..\FSComp.txt:166) static member typrelCannotResolveAmbiguityInDelegate() = (335, GetStringFunc("typrelCannotResolveAmbiguityInDelegate",",,,") ) /// Invalid value - /// (Originally from ../FSComp.txt:167) + /// (Originally from ..\FSComp.txt:167) static member typrelInvalidValue() = (337, GetStringFunc("typrelInvalidValue",",,,") ) /// The signature and implementation are not compatible because the respective type parameter counts differ - /// (Originally from ../FSComp.txt:168) + /// (Originally from ..\FSComp.txt:168) static member typrelSigImplNotCompatibleParamCountsDiffer() = (338, GetStringFunc("typrelSigImplNotCompatibleParamCountsDiffer",",,,") ) /// The signature and implementation are not compatible because the type parameter in the class/signature has a different compile-time requirement to the one in the member/implementation - /// (Originally from ../FSComp.txt:169) + /// (Originally from ..\FSComp.txt:169) static member typrelSigImplNotCompatibleCompileTimeRequirementsDiffer() = (339, GetStringFunc("typrelSigImplNotCompatibleCompileTimeRequirementsDiffer",",,,") ) /// The signature and implementation are not compatible because the declaration of the type parameter '%s' requires a constraint of the form %s - /// (Originally from ../FSComp.txt:170) + /// (Originally from ..\FSComp.txt:170) static member typrelSigImplNotCompatibleConstraintsDiffer(a0 : System.String, a1 : System.String) = (340, GetStringFunc("typrelSigImplNotCompatibleConstraintsDiffer",",,,%s,,,%s,,,") a0 a1) /// The signature and implementation are not compatible because the type parameter '%s' has a constraint of the form %s but the implementation does not. Either remove this constraint from the signature or add it to the implementation. - /// (Originally from ../FSComp.txt:171) + /// (Originally from ..\FSComp.txt:171) static member typrelSigImplNotCompatibleConstraintsDifferRemove(a0 : System.String, a1 : System.String) = (341, GetStringFunc("typrelSigImplNotCompatibleConstraintsDifferRemove",",,,%s,,,%s,,,") a0 a1) /// The type '%s' implements 'System.IComparable'. Consider also adding an explicit override for 'Object.Equals' - /// (Originally from ../FSComp.txt:172) + /// (Originally from ..\FSComp.txt:172) static member typrelTypeImplementsIComparableShouldOverrideObjectEquals(a0 : System.String) = (342, GetStringFunc("typrelTypeImplementsIComparableShouldOverrideObjectEquals",",,,%s,,,") a0) /// The type '%s' implements 'System.IComparable' explicitly but provides no corresponding override for 'Object.Equals'. An implementation of 'Object.Equals' has been automatically provided, implemented via 'System.IComparable'. Consider implementing the override 'Object.Equals' explicitly - /// (Originally from ../FSComp.txt:173) + /// (Originally from ..\FSComp.txt:173) static member typrelTypeImplementsIComparableDefaultObjectEqualsProvided(a0 : System.String) = (343, GetStringFunc("typrelTypeImplementsIComparableDefaultObjectEqualsProvided",",,,%s,,,") a0) /// The struct, record or union type '%s' has an explicit implementation of 'Object.GetHashCode' or 'Object.Equals'. You must apply the 'CustomEquality' attribute to the type - /// (Originally from ../FSComp.txt:174) + /// (Originally from ..\FSComp.txt:174) static member typrelExplicitImplementationOfGetHashCodeOrEquals(a0 : System.String) = (344, GetStringFunc("typrelExplicitImplementationOfGetHashCodeOrEquals",",,,%s,,,") a0) /// The struct, record or union type '%s' has an explicit implementation of 'Object.GetHashCode'. Consider implementing a matching override for 'Object.Equals(obj)' - /// (Originally from ../FSComp.txt:175) + /// (Originally from ..\FSComp.txt:175) static member typrelExplicitImplementationOfGetHashCode(a0 : System.String) = (345, GetStringFunc("typrelExplicitImplementationOfGetHashCode",",,,%s,,,") a0) /// The struct, record or union type '%s' has an explicit implementation of 'Object.Equals'. Consider implementing a matching override for 'Object.GetHashCode()' - /// (Originally from ../FSComp.txt:176) + /// (Originally from ..\FSComp.txt:176) static member typrelExplicitImplementationOfEquals(a0 : System.String) = (346, GetStringFunc("typrelExplicitImplementationOfEquals",",,,%s,,,") a0) /// The exception definitions are not compatible because a CLI exception mapping is being hidden by a signature. The exception mapping must be visible to other modules. The module contains the exception definition\n %s \nbut its signature specifies\n\t%s - /// (Originally from ../FSComp.txt:177) + /// (Originally from ..\FSComp.txt:177) static member ExceptionDefsNotCompatibleHiddenBySignature(a0 : System.String, a1 : System.String) = (GetStringFunc("ExceptionDefsNotCompatibleHiddenBySignature",",,,%s,,,%s,,,") a0 a1) /// The exception definitions are not compatible because the CLI representations differ. The module contains the exception definition\n %s \nbut its signature specifies\n\t%s - /// (Originally from ../FSComp.txt:178) + /// (Originally from ..\FSComp.txt:178) static member ExceptionDefsNotCompatibleDotNetRepresentationsDiffer(a0 : System.String, a1 : System.String) = (GetStringFunc("ExceptionDefsNotCompatibleDotNetRepresentationsDiffer",",,,%s,,,%s,,,") a0 a1) /// The exception definitions are not compatible because the exception abbreviation is being hidden by the signature. The abbreviation must be visible to other CLI languages. Consider making the abbreviation visible in the signature. The module contains the exception definition\n %s \nbut its signature specifies\n\t%s. - /// (Originally from ../FSComp.txt:179) + /// (Originally from ..\FSComp.txt:179) static member ExceptionDefsNotCompatibleAbbreviationHiddenBySignature(a0 : System.String, a1 : System.String) = (GetStringFunc("ExceptionDefsNotCompatibleAbbreviationHiddenBySignature",",,,%s,,,%s,,,") a0 a1) /// The exception definitions are not compatible because the exception abbreviations in the signature and implementation differ. The module contains the exception definition\n %s \nbut its signature specifies\n\t%s. - /// (Originally from ../FSComp.txt:180) + /// (Originally from ..\FSComp.txt:180) static member ExceptionDefsNotCompatibleSignaturesDiffer(a0 : System.String, a1 : System.String) = (GetStringFunc("ExceptionDefsNotCompatibleSignaturesDiffer",",,,%s,,,%s,,,") a0 a1) /// The exception definitions are not compatible because the exception declarations differ. The module contains the exception definition\n %s \nbut its signature specifies\n\t%s. - /// (Originally from ../FSComp.txt:181) + /// (Originally from ..\FSComp.txt:181) static member ExceptionDefsNotCompatibleExceptionDeclarationsDiffer(a0 : System.String, a1 : System.String) = (GetStringFunc("ExceptionDefsNotCompatibleExceptionDeclarationsDiffer",",,,%s,,,%s,,,") a0 a1) /// The exception definitions are not compatible because the field '%s' was required by the signature but was not specified by the implementation. The module contains the exception definition\n %s \nbut its signature specifies\n\t%s. - /// (Originally from ../FSComp.txt:182) + /// (Originally from ..\FSComp.txt:182) static member ExceptionDefsNotCompatibleFieldInSigButNotImpl(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("ExceptionDefsNotCompatibleFieldInSigButNotImpl",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// The exception definitions are not compatible because the field '%s' was present in the implementation but not in the signature. The module contains the exception definition\n %s \nbut its signature specifies\n\t%s. - /// (Originally from ../FSComp.txt:183) + /// (Originally from ..\FSComp.txt:183) static member ExceptionDefsNotCompatibleFieldInImplButNotSig(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("ExceptionDefsNotCompatibleFieldInImplButNotSig",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// The exception definitions are not compatible because the order of the fields is different in the signature and implementation. The module contains the exception definition\n %s \nbut its signature specifies\n\t%s. - /// (Originally from ../FSComp.txt:184) + /// (Originally from ..\FSComp.txt:184) static member ExceptionDefsNotCompatibleFieldOrderDiffers(a0 : System.String, a1 : System.String) = (GetStringFunc("ExceptionDefsNotCompatibleFieldOrderDiffers",",,,%s,,,%s,,,") a0 a1) /// The namespace or module attributes differ between signature and implementation - /// (Originally from ../FSComp.txt:185) + /// (Originally from ..\FSComp.txt:185) static member typrelModuleNamespaceAttributesDifferInSigAndImpl() = (355, GetStringFunc("typrelModuleNamespaceAttributesDifferInSigAndImpl",",,,") ) /// This method is over-constrained in its type parameters - /// (Originally from ../FSComp.txt:186) + /// (Originally from ..\FSComp.txt:186) static member typrelMethodIsOverconstrained() = (356, GetStringFunc("typrelMethodIsOverconstrained",",,,") ) /// No implementations of '%s' had the correct number of arguments and type parameters. The required signature is '%s'. - /// (Originally from ../FSComp.txt:187) + /// (Originally from ..\FSComp.txt:187) static member typrelOverloadNotFound(a0 : System.String, a1 : System.String) = (357, GetStringFunc("typrelOverloadNotFound",",,,%s,,,%s,,,") a0 a1) /// The override for '%s' was ambiguous - /// (Originally from ../FSComp.txt:188) + /// (Originally from ..\FSComp.txt:188) static member typrelOverrideWasAmbiguous(a0 : System.String) = (358, GetStringFunc("typrelOverrideWasAmbiguous",",,,%s,,,") a0) /// More than one override implements '%s' - /// (Originally from ../FSComp.txt:189) + /// (Originally from ..\FSComp.txt:189) static member typrelMoreThenOneOverride(a0 : System.String) = (359, GetStringFunc("typrelMoreThenOneOverride",",,,%s,,,") a0) /// The method '%s' is sealed and cannot be overridden - /// (Originally from ../FSComp.txt:190) + /// (Originally from ..\FSComp.txt:190) static member typrelMethodIsSealed(a0 : System.String) = (360, GetStringFunc("typrelMethodIsSealed",",,,%s,,,") a0) /// The override '%s' implements more than one abstract slot, e.g. '%s' and '%s' - /// (Originally from ../FSComp.txt:191) + /// (Originally from ..\FSComp.txt:191) static member typrelOverrideImplementsMoreThenOneSlot(a0 : System.String, a1 : System.String, a2 : System.String) = (361, GetStringFunc("typrelOverrideImplementsMoreThenOneSlot",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// Duplicate or redundant interface - /// (Originally from ../FSComp.txt:192) + /// (Originally from ..\FSComp.txt:192) static member typrelDuplicateInterface() = (362, GetStringFunc("typrelDuplicateInterface",",,,") ) /// The interface '%s' is included in multiple explicitly implemented interface types. Add an explicit implementation of this interface. - /// (Originally from ../FSComp.txt:193) + /// (Originally from ..\FSComp.txt:193) static member typrelNeedExplicitImplementation(a0 : System.String) = (363, GetStringFunc("typrelNeedExplicitImplementation",",,,%s,,,") a0) /// A named argument has been assigned more than one value - /// (Originally from ../FSComp.txt:194) + /// (Originally from ..\FSComp.txt:194) static member typrelNamedArgumentHasBeenAssignedMoreThenOnce() = (364, GetStringFunc("typrelNamedArgumentHasBeenAssignedMoreThenOnce",",,,") ) /// No implementation was given for '%s' - /// (Originally from ../FSComp.txt:195) + /// (Originally from ..\FSComp.txt:195) static member typrelNoImplementationGiven(a0 : System.String) = (365, GetStringFunc("typrelNoImplementationGiven",",,,%s,,,") a0) /// No implementation was given for '%s'. Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. - /// (Originally from ../FSComp.txt:196) + /// (Originally from ..\FSComp.txt:196) static member typrelNoImplementationGivenWithSuggestion(a0 : System.String) = (366, GetStringFunc("typrelNoImplementationGivenWithSuggestion",",,,%s,,,") a0) /// The member '%s' does not have the correct number of arguments. The required signature is '%s'. - /// (Originally from ../FSComp.txt:197) + /// (Originally from ..\FSComp.txt:197) static member typrelMemberDoesNotHaveCorrectNumberOfArguments(a0 : System.String, a1 : System.String) = (367, GetStringFunc("typrelMemberDoesNotHaveCorrectNumberOfArguments",",,,%s,,,%s,,,") a0 a1) /// The member '%s' does not have the correct number of method type parameters. The required signature is '%s'. - /// (Originally from ../FSComp.txt:198) + /// (Originally from ..\FSComp.txt:198) static member typrelMemberDoesNotHaveCorrectNumberOfTypeParameters(a0 : System.String, a1 : System.String) = (368, GetStringFunc("typrelMemberDoesNotHaveCorrectNumberOfTypeParameters",",,,%s,,,%s,,,") a0 a1) /// The member '%s' does not have the correct kinds of generic parameters. The required signature is '%s'. - /// (Originally from ../FSComp.txt:199) + /// (Originally from ..\FSComp.txt:199) static member typrelMemberDoesNotHaveCorrectKindsOfGenericParameters(a0 : System.String, a1 : System.String) = (369, GetStringFunc("typrelMemberDoesNotHaveCorrectKindsOfGenericParameters",",,,%s,,,%s,,,") a0 a1) /// The member '%s' cannot be used to implement '%s'. The required signature is '%s'. - /// (Originally from ../FSComp.txt:200) + /// (Originally from ..\FSComp.txt:200) static member typrelMemberCannotImplement(a0 : System.String, a1 : System.String, a2 : System.String) = (370, GetStringFunc("typrelMemberCannotImplement",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// Error while parsing embedded IL - /// (Originally from ../FSComp.txt:201) + /// (Originally from ..\FSComp.txt:201) static member astParseEmbeddedILError() = (371, GetStringFunc("astParseEmbeddedILError",",,,") ) /// Error while parsing embedded IL type - /// (Originally from ../FSComp.txt:202) + /// (Originally from ..\FSComp.txt:202) static member astParseEmbeddedILTypeError() = (372, GetStringFunc("astParseEmbeddedILTypeError",",,,") ) /// This indexer notation has been removed from the F# language - /// (Originally from ../FSComp.txt:203) + /// (Originally from ..\FSComp.txt:203) static member astDeprecatedIndexerNotation() = (GetStringFunc("astDeprecatedIndexerNotation",",,,") ) /// Invalid expression on left of assignment - /// (Originally from ../FSComp.txt:204) + /// (Originally from ..\FSComp.txt:204) static member astInvalidExprLeftHandOfAssignment() = (374, GetStringFunc("astInvalidExprLeftHandOfAssignment",",,,") ) /// The 'ReferenceEquality' attribute cannot be used on structs. Consider using the 'StructuralEquality' attribute instead, or implement an override for 'System.Object.Equals(obj)'. - /// (Originally from ../FSComp.txt:205) + /// (Originally from ..\FSComp.txt:205) static member augNoRefEqualsOnStruct() = (376, GetStringFunc("augNoRefEqualsOnStruct",",,,") ) /// This type uses an invalid mix of the attributes 'NoEquality', 'ReferenceEquality', 'StructuralEquality', 'NoComparison' and 'StructuralComparison' - /// (Originally from ../FSComp.txt:206) + /// (Originally from ..\FSComp.txt:206) static member augInvalidAttrs() = (377, GetStringFunc("augInvalidAttrs",",,,") ) /// The 'NoEquality' attribute must be used in conjunction with the 'NoComparison' attribute - /// (Originally from ../FSComp.txt:207) + /// (Originally from ..\FSComp.txt:207) static member augNoEqualityNeedsNoComparison() = (378, GetStringFunc("augNoEqualityNeedsNoComparison",",,,") ) /// The 'StructuralComparison' attribute must be used in conjunction with the 'StructuralEquality' attribute - /// (Originally from ../FSComp.txt:208) + /// (Originally from ..\FSComp.txt:208) static member augStructCompNeedsStructEquality() = (379, GetStringFunc("augStructCompNeedsStructEquality",",,,") ) /// The 'StructuralEquality' attribute must be used in conjunction with the 'NoComparison' or 'StructuralComparison' attributes - /// (Originally from ../FSComp.txt:209) + /// (Originally from ..\FSComp.txt:209) static member augStructEqNeedsNoCompOrStructComp() = (380, GetStringFunc("augStructEqNeedsNoCompOrStructComp",",,,") ) /// A type cannot have both the 'ReferenceEquality' and 'StructuralEquality' or 'StructuralComparison' attributes - /// (Originally from ../FSComp.txt:210) + /// (Originally from ..\FSComp.txt:210) static member augTypeCantHaveRefEqAndStructAttrs() = (381, GetStringFunc("augTypeCantHaveRefEqAndStructAttrs",",,,") ) /// Only record, union, exception and struct types may be augmented with the 'ReferenceEquality', 'StructuralEquality' and 'StructuralComparison' attributes - /// (Originally from ../FSComp.txt:211) + /// (Originally from ..\FSComp.txt:211) static member augOnlyCertainTypesCanHaveAttrs() = (382, GetStringFunc("augOnlyCertainTypesCanHaveAttrs",",,,") ) /// A type with attribute 'ReferenceEquality' cannot have an explicit implementation of 'Object.Equals(obj)', 'System.IEquatable<_>' or 'System.Collections.IStructuralEquatable' - /// (Originally from ../FSComp.txt:212) + /// (Originally from ..\FSComp.txt:212) static member augRefEqCantHaveObjEquals() = (383, GetStringFunc("augRefEqCantHaveObjEquals",",,,") ) /// A type with attribute 'CustomEquality' must have an explicit implementation of at least one of 'Object.Equals(obj)', 'System.IEquatable<_>' or 'System.Collections.IStructuralEquatable' - /// (Originally from ../FSComp.txt:213) + /// (Originally from ..\FSComp.txt:213) static member augCustomEqNeedsObjEquals() = (384, GetStringFunc("augCustomEqNeedsObjEquals",",,,") ) /// A type with attribute 'CustomComparison' must have an explicit implementation of at least one of 'System.IComparable' or 'System.Collections.IStructuralComparable' - /// (Originally from ../FSComp.txt:214) + /// (Originally from ..\FSComp.txt:214) static member augCustomCompareNeedsIComp() = (385, GetStringFunc("augCustomCompareNeedsIComp",",,,") ) /// A type with attribute 'NoEquality' should not usually have an explicit implementation of 'Object.Equals(obj)'. Disable this warning if this is intentional for interoperability purposes - /// (Originally from ../FSComp.txt:215) + /// (Originally from ..\FSComp.txt:215) static member augNoEqNeedsNoObjEquals() = (386, GetStringFunc("augNoEqNeedsNoObjEquals",",,,") ) /// A type with attribute 'NoComparison' should not usually have an explicit implementation of 'System.IComparable', 'System.IComparable<_>' or 'System.Collections.IStructuralComparable'. Disable this warning if this is intentional for interoperability purposes - /// (Originally from ../FSComp.txt:216) + /// (Originally from ..\FSComp.txt:216) static member augNoCompCantImpIComp() = (386, GetStringFunc("augNoCompCantImpIComp",",,,") ) /// The 'CustomEquality' attribute must be used in conjunction with the 'NoComparison' or 'CustomComparison' attributes - /// (Originally from ../FSComp.txt:217) + /// (Originally from ..\FSComp.txt:217) static member augCustomEqNeedsNoCompOrCustomComp() = (387, GetStringFunc("augCustomEqNeedsNoCompOrCustomComp",",,,") ) /// Positional specifiers are not permitted in format strings - /// (Originally from ../FSComp.txt:218) + /// (Originally from ..\FSComp.txt:218) static member forPositionalSpecifiersNotPermitted() = (GetStringFunc("forPositionalSpecifiersNotPermitted",",,,") ) /// Missing format specifier - /// (Originally from ../FSComp.txt:219) + /// (Originally from ..\FSComp.txt:219) static member forMissingFormatSpecifier() = (GetStringFunc("forMissingFormatSpecifier",",,,") ) /// '%s' flag set twice - /// (Originally from ../FSComp.txt:220) + /// (Originally from ..\FSComp.txt:220) static member forFlagSetTwice(a0 : System.String) = (GetStringFunc("forFlagSetTwice",",,,%s,,,") a0) /// Prefix flag (' ' or '+') set twice - /// (Originally from ../FSComp.txt:221) + /// (Originally from ..\FSComp.txt:221) static member forPrefixFlagSpacePlusSetTwice() = (GetStringFunc("forPrefixFlagSpacePlusSetTwice",",,,") ) /// The # formatting modifier is invalid in F# - /// (Originally from ../FSComp.txt:222) + /// (Originally from ..\FSComp.txt:222) static member forHashSpecifierIsInvalid() = (GetStringFunc("forHashSpecifierIsInvalid",",,,") ) /// Bad precision in format specifier - /// (Originally from ../FSComp.txt:223) + /// (Originally from ..\FSComp.txt:223) static member forBadPrecision() = (GetStringFunc("forBadPrecision",",,,") ) /// Bad width in format specifier - /// (Originally from ../FSComp.txt:224) + /// (Originally from ..\FSComp.txt:224) static member forBadWidth() = (GetStringFunc("forBadWidth",",,,") ) /// '%s' format does not support '0' flag - /// (Originally from ../FSComp.txt:225) + /// (Originally from ..\FSComp.txt:225) static member forDoesNotSupportZeroFlag(a0 : System.String) = (GetStringFunc("forDoesNotSupportZeroFlag",",,,%s,,,") a0) /// Precision missing after the '.' - /// (Originally from ../FSComp.txt:226) + /// (Originally from ..\FSComp.txt:226) static member forPrecisionMissingAfterDot() = (GetStringFunc("forPrecisionMissingAfterDot",",,,") ) /// '%s' format does not support precision - /// (Originally from ../FSComp.txt:227) + /// (Originally from ..\FSComp.txt:227) static member forFormatDoesntSupportPrecision(a0 : System.String) = (GetStringFunc("forFormatDoesntSupportPrecision",",,,%s,,,") a0) /// Bad format specifier (after l or L): Expected ld,li,lo,lu,lx or lX. In F# code you can use %%d, %%x, %%o or %%u instead, which are overloaded to work with all basic integer types. - /// (Originally from ../FSComp.txt:228) + /// (Originally from ..\FSComp.txt:228) static member forBadFormatSpecifier() = (GetStringFunc("forBadFormatSpecifier",",,,") ) /// The 'l' or 'L' in this format specifier is unnecessary. In F# code you can use %%d, %%x, %%o or %%u instead, which are overloaded to work with all basic integer types. - /// (Originally from ../FSComp.txt:229) + /// (Originally from ..\FSComp.txt:229) static member forLIsUnnecessary() = (GetStringFunc("forLIsUnnecessary",",,,") ) /// The 'h' or 'H' in this format specifier is unnecessary. You can use %%d, %%x, %%o or %%u instead, which are overloaded to work with all basic integer types. - /// (Originally from ../FSComp.txt:230) + /// (Originally from ..\FSComp.txt:230) static member forHIsUnnecessary() = (GetStringFunc("forHIsUnnecessary",",,,") ) /// '%s' does not support prefix '%s' flag - /// (Originally from ../FSComp.txt:231) + /// (Originally from ..\FSComp.txt:231) static member forDoesNotSupportPrefixFlag(a0 : System.String, a1 : System.String) = (GetStringFunc("forDoesNotSupportPrefixFlag",",,,%s,,,%s,,,") a0 a1) /// Bad format specifier: '%s' - /// (Originally from ../FSComp.txt:232) + /// (Originally from ..\FSComp.txt:232) static member forBadFormatSpecifierGeneral(a0 : System.String) = (GetStringFunc("forBadFormatSpecifierGeneral",",,,%s,,,") a0) /// System.Environment.Exit did not exit - /// (Originally from ../FSComp.txt:233) + /// (Originally from ..\FSComp.txt:233) static member elSysEnvExitDidntExit() = (GetStringFunc("elSysEnvExitDidntExit",",,,") ) /// The treatment of this operator is now handled directly by the F# compiler and its meaning cannot be redefined - /// (Originally from ../FSComp.txt:234) + /// (Originally from ..\FSComp.txt:234) static member elDeprecatedOperator() = (GetStringFunc("elDeprecatedOperator",",,,") ) /// A protected member is called or 'base' is being used. This is only allowed in the direct implementation of members since they could escape their object scope. - /// (Originally from ../FSComp.txt:235) + /// (Originally from ..\FSComp.txt:235) static member chkProtectedOrBaseCalled() = (405, GetStringFunc("chkProtectedOrBaseCalled",",,,") ) /// The byref-typed variable '%s' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. - /// (Originally from ../FSComp.txt:236) + /// (Originally from ..\FSComp.txt:236) static member chkByrefUsedInInvalidWay(a0 : System.String) = (406, GetStringFunc("chkByrefUsedInInvalidWay",",,,%s,,,") a0) /// The 'base' keyword is used in an invalid way. Base calls cannot be used in closures. Consider using a private member to make base calls. - /// (Originally from ../FSComp.txt:237) + /// (Originally from ..\FSComp.txt:237) static member chkBaseUsedInInvalidWay() = (408, GetStringFunc("chkBaseUsedInInvalidWay",",,,") ) /// The variable '%s' is used in an invalid way - /// (Originally from ../FSComp.txt:238) + /// (Originally from ..\FSComp.txt:238) static member chkVariableUsedInInvalidWay(a0 : System.String) = (GetStringFunc("chkVariableUsedInInvalidWay",",,,%s,,,") a0) /// The type '%s' is less accessible than the value, member or type '%s' it is used in. - /// (Originally from ../FSComp.txt:239) + /// (Originally from ..\FSComp.txt:239) static member chkTypeLessAccessibleThanType(a0 : System.String, a1 : System.String) = (410, GetStringFunc("chkTypeLessAccessibleThanType",",,,%s,,,%s,,,") a0 a1) /// 'System.Void' can only be used as 'typeof' in F# - /// (Originally from ../FSComp.txt:240) + /// (Originally from ..\FSComp.txt:240) static member chkSystemVoidOnlyInTypeof() = (411, GetStringFunc("chkSystemVoidOnlyInTypeof",",,,") ) /// A type instantiation involves a byref type. This is not permitted by the rules of Common IL. - /// (Originally from ../FSComp.txt:241) + /// (Originally from ..\FSComp.txt:241) static member chkErrorUseOfByref() = (412, GetStringFunc("chkErrorUseOfByref",",,,") ) /// Calls to 'reraise' may only occur directly in a handler of a try-with - /// (Originally from ../FSComp.txt:242) + /// (Originally from ..\FSComp.txt:242) static member chkErrorContainsCallToRethrow() = (413, GetStringFunc("chkErrorContainsCallToRethrow",",,,") ) /// Expression-splicing operators may only be used within quotations - /// (Originally from ../FSComp.txt:243) + /// (Originally from ..\FSComp.txt:243) static member chkSplicingOnlyInQuotations() = (414, GetStringFunc("chkSplicingOnlyInQuotations",",,,") ) /// First-class uses of the expression-splicing operator are not permitted - /// (Originally from ../FSComp.txt:244) + /// (Originally from ..\FSComp.txt:244) static member chkNoFirstClassSplicing() = (415, GetStringFunc("chkNoFirstClassSplicing",",,,") ) /// First-class uses of the address-of operators are not permitted - /// (Originally from ../FSComp.txt:245) + /// (Originally from ..\FSComp.txt:245) static member chkNoFirstClassAddressOf() = (416, GetStringFunc("chkNoFirstClassAddressOf",",,,") ) /// First-class uses of the 'reraise' function is not permitted - /// (Originally from ../FSComp.txt:246) + /// (Originally from ..\FSComp.txt:246) static member chkNoFirstClassRethrow() = (417, GetStringFunc("chkNoFirstClassRethrow",",,,") ) /// The byref typed value '%s' cannot be used at this point - /// (Originally from ../FSComp.txt:247) + /// (Originally from ..\FSComp.txt:247) static member chkNoByrefAtThisPoint(a0 : System.String) = (418, GetStringFunc("chkNoByrefAtThisPoint",",,,%s,,,") a0) /// 'base' values may only be used to make direct calls to the base implementations of overridden members - /// (Originally from ../FSComp.txt:248) + /// (Originally from ..\FSComp.txt:248) static member chkLimitationsOfBaseKeyword() = (419, GetStringFunc("chkLimitationsOfBaseKeyword",",,,") ) /// Object constructors cannot directly use try/with and try/finally prior to the initialization of the object. This includes constructs such as 'for x in ...' that may elaborate to uses of these constructs. This is a limitation imposed by Common IL. - /// (Originally from ../FSComp.txt:249) + /// (Originally from ..\FSComp.txt:249) static member chkObjCtorsCantUseExceptionHandling() = (420, GetStringFunc("chkObjCtorsCantUseExceptionHandling",",,,") ) /// The address of the variable '%s' cannot be used at this point - /// (Originally from ../FSComp.txt:250) + /// (Originally from ..\FSComp.txt:250) static member chkNoAddressOfAtThisPoint(a0 : System.String) = (421, GetStringFunc("chkNoAddressOfAtThisPoint",",,,%s,,,") a0) /// The address of the static field '%s' cannot be used at this point - /// (Originally from ../FSComp.txt:251) + /// (Originally from ..\FSComp.txt:251) static member chkNoAddressStaticFieldAtThisPoint(a0 : System.String) = (422, GetStringFunc("chkNoAddressStaticFieldAtThisPoint",",,,%s,,,") a0) /// The address of the field '%s' cannot be used at this point - /// (Originally from ../FSComp.txt:252) + /// (Originally from ..\FSComp.txt:252) static member chkNoAddressFieldAtThisPoint(a0 : System.String) = (423, GetStringFunc("chkNoAddressFieldAtThisPoint",",,,%s,,,") a0) /// The address of an array element cannot be used at this point - /// (Originally from ../FSComp.txt:253) + /// (Originally from ..\FSComp.txt:253) static member chkNoAddressOfArrayElementAtThisPoint() = (424, GetStringFunc("chkNoAddressOfArrayElementAtThisPoint",",,,") ) /// The type of a first-class function cannot contain byrefs - /// (Originally from ../FSComp.txt:254) + /// (Originally from ..\FSComp.txt:254) static member chkFirstClassFuncNoByref() = (425, GetStringFunc("chkFirstClassFuncNoByref",",,,") ) /// A method return type would contain byrefs which is not permitted - /// (Originally from ../FSComp.txt:255) + /// (Originally from ..\FSComp.txt:255) static member chkReturnTypeNoByref() = (426, GetStringFunc("chkReturnTypeNoByref",",,,") ) /// Invalid custom attribute value (not a constant or literal) - /// (Originally from ../FSComp.txt:256) + /// (Originally from ..\FSComp.txt:256) static member chkInvalidCustAttrVal() = (428, GetStringFunc("chkInvalidCustAttrVal",",,,") ) /// The attribute type '%s' has 'AllowMultiple=false'. Multiple instances of this attribute cannot be attached to a single language element. - /// (Originally from ../FSComp.txt:257) + /// (Originally from ..\FSComp.txt:257) static member chkAttrHasAllowMultiFalse(a0 : System.String) = (429, GetStringFunc("chkAttrHasAllowMultiFalse",",,,%s,,,") a0) /// The member '%s' is used in an invalid way. A use of '%s' has been inferred prior to its definition at or near '%s'. This is an invalid forward reference. - /// (Originally from ../FSComp.txt:258) + /// (Originally from ..\FSComp.txt:258) static member chkMemberUsedInInvalidWay(a0 : System.String, a1 : System.String, a2 : System.String) = (430, GetStringFunc("chkMemberUsedInInvalidWay",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// A byref typed value would be stored here. Top-level let-bound byref values are not permitted. - /// (Originally from ../FSComp.txt:259) + /// (Originally from ..\FSComp.txt:259) static member chkNoByrefAsTopValue() = (431, GetStringFunc("chkNoByrefAsTopValue",",,,") ) /// [] terms cannot contain uses of the prefix splice operator '%%' - /// (Originally from ../FSComp.txt:260) + /// (Originally from ..\FSComp.txt:260) static member chkReflectedDefCantSplice() = (432, GetStringFunc("chkReflectedDefCantSplice",",,,") ) /// A function labeled with the 'EntryPointAttribute' attribute must be the last declaration in the last file in the compilation sequence. - /// (Originally from ../FSComp.txt:261) + /// (Originally from ..\FSComp.txt:261) static member chkEntryPointUsage() = (433, GetStringFunc("chkEntryPointUsage",",,,") ) /// compiled form of the union case - /// (Originally from ../FSComp.txt:262) + /// (Originally from ..\FSComp.txt:262) static member chkUnionCaseCompiledForm() = (GetStringFunc("chkUnionCaseCompiledForm",",,,") ) /// default augmentation of the union case - /// (Originally from ../FSComp.txt:263) + /// (Originally from ..\FSComp.txt:263) static member chkUnionCaseDefaultAugmentation() = (GetStringFunc("chkUnionCaseDefaultAugmentation",",,,") ) /// The property '%s' has the same name as a method in type '%s'. - /// (Originally from ../FSComp.txt:264) + /// (Originally from ..\FSComp.txt:264) static member chkPropertySameNameMethod(a0 : System.String, a1 : System.String) = (434, GetStringFunc("chkPropertySameNameMethod",",,,%s,,,%s,,,") a0 a1) /// The property '%s' of type '%s' has a getter and a setter that do not match. If one is abstract then the other must be as well. - /// (Originally from ../FSComp.txt:265) + /// (Originally from ..\FSComp.txt:265) static member chkGetterSetterDoNotMatchAbstract(a0 : System.String, a1 : System.String) = (435, GetStringFunc("chkGetterSetterDoNotMatchAbstract",",,,%s,,,%s,,,") a0 a1) /// The property '%s' has the same name as another property in type '%s', but one takes indexer arguments and the other does not. You may be missing an indexer argument to one of your properties. - /// (Originally from ../FSComp.txt:266) + /// (Originally from ..\FSComp.txt:266) static member chkPropertySameNameIndexer(a0 : System.String, a1 : System.String) = (436, GetStringFunc("chkPropertySameNameIndexer",",,,%s,,,%s,,,") a0 a1) /// A type would store a byref typed value. This is not permitted by Common IL. - /// (Originally from ../FSComp.txt:267) + /// (Originally from ..\FSComp.txt:267) static member chkCantStoreByrefValue() = (437, GetStringFunc("chkCantStoreByrefValue",",,,") ) /// Duplicate method. The method '%s' has the same name and signature as another method in type '%s'. - /// (Originally from ../FSComp.txt:269) + /// (Originally from ..\FSComp.txt:269) static member chkDuplicateMethod(a0 : System.String, a1 : System.String) = (438, GetStringFunc("chkDuplicateMethod",",,,%s,,,%s,,,") a0 a1) /// Duplicate method. The method '%s' has the same name and signature as another method in type '%s' once tuples, functions, units of measure and/or provided types are erased. - /// (Originally from ../FSComp.txt:270) + /// (Originally from ..\FSComp.txt:270) static member chkDuplicateMethodWithSuffix(a0 : System.String, a1 : System.String) = (438, GetStringFunc("chkDuplicateMethodWithSuffix",",,,%s,,,%s,,,") a0 a1) /// The method '%s' has curried arguments but has the same name as another method in type '%s'. Methods with curried arguments cannot be overloaded. Consider using a method taking tupled arguments. - /// (Originally from ../FSComp.txt:271) + /// (Originally from ..\FSComp.txt:271) static member chkDuplicateMethodCurried(a0 : System.String, a1 : System.String) = (439, GetStringFunc("chkDuplicateMethodCurried",",,,%s,,,%s,,,") a0 a1) /// Methods with curried arguments cannot declare 'out', 'ParamArray', 'optional', 'ReflectedDefinition', 'byref', 'CallerLineNumber', 'CallerMemberName', or 'CallerFilePath' arguments - /// (Originally from ../FSComp.txt:272) + /// (Originally from ..\FSComp.txt:272) static member chkCurriedMethodsCantHaveOutParams() = (440, GetStringFunc("chkCurriedMethodsCantHaveOutParams",",,,") ) /// Duplicate property. The property '%s' has the same name and signature as another property in type '%s'. - /// (Originally from ../FSComp.txt:273) + /// (Originally from ..\FSComp.txt:273) static member chkDuplicateProperty(a0 : System.String, a1 : System.String) = (441, GetStringFunc("chkDuplicateProperty",",,,%s,,,%s,,,") a0 a1) /// Duplicate property. The property '%s' has the same name and signature as another property in type '%s' once tuples, functions, units of measure and/or provided types are erased. - /// (Originally from ../FSComp.txt:274) + /// (Originally from ..\FSComp.txt:274) static member chkDuplicatePropertyWithSuffix(a0 : System.String, a1 : System.String) = (441, GetStringFunc("chkDuplicatePropertyWithSuffix",",,,%s,,,%s,,,") a0 a1) /// Duplicate method. The abstract method '%s' has the same name and signature as an abstract method in an inherited type. - /// (Originally from ../FSComp.txt:275) + /// (Originally from ..\FSComp.txt:275) static member chkDuplicateMethodInheritedType(a0 : System.String) = (442, GetStringFunc("chkDuplicateMethodInheritedType",",,,%s,,,") a0) /// Duplicate method. The abstract method '%s' has the same name and signature as an abstract method in an inherited type once tuples, functions, units of measure and/or provided types are erased. - /// (Originally from ../FSComp.txt:276) + /// (Originally from ..\FSComp.txt:276) static member chkDuplicateMethodInheritedTypeWithSuffix(a0 : System.String) = (442, GetStringFunc("chkDuplicateMethodInheritedTypeWithSuffix",",,,%s,,,") a0) /// This type implements the same interface at different generic instantiations '%s' and '%s'. This is not permitted in this version of F#. - /// (Originally from ../FSComp.txt:277) + /// (Originally from ..\FSComp.txt:277) static member chkMultipleGenericInterfaceInstantiations(a0 : System.String, a1 : System.String) = (443, GetStringFunc("chkMultipleGenericInterfaceInstantiations",",,,%s,,,%s,,,") a0 a1) /// The type of a field using the 'DefaultValue' attribute must admit default initialization, i.e. have 'null' as a proper value or be a struct type whose fields all admit default initialization. You can use 'DefaultValue(false)' to disable this check - /// (Originally from ../FSComp.txt:278) + /// (Originally from ..\FSComp.txt:278) static member chkValueWithDefaultValueMustHaveDefaultValue() = (444, GetStringFunc("chkValueWithDefaultValueMustHaveDefaultValue",",,,") ) /// The type abbreviation contains byrefs. This is not permitted by F#. - /// (Originally from ../FSComp.txt:279) + /// (Originally from ..\FSComp.txt:279) static member chkNoByrefInTypeAbbrev() = (445, GetStringFunc("chkNoByrefInTypeAbbrev",",,,") ) /// The variable '%s' is bound in a quotation but is used as part of a spliced expression. This is not permitted since it may escape its scope. - /// (Originally from ../FSComp.txt:280) + /// (Originally from ..\FSComp.txt:280) static member crefBoundVarUsedInSplice(a0 : System.String) = (446, GetStringFunc("crefBoundVarUsedInSplice",",,,%s,,,") a0) /// Quotations cannot contain uses of generic expressions - /// (Originally from ../FSComp.txt:281) + /// (Originally from ..\FSComp.txt:281) static member crefQuotationsCantContainGenericExprs() = (447, GetStringFunc("crefQuotationsCantContainGenericExprs",",,,") ) /// Quotations cannot contain function definitions that are inferred or declared to be generic. Consider adding some type constraints to make this a valid quoted expression. - /// (Originally from ../FSComp.txt:282) + /// (Originally from ..\FSComp.txt:282) static member crefQuotationsCantContainGenericFunctions() = (448, GetStringFunc("crefQuotationsCantContainGenericFunctions",",,,") ) /// Quotations cannot contain object expressions - /// (Originally from ../FSComp.txt:283) + /// (Originally from ..\FSComp.txt:283) static member crefQuotationsCantContainObjExprs() = (449, GetStringFunc("crefQuotationsCantContainObjExprs",",,,") ) /// Quotations cannot contain expressions that take the address of a field - /// (Originally from ../FSComp.txt:284) + /// (Originally from ..\FSComp.txt:284) static member crefQuotationsCantContainAddressOf() = (450, GetStringFunc("crefQuotationsCantContainAddressOf",",,,") ) /// Quotations cannot contain expressions that fetch static fields - /// (Originally from ../FSComp.txt:285) + /// (Originally from ..\FSComp.txt:285) static member crefQuotationsCantContainStaticFieldRef() = (451, GetStringFunc("crefQuotationsCantContainStaticFieldRef",",,,") ) /// Quotations cannot contain inline assembly code or pattern matching on arrays - /// (Originally from ../FSComp.txt:286) + /// (Originally from ..\FSComp.txt:286) static member crefQuotationsCantContainInlineIL() = (452, GetStringFunc("crefQuotationsCantContainInlineIL",",,,") ) /// Quotations cannot contain descending for loops - /// (Originally from ../FSComp.txt:287) + /// (Originally from ..\FSComp.txt:287) static member crefQuotationsCantContainDescendingForLoops() = (453, GetStringFunc("crefQuotationsCantContainDescendingForLoops",",,,") ) /// Quotations cannot contain expressions that fetch union case indexes - /// (Originally from ../FSComp.txt:288) + /// (Originally from ..\FSComp.txt:288) static member crefQuotationsCantFetchUnionIndexes() = (454, GetStringFunc("crefQuotationsCantFetchUnionIndexes",",,,") ) /// Quotations cannot contain expressions that set union case fields - /// (Originally from ../FSComp.txt:289) + /// (Originally from ..\FSComp.txt:289) static member crefQuotationsCantSetUnionFields() = (455, GetStringFunc("crefQuotationsCantSetUnionFields",",,,") ) /// Quotations cannot contain expressions that set fields in exception values - /// (Originally from ../FSComp.txt:290) + /// (Originally from ..\FSComp.txt:290) static member crefQuotationsCantSetExceptionFields() = (456, GetStringFunc("crefQuotationsCantSetExceptionFields",",,,") ) /// Quotations cannot contain expressions that require byref pointers - /// (Originally from ../FSComp.txt:291) + /// (Originally from ..\FSComp.txt:291) static member crefQuotationsCantRequireByref() = (457, GetStringFunc("crefQuotationsCantRequireByref",",,,") ) /// Quotations cannot contain expressions that make member constraint calls, or uses of operators that implicitly resolve to a member constraint call - /// (Originally from ../FSComp.txt:292) + /// (Originally from ..\FSComp.txt:292) static member crefQuotationsCantCallTraitMembers() = (458, GetStringFunc("crefQuotationsCantCallTraitMembers",",,,") ) /// Quotations cannot contain this kind of constant - /// (Originally from ../FSComp.txt:293) + /// (Originally from ..\FSComp.txt:293) static member crefQuotationsCantContainThisConstant() = (459, GetStringFunc("crefQuotationsCantContainThisConstant",",,,") ) /// Quotations cannot contain this kind of pattern match - /// (Originally from ../FSComp.txt:294) + /// (Originally from ..\FSComp.txt:294) static member crefQuotationsCantContainThisPatternMatch() = (460, GetStringFunc("crefQuotationsCantContainThisPatternMatch",",,,") ) /// Quotations cannot contain array pattern matching - /// (Originally from ../FSComp.txt:295) + /// (Originally from ..\FSComp.txt:295) static member crefQuotationsCantContainArrayPatternMatching() = (461, GetStringFunc("crefQuotationsCantContainArrayPatternMatching",",,,") ) /// Quotations cannot contain this kind of type - /// (Originally from ../FSComp.txt:296) + /// (Originally from ..\FSComp.txt:296) static member crefQuotationsCantContainThisType() = (462, GetStringFunc("crefQuotationsCantContainThisType",",,,") ) /// The declared type parameter '%s' cannot be used here since the type parameter cannot be resolved at compile time - /// (Originally from ../FSComp.txt:297) + /// (Originally from ..\FSComp.txt:297) static member csTypeCannotBeResolvedAtCompileTime(a0 : System.String) = (GetStringFunc("csTypeCannotBeResolvedAtCompileTime",",,,%s,,,") a0) /// 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 '_'. - /// (Originally from ../FSComp.txt:298) + /// (Originally from ..\FSComp.txt:298) static member csCodeLessGeneric() = (464, GetStringFunc("csCodeLessGeneric",",,,") ) /// Type inference problem too complicated (maximum iteration depth reached). Consider adding further type annotations. - /// (Originally from ../FSComp.txt:299) + /// (Originally from ..\FSComp.txt:299) static member csTypeInferenceMaxDepth() = (465, GetStringFunc("csTypeInferenceMaxDepth",",,,") ) /// Expected arguments to an instance member - /// (Originally from ../FSComp.txt:300) + /// (Originally from ..\FSComp.txt:300) static member csExpectedArguments() = (GetStringFunc("csExpectedArguments",",,,") ) /// This indexer expects %d arguments but is here given %d - /// (Originally from ../FSComp.txt:301) + /// (Originally from ..\FSComp.txt:301) static member csIndexArgumentMismatch(a0 : System.Int32, a1 : System.Int32) = (GetStringFunc("csIndexArgumentMismatch",",,,%d,,,%d,,,") a0 a1) /// Expecting a type supporting the operator '%s' but given a function type. You may be missing an argument to a function. - /// (Originally from ../FSComp.txt:302) + /// (Originally from ..\FSComp.txt:302) static member csExpectTypeWithOperatorButGivenFunction(a0 : System.String) = (GetStringFunc("csExpectTypeWithOperatorButGivenFunction",",,,%s,,,") a0) /// Expecting a type supporting the operator '%s' but given a tuple type - /// (Originally from ../FSComp.txt:303) + /// (Originally from ..\FSComp.txt:303) static member csExpectTypeWithOperatorButGivenTuple(a0 : System.String) = (GetStringFunc("csExpectTypeWithOperatorButGivenTuple",",,,%s,,,") a0) /// None of the types '%s' support the operator '%s' - /// (Originally from ../FSComp.txt:304) + /// (Originally from ..\FSComp.txt:304) static member csTypesDoNotSupportOperator(a0 : System.String, a1 : System.String) = (GetStringFunc("csTypesDoNotSupportOperator",",,,%s,,,%s,,,") a0 a1) /// The type '%s' does not support the operator '%s' - /// (Originally from ../FSComp.txt:305) + /// (Originally from ..\FSComp.txt:305) static member csTypeDoesNotSupportOperator(a0 : System.String, a1 : System.String) = (GetStringFunc("csTypeDoesNotSupportOperator",",,,%s,,,%s,,,") a0 a1) /// None of the types '%s' support the operator '%s'. Consider opening the module 'Microsoft.FSharp.Linq.NullableOperators'. - /// (Originally from ../FSComp.txt:306) + /// (Originally from ..\FSComp.txt:306) static member csTypesDoNotSupportOperatorNullable(a0 : System.String, a1 : System.String) = (GetStringFunc("csTypesDoNotSupportOperatorNullable",",,,%s,,,%s,,,") a0 a1) /// The type '%s' does not support the operator '%s'. Consider opening the module 'Microsoft.FSharp.Linq.NullableOperators'. - /// (Originally from ../FSComp.txt:307) + /// (Originally from ..\FSComp.txt:307) static member csTypeDoesNotSupportOperatorNullable(a0 : System.String, a1 : System.String) = (GetStringFunc("csTypeDoesNotSupportOperatorNullable",",,,%s,,,%s,,,") a0 a1) /// The type '%s' does not support a conversion to the type '%s' - /// (Originally from ../FSComp.txt:308) + /// (Originally from ..\FSComp.txt:308) static member csTypeDoesNotSupportConversion(a0 : System.String, a1 : System.String) = (GetStringFunc("csTypeDoesNotSupportConversion",",,,%s,,,%s,,,") a0 a1) /// The type '%s' has a method '%s' (full name '%s'), but the method is static - /// (Originally from ../FSComp.txt:309) + /// (Originally from ..\FSComp.txt:309) static member csMethodFoundButIsStatic(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("csMethodFoundButIsStatic",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// The type '%s' has a method '%s' (full name '%s'), but the method is not static - /// (Originally from ../FSComp.txt:310) + /// (Originally from ..\FSComp.txt:310) static member csMethodFoundButIsNotStatic(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("csMethodFoundButIsNotStatic",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// The constraints 'struct' and 'not struct' are inconsistent - /// (Originally from ../FSComp.txt:311) + /// (Originally from ..\FSComp.txt:311) static member csStructConstraintInconsistent() = (472, GetStringFunc("csStructConstraintInconsistent",",,,") ) /// The type '%s' does not have 'null' as a proper value - /// (Originally from ../FSComp.txt:312) + /// (Originally from ..\FSComp.txt:312) static member csTypeDoesNotHaveNull(a0 : System.String) = (GetStringFunc("csTypeDoesNotHaveNull",",,,%s,,,") a0) /// The type '%s' does not have 'null' as a proper value. To create a null value for a Nullable type use 'System.Nullable()'. - /// (Originally from ../FSComp.txt:313) + /// (Originally from ..\FSComp.txt:313) static member csNullableTypeDoesNotHaveNull(a0 : System.String) = (GetStringFunc("csNullableTypeDoesNotHaveNull",",,,%s,,,") a0) /// The type '%s' does not support the 'comparison' constraint because it has the 'NoComparison' attribute - /// (Originally from ../FSComp.txt:314) + /// (Originally from ..\FSComp.txt:314) static member csTypeDoesNotSupportComparison1(a0 : System.String) = (GetStringFunc("csTypeDoesNotSupportComparison1",",,,%s,,,") a0) /// The type '%s' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface - /// (Originally from ../FSComp.txt:315) + /// (Originally from ..\FSComp.txt:315) static member csTypeDoesNotSupportComparison2(a0 : System.String) = (GetStringFunc("csTypeDoesNotSupportComparison2",",,,%s,,,") a0) /// The type '%s' does not support the 'comparison' constraint because it is a record, union or struct with one or more structural element types which do not support the 'comparison' constraint. Either avoid the use of comparison with this type, or add the 'StructuralComparison' attribute to the type to determine which field type does not support comparison - /// (Originally from ../FSComp.txt:316) + /// (Originally from ..\FSComp.txt:316) static member csTypeDoesNotSupportComparison3(a0 : System.String) = (GetStringFunc("csTypeDoesNotSupportComparison3",",,,%s,,,") a0) /// The type '%s' does not support the 'equality' constraint because it has the 'NoEquality' attribute - /// (Originally from ../FSComp.txt:317) + /// (Originally from ..\FSComp.txt:317) static member csTypeDoesNotSupportEquality1(a0 : System.String) = (GetStringFunc("csTypeDoesNotSupportEquality1",",,,%s,,,") a0) /// The type '%s' does not support the 'equality' constraint because it is a function type - /// (Originally from ../FSComp.txt:318) + /// (Originally from ..\FSComp.txt:318) static member csTypeDoesNotSupportEquality2(a0 : System.String) = (GetStringFunc("csTypeDoesNotSupportEquality2",",,,%s,,,") a0) /// The type '%s' does not support the 'equality' constraint because it is a record, union or struct with one or more structural element types which do not support the 'equality' constraint. Either avoid the use of equality with this type, or add the 'StructuralEquality' attribute to the type to determine which field type does not support equality - /// (Originally from ../FSComp.txt:319) + /// (Originally from ..\FSComp.txt:319) static member csTypeDoesNotSupportEquality3(a0 : System.String) = (GetStringFunc("csTypeDoesNotSupportEquality3",",,,%s,,,") a0) /// The type '%s' is not a CLI enum type - /// (Originally from ../FSComp.txt:320) + /// (Originally from ..\FSComp.txt:320) static member csTypeIsNotEnumType(a0 : System.String) = (GetStringFunc("csTypeIsNotEnumType",",,,%s,,,") a0) /// The type '%s' has a non-standard delegate type - /// (Originally from ../FSComp.txt:321) + /// (Originally from ..\FSComp.txt:321) static member csTypeHasNonStandardDelegateType(a0 : System.String) = (GetStringFunc("csTypeHasNonStandardDelegateType",",,,%s,,,") a0) /// The type '%s' is not a CLI delegate type - /// (Originally from ../FSComp.txt:322) + /// (Originally from ..\FSComp.txt:322) static member csTypeIsNotDelegateType(a0 : System.String) = (GetStringFunc("csTypeIsNotDelegateType",",,,%s,,,") a0) /// This type parameter cannot be instantiated to 'Nullable'. This is a restriction imposed in order to ensure the meaning of 'null' in some CLI languages is not confusing when used in conjunction with 'Nullable' values. - /// (Originally from ../FSComp.txt:323) + /// (Originally from ..\FSComp.txt:323) static member csTypeParameterCannotBeNullable() = (GetStringFunc("csTypeParameterCannotBeNullable",",,,") ) /// A generic construct requires that the type '%s' is a CLI or F# struct type - /// (Originally from ../FSComp.txt:324) + /// (Originally from ..\FSComp.txt:324) static member csGenericConstructRequiresStructType(a0 : System.String) = (GetStringFunc("csGenericConstructRequiresStructType",",,,%s,,,") a0) /// A generic construct requires that the type '%s' is an unmanaged type - /// (Originally from ../FSComp.txt:325) + /// (Originally from ..\FSComp.txt:325) static member csGenericConstructRequiresUnmanagedType(a0 : System.String) = (GetStringFunc("csGenericConstructRequiresUnmanagedType",",,,%s,,,") a0) /// The type '%s' is not compatible with any of the types %s, arising from the use of a printf-style format string - /// (Originally from ../FSComp.txt:326) + /// (Originally from ..\FSComp.txt:326) static member csTypeNotCompatibleBecauseOfPrintf(a0 : System.String, a1 : System.String) = (GetStringFunc("csTypeNotCompatibleBecauseOfPrintf",",,,%s,,,%s,,,") a0 a1) /// A generic construct requires that the type '%s' have reference semantics, but it does not, i.e. it is a struct - /// (Originally from ../FSComp.txt:327) + /// (Originally from ..\FSComp.txt:327) static member csGenericConstructRequiresReferenceSemantics(a0 : System.String) = (GetStringFunc("csGenericConstructRequiresReferenceSemantics",",,,%s,,,") a0) /// A generic construct requires that the type '%s' be non-abstract - /// (Originally from ../FSComp.txt:328) + /// (Originally from ..\FSComp.txt:328) static member csGenericConstructRequiresNonAbstract(a0 : System.String) = (GetStringFunc("csGenericConstructRequiresNonAbstract",",,,%s,,,") a0) /// A generic construct requires that the type '%s' have a public default constructor - /// (Originally from ../FSComp.txt:329) + /// (Originally from ..\FSComp.txt:329) static member csGenericConstructRequiresPublicDefaultConstructor(a0 : System.String) = (GetStringFunc("csGenericConstructRequiresPublicDefaultConstructor",",,,%s,,,") a0) /// Type instantiation length mismatch - /// (Originally from ../FSComp.txt:330) + /// (Originally from ..\FSComp.txt:330) static member csTypeInstantiationLengthMismatch() = (483, GetStringFunc("csTypeInstantiationLengthMismatch",",,,") ) /// Optional arguments not permitted here - /// (Originally from ../FSComp.txt:331) + /// (Originally from ..\FSComp.txt:331) static member csOptionalArgumentNotPermittedHere() = (484, GetStringFunc("csOptionalArgumentNotPermittedHere",",,,") ) /// %s is not a static member - /// (Originally from ../FSComp.txt:332) + /// (Originally from ..\FSComp.txt:332) static member csMemberIsNotStatic(a0 : System.String) = (485, GetStringFunc("csMemberIsNotStatic",",,,%s,,,") a0) /// %s is not an instance member - /// (Originally from ../FSComp.txt:333) + /// (Originally from ..\FSComp.txt:333) static member csMemberIsNotInstance(a0 : System.String) = (486, GetStringFunc("csMemberIsNotInstance",",,,%s,,,") a0) /// Argument length mismatch - /// (Originally from ../FSComp.txt:334) + /// (Originally from ..\FSComp.txt:334) static member csArgumentLengthMismatch() = (487, GetStringFunc("csArgumentLengthMismatch",",,,") ) /// The argument types don't match - /// (Originally from ../FSComp.txt:335) + /// (Originally from ..\FSComp.txt:335) static member csArgumentTypesDoNotMatch() = (488, GetStringFunc("csArgumentTypesDoNotMatch",",,,") ) /// This method expects a CLI 'params' parameter in this position. 'params' is a way of passing a variable number of arguments to a method in languages such as C#. Consider passing an array for this argument - /// (Originally from ../FSComp.txt:336) + /// (Originally from ..\FSComp.txt:336) static member csMethodExpectsParams() = (489, GetStringFunc("csMethodExpectsParams",",,,") ) /// The member or object constructor '%s' is not %s - /// (Originally from ../FSComp.txt:337) + /// (Originally from ..\FSComp.txt:337) static member csMemberIsNotAccessible(a0 : System.String, a1 : System.String) = (490, GetStringFunc("csMemberIsNotAccessible",",,,%s,,,%s,,,") a0 a1) /// The member or object constructor '%s' is not %s. 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. - /// (Originally from ../FSComp.txt:338) + /// (Originally from ..\FSComp.txt:338) static member csMemberIsNotAccessible2(a0 : System.String, a1 : System.String) = (491, GetStringFunc("csMemberIsNotAccessible2",",,,%s,,,%s,,,") a0 a1) /// %s is not a static method - /// (Originally from ../FSComp.txt:339) + /// (Originally from ..\FSComp.txt:339) static member csMethodIsNotAStaticMethod(a0 : System.String) = (492, GetStringFunc("csMethodIsNotAStaticMethod",",,,%s,,,") a0) /// %s is not an instance method - /// (Originally from ../FSComp.txt:340) + /// (Originally from ..\FSComp.txt:340) static member csMethodIsNotAnInstanceMethod(a0 : System.String) = (493, GetStringFunc("csMethodIsNotAnInstanceMethod",",,,%s,,,") a0) /// The member or object constructor '%s' has no argument or settable return property '%s'. %s. - /// (Originally from ../FSComp.txt:341) + /// (Originally from ..\FSComp.txt:341) static member csMemberHasNoArgumentOrReturnProperty(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("csMemberHasNoArgumentOrReturnProperty",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// The object constructor '%s' has no argument or settable return property '%s'. %s. - /// (Originally from ../FSComp.txt:342) + /// (Originally from ..\FSComp.txt:342) static member csCtorHasNoArgumentOrReturnProperty(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("csCtorHasNoArgumentOrReturnProperty",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// The required signature is %s - /// (Originally from ../FSComp.txt:343) + /// (Originally from ..\FSComp.txt:343) static member csRequiredSignatureIs(a0 : System.String) = (495, GetStringFunc("csRequiredSignatureIs",",,,%s,,,") a0) /// The member or object constructor '%s' requires %d argument(s). The required signature is '%s'. - /// (Originally from ../FSComp.txt:344) + /// (Originally from ..\FSComp.txt:344) static member csMemberSignatureMismatch(a0 : System.String, a1 : System.Int32, a2 : System.String) = (496, GetStringFunc("csMemberSignatureMismatch",",,,%s,,,%d,,,%s,,,") a0 a1 a2) /// The member or object constructor '%s' requires %d additional argument(s). The required signature is '%s'. - /// (Originally from ../FSComp.txt:345) + /// (Originally from ..\FSComp.txt:345) static member csMemberSignatureMismatch2(a0 : System.String, a1 : System.Int32, a2 : System.String) = (497, GetStringFunc("csMemberSignatureMismatch2",",,,%s,,,%d,,,%s,,,") a0 a1 a2) /// The member or object constructor '%s' requires %d argument(s). The required signature is '%s'. Some names for missing arguments are %s. - /// (Originally from ../FSComp.txt:346) + /// (Originally from ..\FSComp.txt:346) static member csMemberSignatureMismatch3(a0 : System.String, a1 : System.Int32, a2 : System.String, a3 : System.String) = (498, GetStringFunc("csMemberSignatureMismatch3",",,,%s,,,%d,,,%s,,,%s,,,") a0 a1 a2 a3) /// The member or object constructor '%s' requires %d additional argument(s). The required signature is '%s'. Some names for missing arguments are %s. - /// (Originally from ../FSComp.txt:347) + /// (Originally from ..\FSComp.txt:347) static member csMemberSignatureMismatch4(a0 : System.String, a1 : System.Int32, a2 : System.String, a3 : System.String) = (499, GetStringFunc("csMemberSignatureMismatch4",",,,%s,,,%d,,,%s,,,%s,,,") a0 a1 a2 a3) /// The member or object constructor '%s' requires %d argument(s) but is here given %d unnamed and %d named argument(s). The required signature is '%s'. - /// (Originally from ../FSComp.txt:348) + /// (Originally from ..\FSComp.txt:348) static member csMemberSignatureMismatchArityNamed(a0 : System.String, a1 : System.Int32, a2 : System.Int32, a3 : System.Int32, a4 : System.String) = (500, GetStringFunc("csMemberSignatureMismatchArityNamed",",,,%s,,,%d,,,%d,,,%d,,,%s,,,") a0 a1 a2 a3 a4) /// The member or object constructor '%s' takes %d argument(s) but is here given %d. The required signature is '%s'. - /// (Originally from ../FSComp.txt:349) + /// (Originally from ..\FSComp.txt:349) static member csMemberSignatureMismatchArity(a0 : System.String, a1 : System.Int32, a2 : System.Int32, a3 : System.String) = (501, GetStringFunc("csMemberSignatureMismatchArity",",,,%s,,,%d,,,%d,,,%s,,,") a0 a1 a2 a3) /// The object constructor '%s' takes %d argument(s) but is here given %d. The required signature is '%s'. - /// (Originally from ../FSComp.txt:350) + /// (Originally from ..\FSComp.txt:350) static member csCtorSignatureMismatchArity(a0 : System.String, a1 : System.Int32, a2 : System.Int32, a3 : System.String) = (501, GetStringFunc("csCtorSignatureMismatchArity",",,,%s,,,%d,,,%d,,,%s,,,") a0 a1 a2 a3) /// The object constructor '%s' takes %d argument(s) but is here given %d. The required signature is '%s'. If some of the arguments are meant to assign values to properties, consider separating those arguments with a comma (','). - /// (Originally from ../FSComp.txt:351) + /// (Originally from ..\FSComp.txt:351) static member csCtorSignatureMismatchArityProp(a0 : System.String, a1 : System.Int32, a2 : System.Int32, a3 : System.String) = (501, GetStringFunc("csCtorSignatureMismatchArityProp",",,,%s,,,%d,,,%d,,,%s,,,") a0 a1 a2 a3) /// The member or object constructor '%s' takes %d type argument(s) but is here given %d. The required signature is '%s'. - /// (Originally from ../FSComp.txt:352) + /// (Originally from ..\FSComp.txt:352) static member csMemberSignatureMismatchArityType(a0 : System.String, a1 : System.Int32, a2 : System.Int32, a3 : System.String) = (502, GetStringFunc("csMemberSignatureMismatchArityType",",,,%s,,,%d,,,%d,,,%s,,,") a0 a1 a2 a3) /// A member or object constructor '%s' taking %d arguments is not accessible from this code location. All accessible versions of method '%s' take %d arguments. - /// (Originally from ../FSComp.txt:353) + /// (Originally from ..\FSComp.txt:353) static member csMemberNotAccessible(a0 : System.String, a1 : System.Int32, a2 : System.String, a3 : System.Int32) = (503, GetStringFunc("csMemberNotAccessible",",,,%s,,,%d,,,%s,,,%d,,,") a0 a1 a2 a3) /// Incorrect generic instantiation. No %s member named '%s' takes %d generic arguments. - /// (Originally from ../FSComp.txt:354) + /// (Originally from ..\FSComp.txt:354) static member csIncorrectGenericInstantiation(a0 : System.String, a1 : System.String, a2 : System.Int32) = (504, GetStringFunc("csIncorrectGenericInstantiation",",,,%s,,,%s,,,%d,,,") a0 a1 a2) /// The member or object constructor '%s' does not take %d argument(s). An overload was found taking %d arguments. - /// (Originally from ../FSComp.txt:355) + /// (Originally from ..\FSComp.txt:355) static member csMemberOverloadArityMismatch(a0 : System.String, a1 : System.Int32, a2 : System.Int32) = (505, GetStringFunc("csMemberOverloadArityMismatch",",,,%s,,,%d,,,%d,,,") a0 a1 a2) /// No %s member or object constructor named '%s' takes %d arguments - /// (Originally from ../FSComp.txt:356) + /// (Originally from ..\FSComp.txt:356) static member csNoMemberTakesTheseArguments(a0 : System.String, a1 : System.String, a2 : System.Int32) = (506, GetStringFunc("csNoMemberTakesTheseArguments",",,,%s,,,%s,,,%d,,,") a0 a1 a2) /// No %s member or object constructor named '%s' takes %d arguments. Note the call to this member also provides %d named arguments. - /// (Originally from ../FSComp.txt:357) + /// (Originally from ..\FSComp.txt:357) static member csNoMemberTakesTheseArguments2(a0 : System.String, a1 : System.String, a2 : System.Int32, a3 : System.Int32) = (507, GetStringFunc("csNoMemberTakesTheseArguments2",",,,%s,,,%s,,,%d,,,%d,,,") a0 a1 a2 a3) /// No %s member or object constructor named '%s' takes %d arguments. The named argument '%s' doesn't correspond to any argument or settable return property for any overload. - /// (Originally from ../FSComp.txt:358) + /// (Originally from ..\FSComp.txt:358) static member csNoMemberTakesTheseArguments3(a0 : System.String, a1 : System.String, a2 : System.Int32, a3 : System.String) = (508, GetStringFunc("csNoMemberTakesTheseArguments3",",,,%s,,,%s,,,%d,,,%s,,,") a0 a1 a2 a3) /// Method or object constructor '%s' not found - /// (Originally from ../FSComp.txt:359) + /// (Originally from ..\FSComp.txt:359) static member csMethodNotFound(a0 : System.String) = (509, GetStringFunc("csMethodNotFound",",,,%s,,,") a0) /// No overloads match for method '%s'. - /// (Originally from ../FSComp.txt:360) + /// (Originally from ..\FSComp.txt:360) static member csNoOverloadsFound(a0 : System.String) = (GetStringFunc("csNoOverloadsFound",",,,%s,,,") a0) /// A unique overload for method '%s' could not be determined based on type information prior to this program point. A type annotation may be needed. - /// (Originally from ../FSComp.txt:361) + /// (Originally from ..\FSComp.txt:361) static member csMethodIsOverloaded(a0 : System.String) = (GetStringFunc("csMethodIsOverloaded",",,,%s,,,") a0) /// Candidates: %s - /// (Originally from ../FSComp.txt:362) + /// (Originally from ..\FSComp.txt:362) static member csCandidates(a0 : System.String) = (GetStringFunc("csCandidates",",,,%s,,,") a0) /// The available overloads are shown below. - /// (Originally from ../FSComp.txt:363) + /// (Originally from ..\FSComp.txt:363) static member csSeeAvailableOverloads() = (GetStringFunc("csSeeAvailableOverloads",",,,") ) /// Accessibility modifiers are not permitted on 'do' bindings, but '%s' was given. - /// (Originally from ../FSComp.txt:364) + /// (Originally from ..\FSComp.txt:364) static member parsDoCannotHaveVisibilityDeclarations(a0 : System.String) = (512, GetStringFunc("parsDoCannotHaveVisibilityDeclarations",",,,%s,,,") a0) /// End of file in #if section begun at or after here - /// (Originally from ../FSComp.txt:365) + /// (Originally from ..\FSComp.txt:365) static member parsEofInHashIf() = (513, GetStringFunc("parsEofInHashIf",",,,") ) /// End of file in string begun at or before here - /// (Originally from ../FSComp.txt:366) + /// (Originally from ..\FSComp.txt:366) static member parsEofInString() = (514, GetStringFunc("parsEofInString",",,,") ) /// End of file in verbatim string begun at or before here - /// (Originally from ../FSComp.txt:367) + /// (Originally from ..\FSComp.txt:367) static member parsEofInVerbatimString() = (515, GetStringFunc("parsEofInVerbatimString",",,,") ) /// End of file in comment begun at or before here - /// (Originally from ../FSComp.txt:368) + /// (Originally from ..\FSComp.txt:368) static member parsEofInComment() = (516, GetStringFunc("parsEofInComment",",,,") ) /// End of file in string embedded in comment begun at or before here - /// (Originally from ../FSComp.txt:369) + /// (Originally from ..\FSComp.txt:369) static member parsEofInStringInComment() = (517, GetStringFunc("parsEofInStringInComment",",,,") ) /// End of file in verbatim string embedded in comment begun at or before here - /// (Originally from ../FSComp.txt:370) + /// (Originally from ..\FSComp.txt:370) static member parsEofInVerbatimStringInComment() = (518, GetStringFunc("parsEofInVerbatimStringInComment",",,,") ) /// End of file in IF-OCAML section begun at or before here - /// (Originally from ../FSComp.txt:371) + /// (Originally from ..\FSComp.txt:371) static member parsEofInIfOcaml() = (519, GetStringFunc("parsEofInIfOcaml",",,,") ) /// End of file in directive begun at or before here - /// (Originally from ../FSComp.txt:372) + /// (Originally from ..\FSComp.txt:372) static member parsEofInDirective() = (520, GetStringFunc("parsEofInDirective",",,,") ) /// No #endif found for #if or #else - /// (Originally from ../FSComp.txt:373) + /// (Originally from ..\FSComp.txt:373) static member parsNoHashEndIfFound() = (521, GetStringFunc("parsNoHashEndIfFound",",,,") ) /// Attributes have been ignored in this construct - /// (Originally from ../FSComp.txt:374) + /// (Originally from ..\FSComp.txt:374) static member parsAttributesIgnored() = (522, GetStringFunc("parsAttributesIgnored",",,,") ) /// 'use' bindings are not permitted in primary constructors - /// (Originally from ../FSComp.txt:375) + /// (Originally from ..\FSComp.txt:375) static member parsUseBindingsIllegalInImplicitClassConstructors() = (523, GetStringFunc("parsUseBindingsIllegalInImplicitClassConstructors",",,,") ) /// 'use' bindings are not permitted in modules and are treated as 'let' bindings - /// (Originally from ../FSComp.txt:376) + /// (Originally from ..\FSComp.txt:376) static member parsUseBindingsIllegalInModules() = (524, GetStringFunc("parsUseBindingsIllegalInModules",",,,") ) /// An integer for loop must use a simple identifier - /// (Originally from ../FSComp.txt:377) + /// (Originally from ..\FSComp.txt:377) static member parsIntegerForLoopRequiresSimpleIdentifier() = (525, GetStringFunc("parsIntegerForLoopRequiresSimpleIdentifier",",,,") ) /// At most one 'with' augmentation is permitted - /// (Originally from ../FSComp.txt:378) + /// (Originally from ..\FSComp.txt:378) static member parsOnlyOneWithAugmentationAllowed() = (526, GetStringFunc("parsOnlyOneWithAugmentationAllowed",",,,") ) /// A semicolon is not expected at this point - /// (Originally from ../FSComp.txt:379) + /// (Originally from ..\FSComp.txt:379) static member parsUnexpectedSemicolon() = (527, GetStringFunc("parsUnexpectedSemicolon",",,,") ) /// Unexpected end of input - /// (Originally from ../FSComp.txt:380) + /// (Originally from ..\FSComp.txt:380) static member parsUnexpectedEndOfFile() = (528, GetStringFunc("parsUnexpectedEndOfFile",",,,") ) /// Accessibility modifiers are not permitted here, but '%s' was given. - /// (Originally from ../FSComp.txt:381) + /// (Originally from ..\FSComp.txt:381) static member parsUnexpectedVisibilityDeclaration(a0 : System.String) = (529, GetStringFunc("parsUnexpectedVisibilityDeclaration",",,,%s,,,") a0) /// Only '#' compiler directives may occur prior to the first 'namespace' declaration - /// (Originally from ../FSComp.txt:382) + /// (Originally from ..\FSComp.txt:382) static member parsOnlyHashDirectivesAllowed() = (530, GetStringFunc("parsOnlyHashDirectivesAllowed",",,,") ) /// Accessibility modifiers should come immediately prior to the identifier naming a construct - /// (Originally from ../FSComp.txt:383) + /// (Originally from ..\FSComp.txt:383) static member parsVisibilityDeclarationsShouldComePriorToIdentifier() = (531, GetStringFunc("parsVisibilityDeclarationsShouldComePriorToIdentifier",",,,") ) /// Files should begin with either a namespace or module declaration, e.g. 'namespace SomeNamespace.SubNamespace' or 'module SomeNamespace.SomeModule', but not both. To define a module within a namespace use 'module SomeModule = ...' - /// (Originally from ../FSComp.txt:384) + /// (Originally from ..\FSComp.txt:384) static member parsNamespaceOrModuleNotBoth() = (532, GetStringFunc("parsNamespaceOrModuleNotBoth",",,,") ) /// A module abbreviation must be a simple name, not a path - /// (Originally from ../FSComp.txt:385) + /// (Originally from ..\FSComp.txt:385) static member parsModuleAbbreviationMustBeSimpleName() = (534, GetStringFunc("parsModuleAbbreviationMustBeSimpleName",",,,") ) /// Ignoring attributes on module abbreviation - /// (Originally from ../FSComp.txt:386) + /// (Originally from ..\FSComp.txt:386) static member parsIgnoreAttributesOnModuleAbbreviation() = (535, GetStringFunc("parsIgnoreAttributesOnModuleAbbreviation",",,,") ) /// The '%s' accessibility attribute is not allowed on module abbreviation. Module abbreviations are always private. - /// (Originally from ../FSComp.txt:387) + /// (Originally from ..\FSComp.txt:387) static member parsIgnoreAttributesOnModuleAbbreviationAlwaysPrivate(a0 : System.String) = (536, GetStringFunc("parsIgnoreAttributesOnModuleAbbreviationAlwaysPrivate",",,,%s,,,") a0) /// The '%s' visibility attribute is not allowed on module abbreviation. Module abbreviations are always private. - /// (Originally from ../FSComp.txt:388) + /// (Originally from ..\FSComp.txt:388) static member parsIgnoreVisibilityOnModuleAbbreviationAlwaysPrivate(a0 : System.String) = (537, GetStringFunc("parsIgnoreVisibilityOnModuleAbbreviationAlwaysPrivate",",,,%s,,,") a0) /// Unclosed block - /// (Originally from ../FSComp.txt:389) + /// (Originally from ..\FSComp.txt:389) static member parsUnClosedBlockInHashLight() = (538, GetStringFunc("parsUnClosedBlockInHashLight",",,,") ) /// Unmatched 'begin' or 'struct' - /// (Originally from ../FSComp.txt:390) + /// (Originally from ..\FSComp.txt:390) static member parsUnmatchedBeginOrStruct() = (539, GetStringFunc("parsUnmatchedBeginOrStruct",",,,") ) /// A module name must be a simple name, not a path - /// (Originally from ../FSComp.txt:391) + /// (Originally from ..\FSComp.txt:391) static member parsModuleDefnMustBeSimpleName() = (541, GetStringFunc("parsModuleDefnMustBeSimpleName",",,,") ) /// Unexpected empty type moduleDefn list - /// (Originally from ../FSComp.txt:392) + /// (Originally from ..\FSComp.txt:392) static member parsUnexpectedEmptyModuleDefn() = (542, GetStringFunc("parsUnexpectedEmptyModuleDefn",",,,") ) /// Attributes should be placed before 'val' - /// (Originally from ../FSComp.txt:393) + /// (Originally from ..\FSComp.txt:393) static member parsAttributesMustComeBeforeVal() = (GetStringFunc("parsAttributesMustComeBeforeVal",",,,") ) /// Attributes are not permitted on interface implementations - /// (Originally from ../FSComp.txt:394) + /// (Originally from ..\FSComp.txt:394) static member parsAttributesAreNotPermittedOnInterfaceImplementations() = (543, GetStringFunc("parsAttributesAreNotPermittedOnInterfaceImplementations",",,,") ) /// Syntax error - /// (Originally from ../FSComp.txt:395) + /// (Originally from ..\FSComp.txt:395) static member parsSyntaxError() = (544, GetStringFunc("parsSyntaxError",",,,") ) /// Augmentations are not permitted on delegate type moduleDefns - /// (Originally from ../FSComp.txt:396) + /// (Originally from ..\FSComp.txt:396) static member parsAugmentationsIllegalOnDelegateType() = (545, GetStringFunc("parsAugmentationsIllegalOnDelegateType",",,,") ) /// Unmatched 'class', 'interface' or 'struct' - /// (Originally from ../FSComp.txt:397) + /// (Originally from ..\FSComp.txt:397) static member parsUnmatchedClassInterfaceOrStruct() = (546, GetStringFunc("parsUnmatchedClassInterfaceOrStruct",",,,") ) /// A type definition requires one or more members or other declarations. If you intend to define an empty class, struct or interface, then use 'type ... = class end', 'interface end' or 'struct end'. - /// (Originally from ../FSComp.txt:398) + /// (Originally from ..\FSComp.txt:398) static member parsEmptyTypeDefinition() = (547, GetStringFunc("parsEmptyTypeDefinition",",,,") ) /// Unmatched 'with' or badly formatted 'with' block - /// (Originally from ../FSComp.txt:399) + /// (Originally from ..\FSComp.txt:399) static member parsUnmatchedWith() = (550, GetStringFunc("parsUnmatchedWith",",,,") ) /// 'get', 'set' or 'get,set' required - /// (Originally from ../FSComp.txt:400) + /// (Originally from ..\FSComp.txt:400) static member parsGetOrSetRequired() = (551, GetStringFunc("parsGetOrSetRequired",",,,") ) /// Only class types may take value arguments - /// (Originally from ../FSComp.txt:401) + /// (Originally from ..\FSComp.txt:401) static member parsOnlyClassCanTakeValueArguments() = (552, GetStringFunc("parsOnlyClassCanTakeValueArguments",",,,") ) /// Unmatched 'begin' - /// (Originally from ../FSComp.txt:402) + /// (Originally from ..\FSComp.txt:402) static member parsUnmatchedBegin() = (553, GetStringFunc("parsUnmatchedBegin",",,,") ) /// Invalid declaration syntax - /// (Originally from ../FSComp.txt:403) + /// (Originally from ..\FSComp.txt:403) static member parsInvalidDeclarationSyntax() = (554, GetStringFunc("parsInvalidDeclarationSyntax",",,,") ) /// 'get' and/or 'set' required - /// (Originally from ../FSComp.txt:404) + /// (Originally from ..\FSComp.txt:404) static member parsGetAndOrSetRequired() = (555, GetStringFunc("parsGetAndOrSetRequired",",,,") ) /// Type annotations on property getters and setters must be given after the 'get()' or 'set(v)', e.g. 'with get() : string = ...' - /// (Originally from ../FSComp.txt:405) + /// (Originally from ..\FSComp.txt:405) static member parsTypeAnnotationsOnGetSet() = (556, GetStringFunc("parsTypeAnnotationsOnGetSet",",,,") ) /// A getter property is expected to be a function, e.g. 'get() = ...' or 'get(index) = ...' - /// (Originally from ../FSComp.txt:406) + /// (Originally from ..\FSComp.txt:406) static member parsGetterMustHaveAtLeastOneArgument() = (557, GetStringFunc("parsGetterMustHaveAtLeastOneArgument",",,,") ) /// Multiple accessibilities given for property getter or setter - /// (Originally from ../FSComp.txt:407) + /// (Originally from ..\FSComp.txt:407) static member parsMultipleAccessibilitiesForGetSet() = (558, GetStringFunc("parsMultipleAccessibilitiesForGetSet",",,,") ) /// Property setters must be defined using 'set value = ', 'set idx value = ' or 'set (idx1,...,idxN) value = ... ' - /// (Originally from ../FSComp.txt:408) + /// (Originally from ..\FSComp.txt:408) static member parsSetSyntax() = (559, GetStringFunc("parsSetSyntax",",,,") ) /// Interfaces always have the same visibility as the enclosing type - /// (Originally from ../FSComp.txt:409) + /// (Originally from ..\FSComp.txt:409) static member parsInterfacesHaveSameVisibilityAsEnclosingType() = (560, GetStringFunc("parsInterfacesHaveSameVisibilityAsEnclosingType",",,,") ) /// Accessibility modifiers are not allowed on this member. Abstract slots always have the same visibility as the enclosing type. - /// (Originally from ../FSComp.txt:410) + /// (Originally from ..\FSComp.txt:410) static member parsAccessibilityModsIllegalForAbstract() = (561, GetStringFunc("parsAccessibilityModsIllegalForAbstract",",,,") ) /// Attributes are not permitted on 'inherit' declarations - /// (Originally from ../FSComp.txt:411) + /// (Originally from ..\FSComp.txt:411) static member parsAttributesIllegalOnInherit() = (562, GetStringFunc("parsAttributesIllegalOnInherit",",,,") ) /// Accessibility modifiers are not permitted on an 'inherits' declaration - /// (Originally from ../FSComp.txt:412) + /// (Originally from ..\FSComp.txt:412) static member parsVisibilityIllegalOnInherit() = (563, GetStringFunc("parsVisibilityIllegalOnInherit",",,,") ) /// 'inherit' declarations cannot have 'as' bindings. To access members of the base class when overriding a method, the syntax 'base.SomeMember' may be used; 'base' is a keyword. Remove this 'as' binding. - /// (Originally from ../FSComp.txt:413) + /// (Originally from ..\FSComp.txt:413) static member parsInheritDeclarationsCannotHaveAsBindings() = (564, GetStringFunc("parsInheritDeclarationsCannotHaveAsBindings",",,,") ) /// Attributes are not allowed here - /// (Originally from ../FSComp.txt:414) + /// (Originally from ..\FSComp.txt:414) static member parsAttributesIllegalHere() = (565, GetStringFunc("parsAttributesIllegalHere",",,,") ) /// Accessibility modifiers are not permitted in this position for type abbreviations - /// (Originally from ../FSComp.txt:415) + /// (Originally from ..\FSComp.txt:415) static member parsTypeAbbreviationsCannotHaveVisibilityDeclarations() = (566, GetStringFunc("parsTypeAbbreviationsCannotHaveVisibilityDeclarations",",,,") ) /// Accessibility modifiers are not permitted in this position for enum types - /// (Originally from ../FSComp.txt:416) + /// (Originally from ..\FSComp.txt:416) static member parsEnumTypesCannotHaveVisibilityDeclarations() = (567, GetStringFunc("parsEnumTypesCannotHaveVisibilityDeclarations",",,,") ) /// All enum fields must be given values - /// (Originally from ../FSComp.txt:417) + /// (Originally from ..\FSComp.txt:417) static member parsAllEnumFieldsRequireValues() = (568, GetStringFunc("parsAllEnumFieldsRequireValues",",,,") ) /// Accessibility modifiers are not permitted on inline assembly code types - /// (Originally from ../FSComp.txt:418) + /// (Originally from ..\FSComp.txt:418) static member parsInlineAssemblyCannotHaveVisibilityDeclarations() = (569, GetStringFunc("parsInlineAssemblyCannotHaveVisibilityDeclarations",",,,") ) /// Unexpected identifier: '%s' - /// (Originally from ../FSComp.txt:419) + /// (Originally from ..\FSComp.txt:419) static member parsUnexpectedIdentifier(a0 : System.String) = (571, GetStringFunc("parsUnexpectedIdentifier",",,,%s,,,") a0) /// Accessibility modifiers are not permitted on union cases. Use 'type U = internal ...' or 'type U = private ...' to give an accessibility to the whole representation. - /// (Originally from ../FSComp.txt:420) + /// (Originally from ..\FSComp.txt:420) static member parsUnionCasesCannotHaveVisibilityDeclarations() = (572, GetStringFunc("parsUnionCasesCannotHaveVisibilityDeclarations",",,,") ) /// Accessibility modifiers are not permitted on enumeration fields - /// (Originally from ../FSComp.txt:421) + /// (Originally from ..\FSComp.txt:421) static member parsEnumFieldsCannotHaveVisibilityDeclarations() = (573, GetStringFunc("parsEnumFieldsCannotHaveVisibilityDeclarations",",,,") ) /// Consider using a separate record type instead - /// (Originally from ../FSComp.txt:422) + /// (Originally from ..\FSComp.txt:422) static member parsConsiderUsingSeparateRecordType() = (GetStringFunc("parsConsiderUsingSeparateRecordType",",,,") ) /// Accessibility modifiers are not permitted on record fields. Use 'type R = internal ...' or 'type R = private ...' to give an accessibility to the whole representation. - /// (Originally from ../FSComp.txt:423) + /// (Originally from ..\FSComp.txt:423) static member parsRecordFieldsCannotHaveVisibilityDeclarations() = (575, GetStringFunc("parsRecordFieldsCannotHaveVisibilityDeclarations",",,,") ) /// The declaration form 'let ... and ...' for non-recursive bindings is not used in F# code. Consider using a sequence of 'let' bindings - /// (Originally from ../FSComp.txt:424) + /// (Originally from ..\FSComp.txt:424) static member parsLetAndForNonRecBindings() = (576, GetStringFunc("parsLetAndForNonRecBindings",",,,") ) /// Unmatched '(' - /// (Originally from ../FSComp.txt:425) + /// (Originally from ..\FSComp.txt:425) static member parsUnmatchedParen() = (583, GetStringFunc("parsUnmatchedParen",",,,") ) /// Successive patterns should be separated by spaces or tupled - /// (Originally from ../FSComp.txt:426) + /// (Originally from ..\FSComp.txt:426) static member parsSuccessivePatternsShouldBeSpacedOrTupled() = (584, GetStringFunc("parsSuccessivePatternsShouldBeSpacedOrTupled",",,,") ) /// No matching 'in' found for this 'let' - /// (Originally from ../FSComp.txt:427) + /// (Originally from ..\FSComp.txt:427) static member parsNoMatchingInForLet() = (586, GetStringFunc("parsNoMatchingInForLet",",,,") ) /// Error in the return expression for this 'let'. Possible incorrect indentation. - /// (Originally from ../FSComp.txt:428) + /// (Originally from ..\FSComp.txt:428) static member parsErrorInReturnForLetIncorrectIndentation() = (587, GetStringFunc("parsErrorInReturnForLetIncorrectIndentation",",,,") ) /// The block following this '%s' is unfinished. Every code block is an expression and must have a result. '%s' cannot be the final code element in a block. Consider giving this block an explicit result. - /// (Originally from ../FSComp.txt:429) + /// (Originally from ..\FSComp.txt:429) static member parsExpectedExpressionAfterLet(a0 : System.String, a1 : System.String) = (588, GetStringFunc("parsExpectedExpressionAfterLet",",,,%s,,,%s,,,") a0 a1) /// Incomplete conditional. Expected 'if then ' or 'if then else '. - /// (Originally from ../FSComp.txt:430) + /// (Originally from ..\FSComp.txt:430) static member parsIncompleteIf() = (589, GetStringFunc("parsIncompleteIf",",,,") ) /// 'assert' may not be used as a first class value. Use 'assert ' instead. - /// (Originally from ../FSComp.txt:431) + /// (Originally from ..\FSComp.txt:431) static member parsAssertIsNotFirstClassValue() = (590, GetStringFunc("parsAssertIsNotFirstClassValue",",,,") ) /// Identifier expected - /// (Originally from ../FSComp.txt:432) + /// (Originally from ..\FSComp.txt:432) static member parsIdentifierExpected() = (594, GetStringFunc("parsIdentifierExpected",",,,") ) /// 'in' or '=' expected - /// (Originally from ../FSComp.txt:433) + /// (Originally from ..\FSComp.txt:433) static member parsInOrEqualExpected() = (595, GetStringFunc("parsInOrEqualExpected",",,,") ) /// The use of '->' in sequence and computation expressions is limited to the form 'for pat in expr -> expr'. Use the syntax 'for ... in ... do ... yield...' to generate elements in more complex sequence expressions. - /// (Originally from ../FSComp.txt:434) + /// (Originally from ..\FSComp.txt:434) static member parsArrowUseIsLimited() = (596, GetStringFunc("parsArrowUseIsLimited",",,,") ) /// Successive arguments should be separated by spaces or tupled, and arguments involving function or method applications should be parenthesized - /// (Originally from ../FSComp.txt:435) + /// (Originally from ..\FSComp.txt:435) static member parsSuccessiveArgsShouldBeSpacedOrTupled() = (597, GetStringFunc("parsSuccessiveArgsShouldBeSpacedOrTupled",",,,") ) /// Unmatched '[' - /// (Originally from ../FSComp.txt:436) + /// (Originally from ..\FSComp.txt:436) static member parsUnmatchedBracket() = (598, GetStringFunc("parsUnmatchedBracket",",,,") ) /// Missing qualification after '.' - /// (Originally from ../FSComp.txt:437) + /// (Originally from ..\FSComp.txt:437) static member parsMissingQualificationAfterDot() = (599, GetStringFunc("parsMissingQualificationAfterDot",",,,") ) /// In F# code you may use 'expr.[expr]'. A type annotation may be required to indicate the first expression is an array - /// (Originally from ../FSComp.txt:438) + /// (Originally from ..\FSComp.txt:438) static member parsParenFormIsForML() = (GetStringFunc("parsParenFormIsForML",",,,") ) /// Mismatched quotation, beginning with '%s' - /// (Originally from ../FSComp.txt:439) + /// (Originally from ..\FSComp.txt:439) static member parsMismatchedQuote(a0 : System.String) = (601, GetStringFunc("parsMismatchedQuote",",,,%s,,,") a0) /// Unmatched '%s' - /// (Originally from ../FSComp.txt:440) + /// (Originally from ..\FSComp.txt:440) static member parsUnmatched(a0 : System.String) = (602, GetStringFunc("parsUnmatched",",,,%s,,,") a0) /// Unmatched '[|' - /// (Originally from ../FSComp.txt:441) + /// (Originally from ..\FSComp.txt:441) static member parsUnmatchedBracketBar() = (603, GetStringFunc("parsUnmatchedBracketBar",",,,") ) /// Unmatched '{' - /// (Originally from ../FSComp.txt:442) + /// (Originally from ..\FSComp.txt:442) static member parsUnmatchedBrace() = (604, GetStringFunc("parsUnmatchedBrace",",,,") ) /// Field bindings must have the form 'id = expr;' - /// (Originally from ../FSComp.txt:443) + /// (Originally from ..\FSComp.txt:443) static member parsFieldBinding() = (609, GetStringFunc("parsFieldBinding",",,,") ) /// This member is not permitted in an object implementation - /// (Originally from ../FSComp.txt:444) + /// (Originally from ..\FSComp.txt:444) static member parsMemberIllegalInObjectImplementation() = (610, GetStringFunc("parsMemberIllegalInObjectImplementation",",,,") ) /// Missing function body - /// (Originally from ../FSComp.txt:445) + /// (Originally from ..\FSComp.txt:445) static member parsMissingFunctionBody() = (611, GetStringFunc("parsMissingFunctionBody",",,,") ) /// Syntax error in labelled type argument - /// (Originally from ../FSComp.txt:446) + /// (Originally from ..\FSComp.txt:446) static member parsSyntaxErrorInLabeledType() = (613, GetStringFunc("parsSyntaxErrorInLabeledType",",,,") ) /// Unexpected infix operator in type expression - /// (Originally from ../FSComp.txt:447) + /// (Originally from ..\FSComp.txt:447) static member parsUnexpectedInfixOperator() = (615, GetStringFunc("parsUnexpectedInfixOperator",",,,") ) /// The syntax '(typ,...,typ) ident' is not used in F# code. Consider using 'ident' instead - /// (Originally from ../FSComp.txt:448) + /// (Originally from ..\FSComp.txt:448) static member parsMultiArgumentGenericTypeFormDeprecated() = (GetStringFunc("parsMultiArgumentGenericTypeFormDeprecated",",,,") ) /// Invalid literal in type - /// (Originally from ../FSComp.txt:449) + /// (Originally from ..\FSComp.txt:449) static member parsInvalidLiteralInType() = (618, GetStringFunc("parsInvalidLiteralInType",",,,") ) /// Unexpected infix operator in unit-of-measure expression. Legal operators are '*', '/' and '^'. - /// (Originally from ../FSComp.txt:450) + /// (Originally from ..\FSComp.txt:450) static member parsUnexpectedOperatorForUnitOfMeasure() = (619, GetStringFunc("parsUnexpectedOperatorForUnitOfMeasure",",,,") ) /// Unexpected integer literal in unit-of-measure expression - /// (Originally from ../FSComp.txt:451) + /// (Originally from ..\FSComp.txt:451) static member parsUnexpectedIntegerLiteralForUnitOfMeasure() = (620, GetStringFunc("parsUnexpectedIntegerLiteralForUnitOfMeasure",",,,") ) /// Syntax error: unexpected type parameter specification - /// (Originally from ../FSComp.txt:452) + /// (Originally from ..\FSComp.txt:452) static member parsUnexpectedTypeParameter() = (621, GetStringFunc("parsUnexpectedTypeParameter",",,,") ) /// Mismatched quotation operator name, beginning with '%s' - /// (Originally from ../FSComp.txt:453) + /// (Originally from ..\FSComp.txt:453) static member parsMismatchedQuotationName(a0 : System.String) = (622, GetStringFunc("parsMismatchedQuotationName",",,,%s,,,") a0) /// Active pattern case identifiers must begin with an uppercase letter - /// (Originally from ../FSComp.txt:454) + /// (Originally from ..\FSComp.txt:454) static member parsActivePatternCaseMustBeginWithUpperCase() = (623, GetStringFunc("parsActivePatternCaseMustBeginWithUpperCase",",,,") ) /// The '|' character is not permitted in active pattern case identifiers - /// (Originally from ../FSComp.txt:455) + /// (Originally from ..\FSComp.txt:455) static member parsActivePatternCaseContainsPipe() = (624, GetStringFunc("parsActivePatternCaseContainsPipe",",,,") ) /// Denominator must not be 0 in unit-of-measure exponent - /// (Originally from ../FSComp.txt:456) + /// (Originally from ..\FSComp.txt:456) static member parsIllegalDenominatorForMeasureExponent() = (625, GetStringFunc("parsIllegalDenominatorForMeasureExponent",",,,") ) /// No '=' symbol should follow a 'namespace' declaration - /// (Originally from ../FSComp.txt:457) + /// (Originally from ..\FSComp.txt:457) static member parsNoEqualShouldFollowNamespace() = (GetStringFunc("parsNoEqualShouldFollowNamespace",",,,") ) /// The syntax 'module ... = struct .. end' is not used in F# code. Consider using 'module ... = begin .. end' - /// (Originally from ../FSComp.txt:458) + /// (Originally from ..\FSComp.txt:458) static member parsSyntaxModuleStructEndDeprecated() = (GetStringFunc("parsSyntaxModuleStructEndDeprecated",",,,") ) /// The syntax 'module ... : sig .. end' is not used in F# code. Consider using 'module ... = begin .. end' - /// (Originally from ../FSComp.txt:459) + /// (Originally from ..\FSComp.txt:459) static member parsSyntaxModuleSigEndDeprecated() = (GetStringFunc("parsSyntaxModuleSigEndDeprecated",",,,") ) /// A static field was used where an instance field is expected - /// (Originally from ../FSComp.txt:460) + /// (Originally from ..\FSComp.txt:460) static member tcStaticFieldUsedWhenInstanceFieldExpected() = (627, GetStringFunc("tcStaticFieldUsedWhenInstanceFieldExpected",",,,") ) /// Method '%s' is not accessible from this code location - /// (Originally from ../FSComp.txt:461) + /// (Originally from ..\FSComp.txt:461) static member tcMethodNotAccessible(a0 : System.String) = (629, GetStringFunc("tcMethodNotAccessible",",,,%s,,,") a0) /// Implicit product of measures following / - /// (Originally from ../FSComp.txt:463) + /// (Originally from ..\FSComp.txt:463) static member tcImplicitMeasureFollowingSlash() = (632, GetStringFunc("tcImplicitMeasureFollowingSlash",",,,") ) /// Unexpected SynMeasure.Anon - /// (Originally from ../FSComp.txt:464) + /// (Originally from ..\FSComp.txt:464) static member tcUnexpectedMeasureAnon() = (633, GetStringFunc("tcUnexpectedMeasureAnon",",,,") ) /// Non-zero constants cannot have generic units. For generic zero, write 0.0<_>. - /// (Originally from ../FSComp.txt:465) + /// (Originally from ..\FSComp.txt:465) static member tcNonZeroConstantCannotHaveGenericUnit() = (634, GetStringFunc("tcNonZeroConstantCannotHaveGenericUnit",",,,") ) /// In sequence expressions, results are generated using 'yield' - /// (Originally from ../FSComp.txt:466) + /// (Originally from ..\FSComp.txt:466) static member tcSeqResultsUseYield() = (635, GetStringFunc("tcSeqResultsUseYield",",,,") ) /// Unexpected big rational constant - /// (Originally from ../FSComp.txt:467) + /// (Originally from ..\FSComp.txt:467) static member tcUnexpectedBigRationalConstant() = (GetStringFunc("tcUnexpectedBigRationalConstant",",,,") ) /// Units-of-measure supported only on float, float32, decimal and signed integer types - /// (Originally from ../FSComp.txt:468) + /// (Originally from ..\FSComp.txt:468) static member tcInvalidTypeForUnitsOfMeasure() = (636, GetStringFunc("tcInvalidTypeForUnitsOfMeasure",",,,") ) /// Unexpected Const_uint16array - /// (Originally from ../FSComp.txt:469) + /// (Originally from ..\FSComp.txt:469) static member tcUnexpectedConstUint16Array() = (GetStringFunc("tcUnexpectedConstUint16Array",",,,") ) /// Unexpected Const_bytearray - /// (Originally from ../FSComp.txt:470) + /// (Originally from ..\FSComp.txt:470) static member tcUnexpectedConstByteArray() = (GetStringFunc("tcUnexpectedConstByteArray",",,,") ) /// A parameter with attributes must also be given a name, e.g. '[] Name : Type' - /// (Originally from ../FSComp.txt:471) + /// (Originally from ..\FSComp.txt:471) static member tcParameterRequiresName() = (640, GetStringFunc("tcParameterRequiresName",",,,") ) /// Return values cannot have names - /// (Originally from ../FSComp.txt:472) + /// (Originally from ..\FSComp.txt:472) static member tcReturnValuesCannotHaveNames() = (641, GetStringFunc("tcReturnValuesCannotHaveNames",",,,") ) /// MemberKind.PropertyGetSet only expected in parse trees - /// (Originally from ../FSComp.txt:473) + /// (Originally from ..\FSComp.txt:473) static member tcMemberKindPropertyGetSetNotExpected() = (GetStringFunc("tcMemberKindPropertyGetSetNotExpected",",,,") ) /// Namespaces cannot contain values. Consider using a module to hold your value declarations. - /// (Originally from ../FSComp.txt:474) + /// (Originally from ..\FSComp.txt:474) static member tcNamespaceCannotContainValues() = (201, GetStringFunc("tcNamespaceCannotContainValues",",,,") ) /// Namespaces cannot contain extension members except in the same file and namespace declaration group where the type is defined. Consider using a module to hold declarations of extension members. - /// (Originally from ../FSComp.txt:475) + /// (Originally from ..\FSComp.txt:475) static member tcNamespaceCannotContainExtensionMembers() = (644, GetStringFunc("tcNamespaceCannotContainExtensionMembers",",,,") ) /// Multiple visibility attributes have been specified for this identifier - /// (Originally from ../FSComp.txt:476) + /// (Originally from ..\FSComp.txt:476) static member tcMultipleVisibilityAttributes() = (645, GetStringFunc("tcMultipleVisibilityAttributes",",,,") ) /// Multiple visibility attributes have been specified for this identifier. 'let' bindings in classes are always private, as are any 'let' bindings inside expressions. - /// (Originally from ../FSComp.txt:477) + /// (Originally from ..\FSComp.txt:477) static member tcMultipleVisibilityAttributesWithLet() = (646, GetStringFunc("tcMultipleVisibilityAttributesWithLet",",,,") ) /// The name '(%s)' should not be used as a member name. To define comparison semantics for a type, implement the 'System.IComparable' interface. If defining a static member for use from other CLI languages then use the name '%s' instead. - /// (Originally from ../FSComp.txt:478) + /// (Originally from ..\FSComp.txt:478) static member tcInvalidMethodNameForRelationalOperator(a0 : System.String, a1 : System.String) = (GetStringFunc("tcInvalidMethodNameForRelationalOperator",",,,%s,,,%s,,,") a0 a1) /// The name '(%s)' should not be used as a member name. To define equality semantics for a type, override the 'Object.Equals' member. If defining a static member for use from other CLI languages then use the name '%s' instead. - /// (Originally from ../FSComp.txt:479) + /// (Originally from ..\FSComp.txt:479) static member tcInvalidMethodNameForEquality(a0 : System.String, a1 : System.String) = (GetStringFunc("tcInvalidMethodNameForEquality",",,,%s,,,%s,,,") a0 a1) /// The name '(%s)' should not be used as a member name. If defining a static member for use from other CLI languages then use the name '%s' instead. - /// (Originally from ../FSComp.txt:480) + /// (Originally from ..\FSComp.txt:480) static member tcInvalidMemberName(a0 : System.String, a1 : System.String) = (GetStringFunc("tcInvalidMemberName",",,,%s,,,%s,,,") a0 a1) /// The name '(%s)' should not be used as a member name because it is given a standard definition in the F# library over fixed types - /// (Originally from ../FSComp.txt:481) + /// (Originally from ..\FSComp.txt:481) static member tcInvalidMemberNameFixedTypes(a0 : System.String) = (GetStringFunc("tcInvalidMemberNameFixedTypes",",,,%s,,,") a0) /// The '%s' operator should not normally be redefined. To define overloaded comparison semantics for a particular type, implement the 'System.IComparable' interface in the definition of that type. - /// (Originally from ../FSComp.txt:482) + /// (Originally from ..\FSComp.txt:482) static member tcInvalidOperatorDefinitionRelational(a0 : System.String) = (GetStringFunc("tcInvalidOperatorDefinitionRelational",",,,%s,,,") a0) /// The '%s' operator should not normally be redefined. To define equality semantics for a type, override the 'Object.Equals' member in the definition of that type. - /// (Originally from ../FSComp.txt:483) + /// (Originally from ..\FSComp.txt:483) static member tcInvalidOperatorDefinitionEquality(a0 : System.String) = (GetStringFunc("tcInvalidOperatorDefinitionEquality",",,,%s,,,") a0) /// The '%s' operator should not normally be redefined. Consider using a different operator name - /// (Originally from ../FSComp.txt:484) + /// (Originally from ..\FSComp.txt:484) static member tcInvalidOperatorDefinition(a0 : System.String) = (GetStringFunc("tcInvalidOperatorDefinition",",,,%s,,,") a0) /// The '%s' operator cannot be redefined. Consider using a different operator name - /// (Originally from ../FSComp.txt:485) + /// (Originally from ..\FSComp.txt:485) static member tcInvalidIndexOperatorDefinition(a0 : System.String) = (GetStringFunc("tcInvalidIndexOperatorDefinition",",,,%s,,,") a0) /// Expected module or namespace parent %s - /// (Originally from ../FSComp.txt:486) + /// (Originally from ..\FSComp.txt:486) static member tcExpectModuleOrNamespaceParent(a0 : System.String) = (GetStringFunc("tcExpectModuleOrNamespaceParent",",,,%s,,,") a0) /// The struct, record or union type '%s' implements the interface 'System.IComparable' explicitly. You must apply the 'CustomComparison' attribute to the type. - /// (Originally from ../FSComp.txt:487) + /// (Originally from ..\FSComp.txt:487) static member tcImplementsIComparableExplicitly(a0 : System.String) = (647, GetStringFunc("tcImplementsIComparableExplicitly",",,,%s,,,") a0) /// The struct, record or union type '%s' implements the interface 'System.IComparable<_>' explicitly. You must apply the 'CustomComparison' attribute to the type, and should also provide a consistent implementation of the non-generic interface System.IComparable. - /// (Originally from ../FSComp.txt:488) + /// (Originally from ..\FSComp.txt:488) static member tcImplementsGenericIComparableExplicitly(a0 : System.String) = (648, GetStringFunc("tcImplementsGenericIComparableExplicitly",",,,%s,,,") a0) /// The struct, record or union type '%s' implements the interface 'System.IStructuralComparable' explicitly. Apply the 'CustomComparison' attribute to the type. - /// (Originally from ../FSComp.txt:489) + /// (Originally from ..\FSComp.txt:489) static member tcImplementsIStructuralComparableExplicitly(a0 : System.String) = (649, GetStringFunc("tcImplementsIStructuralComparableExplicitly",",,,%s,,,") a0) /// This record contains fields from inconsistent types - /// (Originally from ../FSComp.txt:490) + /// (Originally from ..\FSComp.txt:490) static member tcRecordFieldInconsistentTypes() = (656, GetStringFunc("tcRecordFieldInconsistentTypes",",,,") ) /// DLLImport stubs cannot be inlined - /// (Originally from ../FSComp.txt:491) + /// (Originally from ..\FSComp.txt:491) static member tcDllImportStubsCannotBeInlined() = (657, GetStringFunc("tcDllImportStubsCannotBeInlined",",,,") ) /// Structs may only bind a 'this' parameter at member declarations - /// (Originally from ../FSComp.txt:492) + /// (Originally from ..\FSComp.txt:492) static member tcStructsCanOnlyBindThisAtMemberDeclaration() = (658, GetStringFunc("tcStructsCanOnlyBindThisAtMemberDeclaration",",,,") ) /// Unexpected expression at recursive inference point - /// (Originally from ../FSComp.txt:493) + /// (Originally from ..\FSComp.txt:493) static member tcUnexpectedExprAtRecInfPoint() = (659, GetStringFunc("tcUnexpectedExprAtRecInfPoint",",,,") ) /// This code is less generic than required by its annotations because the explicit type variable '%s' could not be generalized. It was constrained to be '%s'. - /// (Originally from ../FSComp.txt:494) + /// (Originally from ..\FSComp.txt:494) static member tcLessGenericBecauseOfAnnotation(a0 : System.String, a1 : System.String) = (660, GetStringFunc("tcLessGenericBecauseOfAnnotation",",,,%s,,,%s,,,") a0 a1) /// One or more of the explicit class or function type variables for this binding could not be generalized, because they were constrained to other types - /// (Originally from ../FSComp.txt:495) + /// (Originally from ..\FSComp.txt:495) static member tcConstrainedTypeVariableCannotBeGeneralized() = (661, GetStringFunc("tcConstrainedTypeVariableCannotBeGeneralized",",,,") ) /// A generic type parameter has been used in a way that constrains it to always be '%s' - /// (Originally from ../FSComp.txt:496) + /// (Originally from ..\FSComp.txt:496) static member tcGenericParameterHasBeenConstrained(a0 : System.String) = (662, GetStringFunc("tcGenericParameterHasBeenConstrained",",,,%s,,,") a0) /// This type parameter has been used in a way that constrains it to always be '%s' - /// (Originally from ../FSComp.txt:497) + /// (Originally from ..\FSComp.txt:497) static member tcTypeParameterHasBeenConstrained(a0 : System.String) = (663, GetStringFunc("tcTypeParameterHasBeenConstrained",",,,%s,,,") a0) /// The type parameters inferred for this value are not stable under the erasure of type abbreviations. This is due to the use of type abbreviations which drop or reorder type parameters, e.g. \n\ttype taggedInt<'a> = int or\n\ttype swap<'a,'b> = 'b * 'a.\nConsider declaring the type parameters for this value explicitly, e.g.\n\tlet f<'a,'b> ((x,y) : swap<'b,'a>) : swap<'a,'b> = (y,x). - /// (Originally from ../FSComp.txt:498) + /// (Originally from ..\FSComp.txt:498) static member tcTypeParametersInferredAreNotStable() = (664, GetStringFunc("tcTypeParametersInferredAreNotStable",",,,") ) /// Explicit type parameters may only be used on module or member bindings - /// (Originally from ../FSComp.txt:499) + /// (Originally from ..\FSComp.txt:499) static member tcExplicitTypeParameterInvalid() = (665, GetStringFunc("tcExplicitTypeParameterInvalid",",,,") ) /// You must explicitly declare either all or no type parameters when overriding a generic abstract method - /// (Originally from ../FSComp.txt:500) + /// (Originally from ..\FSComp.txt:500) static member tcOverridingMethodRequiresAllOrNoTypeParameters() = (666, GetStringFunc("tcOverridingMethodRequiresAllOrNoTypeParameters",",,,") ) /// The field labels and expected type of this record expression or pattern do not uniquely determine a corresponding record type - /// (Originally from ../FSComp.txt:501) + /// (Originally from ..\FSComp.txt:501) static member tcFieldsDoNotDetermineUniqueRecordType() = (667, GetStringFunc("tcFieldsDoNotDetermineUniqueRecordType",",,,") ) /// The field '%s' appears twice in this record expression or pattern - /// (Originally from ../FSComp.txt:502) + /// (Originally from ..\FSComp.txt:502) static member tcFieldAppearsTwiceInRecord(a0 : System.String) = (668, GetStringFunc("tcFieldAppearsTwiceInRecord",",,,%s,,,") a0) /// Unknown union case - /// (Originally from ../FSComp.txt:503) + /// (Originally from ..\FSComp.txt:503) static member tcUnknownUnion() = (669, GetStringFunc("tcUnknownUnion",",,,") ) /// This code is not sufficiently generic. The type variable %s could not be generalized because it would escape its scope. - /// (Originally from ../FSComp.txt:504) + /// (Originally from ..\FSComp.txt:504) static member tcNotSufficientlyGenericBecauseOfScope(a0 : System.String) = (670, GetStringFunc("tcNotSufficientlyGenericBecauseOfScope",",,,%s,,,") a0) /// A property cannot have explicit type parameters. Consider using a method instead. - /// (Originally from ../FSComp.txt:505) + /// (Originally from ..\FSComp.txt:505) static member tcPropertyRequiresExplicitTypeParameters() = (671, GetStringFunc("tcPropertyRequiresExplicitTypeParameters",",,,") ) /// A constructor cannot have explicit type parameters. Consider using a static construction method instead. - /// (Originally from ../FSComp.txt:506) + /// (Originally from ..\FSComp.txt:506) static member tcConstructorCannotHaveTypeParameters() = (672, GetStringFunc("tcConstructorCannotHaveTypeParameters",",,,") ) /// This instance member needs a parameter to represent the object being invoked. Make the member static or use the notation 'member x.Member(args) = ...'. - /// (Originally from ../FSComp.txt:507) + /// (Originally from ..\FSComp.txt:507) static member tcInstanceMemberRequiresTarget() = (673, GetStringFunc("tcInstanceMemberRequiresTarget",",,,") ) /// Unexpected source-level property specification in syntax tree - /// (Originally from ../FSComp.txt:508) + /// (Originally from ..\FSComp.txt:508) static member tcUnexpectedPropertyInSyntaxTree() = (674, GetStringFunc("tcUnexpectedPropertyInSyntaxTree",",,,") ) /// A static initializer requires an argument - /// (Originally from ../FSComp.txt:509) + /// (Originally from ..\FSComp.txt:509) static member tcStaticInitializerRequiresArgument() = (675, GetStringFunc("tcStaticInitializerRequiresArgument",",,,") ) /// An object constructor requires an argument - /// (Originally from ../FSComp.txt:510) + /// (Originally from ..\FSComp.txt:510) static member tcObjectConstructorRequiresArgument() = (676, GetStringFunc("tcObjectConstructorRequiresArgument",",,,") ) /// This static member should not have a 'this' parameter. Consider using the notation 'member Member(args) = ...'. - /// (Originally from ../FSComp.txt:511) + /// (Originally from ..\FSComp.txt:511) static member tcStaticMemberShouldNotHaveThis() = (677, GetStringFunc("tcStaticMemberShouldNotHaveThis",",,,") ) /// An explicit static initializer should use the syntax 'static new(args) = expr' - /// (Originally from ../FSComp.txt:512) + /// (Originally from ..\FSComp.txt:512) static member tcExplicitStaticInitializerSyntax() = (678, GetStringFunc("tcExplicitStaticInitializerSyntax",",,,") ) /// An explicit object constructor should use the syntax 'new(args) = expr' - /// (Originally from ../FSComp.txt:513) + /// (Originally from ..\FSComp.txt:513) static member tcExplicitObjectConstructorSyntax() = (679, GetStringFunc("tcExplicitObjectConstructorSyntax",",,,") ) /// Unexpected source-level property specification - /// (Originally from ../FSComp.txt:514) + /// (Originally from ..\FSComp.txt:514) static member tcUnexpectedPropertySpec() = (680, GetStringFunc("tcUnexpectedPropertySpec",",,,") ) /// This form of object expression is not used in F#. Use 'member this.MemberName ... = ...' to define member implementations in object expressions. - /// (Originally from ../FSComp.txt:515) + /// (Originally from ..\FSComp.txt:515) static member tcObjectExpressionFormDeprecated() = (GetStringFunc("tcObjectExpressionFormDeprecated",",,,") ) /// Invalid declaration - /// (Originally from ../FSComp.txt:516) + /// (Originally from ..\FSComp.txt:516) static member tcInvalidDeclaration() = (682, GetStringFunc("tcInvalidDeclaration",",,,") ) /// Attributes are not allowed within patterns - /// (Originally from ../FSComp.txt:517) + /// (Originally from ..\FSComp.txt:517) static member tcAttributesInvalidInPatterns() = (683, GetStringFunc("tcAttributesInvalidInPatterns",",,,") ) /// The generic function '%s' must be given explicit type argument(s) - /// (Originally from ../FSComp.txt:518) + /// (Originally from ..\FSComp.txt:518) static member tcFunctionRequiresExplicitTypeArguments(a0 : System.String) = (685, GetStringFunc("tcFunctionRequiresExplicitTypeArguments",",,,%s,,,") a0) /// The method or function '%s' should not be given explicit type argument(s) because it does not declare its type parameters explicitly - /// (Originally from ../FSComp.txt:519) + /// (Originally from ..\FSComp.txt:519) static member tcDoesNotAllowExplicitTypeArguments(a0 : System.String) = (686, GetStringFunc("tcDoesNotAllowExplicitTypeArguments",",,,%s,,,") a0) /// This value, type or method expects %d type parameter(s) but was given %d - /// (Originally from ../FSComp.txt:520) + /// (Originally from ..\FSComp.txt:520) static member tcTypeParameterArityMismatch(a0 : System.Int32, a1 : System.Int32) = (687, GetStringFunc("tcTypeParameterArityMismatch",",,,%d,,,%d,,,") a0 a1) /// The default, zero-initializing constructor of a struct type may only be used if all the fields of the struct type admit default initialization - /// (Originally from ../FSComp.txt:521) + /// (Originally from ..\FSComp.txt:521) static member tcDefaultStructConstructorCall() = (688, GetStringFunc("tcDefaultStructConstructorCall",",,,") ) /// Couldn't find Dispose on IDisposable, or it was overloaded - /// (Originally from ../FSComp.txt:522) + /// (Originally from ..\FSComp.txt:522) static member tcCouldNotFindIDisposable() = (GetStringFunc("tcCouldNotFindIDisposable",",,,") ) /// This value is not a literal and cannot be used in a pattern - /// (Originally from ../FSComp.txt:523) + /// (Originally from ..\FSComp.txt:523) static member tcNonLiteralCannotBeUsedInPattern() = (689, GetStringFunc("tcNonLiteralCannotBeUsedInPattern",",,,") ) /// This field is readonly - /// (Originally from ../FSComp.txt:524) + /// (Originally from ..\FSComp.txt:524) static member tcFieldIsReadonly() = (690, GetStringFunc("tcFieldIsReadonly",",,,") ) /// Named arguments must appear after all other arguments - /// (Originally from ../FSComp.txt:525) + /// (Originally from ..\FSComp.txt:525) static member tcNameArgumentsMustAppearLast() = (691, GetStringFunc("tcNameArgumentsMustAppearLast",",,,") ) /// This function value is being used to construct a delegate type whose signature includes a byref argument. You must use an explicit lambda expression taking %d arguments. - /// (Originally from ../FSComp.txt:526) + /// (Originally from ..\FSComp.txt:526) static member tcFunctionRequiresExplicitLambda(a0 : System.Int32) = (692, GetStringFunc("tcFunctionRequiresExplicitLambda",",,,%d,,,") a0) /// The type '%s' is not a type whose values can be enumerated with this syntax, i.e. is not compatible with either seq<_>, IEnumerable<_> or IEnumerable and does not have a GetEnumerator method - /// (Originally from ../FSComp.txt:527) + /// (Originally from ..\FSComp.txt:527) static member tcTypeCannotBeEnumerated(a0 : System.String) = (693, GetStringFunc("tcTypeCannotBeEnumerated",",,,%s,,,") a0) /// This recursive binding uses an invalid mixture of recursive forms - /// (Originally from ../FSComp.txt:528) + /// (Originally from ..\FSComp.txt:528) static member tcInvalidMixtureOfRecursiveForms() = (695, GetStringFunc("tcInvalidMixtureOfRecursiveForms",",,,") ) /// This is not a valid object construction expression. Explicit object constructors must either call an alternate constructor or initialize all fields of the object and specify a call to a super class constructor. - /// (Originally from ../FSComp.txt:529) + /// (Originally from ..\FSComp.txt:529) static member tcInvalidObjectConstructionExpression() = (696, GetStringFunc("tcInvalidObjectConstructionExpression",",,,") ) /// Invalid constraint - /// (Originally from ../FSComp.txt:530) + /// (Originally from ..\FSComp.txt:530) static member tcInvalidConstraint() = (697, GetStringFunc("tcInvalidConstraint",",,,") ) /// Invalid constraint: the type used for the constraint is sealed, which means the constraint could only be satisfied by at most one solution - /// (Originally from ../FSComp.txt:531) + /// (Originally from ..\FSComp.txt:531) static member tcInvalidConstraintTypeSealed() = (698, GetStringFunc("tcInvalidConstraintTypeSealed",",,,") ) /// An 'enum' constraint must be of the form 'enum' - /// (Originally from ../FSComp.txt:532) + /// (Originally from ..\FSComp.txt:532) static member tcInvalidEnumConstraint() = (699, GetStringFunc("tcInvalidEnumConstraint",",,,") ) /// 'new' constraints must take one argument of type 'unit' and return the constructed type - /// (Originally from ../FSComp.txt:533) + /// (Originally from ..\FSComp.txt:533) static member tcInvalidNewConstraint() = (700, GetStringFunc("tcInvalidNewConstraint",",,,") ) /// This property has an invalid type. Properties taking multiple indexer arguments should have types of the form 'ty1 * ty2 -> ty3'. Properties returning functions should have types of the form '(ty1 -> ty2)'. - /// (Originally from ../FSComp.txt:534) + /// (Originally from ..\FSComp.txt:534) static member tcInvalidPropertyType() = (701, GetStringFunc("tcInvalidPropertyType",",,,") ) /// Expected unit-of-measure parameter, not type parameter. Explicit unit-of-measure parameters must be marked with the [] attribute. - /// (Originally from ../FSComp.txt:535) + /// (Originally from ..\FSComp.txt:535) static member tcExpectedUnitOfMeasureMarkWithAttribute() = (702, GetStringFunc("tcExpectedUnitOfMeasureMarkWithAttribute",",,,") ) /// Expected type parameter, not unit-of-measure parameter - /// (Originally from ../FSComp.txt:536) + /// (Originally from ..\FSComp.txt:536) static member tcExpectedTypeParameter() = (703, GetStringFunc("tcExpectedTypeParameter",",,,") ) /// Expected type, not unit-of-measure - /// (Originally from ../FSComp.txt:537) + /// (Originally from ..\FSComp.txt:537) static member tcExpectedTypeNotUnitOfMeasure() = (704, GetStringFunc("tcExpectedTypeNotUnitOfMeasure",",,,") ) /// Expected unit-of-measure, not type - /// (Originally from ../FSComp.txt:538) + /// (Originally from ..\FSComp.txt:538) static member tcExpectedUnitOfMeasureNotType() = (705, GetStringFunc("tcExpectedUnitOfMeasureNotType",",,,") ) /// Units-of-measure cannot be used as prefix arguments to a type. Rewrite as postfix arguments in angle brackets. - /// (Originally from ../FSComp.txt:539) + /// (Originally from ..\FSComp.txt:539) static member tcInvalidUnitsOfMeasurePrefix() = (706, GetStringFunc("tcInvalidUnitsOfMeasurePrefix",",,,") ) /// Unit-of-measure cannot be used in type constructor application - /// (Originally from ../FSComp.txt:540) + /// (Originally from ..\FSComp.txt:540) static member tcUnitsOfMeasureInvalidInTypeConstructor() = (707, GetStringFunc("tcUnitsOfMeasureInvalidInTypeConstructor",",,,") ) /// This control construct may only be used if the computation expression builder defines a '%s' method - /// (Originally from ../FSComp.txt:541) + /// (Originally from ..\FSComp.txt:541) static member tcRequireBuilderMethod(a0 : System.String) = (708, GetStringFunc("tcRequireBuilderMethod",",,,%s,,,") a0) /// This type has no nested types - /// (Originally from ../FSComp.txt:542) + /// (Originally from ..\FSComp.txt:542) static member tcTypeHasNoNestedTypes() = (709, GetStringFunc("tcTypeHasNoNestedTypes",",,,") ) /// Unexpected %s in type expression - /// (Originally from ../FSComp.txt:543) + /// (Originally from ..\FSComp.txt:543) static member tcUnexpectedSymbolInTypeExpression(a0 : System.String) = (711, GetStringFunc("tcUnexpectedSymbolInTypeExpression",",,,%s,,,") a0) /// Type parameter cannot be used as type constructor - /// (Originally from ../FSComp.txt:544) + /// (Originally from ..\FSComp.txt:544) static member tcTypeParameterInvalidAsTypeConstructor() = (712, GetStringFunc("tcTypeParameterInvalidAsTypeConstructor",",,,") ) /// Illegal syntax in type expression - /// (Originally from ../FSComp.txt:545) + /// (Originally from ..\FSComp.txt:545) static member tcIllegalSyntaxInTypeExpression() = (713, GetStringFunc("tcIllegalSyntaxInTypeExpression",",,,") ) /// Anonymous unit-of-measure cannot be nested inside another unit-of-measure expression - /// (Originally from ../FSComp.txt:546) + /// (Originally from ..\FSComp.txt:546) static member tcAnonymousUnitsOfMeasureCannotBeNested() = (714, GetStringFunc("tcAnonymousUnitsOfMeasureCannotBeNested",",,,") ) /// Anonymous type variables are not permitted in this declaration - /// (Originally from ../FSComp.txt:547) + /// (Originally from ..\FSComp.txt:547) static member tcAnonymousTypeInvalidInDeclaration() = (715, GetStringFunc("tcAnonymousTypeInvalidInDeclaration",",,,") ) /// Unexpected / in type - /// (Originally from ../FSComp.txt:548) + /// (Originally from ..\FSComp.txt:548) static member tcUnexpectedSlashInType() = (716, GetStringFunc("tcUnexpectedSlashInType",",,,") ) /// Unexpected type arguments - /// (Originally from ../FSComp.txt:549) + /// (Originally from ..\FSComp.txt:549) static member tcUnexpectedTypeArguments() = (717, GetStringFunc("tcUnexpectedTypeArguments",",,,") ) /// Optional arguments are only permitted on type members - /// (Originally from ../FSComp.txt:550) + /// (Originally from ..\FSComp.txt:550) static member tcOptionalArgsOnlyOnMembers() = (718, GetStringFunc("tcOptionalArgsOnlyOnMembers",",,,") ) /// Name '%s' not bound in pattern context - /// (Originally from ../FSComp.txt:551) + /// (Originally from ..\FSComp.txt:551) static member tcNameNotBoundInPattern(a0 : System.String) = (719, GetStringFunc("tcNameNotBoundInPattern",",,,%s,,,") a0) /// Non-primitive numeric literal constants cannot be used in pattern matches because they can be mapped to multiple different types through the use of a NumericLiteral module. Consider using replacing with a variable, and use 'when = ' at the end of the match clause. - /// (Originally from ../FSComp.txt:552) + /// (Originally from ..\FSComp.txt:552) static member tcInvalidNonPrimitiveLiteralInPatternMatch() = (720, GetStringFunc("tcInvalidNonPrimitiveLiteralInPatternMatch",",,,") ) /// Type arguments cannot be specified here - /// (Originally from ../FSComp.txt:553) + /// (Originally from ..\FSComp.txt:553) static member tcInvalidTypeArgumentUsage() = (721, GetStringFunc("tcInvalidTypeArgumentUsage",",,,") ) /// Only active patterns returning exactly one result may accept arguments - /// (Originally from ../FSComp.txt:554) + /// (Originally from ..\FSComp.txt:554) static member tcRequireActivePatternWithOneResult() = (722, GetStringFunc("tcRequireActivePatternWithOneResult",",,,") ) /// Invalid argument to parameterized pattern label - /// (Originally from ../FSComp.txt:555) + /// (Originally from ..\FSComp.txt:555) static member tcInvalidArgForParameterizedPattern() = (723, GetStringFunc("tcInvalidArgForParameterizedPattern",",,,") ) /// Internal error. Invalid index into active pattern array - /// (Originally from ../FSComp.txt:556) + /// (Originally from ..\FSComp.txt:556) static member tcInvalidIndexIntoActivePatternArray() = (724, GetStringFunc("tcInvalidIndexIntoActivePatternArray",",,,") ) /// This union case does not take arguments - /// (Originally from ../FSComp.txt:557) + /// (Originally from ..\FSComp.txt:557) static member tcUnionCaseDoesNotTakeArguments() = (725, GetStringFunc("tcUnionCaseDoesNotTakeArguments",",,,") ) /// This union case takes one argument - /// (Originally from ../FSComp.txt:558) + /// (Originally from ..\FSComp.txt:558) static member tcUnionCaseRequiresOneArgument() = (726, GetStringFunc("tcUnionCaseRequiresOneArgument",",,,") ) /// This union case expects %d arguments in tupled form - /// (Originally from ../FSComp.txt:559) + /// (Originally from ..\FSComp.txt:559) static member tcUnionCaseExpectsTupledArguments(a0 : System.Int32) = (727, GetStringFunc("tcUnionCaseExpectsTupledArguments",",,,%d,,,") a0) /// Field '%s' is not static - /// (Originally from ../FSComp.txt:560) + /// (Originally from ..\FSComp.txt:560) static member tcFieldIsNotStatic(a0 : System.String) = (728, GetStringFunc("tcFieldIsNotStatic",",,,%s,,,") a0) /// This field is not a literal and cannot be used in a pattern - /// (Originally from ../FSComp.txt:561) + /// (Originally from ..\FSComp.txt:561) static member tcFieldNotLiteralCannotBeUsedInPattern() = (729, GetStringFunc("tcFieldNotLiteralCannotBeUsedInPattern",",,,") ) /// This is not a variable, constant, active recognizer or literal - /// (Originally from ../FSComp.txt:562) + /// (Originally from ..\FSComp.txt:562) static member tcRequireVarConstRecogOrLiteral() = (730, GetStringFunc("tcRequireVarConstRecogOrLiteral",",,,") ) /// This is not a valid pattern - /// (Originally from ../FSComp.txt:563) + /// (Originally from ..\FSComp.txt:563) static member tcInvalidPattern() = (731, GetStringFunc("tcInvalidPattern",",,,") ) /// Character range matches have been removed in F#. Consider using a 'when' pattern guard instead. - /// (Originally from ../FSComp.txt:564) + /// (Originally from ..\FSComp.txt:564) static member tcUseWhenPatternGuard() = (GetStringFunc("tcUseWhenPatternGuard",",,,") ) /// Illegal pattern - /// (Originally from ../FSComp.txt:565) + /// (Originally from ..\FSComp.txt:565) static member tcIllegalPattern() = (733, GetStringFunc("tcIllegalPattern",",,,") ) /// Syntax error - unexpected '?' symbol - /// (Originally from ../FSComp.txt:566) + /// (Originally from ..\FSComp.txt:566) static member tcSyntaxErrorUnexpectedQMark() = (734, GetStringFunc("tcSyntaxErrorUnexpectedQMark",",,,") ) /// Expected %d expressions, got %d - /// (Originally from ../FSComp.txt:567) + /// (Originally from ..\FSComp.txt:567) static member tcExpressionCountMisMatch(a0 : System.Int32, a1 : System.Int32) = (735, GetStringFunc("tcExpressionCountMisMatch",",,,%d,,,%d,,,") a0 a1) /// TcExprUndelayed: delayed - /// (Originally from ../FSComp.txt:568) + /// (Originally from ..\FSComp.txt:568) static member tcExprUndelayed() = (736, GetStringFunc("tcExprUndelayed",",,,") ) /// This expression form may only be used in sequence and computation expressions - /// (Originally from ../FSComp.txt:569) + /// (Originally from ..\FSComp.txt:569) static member tcExpressionRequiresSequence() = (737, GetStringFunc("tcExpressionRequiresSequence",",,,") ) /// Invalid object expression. Objects without overrides or interfaces should use the expression form 'new Type(args)' without braces. - /// (Originally from ../FSComp.txt:570) + /// (Originally from ..\FSComp.txt:570) static member tcInvalidObjectExpressionSyntaxForm() = (738, GetStringFunc("tcInvalidObjectExpressionSyntaxForm",",,,") ) /// Invalid object, sequence or record expression - /// (Originally from ../FSComp.txt:571) + /// (Originally from ..\FSComp.txt:571) static member tcInvalidObjectSequenceOrRecordExpression() = (739, GetStringFunc("tcInvalidObjectSequenceOrRecordExpression",",,,") ) /// Invalid record, sequence or computation expression. Sequence expressions should be of the form 'seq { ... }' - /// (Originally from ../FSComp.txt:572) + /// (Originally from ..\FSComp.txt:572) static member tcInvalidSequenceExpressionSyntaxForm() = (740, GetStringFunc("tcInvalidSequenceExpressionSyntaxForm",",,,") ) /// This list or array expression includes an element of the form 'if ... then ... else'. Parenthesize this expression to indicate it is an individual element of the list or array, to disambiguate this from a list generated using a sequence expression - /// (Originally from ../FSComp.txt:573) + /// (Originally from ..\FSComp.txt:573) static member tcExpressionWithIfRequiresParenthesis() = (GetStringFunc("tcExpressionWithIfRequiresParenthesis",",,,") ) /// Unable to parse format string '%s' - /// (Originally from ../FSComp.txt:574) + /// (Originally from ..\FSComp.txt:574) static member tcUnableToParseFormatString(a0 : System.String) = (741, GetStringFunc("tcUnableToParseFormatString",",,,%s,,,") a0) /// This list expression exceeds the maximum size for list literals. Use an array for larger literals and call Array.ToList. - /// (Originally from ../FSComp.txt:575) + /// (Originally from ..\FSComp.txt:575) static member tcListLiteralMaxSize() = (742, GetStringFunc("tcListLiteralMaxSize",",,,") ) /// The expression form 'expr then expr' may only be used as part of an explicit object constructor - /// (Originally from ../FSComp.txt:576) + /// (Originally from ..\FSComp.txt:576) static member tcExpressionFormRequiresObjectConstructor() = (743, GetStringFunc("tcExpressionFormRequiresObjectConstructor",",,,") ) /// Named arguments cannot be given to member trait calls - /// (Originally from ../FSComp.txt:577) + /// (Originally from ..\FSComp.txt:577) static member tcNamedArgumentsCannotBeUsedInMemberTraits() = (744, GetStringFunc("tcNamedArgumentsCannotBeUsedInMemberTraits",",,,") ) /// This is not a valid name for an enumeration case - /// (Originally from ../FSComp.txt:578) + /// (Originally from ..\FSComp.txt:578) static member tcNotValidEnumCaseName() = (745, GetStringFunc("tcNotValidEnumCaseName",",,,") ) /// This field is not mutable - /// (Originally from ../FSComp.txt:579) + /// (Originally from ..\FSComp.txt:579) static member tcFieldIsNotMutable() = (746, GetStringFunc("tcFieldIsNotMutable",",,,") ) /// This construct may only be used within list, array and sequence expressions, e.g. expressions of the form 'seq { ... }', '[ ... ]' or '[| ... |]'. These use the syntax 'for ... in ... do ... yield...' to generate elements - /// (Originally from ../FSComp.txt:580) + /// (Originally from ..\FSComp.txt:580) static member tcConstructRequiresListArrayOrSequence() = (747, GetStringFunc("tcConstructRequiresListArrayOrSequence",",,,") ) /// This construct may only be used within computation expressions. To return a value from an ordinary function simply write the expression without 'return'. - /// (Originally from ../FSComp.txt:581) + /// (Originally from ..\FSComp.txt:581) static member tcConstructRequiresComputationExpressions() = (748, GetStringFunc("tcConstructRequiresComputationExpressions",",,,") ) /// This construct may only be used within sequence or computation expressions - /// (Originally from ../FSComp.txt:582) + /// (Originally from ..\FSComp.txt:582) static member tcConstructRequiresSequenceOrComputations() = (749, GetStringFunc("tcConstructRequiresSequenceOrComputations",",,,") ) /// This construct may only be used within computation expressions - /// (Originally from ../FSComp.txt:583) + /// (Originally from ..\FSComp.txt:583) static member tcConstructRequiresComputationExpression() = (750, GetStringFunc("tcConstructRequiresComputationExpression",",,,") ) /// Invalid indexer expression - /// (Originally from ../FSComp.txt:584) + /// (Originally from ..\FSComp.txt:584) static member tcInvalidIndexerExpression() = (751, GetStringFunc("tcInvalidIndexerExpression",",,,") ) /// The operator 'expr.[idx]' has been used on an object of indeterminate type based on information prior to this program point. Consider adding further type constraints - /// (Originally from ../FSComp.txt:585) + /// (Originally from ..\FSComp.txt:585) static member tcObjectOfIndeterminateTypeUsedRequireTypeConstraint() = (752, GetStringFunc("tcObjectOfIndeterminateTypeUsedRequireTypeConstraint",",,,") ) /// Cannot inherit from a variable type - /// (Originally from ../FSComp.txt:586) + /// (Originally from ..\FSComp.txt:586) static member tcCannotInheritFromVariableType() = (753, GetStringFunc("tcCannotInheritFromVariableType",",,,") ) /// Calls to object constructors on type parameters cannot be given arguments - /// (Originally from ../FSComp.txt:587) + /// (Originally from ..\FSComp.txt:587) static member tcObjectConstructorsOnTypeParametersCannotTakeArguments() = (754, GetStringFunc("tcObjectConstructorsOnTypeParametersCannotTakeArguments",",,,") ) /// The 'CompiledName' attribute cannot be used with this language element - /// (Originally from ../FSComp.txt:588) + /// (Originally from ..\FSComp.txt:588) static member tcCompiledNameAttributeMisused() = (755, GetStringFunc("tcCompiledNameAttributeMisused",",,,") ) /// '%s' may only be used with named types - /// (Originally from ../FSComp.txt:589) + /// (Originally from ..\FSComp.txt:589) static member tcNamedTypeRequired(a0 : System.String) = (756, GetStringFunc("tcNamedTypeRequired",",,,%s,,,") a0) /// 'inherit' cannot be used on interface types. Consider implementing the interface by using 'interface ... with ... end' instead. - /// (Originally from ../FSComp.txt:590) + /// (Originally from ..\FSComp.txt:590) static member tcInheritCannotBeUsedOnInterfaceType() = (757, GetStringFunc("tcInheritCannotBeUsedOnInterfaceType",",,,") ) /// 'new' cannot be used on interface types. Consider using an object expression '{ new ... with ... }' instead. - /// (Originally from ../FSComp.txt:591) + /// (Originally from ..\FSComp.txt:591) static member tcNewCannotBeUsedOnInterfaceType() = (758, GetStringFunc("tcNewCannotBeUsedOnInterfaceType",",,,") ) /// Instances of this type cannot be created since it has been marked abstract or not all methods have been given implementations. Consider using an object expression '{ new ... with ... }' instead. - /// (Originally from ../FSComp.txt:592) + /// (Originally from ..\FSComp.txt:592) static member tcAbstractTypeCannotBeInstantiated() = (759, GetStringFunc("tcAbstractTypeCannotBeInstantiated",",,,") ) /// It is recommended that objects supporting the IDisposable interface are created using the syntax 'new Type(args)', rather than 'Type(args)' or 'Type' as a function value representing the constructor, to indicate that resources may be owned by the generated value - /// (Originally from ../FSComp.txt:593) + /// (Originally from ..\FSComp.txt:593) static member tcIDisposableTypeShouldUseNew() = (760, GetStringFunc("tcIDisposableTypeShouldUseNew",",,,") ) /// '%s' may only be used to construct object types - /// (Originally from ../FSComp.txt:594) + /// (Originally from ..\FSComp.txt:594) static member tcSyntaxCanOnlyBeUsedToCreateObjectTypes(a0 : System.String) = (761, GetStringFunc("tcSyntaxCanOnlyBeUsedToCreateObjectTypes",",,,%s,,,") a0) /// Constructors for the type '%s' must directly or indirectly call its implicit object constructor. Use a call to the implicit object constructor instead of a record expression. - /// (Originally from ../FSComp.txt:595) + /// (Originally from ..\FSComp.txt:595) static member tcConstructorRequiresCall(a0 : System.String) = (762, GetStringFunc("tcConstructorRequiresCall",",,,%s,,,") a0) /// The field '%s' has been given a value, but is not present in the type '%s' - /// (Originally from ../FSComp.txt:596) + /// (Originally from ..\FSComp.txt:596) static member tcUndefinedField(a0 : System.String, a1 : System.String) = (763, GetStringFunc("tcUndefinedField",",,,%s,,,%s,,,") a0 a1) /// No assignment given for field '%s' of type '%s' - /// (Originally from ../FSComp.txt:597) + /// (Originally from ..\FSComp.txt:597) static member tcFieldRequiresAssignment(a0 : System.String, a1 : System.String) = (764, GetStringFunc("tcFieldRequiresAssignment",",,,%s,,,%s,,,") a0 a1) /// Extraneous fields have been given values - /// (Originally from ../FSComp.txt:598) + /// (Originally from ..\FSComp.txt:598) static member tcExtraneousFieldsGivenValues() = (765, GetStringFunc("tcExtraneousFieldsGivenValues",",,,") ) /// Only overrides of abstract and virtual members may be specified in object expressions - /// (Originally from ../FSComp.txt:599) + /// (Originally from ..\FSComp.txt:599) static member tcObjectExpressionsCanOnlyOverrideAbstractOrVirtual() = (766, GetStringFunc("tcObjectExpressionsCanOnlyOverrideAbstractOrVirtual",",,,") ) /// The member '%s' does not correspond to any abstract or virtual method available to override or implement. - /// (Originally from ../FSComp.txt:600) + /// (Originally from ..\FSComp.txt:600) static member tcNoAbstractOrVirtualMemberFound(a0 : System.String) = (767, GetStringFunc("tcNoAbstractOrVirtualMemberFound",",,,%s,,,") a0) /// The type %s contains the member '%s' but it is not a virtual or abstract method that is available to override or implement. - /// (Originally from ../FSComp.txt:601) + /// (Originally from ..\FSComp.txt:601) static member tcMemberFoundIsNotAbstractOrVirtual(a0 : System.String, a1 : System.String) = (767, GetStringFunc("tcMemberFoundIsNotAbstractOrVirtual",",,,%s,,,%s,,,") a0 a1) /// The member '%s' does not accept the correct number of arguments. %d argument(s) are expected, but %d were given. The required signature is '%s'.%s - /// (Originally from ../FSComp.txt:602) + /// (Originally from ..\FSComp.txt:602) static member tcArgumentArityMismatch(a0 : System.String, a1 : System.Int32, a2 : System.Int32, a3 : System.String, a4 : System.String) = (768, GetStringFunc("tcArgumentArityMismatch",",,,%s,,,%d,,,%d,,,%s,,,%s,,,") a0 a1 a2 a3 a4) /// The member '%s' does not accept the correct number of arguments. One overload accepts %d arguments, but %d were given. The required signature is '%s'.%s - /// (Originally from ../FSComp.txt:603) + /// (Originally from ..\FSComp.txt:603) static member tcArgumentArityMismatchOneOverload(a0 : System.String, a1 : System.Int32, a2 : System.Int32, a3 : System.String, a4 : System.String) = (769, GetStringFunc("tcArgumentArityMismatchOneOverload",",,,%s,,,%d,,,%d,,,%s,,,%s,,,") a0 a1 a2 a3 a4) /// A simple method name is required here - /// (Originally from ../FSComp.txt:604) + /// (Originally from ..\FSComp.txt:604) static member tcSimpleMethodNameRequired() = (770, GetStringFunc("tcSimpleMethodNameRequired",",,,") ) /// The types System.ValueType, System.Enum, System.Delegate, System.MulticastDelegate and System.Array cannot be used as super types in an object expression or class - /// (Originally from ../FSComp.txt:605) + /// (Originally from ..\FSComp.txt:605) static member tcPredefinedTypeCannotBeUsedAsSuperType() = (771, GetStringFunc("tcPredefinedTypeCannotBeUsedAsSuperType",",,,") ) /// 'new' must be used with a named type - /// (Originally from ../FSComp.txt:606) + /// (Originally from ..\FSComp.txt:606) static member tcNewMustBeUsedWithNamedType() = (772, GetStringFunc("tcNewMustBeUsedWithNamedType",",,,") ) /// Cannot create an extension of a sealed type - /// (Originally from ../FSComp.txt:607) + /// (Originally from ..\FSComp.txt:607) static member tcCannotCreateExtensionOfSealedType() = (773, GetStringFunc("tcCannotCreateExtensionOfSealedType",",,,") ) /// No arguments may be given when constructing a record value - /// (Originally from ../FSComp.txt:608) + /// (Originally from ..\FSComp.txt:608) static member tcNoArgumentsForRecordValue() = (774, GetStringFunc("tcNoArgumentsForRecordValue",",,,") ) /// Interface implementations cannot be given on construction expressions - /// (Originally from ../FSComp.txt:609) + /// (Originally from ..\FSComp.txt:609) static member tcNoInterfaceImplementationForConstructionExpression() = (775, GetStringFunc("tcNoInterfaceImplementationForConstructionExpression",",,,") ) /// Object construction expressions may only be used to implement constructors in class types - /// (Originally from ../FSComp.txt:610) + /// (Originally from ..\FSComp.txt:610) static member tcObjectConstructionCanOnlyBeUsedInClassTypes() = (776, GetStringFunc("tcObjectConstructionCanOnlyBeUsedInClassTypes",",,,") ) /// Only simple bindings of the form 'id = expr' can be used in construction expressions - /// (Originally from ../FSComp.txt:611) + /// (Originally from ..\FSComp.txt:611) static member tcOnlySimpleBindingsCanBeUsedInConstructionExpressions() = (777, GetStringFunc("tcOnlySimpleBindingsCanBeUsedInConstructionExpressions",",,,") ) /// Objects must be initialized by an object construction expression that calls an inherited object constructor and assigns a value to each field - /// (Originally from ../FSComp.txt:612) + /// (Originally from ..\FSComp.txt:612) static member tcObjectsMustBeInitializedWithObjectExpression() = (778, GetStringFunc("tcObjectsMustBeInitializedWithObjectExpression",",,,") ) /// Expected an interface type - /// (Originally from ../FSComp.txt:613) + /// (Originally from ..\FSComp.txt:613) static member tcExpectedInterfaceType() = (779, GetStringFunc("tcExpectedInterfaceType",",,,") ) /// Constructor expressions for interfaces do not take arguments - /// (Originally from ../FSComp.txt:614) + /// (Originally from ..\FSComp.txt:614) static member tcConstructorForInterfacesDoNotTakeArguments() = (780, GetStringFunc("tcConstructorForInterfacesDoNotTakeArguments",",,,") ) /// This object constructor requires arguments - /// (Originally from ../FSComp.txt:615) + /// (Originally from ..\FSComp.txt:615) static member tcConstructorRequiresArguments() = (781, GetStringFunc("tcConstructorRequiresArguments",",,,") ) /// 'new' may only be used with object constructors - /// (Originally from ../FSComp.txt:616) + /// (Originally from ..\FSComp.txt:616) static member tcNewRequiresObjectConstructor() = (782, GetStringFunc("tcNewRequiresObjectConstructor",",,,") ) /// At least one override did not correctly implement its corresponding abstract member - /// (Originally from ../FSComp.txt:617) + /// (Originally from ..\FSComp.txt:617) static member tcAtLeastOneOverrideIsInvalid() = (783, GetStringFunc("tcAtLeastOneOverrideIsInvalid",",,,") ) /// This numeric literal requires that a module '%s' defining functions FromZero, FromOne, FromInt32, FromInt64 and FromString be in scope - /// (Originally from ../FSComp.txt:618) + /// (Originally from ..\FSComp.txt:618) static member tcNumericLiteralRequiresModule(a0 : System.String) = (784, GetStringFunc("tcNumericLiteralRequiresModule",",,,%s,,,") a0) /// Invalid record construction - /// (Originally from ../FSComp.txt:619) + /// (Originally from ..\FSComp.txt:619) static member tcInvalidRecordConstruction() = (785, GetStringFunc("tcInvalidRecordConstruction",",,,") ) /// The expression form { expr with ... } may only be used with record types. To build object types use { new Type(...) with ... } - /// (Originally from ../FSComp.txt:620) + /// (Originally from ..\FSComp.txt:620) static member tcExpressionFormRequiresRecordTypes() = (786, GetStringFunc("tcExpressionFormRequiresRecordTypes",",,,") ) /// The inherited type is not an object model type - /// (Originally from ../FSComp.txt:621) + /// (Originally from ..\FSComp.txt:621) static member tcInheritedTypeIsNotObjectModelType() = (787, GetStringFunc("tcInheritedTypeIsNotObjectModelType",",,,") ) /// Object construction expressions (i.e. record expressions with inheritance specifications) may only be used to implement constructors in object model types. Use 'new ObjectType(args)' to construct instances of object model types outside of constructors - /// (Originally from ../FSComp.txt:622) + /// (Originally from ..\FSComp.txt:622) static member tcObjectConstructionExpressionCanOnlyImplementConstructorsInObjectModelTypes() = (788, GetStringFunc("tcObjectConstructionExpressionCanOnlyImplementConstructorsInObjectModelTypes",",,,") ) /// '{ }' is not a valid expression. Records must include at least one field. Empty sequences are specified by using Seq.empty or an empty list '[]'. - /// (Originally from ../FSComp.txt:623) + /// (Originally from ..\FSComp.txt:623) static member tcEmptyRecordInvalid() = (789, GetStringFunc("tcEmptyRecordInvalid",",,,") ) /// This type is not a record type. Values of class and struct types must be created using calls to object constructors. - /// (Originally from ../FSComp.txt:624) + /// (Originally from ..\FSComp.txt:624) static member tcTypeIsNotARecordTypeNeedConstructor() = (790, GetStringFunc("tcTypeIsNotARecordTypeNeedConstructor",",,,") ) /// This type is not a record type - /// (Originally from ../FSComp.txt:625) + /// (Originally from ..\FSComp.txt:625) static member tcTypeIsNotARecordType() = (791, GetStringFunc("tcTypeIsNotARecordType",",,,") ) /// This construct is ambiguous as part of a computation expression. Nested expressions may be written using 'let _ = (...)' and nested computations using 'let! res = builder { ... }'. - /// (Originally from ../FSComp.txt:626) + /// (Originally from ..\FSComp.txt:626) static member tcConstructIsAmbiguousInComputationExpression() = (792, GetStringFunc("tcConstructIsAmbiguousInComputationExpression",",,,") ) /// This construct is ambiguous as part of a sequence expression. Nested expressions may be written using 'let _ = (...)' and nested sequences using 'yield! seq {... }'. - /// (Originally from ../FSComp.txt:627) + /// (Originally from ..\FSComp.txt:627) static member tcConstructIsAmbiguousInSequenceExpression() = (793, GetStringFunc("tcConstructIsAmbiguousInSequenceExpression",",,,") ) /// 'do!' cannot be used within sequence expressions - /// (Originally from ../FSComp.txt:628) + /// (Originally from ..\FSComp.txt:628) static member tcDoBangIllegalInSequenceExpression() = (794, GetStringFunc("tcDoBangIllegalInSequenceExpression",",,,") ) /// The use of 'let! x = coll' in sequence expressions is not permitted. Use 'for x in coll' instead. - /// (Originally from ../FSComp.txt:629) + /// (Originally from ..\FSComp.txt:629) static member tcUseForInSequenceExpression() = (795, GetStringFunc("tcUseForInSequenceExpression",",,,") ) /// 'try'/'with' cannot be used within sequence expressions - /// (Originally from ../FSComp.txt:630) + /// (Originally from ..\FSComp.txt:630) static member tcTryIllegalInSequenceExpression() = (796, GetStringFunc("tcTryIllegalInSequenceExpression",",,,") ) /// In sequence expressions, multiple results are generated using 'yield!' - /// (Originally from ../FSComp.txt:631) + /// (Originally from ..\FSComp.txt:631) static member tcUseYieldBangForMultipleResults() = (797, GetStringFunc("tcUseYieldBangForMultipleResults",",,,") ) /// Invalid assignment - /// (Originally from ../FSComp.txt:632) + /// (Originally from ..\FSComp.txt:632) static member tcInvalidAssignment() = (799, GetStringFunc("tcInvalidAssignment",",,,") ) /// Invalid use of a type name - /// (Originally from ../FSComp.txt:633) + /// (Originally from ..\FSComp.txt:633) static member tcInvalidUseOfTypeName() = (800, GetStringFunc("tcInvalidUseOfTypeName",",,,") ) /// This type has no accessible object constructors - /// (Originally from ../FSComp.txt:634) + /// (Originally from ..\FSComp.txt:634) static member tcTypeHasNoAccessibleConstructor() = (801, GetStringFunc("tcTypeHasNoAccessibleConstructor",",,,") ) /// Invalid use of an interface type - /// (Originally from ../FSComp.txt:637) + /// (Originally from ..\FSComp.txt:637) static member tcInvalidUseOfInterfaceType() = (804, GetStringFunc("tcInvalidUseOfInterfaceType",",,,") ) /// Invalid use of a delegate constructor. Use the syntax 'new Type(args)' or just 'Type(args)'. - /// (Originally from ../FSComp.txt:638) + /// (Originally from ..\FSComp.txt:638) static member tcInvalidUseOfDelegate() = (805, GetStringFunc("tcInvalidUseOfDelegate",",,,") ) /// Property '%s' is not static - /// (Originally from ../FSComp.txt:639) + /// (Originally from ..\FSComp.txt:639) static member tcPropertyIsNotStatic(a0 : System.String) = (806, GetStringFunc("tcPropertyIsNotStatic",",,,%s,,,") a0) /// Property '%s' is not readable - /// (Originally from ../FSComp.txt:640) + /// (Originally from ..\FSComp.txt:640) static member tcPropertyIsNotReadable(a0 : System.String) = (807, GetStringFunc("tcPropertyIsNotReadable",",,,%s,,,") a0) /// This lookup cannot be used here - /// (Originally from ../FSComp.txt:641) + /// (Originally from ..\FSComp.txt:641) static member tcLookupMayNotBeUsedHere() = (808, GetStringFunc("tcLookupMayNotBeUsedHere",",,,") ) /// Property '%s' is static - /// (Originally from ../FSComp.txt:642) + /// (Originally from ..\FSComp.txt:642) static member tcPropertyIsStatic(a0 : System.String) = (809, GetStringFunc("tcPropertyIsStatic",",,,%s,,,") a0) /// Property '%s' cannot be set - /// (Originally from ../FSComp.txt:643) + /// (Originally from ..\FSComp.txt:643) static member tcPropertyCannotBeSet1(a0 : System.String) = (810, GetStringFunc("tcPropertyCannotBeSet1",",,,%s,,,") a0) /// Constructors must be applied to arguments and cannot be used as first-class values. If necessary use an anonymous function '(fun arg1 ... argN -> new Type(arg1,...,argN))'. - /// (Originally from ../FSComp.txt:644) + /// (Originally from ..\FSComp.txt:644) static member tcConstructorsCannotBeFirstClassValues() = (811, GetStringFunc("tcConstructorsCannotBeFirstClassValues",",,,") ) /// The syntax 'expr.id' may only be used with record labels, properties and fields - /// (Originally from ../FSComp.txt:645) + /// (Originally from ..\FSComp.txt:645) static member tcSyntaxFormUsedOnlyWithRecordLabelsPropertiesAndFields() = (812, GetStringFunc("tcSyntaxFormUsedOnlyWithRecordLabelsPropertiesAndFields",",,,") ) /// Event '%s' is static - /// (Originally from ../FSComp.txt:646) + /// (Originally from ..\FSComp.txt:646) static member tcEventIsStatic(a0 : System.String) = (813, GetStringFunc("tcEventIsStatic",",,,%s,,,") a0) /// Event '%s' is not static - /// (Originally from ../FSComp.txt:647) + /// (Originally from ..\FSComp.txt:647) static member tcEventIsNotStatic(a0 : System.String) = (814, GetStringFunc("tcEventIsNotStatic",",,,%s,,,") a0) /// The named argument '%s' did not match any argument or mutable property - /// (Originally from ../FSComp.txt:648) + /// (Originally from ..\FSComp.txt:648) static member tcNamedArgumentDidNotMatch(a0 : System.String) = (815, GetStringFunc("tcNamedArgumentDidNotMatch",",,,%s,,,") a0) /// One or more of the overloads of this method has curried arguments. Consider redesigning these members to take arguments in tupled form. - /// (Originally from ../FSComp.txt:649) + /// (Originally from ..\FSComp.txt:649) static member tcOverloadsCannotHaveCurriedArguments() = (816, GetStringFunc("tcOverloadsCannotHaveCurriedArguments",",,,") ) /// The unnamed arguments do not form a prefix of the arguments of the method called - /// (Originally from ../FSComp.txt:650) + /// (Originally from ..\FSComp.txt:650) static member tcUnnamedArgumentsDoNotFormPrefix() = (GetStringFunc("tcUnnamedArgumentsDoNotFormPrefix",",,,") ) /// Static optimization conditionals are only for use within the F# library - /// (Originally from ../FSComp.txt:651) + /// (Originally from ..\FSComp.txt:651) static member tcStaticOptimizationConditionalsOnlyForFSharpLibrary() = (817, GetStringFunc("tcStaticOptimizationConditionalsOnlyForFSharpLibrary",",,,") ) /// The corresponding formal argument is not optional - /// (Originally from ../FSComp.txt:652) + /// (Originally from ..\FSComp.txt:652) static member tcFormalArgumentIsNotOptional() = (818, GetStringFunc("tcFormalArgumentIsNotOptional",",,,") ) /// Invalid optional assignment to a property or field - /// (Originally from ../FSComp.txt:653) + /// (Originally from ..\FSComp.txt:653) static member tcInvalidOptionalAssignmentToPropertyOrField() = (819, GetStringFunc("tcInvalidOptionalAssignmentToPropertyOrField",",,,") ) /// A delegate constructor must be passed a single function value - /// (Originally from ../FSComp.txt:654) + /// (Originally from ..\FSComp.txt:654) static member tcDelegateConstructorMustBePassed() = (820, GetStringFunc("tcDelegateConstructorMustBePassed",",,,") ) /// A binding cannot be marked both 'use' and 'rec' - /// (Originally from ../FSComp.txt:655) + /// (Originally from ..\FSComp.txt:655) static member tcBindingCannotBeUseAndRec() = (821, GetStringFunc("tcBindingCannotBeUseAndRec",",,,") ) /// The 'VolatileField' attribute may only be used on 'let' bindings in classes - /// (Originally from ../FSComp.txt:656) + /// (Originally from ..\FSComp.txt:656) static member tcVolatileOnlyOnClassLetBindings() = (823, GetStringFunc("tcVolatileOnlyOnClassLetBindings",",,,") ) /// Attributes are not permitted on 'let' bindings in expressions - /// (Originally from ../FSComp.txt:657) + /// (Originally from ..\FSComp.txt:657) static member tcAttributesAreNotPermittedOnLetBindings() = (824, GetStringFunc("tcAttributesAreNotPermittedOnLetBindings",",,,") ) /// The 'DefaultValue' attribute may only be used on 'val' declarations - /// (Originally from ../FSComp.txt:658) + /// (Originally from ..\FSComp.txt:658) static member tcDefaultValueAttributeRequiresVal() = (825, GetStringFunc("tcDefaultValueAttributeRequiresVal",",,,") ) /// The 'ConditionalAttribute' attribute may only be used on members - /// (Originally from ../FSComp.txt:659) + /// (Originally from ..\FSComp.txt:659) static member tcConditionalAttributeRequiresMembers() = (826, GetStringFunc("tcConditionalAttributeRequiresMembers",",,,") ) /// This is not a valid name for an active pattern - /// (Originally from ../FSComp.txt:660) + /// (Originally from ..\FSComp.txt:660) static member tcInvalidActivePatternName() = (827, GetStringFunc("tcInvalidActivePatternName",",,,") ) /// The 'EntryPointAttribute' attribute may only be used on function definitions in modules - /// (Originally from ../FSComp.txt:661) + /// (Originally from ..\FSComp.txt:661) static member tcEntryPointAttributeRequiresFunctionInModule() = (828, GetStringFunc("tcEntryPointAttributeRequiresFunctionInModule",",,,") ) /// Mutable values cannot be marked 'inline' - /// (Originally from ../FSComp.txt:662) + /// (Originally from ..\FSComp.txt:662) static member tcMutableValuesCannotBeInline() = (829, GetStringFunc("tcMutableValuesCannotBeInline",",,,") ) /// Mutable values cannot have generic parameters - /// (Originally from ../FSComp.txt:663) + /// (Originally from ..\FSComp.txt:663) static member tcMutableValuesMayNotHaveGenericParameters() = (830, GetStringFunc("tcMutableValuesMayNotHaveGenericParameters",",,,") ) /// Mutable function values should be written 'let mutable f = (fun args -> ...)' - /// (Originally from ../FSComp.txt:664) + /// (Originally from ..\FSComp.txt:664) static member tcMutableValuesSyntax() = (831, GetStringFunc("tcMutableValuesSyntax",",,,") ) /// Only functions may be marked 'inline' - /// (Originally from ../FSComp.txt:665) + /// (Originally from ..\FSComp.txt:665) static member tcOnlyFunctionsCanBeInline() = (832, GetStringFunc("tcOnlyFunctionsCanBeInline",",,,") ) /// A literal value cannot be given the [] or [] attributes - /// (Originally from ../FSComp.txt:666) + /// (Originally from ..\FSComp.txt:666) static member tcIllegalAttributesForLiteral() = (833, GetStringFunc("tcIllegalAttributesForLiteral",",,,") ) /// A literal value cannot be marked 'mutable' - /// (Originally from ../FSComp.txt:667) + /// (Originally from ..\FSComp.txt:667) static member tcLiteralCannotBeMutable() = (834, GetStringFunc("tcLiteralCannotBeMutable",",,,") ) /// A literal value cannot be marked 'inline' - /// (Originally from ../FSComp.txt:668) + /// (Originally from ..\FSComp.txt:668) static member tcLiteralCannotBeInline() = (835, GetStringFunc("tcLiteralCannotBeInline",",,,") ) /// Literal values cannot have generic parameters - /// (Originally from ../FSComp.txt:669) + /// (Originally from ..\FSComp.txt:669) static member tcLiteralCannotHaveGenericParameters() = (836, GetStringFunc("tcLiteralCannotHaveGenericParameters",",,,") ) /// This is not a valid constant expression - /// (Originally from ../FSComp.txt:670) + /// (Originally from ..\FSComp.txt:670) static member tcInvalidConstantExpression() = (837, GetStringFunc("tcInvalidConstantExpression",",,,") ) /// This type is not accessible from this code location - /// (Originally from ../FSComp.txt:671) + /// (Originally from ..\FSComp.txt:671) static member tcTypeIsInaccessible() = (838, GetStringFunc("tcTypeIsInaccessible",",,,") ) /// Unexpected condition in imported assembly: failed to decode AttributeUsage attribute - /// (Originally from ../FSComp.txt:672) + /// (Originally from ..\FSComp.txt:672) static member tcUnexpectedConditionInImportedAssembly() = (839, GetStringFunc("tcUnexpectedConditionInImportedAssembly",",,,") ) /// Unrecognized attribute target. Valid attribute targets are 'assembly', 'module', 'type', 'method', 'property', 'return', 'param', 'field', 'event', 'constructor'. - /// (Originally from ../FSComp.txt:673) + /// (Originally from ..\FSComp.txt:673) static member tcUnrecognizedAttributeTarget() = (840, GetStringFunc("tcUnrecognizedAttributeTarget",",,,") ) /// This attribute is not valid for use on this language element. Assembly attributes should be attached to a 'do ()' declaration, if necessary within an F# module. - /// (Originally from ../FSComp.txt:674) + /// (Originally from ..\FSComp.txt:674) static member tcAttributeIsNotValidForLanguageElementUseDo() = (841, GetStringFunc("tcAttributeIsNotValidForLanguageElementUseDo",",,,") ) /// This attribute is not valid for use on this language element - /// (Originally from ../FSComp.txt:675) + /// (Originally from ..\FSComp.txt:675) static member tcAttributeIsNotValidForLanguageElement() = (842, GetStringFunc("tcAttributeIsNotValidForLanguageElement",",,,") ) /// Optional arguments cannot be used in custom attributes - /// (Originally from ../FSComp.txt:676) + /// (Originally from ..\FSComp.txt:676) static member tcOptionalArgumentsCannotBeUsedInCustomAttribute() = (843, GetStringFunc("tcOptionalArgumentsCannotBeUsedInCustomAttribute",",,,") ) /// This property cannot be set - /// (Originally from ../FSComp.txt:677) + /// (Originally from ..\FSComp.txt:677) static member tcPropertyCannotBeSet0() = (844, GetStringFunc("tcPropertyCannotBeSet0",",,,") ) /// This property or field was not found on this custom attribute type - /// (Originally from ../FSComp.txt:678) + /// (Originally from ..\FSComp.txt:678) static member tcPropertyOrFieldNotFoundInAttribute() = (845, GetStringFunc("tcPropertyOrFieldNotFoundInAttribute",",,,") ) /// A custom attribute must be a reference type - /// (Originally from ../FSComp.txt:679) + /// (Originally from ..\FSComp.txt:679) static member tcCustomAttributeMustBeReferenceType() = (846, GetStringFunc("tcCustomAttributeMustBeReferenceType",",,,") ) /// The number of args for a custom attribute does not match the expected number of args for the attribute constructor - /// (Originally from ../FSComp.txt:680) + /// (Originally from ..\FSComp.txt:680) static member tcCustomAttributeArgumentMismatch() = (847, GetStringFunc("tcCustomAttributeArgumentMismatch",",,,") ) /// A custom attribute must invoke an object constructor - /// (Originally from ../FSComp.txt:681) + /// (Originally from ..\FSComp.txt:681) static member tcCustomAttributeMustInvokeConstructor() = (848, GetStringFunc("tcCustomAttributeMustInvokeConstructor",",,,") ) /// Attribute expressions must be calls to object constructors - /// (Originally from ../FSComp.txt:682) + /// (Originally from ..\FSComp.txt:682) static member tcAttributeExpressionsMustBeConstructorCalls() = (849, GetStringFunc("tcAttributeExpressionsMustBeConstructorCalls",",,,") ) /// This attribute cannot be used in this version of F# - /// (Originally from ../FSComp.txt:683) + /// (Originally from ..\FSComp.txt:683) static member tcUnsupportedAttribute() = (850, GetStringFunc("tcUnsupportedAttribute",",,,") ) /// Invalid inline specification - /// (Originally from ../FSComp.txt:684) + /// (Originally from ..\FSComp.txt:684) static member tcInvalidInlineSpecification() = (851, GetStringFunc("tcInvalidInlineSpecification",",,,") ) /// 'use' bindings must be of the form 'use = ' - /// (Originally from ../FSComp.txt:685) + /// (Originally from ..\FSComp.txt:685) static member tcInvalidUseBinding() = (852, GetStringFunc("tcInvalidUseBinding",",,,") ) /// Abstract members are not permitted in an augmentation - they must be defined as part of the type itself - /// (Originally from ../FSComp.txt:686) + /// (Originally from ..\FSComp.txt:686) static member tcAbstractMembersIllegalInAugmentation() = (853, GetStringFunc("tcAbstractMembersIllegalInAugmentation",",,,") ) /// Method overrides and interface implementations are not permitted here - /// (Originally from ../FSComp.txt:687) + /// (Originally from ..\FSComp.txt:687) static member tcMethodOverridesIllegalHere() = (854, GetStringFunc("tcMethodOverridesIllegalHere",",,,") ) /// No abstract or interface member was found that corresponds to this override - /// (Originally from ../FSComp.txt:688) + /// (Originally from ..\FSComp.txt:688) static member tcNoMemberFoundForOverride() = (855, GetStringFunc("tcNoMemberFoundForOverride",",,,") ) /// This override takes a different number of arguments to the corresponding abstract member. The following abstract members were found:%s - /// (Originally from ../FSComp.txt:689) + /// (Originally from ..\FSComp.txt:689) static member tcOverrideArityMismatch(a0 : System.String) = (856, GetStringFunc("tcOverrideArityMismatch",",,,%s,,,") a0) /// This method already has a default implementation - /// (Originally from ../FSComp.txt:690) + /// (Originally from ..\FSComp.txt:690) static member tcDefaultImplementationAlreadyExists() = (857, GetStringFunc("tcDefaultImplementationAlreadyExists",",,,") ) /// The method implemented by this default is ambiguous - /// (Originally from ../FSComp.txt:691) + /// (Originally from ..\FSComp.txt:691) static member tcDefaultAmbiguous() = (858, GetStringFunc("tcDefaultAmbiguous",",,,") ) /// No abstract property was found that corresponds to this override - /// (Originally from ../FSComp.txt:692) + /// (Originally from ..\FSComp.txt:692) static member tcNoPropertyFoundForOverride() = (859, GetStringFunc("tcNoPropertyFoundForOverride",",,,") ) /// This property overrides or implements an abstract property but the abstract property doesn't have a corresponding %s - /// (Originally from ../FSComp.txt:693) + /// (Originally from ..\FSComp.txt:693) static member tcAbstractPropertyMissingGetOrSet(a0 : System.String) = (860, GetStringFunc("tcAbstractPropertyMissingGetOrSet",",,,%s,,,") a0) /// Invalid signature for set member - /// (Originally from ../FSComp.txt:694) + /// (Originally from ..\FSComp.txt:694) static member tcInvalidSignatureForSet() = (861, GetStringFunc("tcInvalidSignatureForSet",",,,") ) /// This new member hides the abstract member '%s'. Rename the member or use 'override' instead. - /// (Originally from ../FSComp.txt:695) + /// (Originally from ..\FSComp.txt:695) static member tcNewMemberHidesAbstractMember(a0 : System.String) = (864, GetStringFunc("tcNewMemberHidesAbstractMember",",,,%s,,,") a0) /// This new member hides the abstract member '%s' once tuples, functions, units of measure and/or provided types are erased. Rename the member or use 'override' instead. - /// (Originally from ../FSComp.txt:696) + /// (Originally from ..\FSComp.txt:696) static member tcNewMemberHidesAbstractMemberWithSuffix(a0 : System.String) = (864, GetStringFunc("tcNewMemberHidesAbstractMemberWithSuffix",",,,%s,,,") a0) /// Interfaces cannot contain definitions of static initializers - /// (Originally from ../FSComp.txt:697) + /// (Originally from ..\FSComp.txt:697) static member tcStaticInitializersIllegalInInterface() = (865, GetStringFunc("tcStaticInitializersIllegalInInterface",",,,") ) /// Interfaces cannot contain definitions of object constructors - /// (Originally from ../FSComp.txt:698) + /// (Originally from ..\FSComp.txt:698) static member tcObjectConstructorsIllegalInInterface() = (866, GetStringFunc("tcObjectConstructorsIllegalInInterface",",,,") ) /// Interfaces cannot contain definitions of member overrides - /// (Originally from ../FSComp.txt:699) + /// (Originally from ..\FSComp.txt:699) static member tcMemberOverridesIllegalInInterface() = (867, GetStringFunc("tcMemberOverridesIllegalInInterface",",,,") ) /// Interfaces cannot contain definitions of concrete members. You may need to define a constructor on your type to indicate that the type is a class. - /// (Originally from ../FSComp.txt:700) + /// (Originally from ..\FSComp.txt:700) static member tcConcreteMembersIllegalInInterface() = (868, GetStringFunc("tcConcreteMembersIllegalInInterface",",,,") ) /// Constructors cannot be specified in exception augmentations - /// (Originally from ../FSComp.txt:701) + /// (Originally from ..\FSComp.txt:701) static member tcConstructorsDisallowedInExceptionAugmentation() = (869, GetStringFunc("tcConstructorsDisallowedInExceptionAugmentation",",,,") ) /// Structs cannot have an object constructor with no arguments. This is a restriction imposed on all CLI languages as structs automatically support a default constructor. - /// (Originally from ../FSComp.txt:702) + /// (Originally from ..\FSComp.txt:702) static member tcStructsCannotHaveConstructorWithNoArguments() = (870, GetStringFunc("tcStructsCannotHaveConstructorWithNoArguments",",,,") ) /// Constructors cannot be defined for this type - /// (Originally from ../FSComp.txt:703) + /// (Originally from ..\FSComp.txt:703) static member tcConstructorsIllegalForThisType() = (871, GetStringFunc("tcConstructorsIllegalForThisType",",,,") ) /// Recursive bindings that include member specifications can only occur as a direct augmentation of a type - /// (Originally from ../FSComp.txt:704) + /// (Originally from ..\FSComp.txt:704) static member tcRecursiveBindingsWithMembersMustBeDirectAugmentation() = (872, GetStringFunc("tcRecursiveBindingsWithMembersMustBeDirectAugmentation",",,,") ) /// Only simple variable patterns can be bound in 'let rec' constructs - /// (Originally from ../FSComp.txt:705) + /// (Originally from ..\FSComp.txt:705) static member tcOnlySimplePatternsInLetRec() = (873, GetStringFunc("tcOnlySimplePatternsInLetRec",",,,") ) /// Only record fields and simple, non-recursive 'let' bindings may be marked mutable - /// (Originally from ../FSComp.txt:706) + /// (Originally from ..\FSComp.txt:706) static member tcOnlyRecordFieldsAndSimpleLetCanBeMutable() = (874, GetStringFunc("tcOnlyRecordFieldsAndSimpleLetCanBeMutable",",,,") ) /// This member is not sufficiently generic - /// (Originally from ../FSComp.txt:707) + /// (Originally from ..\FSComp.txt:707) static member tcMemberIsNotSufficientlyGeneric() = (875, GetStringFunc("tcMemberIsNotSufficientlyGeneric",",,,") ) /// A declaration may only be the [] attribute if a constant value is also given, e.g. 'val x : int = 1' - /// (Originally from ../FSComp.txt:708) + /// (Originally from ..\FSComp.txt:708) static member tcLiteralAttributeRequiresConstantValue() = (876, GetStringFunc("tcLiteralAttributeRequiresConstantValue",",,,") ) /// A declaration may only be given a value in a signature if the declaration has the [] attribute - /// (Originally from ../FSComp.txt:709) + /// (Originally from ..\FSComp.txt:709) static member tcValueInSignatureRequiresLiteralAttribute() = (877, GetStringFunc("tcValueInSignatureRequiresLiteralAttribute",",,,") ) /// Thread-static and context-static variables must be static and given the [] attribute to indicate that the value is initialized to the default value on each new thread - /// (Originally from ../FSComp.txt:710) + /// (Originally from ..\FSComp.txt:710) static member tcThreadStaticAndContextStaticMustBeStatic() = (878, GetStringFunc("tcThreadStaticAndContextStaticMustBeStatic",",,,") ) /// Volatile fields must be marked 'mutable' and cannot be thread-static - /// (Originally from ../FSComp.txt:711) + /// (Originally from ..\FSComp.txt:711) static member tcVolatileFieldsMustBeMutable() = (879, GetStringFunc("tcVolatileFieldsMustBeMutable",",,,") ) /// Uninitialized 'val' fields must be mutable and marked with the '[]' attribute. Consider using a 'let' binding instead of a 'val' field. - /// (Originally from ../FSComp.txt:712) + /// (Originally from ..\FSComp.txt:712) static member tcUninitializedValFieldsMustBeMutable() = (880, GetStringFunc("tcUninitializedValFieldsMustBeMutable",",,,") ) /// Static 'val' fields in types must be mutable, private and marked with the '[]' attribute. They are initialized to the 'null' or 'zero' value for their type. Consider also using a 'static let mutable' binding in a class type. - /// (Originally from ../FSComp.txt:713) + /// (Originally from ..\FSComp.txt:713) static member tcStaticValFieldsMustBeMutableAndPrivate() = (881, GetStringFunc("tcStaticValFieldsMustBeMutableAndPrivate",",,,") ) /// This field requires a name - /// (Originally from ../FSComp.txt:714) + /// (Originally from ..\FSComp.txt:714) static member tcFieldRequiresName() = (882, GetStringFunc("tcFieldRequiresName",",,,") ) /// Invalid namespace, module, type or union case name - /// (Originally from ../FSComp.txt:715) + /// (Originally from ..\FSComp.txt:715) static member tcInvalidNamespaceModuleTypeUnionName() = (883, GetStringFunc("tcInvalidNamespaceModuleTypeUnionName",",,,") ) /// Explicit type declarations for constructors must be of the form 'ty1 * ... * tyN -> resTy'. Parentheses may be required around 'resTy' - /// (Originally from ../FSComp.txt:716) + /// (Originally from ..\FSComp.txt:716) static member tcIllegalFormForExplicitTypeDeclaration() = (884, GetStringFunc("tcIllegalFormForExplicitTypeDeclaration",",,,") ) /// Return types of union cases must be identical to the type being defined, up to abbreviations - /// (Originally from ../FSComp.txt:717) + /// (Originally from ..\FSComp.txt:717) static member tcReturnTypesForUnionMustBeSameAsType() = (885, GetStringFunc("tcReturnTypesForUnionMustBeSameAsType",",,,") ) /// This is not a valid value for an enumeration literal - /// (Originally from ../FSComp.txt:718) + /// (Originally from ..\FSComp.txt:718) static member tcInvalidEnumerationLiteral() = (886, GetStringFunc("tcInvalidEnumerationLiteral",",,,") ) /// The type '%s' is not an interface type - /// (Originally from ../FSComp.txt:719) + /// (Originally from ..\FSComp.txt:719) static member tcTypeIsNotInterfaceType1(a0 : System.String) = (887, GetStringFunc("tcTypeIsNotInterfaceType1",",,,%s,,,") a0) /// Duplicate specification of an interface - /// (Originally from ../FSComp.txt:720) + /// (Originally from ..\FSComp.txt:720) static member tcDuplicateSpecOfInterface() = (888, GetStringFunc("tcDuplicateSpecOfInterface",",,,") ) /// A field/val declaration is not permitted here - /// (Originally from ../FSComp.txt:721) + /// (Originally from ..\FSComp.txt:721) static member tcFieldValIllegalHere() = (889, GetStringFunc("tcFieldValIllegalHere",",,,") ) /// A inheritance declaration is not permitted here - /// (Originally from ../FSComp.txt:722) + /// (Originally from ..\FSComp.txt:722) static member tcInheritIllegalHere() = (890, GetStringFunc("tcInheritIllegalHere",",,,") ) /// This declaration opens the module '%s', which is marked as 'RequireQualifiedAccess'. Adjust your code to use qualified references to the elements of the module instead, e.g. 'List.map' instead of 'map'. This change will ensure that your code is robust as new constructs are added to libraries. - /// (Originally from ../FSComp.txt:723) + /// (Originally from ..\FSComp.txt:723) static member tcModuleRequiresQualifiedAccess(a0 : System.String) = (892, GetStringFunc("tcModuleRequiresQualifiedAccess",",,,%s,,,") a0) /// This declaration opens the namespace or module '%s' through a partially qualified path. Adjust this code to use the full path of the namespace. This change will make your code more robust as new constructs are added to the F# and CLI libraries. - /// (Originally from ../FSComp.txt:724) + /// (Originally from ..\FSComp.txt:724) static member tcOpenUsedWithPartiallyQualifiedPath(a0 : System.String) = (893, GetStringFunc("tcOpenUsedWithPartiallyQualifiedPath",",,,%s,,,") a0) /// Local class bindings cannot be marked inline. Consider lifting the definition out of the class or else do not mark it as inline. - /// (Originally from ../FSComp.txt:725) + /// (Originally from ..\FSComp.txt:725) static member tcLocalClassBindingsCannotBeInline() = (894, GetStringFunc("tcLocalClassBindingsCannotBeInline",",,,") ) /// Type abbreviations cannot have members - /// (Originally from ../FSComp.txt:726) + /// (Originally from ..\FSComp.txt:726) static member tcTypeAbbreviationsMayNotHaveMembers() = (895, GetStringFunc("tcTypeAbbreviationsMayNotHaveMembers",",,,") ) /// As of F# 4.1, the accessibility of type abbreviations is checked at compile-time. Consider changing the accessibility of the type abbreviation. Ignoring this warning might lead to runtime errors. - /// (Originally from ../FSComp.txt:727) + /// (Originally from ..\FSComp.txt:727) static member tcTypeAbbreviationsCheckedAtCompileTime() = (GetStringFunc("tcTypeAbbreviationsCheckedAtCompileTime",",,,") ) /// Enumerations cannot have members - /// (Originally from ../FSComp.txt:728) + /// (Originally from ..\FSComp.txt:728) static member tcEnumerationsMayNotHaveMembers() = (896, GetStringFunc("tcEnumerationsMayNotHaveMembers",",,,") ) /// Measure declarations may have only static members - /// (Originally from ../FSComp.txt:729) + /// (Originally from ..\FSComp.txt:729) static member tcMeasureDeclarationsRequireStaticMembers() = (897, GetStringFunc("tcMeasureDeclarationsRequireStaticMembers",",,,") ) /// Structs cannot contain 'do' bindings because the default constructor for structs would not execute these bindings - /// (Originally from ../FSComp.txt:730) + /// (Originally from ..\FSComp.txt:730) static member tcStructsMayNotContainDoBindings() = (GetStringFunc("tcStructsMayNotContainDoBindings",",,,") ) /// Structs cannot contain value definitions because the default constructor for structs will not execute these bindings. Consider adding additional arguments to the primary constructor for the type. - /// (Originally from ../FSComp.txt:731) + /// (Originally from ..\FSComp.txt:731) static member tcStructsMayNotContainLetBindings() = (901, GetStringFunc("tcStructsMayNotContainLetBindings",",,,") ) /// Static value definitions may only be used in types with a primary constructor. Consider adding arguments to the type definition, e.g. 'type X(args) = ...'. - /// (Originally from ../FSComp.txt:732) + /// (Originally from ..\FSComp.txt:732) static member tcStaticLetBindingsRequireClassesWithImplicitConstructors() = (902, GetStringFunc("tcStaticLetBindingsRequireClassesWithImplicitConstructors",",,,") ) /// Measure declarations may have only static members: constructors are not available - /// (Originally from ../FSComp.txt:733) + /// (Originally from ..\FSComp.txt:733) static member tcMeasureDeclarationsRequireStaticMembersNotConstructors() = (904, GetStringFunc("tcMeasureDeclarationsRequireStaticMembersNotConstructors",",,,") ) /// A member and a local class binding both have the name '%s' - /// (Originally from ../FSComp.txt:734) + /// (Originally from ..\FSComp.txt:734) static member tcMemberAndLocalClassBindingHaveSameName(a0 : System.String) = (905, GetStringFunc("tcMemberAndLocalClassBindingHaveSameName",",,,%s,,,") a0) /// Type abbreviations cannot have interface declarations - /// (Originally from ../FSComp.txt:735) + /// (Originally from ..\FSComp.txt:735) static member tcTypeAbbreviationsCannotHaveInterfaceDeclaration() = (906, GetStringFunc("tcTypeAbbreviationsCannotHaveInterfaceDeclaration",",,,") ) /// Enumerations cannot have interface declarations - /// (Originally from ../FSComp.txt:736) + /// (Originally from ..\FSComp.txt:736) static member tcEnumerationsCannotHaveInterfaceDeclaration() = (907, GetStringFunc("tcEnumerationsCannotHaveInterfaceDeclaration",",,,") ) /// This type is not an interface type - /// (Originally from ../FSComp.txt:737) + /// (Originally from ..\FSComp.txt:737) static member tcTypeIsNotInterfaceType0() = (908, GetStringFunc("tcTypeIsNotInterfaceType0",",,,") ) /// All implemented interfaces should be declared on the initial declaration of the type - /// (Originally from ../FSComp.txt:738) + /// (Originally from ..\FSComp.txt:738) static member tcAllImplementedInterfacesShouldBeDeclared() = (909, GetStringFunc("tcAllImplementedInterfacesShouldBeDeclared",",,,") ) /// A default implementation of this interface has already been added because the explicit implementation of the interface was not specified at the definition of the type - /// (Originally from ../FSComp.txt:739) + /// (Originally from ..\FSComp.txt:739) static member tcDefaultImplementationForInterfaceHasAlreadyBeenAdded() = (910, GetStringFunc("tcDefaultImplementationForInterfaceHasAlreadyBeenAdded",",,,") ) /// This member is not permitted in an interface implementation - /// (Originally from ../FSComp.txt:740) + /// (Originally from ..\FSComp.txt:740) static member tcMemberNotPermittedInInterfaceImplementation() = (911, GetStringFunc("tcMemberNotPermittedInInterfaceImplementation",",,,") ) /// This declaration element is not permitted in an augmentation - /// (Originally from ../FSComp.txt:741) + /// (Originally from ..\FSComp.txt:741) static member tcDeclarationElementNotPermittedInAugmentation() = (912, GetStringFunc("tcDeclarationElementNotPermittedInAugmentation",",,,") ) /// Types cannot contain nested type definitions - /// (Originally from ../FSComp.txt:742) + /// (Originally from ..\FSComp.txt:742) static member tcTypesCannotContainNestedTypes() = (913, GetStringFunc("tcTypesCannotContainNestedTypes",",,,") ) /// type, exception or module - /// (Originally from ../FSComp.txt:743) + /// (Originally from ..\FSComp.txt:743) static member tcTypeExceptionOrModule() = (GetStringFunc("tcTypeExceptionOrModule",",,,") ) /// type or module - /// (Originally from ../FSComp.txt:744) + /// (Originally from ..\FSComp.txt:744) static member tcTypeOrModule() = (GetStringFunc("tcTypeOrModule",",,,") ) /// The struct, record or union type '%s' implements the interface 'System.IStructuralEquatable' explicitly. Apply the 'CustomEquality' attribute to the type. - /// (Originally from ../FSComp.txt:745) + /// (Originally from ..\FSComp.txt:745) static member tcImplementsIStructuralEquatableExplicitly(a0 : System.String) = (914, GetStringFunc("tcImplementsIStructuralEquatableExplicitly",",,,%s,,,") a0) /// The struct, record or union type '%s' implements the interface 'System.IEquatable<_>' explicitly. Apply the 'CustomEquality' attribute to the type and provide a consistent implementation of the non-generic override 'System.Object.Equals(obj)'. - /// (Originally from ../FSComp.txt:746) + /// (Originally from ..\FSComp.txt:746) static member tcImplementsIEquatableExplicitly(a0 : System.String) = (915, GetStringFunc("tcImplementsIEquatableExplicitly",",,,%s,,,") a0) /// Explicit type specifications cannot be used for exception constructors - /// (Originally from ../FSComp.txt:747) + /// (Originally from ..\FSComp.txt:747) static member tcExplicitTypeSpecificationCannotBeUsedForExceptionConstructors() = (916, GetStringFunc("tcExplicitTypeSpecificationCannotBeUsedForExceptionConstructors",",,,") ) /// Exception abbreviations should not have argument lists - /// (Originally from ../FSComp.txt:748) + /// (Originally from ..\FSComp.txt:748) static member tcExceptionAbbreviationsShouldNotHaveArgumentList() = (917, GetStringFunc("tcExceptionAbbreviationsShouldNotHaveArgumentList",",,,") ) /// Abbreviations for Common IL exceptions cannot take arguments - /// (Originally from ../FSComp.txt:749) + /// (Originally from ..\FSComp.txt:749) static member tcAbbreviationsFordotNetExceptionsCannotTakeArguments() = (918, GetStringFunc("tcAbbreviationsFordotNetExceptionsCannotTakeArguments",",,,") ) /// Exception abbreviations must refer to existing exceptions or F# types deriving from System.Exception - /// (Originally from ../FSComp.txt:750) + /// (Originally from ..\FSComp.txt:750) static member tcExceptionAbbreviationsMustReferToValidExceptions() = (919, GetStringFunc("tcExceptionAbbreviationsMustReferToValidExceptions",",,,") ) /// Abbreviations for Common IL exception types must have a matching object constructor - /// (Originally from ../FSComp.txt:751) + /// (Originally from ..\FSComp.txt:751) static member tcAbbreviationsFordotNetExceptionsMustHaveMatchingObjectConstructor() = (920, GetStringFunc("tcAbbreviationsFordotNetExceptionsMustHaveMatchingObjectConstructor",",,,") ) /// Not an exception - /// (Originally from ../FSComp.txt:752) + /// (Originally from ..\FSComp.txt:752) static member tcNotAnException() = (921, GetStringFunc("tcNotAnException",",,,") ) /// Invalid module name - /// (Originally from ../FSComp.txt:754) + /// (Originally from ..\FSComp.txt:754) static member tcInvalidModuleName() = (924, GetStringFunc("tcInvalidModuleName",",,,") ) /// Invalid type extension - /// (Originally from ../FSComp.txt:755) + /// (Originally from ..\FSComp.txt:755) static member tcInvalidTypeExtension() = (925, GetStringFunc("tcInvalidTypeExtension",",,,") ) /// The attributes of this type specify multiple kinds for the type - /// (Originally from ../FSComp.txt:756) + /// (Originally from ..\FSComp.txt:756) static member tcAttributesOfTypeSpecifyMultipleKindsForType() = (926, GetStringFunc("tcAttributesOfTypeSpecifyMultipleKindsForType",",,,") ) /// The kind of the type specified by its attributes does not match the kind implied by its definition - /// (Originally from ../FSComp.txt:757) + /// (Originally from ..\FSComp.txt:757) static member tcKindOfTypeSpecifiedDoesNotMatchDefinition() = (927, GetStringFunc("tcKindOfTypeSpecifiedDoesNotMatchDefinition",",,,") ) /// Measure definitions cannot have type parameters - /// (Originally from ../FSComp.txt:758) + /// (Originally from ..\FSComp.txt:758) static member tcMeasureDefinitionsCannotHaveTypeParameters() = (928, GetStringFunc("tcMeasureDefinitionsCannotHaveTypeParameters",",,,") ) /// This type requires a definition - /// (Originally from ../FSComp.txt:759) + /// (Originally from ..\FSComp.txt:759) static member tcTypeRequiresDefinition() = (929, GetStringFunc("tcTypeRequiresDefinition",",,,") ) /// This type abbreviation has one or more declared type parameters that do not appear in the type being abbreviated. Type abbreviations must use all declared type parameters in the type being abbreviated. Consider removing one or more type parameters, or use a concrete type definition that wraps an underlying type, such as 'type C<'a> = C of ...'. - /// (Originally from ../FSComp.txt:760) + /// (Originally from ..\FSComp.txt:760) static member tcTypeAbbreviationHasTypeParametersMissingOnType() = (GetStringFunc("tcTypeAbbreviationHasTypeParametersMissingOnType",",,,") ) /// Structs, interfaces, enums and delegates cannot inherit from other types - /// (Originally from ../FSComp.txt:761) + /// (Originally from ..\FSComp.txt:761) static member tcStructsInterfacesEnumsDelegatesMayNotInheritFromOtherTypes() = (931, GetStringFunc("tcStructsInterfacesEnumsDelegatesMayNotInheritFromOtherTypes",",,,") ) /// Types cannot inherit from multiple concrete types - /// (Originally from ../FSComp.txt:762) + /// (Originally from ..\FSComp.txt:762) static member tcTypesCannotInheritFromMultipleConcreteTypes() = (932, GetStringFunc("tcTypesCannotInheritFromMultipleConcreteTypes",",,,") ) /// Records, union, abbreviations and struct types cannot have the 'AllowNullLiteral' attribute - /// (Originally from ../FSComp.txt:763) + /// (Originally from ..\FSComp.txt:763) static member tcRecordsUnionsAbbreviationsStructsMayNotHaveAllowNullLiteralAttribute() = (934, GetStringFunc("tcRecordsUnionsAbbreviationsStructsMayNotHaveAllowNullLiteralAttribute",",,,") ) /// Types with the 'AllowNullLiteral' attribute may only inherit from or implement types which also allow the use of the null literal - /// (Originally from ../FSComp.txt:764) + /// (Originally from ..\FSComp.txt:764) static member tcAllowNullTypesMayOnlyInheritFromAllowNullTypes() = (935, GetStringFunc("tcAllowNullTypesMayOnlyInheritFromAllowNullTypes",",,,") ) /// Generic types cannot be given the 'StructLayout' attribute - /// (Originally from ../FSComp.txt:765) + /// (Originally from ..\FSComp.txt:765) static member tcGenericTypesCannotHaveStructLayout() = (936, GetStringFunc("tcGenericTypesCannotHaveStructLayout",",,,") ) /// Only structs and classes without primary constructors may be given the 'StructLayout' attribute - /// (Originally from ../FSComp.txt:766) + /// (Originally from ..\FSComp.txt:766) static member tcOnlyStructsCanHaveStructLayout() = (937, GetStringFunc("tcOnlyStructsCanHaveStructLayout",",,,") ) /// The representation of this type is hidden by the signature. It must be given an attribute such as [], [] or [] to indicate the characteristics of the type. - /// (Originally from ../FSComp.txt:767) + /// (Originally from ..\FSComp.txt:767) static member tcRepresentationOfTypeHiddenBySignature() = (938, GetStringFunc("tcRepresentationOfTypeHiddenBySignature",",,,") ) /// Only classes may be given the 'AbstractClass' attribute - /// (Originally from ../FSComp.txt:768) + /// (Originally from ..\FSComp.txt:768) static member tcOnlyClassesCanHaveAbstract() = (939, GetStringFunc("tcOnlyClassesCanHaveAbstract",",,,") ) /// Only types representing units-of-measure may be given the 'Measure' attribute - /// (Originally from ../FSComp.txt:769) + /// (Originally from ..\FSComp.txt:769) static member tcOnlyTypesRepresentingUnitsOfMeasureCanHaveMeasure() = (940, GetStringFunc("tcOnlyTypesRepresentingUnitsOfMeasureCanHaveMeasure",",,,") ) /// Accessibility modifiers are not permitted on overrides or interface implementations - /// (Originally from ../FSComp.txt:770) + /// (Originally from ..\FSComp.txt:770) static member tcOverridesCannotHaveVisibilityDeclarations() = (941, GetStringFunc("tcOverridesCannotHaveVisibilityDeclarations",",,,") ) /// Discriminated union types are always sealed - /// (Originally from ../FSComp.txt:771) + /// (Originally from ..\FSComp.txt:771) static member tcTypesAreAlwaysSealedDU() = (942, GetStringFunc("tcTypesAreAlwaysSealedDU",",,,") ) /// Record types are always sealed - /// (Originally from ../FSComp.txt:772) + /// (Originally from ..\FSComp.txt:772) static member tcTypesAreAlwaysSealedRecord() = (942, GetStringFunc("tcTypesAreAlwaysSealedRecord",",,,") ) /// Assembly code types are always sealed - /// (Originally from ../FSComp.txt:773) + /// (Originally from ..\FSComp.txt:773) static member tcTypesAreAlwaysSealedAssemblyCode() = (942, GetStringFunc("tcTypesAreAlwaysSealedAssemblyCode",",,,") ) /// Struct types are always sealed - /// (Originally from ../FSComp.txt:774) + /// (Originally from ..\FSComp.txt:774) static member tcTypesAreAlwaysSealedStruct() = (942, GetStringFunc("tcTypesAreAlwaysSealedStruct",",,,") ) /// Delegate types are always sealed - /// (Originally from ../FSComp.txt:775) + /// (Originally from ..\FSComp.txt:775) static member tcTypesAreAlwaysSealedDelegate() = (942, GetStringFunc("tcTypesAreAlwaysSealedDelegate",",,,") ) /// Enum types are always sealed - /// (Originally from ../FSComp.txt:776) + /// (Originally from ..\FSComp.txt:776) static member tcTypesAreAlwaysSealedEnum() = (942, GetStringFunc("tcTypesAreAlwaysSealedEnum",",,,") ) /// Interface types and delegate types cannot contain fields - /// (Originally from ../FSComp.txt:777) + /// (Originally from ..\FSComp.txt:777) static member tcInterfaceTypesAndDelegatesCannotContainFields() = (943, GetStringFunc("tcInterfaceTypesAndDelegatesCannotContainFields",",,,") ) /// Abbreviated types cannot be given the 'Sealed' attribute - /// (Originally from ../FSComp.txt:778) + /// (Originally from ..\FSComp.txt:778) static member tcAbbreviatedTypesCannotBeSealed() = (944, GetStringFunc("tcAbbreviatedTypesCannotBeSealed",",,,") ) /// Cannot inherit a sealed type - /// (Originally from ../FSComp.txt:779) + /// (Originally from ..\FSComp.txt:779) static member tcCannotInheritFromSealedType() = (945, GetStringFunc("tcCannotInheritFromSealedType",",,,") ) /// Cannot inherit from interface type. Use interface ... with instead. - /// (Originally from ../FSComp.txt:780) + /// (Originally from ..\FSComp.txt:780) static member tcCannotInheritFromInterfaceType() = (946, GetStringFunc("tcCannotInheritFromInterfaceType",",,,") ) /// Struct types cannot contain abstract members - /// (Originally from ../FSComp.txt:781) + /// (Originally from ..\FSComp.txt:781) static member tcStructTypesCannotContainAbstractMembers() = (947, GetStringFunc("tcStructTypesCannotContainAbstractMembers",",,,") ) /// Interface types cannot be sealed - /// (Originally from ../FSComp.txt:782) + /// (Originally from ..\FSComp.txt:782) static member tcInterfaceTypesCannotBeSealed() = (948, GetStringFunc("tcInterfaceTypesCannotBeSealed",",,,") ) /// Delegate specifications must be of the form 'typ -> typ' - /// (Originally from ../FSComp.txt:783) + /// (Originally from ..\FSComp.txt:783) static member tcInvalidDelegateSpecification() = (949, GetStringFunc("tcInvalidDelegateSpecification",",,,") ) /// Delegate specifications must not be curried types. Use 'typ * ... * typ -> typ' for multi-argument delegates, and 'typ -> (typ -> typ)' for delegates returning function values. - /// (Originally from ../FSComp.txt:784) + /// (Originally from ..\FSComp.txt:784) static member tcDelegatesCannotBeCurried() = (950, GetStringFunc("tcDelegatesCannotBeCurried",",,,") ) /// Literal enumerations must have type int, uint, int16, uint16, int64, uint64, byte, sbyte or char - /// (Originally from ../FSComp.txt:785) + /// (Originally from ..\FSComp.txt:785) static member tcInvalidTypeForLiteralEnumeration() = (951, GetStringFunc("tcInvalidTypeForLiteralEnumeration",",,,") ) /// This type definition involves an immediate cyclic reference through an abbreviation - /// (Originally from ../FSComp.txt:787) + /// (Originally from ..\FSComp.txt:787) static member tcTypeDefinitionIsCyclic() = (953, GetStringFunc("tcTypeDefinitionIsCyclic",",,,") ) /// This type definition involves an immediate cyclic reference through a struct field or inheritance relation - /// (Originally from ../FSComp.txt:788) + /// (Originally from ..\FSComp.txt:788) static member tcTypeDefinitionIsCyclicThroughInheritance() = (954, GetStringFunc("tcTypeDefinitionIsCyclicThroughInheritance",",,,") ) /// The syntax 'type X with ...' is reserved for augmentations. Types whose representations are hidden but which have members are now declared in signatures using 'type X = ...'. You may also need to add the '[] attribute to the type definition in the signature - /// (Originally from ../FSComp.txt:789) + /// (Originally from ..\FSComp.txt:789) static member tcReservedSyntaxForAugmentation() = (GetStringFunc("tcReservedSyntaxForAugmentation",",,,") ) /// 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. - /// (Originally from ../FSComp.txt:790) + /// (Originally from ..\FSComp.txt:790) static member tcMembersThatExtendInterfaceMustBePlacedInSeparateModule() = (956, GetStringFunc("tcMembersThatExtendInterfaceMustBePlacedInSeparateModule",",,,") ) /// One or more of the declared type parameters for this type extension have a missing or wrong type constraint not matching the original type constraints on '%s' - /// (Originally from ../FSComp.txt:791) + /// (Originally from ..\FSComp.txt:791) static member tcDeclaredTypeParametersForExtensionDoNotMatchOriginal(a0 : System.String) = (957, GetStringFunc("tcDeclaredTypeParametersForExtensionDoNotMatchOriginal",",,,%s,,,") a0) /// Type definitions may only have one 'inherit' specification and it must be the first declaration - /// (Originally from ../FSComp.txt:792) + /// (Originally from ..\FSComp.txt:792) static member tcTypeDefinitionsWithImplicitConstructionMustHaveOneInherit() = (959, GetStringFunc("tcTypeDefinitionsWithImplicitConstructionMustHaveOneInherit",",,,") ) /// 'let' and 'do' bindings must come before member and interface definitions in type definitions - /// (Originally from ../FSComp.txt:793) + /// (Originally from ..\FSComp.txt:793) static member tcTypeDefinitionsWithImplicitConstructionMustHaveLocalBindingsBeforeMembers() = (960, GetStringFunc("tcTypeDefinitionsWithImplicitConstructionMustHaveLocalBindingsBeforeMembers",",,,") ) /// This 'inherit' declaration specifies the inherited type but no arguments. Consider supplying arguments, e.g. 'inherit BaseType(args)'. - /// (Originally from ../FSComp.txt:794) + /// (Originally from ..\FSComp.txt:794) static member tcInheritDeclarationMissingArguments() = (961, GetStringFunc("tcInheritDeclarationMissingArguments",",,,") ) /// This 'inherit' declaration has arguments, but is not in a type with a primary constructor. Consider adding arguments to your type definition, e.g. 'type X(args) = ...'. - /// (Originally from ../FSComp.txt:795) + /// (Originally from ..\FSComp.txt:795) static member tcInheritConstructionCallNotPartOfImplicitSequence() = (962, GetStringFunc("tcInheritConstructionCallNotPartOfImplicitSequence",",,,") ) /// This definition may only be used in a type with a primary constructor. Consider adding arguments to your type definition, e.g. 'type X(args) = ...'. - /// (Originally from ../FSComp.txt:796) + /// (Originally from ..\FSComp.txt:796) static member tcLetAndDoRequiresImplicitConstructionSequence() = (963, GetStringFunc("tcLetAndDoRequiresImplicitConstructionSequence",",,,") ) /// Type abbreviations cannot have augmentations - /// (Originally from ../FSComp.txt:797) + /// (Originally from ..\FSComp.txt:797) static member tcTypeAbbreviationsCannotHaveAugmentations() = (964, GetStringFunc("tcTypeAbbreviationsCannotHaveAugmentations",",,,") ) /// The path '%s' is a namespace. A module abbreviation may not abbreviate a namespace. - /// (Originally from ../FSComp.txt:798) + /// (Originally from ..\FSComp.txt:798) static member tcModuleAbbreviationForNamespace(a0 : System.String) = (965, GetStringFunc("tcModuleAbbreviationForNamespace",",,,%s,,,") a0) /// The type '%s' is used in an invalid way. A value prior to '%s' has an inferred type involving '%s', which is an invalid forward reference. - /// (Originally from ../FSComp.txt:799) + /// (Originally from ..\FSComp.txt:799) static member tcTypeUsedInInvalidWay(a0 : System.String, a1 : System.String, a2 : System.String) = (966, GetStringFunc("tcTypeUsedInInvalidWay",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// The member '%s' is used in an invalid way. A use of '%s' has been inferred prior to the definition of '%s', which is an invalid forward reference. - /// (Originally from ../FSComp.txt:800) + /// (Originally from ..\FSComp.txt:800) static member tcMemberUsedInInvalidWay(a0 : System.String, a1 : System.String, a2 : System.String) = (967, GetStringFunc("tcMemberUsedInInvalidWay",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// The attribute 'AutoOpen(\"%s\")' in the assembly '%s' did not refer to a valid module or namespace in that assembly and has been ignored - /// (Originally from ../FSComp.txt:803) + /// (Originally from ..\FSComp.txt:803) static member tcAttributeAutoOpenWasIgnored(a0 : System.String, a1 : System.String) = (970, GetStringFunc("tcAttributeAutoOpenWasIgnored",",,,%s,,,%s,,,") a0 a1) /// Undefined value '%s' - /// (Originally from ../FSComp.txt:804) + /// (Originally from ..\FSComp.txt:804) static member ilUndefinedValue(a0 : System.String) = (971, GetStringFunc("ilUndefinedValue",",,,%s,,,") a0) /// Label %s not found - /// (Originally from ../FSComp.txt:805) + /// (Originally from ..\FSComp.txt:805) static member ilLabelNotFound(a0 : System.String) = (972, GetStringFunc("ilLabelNotFound",",,,%s,,,") a0) /// Incorrect number of type arguments to local call - /// (Originally from ../FSComp.txt:806) + /// (Originally from ..\FSComp.txt:806) static member ilIncorrectNumberOfTypeArguments() = (973, GetStringFunc("ilIncorrectNumberOfTypeArguments",",,,") ) /// Dynamic invocation of %s is not supported - /// (Originally from ../FSComp.txt:807) + /// (Originally from ..\FSComp.txt:807) static member ilDynamicInvocationNotSupported(a0 : System.String) = (GetStringFunc("ilDynamicInvocationNotSupported",",,,%s,,,") a0) /// Taking the address of a literal field is invalid - /// (Originally from ../FSComp.txt:808) + /// (Originally from ..\FSComp.txt:808) static member ilAddressOfLiteralFieldIsInvalid() = (975, GetStringFunc("ilAddressOfLiteralFieldIsInvalid",",,,") ) /// This operation involves taking the address of a value '%s' represented using a local variable or other special representation. This is invalid. - /// (Originally from ../FSComp.txt:809) + /// (Originally from ..\FSComp.txt:809) static member ilAddressOfValueHereIsInvalid(a0 : System.String) = (976, GetStringFunc("ilAddressOfValueHereIsInvalid",",,,%s,,,") a0) /// Custom marshallers cannot be specified in F# code. Consider using a C# helper function. - /// (Originally from ../FSComp.txt:810) + /// (Originally from ..\FSComp.txt:810) static member ilCustomMarshallersCannotBeUsedInFSharp() = (980, GetStringFunc("ilCustomMarshallersCannotBeUsedInFSharp",",,,") ) /// The MarshalAs attribute could not be decoded - /// (Originally from ../FSComp.txt:811) + /// (Originally from ..\FSComp.txt:811) static member ilMarshalAsAttributeCannotBeDecoded() = (981, GetStringFunc("ilMarshalAsAttributeCannotBeDecoded",",,,") ) /// The signature for this external function contains type parameters. Constrain the argument and return types to indicate the types of the corresponding C function. - /// (Originally from ../FSComp.txt:812) + /// (Originally from ..\FSComp.txt:812) static member ilSignatureForExternalFunctionContainsTypeParameters() = (982, GetStringFunc("ilSignatureForExternalFunctionContainsTypeParameters",",,,") ) /// The DllImport attribute could not be decoded - /// (Originally from ../FSComp.txt:813) + /// (Originally from ..\FSComp.txt:813) static member ilDllImportAttributeCouldNotBeDecoded() = (983, GetStringFunc("ilDllImportAttributeCouldNotBeDecoded",",,,") ) /// Literal fields cannot be set - /// (Originally from ../FSComp.txt:814) + /// (Originally from ..\FSComp.txt:814) static member ilLiteralFieldsCannotBeSet() = (984, GetStringFunc("ilLiteralFieldsCannotBeSet",",,,") ) /// GenSetStorage: %s was represented as a static method but was not an appropriate lambda expression - /// (Originally from ../FSComp.txt:815) + /// (Originally from ..\FSComp.txt:815) static member ilStaticMethodIsNotLambda(a0 : System.String) = (985, GetStringFunc("ilStaticMethodIsNotLambda",",,,%s,,,") a0) /// Mutable variables cannot escape their method - /// (Originally from ../FSComp.txt:816) + /// (Originally from ..\FSComp.txt:816) static member ilMutableVariablesCannotEscapeMethod() = (986, GetStringFunc("ilMutableVariablesCannotEscapeMethod",",,,") ) /// Compiler error: unexpected unrealized value - /// (Originally from ../FSComp.txt:817) + /// (Originally from ..\FSComp.txt:817) static member ilUnexpectedUnrealizedValue() = (987, GetStringFunc("ilUnexpectedUnrealizedValue",",,,") ) /// Main module of program is empty: nothing will happen when it is run - /// (Originally from ../FSComp.txt:818) + /// (Originally from ..\FSComp.txt:818) static member ilMainModuleEmpty() = (988, GetStringFunc("ilMainModuleEmpty",",,,") ) /// This type cannot be used for a literal field - /// (Originally from ../FSComp.txt:819) + /// (Originally from ..\FSComp.txt:819) static member ilTypeCannotBeUsedForLiteralField() = (989, GetStringFunc("ilTypeCannotBeUsedForLiteralField",",,,") ) /// Unexpected GetSet annotation on a property - /// (Originally from ../FSComp.txt:820) + /// (Originally from ..\FSComp.txt:820) static member ilUnexpectedGetSetAnnotation() = (990, GetStringFunc("ilUnexpectedGetSetAnnotation",",,,") ) /// The FieldOffset attribute could not be decoded - /// (Originally from ../FSComp.txt:821) + /// (Originally from ..\FSComp.txt:821) static member ilFieldOffsetAttributeCouldNotBeDecoded() = (991, GetStringFunc("ilFieldOffsetAttributeCouldNotBeDecoded",",,,") ) /// The StructLayout attribute could not be decoded - /// (Originally from ../FSComp.txt:822) + /// (Originally from ..\FSComp.txt:822) static member ilStructLayoutAttributeCouldNotBeDecoded() = (992, GetStringFunc("ilStructLayoutAttributeCouldNotBeDecoded",",,,") ) /// The DefaultAugmentation attribute could not be decoded - /// (Originally from ../FSComp.txt:823) + /// (Originally from ..\FSComp.txt:823) static member ilDefaultAugmentationAttributeCouldNotBeDecoded() = (993, GetStringFunc("ilDefaultAugmentationAttributeCouldNotBeDecoded",",,,") ) /// Reflected definitions cannot contain uses of the prefix splice operator '%%' - /// (Originally from ../FSComp.txt:824) + /// (Originally from ..\FSComp.txt:824) static member ilReflectedDefinitionsCannotUseSliceOperator() = (994, GetStringFunc("ilReflectedDefinitionsCannotUseSliceOperator",",,,") ) /// Problem with codepage '%d': %s - /// (Originally from ../FSComp.txt:825) + /// (Originally from ..\FSComp.txt:825) static member optsProblemWithCodepage(a0 : System.Int32, a1 : System.String) = (1000, GetStringFunc("optsProblemWithCodepage",",,,%d,,,%s,,,") a0 a1) /// Copyright (c) Microsoft Corporation. All Rights Reserved. - /// (Originally from ../FSComp.txt:826) + /// (Originally from ..\FSComp.txt:826) static member optsCopyright() = (GetStringFunc("optsCopyright",",,,") ) /// Freely distributed under the MIT Open Source License. https://github.com/Microsoft/visualfsharp/blob/master/License.txt - /// (Originally from ../FSComp.txt:827) + /// (Originally from ..\FSComp.txt:827) static member optsCopyrightCommunity() = (GetStringFunc("optsCopyrightCommunity",",,,") ) /// Name of the output file (Short form: -o) - /// (Originally from ../FSComp.txt:828) + /// (Originally from ..\FSComp.txt:828) static member optsNameOfOutputFile() = (GetStringFunc("optsNameOfOutputFile",",,,") ) /// Build a console executable - /// (Originally from ../FSComp.txt:829) + /// (Originally from ..\FSComp.txt:829) static member optsBuildConsole() = (GetStringFunc("optsBuildConsole",",,,") ) /// Build a Windows executable - /// (Originally from ../FSComp.txt:830) + /// (Originally from ..\FSComp.txt:830) static member optsBuildWindows() = (GetStringFunc("optsBuildWindows",",,,") ) /// Build a library (Short form: -a) - /// (Originally from ../FSComp.txt:831) + /// (Originally from ..\FSComp.txt:831) static member optsBuildLibrary() = (GetStringFunc("optsBuildLibrary",",,,") ) /// Build a module that can be added to another assembly - /// (Originally from ../FSComp.txt:832) + /// (Originally from ..\FSComp.txt:832) static member optsBuildModule() = (GetStringFunc("optsBuildModule",",,,") ) /// Delay-sign the assembly using only the public portion of the strong name key - /// (Originally from ../FSComp.txt:833) + /// (Originally from ..\FSComp.txt:833) static member optsDelaySign() = (GetStringFunc("optsDelaySign",",,,") ) /// Public-sign the assembly using only the public portion of the strong name key, and mark the assembly as signed - /// (Originally from ../FSComp.txt:834) + /// (Originally from ..\FSComp.txt:834) static member optsPublicSign() = (GetStringFunc("optsPublicSign",",,,") ) /// Write the xmldoc of the assembly to the given file - /// (Originally from ../FSComp.txt:835) + /// (Originally from ..\FSComp.txt:835) static member optsWriteXml() = (GetStringFunc("optsWriteXml",",,,") ) /// Specify a strong name key file - /// (Originally from ../FSComp.txt:836) + /// (Originally from ..\FSComp.txt:836) static member optsStrongKeyFile() = (GetStringFunc("optsStrongKeyFile",",,,") ) /// Specify a strong name key container - /// (Originally from ../FSComp.txt:837) + /// (Originally from ..\FSComp.txt:837) static member optsStrongKeyContainer() = (GetStringFunc("optsStrongKeyContainer",",,,") ) /// Limit which platforms this code can run on: x86, Itanium, x64, anycpu32bitpreferred, or anycpu. The default is anycpu. - /// (Originally from ../FSComp.txt:838) + /// (Originally from ..\FSComp.txt:838) static member optsPlatform() = (GetStringFunc("optsPlatform",",,,") ) /// Only include optimization information essential for implementing inlined constructs. Inhibits cross-module inlining but improves binary compatibility. - /// (Originally from ../FSComp.txt:839) + /// (Originally from ..\FSComp.txt:839) static member optsNoOpt() = (GetStringFunc("optsNoOpt",",,,") ) /// Don't add a resource to the generated assembly containing F#-specific metadata - /// (Originally from ../FSComp.txt:840) + /// (Originally from ..\FSComp.txt:840) static member optsNoInterface() = (GetStringFunc("optsNoInterface",",,,") ) /// Print the inferred interface of the assembly to a file - /// (Originally from ../FSComp.txt:841) + /// (Originally from ..\FSComp.txt:841) static member optsSig() = (GetStringFunc("optsSig",",,,") ) /// Reference an assembly (Short form: -r) - /// (Originally from ../FSComp.txt:842) + /// (Originally from ..\FSComp.txt:842) static member optsReference() = (GetStringFunc("optsReference",",,,") ) /// Specify a Win32 resource file (.res) - /// (Originally from ../FSComp.txt:843) + /// (Originally from ..\FSComp.txt:843) static member optsWin32res() = (GetStringFunc("optsWin32res",",,,") ) /// Specify a Win32 manifest file - /// (Originally from ../FSComp.txt:844) + /// (Originally from ..\FSComp.txt:844) static member optsWin32manifest() = (GetStringFunc("optsWin32manifest",",,,") ) /// Do not include the default Win32 manifest - /// (Originally from ../FSComp.txt:845) + /// (Originally from ..\FSComp.txt:845) static member optsNowin32manifest() = (GetStringFunc("optsNowin32manifest",",,,") ) /// Embed all source files in the portable PDB file - /// (Originally from ../FSComp.txt:846) + /// (Originally from ..\FSComp.txt:846) static member optsEmbedAllSource() = (GetStringFunc("optsEmbedAllSource",",,,") ) /// Embed specific source files in the portable PDB file - /// (Originally from ../FSComp.txt:847) + /// (Originally from ..\FSComp.txt:847) static member optsEmbedSource() = (GetStringFunc("optsEmbedSource",",,,") ) /// Source link information file to embed in the portable PDB file - /// (Originally from ../FSComp.txt:848) + /// (Originally from ..\FSComp.txt:848) static member optsSourceLink() = (GetStringFunc("optsSourceLink",",,,") ) /// --embed switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - /// (Originally from ../FSComp.txt:849) + /// (Originally from ..\FSComp.txt:849) static member optsEmbeddedSourceRequirePortablePDBs() = (1501, GetStringFunc("optsEmbeddedSourceRequirePortablePDBs",",,,") ) /// --sourcelink switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - /// (Originally from ../FSComp.txt:850) + /// (Originally from ..\FSComp.txt:850) static member optsSourceLinkRequirePortablePDBs() = (1502, GetStringFunc("optsSourceLinkRequirePortablePDBs",",,,") ) /// Source file is too large to embed in a portable PDB - /// (Originally from ../FSComp.txt:851) + /// (Originally from ..\FSComp.txt:851) static member srcFileTooLarge() = (GetStringFunc("srcFileTooLarge",",,,") ) /// Embed the specified managed resource - /// (Originally from ../FSComp.txt:852) + /// (Originally from ..\FSComp.txt:852) static member optsResource() = (GetStringFunc("optsResource",",,,") ) /// Link the specified resource to this assembly where the resinfo format is [,[,public|private]] - /// (Originally from ../FSComp.txt:853) + /// (Originally from ..\FSComp.txt:853) static member optsLinkresource() = (GetStringFunc("optsLinkresource",",,,") ) /// Emit debug information (Short form: -g) - /// (Originally from ../FSComp.txt:854) + /// (Originally from ..\FSComp.txt:854) static member optsDebugPM() = (GetStringFunc("optsDebugPM",",,,") ) /// Specify debugging type: full, portable, embedded, pdbonly. ('%s' is the default if no debuggging type specified and enables attaching a debugger to a running program, 'portable' is a cross-platform format, 'embedded' is a cross-platform format embedded into the output file). - /// (Originally from ../FSComp.txt:855) + /// (Originally from ..\FSComp.txt:855) static member optsDebug(a0 : System.String) = (GetStringFunc("optsDebug",",,,%s,,,") a0) /// Enable optimizations (Short form: -O) - /// (Originally from ../FSComp.txt:856) + /// (Originally from ..\FSComp.txt:856) static member optsOptimize() = (GetStringFunc("optsOptimize",",,,") ) /// Enable or disable tailcalls - /// (Originally from ../FSComp.txt:857) + /// (Originally from ..\FSComp.txt:857) static member optsTailcalls() = (GetStringFunc("optsTailcalls",",,,") ) /// Produce a deterministic assembly (including module version GUID and timestamp) - /// (Originally from ../FSComp.txt:858) + /// (Originally from ..\FSComp.txt:858) static member optsDeterministic() = (GetStringFunc("optsDeterministic",",,,") ) /// Enable or disable cross-module optimizations - /// (Originally from ../FSComp.txt:859) + /// (Originally from ..\FSComp.txt:859) static member optsCrossoptimize() = (GetStringFunc("optsCrossoptimize",",,,") ) /// Report all warnings as errors - /// (Originally from ../FSComp.txt:860) + /// (Originally from ..\FSComp.txt:860) static member optsWarnaserrorPM() = (GetStringFunc("optsWarnaserrorPM",",,,") ) /// Report specific warnings as errors - /// (Originally from ../FSComp.txt:861) + /// (Originally from ..\FSComp.txt:861) static member optsWarnaserror() = (GetStringFunc("optsWarnaserror",",,,") ) /// Set a warning level (0-5) - /// (Originally from ../FSComp.txt:862) + /// (Originally from ..\FSComp.txt:862) static member optsWarn() = (GetStringFunc("optsWarn",",,,") ) /// Disable specific warning messages - /// (Originally from ../FSComp.txt:863) + /// (Originally from ..\FSComp.txt:863) static member optsNowarn() = (GetStringFunc("optsNowarn",",,,") ) /// Enable specific warnings that may be off by default - /// (Originally from ../FSComp.txt:864) + /// (Originally from ..\FSComp.txt:864) static member optsWarnOn() = (GetStringFunc("optsWarnOn",",,,") ) /// Generate overflow checks - /// (Originally from ../FSComp.txt:865) + /// (Originally from ..\FSComp.txt:865) static member optsChecked() = (GetStringFunc("optsChecked",",,,") ) /// Define conditional compilation symbols (Short form: -d) - /// (Originally from ../FSComp.txt:866) + /// (Originally from ..\FSComp.txt:866) static member optsDefine() = (GetStringFunc("optsDefine",",,,") ) /// Ignore ML compatibility warnings - /// (Originally from ../FSComp.txt:867) + /// (Originally from ..\FSComp.txt:867) static member optsMlcompatibility() = (GetStringFunc("optsMlcompatibility",",,,") ) /// Suppress compiler copyright message - /// (Originally from ../FSComp.txt:868) + /// (Originally from ..\FSComp.txt:868) static member optsNologo() = (GetStringFunc("optsNologo",",,,") ) /// Display this usage message (Short form: -?) - /// (Originally from ../FSComp.txt:869) + /// (Originally from ..\FSComp.txt:869) static member optsHelp() = (GetStringFunc("optsHelp",",,,") ) /// Read response file for more options - /// (Originally from ../FSComp.txt:870) + /// (Originally from ..\FSComp.txt:870) static member optsResponseFile() = (GetStringFunc("optsResponseFile",",,,") ) /// Specify the codepage used to read source files - /// (Originally from ../FSComp.txt:871) + /// (Originally from ..\FSComp.txt:871) static member optsCodepage() = (GetStringFunc("optsCodepage",",,,") ) /// Output messages in UTF-8 encoding - /// (Originally from ../FSComp.txt:872) + /// (Originally from ..\FSComp.txt:872) static member optsUtf8output() = (GetStringFunc("optsUtf8output",",,,") ) /// Output messages with fully qualified paths - /// (Originally from ../FSComp.txt:873) + /// (Originally from ..\FSComp.txt:873) static member optsFullpaths() = (GetStringFunc("optsFullpaths",",,,") ) /// Specify a directory for the include path which is used to resolve source files and assemblies (Short form: -I) - /// (Originally from ../FSComp.txt:874) + /// (Originally from ..\FSComp.txt:874) static member optsLib() = (GetStringFunc("optsLib",",,,") ) /// Base address for the library to be built - /// (Originally from ../FSComp.txt:875) + /// (Originally from ..\FSComp.txt:875) static member optsBaseaddress() = (GetStringFunc("optsBaseaddress",",,,") ) /// Do not reference the default CLI assemblies by default - /// (Originally from ../FSComp.txt:876) + /// (Originally from ..\FSComp.txt:876) static member optsNoframework() = (GetStringFunc("optsNoframework",",,,") ) /// Statically link the F# library and all referenced DLLs that depend on it into the assembly being generated - /// (Originally from ../FSComp.txt:877) + /// (Originally from ..\FSComp.txt:877) static member optsStandalone() = (GetStringFunc("optsStandalone",",,,") ) /// Statically link the given assembly and all referenced DLLs that depend on this assembly. Use an assembly name e.g. mylib, not a DLL name. - /// (Originally from ../FSComp.txt:878) + /// (Originally from ..\FSComp.txt:878) static member optsStaticlink() = (GetStringFunc("optsStaticlink",",,,") ) /// Use a resident background compilation service to improve compiler startup times. - /// (Originally from ../FSComp.txt:879) + /// (Originally from ..\FSComp.txt:879) static member optsResident() = (GetStringFunc("optsResident",",,,") ) /// Name the output debug file - /// (Originally from ../FSComp.txt:880) + /// (Originally from ..\FSComp.txt:880) static member optsPdb() = (GetStringFunc("optsPdb",",,,") ) /// Resolve assembly references using directory-based rules rather than MSBuild resolution - /// (Originally from ../FSComp.txt:881) + /// (Originally from ..\FSComp.txt:881) static member optsSimpleresolution() = (GetStringFunc("optsSimpleresolution",",,,") ) /// Unrecognized target '%s', expected 'exe', 'winexe', 'library' or 'module' - /// (Originally from ../FSComp.txt:882) + /// (Originally from ..\FSComp.txt:882) static member optsUnrecognizedTarget(a0 : System.String) = (1048, GetStringFunc("optsUnrecognizedTarget",",,,%s,,,") a0) /// Unrecognized debug type '%s', expected 'pdbonly' or 'full' - /// (Originally from ../FSComp.txt:883) + /// (Originally from ..\FSComp.txt:883) static member optsUnrecognizedDebugType(a0 : System.String) = (1049, GetStringFunc("optsUnrecognizedDebugType",",,,%s,,,") a0) /// Invalid warning level '%d' - /// (Originally from ../FSComp.txt:884) + /// (Originally from ..\FSComp.txt:884) static member optsInvalidWarningLevel(a0 : System.Int32) = (1050, GetStringFunc("optsInvalidWarningLevel",",,,%d,,,") a0) /// Short form of '%s' - /// (Originally from ../FSComp.txt:885) + /// (Originally from ..\FSComp.txt:885) static member optsShortFormOf(a0 : System.String) = (GetStringFunc("optsShortFormOf",",,,%s,,,") a0) /// The command-line option '--cliroot' has been deprecated. Use an explicit reference to a specific copy of mscorlib.dll instead. - /// (Originally from ../FSComp.txt:886) + /// (Originally from ..\FSComp.txt:886) static member optsClirootDeprecatedMsg() = (GetStringFunc("optsClirootDeprecatedMsg",",,,") ) /// Use to override where the compiler looks for mscorlib.dll and framework components - /// (Originally from ../FSComp.txt:887) + /// (Originally from ..\FSComp.txt:887) static member optsClirootDescription() = (GetStringFunc("optsClirootDescription",",,,") ) /// - OUTPUT FILES - - /// (Originally from ../FSComp.txt:888) + /// (Originally from ..\FSComp.txt:888) static member optsHelpBannerOutputFiles() = (GetStringFunc("optsHelpBannerOutputFiles",",,,") ) /// - INPUT FILES - - /// (Originally from ../FSComp.txt:889) + /// (Originally from ..\FSComp.txt:889) static member optsHelpBannerInputFiles() = (GetStringFunc("optsHelpBannerInputFiles",",,,") ) /// - RESOURCES - - /// (Originally from ../FSComp.txt:890) + /// (Originally from ..\FSComp.txt:890) static member optsHelpBannerResources() = (GetStringFunc("optsHelpBannerResources",",,,") ) /// - CODE GENERATION - - /// (Originally from ../FSComp.txt:891) + /// (Originally from ..\FSComp.txt:891) static member optsHelpBannerCodeGen() = (GetStringFunc("optsHelpBannerCodeGen",",,,") ) /// - ADVANCED - - /// (Originally from ../FSComp.txt:892) + /// (Originally from ..\FSComp.txt:892) static member optsHelpBannerAdvanced() = (GetStringFunc("optsHelpBannerAdvanced",",,,") ) /// - MISCELLANEOUS - - /// (Originally from ../FSComp.txt:893) + /// (Originally from ..\FSComp.txt:893) static member optsHelpBannerMisc() = (GetStringFunc("optsHelpBannerMisc",",,,") ) /// - LANGUAGE - - /// (Originally from ../FSComp.txt:894) + /// (Originally from ..\FSComp.txt:894) static member optsHelpBannerLanguage() = (GetStringFunc("optsHelpBannerLanguage",",,,") ) /// - ERRORS AND WARNINGS - - /// (Originally from ../FSComp.txt:895) + /// (Originally from ..\FSComp.txt:895) static member optsHelpBannerErrsAndWarns() = (GetStringFunc("optsHelpBannerErrsAndWarns",",,,") ) /// Unknown --test argument: '%s' - /// (Originally from ../FSComp.txt:896) + /// (Originally from ..\FSComp.txt:896) static member optsUnknownArgumentToTheTestSwitch(a0 : System.String) = (1063, GetStringFunc("optsUnknownArgumentToTheTestSwitch",",,,%s,,,") a0) /// Unrecognized platform '%s', valid values are 'x86', 'x64', 'Itanium', 'anycpu32bitpreferred', and 'anycpu' - /// (Originally from ../FSComp.txt:897) + /// (Originally from ..\FSComp.txt:897) static member optsUnknownPlatform(a0 : System.String) = (1064, GetStringFunc("optsUnknownPlatform",",,,%s,,,") a0) /// The command-line option '%s' is for test purposes only - /// (Originally from ../FSComp.txt:898) + /// (Originally from ..\FSComp.txt:898) static member optsInternalNoDescription(a0 : System.String) = (GetStringFunc("optsInternalNoDescription",",,,%s,,,") a0) /// The command-line option '%s' has been deprecated - /// (Originally from ../FSComp.txt:899) + /// (Originally from ..\FSComp.txt:899) static member optsDCLONoDescription(a0 : System.String) = (GetStringFunc("optsDCLONoDescription",",,,%s,,,") a0) /// The command-line option '%s' has been deprecated. Use '%s' instead. - /// (Originally from ../FSComp.txt:900) + /// (Originally from ..\FSComp.txt:900) static member optsDCLODeprecatedSuggestAlternative(a0 : System.String, a1 : System.String) = (GetStringFunc("optsDCLODeprecatedSuggestAlternative",",,,%s,,,%s,,,") a0 a1) /// The command-line option '%s' has been deprecated. HTML document generation is now part of the F# Power Pack, via the tool FsHtmlDoc.exe. - /// (Originally from ../FSComp.txt:901) + /// (Originally from ..\FSComp.txt:901) static member optsDCLOHtmlDoc(a0 : System.String) = (GetStringFunc("optsDCLOHtmlDoc",",,,%s,,,") a0) /// Output warning and error messages in color - /// (Originally from ../FSComp.txt:902) + /// (Originally from ..\FSComp.txt:902) static member optsConsoleColors() = (GetStringFunc("optsConsoleColors",",,,") ) /// Enable high-entropy ASLR - /// (Originally from ../FSComp.txt:903) + /// (Originally from ..\FSComp.txt:903) static member optsUseHighEntropyVA() = (GetStringFunc("optsUseHighEntropyVA",",,,") ) /// Specify subsystem version of this assembly - /// (Originally from ../FSComp.txt:904) + /// (Originally from ..\FSComp.txt:904) static member optsSubSystemVersion() = (GetStringFunc("optsSubSystemVersion",",,,") ) /// Specify target framework profile of this assembly. Valid values are mscorlib, netcore or netstandard. Default - mscorlib - /// (Originally from ../FSComp.txt:905) + /// (Originally from ..\FSComp.txt:905) static member optsTargetProfile() = (GetStringFunc("optsTargetProfile",",,,") ) /// Emit debug information in quotations - /// (Originally from ../FSComp.txt:906) + /// (Originally from ..\FSComp.txt:906) static member optsEmitDebugInfoInQuotations() = (GetStringFunc("optsEmitDebugInfoInQuotations",",,,") ) /// Specify the preferred output language culture name (e.g. es-ES, ja-JP) - /// (Originally from ../FSComp.txt:907) + /// (Originally from ..\FSComp.txt:907) static member optsPreferredUiLang() = (GetStringFunc("optsPreferredUiLang",",,,") ) /// Don't copy FSharp.Core.dll along the produced binaries - /// (Originally from ../FSComp.txt:908) + /// (Originally from ..\FSComp.txt:908) static member optsNoCopyFsharpCore() = (GetStringFunc("optsNoCopyFsharpCore",",,,") ) /// Invalid version '%s' for '--subsystemversion'. The version must be 4.00 or greater. - /// (Originally from ../FSComp.txt:909) + /// (Originally from ..\FSComp.txt:909) static member optsInvalidSubSystemVersion(a0 : System.String) = (1051, GetStringFunc("optsInvalidSubSystemVersion",",,,%s,,,") a0) /// Invalid value '%s' for '--targetprofile', valid values are 'mscorlib', 'netcore' or 'netstandard'. - /// (Originally from ../FSComp.txt:910) + /// (Originally from ..\FSComp.txt:910) static member optsInvalidTargetProfile(a0 : System.String) = (1052, GetStringFunc("optsInvalidTargetProfile",",,,%s,,,") a0) /// Full name - /// (Originally from ../FSComp.txt:911) + /// (Originally from ..\FSComp.txt:911) static member typeInfoFullName() = (GetStringFunc("typeInfoFullName",",,,") ) /// and %d other overloads - /// (Originally from ../FSComp.txt:915) + /// (Originally from ..\FSComp.txt:915) static member typeInfoOtherOverloads(a0 : System.Int32) = (GetStringFunc("typeInfoOtherOverloads",",,,%d,,,") a0) /// union case - /// (Originally from ../FSComp.txt:916) + /// (Originally from ..\FSComp.txt:916) static member typeInfoUnionCase() = (GetStringFunc("typeInfoUnionCase",",,,") ) /// active pattern result - /// (Originally from ../FSComp.txt:917) + /// (Originally from ..\FSComp.txt:917) static member typeInfoActivePatternResult() = (GetStringFunc("typeInfoActivePatternResult",",,,") ) /// active recognizer - /// (Originally from ../FSComp.txt:918) + /// (Originally from ..\FSComp.txt:918) static member typeInfoActiveRecognizer() = (GetStringFunc("typeInfoActiveRecognizer",",,,") ) /// field - /// (Originally from ../FSComp.txt:919) + /// (Originally from ..\FSComp.txt:919) static member typeInfoField() = (GetStringFunc("typeInfoField",",,,") ) /// event - /// (Originally from ../FSComp.txt:920) + /// (Originally from ..\FSComp.txt:920) static member typeInfoEvent() = (GetStringFunc("typeInfoEvent",",,,") ) /// property - /// (Originally from ../FSComp.txt:921) + /// (Originally from ..\FSComp.txt:921) static member typeInfoProperty() = (GetStringFunc("typeInfoProperty",",,,") ) /// extension - /// (Originally from ../FSComp.txt:922) + /// (Originally from ..\FSComp.txt:922) static member typeInfoExtension() = (GetStringFunc("typeInfoExtension",",,,") ) /// custom operation - /// (Originally from ../FSComp.txt:923) + /// (Originally from ..\FSComp.txt:923) static member typeInfoCustomOperation() = (GetStringFunc("typeInfoCustomOperation",",,,") ) /// argument - /// (Originally from ../FSComp.txt:924) + /// (Originally from ..\FSComp.txt:924) static member typeInfoArgument() = (GetStringFunc("typeInfoArgument",",,,") ) /// patvar - /// (Originally from ../FSComp.txt:925) + /// (Originally from ..\FSComp.txt:925) static member typeInfoPatternVariable() = (GetStringFunc("typeInfoPatternVariable",",,,") ) /// namespace - /// (Originally from ../FSComp.txt:926) + /// (Originally from ..\FSComp.txt:926) static member typeInfoNamespace() = (GetStringFunc("typeInfoNamespace",",,,") ) /// module - /// (Originally from ../FSComp.txt:927) + /// (Originally from ..\FSComp.txt:927) static member typeInfoModule() = (GetStringFunc("typeInfoModule",",,,") ) /// namespace/module - /// (Originally from ../FSComp.txt:928) + /// (Originally from ..\FSComp.txt:928) static member typeInfoNamespaceOrModule() = (GetStringFunc("typeInfoNamespaceOrModule",",,,") ) /// from %s - /// (Originally from ../FSComp.txt:929) + /// (Originally from ..\FSComp.txt:929) static member typeInfoFromFirst(a0 : System.String) = (GetStringFunc("typeInfoFromFirst",",,,%s,,,") a0) /// also from %s - /// (Originally from ../FSComp.txt:930) + /// (Originally from ..\FSComp.txt:930) static member typeInfoFromNext(a0 : System.String) = (GetStringFunc("typeInfoFromNext",",,,%s,,,") a0) /// generated property - /// (Originally from ../FSComp.txt:931) + /// (Originally from ..\FSComp.txt:931) static member typeInfoGeneratedProperty() = (GetStringFunc("typeInfoGeneratedProperty",",,,") ) /// generated type - /// (Originally from ../FSComp.txt:932) + /// (Originally from ..\FSComp.txt:932) static member typeInfoGeneratedType() = (GetStringFunc("typeInfoGeneratedType",",,,") ) /// Found by AssemblyFolders registry key - /// (Originally from ../FSComp.txt:933) + /// (Originally from ..\FSComp.txt:933) static member assemblyResolutionFoundByAssemblyFoldersKey() = (GetStringFunc("assemblyResolutionFoundByAssemblyFoldersKey",",,,") ) /// Found by AssemblyFoldersEx registry key - /// (Originally from ../FSComp.txt:934) + /// (Originally from ..\FSComp.txt:934) static member assemblyResolutionFoundByAssemblyFoldersExKey() = (GetStringFunc("assemblyResolutionFoundByAssemblyFoldersExKey",",,,") ) /// .NET Framework - /// (Originally from ../FSComp.txt:935) + /// (Originally from ..\FSComp.txt:935) static member assemblyResolutionNetFramework() = (GetStringFunc("assemblyResolutionNetFramework",",,,") ) /// Global Assembly Cache - /// (Originally from ../FSComp.txt:936) + /// (Originally from ..\FSComp.txt:936) static member assemblyResolutionGAC() = (GetStringFunc("assemblyResolutionGAC",",,,") ) /// Recursive class hierarchy in type '%s' - /// (Originally from ../FSComp.txt:937) + /// (Originally from ..\FSComp.txt:937) static member recursiveClassHierarchy(a0 : System.String) = (1089, GetStringFunc("recursiveClassHierarchy",",,,%s,,,") a0) /// Invalid recursive reference to an abstract slot - /// (Originally from ../FSComp.txt:938) + /// (Originally from ..\FSComp.txt:938) static member InvalidRecursiveReferenceToAbstractSlot() = (1090, GetStringFunc("InvalidRecursiveReferenceToAbstractSlot",",,,") ) /// The event '%s' has a non-standard type. If this event is declared in another CLI language, you may need to access this event using the explicit %s and %s methods for the event. If this event is declared in F#, make the type of the event an instantiation of either 'IDelegateEvent<_>' or 'IEvent<_,_>'. - /// (Originally from ../FSComp.txt:939) + /// (Originally from ..\FSComp.txt:939) static member eventHasNonStandardType(a0 : System.String, a1 : System.String, a2 : System.String) = (1091, GetStringFunc("eventHasNonStandardType",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// The type '%s' is not accessible from this code location - /// (Originally from ../FSComp.txt:940) + /// (Originally from ..\FSComp.txt:940) static member typeIsNotAccessible(a0 : System.String) = (1092, GetStringFunc("typeIsNotAccessible",",,,%s,,,") a0) /// The union cases or fields of the type '%s' are not accessible from this code location - /// (Originally from ../FSComp.txt:941) + /// (Originally from ..\FSComp.txt:941) static member unionCasesAreNotAccessible(a0 : System.String) = (1093, GetStringFunc("unionCasesAreNotAccessible",",,,%s,,,") a0) /// The value '%s' is not accessible from this code location - /// (Originally from ../FSComp.txt:942) + /// (Originally from ..\FSComp.txt:942) static member valueIsNotAccessible(a0 : System.String) = (1094, GetStringFunc("valueIsNotAccessible",",,,%s,,,") a0) /// The union case '%s' is not accessible from this code location - /// (Originally from ../FSComp.txt:943) + /// (Originally from ..\FSComp.txt:943) static member unionCaseIsNotAccessible(a0 : System.String) = (1095, GetStringFunc("unionCaseIsNotAccessible",",,,%s,,,") a0) /// The record, struct or class field '%s' is not accessible from this code location - /// (Originally from ../FSComp.txt:944) + /// (Originally from ..\FSComp.txt:944) static member fieldIsNotAccessible(a0 : System.String) = (1096, GetStringFunc("fieldIsNotAccessible",",,,%s,,,") a0) /// The struct or class field '%s' is not accessible from this code location - /// (Originally from ../FSComp.txt:945) + /// (Originally from ..\FSComp.txt:945) static member structOrClassFieldIsNotAccessible(a0 : System.String) = (1097, GetStringFunc("structOrClassFieldIsNotAccessible",",,,%s,,,") a0) /// This construct is experimental - /// (Originally from ../FSComp.txt:946) + /// (Originally from ..\FSComp.txt:946) static member experimentalConstruct() = (GetStringFunc("experimentalConstruct",",,,") ) /// No Invoke methods found for delegate type - /// (Originally from ../FSComp.txt:947) + /// (Originally from ..\FSComp.txt:947) static member noInvokeMethodsFound() = (1099, GetStringFunc("noInvokeMethodsFound",",,,") ) /// More than one Invoke method found for delegate type - /// (Originally from ../FSComp.txt:948) + /// (Originally from ..\FSComp.txt:948) static member moreThanOneInvokeMethodFound() = (GetStringFunc("moreThanOneInvokeMethodFound",",,,") ) /// Delegates are not allowed to have curried signatures - /// (Originally from ../FSComp.txt:949) + /// (Originally from ..\FSComp.txt:949) static member delegatesNotAllowedToHaveCurriedSignatures() = (1101, GetStringFunc("delegatesNotAllowedToHaveCurriedSignatures",",,,") ) /// Unexpected Expr.TyChoose - /// (Originally from ../FSComp.txt:950) + /// (Originally from ..\FSComp.txt:950) static member tlrUnexpectedTExpr() = (1102, GetStringFunc("tlrUnexpectedTExpr",",,,") ) /// Note: Lambda-lifting optimizations have not been applied because of the use of this local constrained generic function as a first class value. Adding type constraints may resolve this condition. - /// (Originally from ../FSComp.txt:951) + /// (Originally from ..\FSComp.txt:951) static member tlrLambdaLiftingOptimizationsNotApplied() = (1103, GetStringFunc("tlrLambdaLiftingOptimizationsNotApplied",",,,") ) /// Identifiers containing '@' are reserved for use in F# code generation - /// (Originally from ../FSComp.txt:952) + /// (Originally from ..\FSComp.txt:952) static member lexhlpIdentifiersContainingAtSymbolReserved() = (1104, GetStringFunc("lexhlpIdentifiersContainingAtSymbolReserved",",,,") ) /// The identifier '%s' is reserved for future use by F# - /// (Originally from ../FSComp.txt:953) + /// (Originally from ..\FSComp.txt:953) static member lexhlpIdentifierReserved(a0 : System.String) = (GetStringFunc("lexhlpIdentifierReserved",",,,%s,,,") a0) /// Missing variable '%s' - /// (Originally from ../FSComp.txt:954) + /// (Originally from ..\FSComp.txt:954) static member patcMissingVariable(a0 : System.String) = (1106, GetStringFunc("patcMissingVariable",",,,%s,,,") a0) /// Partial active patterns may only generate one result - /// (Originally from ../FSComp.txt:955) + /// (Originally from ..\FSComp.txt:955) static member patcPartialActivePatternsGenerateOneResult() = (1107, GetStringFunc("patcPartialActivePatternsGenerateOneResult",",,,") ) /// The type '%s' is required here and is unavailable. You must add a reference to assembly '%s'. - /// (Originally from ../FSComp.txt:956) + /// (Originally from ..\FSComp.txt:956) static member impTypeRequiredUnavailable(a0 : System.String, a1 : System.String) = (1108, GetStringFunc("impTypeRequiredUnavailable",",,,%s,,,%s,,,") a0 a1) /// A reference to the type '%s' in assembly '%s' was found, but the type could not be found in that assembly - /// (Originally from ../FSComp.txt:957) + /// (Originally from ..\FSComp.txt:957) static member impReferencedTypeCouldNotBeFoundInAssembly(a0 : System.String, a1 : System.String) = (1109, GetStringFunc("impReferencedTypeCouldNotBeFoundInAssembly",",,,%s,,,%s,,,") a0 a1) /// Internal error or badly formed metadata: not enough type parameters were in scope while importing - /// (Originally from ../FSComp.txt:958) + /// (Originally from ..\FSComp.txt:958) static member impNotEnoughTypeParamsInScopeWhileImporting() = (1110, GetStringFunc("impNotEnoughTypeParamsInScopeWhileImporting",",,,") ) /// A reference to the DLL %s is required by assembly %s. The imported type %s is located in the first assembly and could not be resolved. - /// (Originally from ../FSComp.txt:959) + /// (Originally from ..\FSComp.txt:959) static member impReferenceToDllRequiredByAssembly(a0 : System.String, a1 : System.String, a2 : System.String) = (1111, GetStringFunc("impReferenceToDllRequiredByAssembly",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// An imported assembly uses the type '%s' but that type is not public - /// (Originally from ../FSComp.txt:960) + /// (Originally from ..\FSComp.txt:960) static member impImportedAssemblyUsesNotPublicType(a0 : System.String) = (1112, GetStringFunc("impImportedAssemblyUsesNotPublicType",",,,%s,,,") a0) /// The value '%s' was marked inline but its implementation makes use of an internal or private function which is not sufficiently accessible - /// (Originally from ../FSComp.txt:961) + /// (Originally from ..\FSComp.txt:961) static member optValueMarkedInlineButIncomplete(a0 : System.String) = (1113, GetStringFunc("optValueMarkedInlineButIncomplete",",,,%s,,,") a0) /// The value '%s' was marked inline but was not bound in the optimization environment - /// (Originally from ../FSComp.txt:962) + /// (Originally from ..\FSComp.txt:962) static member optValueMarkedInlineButWasNotBoundInTheOptEnv(a0 : System.String) = (1114, GetStringFunc("optValueMarkedInlineButWasNotBoundInTheOptEnv",",,,%s,,,") a0) /// Local value %s not found during optimization - /// (Originally from ../FSComp.txt:963) + /// (Originally from ..\FSComp.txt:963) static member optLocalValueNotFoundDuringOptimization(a0 : System.String) = (1115, GetStringFunc("optLocalValueNotFoundDuringOptimization",",,,%s,,,") a0) /// A value marked as 'inline' has an unexpected value - /// (Originally from ../FSComp.txt:964) + /// (Originally from ..\FSComp.txt:964) static member optValueMarkedInlineHasUnexpectedValue() = (1116, GetStringFunc("optValueMarkedInlineHasUnexpectedValue",",,,") ) /// A value marked as 'inline' could not be inlined - /// (Originally from ../FSComp.txt:965) + /// (Originally from ..\FSComp.txt:965) static member optValueMarkedInlineCouldNotBeInlined() = (1117, GetStringFunc("optValueMarkedInlineCouldNotBeInlined",",,,") ) /// Failed to inline the value '%s' marked 'inline', perhaps because a recursive value was marked 'inline' - /// (Originally from ../FSComp.txt:966) + /// (Originally from ..\FSComp.txt:966) static member optFailedToInlineValue(a0 : System.String) = (1118, GetStringFunc("optFailedToInlineValue",",,,%s,,,") a0) /// Recursive ValValue %s - /// (Originally from ../FSComp.txt:967) + /// (Originally from ..\FSComp.txt:967) static member optRecursiveValValue(a0 : System.String) = (1119, GetStringFunc("optRecursiveValValue",",,,%s,,,") a0) /// The indentation of this 'in' token is incorrect with respect to the corresponding 'let' - /// (Originally from ../FSComp.txt:968) + /// (Originally from ..\FSComp.txt:968) static member lexfltIncorrentIndentationOfIn() = (GetStringFunc("lexfltIncorrentIndentationOfIn",",,,") ) /// Possible incorrect indentation: this token is offside of context started at position %s. Try indenting this token further or using standard formatting conventions. - /// (Originally from ../FSComp.txt:969) + /// (Originally from ..\FSComp.txt:969) static member lexfltTokenIsOffsideOfContextStartedEarlier(a0 : System.String) = (GetStringFunc("lexfltTokenIsOffsideOfContextStartedEarlier",",,,%s,,,") a0) /// The '|' tokens separating rules of this pattern match are misaligned by one column. Consider realigning your code or using further indentation. - /// (Originally from ../FSComp.txt:970) + /// (Originally from ..\FSComp.txt:970) static member lexfltSeparatorTokensOfPatternMatchMisaligned() = (GetStringFunc("lexfltSeparatorTokensOfPatternMatchMisaligned",",,,") ) /// Invalid module/expression/type - /// (Originally from ../FSComp.txt:971) + /// (Originally from ..\FSComp.txt:971) static member nrInvalidModuleExprType() = (1123, GetStringFunc("nrInvalidModuleExprType",",,,") ) /// Multiple types exist called '%s', taking different numbers of generic parameters. Provide a type instantiation to disambiguate the type resolution, e.g. '%s'. - /// (Originally from ../FSComp.txt:972) + /// (Originally from ..\FSComp.txt:972) static member nrTypeInstantiationNeededToDisambiguateTypesWithSameName(a0 : System.String, a1 : System.String) = (1124, GetStringFunc("nrTypeInstantiationNeededToDisambiguateTypesWithSameName",",,,%s,,,%s,,,") a0 a1) /// The instantiation of the generic type '%s' is missing and can't be inferred from the arguments or return type of this member. Consider providing a type instantiation when accessing this type, e.g. '%s'. - /// (Originally from ../FSComp.txt:973) + /// (Originally from ..\FSComp.txt:973) static member nrTypeInstantiationIsMissingAndCouldNotBeInferred(a0 : System.String, a1 : System.String) = (1125, GetStringFunc("nrTypeInstantiationIsMissingAndCouldNotBeInferred",",,,%s,,,%s,,,") a0 a1) /// 'global' may only be used as the first name in a qualified path - /// (Originally from ../FSComp.txt:974) + /// (Originally from ..\FSComp.txt:974) static member nrGlobalUsedOnlyAsFirstName() = (1126, GetStringFunc("nrGlobalUsedOnlyAsFirstName",",,,") ) /// This is not a constructor or literal, or a constructor is being used incorrectly - /// (Originally from ../FSComp.txt:975) + /// (Originally from ..\FSComp.txt:975) static member nrIsNotConstructorOrLiteral() = (1127, GetStringFunc("nrIsNotConstructorOrLiteral",",,,") ) /// Unexpected empty long identifier - /// (Originally from ../FSComp.txt:976) + /// (Originally from ..\FSComp.txt:976) static member nrUnexpectedEmptyLongId() = (1128, GetStringFunc("nrUnexpectedEmptyLongId",",,,") ) /// The record type '%s' does not contain a label '%s'. - /// (Originally from ../FSComp.txt:977) + /// (Originally from ..\FSComp.txt:977) static member nrRecordDoesNotContainSuchLabel(a0 : System.String, a1 : System.String) = (1129, GetStringFunc("nrRecordDoesNotContainSuchLabel",",,,%s,,,%s,,,") a0 a1) /// Invalid field label - /// (Originally from ../FSComp.txt:978) + /// (Originally from ..\FSComp.txt:978) static member nrInvalidFieldLabel() = (1130, GetStringFunc("nrInvalidFieldLabel",",,,") ) /// Invalid expression '%s' - /// (Originally from ../FSComp.txt:979) + /// (Originally from ..\FSComp.txt:979) static member nrInvalidExpression(a0 : System.String) = (1132, GetStringFunc("nrInvalidExpression",",,,%s,,,") a0) /// No constructors are available for the type '%s' - /// (Originally from ../FSComp.txt:980) + /// (Originally from ..\FSComp.txt:980) static member nrNoConstructorsAvailableForType(a0 : System.String) = (1133, GetStringFunc("nrNoConstructorsAvailableForType",",,,%s,,,") a0) /// The union type for union case '%s' was defined with the RequireQualifiedAccessAttribute. Include the name of the union type ('%s') in the name you are using. - /// (Originally from ../FSComp.txt:981) + /// (Originally from ..\FSComp.txt:981) static member nrUnionTypeNeedsQualifiedAccess(a0 : System.String, a1 : System.String) = (1134, GetStringFunc("nrUnionTypeNeedsQualifiedAccess",",,,%s,,,%s,,,") a0 a1) /// The record type for the record field '%s' was defined with the RequireQualifiedAccessAttribute. Include the name of the record type ('%s') in the name you are using. - /// (Originally from ../FSComp.txt:982) + /// (Originally from ..\FSComp.txt:982) static member nrRecordTypeNeedsQualifiedAccess(a0 : System.String, a1 : System.String) = (1135, GetStringFunc("nrRecordTypeNeedsQualifiedAccess",",,,%s,,,%s,,,") a0 a1) /// Unexpected error creating debug information file '%s' - /// (Originally from ../FSComp.txt:983) + /// (Originally from ..\FSComp.txt:983) static member ilwriteErrorCreatingPdb(a0 : System.String) = (1136, GetStringFunc("ilwriteErrorCreatingPdb",",,,%s,,,") a0) /// This number is outside the allowable range for this integer type - /// (Originally from ../FSComp.txt:984) + /// (Originally from ..\FSComp.txt:984) static member lexOutsideIntegerRange() = (1138, GetStringFunc("lexOutsideIntegerRange",",,,") ) /// '%s' is not permitted as a character in operator names and is reserved for future use - /// (Originally from ../FSComp.txt:988) + /// (Originally from ..\FSComp.txt:988) static member lexCharNotAllowedInOperatorNames(a0 : System.String) = (GetStringFunc("lexCharNotAllowedInOperatorNames",",,,%s,,,") a0) /// Unexpected character '%s' - /// (Originally from ../FSComp.txt:989) + /// (Originally from ..\FSComp.txt:989) static member lexUnexpectedChar(a0 : System.String) = (GetStringFunc("lexUnexpectedChar",",,,%s,,,") a0) /// This byte array literal contains characters that do not encode as a single byte - /// (Originally from ../FSComp.txt:990) + /// (Originally from ..\FSComp.txt:990) static member lexByteArrayCannotEncode() = (1140, GetStringFunc("lexByteArrayCannotEncode",",,,") ) /// Identifiers followed by '%s' are reserved for future use - /// (Originally from ../FSComp.txt:991) + /// (Originally from ..\FSComp.txt:991) static member lexIdentEndInMarkReserved(a0 : System.String) = (1141, GetStringFunc("lexIdentEndInMarkReserved",",,,%s,,,") a0) /// This number is outside the allowable range for 8-bit signed integers - /// (Originally from ../FSComp.txt:992) + /// (Originally from ..\FSComp.txt:992) static member lexOutsideEightBitSigned() = (1142, GetStringFunc("lexOutsideEightBitSigned",",,,") ) /// This number is outside the allowable range for hexadecimal 8-bit signed integers - /// (Originally from ../FSComp.txt:993) + /// (Originally from ..\FSComp.txt:993) static member lexOutsideEightBitSignedHex() = (1143, GetStringFunc("lexOutsideEightBitSignedHex",",,,") ) /// This number is outside the allowable range for 8-bit unsigned integers - /// (Originally from ../FSComp.txt:994) + /// (Originally from ..\FSComp.txt:994) static member lexOutsideEightBitUnsigned() = (1144, GetStringFunc("lexOutsideEightBitUnsigned",",,,") ) /// This number is outside the allowable range for 16-bit signed integers - /// (Originally from ../FSComp.txt:995) + /// (Originally from ..\FSComp.txt:995) static member lexOutsideSixteenBitSigned() = (1145, GetStringFunc("lexOutsideSixteenBitSigned",",,,") ) /// This number is outside the allowable range for 16-bit unsigned integers - /// (Originally from ../FSComp.txt:996) + /// (Originally from ..\FSComp.txt:996) static member lexOutsideSixteenBitUnsigned() = (1146, GetStringFunc("lexOutsideSixteenBitUnsigned",",,,") ) /// This number is outside the allowable range for 32-bit signed integers - /// (Originally from ../FSComp.txt:997) + /// (Originally from ..\FSComp.txt:997) static member lexOutsideThirtyTwoBitSigned() = (1147, GetStringFunc("lexOutsideThirtyTwoBitSigned",",,,") ) /// This number is outside the allowable range for 32-bit unsigned integers - /// (Originally from ../FSComp.txt:998) + /// (Originally from ..\FSComp.txt:998) static member lexOutsideThirtyTwoBitUnsigned() = (1148, GetStringFunc("lexOutsideThirtyTwoBitUnsigned",",,,") ) /// This number is outside the allowable range for 64-bit signed integers - /// (Originally from ../FSComp.txt:999) + /// (Originally from ..\FSComp.txt:999) static member lexOutsideSixtyFourBitSigned() = (1149, GetStringFunc("lexOutsideSixtyFourBitSigned",",,,") ) /// This number is outside the allowable range for 64-bit unsigned integers - /// (Originally from ../FSComp.txt:1000) + /// (Originally from ..\FSComp.txt:1000) static member lexOutsideSixtyFourBitUnsigned() = (1150, GetStringFunc("lexOutsideSixtyFourBitUnsigned",",,,") ) /// This number is outside the allowable range for signed native integers - /// (Originally from ../FSComp.txt:1001) + /// (Originally from ..\FSComp.txt:1001) static member lexOutsideNativeSigned() = (1151, GetStringFunc("lexOutsideNativeSigned",",,,") ) /// This number is outside the allowable range for unsigned native integers - /// (Originally from ../FSComp.txt:1002) + /// (Originally from ..\FSComp.txt:1002) static member lexOutsideNativeUnsigned() = (1152, GetStringFunc("lexOutsideNativeUnsigned",",,,") ) /// Invalid floating point number - /// (Originally from ../FSComp.txt:1003) + /// (Originally from ..\FSComp.txt:1003) static member lexInvalidFloat() = (1153, GetStringFunc("lexInvalidFloat",",,,") ) /// This number is outside the allowable range for decimal literals - /// (Originally from ../FSComp.txt:1004) + /// (Originally from ..\FSComp.txt:1004) static member lexOusideDecimal() = (1154, GetStringFunc("lexOusideDecimal",",,,") ) /// This number is outside the allowable range for 32-bit floats - /// (Originally from ../FSComp.txt:1005) + /// (Originally from ..\FSComp.txt:1005) static member lexOusideThirtyTwoBitFloat() = (1155, GetStringFunc("lexOusideThirtyTwoBitFloat",",,,") ) /// 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), 1uy (byte), 1.0 (float), 1.0f (float32), 1.0m (decimal), 1I (BigInteger). - /// (Originally from ../FSComp.txt:1006) + /// (Originally from ..\FSComp.txt:1006) static member lexInvalidNumericLiteral() = (1156, GetStringFunc("lexInvalidNumericLiteral",",,,") ) /// This is not a valid byte literal - /// (Originally from ../FSComp.txt:1007) + /// (Originally from ..\FSComp.txt:1007) static member lexInvalidByteLiteral() = (1157, GetStringFunc("lexInvalidByteLiteral",",,,") ) /// This is not a valid character literal - /// (Originally from ../FSComp.txt:1008) + /// (Originally from ..\FSComp.txt:1008) static member lexInvalidCharLiteral() = (1158, GetStringFunc("lexInvalidCharLiteral",",,,") ) /// This Unicode encoding is only valid in string literals - /// (Originally from ../FSComp.txt:1009) + /// (Originally from ..\FSComp.txt:1009) static member lexThisUnicodeOnlyInStringLiterals() = (1159, GetStringFunc("lexThisUnicodeOnlyInStringLiterals",",,,") ) /// This token is reserved for future use - /// (Originally from ../FSComp.txt:1010) + /// (Originally from ..\FSComp.txt:1010) static member lexTokenReserved() = (1160, GetStringFunc("lexTokenReserved",",,,") ) /// TABs are not allowed in F# code unless the #indent \"off\" option is used - /// (Originally from ../FSComp.txt:1011) + /// (Originally from ..\FSComp.txt:1011) static member lexTabsNotAllowed() = (1161, GetStringFunc("lexTabsNotAllowed",",,,") ) /// Invalid line number: '%s' - /// (Originally from ../FSComp.txt:1012) + /// (Originally from ..\FSComp.txt:1012) static member lexInvalidLineNumber(a0 : System.String) = (1162, GetStringFunc("lexInvalidLineNumber",",,,%s,,,") a0) /// #if directive must appear as the first non-whitespace character on a line - /// (Originally from ../FSComp.txt:1013) + /// (Originally from ..\FSComp.txt:1013) static member lexHashIfMustBeFirst() = (1163, GetStringFunc("lexHashIfMustBeFirst",",,,") ) /// #else has no matching #if - /// (Originally from ../FSComp.txt:1014) + /// (Originally from ..\FSComp.txt:1014) static member lexHashElseNoMatchingIf() = (GetStringFunc("lexHashElseNoMatchingIf",",,,") ) /// #endif required for #else - /// (Originally from ../FSComp.txt:1015) + /// (Originally from ..\FSComp.txt:1015) static member lexHashEndifRequiredForElse() = (GetStringFunc("lexHashEndifRequiredForElse",",,,") ) /// #else directive must appear as the first non-whitespace character on a line - /// (Originally from ../FSComp.txt:1016) + /// (Originally from ..\FSComp.txt:1016) static member lexHashElseMustBeFirst() = (1166, GetStringFunc("lexHashElseMustBeFirst",",,,") ) /// #endif has no matching #if - /// (Originally from ../FSComp.txt:1017) + /// (Originally from ..\FSComp.txt:1017) static member lexHashEndingNoMatchingIf() = (GetStringFunc("lexHashEndingNoMatchingIf",",,,") ) /// #endif directive must appear as the first non-whitespace character on a line - /// (Originally from ../FSComp.txt:1018) + /// (Originally from ..\FSComp.txt:1018) static member lexHashEndifMustBeFirst() = (1168, GetStringFunc("lexHashEndifMustBeFirst",",,,") ) /// #if directive should be immediately followed by an identifier - /// (Originally from ../FSComp.txt:1019) + /// (Originally from ..\FSComp.txt:1019) static member lexHashIfMustHaveIdent() = (1169, GetStringFunc("lexHashIfMustHaveIdent",",,,") ) /// Syntax error. Wrong nested #endif, unexpected tokens before it. - /// (Originally from ../FSComp.txt:1020) + /// (Originally from ..\FSComp.txt:1020) static member lexWrongNestedHashEndif() = (1170, GetStringFunc("lexWrongNestedHashEndif",",,,") ) /// #! may only appear as the first line at the start of a file. - /// (Originally from ../FSComp.txt:1021) + /// (Originally from ..\FSComp.txt:1021) static member lexHashBangMustBeFirstInFile() = (GetStringFunc("lexHashBangMustBeFirstInFile",",,,") ) /// Expected single line comment or end of line - /// (Originally from ../FSComp.txt:1022) + /// (Originally from ..\FSComp.txt:1022) static member pplexExpectedSingleLineComment() = (1171, GetStringFunc("pplexExpectedSingleLineComment",",,,") ) /// Infix operator member '%s' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... - /// (Originally from ../FSComp.txt:1023) + /// (Originally from ..\FSComp.txt:1023) static member memberOperatorDefinitionWithNoArguments(a0 : System.String) = (1172, GetStringFunc("memberOperatorDefinitionWithNoArguments",",,,%s,,,") a0) /// Infix operator member '%s' has %d initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... - /// (Originally from ../FSComp.txt:1024) + /// (Originally from ..\FSComp.txt:1024) static member memberOperatorDefinitionWithNonPairArgument(a0 : System.String, a1 : System.Int32) = (1173, GetStringFunc("memberOperatorDefinitionWithNonPairArgument",",,,%s,,,%d,,,") a0 a1) /// Infix operator member '%s' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... - /// (Originally from ../FSComp.txt:1025) + /// (Originally from ..\FSComp.txt:1025) static member memberOperatorDefinitionWithCurriedArguments(a0 : System.String) = (1174, GetStringFunc("memberOperatorDefinitionWithCurriedArguments",",,,%s,,,") a0) /// All record, union and struct types in FSharp.Core.dll must be explicitly labelled with 'StructuralComparison' or 'NoComparison' - /// (Originally from ../FSComp.txt:1026) + /// (Originally from ..\FSComp.txt:1026) static member tcFSharpCoreRequiresExplicit() = (1175, GetStringFunc("tcFSharpCoreRequiresExplicit",",,,") ) /// The struct, record or union type '%s' has the 'StructuralComparison' attribute but the type parameter '%s' does not satisfy the 'comparison' constraint. Consider adding the 'comparison' constraint to the type parameter - /// (Originally from ../FSComp.txt:1027) + /// (Originally from ..\FSComp.txt:1027) static member tcStructuralComparisonNotSatisfied1(a0 : System.String, a1 : System.String) = (1176, GetStringFunc("tcStructuralComparisonNotSatisfied1",",,,%s,,,%s,,,") a0 a1) /// The struct, record or union type '%s' has the 'StructuralComparison' attribute but the component type '%s' does not satisfy the 'comparison' constraint - /// (Originally from ../FSComp.txt:1028) + /// (Originally from ..\FSComp.txt:1028) static member tcStructuralComparisonNotSatisfied2(a0 : System.String, a1 : System.String) = (1177, GetStringFunc("tcStructuralComparisonNotSatisfied2",",,,%s,,,%s,,,") a0 a1) /// The struct, record or union type '%s' is not structurally comparable because the type parameter %s does not satisfy the 'comparison' constraint. Consider adding the 'NoComparison' attribute to the type '%s' to clarify that the type is not comparable - /// (Originally from ../FSComp.txt:1029) + /// (Originally from ..\FSComp.txt:1029) static member tcNoComparisonNeeded1(a0 : System.String, a1 : System.String, a2 : System.String) = (1178, GetStringFunc("tcNoComparisonNeeded1",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// The struct, record or union type '%s' is not structurally comparable because the type '%s' does not satisfy the 'comparison' constraint. Consider adding the 'NoComparison' attribute to the type '%s' to clarify that the type is not comparable - /// (Originally from ../FSComp.txt:1030) + /// (Originally from ..\FSComp.txt:1030) static member tcNoComparisonNeeded2(a0 : System.String, a1 : System.String, a2 : System.String) = (1178, GetStringFunc("tcNoComparisonNeeded2",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// The struct, record or union type '%s' does not support structural equality because the type parameter %s does not satisfy the 'equality' constraint. Consider adding the 'NoEquality' attribute to the type '%s' to clarify that the type does not support structural equality - /// (Originally from ../FSComp.txt:1031) + /// (Originally from ..\FSComp.txt:1031) static member tcNoEqualityNeeded1(a0 : System.String, a1 : System.String, a2 : System.String) = (1178, GetStringFunc("tcNoEqualityNeeded1",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// The struct, record or union type '%s' does not support structural equality because the type '%s' does not satisfy the 'equality' constraint. Consider adding the 'NoEquality' attribute to the type '%s' to clarify that the type does not support structural equality - /// (Originally from ../FSComp.txt:1032) + /// (Originally from ..\FSComp.txt:1032) static member tcNoEqualityNeeded2(a0 : System.String, a1 : System.String, a2 : System.String) = (1178, GetStringFunc("tcNoEqualityNeeded2",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// The struct, record or union type '%s' has the 'StructuralEquality' attribute but the type parameter '%s' does not satisfy the 'equality' constraint. Consider adding the 'equality' constraint to the type parameter - /// (Originally from ../FSComp.txt:1033) + /// (Originally from ..\FSComp.txt:1033) static member tcStructuralEqualityNotSatisfied1(a0 : System.String, a1 : System.String) = (1179, GetStringFunc("tcStructuralEqualityNotSatisfied1",",,,%s,,,%s,,,") a0 a1) /// The struct, record or union type '%s' has the 'StructuralEquality' attribute but the component type '%s' does not satisfy the 'equality' constraint - /// (Originally from ../FSComp.txt:1034) + /// (Originally from ..\FSComp.txt:1034) static member tcStructuralEqualityNotSatisfied2(a0 : System.String, a1 : System.String) = (1180, GetStringFunc("tcStructuralEqualityNotSatisfied2",",,,%s,,,%s,,,") a0 a1) /// Each argument of the primary constructor for a struct must be given a type, for example 'type S(x1:int, x2: int) = ...'. These arguments determine the fields of the struct. - /// (Originally from ../FSComp.txt:1035) + /// (Originally from ..\FSComp.txt:1035) static member tcStructsMustDeclareTypesOfImplicitCtorArgsExplicitly() = (1181, GetStringFunc("tcStructsMustDeclareTypesOfImplicitCtorArgsExplicitly",",,,") ) /// The value '%s' is unused - /// (Originally from ../FSComp.txt:1036) + /// (Originally from ..\FSComp.txt:1036) static member chkUnusedValue(a0 : System.String) = (1182, GetStringFunc("chkUnusedValue",",,,%s,,,") a0) /// The recursive object reference '%s' is unused. The presence of a recursive object reference adds runtime initialization checks to members in this and derived types. Consider removing this recursive object reference. - /// (Originally from ../FSComp.txt:1037) + /// (Originally from ..\FSComp.txt:1037) static member chkUnusedThisVariable(a0 : System.String) = (1183, GetStringFunc("chkUnusedThisVariable",",,,%s,,,") a0) /// A getter property may have at most one argument group - /// (Originally from ../FSComp.txt:1038) + /// (Originally from ..\FSComp.txt:1038) static member parsGetterAtMostOneArgument() = (1184, GetStringFunc("parsGetterAtMostOneArgument",",,,") ) /// A setter property may have at most two argument groups - /// (Originally from ../FSComp.txt:1039) + /// (Originally from ..\FSComp.txt:1039) static member parsSetterAtMostTwoArguments() = (1185, GetStringFunc("parsSetterAtMostTwoArguments",",,,") ) /// Invalid property getter or setter - /// (Originally from ../FSComp.txt:1040) + /// (Originally from ..\FSComp.txt:1040) static member parsInvalidProperty() = (1186, GetStringFunc("parsInvalidProperty",",,,") ) /// An indexer property must be given at least one argument - /// (Originally from ../FSComp.txt:1041) + /// (Originally from ..\FSComp.txt:1041) static member parsIndexerPropertyRequiresAtLeastOneArgument() = (1187, GetStringFunc("parsIndexerPropertyRequiresAtLeastOneArgument",",,,") ) /// This operation accesses a mutable top-level value defined in another assembly in an unsupported way. The value cannot be accessed through its address. Consider copying the expression to a mutable local, e.g. 'let mutable x = ...', and if necessary assigning the value back after the completion of the operation - /// (Originally from ../FSComp.txt:1042) + /// (Originally from ..\FSComp.txt:1042) static member tastInvalidAddressOfMutableAcrossAssemblyBoundary() = (1188, GetStringFunc("tastInvalidAddressOfMutableAcrossAssemblyBoundary",",,,") ) /// Type parameters must be placed directly adjacent to the type name, e.g. \"type C<'T>\", not type \"C <'T>\" - /// (Originally from ../FSComp.txt:1043) + /// (Originally from ..\FSComp.txt:1043) static member parsNonAdjacentTypars() = (1189, GetStringFunc("parsNonAdjacentTypars",",,,") ) /// Type arguments must be placed directly adjacent to the type name, e.g. \"C<'T>\", not \"C <'T>\" - /// (Originally from ../FSComp.txt:1044) + /// (Originally from ..\FSComp.txt:1044) static member parsNonAdjacentTyargs() = (1190, GetStringFunc("parsNonAdjacentTyargs",",,,") ) /// The use of the type syntax 'int C' and 'C ' is not permitted here. Consider adjusting this type to be written in the form 'C' - /// (Originally from ../FSComp.txt:1045) + /// (Originally from ..\FSComp.txt:1045) static member parsNonAtomicType() = (GetStringFunc("parsNonAtomicType",",,,") ) /// The module/namespace '%s' from compilation unit '%s' did not contain the module/namespace '%s' - /// (Originally from ../FSComp.txt:1048) + /// (Originally from ..\FSComp.txt:1048) static member tastUndefinedItemRefModuleNamespace(a0 : System.String, a1 : System.String, a2 : System.String) = (1193, GetStringFunc("tastUndefinedItemRefModuleNamespace",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// The module/namespace '%s' from compilation unit '%s' did not contain the val '%s' - /// (Originally from ../FSComp.txt:1049) + /// (Originally from ..\FSComp.txt:1049) static member tastUndefinedItemRefVal(a0 : System.String, a1 : System.String, a2 : System.String) = (1194, GetStringFunc("tastUndefinedItemRefVal",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// The module/namespace '%s' from compilation unit '%s' did not contain the namespace, module or type '%s' - /// (Originally from ../FSComp.txt:1050) + /// (Originally from ..\FSComp.txt:1050) static member tastUndefinedItemRefModuleNamespaceType(a0 : System.String, a1 : System.String, a2 : System.String) = (1195, GetStringFunc("tastUndefinedItemRefModuleNamespaceType",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// The 'UseNullAsTrueValue' attribute flag may only be used with union types that have one nullary case and at least one non-nullary case - /// (Originally from ../FSComp.txt:1051) + /// (Originally from ..\FSComp.txt:1051) static member tcInvalidUseNullAsTrueValue() = (1196, GetStringFunc("tcInvalidUseNullAsTrueValue",",,,") ) /// The parameter '%s' was inferred to have byref type. Parameters of byref type must be given an explicit type annotation, e.g. 'x1: byref'. When used, a byref parameter is implicitly dereferenced. - /// (Originally from ../FSComp.txt:1052) + /// (Originally from ..\FSComp.txt:1052) static member tcParameterInferredByref(a0 : System.String) = (1197, GetStringFunc("tcParameterInferredByref",",,,%s,,,") a0) /// The generic member '%s' has been used at a non-uniform instantiation prior to this program point. Consider reordering the members so this member occurs first. Alternatively, specify the full type of the member explicitly, including argument types, return type and any additional generic parameters and constraints. - /// (Originally from ../FSComp.txt:1053) + /// (Originally from ..\FSComp.txt:1053) static member tcNonUniformMemberUse(a0 : System.String) = (1198, GetStringFunc("tcNonUniformMemberUse",",,,%s,,,") a0) /// The attribute '%s' appears in both the implementation and the signature, but the attribute arguments differ. Only the attribute from the signature will be included in the compiled code. - /// (Originally from ../FSComp.txt:1054) + /// (Originally from ..\FSComp.txt:1054) static member tcAttribArgsDiffer(a0 : System.String) = (1200, GetStringFunc("tcAttribArgsDiffer",",,,%s,,,") a0) /// Cannot call an abstract base member: '%s' - /// (Originally from ../FSComp.txt:1055) + /// (Originally from ..\FSComp.txt:1055) static member tcCannotCallAbstractBaseMember(a0 : System.String) = (1201, GetStringFunc("tcCannotCallAbstractBaseMember",",,,%s,,,") a0) /// Could not resolve the ambiguity in the use of a generic construct with an 'unmanaged' constraint at or near this position - /// (Originally from ../FSComp.txt:1056) + /// (Originally from ..\FSComp.txt:1056) static member typrelCannotResolveAmbiguityInUnmanaged() = (1202, GetStringFunc("typrelCannotResolveAmbiguityInUnmanaged",",,,") ) /// This construct is for ML compatibility. %s. You can disable this warning by using '--mlcompatibility' or '--nowarn:62'. - /// (Originally from ../FSComp.txt:1059) + /// (Originally from ..\FSComp.txt:1059) static member mlCompatMessage(a0 : System.String) = (GetStringFunc("mlCompatMessage",",,,%s,,,") a0) /// The type '%s' has been marked as having an Explicit layout, but the field '%s' has not been marked with the 'FieldOffset' attribute - /// (Originally from ../FSComp.txt:1061) + /// (Originally from ..\FSComp.txt:1061) static member ilFieldDoesNotHaveValidOffsetForStructureLayout(a0 : System.String, a1 : System.String) = (1206, GetStringFunc("ilFieldDoesNotHaveValidOffsetForStructureLayout",",,,%s,,,%s,,,") a0 a1) /// Interfaces inherited by other interfaces should be declared using 'inherit ...' instead of 'interface ...' - /// (Originally from ../FSComp.txt:1062) + /// (Originally from ..\FSComp.txt:1062) static member tcInterfacesShouldUseInheritNotInterface() = (1207, GetStringFunc("tcInterfacesShouldUseInheritNotInterface",",,,") ) /// Invalid prefix operator - /// (Originally from ../FSComp.txt:1063) + /// (Originally from ..\FSComp.txt:1063) static member parsInvalidPrefixOperator() = (1208, GetStringFunc("parsInvalidPrefixOperator",",,,") ) /// Invalid operator definition. Prefix operator definitions must use a valid prefix operator name. - /// (Originally from ../FSComp.txt:1064) + /// (Originally from ..\FSComp.txt:1064) static member parsInvalidPrefixOperatorDefinition() = (1208, GetStringFunc("parsInvalidPrefixOperatorDefinition",",,,") ) /// The file extensions '.ml' and '.mli' are for ML compatibility - /// (Originally from ../FSComp.txt:1065) + /// (Originally from ..\FSComp.txt:1065) static member buildCompilingExtensionIsForML() = (GetStringFunc("buildCompilingExtensionIsForML",",,,") ) /// Consider using a file with extension '.ml' or '.mli' instead - /// (Originally from ../FSComp.txt:1066) + /// (Originally from ..\FSComp.txt:1066) static member lexIndentOffForML() = (GetStringFunc("lexIndentOffForML",",,,") ) /// Active pattern '%s' is not a function - /// (Originally from ../FSComp.txt:1067) + /// (Originally from ..\FSComp.txt:1067) static member activePatternIdentIsNotFunctionTyped(a0 : System.String) = (1209, GetStringFunc("activePatternIdentIsNotFunctionTyped",",,,%s,,,") a0) /// Active pattern '%s' has a result type containing type variables that are not determined by the input. The common cause is a when a result case is not mentioned, e.g. 'let (|A|B|) (x:int) = A x'. This can be fixed with a type constraint, e.g. 'let (|A|B|) (x:int) : Choice = A x' - /// (Originally from ../FSComp.txt:1068) + /// (Originally from ..\FSComp.txt:1068) static member activePatternChoiceHasFreeTypars(a0 : System.String) = (1210, GetStringFunc("activePatternChoiceHasFreeTypars",",,,%s,,,") a0) /// The FieldOffset attribute can only be placed on members of types marked with the StructLayout(LayoutKind.Explicit) - /// (Originally from ../FSComp.txt:1069) + /// (Originally from ..\FSComp.txt:1069) static member ilFieldHasOffsetForSequentialLayout() = (1211, GetStringFunc("ilFieldHasOffsetForSequentialLayout",",,,") ) /// Optional arguments must come at the end of the argument list, after any non-optional arguments - /// (Originally from ../FSComp.txt:1070) + /// (Originally from ..\FSComp.txt:1070) static member tcOptionalArgsMustComeAfterNonOptionalArgs() = (1212, GetStringFunc("tcOptionalArgsMustComeAfterNonOptionalArgs",",,,") ) /// Attribute 'System.Diagnostics.ConditionalAttribute' is only valid on methods or attribute classes - /// (Originally from ../FSComp.txt:1071) + /// (Originally from ..\FSComp.txt:1071) static member tcConditionalAttributeUsage() = (1213, GetStringFunc("tcConditionalAttributeUsage",",,,") ) /// Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. - /// (Originally from ../FSComp.txt:1073) + /// (Originally from ..\FSComp.txt:1073) static member tcMemberOperatorDefinitionInExtrinsic() = (1215, GetStringFunc("tcMemberOperatorDefinitionInExtrinsic",",,,") ) /// The name of the MDB file must be .mdb. The --pdb option will be ignored. - /// (Originally from ../FSComp.txt:1074) + /// (Originally from ..\FSComp.txt:1074) static member ilwriteMDBFileNameCannotBeChangedWarning() = (1216, GetStringFunc("ilwriteMDBFileNameCannotBeChangedWarning",",,,") ) /// MDB generation failed. Could not find compatible member %s - /// (Originally from ../FSComp.txt:1075) + /// (Originally from ..\FSComp.txt:1075) static member ilwriteMDBMemberMissing(a0 : System.String) = (1217, GetStringFunc("ilwriteMDBMemberMissing",",,,%s,,,") a0) /// Cannot generate MDB debug information. Failed to load the 'MonoSymbolWriter' type from the 'Mono.CompilerServices.SymbolWriter.dll' assembly. - /// (Originally from ../FSComp.txt:1076) + /// (Originally from ..\FSComp.txt:1076) static member ilwriteErrorCreatingMdb() = (1218, GetStringFunc("ilwriteErrorCreatingMdb",",,,") ) /// The union case named '%s' conflicts with the generated type '%s' - /// (Originally from ../FSComp.txt:1077) + /// (Originally from ..\FSComp.txt:1077) static member tcUnionCaseNameConflictsWithGeneratedType(a0 : System.String, a1 : System.String) = (1219, GetStringFunc("tcUnionCaseNameConflictsWithGeneratedType",",,,%s,,,%s,,,") a0 a1) /// ReflectedDefinitionAttribute may not be applied to an instance member on a struct type, because the instance member takes an implicit 'this' byref parameter - /// (Originally from ../FSComp.txt:1078) + /// (Originally from ..\FSComp.txt:1078) static member chkNoReflectedDefinitionOnStructMember() = (1220, GetStringFunc("chkNoReflectedDefinitionOnStructMember",",,,") ) /// DLLImport bindings must be static members in a class or function definitions in a module - /// (Originally from ../FSComp.txt:1079) + /// (Originally from ..\FSComp.txt:1079) static member tcDllImportNotAllowed() = (1221, GetStringFunc("tcDllImportNotAllowed",",,,") ) /// When mscorlib.dll or FSharp.Core.dll is explicitly referenced the %s option must also be passed - /// (Originally from ../FSComp.txt:1080) + /// (Originally from ..\FSComp.txt:1080) static member buildExplicitCoreLibRequiresNoFramework(a0 : System.String) = (1222, GetStringFunc("buildExplicitCoreLibRequiresNoFramework",",,,%s,,,") a0) /// FSharp.Core.sigdata not found alongside FSharp.Core. File expected in %s. Consider upgrading to a more recent version of FSharp.Core, where this file is no longer be required. - /// (Originally from ../FSComp.txt:1081) + /// (Originally from ..\FSComp.txt:1081) static member buildExpectedSigdataFile(a0 : System.String) = (1223, GetStringFunc("buildExpectedSigdataFile",",,,%s,,,") a0) /// File '%s' not found alongside FSharp.Core. File expected in %s. Consider upgrading to a more recent version of FSharp.Core, where this file is no longer be required. - /// (Originally from ../FSComp.txt:1082) + /// (Originally from ..\FSComp.txt:1082) static member buildExpectedFileAlongSideFSharpCore(a0 : System.String, a1 : System.String) = (1225, GetStringFunc("buildExpectedFileAlongSideFSharpCore",",,,%s,,,%s,,,") a0 a1) /// Filename '%s' contains invalid character '%s' - /// (Originally from ../FSComp.txt:1083) + /// (Originally from ..\FSComp.txt:1083) static member buildUnexpectedFileNameCharacter(a0 : System.String, a1 : System.String) = (1227, GetStringFunc("buildUnexpectedFileNameCharacter",",,,%s,,,%s,,,") a0 a1) /// 'use!' bindings must be of the form 'use! = ' - /// (Originally from ../FSComp.txt:1084) + /// (Originally from ..\FSComp.txt:1084) static member tcInvalidUseBangBinding() = (1228, GetStringFunc("tcInvalidUseBangBinding",",,,") ) /// Inner generic functions are not permitted in quoted expressions. Consider adding some type constraints until this function is no longer generic. - /// (Originally from ../FSComp.txt:1085) + /// (Originally from ..\FSComp.txt:1085) static member crefNoInnerGenericsInQuotations() = (1230, GetStringFunc("crefNoInnerGenericsInQuotations",",,,") ) /// The type '%s' is not a valid enumerator type , i.e. does not have a 'MoveNext()' method returning a bool, and a 'Current' property - /// (Originally from ../FSComp.txt:1086) + /// (Originally from ..\FSComp.txt:1086) static member tcEnumTypeCannotBeEnumerated(a0 : System.String) = (1231, GetStringFunc("tcEnumTypeCannotBeEnumerated",",,,%s,,,") a0) /// End of file in triple-quote string begun at or before here - /// (Originally from ../FSComp.txt:1087) + /// (Originally from ..\FSComp.txt:1087) static member parsEofInTripleQuoteString() = (1232, GetStringFunc("parsEofInTripleQuoteString",",,,") ) /// End of file in triple-quote string embedded in comment begun at or before here - /// (Originally from ../FSComp.txt:1088) + /// (Originally from ..\FSComp.txt:1088) static member parsEofInTripleQuoteStringInComment() = (1233, GetStringFunc("parsEofInTripleQuoteStringInComment",",,,") ) /// This type test or downcast will ignore the unit-of-measure '%s' - /// (Originally from ../FSComp.txt:1089) + /// (Originally from ..\FSComp.txt:1089) static member tcTypeTestLosesMeasures(a0 : System.String) = (1240, GetStringFunc("tcTypeTestLosesMeasures",",,,%s,,,") a0) /// Expected type argument or static argument - /// (Originally from ../FSComp.txt:1090) + /// (Originally from ..\FSComp.txt:1090) static member parsMissingTypeArgs() = (1241, GetStringFunc("parsMissingTypeArgs",",,,") ) /// Unmatched '<'. Expected closing '>' - /// (Originally from ../FSComp.txt:1091) + /// (Originally from ..\FSComp.txt:1091) static member parsMissingGreaterThan() = (1242, GetStringFunc("parsMissingGreaterThan",",,,") ) /// Unexpected quotation operator '<@' in type definition. If you intend to pass a verbatim string as a static argument to a type provider, put a space between the '<' and '@' characters. - /// (Originally from ../FSComp.txt:1092) + /// (Originally from ..\FSComp.txt:1092) static member parsUnexpectedQuotationOperatorInTypeAliasDidYouMeanVerbatimString() = (1243, GetStringFunc("parsUnexpectedQuotationOperatorInTypeAliasDidYouMeanVerbatimString",",,,") ) /// Attempted to parse this as an operator name, but failed - /// (Originally from ../FSComp.txt:1093) + /// (Originally from ..\FSComp.txt:1093) static member parsErrorParsingAsOperatorName() = (1244, GetStringFunc("parsErrorParsingAsOperatorName",",,,") ) /// \U%s is not a valid Unicode character escape sequence - /// (Originally from ../FSComp.txt:1094) + /// (Originally from ..\FSComp.txt:1094) static member lexInvalidUnicodeLiteral(a0 : System.String) = (1245, GetStringFunc("lexInvalidUnicodeLiteral",",,,%s,,,") a0) /// '%s' must be applied to an argument of type '%s', but has been applied to an argument of type '%s' - /// (Originally from ../FSComp.txt:1095) + /// (Originally from ..\FSComp.txt:1095) static member tcCallerInfoWrongType(a0 : System.String, a1 : System.String, a2 : System.String) = (1246, GetStringFunc("tcCallerInfoWrongType",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// '%s' can only be applied to optional arguments - /// (Originally from ../FSComp.txt:1096) + /// (Originally from ..\FSComp.txt:1096) static member tcCallerInfoNotOptional(a0 : System.String) = (1247, GetStringFunc("tcCallerInfoNotOptional",",,,%s,,,") a0) /// The specified .NET Framework version '%s' is not supported. Please specify a value from the enumeration Microsoft.Build.Utilities.TargetDotNetFrameworkVersion. - /// (Originally from ../FSComp.txt:1098) + /// (Originally from ..\FSComp.txt:1098) static member toolLocationHelperUnsupportedFrameworkVersion(a0 : System.String) = (1300, GetStringFunc("toolLocationHelperUnsupportedFrameworkVersion",",,,%s,,,") a0) /// Invalid Magic value in CLR Header - /// (Originally from ../FSComp.txt:1102) + /// (Originally from ..\FSComp.txt:1102) static member ilSignInvalidMagicValue() = (1301, GetStringFunc("ilSignInvalidMagicValue",",,,") ) /// Bad image format - /// (Originally from ../FSComp.txt:1103) + /// (Originally from ..\FSComp.txt:1103) static member ilSignBadImageFormat() = (1302, GetStringFunc("ilSignBadImageFormat",",,,") ) /// Private key expected - /// (Originally from ../FSComp.txt:1104) + /// (Originally from ..\FSComp.txt:1104) static member ilSignPrivateKeyExpected() = (1303, GetStringFunc("ilSignPrivateKeyExpected",",,,") ) /// RSA key expected - /// (Originally from ../FSComp.txt:1105) + /// (Originally from ..\FSComp.txt:1105) static member ilSignRsaKeyExpected() = (1304, GetStringFunc("ilSignRsaKeyExpected",",,,") ) /// Invalid bit Length - /// (Originally from ../FSComp.txt:1106) + /// (Originally from ..\FSComp.txt:1106) static member ilSignInvalidBitLen() = (1305, GetStringFunc("ilSignInvalidBitLen",",,,") ) /// Invalid RSAParameters structure - '{0}' expected - /// (Originally from ../FSComp.txt:1107) + /// (Originally from ..\FSComp.txt:1107) static member ilSignInvalidRSAParams() = (1306, GetStringFunc("ilSignInvalidRSAParams",",,,") ) /// Invalid algId - 'Exponent' expected - /// (Originally from ../FSComp.txt:1108) + /// (Originally from ..\FSComp.txt:1108) static member ilSignInvalidAlgId() = (1307, GetStringFunc("ilSignInvalidAlgId",",,,") ) /// Invalid signature size - /// (Originally from ../FSComp.txt:1109) + /// (Originally from ..\FSComp.txt:1109) static member ilSignInvalidSignatureSize() = (1308, GetStringFunc("ilSignInvalidSignatureSize",",,,") ) /// No signature directory - /// (Originally from ../FSComp.txt:1110) + /// (Originally from ..\FSComp.txt:1110) static member ilSignNoSignatureDirectory() = (1309, GetStringFunc("ilSignNoSignatureDirectory",",,,") ) /// Invalid Public Key blob - /// (Originally from ../FSComp.txt:1111) + /// (Originally from ..\FSComp.txt:1111) static member ilSignInvalidPKBlob() = (1310, GetStringFunc("ilSignInvalidPKBlob",",,,") ) /// Exiting - too many errors - /// (Originally from ../FSComp.txt:1113) + /// (Originally from ..\FSComp.txt:1113) static member fscTooManyErrors() = (GetStringFunc("fscTooManyErrors",",,,") ) /// The documentation file has no .xml suffix - /// (Originally from ../FSComp.txt:1114) + /// (Originally from ..\FSComp.txt:1114) static member docfileNoXmlSuffix() = (2001, GetStringFunc("docfileNoXmlSuffix",",,,") ) /// No implementation files specified - /// (Originally from ../FSComp.txt:1115) + /// (Originally from ..\FSComp.txt:1115) static member fscNoImplementationFiles() = (2002, GetStringFunc("fscNoImplementationFiles",",,,") ) - /// An %s specified version '%s', but this value is invalid and has been ignored - /// (Originally from ../FSComp.txt:1116) + /// The attribute %s specified version '%s', but this value is invalid and has been ignored + /// (Originally from ..\FSComp.txt:1116) static member fscBadAssemblyVersion(a0 : System.String, a1 : System.String) = (2003, GetStringFunc("fscBadAssemblyVersion",",,,%s,,,%s,,,") a0 a1) /// Conflicting options specified: 'win32manifest' and 'win32res'. Only one of these can be used. - /// (Originally from ../FSComp.txt:1117) + /// (Originally from ..\FSComp.txt:1117) static member fscTwoResourceManifests() = (2004, GetStringFunc("fscTwoResourceManifests",",,,") ) /// The code in assembly '%s' makes uses of quotation literals. Static linking may not include components that make use of quotation literals unless all assemblies are compiled with at least F# 4.0. - /// (Originally from ../FSComp.txt:1118) + /// (Originally from ..\FSComp.txt:1118) static member fscQuotationLiteralsStaticLinking(a0 : System.String) = (2005, GetStringFunc("fscQuotationLiteralsStaticLinking",",,,%s,,,") a0) /// Code in this assembly makes uses of quotation literals. Static linking may not include components that make use of quotation literals unless all assemblies are compiled with at least F# 4.0. - /// (Originally from ../FSComp.txt:1119) + /// (Originally from ..\FSComp.txt:1119) static member fscQuotationLiteralsStaticLinking0() = (2006, GetStringFunc("fscQuotationLiteralsStaticLinking0",",,,") ) /// Static linking may not include a .EXE - /// (Originally from ../FSComp.txt:1120) + /// (Originally from ..\FSComp.txt:1120) static member fscStaticLinkingNoEXE() = (2007, GetStringFunc("fscStaticLinkingNoEXE",",,,") ) /// Static linking may not include a mixed managed/unmanaged DLL - /// (Originally from ../FSComp.txt:1121) + /// (Originally from ..\FSComp.txt:1121) static member fscStaticLinkingNoMixedDLL() = (2008, GetStringFunc("fscStaticLinkingNoMixedDLL",",,,") ) /// Ignoring mixed managed/unmanaged assembly '%s' during static linking - /// (Originally from ../FSComp.txt:1122) + /// (Originally from ..\FSComp.txt:1122) static member fscIgnoringMixedWhenLinking(a0 : System.String) = (2009, GetStringFunc("fscIgnoringMixedWhenLinking",",,,%s,,,") a0) /// Assembly '%s' was referenced transitively and the assembly could not be resolved automatically. Static linking will assume this DLL has no dependencies on the F# library or other statically linked DLLs. Consider adding an explicit reference to this DLL. - /// (Originally from ../FSComp.txt:1123) + /// (Originally from ..\FSComp.txt:1123) static member fscAssumeStaticLinkContainsNoDependencies(a0 : System.String) = (2011, GetStringFunc("fscAssumeStaticLinkContainsNoDependencies",",,,%s,,,") a0) /// Assembly '%s' not found in dependency set of target binary. Statically linked roots should be specified using an assembly name, without a DLL or EXE extension. If this assembly was referenced explicitly then it is possible the assembly was not actually required by the generated binary, in which case it should not be statically linked. - /// (Originally from ../FSComp.txt:1124) + /// (Originally from ..\FSComp.txt:1124) static member fscAssemblyNotFoundInDependencySet(a0 : System.String) = (2012, GetStringFunc("fscAssemblyNotFoundInDependencySet",",,,%s,,,") a0) /// The key file '%s' could not be opened - /// (Originally from ../FSComp.txt:1125) + /// (Originally from ..\FSComp.txt:1125) static member fscKeyFileCouldNotBeOpened(a0 : System.String) = (2013, GetStringFunc("fscKeyFileCouldNotBeOpened",",,,%s,,,") a0) /// A problem occurred writing the binary '%s': %s - /// (Originally from ../FSComp.txt:1126) + /// (Originally from ..\FSComp.txt:1126) static member fscProblemWritingBinary(a0 : System.String, a1 : System.String) = (2014, GetStringFunc("fscProblemWritingBinary",",,,%s,,,%s,,,") a0 a1) /// The 'AssemblyVersionAttribute' has been ignored because a version was given using a command line option - /// (Originally from ../FSComp.txt:1127) + /// (Originally from ..\FSComp.txt:1127) static member fscAssemblyVersionAttributeIgnored() = (2015, GetStringFunc("fscAssemblyVersionAttributeIgnored",",,,") ) /// Error emitting 'System.Reflection.AssemblyCultureAttribute' attribute -- 'Executables cannot be satellite assemblies, Culture should always be empty' - /// (Originally from ../FSComp.txt:1128) + /// (Originally from ..\FSComp.txt:1128) static member fscAssemblyCultureAttributeError() = (2016, GetStringFunc("fscAssemblyCultureAttributeError",",,,") ) /// Option '--delaysign' overrides attribute 'System.Reflection.AssemblyDelaySignAttribute' given in a source file or added module - /// (Originally from ../FSComp.txt:1129) + /// (Originally from ..\FSComp.txt:1129) static member fscDelaySignWarning() = (2017, GetStringFunc("fscDelaySignWarning",",,,") ) /// Option '--keyfile' overrides attribute 'System.Reflection.AssemblyKeyFileAttribute' given in a source file or added module - /// (Originally from ../FSComp.txt:1130) + /// (Originally from ..\FSComp.txt:1130) static member fscKeyFileWarning() = (2018, GetStringFunc("fscKeyFileWarning",",,,") ) /// Option '--keycontainer' overrides attribute 'System.Reflection.AssemblyNameAttribute' given in a source file or added module - /// (Originally from ../FSComp.txt:1131) + /// (Originally from ..\FSComp.txt:1131) static member fscKeyNameWarning() = (2019, GetStringFunc("fscKeyNameWarning",",,,") ) /// The assembly '%s' is listed on the command line. Assemblies should be referenced using a command line flag such as '-r'. - /// (Originally from ../FSComp.txt:1132) + /// (Originally from ..\FSComp.txt:1132) static member fscReferenceOnCommandLine(a0 : System.String) = (2020, GetStringFunc("fscReferenceOnCommandLine",",,,%s,,,") a0) /// The resident compilation service was not used because a problem occured in communicating with the server. - /// (Originally from ../FSComp.txt:1133) + /// (Originally from ..\FSComp.txt:1133) static member fscRemotingError() = (2021, GetStringFunc("fscRemotingError",",,,") ) /// Problem with filename '%s': Illegal characters in path. - /// (Originally from ../FSComp.txt:1134) + /// (Originally from ..\FSComp.txt:1134) static member pathIsInvalid(a0 : System.String) = (2022, GetStringFunc("pathIsInvalid",",,,%s,,,") a0) /// Passing a .resx file (%s) as a source file to the compiler is deprecated. Use resgen.exe to transform the .resx file into a .resources file to pass as a --resource option. If you are using MSBuild, this can be done via an item in the .fsproj project file. - /// (Originally from ../FSComp.txt:1135) + /// (Originally from ..\FSComp.txt:1135) static member fscResxSourceFileDeprecated(a0 : System.String) = (2023, GetStringFunc("fscResxSourceFileDeprecated",",,,%s,,,") a0) /// Static linking may not be used on an assembly referencing mscorlib (e.g. a .NET Framework assembly) when generating an assembly that references System.Runtime (e.g. a .NET Core or Portable assembly). - /// (Originally from ../FSComp.txt:1136) + /// (Originally from ..\FSComp.txt:1136) static member fscStaticLinkingNoProfileMismatches() = (2024, GetStringFunc("fscStaticLinkingNoProfileMismatches",",,,") ) /// An %s specified version '%s', but this value is a wildcard, and you have requested a deterministic build, these are in conflict. - /// (Originally from ../FSComp.txt:1137) + /// (Originally from ..\FSComp.txt:1137) static member fscAssemblyWildcardAndDeterminism(a0 : System.String, a1 : System.String) = (2025, GetStringFunc("fscAssemblyWildcardAndDeterminism",",,,%s,,,%s,,,") a0 a1) /// Determinstic builds only support portable PDBs (--debug:portable or --debug:embedded) - /// (Originally from ../FSComp.txt:1138) + /// (Originally from ..\FSComp.txt:1138) static member fscDeterministicDebugRequiresPortablePdb() = (2026, GetStringFunc("fscDeterministicDebugRequiresPortablePdb",",,,") ) /// Character '%s' is not allowed in provided namespace name '%s' - /// (Originally from ../FSComp.txt:1139) + /// (Originally from ..\FSComp.txt:1139) static member etIllegalCharactersInNamespaceName(a0 : System.String, a1 : System.String) = (3000, GetStringFunc("etIllegalCharactersInNamespaceName",",,,%s,,,%s,,,") a0 a1) /// The provided type '%s' returned a member with a null or empty member name - /// (Originally from ../FSComp.txt:1140) + /// (Originally from ..\FSComp.txt:1140) static member etNullOrEmptyMemberName(a0 : System.String) = (3001, GetStringFunc("etNullOrEmptyMemberName",",,,%s,,,") a0) /// The provided type '%s' returned a null member - /// (Originally from ../FSComp.txt:1141) + /// (Originally from ..\FSComp.txt:1141) static member etNullMember(a0 : System.String) = (3002, GetStringFunc("etNullMember",",,,%s,,,") a0) /// The provided type '%s' member info '%s' has null declaring type - /// (Originally from ../FSComp.txt:1142) + /// (Originally from ..\FSComp.txt:1142) static member etNullMemberDeclaringType(a0 : System.String, a1 : System.String) = (3003, GetStringFunc("etNullMemberDeclaringType",",,,%s,,,%s,,,") a0 a1) /// The provided type '%s' has member '%s' which has declaring type '%s'. Expected declaring type to be the same as provided type. - /// (Originally from ../FSComp.txt:1143) + /// (Originally from ..\FSComp.txt:1143) static member etNullMemberDeclaringTypeDifferentFromProvidedType(a0 : System.String, a1 : System.String, a2 : System.String) = (3004, GetStringFunc("etNullMemberDeclaringTypeDifferentFromProvidedType",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// Referenced assembly '%s' has assembly level attribute '%s' but no public type provider classes were found - /// (Originally from ../FSComp.txt:1144) + /// (Originally from ..\FSComp.txt:1144) static member etHostingAssemblyFoundWithoutHosts(a0 : System.String, a1 : System.String) = (3005, GetStringFunc("etHostingAssemblyFoundWithoutHosts",",,,%s,,,%s,,,") a0 a1) /// Type '%s' from type provider '%s' has an empty namespace. Use 'null' for the global namespace. - /// (Originally from ../FSComp.txt:1145) + /// (Originally from ..\FSComp.txt:1145) static member etEmptyNamespaceOfTypeNotAllowed(a0 : System.String, a1 : System.String) = (3006, GetStringFunc("etEmptyNamespaceOfTypeNotAllowed",",,,%s,,,%s,,,") a0 a1) /// Empty namespace found from the type provider '%s'. Use 'null' for the global namespace. - /// (Originally from ../FSComp.txt:1146) + /// (Originally from ..\FSComp.txt:1146) static member etEmptyNamespaceNotAllowed(a0 : System.String) = (3007, GetStringFunc("etEmptyNamespaceNotAllowed",",,,%s,,,") a0) /// Provided type '%s' has 'IsGenericType' as true, but generic types are not supported. - /// (Originally from ../FSComp.txt:1147) + /// (Originally from ..\FSComp.txt:1147) static member etMustNotBeGeneric(a0 : System.String) = (3011, GetStringFunc("etMustNotBeGeneric",",,,%s,,,") a0) /// Provided type '%s' has 'IsArray' as true, but array types are not supported. - /// (Originally from ../FSComp.txt:1148) + /// (Originally from ..\FSComp.txt:1148) static member etMustNotBeAnArray(a0 : System.String) = (3013, GetStringFunc("etMustNotBeAnArray",",,,%s,,,") a0) /// Invalid member '%s' on provided type '%s'. Provided type members must be public, and not be generic, virtual, or abstract. - /// (Originally from ../FSComp.txt:1149) + /// (Originally from ..\FSComp.txt:1149) static member etMethodHasRequirements(a0 : System.String, a1 : System.String) = (3014, GetStringFunc("etMethodHasRequirements",",,,%s,,,%s,,,") a0 a1) /// Invalid member '%s' on provided type '%s'. Only properties, methods and constructors are allowed - /// (Originally from ../FSComp.txt:1150) + /// (Originally from ..\FSComp.txt:1150) static member etUnsupportedMemberKind(a0 : System.String, a1 : System.String) = (3015, GetStringFunc("etUnsupportedMemberKind",",,,%s,,,%s,,,") a0 a1) /// Property '%s' on provided type '%s' has CanRead=true but there was no value from GetGetMethod() - /// (Originally from ../FSComp.txt:1151) + /// (Originally from ..\FSComp.txt:1151) static member etPropertyCanReadButHasNoGetter(a0 : System.String, a1 : System.String) = (3016, GetStringFunc("etPropertyCanReadButHasNoGetter",",,,%s,,,%s,,,") a0 a1) /// Property '%s' on provided type '%s' has CanRead=false but GetGetMethod() returned a method - /// (Originally from ../FSComp.txt:1152) + /// (Originally from ..\FSComp.txt:1152) static member etPropertyHasGetterButNoCanRead(a0 : System.String, a1 : System.String) = (3017, GetStringFunc("etPropertyHasGetterButNoCanRead",",,,%s,,,%s,,,") a0 a1) /// Property '%s' on provided type '%s' has CanWrite=true but there was no value from GetSetMethod() - /// (Originally from ../FSComp.txt:1153) + /// (Originally from ..\FSComp.txt:1153) static member etPropertyCanWriteButHasNoSetter(a0 : System.String, a1 : System.String) = (3018, GetStringFunc("etPropertyCanWriteButHasNoSetter",",,,%s,,,%s,,,") a0 a1) /// Property '%s' on provided type '%s' has CanWrite=false but GetSetMethod() returned a method - /// (Originally from ../FSComp.txt:1154) + /// (Originally from ..\FSComp.txt:1154) static member etPropertyHasSetterButNoCanWrite(a0 : System.String, a1 : System.String) = (3019, GetStringFunc("etPropertyHasSetterButNoCanWrite",",,,%s,,,%s,,,") a0 a1) /// One or more errors seen during provided type setup - /// (Originally from ../FSComp.txt:1155) + /// (Originally from ..\FSComp.txt:1155) static member etOneOrMoreErrorsSeenDuringExtensionTypeSetting() = (3020, GetStringFunc("etOneOrMoreErrorsSeenDuringExtensionTypeSetting",",,,") ) /// Unexpected exception from provided type '%s' member '%s': %s - /// (Originally from ../FSComp.txt:1156) + /// (Originally from ..\FSComp.txt:1156) static member etUnexpectedExceptionFromProvidedTypeMember(a0 : System.String, a1 : System.String, a2 : System.String) = (3021, GetStringFunc("etUnexpectedExceptionFromProvidedTypeMember",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// Unsupported constant type '%s'. Quotations provided by type providers can only contain simple constants. The implementation of the type provider may need to be adjusted by moving a value declared outside a provided quotation literal to be a 'let' binding inside the quotation literal. - /// (Originally from ../FSComp.txt:1157) + /// (Originally from ..\FSComp.txt:1157) static member etUnsupportedConstantType(a0 : System.String) = (3022, GetStringFunc("etUnsupportedConstantType",",,,%s,,,") a0) /// Unsupported expression '%s' from type provider. If you are the author of this type provider, consider adjusting it to provide a different provided expression. - /// (Originally from ../FSComp.txt:1158) + /// (Originally from ..\FSComp.txt:1158) static member etUnsupportedProvidedExpression(a0 : System.String) = (3025, GetStringFunc("etUnsupportedProvidedExpression",",,,%s,,,") a0) /// Expected provided type named '%s' but provided type has 'Name' with value '%s' - /// (Originally from ../FSComp.txt:1159) + /// (Originally from ..\FSComp.txt:1159) static member etProvidedTypeHasUnexpectedName(a0 : System.String, a1 : System.String) = (3028, GetStringFunc("etProvidedTypeHasUnexpectedName",",,,%s,,,%s,,,") a0 a1) /// Event '%s' on provided type '%s' has no value from GetAddMethod() - /// (Originally from ../FSComp.txt:1160) + /// (Originally from ..\FSComp.txt:1160) static member etEventNoAdd(a0 : System.String, a1 : System.String) = (3029, GetStringFunc("etEventNoAdd",",,,%s,,,%s,,,") a0 a1) /// Event '%s' on provided type '%s' has no value from GetRemoveMethod() - /// (Originally from ../FSComp.txt:1161) + /// (Originally from ..\FSComp.txt:1161) static member etEventNoRemove(a0 : System.String, a1 : System.String) = (3030, GetStringFunc("etEventNoRemove",",,,%s,,,%s,,,") a0 a1) /// Assembly attribute '%s' refers to a designer assembly '%s' which cannot be loaded or doesn't exist. %s - /// (Originally from ../FSComp.txt:1162) + /// (Originally from ..\FSComp.txt:1162) static member etProviderHasWrongDesignerAssembly(a0 : System.String, a1 : System.String, a2 : System.String) = (3031, GetStringFunc("etProviderHasWrongDesignerAssembly",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// The type provider does not have a valid constructor. A constructor taking either no arguments or one argument of type 'TypeProviderConfig' was expected. - /// (Originally from ../FSComp.txt:1163) + /// (Originally from ..\FSComp.txt:1163) static member etProviderDoesNotHaveValidConstructor() = (3032, GetStringFunc("etProviderDoesNotHaveValidConstructor",",,,") ) /// The type provider '%s' reported an error: %s - /// (Originally from ../FSComp.txt:1164) + /// (Originally from ..\FSComp.txt:1164) static member etProviderError(a0 : System.String, a1 : System.String) = (3033, GetStringFunc("etProviderError",",,,%s,,,%s,,,") a0 a1) /// The type provider '%s' used an invalid parameter in the ParameterExpression: %s - /// (Originally from ../FSComp.txt:1165) + /// (Originally from ..\FSComp.txt:1165) static member etIncorrectParameterExpression(a0 : System.String, a1 : System.String) = (3034, GetStringFunc("etIncorrectParameterExpression",",,,%s,,,%s,,,") a0 a1) /// The type provider '%s' provided a method with a name '%s' and metadata token '%d', which is not reported among its methods of its declaring type '%s' - /// (Originally from ../FSComp.txt:1166) + /// (Originally from ..\FSComp.txt:1166) static member etIncorrectProvidedMethod(a0 : System.String, a1 : System.String, a2 : System.Int32, a3 : System.String) = (3035, GetStringFunc("etIncorrectProvidedMethod",",,,%s,,,%s,,,%d,,,%s,,,") a0 a1 a2 a3) /// The type provider '%s' provided a constructor which is not reported among the constructors of its declaring type '%s' - /// (Originally from ../FSComp.txt:1167) + /// (Originally from ..\FSComp.txt:1167) static member etIncorrectProvidedConstructor(a0 : System.String, a1 : System.String) = (3036, GetStringFunc("etIncorrectProvidedConstructor",",,,%s,,,%s,,,") a0 a1) /// A direct reference to the generated type '%s' is not permitted. Instead, use a type definition, e.g. 'type TypeAlias = '. This indicates that a type provider adds generated types to your assembly. - /// (Originally from ../FSComp.txt:1168) + /// (Originally from ..\FSComp.txt:1168) static member etDirectReferenceToGeneratedTypeNotAllowed(a0 : System.String) = (3039, GetStringFunc("etDirectReferenceToGeneratedTypeNotAllowed",",,,%s,,,") a0) /// Expected provided type with path '%s' but provided type has path '%s' - /// (Originally from ../FSComp.txt:1169) + /// (Originally from ..\FSComp.txt:1169) static member etProvidedTypeHasUnexpectedPath(a0 : System.String, a1 : System.String) = (3041, GetStringFunc("etProvidedTypeHasUnexpectedPath",",,,%s,,,%s,,,") a0 a1) /// Unexpected 'null' return value from provided type '%s' member '%s' - /// (Originally from ../FSComp.txt:1170) + /// (Originally from ..\FSComp.txt:1170) static member etUnexpectedNullFromProvidedTypeMember(a0 : System.String, a1 : System.String) = (3042, GetStringFunc("etUnexpectedNullFromProvidedTypeMember",",,,%s,,,%s,,,") a0 a1) /// Unexpected exception from member '%s' of provided type '%s' member '%s': %s - /// (Originally from ../FSComp.txt:1171) + /// (Originally from ..\FSComp.txt:1171) static member etUnexpectedExceptionFromProvidedMemberMember(a0 : System.String, a1 : System.String, a2 : System.String, a3 : System.String) = (3043, GetStringFunc("etUnexpectedExceptionFromProvidedMemberMember",",,,%s,,,%s,,,%s,,,%s,,,") a0 a1 a2 a3) /// Nested provided types do not take static arguments or generic parameters - /// (Originally from ../FSComp.txt:1172) + /// (Originally from ..\FSComp.txt:1172) static member etNestedProvidedTypesDoNotTakeStaticArgumentsOrGenericParameters() = (3044, GetStringFunc("etNestedProvidedTypesDoNotTakeStaticArgumentsOrGenericParameters",",,,") ) /// Invalid static argument to provided type. Expected an argument of kind '%s'. - /// (Originally from ../FSComp.txt:1173) + /// (Originally from ..\FSComp.txt:1173) static member etInvalidStaticArgument(a0 : System.String) = (3045, GetStringFunc("etInvalidStaticArgument",",,,%s,,,") a0) /// An error occured applying the static arguments to a provided type - /// (Originally from ../FSComp.txt:1174) + /// (Originally from ..\FSComp.txt:1174) static member etErrorApplyingStaticArgumentsToType() = (3046, GetStringFunc("etErrorApplyingStaticArgumentsToType",",,,") ) /// Unknown static argument kind '%s' when resolving a reference to a provided type or method '%s' - /// (Originally from ../FSComp.txt:1175) + /// (Originally from ..\FSComp.txt:1175) static member etUnknownStaticArgumentKind(a0 : System.String, a1 : System.String) = (3047, GetStringFunc("etUnknownStaticArgumentKind",",,,%s,,,%s,,,") a0 a1) /// invalid namespace for provided type - /// (Originally from ../FSComp.txt:1176) + /// (Originally from ..\FSComp.txt:1176) static member invalidNamespaceForProvidedType() = (GetStringFunc("invalidNamespaceForProvidedType",",,,") ) /// invalid full name for provided type - /// (Originally from ../FSComp.txt:1177) + /// (Originally from ..\FSComp.txt:1177) static member invalidFullNameForProvidedType() = (GetStringFunc("invalidFullNameForProvidedType",",,,") ) /// The type provider returned 'null', which is not a valid return value from '%s' - /// (Originally from ../FSComp.txt:1179) + /// (Originally from ..\FSComp.txt:1179) static member etProviderReturnedNull(a0 : System.String) = (3051, GetStringFunc("etProviderReturnedNull",",,,%s,,,") a0) /// The type provider constructor has thrown an exception: %s - /// (Originally from ../FSComp.txt:1180) + /// (Originally from ..\FSComp.txt:1180) static member etTypeProviderConstructorException(a0 : System.String) = (3053, GetStringFunc("etTypeProviderConstructorException",",,,%s,,,") a0) /// Type provider '%s' returned null from GetInvokerExpression. - /// (Originally from ../FSComp.txt:1181) + /// (Originally from ..\FSComp.txt:1181) static member etNullProvidedExpression(a0 : System.String) = (3056, GetStringFunc("etNullProvidedExpression",",,,%s,,,") a0) /// The type provider '%s' returned an invalid type from 'ApplyStaticArguments'. A type with name '%s' was expected, but a type with name '%s' was returned. - /// (Originally from ../FSComp.txt:1182) + /// (Originally from ..\FSComp.txt:1182) static member etProvidedAppliedTypeHadWrongName(a0 : System.String, a1 : System.String, a2 : System.String) = (3057, GetStringFunc("etProvidedAppliedTypeHadWrongName",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// The type provider '%s' returned an invalid method from 'ApplyStaticArgumentsForMethod'. A method with name '%s' was expected, but a method with name '%s' was returned. - /// (Originally from ../FSComp.txt:1183) + /// (Originally from ..\FSComp.txt:1183) static member etProvidedAppliedMethodHadWrongName(a0 : System.String, a1 : System.String, a2 : System.String) = (3058, GetStringFunc("etProvidedAppliedMethodHadWrongName",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// This type test or downcast will erase the provided type '%s' to the type '%s' - /// (Originally from ../FSComp.txt:1184) + /// (Originally from ..\FSComp.txt:1184) static member tcTypeTestLossy(a0 : System.String, a1 : System.String) = (3060, GetStringFunc("tcTypeTestLossy",",,,%s,,,%s,,,") a0 a1) /// This downcast will erase the provided type '%s' to the type '%s'. - /// (Originally from ../FSComp.txt:1185) + /// (Originally from ..\FSComp.txt:1185) static member tcTypeCastErased(a0 : System.String, a1 : System.String) = (3061, GetStringFunc("tcTypeCastErased",",,,%s,,,%s,,,") a0 a1) /// This type test with a provided type '%s' is not allowed because this provided type will be erased to '%s' at runtime. - /// (Originally from ../FSComp.txt:1186) + /// (Originally from ..\FSComp.txt:1186) static member tcTypeTestErased(a0 : System.String, a1 : System.String) = (3062, GetStringFunc("tcTypeTestErased",",,,%s,,,%s,,,") a0 a1) /// Cannot inherit from erased provided type - /// (Originally from ../FSComp.txt:1187) + /// (Originally from ..\FSComp.txt:1187) static member tcCannotInheritFromErasedType() = (3063, GetStringFunc("tcCannotInheritFromErasedType",",,,") ) /// Assembly '%s' hase TypeProviderAssembly attribute with invalid value '%s'. The value should be a valid assembly name - /// (Originally from ../FSComp.txt:1188) + /// (Originally from ..\FSComp.txt:1188) static member etInvalidTypeProviderAssemblyName(a0 : System.String, a1 : System.String) = (3065, GetStringFunc("etInvalidTypeProviderAssemblyName",",,,%s,,,%s,,,") a0 a1) /// Invalid member name. Members may not have name '.ctor' or '.cctor' - /// (Originally from ../FSComp.txt:1189) + /// (Originally from ..\FSComp.txt:1189) static member tcInvalidMemberNameCtor() = (3066, GetStringFunc("tcInvalidMemberNameCtor",",,,") ) /// The function or member '%s' is used in a way that requires further type annotations at its definition to ensure consistency of inferred types. The inferred signature is '%s'. - /// (Originally from ../FSComp.txt:1190) + /// (Originally from ..\FSComp.txt:1190) static member tcInferredGenericTypeGivesRiseToInconsistency(a0 : System.String, a1 : System.String) = (3068, GetStringFunc("tcInferredGenericTypeGivesRiseToInconsistency",",,,%s,,,%s,,,") a0 a1) /// The number of type arguments did not match: '%d' given, '%d' expected. This may be related to a previously reported error. - /// (Originally from ../FSComp.txt:1191) + /// (Originally from ..\FSComp.txt:1191) static member tcInvalidTypeArgumentCount(a0 : System.Int32, a1 : System.Int32) = (3069, GetStringFunc("tcInvalidTypeArgumentCount",",,,%d,,,%d,,,") a0 a1) /// Cannot override inherited member '%s' because it is sealed - /// (Originally from ../FSComp.txt:1192) + /// (Originally from ..\FSComp.txt:1192) static member tcCannotOverrideSealedMethod(a0 : System.String) = (3070, GetStringFunc("tcCannotOverrideSealedMethod",",,,%s,,,") a0) /// The type provider '%s' reported an error in the context of provided type '%s', member '%s'. The error: %s - /// (Originally from ../FSComp.txt:1193) + /// (Originally from ..\FSComp.txt:1193) static member etProviderErrorWithContext(a0 : System.String, a1 : System.String, a2 : System.String, a3 : System.String) = (3071, GetStringFunc("etProviderErrorWithContext",",,,%s,,,%s,,,%s,,,%s,,,") a0 a1 a2 a3) /// An exception occurred when accessing the '%s' of a provided type: %s - /// (Originally from ../FSComp.txt:1194) + /// (Originally from ..\FSComp.txt:1194) static member etProvidedTypeWithNameException(a0 : System.String, a1 : System.String) = (3072, GetStringFunc("etProvidedTypeWithNameException",",,,%s,,,%s,,,") a0 a1) /// The '%s' of a provided type was null or empty. - /// (Originally from ../FSComp.txt:1195) + /// (Originally from ..\FSComp.txt:1195) static member etProvidedTypeWithNullOrEmptyName(a0 : System.String) = (3073, GetStringFunc("etProvidedTypeWithNullOrEmptyName",",,,%s,,,") a0) /// Character '%s' is not allowed in provided type name '%s' - /// (Originally from ../FSComp.txt:1196) + /// (Originally from ..\FSComp.txt:1196) static member etIllegalCharactersInTypeName(a0 : System.String, a1 : System.String) = (3075, GetStringFunc("etIllegalCharactersInTypeName",",,,%s,,,%s,,,") a0 a1) /// In queries, '%s' must use a simple pattern - /// (Originally from ../FSComp.txt:1197) + /// (Originally from ..\FSComp.txt:1197) static member tcJoinMustUseSimplePattern(a0 : System.String) = (3077, GetStringFunc("tcJoinMustUseSimplePattern",",,,%s,,,") a0) /// A custom query operation for '%s' is required but not specified - /// (Originally from ../FSComp.txt:1198) + /// (Originally from ..\FSComp.txt:1198) static member tcMissingCustomOperation(a0 : System.String) = (3078, GetStringFunc("tcMissingCustomOperation",",,,%s,,,") a0) /// Named static arguments must come after all unnamed static arguments - /// (Originally from ../FSComp.txt:1199) + /// (Originally from ..\FSComp.txt:1199) static member etBadUnnamedStaticArgs() = (3080, GetStringFunc("etBadUnnamedStaticArgs",",,,") ) /// The static parameter '%s' of the provided type or method '%s' requires a value. Static parameters to type providers may be optionally specified using named arguments, e.g. '%s<%s=...>'. - /// (Originally from ../FSComp.txt:1200) + /// (Originally from ..\FSComp.txt:1200) static member etStaticParameterRequiresAValue(a0 : System.String, a1 : System.String, a2 : System.String, a3 : System.String) = (3081, GetStringFunc("etStaticParameterRequiresAValue",",,,%s,,,%s,,,%s,,,%s,,,") a0 a1 a2 a3) /// No static parameter exists with name '%s' - /// (Originally from ../FSComp.txt:1201) + /// (Originally from ..\FSComp.txt:1201) static member etNoStaticParameterWithName(a0 : System.String) = (3082, GetStringFunc("etNoStaticParameterWithName",",,,%s,,,") a0) /// The static parameter '%s' has already been given a value - /// (Originally from ../FSComp.txt:1202) + /// (Originally from ..\FSComp.txt:1202) static member etStaticParameterAlreadyHasValue(a0 : System.String) = (3083, GetStringFunc("etStaticParameterAlreadyHasValue",",,,%s,,,") a0) /// Multiple static parameters exist with name '%s' - /// (Originally from ../FSComp.txt:1203) + /// (Originally from ..\FSComp.txt:1203) static member etMultipleStaticParameterWithName(a0 : System.String) = (3084, GetStringFunc("etMultipleStaticParameterWithName",",,,%s,,,") a0) /// A custom operation may not be used in conjunction with a non-value or recursive 'let' binding in another part of this computation expression - /// (Originally from ../FSComp.txt:1204) + /// (Originally from ..\FSComp.txt:1204) static member tcCustomOperationMayNotBeUsedInConjunctionWithNonSimpleLetBindings() = (3085, GetStringFunc("tcCustomOperationMayNotBeUsedInConjunctionWithNonSimpleLetBindings",",,,") ) /// A custom operation may not be used in conjunction with 'use', 'try/with', 'try/finally', 'if/then/else' or 'match' operators within this computation expression - /// (Originally from ../FSComp.txt:1205) + /// (Originally from ..\FSComp.txt:1205) static member tcCustomOperationMayNotBeUsedHere() = (3086, GetStringFunc("tcCustomOperationMayNotBeUsedHere",",,,") ) /// The custom operation '%s' refers to a method which is overloaded. The implementations of custom operations may not be overloaded. - /// (Originally from ../FSComp.txt:1206) + /// (Originally from ..\FSComp.txt:1206) static member tcCustomOperationMayNotBeOverloaded(a0 : System.String) = (3087, GetStringFunc("tcCustomOperationMayNotBeOverloaded",",,,%s,,,") a0) /// An if/then/else expression may not be used within queries. Consider using either an if/then expression, or use a sequence expression instead. - /// (Originally from ../FSComp.txt:1207) + /// (Originally from ..\FSComp.txt:1207) static member tcIfThenElseMayNotBeUsedWithinQueries() = (3090, GetStringFunc("tcIfThenElseMayNotBeUsedWithinQueries",",,,") ) /// Invalid argument to 'methodhandleof' during codegen - /// (Originally from ../FSComp.txt:1208) + /// (Originally from ..\FSComp.txt:1208) static member ilxgenUnexpectedArgumentToMethodHandleOfDuringCodegen() = (3091, GetStringFunc("ilxgenUnexpectedArgumentToMethodHandleOfDuringCodegen",",,,") ) /// A reference to a provided type was missing a value for the static parameter '%s'. You may need to recompile one or more referenced assemblies. - /// (Originally from ../FSComp.txt:1209) + /// (Originally from ..\FSComp.txt:1209) static member etProvidedTypeReferenceMissingArgument(a0 : System.String) = (3092, GetStringFunc("etProvidedTypeReferenceMissingArgument",",,,%s,,,") a0) /// A reference to a provided type had an invalid value '%s' for a static parameter. You may need to recompile one or more referenced assemblies. - /// (Originally from ../FSComp.txt:1210) + /// (Originally from ..\FSComp.txt:1210) static member etProvidedTypeReferenceInvalidText(a0 : System.String) = (3093, GetStringFunc("etProvidedTypeReferenceInvalidText",",,,%s,,,") a0) /// '%s' is not used correctly. This is a custom operation in this query or computation expression. - /// (Originally from ../FSComp.txt:1211) + /// (Originally from ..\FSComp.txt:1211) static member tcCustomOperationNotUsedCorrectly(a0 : System.String) = (3095, GetStringFunc("tcCustomOperationNotUsedCorrectly",",,,%s,,,") a0) /// '%s' is not used correctly. Usage: %s. This is a custom operation in this query or computation expression. - /// (Originally from ../FSComp.txt:1212) + /// (Originally from ..\FSComp.txt:1212) static member tcCustomOperationNotUsedCorrectly2(a0 : System.String, a1 : System.String) = (3095, GetStringFunc("tcCustomOperationNotUsedCorrectly2",",,,%s,,,%s,,,") a0 a1) /// %s var in collection %s (outerKey = innerKey). Note that parentheses are required after '%s' - /// (Originally from ../FSComp.txt:1213) + /// (Originally from ..\FSComp.txt:1213) static member customOperationTextLikeJoin(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("customOperationTextLikeJoin",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// %s var in collection %s (outerKey = innerKey) into group. Note that parentheses are required after '%s' - /// (Originally from ../FSComp.txt:1214) + /// (Originally from ..\FSComp.txt:1214) static member customOperationTextLikeGroupJoin(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("customOperationTextLikeGroupJoin",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// %s var in collection - /// (Originally from ../FSComp.txt:1215) + /// (Originally from ..\FSComp.txt:1215) static member customOperationTextLikeZip(a0 : System.String) = (GetStringFunc("customOperationTextLikeZip",",,,%s,,,") a0) /// '%s' must be followed by a variable name. Usage: %s. - /// (Originally from ../FSComp.txt:1216) + /// (Originally from ..\FSComp.txt:1216) static member tcBinaryOperatorRequiresVariable(a0 : System.String, a1 : System.String) = (3096, GetStringFunc("tcBinaryOperatorRequiresVariable",",,,%s,,,%s,,,") a0 a1) /// Incorrect syntax for '%s'. Usage: %s. - /// (Originally from ../FSComp.txt:1217) + /// (Originally from ..\FSComp.txt:1217) static member tcOperatorIncorrectSyntax(a0 : System.String, a1 : System.String) = (3097, GetStringFunc("tcOperatorIncorrectSyntax",",,,%s,,,%s,,,") a0 a1) /// '%s' must come after a 'for' selection clause and be followed by the rest of the query. Syntax: ... %s ... - /// (Originally from ../FSComp.txt:1218) + /// (Originally from ..\FSComp.txt:1218) static member tcBinaryOperatorRequiresBody(a0 : System.String, a1 : System.String) = (3098, GetStringFunc("tcBinaryOperatorRequiresBody",",,,%s,,,%s,,,") a0 a1) /// '%s' is used with an incorrect number of arguments. This is a custom operation in this query or computation expression. Expected %d argument(s), but given %d. - /// (Originally from ../FSComp.txt:1219) + /// (Originally from ..\FSComp.txt:1219) static member tcCustomOperationHasIncorrectArgCount(a0 : System.String, a1 : System.Int32, a2 : System.Int32) = (3099, GetStringFunc("tcCustomOperationHasIncorrectArgCount",",,,%s,,,%d,,,%d,,,") a0 a1 a2) /// Expected an expression after this point - /// (Originally from ../FSComp.txt:1220) + /// (Originally from ..\FSComp.txt:1220) static member parsExpectedExpressionAfterToken() = (3100, GetStringFunc("parsExpectedExpressionAfterToken",",,,") ) /// Expected a type after this point - /// (Originally from ../FSComp.txt:1221) + /// (Originally from ..\FSComp.txt:1221) static member parsExpectedTypeAfterToken() = (3101, GetStringFunc("parsExpectedTypeAfterToken",",,,") ) /// Unmatched '[<'. Expected closing '>]' - /// (Originally from ../FSComp.txt:1222) + /// (Originally from ..\FSComp.txt:1222) static member parsUnmatchedLBrackLess() = (3102, GetStringFunc("parsUnmatchedLBrackLess",",,,") ) /// Unexpected end of input in 'match' expression. Expected 'match with | -> | -> ...'. - /// (Originally from ../FSComp.txt:1223) + /// (Originally from ..\FSComp.txt:1223) static member parsUnexpectedEndOfFileMatch() = (3103, GetStringFunc("parsUnexpectedEndOfFileMatch",",,,") ) /// Unexpected end of input in 'try' expression. Expected 'try with ' or 'try finally '. - /// (Originally from ../FSComp.txt:1224) + /// (Originally from ..\FSComp.txt:1224) static member parsUnexpectedEndOfFileTry() = (3104, GetStringFunc("parsUnexpectedEndOfFileTry",",,,") ) /// Unexpected end of input in 'while' expression. Expected 'while do '. - /// (Originally from ../FSComp.txt:1225) + /// (Originally from ..\FSComp.txt:1225) static member parsUnexpectedEndOfFileWhile() = (3105, GetStringFunc("parsUnexpectedEndOfFileWhile",",,,") ) /// Unexpected end of input in 'for' expression. Expected 'for in do '. - /// (Originally from ../FSComp.txt:1226) + /// (Originally from ..\FSComp.txt:1226) static member parsUnexpectedEndOfFileFor() = (3106, GetStringFunc("parsUnexpectedEndOfFileFor",",,,") ) /// Unexpected end of input in 'match' or 'try' expression - /// (Originally from ../FSComp.txt:1227) + /// (Originally from ..\FSComp.txt:1227) static member parsUnexpectedEndOfFileWith() = (3107, GetStringFunc("parsUnexpectedEndOfFileWith",",,,") ) /// Unexpected end of input in 'then' branch of conditional expression. Expected 'if then ' or 'if then else '. - /// (Originally from ../FSComp.txt:1228) + /// (Originally from ..\FSComp.txt:1228) static member parsUnexpectedEndOfFileThen() = (3108, GetStringFunc("parsUnexpectedEndOfFileThen",",,,") ) /// Unexpected end of input in 'else' branch of conditional expression. Expected 'if then ' or 'if then else '. - /// (Originally from ../FSComp.txt:1229) + /// (Originally from ..\FSComp.txt:1229) static member parsUnexpectedEndOfFileElse() = (3109, GetStringFunc("parsUnexpectedEndOfFileElse",",,,") ) /// Unexpected end of input in body of lambda expression. Expected 'fun ... -> '. - /// (Originally from ../FSComp.txt:1230) + /// (Originally from ..\FSComp.txt:1230) static member parsUnexpectedEndOfFileFunBody() = (3110, GetStringFunc("parsUnexpectedEndOfFileFunBody",",,,") ) /// Unexpected end of input in type arguments - /// (Originally from ../FSComp.txt:1231) + /// (Originally from ..\FSComp.txt:1231) static member parsUnexpectedEndOfFileTypeArgs() = (3111, GetStringFunc("parsUnexpectedEndOfFileTypeArgs",",,,") ) /// Unexpected end of input in type signature - /// (Originally from ../FSComp.txt:1232) + /// (Originally from ..\FSComp.txt:1232) static member parsUnexpectedEndOfFileTypeSignature() = (3112, GetStringFunc("parsUnexpectedEndOfFileTypeSignature",",,,") ) /// Unexpected end of input in type definition - /// (Originally from ../FSComp.txt:1233) + /// (Originally from ..\FSComp.txt:1233) static member parsUnexpectedEndOfFileTypeDefinition() = (3113, GetStringFunc("parsUnexpectedEndOfFileTypeDefinition",",,,") ) /// Unexpected end of input in object members - /// (Originally from ../FSComp.txt:1234) + /// (Originally from ..\FSComp.txt:1234) static member parsUnexpectedEndOfFileObjectMembers() = (3114, GetStringFunc("parsUnexpectedEndOfFileObjectMembers",",,,") ) /// Unexpected end of input in value, function or member definition - /// (Originally from ../FSComp.txt:1235) + /// (Originally from ..\FSComp.txt:1235) static member parsUnexpectedEndOfFileDefinition() = (3115, GetStringFunc("parsUnexpectedEndOfFileDefinition",",,,") ) /// Unexpected end of input in expression - /// (Originally from ../FSComp.txt:1236) + /// (Originally from ..\FSComp.txt:1236) static member parsUnexpectedEndOfFileExpression() = (3116, GetStringFunc("parsUnexpectedEndOfFileExpression",",,,") ) /// Unexpected end of type. Expected a name after this point. - /// (Originally from ../FSComp.txt:1237) + /// (Originally from ..\FSComp.txt:1237) static member parsExpectedNameAfterToken() = (3117, GetStringFunc("parsExpectedNameAfterToken",",,,") ) /// Incomplete value or function definition. If this is in an expression, the body of the expression must be indented to the same column as the 'let' keyword. - /// (Originally from ../FSComp.txt:1238) + /// (Originally from ..\FSComp.txt:1238) static member parsUnmatchedLet() = (3118, GetStringFunc("parsUnmatchedLet",",,,") ) /// Incomplete value definition. If this is in an expression, the body of the expression must be indented to the same column as the 'let!' keyword. - /// (Originally from ../FSComp.txt:1239) + /// (Originally from ..\FSComp.txt:1239) static member parsUnmatchedLetBang() = (3119, GetStringFunc("parsUnmatchedLetBang",",,,") ) /// Incomplete value definition. If this is in an expression, the body of the expression must be indented to the same column as the 'use!' keyword. - /// (Originally from ../FSComp.txt:1240) + /// (Originally from ..\FSComp.txt:1240) static member parsUnmatchedUseBang() = (3120, GetStringFunc("parsUnmatchedUseBang",",,,") ) /// Incomplete value definition. If this is in an expression, the body of the expression must be indented to the same column as the 'use' keyword. - /// (Originally from ../FSComp.txt:1241) + /// (Originally from ..\FSComp.txt:1241) static member parsUnmatchedUse() = (3121, GetStringFunc("parsUnmatchedUse",",,,") ) /// Missing 'do' in 'while' expression. Expected 'while do '. - /// (Originally from ../FSComp.txt:1242) + /// (Originally from ..\FSComp.txt:1242) static member parsWhileDoExpected() = (3122, GetStringFunc("parsWhileDoExpected",",,,") ) /// Missing 'do' in 'for' expression. Expected 'for in do '. - /// (Originally from ../FSComp.txt:1243) + /// (Originally from ..\FSComp.txt:1243) static member parsForDoExpected() = (3123, GetStringFunc("parsForDoExpected",",,,") ) /// Invalid join relation in '%s'. Expected 'expr expr', where is =, =?, ?= or ?=?. - /// (Originally from ../FSComp.txt:1244) + /// (Originally from ..\FSComp.txt:1244) static member tcInvalidRelationInJoin(a0 : System.String) = (3125, GetStringFunc("tcInvalidRelationInJoin",",,,%s,,,") a0) /// Calls - /// (Originally from ../FSComp.txt:1245) + /// (Originally from ..\FSComp.txt:1245) static member typeInfoCallsWord() = (GetStringFunc("typeInfoCallsWord",",,,") ) /// Invalid number of generic arguments to type '%s' in provided type. Expected '%d' arguments, given '%d'. - /// (Originally from ../FSComp.txt:1246) + /// (Originally from ..\FSComp.txt:1246) static member impInvalidNumberOfGenericArguments(a0 : System.String, a1 : System.Int32, a2 : System.Int32) = (3126, GetStringFunc("impInvalidNumberOfGenericArguments",",,,%s,,,%d,,,%d,,,") a0 a1 a2) /// Invalid value '%s' for unit-of-measure parameter '%s' - /// (Originally from ../FSComp.txt:1247) + /// (Originally from ..\FSComp.txt:1247) static member impInvalidMeasureArgument1(a0 : System.String, a1 : System.String) = (3127, GetStringFunc("impInvalidMeasureArgument1",",,,%s,,,%s,,,") a0 a1) /// Invalid value unit-of-measure parameter '%s' - /// (Originally from ../FSComp.txt:1248) + /// (Originally from ..\FSComp.txt:1248) static member impInvalidMeasureArgument2(a0 : System.String) = (3127, GetStringFunc("impInvalidMeasureArgument2",",,,%s,,,") a0) /// Property '%s' on provided type '%s' is neither readable nor writable as it has CanRead=false and CanWrite=false - /// (Originally from ../FSComp.txt:1249) + /// (Originally from ..\FSComp.txt:1249) static member etPropertyNeedsCanWriteOrCanRead(a0 : System.String, a1 : System.String) = (3128, GetStringFunc("etPropertyNeedsCanWriteOrCanRead",",,,%s,,,%s,,,") a0 a1) /// A use of 'into' must be followed by the remainder of the computation - /// (Originally from ../FSComp.txt:1250) + /// (Originally from ..\FSComp.txt:1250) static member tcIntoNeedsRestOfQuery() = (3129, GetStringFunc("tcIntoNeedsRestOfQuery",",,,") ) /// The operator '%s' does not accept the use of 'into' - /// (Originally from ../FSComp.txt:1251) + /// (Originally from ..\FSComp.txt:1251) static member tcOperatorDoesntAcceptInto(a0 : System.String) = (3130, GetStringFunc("tcOperatorDoesntAcceptInto",",,,%s,,,") a0) /// The definition of the custom operator '%s' does not use a valid combination of attribute flags - /// (Originally from ../FSComp.txt:1252) + /// (Originally from ..\FSComp.txt:1252) static member tcCustomOperationInvalid(a0 : System.String) = (3131, GetStringFunc("tcCustomOperationInvalid",",,,%s,,,") a0) /// This type definition may not have the 'CLIMutable' attribute. Only record types may have this attribute. - /// (Originally from ../FSComp.txt:1253) + /// (Originally from ..\FSComp.txt:1253) static member tcThisTypeMayNotHaveACLIMutableAttribute() = (3132, GetStringFunc("tcThisTypeMayNotHaveACLIMutableAttribute",",,,") ) /// 'member val' definitions are only permitted in types with a primary constructor. Consider adding arguments to your type definition, e.g. 'type X(args) = ...'. - /// (Originally from ../FSComp.txt:1254) + /// (Originally from ..\FSComp.txt:1254) static member tcAutoPropertyRequiresImplicitConstructionSequence() = (3133, GetStringFunc("tcAutoPropertyRequiresImplicitConstructionSequence",",,,") ) /// Property definitions may not be declared mutable. To indicate that this property can be set, use 'member val PropertyName = expr with get,set'. - /// (Originally from ../FSComp.txt:1255) + /// (Originally from ..\FSComp.txt:1255) static member parsMutableOnAutoPropertyShouldBeGetSet() = (3134, GetStringFunc("parsMutableOnAutoPropertyShouldBeGetSet",",,,") ) /// To indicate that this property can be set, use 'member val PropertyName = expr with get,set'. - /// (Originally from ../FSComp.txt:1256) + /// (Originally from ..\FSComp.txt:1256) static member parsMutableOnAutoPropertyShouldBeGetSetNotJustSet() = (3135, GetStringFunc("parsMutableOnAutoPropertyShouldBeGetSetNotJustSet",",,,") ) /// Type '%s' is illegal because in byref, T cannot contain byref types. - /// (Originally from ../FSComp.txt:1257) + /// (Originally from ..\FSComp.txt:1257) static member chkNoByrefsOfByrefs(a0 : System.String) = (3136, GetStringFunc("chkNoByrefsOfByrefs",",,,%s,,,") a0) /// F# supports array ranks between 1 and 32. The value %d is not allowed. - /// (Originally from ../FSComp.txt:1258) + /// (Originally from ..\FSComp.txt:1258) static member tastopsMaxArrayThirtyTwo(a0 : System.Int32) = (3138, GetStringFunc("tastopsMaxArrayThirtyTwo",",,,%d,,,") a0) /// In queries, use the form 'for x in n .. m do ...' for ranging over integers - /// (Originally from ../FSComp.txt:1259) + /// (Originally from ..\FSComp.txt:1259) static member tcNoIntegerForLoopInQuery() = (3139, GetStringFunc("tcNoIntegerForLoopInQuery",",,,") ) /// 'while' expressions may not be used in queries - /// (Originally from ../FSComp.txt:1260) + /// (Originally from ..\FSComp.txt:1260) static member tcNoWhileInQuery() = (3140, GetStringFunc("tcNoWhileInQuery",",,,") ) /// 'try/finally' expressions may not be used in queries - /// (Originally from ../FSComp.txt:1261) + /// (Originally from ..\FSComp.txt:1261) static member tcNoTryFinallyInQuery() = (3141, GetStringFunc("tcNoTryFinallyInQuery",",,,") ) /// 'use' expressions may not be used in queries - /// (Originally from ../FSComp.txt:1262) + /// (Originally from ..\FSComp.txt:1262) static member tcUseMayNotBeUsedInQueries() = (3142, GetStringFunc("tcUseMayNotBeUsedInQueries",",,,") ) /// 'let!', 'use!' and 'do!' expressions may not be used in queries - /// (Originally from ../FSComp.txt:1263) + /// (Originally from ..\FSComp.txt:1263) static member tcBindMayNotBeUsedInQueries() = (3143, GetStringFunc("tcBindMayNotBeUsedInQueries",",,,") ) /// 'return' and 'return!' may not be used in queries - /// (Originally from ../FSComp.txt:1264) + /// (Originally from ..\FSComp.txt:1264) static member tcReturnMayNotBeUsedInQueries() = (3144, GetStringFunc("tcReturnMayNotBeUsedInQueries",",,,") ) /// This is not a known query operator. Query operators are identifiers such as 'select', 'where', 'sortBy', 'thenBy', 'groupBy', 'groupValBy', 'join', 'groupJoin', 'sumBy' and 'averageBy', defined using corresponding methods on the 'QueryBuilder' type. - /// (Originally from ../FSComp.txt:1265) + /// (Originally from ..\FSComp.txt:1265) static member tcUnrecognizedQueryOperator() = (3145, GetStringFunc("tcUnrecognizedQueryOperator",",,,") ) /// 'try/with' expressions may not be used in queries - /// (Originally from ../FSComp.txt:1266) + /// (Originally from ..\FSComp.txt:1266) static member tcTryWithMayNotBeUsedInQueries() = (3146, GetStringFunc("tcTryWithMayNotBeUsedInQueries",",,,") ) /// This 'let' definition may not be used in a query. Only simple value definitions may be used in queries. - /// (Originally from ../FSComp.txt:1267) + /// (Originally from ..\FSComp.txt:1267) static member tcNonSimpleLetBindingInQuery() = (3147, GetStringFunc("tcNonSimpleLetBindingInQuery",",,,") ) /// Too many static parameters. Expected at most %d parameters, but got %d unnamed and %d named parameters. - /// (Originally from ../FSComp.txt:1268) + /// (Originally from ..\FSComp.txt:1268) static member etTooManyStaticParameters(a0 : System.Int32, a1 : System.Int32, a2 : System.Int32) = (3148, GetStringFunc("etTooManyStaticParameters",",,,%d,,,%d,,,%d,,,") a0 a1 a2) /// Invalid provided literal value '%s' - /// (Originally from ../FSComp.txt:1269) + /// (Originally from ..\FSComp.txt:1269) static member infosInvalidProvidedLiteralValue(a0 : System.String) = (3149, GetStringFunc("infosInvalidProvidedLiteralValue",",,,%s,,,") a0) /// The 'anycpu32bitpreferred' platform can only be used with EXE targets. You must use 'anycpu' instead. - /// (Originally from ../FSComp.txt:1270) + /// (Originally from ..\FSComp.txt:1270) static member invalidPlatformTarget() = (3150, GetStringFunc("invalidPlatformTarget",",,,") ) /// This member, function or value declaration may not be declared 'inline' - /// (Originally from ../FSComp.txt:1271) + /// (Originally from ..\FSComp.txt:1271) static member tcThisValueMayNotBeInlined() = (3151, GetStringFunc("tcThisValueMayNotBeInlined",",,,") ) /// The provider '%s' returned a non-generated type '%s' in the context of a set of generated types. Consider adjusting the type provider to only return generated types. - /// (Originally from ../FSComp.txt:1272) + /// (Originally from ..\FSComp.txt:1272) static member etErasedTypeUsedInGeneration(a0 : System.String, a1 : System.String) = (3152, GetStringFunc("etErasedTypeUsedInGeneration",",,,%s,,,%s,,,") a0 a1) /// Arguments to query operators may require parentheses, e.g. 'where (x > y)' or 'groupBy (x.Length / 10)' - /// (Originally from ../FSComp.txt:1273) + /// (Originally from ..\FSComp.txt:1273) static member tcUnrecognizedQueryBinaryOperator() = (3153, GetStringFunc("tcUnrecognizedQueryBinaryOperator",",,,") ) /// A quotation may not involve an assignment to or taking the address of a captured local variable - /// (Originally from ../FSComp.txt:1274) + /// (Originally from ..\FSComp.txt:1274) static member crefNoSetOfHole() = (3155, GetStringFunc("crefNoSetOfHole",",,,") ) /// + 1 overload - /// (Originally from ../FSComp.txt:1275) + /// (Originally from ..\FSComp.txt:1275) static member nicePrintOtherOverloads1() = (GetStringFunc("nicePrintOtherOverloads1",",,,") ) /// + %d overloads - /// (Originally from ../FSComp.txt:1276) + /// (Originally from ..\FSComp.txt:1276) static member nicePrintOtherOverloadsN(a0 : System.Int32) = (GetStringFunc("nicePrintOtherOverloadsN",",,,%d,,,") a0) /// Erased to - /// (Originally from ../FSComp.txt:1277) + /// (Originally from ..\FSComp.txt:1277) static member erasedTo() = (GetStringFunc("erasedTo",",,,") ) /// Unexpected token '%s' or incomplete expression - /// (Originally from ../FSComp.txt:1278) + /// (Originally from ..\FSComp.txt:1278) static member parsUnfinishedExpression(a0 : System.String) = (3156, GetStringFunc("parsUnfinishedExpression",",,,%s,,,") a0) /// Cannot find code target for this attribute, possibly because the code after the attribute is incomplete. - /// (Originally from ../FSComp.txt:1279) + /// (Originally from ..\FSComp.txt:1279) static member parsAttributeOnIncompleteCode() = (3158, GetStringFunc("parsAttributeOnIncompleteCode",",,,") ) /// Type name cannot be empty. - /// (Originally from ../FSComp.txt:1280) + /// (Originally from ..\FSComp.txt:1280) static member parsTypeNameCannotBeEmpty() = (3159, GetStringFunc("parsTypeNameCannotBeEmpty",",,,") ) /// Problem reading assembly '%s': %s - /// (Originally from ../FSComp.txt:1281) + /// (Originally from ..\FSComp.txt:1281) static member buildProblemReadingAssembly(a0 : System.String, a1 : System.String) = (3160, GetStringFunc("buildProblemReadingAssembly",",,,%s,,,%s,,,") a0 a1) /// Invalid provided field. Provided fields of erased provided types must be literals. - /// (Originally from ../FSComp.txt:1282) + /// (Originally from ..\FSComp.txt:1282) static member tcTPFieldMustBeLiteral() = (3161, GetStringFunc("tcTPFieldMustBeLiteral",",,,") ) /// (loading description...) - /// (Originally from ../FSComp.txt:1283) + /// (Originally from ..\FSComp.txt:1283) static member loadingDescription() = (GetStringFunc("loadingDescription",",,,") ) /// (description unavailable...) - /// (Originally from ../FSComp.txt:1284) + /// (Originally from ..\FSComp.txt:1284) static member descriptionUnavailable() = (GetStringFunc("descriptionUnavailable",",,,") ) /// A type variable has been constrained by multiple different class types. A type variable may only have one class constraint. - /// (Originally from ../FSComp.txt:1285) + /// (Originally from ..\FSComp.txt:1285) static member chkTyparMultipleClassConstraints() = (3162, GetStringFunc("chkTyparMultipleClassConstraints",",,,") ) /// 'match' expressions may not be used in queries - /// (Originally from ../FSComp.txt:1286) + /// (Originally from ..\FSComp.txt:1286) static member tcMatchMayNotBeUsedWithQuery() = (3163, GetStringFunc("tcMatchMayNotBeUsedWithQuery",",,,") ) /// Infix operator member '%s' has %d initial argument(s). Expected a tuple of 3 arguments - /// (Originally from ../FSComp.txt:1287) + /// (Originally from ..\FSComp.txt:1287) static member memberOperatorDefinitionWithNonTripleArgument(a0 : System.String, a1 : System.Int32) = (3164, GetStringFunc("memberOperatorDefinitionWithNonTripleArgument",",,,%s,,,%d,,,") a0 a1) /// The operator '%s' cannot be resolved. Consider opening the module 'Microsoft.FSharp.Linq.NullableOperators'. - /// (Originally from ../FSComp.txt:1288) + /// (Originally from ..\FSComp.txt:1288) static member cannotResolveNullableOperators(a0 : System.String) = (3165, GetStringFunc("cannotResolveNullableOperators",",,,%s,,,") a0) /// '%s' must be followed by 'in'. Usage: %s. - /// (Originally from ../FSComp.txt:1289) + /// (Originally from ..\FSComp.txt:1289) static member tcOperatorRequiresIn(a0 : System.String, a1 : System.String) = (3167, GetStringFunc("tcOperatorRequiresIn",",,,%s,,,%s,,,") a0 a1) /// Neither 'member val' nor 'override val' definitions are permitted in object expressions. - /// (Originally from ../FSComp.txt:1290) + /// (Originally from ..\FSComp.txt:1290) static member parsIllegalMemberVarInObjectImplementation() = (3168, GetStringFunc("parsIllegalMemberVarInObjectImplementation",",,,") ) /// Copy-and-update record expressions must include at least one field. - /// (Originally from ../FSComp.txt:1291) + /// (Originally from ..\FSComp.txt:1291) static member tcEmptyCopyAndUpdateRecordInvalid() = (3169, GetStringFunc("tcEmptyCopyAndUpdateRecordInvalid",",,,") ) /// '_' cannot be used as field name - /// (Originally from ../FSComp.txt:1292) + /// (Originally from ..\FSComp.txt:1292) static member parsUnderscoreInvalidFieldName() = (3170, GetStringFunc("parsUnderscoreInvalidFieldName",",,,") ) /// The provided types generated by this use of a type provider may not be used from other F# assemblies and should be marked internal or private. Consider using 'type internal TypeName = ...' or 'type private TypeName = ...'. - /// (Originally from ../FSComp.txt:1293) + /// (Originally from ..\FSComp.txt:1293) static member tcGeneratedTypesShouldBeInternalOrPrivate() = (3171, GetStringFunc("tcGeneratedTypesShouldBeInternalOrPrivate",",,,") ) /// A property's getter and setter must have the same type. Property '%s' has getter of type '%s' but setter of type '%s'. - /// (Originally from ../FSComp.txt:1294) + /// (Originally from ..\FSComp.txt:1294) static member chkGetterAndSetterHaveSamePropertyType(a0 : System.String, a1 : System.String, a2 : System.String) = (3172, GetStringFunc("chkGetterAndSetterHaveSamePropertyType",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// Array method '%s' is supplied by the runtime and cannot be directly used in code. For operations with array elements consider using family of GetArray/SetArray functions from LanguagePrimitives.IntrinsicFunctions module. - /// (Originally from ../FSComp.txt:1295) + /// (Originally from ..\FSComp.txt:1295) static member tcRuntimeSuppliedMethodCannotBeUsedInUserCode(a0 : System.String) = (3173, GetStringFunc("tcRuntimeSuppliedMethodCannotBeUsedInUserCode",",,,%s,,,") a0) /// Union case/exception '%s' does not have field named '%s'. - /// (Originally from ../FSComp.txt:1296) + /// (Originally from ..\FSComp.txt:1296) static member tcUnionCaseConstructorDoesNotHaveFieldWithGivenName(a0 : System.String, a1 : System.String) = (3174, GetStringFunc("tcUnionCaseConstructorDoesNotHaveFieldWithGivenName",",,,%s,,,%s,,,") a0 a1) /// Union case/exception field '%s' cannot be used more than once. - /// (Originally from ../FSComp.txt:1297) + /// (Originally from ..\FSComp.txt:1297) static member tcUnionCaseFieldCannotBeUsedMoreThanOnce(a0 : System.String) = (3175, GetStringFunc("tcUnionCaseFieldCannotBeUsedMoreThanOnce",",,,%s,,,") a0) /// Named field '%s' is used more than once. - /// (Originally from ../FSComp.txt:1298) + /// (Originally from ..\FSComp.txt:1298) static member tcFieldNameIsUsedModeThanOnce(a0 : System.String) = (3176, GetStringFunc("tcFieldNameIsUsedModeThanOnce",",,,%s,,,") a0) /// Named field '%s' conflicts with autogenerated name for anonymous field. - /// (Originally from ../FSComp.txt:1299) + /// (Originally from ..\FSComp.txt:1299) static member tcFieldNameConflictsWithGeneratedNameForAnonymousField(a0 : System.String) = (3176, GetStringFunc("tcFieldNameConflictsWithGeneratedNameForAnonymousField",",,,%s,,,") a0) /// This literal expression or attribute argument results in an arithmetic overflow. - /// (Originally from ../FSComp.txt:1300) + /// (Originally from ..\FSComp.txt:1300) static member tastConstantExpressionOverflow() = (3177, GetStringFunc("tastConstantExpressionOverflow",",,,") ) /// This is not valid literal expression. The [] attribute will be ignored. - /// (Originally from ../FSComp.txt:1301) + /// (Originally from ..\FSComp.txt:1301) static member tcIllegalStructTypeForConstantExpression() = (3178, GetStringFunc("tcIllegalStructTypeForConstantExpression",",,,") ) /// System.Runtime.InteropServices assembly is required to use UnknownWrapper\DispatchWrapper classes. - /// (Originally from ../FSComp.txt:1302) + /// (Originally from ..\FSComp.txt:1302) static member fscSystemRuntimeInteropServicesIsRequired() = (3179, GetStringFunc("fscSystemRuntimeInteropServicesIsRequired",",,,") ) /// The mutable local '%s' is implicitly allocated as a reference cell because it has been captured by a closure. This warning is for informational purposes only to indicate where implicit allocations are performed. - /// (Originally from ../FSComp.txt:1303) + /// (Originally from ..\FSComp.txt:1303) static member abImplicitHeapAllocation(a0 : System.String) = (3180, GetStringFunc("abImplicitHeapAllocation",",,,%s,,,") a0) /// A type provider implemented GetStaticParametersForMethod, but ApplyStaticArgumentsForMethod was not implemented or invalid - /// (Originally from ../FSComp.txt:1304) + /// (Originally from ..\FSComp.txt:1304) static member estApplyStaticArgumentsForMethodNotImplemented() = (GetStringFunc("estApplyStaticArgumentsForMethodNotImplemented",",,,") ) /// An error occured applying the static arguments to a provided method - /// (Originally from ../FSComp.txt:1305) + /// (Originally from ..\FSComp.txt:1305) static member etErrorApplyingStaticArgumentsToMethod() = (3181, GetStringFunc("etErrorApplyingStaticArgumentsToMethod",",,,") ) /// Unexpected character '%s' in preprocessor expression - /// (Originally from ../FSComp.txt:1306) + /// (Originally from ..\FSComp.txt:1306) static member pplexUnexpectedChar(a0 : System.String) = (3182, GetStringFunc("pplexUnexpectedChar",",,,%s,,,") a0) /// Unexpected token '%s' in preprocessor expression - /// (Originally from ../FSComp.txt:1307) + /// (Originally from ..\FSComp.txt:1307) static member ppparsUnexpectedToken(a0 : System.String) = (3183, GetStringFunc("ppparsUnexpectedToken",",,,%s,,,") a0) /// Incomplete preprocessor expression - /// (Originally from ../FSComp.txt:1308) + /// (Originally from ..\FSComp.txt:1308) static member ppparsIncompleteExpression() = (3184, GetStringFunc("ppparsIncompleteExpression",",,,") ) /// Missing token '%s' in preprocessor expression - /// (Originally from ../FSComp.txt:1309) + /// (Originally from ..\FSComp.txt:1309) static member ppparsMissingToken(a0 : System.String) = (3185, GetStringFunc("ppparsMissingToken",",,,%s,,,") a0) /// An error occurred while reading the F# metadata node at position %d in table '%s' of assembly '%s'. The node had no matching declaration. Please report this warning. You may need to recompile the F# assembly you are using. - /// (Originally from ../FSComp.txt:1310) + /// (Originally from ..\FSComp.txt:1310) static member pickleMissingDefinition(a0 : System.Int32, a1 : System.String, a2 : System.String) = (3186, GetStringFunc("pickleMissingDefinition",",,,%d,,,%s,,,%s,,,") a0 a1 a2) /// Type inference caused the type variable %s to escape its scope. Consider adding an explicit type parameter declaration or adjusting your code to be less generic. - /// (Originally from ../FSComp.txt:1311) + /// (Originally from ..\FSComp.txt:1311) static member checkNotSufficientlyGenericBecauseOfScope(a0 : System.String) = (3187, GetStringFunc("checkNotSufficientlyGenericBecauseOfScope",",,,%s,,,") a0) /// Type inference caused an inference type variable to escape its scope. Consider adding type annotations to make your code less generic. - /// (Originally from ../FSComp.txt:1312) + /// (Originally from ..\FSComp.txt:1312) static member checkNotSufficientlyGenericBecauseOfScopeAnon() = (3188, GetStringFunc("checkNotSufficientlyGenericBecauseOfScopeAnon",",,,") ) /// Redundant arguments are being ignored in function '%s'. Expected %d but got %d arguments. - /// (Originally from ../FSComp.txt:1313) + /// (Originally from ..\FSComp.txt:1313) static member checkRaiseFamilyFunctionArgumentCount(a0 : System.String, a1 : System.Int32, a2 : System.Int32) = (3189, GetStringFunc("checkRaiseFamilyFunctionArgumentCount",",,,%s,,,%d,,,%d,,,") a0 a1 a2) /// Lowercase literal '%s' is being shadowed by a new pattern with the same name. Only uppercase and module-prefixed literals can be used as named patterns. - /// (Originally from ../FSComp.txt:1314) + /// (Originally from ..\FSComp.txt:1314) static member checkLowercaseLiteralBindingInPattern(a0 : System.String) = (3190, GetStringFunc("checkLowercaseLiteralBindingInPattern",",,,%s,,,") a0) /// This literal pattern does not take arguments - /// (Originally from ../FSComp.txt:1315) + /// (Originally from ..\FSComp.txt:1315) static member tcLiteralDoesNotTakeArguments() = (3191, GetStringFunc("tcLiteralDoesNotTakeArguments",",,,") ) /// Constructors are not permitted as extension members - they must be defined as part of the original definition of the type - /// (Originally from ../FSComp.txt:1316) + /// (Originally from ..\FSComp.txt:1316) static member tcConstructorsIllegalInAugmentation() = (3192, GetStringFunc("tcConstructorsIllegalInAugmentation",",,,") ) /// Invalid response file '%s' ( '%s' ) - /// (Originally from ../FSComp.txt:1317) + /// (Originally from ..\FSComp.txt:1317) static member optsInvalidResponseFile(a0 : System.String, a1 : System.String) = (3193, GetStringFunc("optsInvalidResponseFile",",,,%s,,,%s,,,") a0 a1) /// Response file '%s' not found in '%s' - /// (Originally from ../FSComp.txt:1318) + /// (Originally from ..\FSComp.txt:1318) static member optsResponseFileNotFound(a0 : System.String, a1 : System.String) = (3194, GetStringFunc("optsResponseFileNotFound",",,,%s,,,%s,,,") a0 a1) /// Response file name '%s' is empty, contains invalid characters, has a drive specification without an absolute path, or is too long - /// (Originally from ../FSComp.txt:1319) + /// (Originally from ..\FSComp.txt:1319) static member optsResponseFileNameInvalid(a0 : System.String) = (3195, GetStringFunc("optsResponseFileNameInvalid",",,,%s,,,") a0) /// Cannot find FSharp.Core.dll in compiler's directory - /// (Originally from ../FSComp.txt:1320) + /// (Originally from ..\FSComp.txt:1320) static member fsharpCoreNotFoundToBeCopied() = (3196, GetStringFunc("fsharpCoreNotFoundToBeCopied",",,,") ) /// One tuple type is a struct tuple, the other is a reference tuple - /// (Originally from ../FSComp.txt:1321) + /// (Originally from ..\FSComp.txt:1321) static member tcTupleStructMismatch() = (GetStringFunc("tcTupleStructMismatch",",,,") ) /// This provided method requires static parameters - /// (Originally from ../FSComp.txt:1322) + /// (Originally from ..\FSComp.txt:1322) static member etMissingStaticArgumentsToMethod() = (3197, GetStringFunc("etMissingStaticArgumentsToMethod",",,,") ) /// The conversion from %s to %s is a compile-time safe upcast, not a downcast. Consider using 'upcast' instead of 'downcast'. - /// (Originally from ../FSComp.txt:1323) + /// (Originally from ..\FSComp.txt:1323) static member considerUpcast(a0 : System.String, a1 : System.String) = (3198, GetStringFunc("considerUpcast",",,,%s,,,%s,,,") a0 a1) /// The conversion from %s to %s is a compile-time safe upcast, not a downcast. Consider using the :> (upcast) operator instead of the :?> (downcast) operator. - /// (Originally from ../FSComp.txt:1324) + /// (Originally from ..\FSComp.txt:1324) static member considerUpcastOperator(a0 : System.String, a1 : System.String) = (3198, GetStringFunc("considerUpcastOperator",",,,%s,,,%s,,,") a0 a1) /// The 'rec' on this module is implied by an outer 'rec' declaration and is being ignored - /// (Originally from ../FSComp.txt:1325) + /// (Originally from ..\FSComp.txt:1325) static member tcRecImplied() = (3199, GetStringFunc("tcRecImplied",",,,") ) /// In a recursive declaration group, 'open' declarations must come first in each module - /// (Originally from ../FSComp.txt:1326) + /// (Originally from ..\FSComp.txt:1326) static member tcOpenFirstInMutRec() = (3200, GetStringFunc("tcOpenFirstInMutRec",",,,") ) /// In a recursive declaration group, module abbreviations must come after all 'open' declarations and before other declarations - /// (Originally from ../FSComp.txt:1327) + /// (Originally from ..\FSComp.txt:1327) static member tcModuleAbbrevFirstInMutRec() = (3201, GetStringFunc("tcModuleAbbrevFirstInMutRec",",,,") ) /// This declaration is not supported in recursive declaration groups - /// (Originally from ../FSComp.txt:1328) + /// (Originally from ..\FSComp.txt:1328) static member tcUnsupportedMutRecDecl() = (3202, GetStringFunc("tcUnsupportedMutRecDecl",",,,") ) /// Invalid use of 'rec' keyword - /// (Originally from ../FSComp.txt:1329) + /// (Originally from ..\FSComp.txt:1329) static member parsInvalidUseOfRec() = (3203, GetStringFunc("parsInvalidUseOfRec",",,,") ) /// If a union type has more than one case and is a struct, then all fields within the union type must be given unique names. - /// (Originally from ../FSComp.txt:1330) + /// (Originally from ..\FSComp.txt:1330) static member tcStructUnionMultiCaseDistinctFields() = (3204, GetStringFunc("tcStructUnionMultiCaseDistinctFields",",,,") ) /// The CallerMemberNameAttribute applied to parameter '%s' will have no effect. It is overridden by the CallerFilePathAttribute. - /// (Originally from ../FSComp.txt:1331) + /// (Originally from ..\FSComp.txt:1331) static member CallerMemberNameIsOverriden(a0 : System.String) = (3206, GetStringFunc("CallerMemberNameIsOverriden",",,,%s,,,") a0) /// Invalid use of 'fixed'. 'fixed' may only be used in a declaration of the form 'use x = fixed expr' where the expression is an array, the address of a field, the address of an array element or a string' - /// (Originally from ../FSComp.txt:1332) + /// (Originally from ..\FSComp.txt:1332) static member tcFixedNotAllowed() = (3207, GetStringFunc("tcFixedNotAllowed",",,,") ) /// Could not find method System.Runtime.CompilerServices.OffsetToStringData in references when building 'fixed' expression. - /// (Originally from ../FSComp.txt:1333) + /// (Originally from ..\FSComp.txt:1333) static member tcCouldNotFindOffsetToStringData() = (3208, GetStringFunc("tcCouldNotFindOffsetToStringData",",,,") ) - /// The address of the variable '%s' cannot be used at this point. A method or function may not return the address of this local value. - /// (Originally from ../FSComp.txt:1334) - static member chkNoByrefReturnOfLocal(a0 : System.String) = (3209, GetStringFunc("chkNoByrefReturnOfLocal",",,,%s,,,") a0) + /// The address of the variable '%s' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + /// (Originally from ..\FSComp.txt:1334) + static member chkNoByrefAddressOfLocal(a0 : System.String) = (3209, GetStringFunc("chkNoByrefAddressOfLocal",",,,%s,,,") a0) /// %s is an active pattern and cannot be treated as a discriminated union case with named fields. - /// (Originally from ../FSComp.txt:1335) + /// (Originally from ..\FSComp.txt:1335) static member tcNamedActivePattern(a0 : System.String) = (3210, GetStringFunc("tcNamedActivePattern",",,,%s,,,") a0) /// The default value does not have the same type as the argument. The DefaultParameterValue attribute and any Optional attribute will be ignored. Note: 'null' needs to be annotated with the correct type, e.g. 'DefaultParameterValue(null:obj)'. - /// (Originally from ../FSComp.txt:1336) + /// (Originally from ..\FSComp.txt:1336) static member DefaultParameterValueNotAppropriateForArgument() = (3211, GetStringFunc("DefaultParameterValueNotAppropriateForArgument",",,,") ) /// The system type '%s' was required but no referenced system DLL contained this type - /// (Originally from ../FSComp.txt:1337) + /// (Originally from ..\FSComp.txt:1337) static member tcGlobalsSystemTypeNotFound(a0 : System.String) = (GetStringFunc("tcGlobalsSystemTypeNotFound",",,,%s,,,") a0) /// The member '%s' matches multiple overloads of the same method.\nPlease restrict it to one of the following:%s. - /// (Originally from ../FSComp.txt:1338) + /// (Originally from ..\FSComp.txt:1338) static member typrelMemberHasMultiplePossibleDispatchSlots(a0 : System.String, a1 : System.String) = (3213, GetStringFunc("typrelMemberHasMultiplePossibleDispatchSlots",",,,%s,,,%s,,,") a0 a1) /// Method or object constructor '%s' is not static - /// (Originally from ../FSComp.txt:1339) + /// (Originally from ..\FSComp.txt:1339) static member methodIsNotStatic(a0 : System.String) = (3214, GetStringFunc("methodIsNotStatic",",,,%s,,,") a0) /// Unexpected symbol '=' in expression. Did you intend to use 'for x in y .. z do' instead? - /// (Originally from ../FSComp.txt:1340) + /// (Originally from ..\FSComp.txt:1340) static member parsUnexpectedSymbolEqualsInsteadOfIn() = (3215, GetStringFunc("parsUnexpectedSymbolEqualsInsteadOfIn",",,,") ) /// Indicates a method that either has no implementation in the type in which it is declared or that is virtual and has a default implementation. - /// (Originally from ../FSComp.txt:1341) + /// (Originally from ..\FSComp.txt:1341) static member keywordDescriptionAbstract() = (GetStringFunc("keywordDescriptionAbstract",",,,") ) /// Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - /// (Originally from ../FSComp.txt:1342) + /// (Originally from ..\FSComp.txt:1342) static member keyworkDescriptionAnd() = (GetStringFunc("keyworkDescriptionAnd",",,,") ) /// Used to give the current class object an object name. Also used to give a name to a whole pattern within a pattern match. - /// (Originally from ../FSComp.txt:1343) + /// (Originally from ..\FSComp.txt:1343) static member keywordDescriptionAs() = (GetStringFunc("keywordDescriptionAs",",,,") ) /// Used to verify code during debugging. - /// (Originally from ../FSComp.txt:1344) + /// (Originally from ..\FSComp.txt:1344) static member keywordDescriptionAssert() = (GetStringFunc("keywordDescriptionAssert",",,,") ) /// Used as the name of the base class object. - /// (Originally from ../FSComp.txt:1345) + /// (Originally from ..\FSComp.txt:1345) static member keywordDescriptionBase() = (GetStringFunc("keywordDescriptionBase",",,,") ) /// In verbose syntax, indicates the start of a code block. - /// (Originally from ../FSComp.txt:1346) + /// (Originally from ..\FSComp.txt:1346) static member keywordDescriptionBegin() = (GetStringFunc("keywordDescriptionBegin",",,,") ) /// In verbose syntax, indicates the start of a class definition. - /// (Originally from ../FSComp.txt:1347) + /// (Originally from ..\FSComp.txt:1347) static member keywordDescriptionClass() = (GetStringFunc("keywordDescriptionClass",",,,") ) /// Indicates an implementation of an abstract method; used together with an abstract method declaration to create a virtual method. - /// (Originally from ../FSComp.txt:1348) + /// (Originally from ..\FSComp.txt:1348) static member keywordDescriptionDefault() = (GetStringFunc("keywordDescriptionDefault",",,,") ) /// Used to declare a delegate. - /// (Originally from ../FSComp.txt:1349) + /// (Originally from ..\FSComp.txt:1349) static member keywordDescriptionDelegate() = (GetStringFunc("keywordDescriptionDelegate",",,,") ) /// Used in looping constructs or to execute imperative code. - /// (Originally from ../FSComp.txt:1350) + /// (Originally from ..\FSComp.txt:1350) static member keywordDescriptionDo() = (GetStringFunc("keywordDescriptionDo",",,,") ) /// In verbose syntax, indicates the end of a block of code in a looping expression. - /// (Originally from ../FSComp.txt:1351) + /// (Originally from ..\FSComp.txt:1351) static member keywordDescriptionDone() = (GetStringFunc("keywordDescriptionDone",",,,") ) /// Used to convert to a type that is lower in the inheritance chain. - /// (Originally from ../FSComp.txt:1352) + /// (Originally from ..\FSComp.txt:1352) static member keywordDescriptionDowncast() = (GetStringFunc("keywordDescriptionDowncast",",,,") ) /// In a for expression, used when counting in reverse. - /// (Originally from ../FSComp.txt:1353) + /// (Originally from ..\FSComp.txt:1353) static member keywordDescriptionDownto() = (GetStringFunc("keywordDescriptionDownto",",,,") ) /// Used in conditional branching. A short form of else if. - /// (Originally from ../FSComp.txt:1354) + /// (Originally from ..\FSComp.txt:1354) static member keywordDescriptionElif() = (GetStringFunc("keywordDescriptionElif",",,,") ) /// Used in conditional branching. - /// (Originally from ../FSComp.txt:1355) + /// (Originally from ..\FSComp.txt:1355) static member keywordDescriptionElse() = (GetStringFunc("keywordDescriptionElse",",,,") ) /// In type definitions and type extensions, indicates the end of a section of member definitions. In verbose syntax, used to specify the end of a code block that starts with the begin keyword. - /// (Originally from ../FSComp.txt:1356) + /// (Originally from ..\FSComp.txt:1356) static member keywordDescriptionEnd() = (GetStringFunc("keywordDescriptionEnd",",,,") ) /// Used to declare an exception type. - /// (Originally from ../FSComp.txt:1357) + /// (Originally from ..\FSComp.txt:1357) static member keywordDescriptionException() = (GetStringFunc("keywordDescriptionException",",,,") ) /// Indicates that a declared program element is defined in another binary or assembly. - /// (Originally from ../FSComp.txt:1358) + /// (Originally from ..\FSComp.txt:1358) static member keywordDescriptionExtern() = (GetStringFunc("keywordDescriptionExtern",",,,") ) /// Used as a Boolean literal. - /// (Originally from ../FSComp.txt:1359) + /// (Originally from ..\FSComp.txt:1359) static member keywordDescriptionTrueFalse() = (GetStringFunc("keywordDescriptionTrueFalse",",,,") ) /// Used together with try to introduce a block of code that executes regardless of whether an exception occurs. - /// (Originally from ../FSComp.txt:1360) + /// (Originally from ..\FSComp.txt:1360) static member keywordDescriptionFinally() = (GetStringFunc("keywordDescriptionFinally",",,,") ) /// Used in looping constructs. - /// (Originally from ../FSComp.txt:1361) + /// (Originally from ..\FSComp.txt:1361) static member keywordDescriptionFor() = (GetStringFunc("keywordDescriptionFor",",,,") ) /// Used in lambda expressions, also known as anonymous functions. - /// (Originally from ../FSComp.txt:1362) + /// (Originally from ..\FSComp.txt:1362) static member keywordDescriptionFun() = (GetStringFunc("keywordDescriptionFun",",,,") ) /// Used as a shorter alternative to the fun keyword and a match expression in a lambda expression that has pattern matching on a single argument. - /// (Originally from ../FSComp.txt:1363) + /// (Originally from ..\FSComp.txt:1363) static member keywordDescriptionFunction() = (GetStringFunc("keywordDescriptionFunction",",,,") ) /// Used to reference the top-level .NET namespace. - /// (Originally from ../FSComp.txt:1364) + /// (Originally from ..\FSComp.txt:1364) static member keywordDescriptionGlobal() = (GetStringFunc("keywordDescriptionGlobal",",,,") ) /// Used in conditional branching constructs. - /// (Originally from ../FSComp.txt:1365) + /// (Originally from ..\FSComp.txt:1365) static member keywordDescriptionIf() = (GetStringFunc("keywordDescriptionIf",",,,") ) /// Used for sequence expressions and, in verbose syntax, to separate expressions from bindings. - /// (Originally from ../FSComp.txt:1366) + /// (Originally from ..\FSComp.txt:1366) static member keywordDescriptionIn() = (GetStringFunc("keywordDescriptionIn",",,,") ) /// Used to specify a base class or base interface. - /// (Originally from ../FSComp.txt:1367) + /// (Originally from ..\FSComp.txt:1367) static member keywordDescriptionInherit() = (GetStringFunc("keywordDescriptionInherit",",,,") ) /// Used to indicate a function that should be integrated directly into the caller's code. - /// (Originally from ../FSComp.txt:1368) + /// (Originally from ..\FSComp.txt:1368) static member keywordDescriptionInline() = (GetStringFunc("keywordDescriptionInline",",,,") ) /// Used to declare and implement interfaces. - /// (Originally from ../FSComp.txt:1369) + /// (Originally from ..\FSComp.txt:1369) static member keywordDescriptionInterface() = (GetStringFunc("keywordDescriptionInterface",",,,") ) /// Used to specify that a member is visible inside an assembly but not outside it. - /// (Originally from ../FSComp.txt:1370) + /// (Originally from ..\FSComp.txt:1370) static member keywordDescriptionInternal() = (GetStringFunc("keywordDescriptionInternal",",,,") ) /// Used to specify a computation that is to be performed only when a result is needed. - /// (Originally from ../FSComp.txt:1371) + /// (Originally from ..\FSComp.txt:1371) static member keywordDescriptionLazy() = (GetStringFunc("keywordDescriptionLazy",",,,") ) /// Used to associate, or bind, a name to a value or function. - /// (Originally from ../FSComp.txt:1372) + /// (Originally from ..\FSComp.txt:1372) static member keywordDescriptionLet() = (GetStringFunc("keywordDescriptionLet",",,,") ) /// Used in asynchronous workflows to bind a name to the result of an asynchronous computation, or, in other computation expressions, used to bind a name to a result, which is of the computation type. - /// (Originally from ../FSComp.txt:1373) + /// (Originally from ..\FSComp.txt:1373) static member keywordDescriptionLetBang() = (GetStringFunc("keywordDescriptionLetBang",",,,") ) /// Used to branch by comparing a value to a pattern. - /// (Originally from ../FSComp.txt:1374) + /// (Originally from ..\FSComp.txt:1374) static member keywordDescriptionMatch() = (GetStringFunc("keywordDescriptionMatch",",,,") ) /// Used in computation expressions to pattern match directly over the result of another computation expression. - /// (Originally from ../FSComp.txt:1375) + /// (Originally from ..\FSComp.txt:1375) static member keywordDescriptionMatchBang() = (GetStringFunc("keywordDescriptionMatchBang",",,,") ) /// Used to declare a property or method in an object type. - /// (Originally from ../FSComp.txt:1376) + /// (Originally from ..\FSComp.txt:1376) static member keywordDescriptionMember() = (GetStringFunc("keywordDescriptionMember",",,,") ) /// Used to associate a name with a group of related types, values, and functions, to logically separate it from other code. - /// (Originally from ../FSComp.txt:1377) + /// (Originally from ..\FSComp.txt:1377) static member keywordDescriptionModule() = (GetStringFunc("keywordDescriptionModule",",,,") ) /// Used to declare a variable, that is, a value that can be changed. - /// (Originally from ../FSComp.txt:1378) + /// (Originally from ..\FSComp.txt:1378) static member keywordDescriptionMutable() = (GetStringFunc("keywordDescriptionMutable",",,,") ) /// Used to associate a name with a group of related types and modules, to logically separate it from other code. - /// (Originally from ../FSComp.txt:1379) + /// (Originally from ..\FSComp.txt:1379) static member keywordDescriptionNamespace() = (GetStringFunc("keywordDescriptionNamespace",",,,") ) /// Used to declare, define, or invoke a constructor that creates or that can create an object. Also used in generic parameter constraints to indicate that a type must have a certain constructor. - /// (Originally from ../FSComp.txt:1380) + /// (Originally from ..\FSComp.txt:1380) static member keywordDescriptionNew() = (GetStringFunc("keywordDescriptionNew",",,,") ) /// Not actually a keyword. However, not struct in combination is used as a generic parameter constraint. - /// (Originally from ../FSComp.txt:1381) + /// (Originally from ..\FSComp.txt:1381) static member keywordDescriptionNot() = (GetStringFunc("keywordDescriptionNot",",,,") ) /// Indicates the absence of an object. Also used in generic parameter constraints. - /// (Originally from ../FSComp.txt:1382) + /// (Originally from ..\FSComp.txt:1382) static member keywordDescriptionNull() = (GetStringFunc("keywordDescriptionNull",",,,") ) /// Used in discriminated unions to indicate the type of categories of values, and in delegate and exception declarations. - /// (Originally from ../FSComp.txt:1383) + /// (Originally from ..\FSComp.txt:1383) static member keywordDescriptionOf() = (GetStringFunc("keywordDescriptionOf",",,,") ) /// Used to make the contents of a namespace or module available without qualification. - /// (Originally from ../FSComp.txt:1384) + /// (Originally from ..\FSComp.txt:1384) static member keywordDescriptionOpen() = (GetStringFunc("keywordDescriptionOpen",",,,") ) /// Used with Boolean conditions as a Boolean or operator. Equivalent to ||. Also used in member constraints. - /// (Originally from ../FSComp.txt:1385) + /// (Originally from ..\FSComp.txt:1385) static member keywordDescriptionOr() = (GetStringFunc("keywordDescriptionOr",",,,") ) /// Used to implement a version of an abstract or virtual method that differs from the base version. - /// (Originally from ../FSComp.txt:1386) + /// (Originally from ..\FSComp.txt:1386) static member keywordDescriptionOverride() = (GetStringFunc("keywordDescriptionOverride",",,,") ) /// Restricts access to a member to code in the same type or module. - /// (Originally from ../FSComp.txt:1387) + /// (Originally from ..\FSComp.txt:1387) static member keywordDescriptionPrivate() = (GetStringFunc("keywordDescriptionPrivate",",,,") ) /// Allows access to a member from outside the type. - /// (Originally from ../FSComp.txt:1388) + /// (Originally from ..\FSComp.txt:1388) static member keywordDescriptionPublic() = (GetStringFunc("keywordDescriptionPublic",",,,") ) /// Used to indicate that a function is recursive. - /// (Originally from ../FSComp.txt:1389) + /// (Originally from ..\FSComp.txt:1389) static member keywordDescriptionRec() = (GetStringFunc("keywordDescriptionRec",",,,") ) /// Used to indicate a value to provide as the result of a computation expression. - /// (Originally from ../FSComp.txt:1390) + /// (Originally from ..\FSComp.txt:1390) static member keywordDescriptionReturn() = (GetStringFunc("keywordDescriptionReturn",",,,") ) /// Used to indicate a computation expression that, when evaluated, provides the result of the containing computation expression. - /// (Originally from ../FSComp.txt:1391) + /// (Originally from ..\FSComp.txt:1391) static member keywordDescriptionReturnBang() = (GetStringFunc("keywordDescriptionReturnBang",",,,") ) /// Used in query expressions to specify what fields or columns to extract. Note that this is a contextual keyword, which means that it is not actually a reserved word and it only acts like a keyword in appropriate context. - /// (Originally from ../FSComp.txt:1392) + /// (Originally from ..\FSComp.txt:1392) static member keywordDescriptionSelect() = (GetStringFunc("keywordDescriptionSelect",",,,") ) /// Used to indicate a method or property that can be called without an instance of a type, or a value member that is shared among all instances of a type. - /// (Originally from ../FSComp.txt:1393) + /// (Originally from ..\FSComp.txt:1393) static member keywordDescriptionStatic() = (GetStringFunc("keywordDescriptionStatic",",,,") ) /// Used to declare a structure type. Also used in generic parameter constraints. Used for OCaml compatibility in module definitions. - /// (Originally from ../FSComp.txt:1394) + /// (Originally from ..\FSComp.txt:1394) static member keywordDescriptionStruct() = (GetStringFunc("keywordDescriptionStruct",",,,") ) /// Used in conditional expressions. Also used to perform side effects after object construction. - /// (Originally from ../FSComp.txt:1395) + /// (Originally from ..\FSComp.txt:1395) static member keywordDescriptionThen() = (GetStringFunc("keywordDescriptionThen",",,,") ) /// Used in for loops to indicate a range. - /// (Originally from ../FSComp.txt:1396) + /// (Originally from ..\FSComp.txt:1396) static member keywordDescriptionTo() = (GetStringFunc("keywordDescriptionTo",",,,") ) /// Used to introduce a block of code that might generate an exception. Used together with with or finally. - /// (Originally from ../FSComp.txt:1397) + /// (Originally from ..\FSComp.txt:1397) static member keywordDescriptionTry() = (GetStringFunc("keywordDescriptionTry",",,,") ) /// Used to declare a class, record, structure, discriminated union, enumeration type, unit of measure, or type abbreviation. - /// (Originally from ../FSComp.txt:1398) + /// (Originally from ..\FSComp.txt:1398) static member keywordDescriptionType() = (GetStringFunc("keywordDescriptionType",",,,") ) /// Used to convert to a type that is higher in the inheritance chain. - /// (Originally from ../FSComp.txt:1399) + /// (Originally from ..\FSComp.txt:1399) static member keywordDescriptionUpcast() = (GetStringFunc("keywordDescriptionUpcast",",,,") ) /// Used instead of let for values that require Dispose to be called to free resources. - /// (Originally from ../FSComp.txt:1400) + /// (Originally from ..\FSComp.txt:1400) static member keywordDescriptionUse() = (GetStringFunc("keywordDescriptionUse",",,,") ) /// Used instead of let! in asynchronous workflows and other computation expressions for values that require Dispose to be called to free resources. - /// (Originally from ../FSComp.txt:1401) + /// (Originally from ..\FSComp.txt:1401) static member keywordDescriptionUseBang() = (GetStringFunc("keywordDescriptionUseBang",",,,") ) /// Used in a signature to indicate a value, or in a type to declare a member, in limited situations. - /// (Originally from ../FSComp.txt:1402) + /// (Originally from ..\FSComp.txt:1402) static member keywordDescriptionVal() = (GetStringFunc("keywordDescriptionVal",",,,") ) /// Indicates the .NET void type. Used when interoperating with other .NET languages. - /// (Originally from ../FSComp.txt:1403) + /// (Originally from ..\FSComp.txt:1403) static member keywordDescriptionVoid() = (GetStringFunc("keywordDescriptionVoid",",,,") ) /// Used for Boolean conditions (when guards) on pattern matches and to introduce a constraint clause for a generic type parameter. - /// (Originally from ../FSComp.txt:1404) + /// (Originally from ..\FSComp.txt:1404) static member keywordDescriptionWhen() = (GetStringFunc("keywordDescriptionWhen",",,,") ) /// Introduces a looping construct. - /// (Originally from ../FSComp.txt:1405) + /// (Originally from ..\FSComp.txt:1405) static member keywordDescriptionWhile() = (GetStringFunc("keywordDescriptionWhile",",,,") ) /// Used together with the match keyword in pattern matching expressions. Also used in object expressions, record copying expressions, and type extensions to introduce member definitions, and to introduce exception handlers. - /// (Originally from ../FSComp.txt:1406) + /// (Originally from ..\FSComp.txt:1406) static member keywordDescriptionWith() = (GetStringFunc("keywordDescriptionWith",",,,") ) /// Used in a sequence expression to produce a value for a sequence. - /// (Originally from ../FSComp.txt:1407) + /// (Originally from ..\FSComp.txt:1407) static member keywordDescriptionYield() = (GetStringFunc("keywordDescriptionYield",",,,") ) /// Used in a computation expression to append the result of a given computation expression to a collection of results for the containing computation expression. - /// (Originally from ../FSComp.txt:1408) + /// (Originally from ..\FSComp.txt:1408) static member keywordDescriptionYieldBang() = (GetStringFunc("keywordDescriptionYieldBang",",,,") ) /// In function types, delimits arguments and return values. Yields an expression (in sequence expressions); equivalent to the yield keyword. Used in match expressions - /// (Originally from ../FSComp.txt:1409) + /// (Originally from ..\FSComp.txt:1409) static member keywordDescriptionRightArrow() = (GetStringFunc("keywordDescriptionRightArrow",",,,") ) /// Assigns a value to a variable. - /// (Originally from ../FSComp.txt:1410) + /// (Originally from ..\FSComp.txt:1410) static member keywordDescriptionLeftArrow() = (GetStringFunc("keywordDescriptionLeftArrow",",,,") ) /// Converts a type to type that is higher in the hierarchy. - /// (Originally from ../FSComp.txt:1411) + /// (Originally from ..\FSComp.txt:1411) static member keywordDescriptionCast() = (GetStringFunc("keywordDescriptionCast",",,,") ) /// Converts a type to a type that is lower in the hierarchy. - /// (Originally from ../FSComp.txt:1412) + /// (Originally from ..\FSComp.txt:1412) static member keywordDescriptionDynamicCast() = (GetStringFunc("keywordDescriptionDynamicCast",",,,") ) /// Delimits a typed code quotation. - /// (Originally from ../FSComp.txt:1413) + /// (Originally from ..\FSComp.txt:1413) static member keywordDescriptionTypedQuotation() = (GetStringFunc("keywordDescriptionTypedQuotation",",,,") ) /// Delimits a untyped code quotation. - /// (Originally from ../FSComp.txt:1414) + /// (Originally from ..\FSComp.txt:1414) static member keywordDescriptionUntypedQuotation() = (GetStringFunc("keywordDescriptionUntypedQuotation",",,,") ) /// %s '%s' not found in assembly '%s'. A possible cause may be a version incompatibility. You may need to explicitly reference the correct version of this assembly to allow all referenced components to use the correct version. - /// (Originally from ../FSComp.txt:1415) + /// (Originally from ..\FSComp.txt:1415) static member itemNotFoundDuringDynamicCodeGen(a0 : System.String, a1 : System.String, a2 : System.String) = (3216, GetStringFunc("itemNotFoundDuringDynamicCodeGen",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// %s '%s' not found in type '%s' from assembly '%s'. A possible cause may be a version incompatibility. You may need to explicitly reference the correct version of this assembly to allow all referenced components to use the correct version. - /// (Originally from ../FSComp.txt:1416) + /// (Originally from ..\FSComp.txt:1416) static member itemNotFoundInTypeDuringDynamicCodeGen(a0 : System.String, a1 : System.String, a2 : System.String, a3 : System.String) = (3216, GetStringFunc("itemNotFoundInTypeDuringDynamicCodeGen",",,,%s,,,%s,,,%s,,,%s,,,") a0 a1 a2 a3) /// is - /// (Originally from ../FSComp.txt:1417) + /// (Originally from ..\FSComp.txt:1417) static member descriptionWordIs() = (GetStringFunc("descriptionWordIs",",,,") ) /// This value is not a function and cannot be applied. - /// (Originally from ../FSComp.txt:1418) + /// (Originally from ..\FSComp.txt:1418) static member notAFunction() = (GetStringFunc("notAFunction",",,,") ) /// This value is not a function and cannot be applied. Did you intend to access the indexer via %s.[index] instead? - /// (Originally from ../FSComp.txt:1419) + /// (Originally from ..\FSComp.txt:1419) static member notAFunctionButMaybeIndexerWithName(a0 : System.String) = (GetStringFunc("notAFunctionButMaybeIndexerWithName",",,,%s,,,") a0) /// This expression is not a function and cannot be applied. Did you intend to access the indexer via expr.[index] instead? - /// (Originally from ../FSComp.txt:1420) + /// (Originally from ..\FSComp.txt:1420) static member notAFunctionButMaybeIndexer() = (GetStringFunc("notAFunctionButMaybeIndexer",",,,") ) /// - /// (Originally from ../FSComp.txt:1421) + /// (Originally from ..\FSComp.txt:1421) static member notAFunctionButMaybeIndexerErrorCode() = (3217, GetStringFunc("notAFunctionButMaybeIndexerErrorCode",",,,") ) /// This value is not a function and cannot be applied. Did you forget to terminate a declaration? - /// (Originally from ../FSComp.txt:1422) + /// (Originally from ..\FSComp.txt:1422) static member notAFunctionButMaybeDeclaration() = (GetStringFunc("notAFunctionButMaybeDeclaration",",,,") ) /// The argument names in the signature '%s' and implementation '%s' do not match. The argument name from the signature file will be used. This may cause problems when debugging or profiling. - /// (Originally from ../FSComp.txt:1423) + /// (Originally from ..\FSComp.txt:1423) static member ArgumentsInSigAndImplMismatch(a0 : System.String, a1 : System.String) = (3218, GetStringFunc("ArgumentsInSigAndImplMismatch",",,,%s,,,%s,,,") a0 a1) /// An error occurred while reading the F# metadata of assembly '%s'. A reserved construct was utilized. You may need to upgrade your F# compiler or use an earlier version of the assembly that doesn't make use of a specific construct. - /// (Originally from ../FSComp.txt:1424) + /// (Originally from ..\FSComp.txt:1424) static member pickleUnexpectedNonZero(a0 : System.String) = (3219, GetStringFunc("pickleUnexpectedNonZero",",,,%s,,,") a0) /// This method or property is not normally used from F# code, use an explicit tuple pattern for deconstruction instead. - /// (Originally from ../FSComp.txt:1425) + /// (Originally from ..\FSComp.txt:1425) static member tcTupleMemberNotNormallyUsed() = (3220, GetStringFunc("tcTupleMemberNotNormallyUsed",",,,") ) /// This expression returns a value of type '%s' but is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to use the expression as a value in the sequence then use an explicit 'yield'. - /// (Originally from ../FSComp.txt:1426) + /// (Originally from ..\FSComp.txt:1426) static member implicitlyDiscardedInSequenceExpression(a0 : System.String) = (3221, GetStringFunc("implicitlyDiscardedInSequenceExpression",",,,%s,,,") a0) /// This expression returns a value of type '%s' but is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to use the expression as a value in the sequence then use an explicit 'yield!'. - /// (Originally from ../FSComp.txt:1427) + /// (Originally from ..\FSComp.txt:1427) static member implicitlyDiscardedSequenceInSequenceExpression(a0 : System.String) = (3222, GetStringFunc("implicitlyDiscardedSequenceInSequenceExpression",",,,%s,,,") a0) /// The file '%s' changed on disk unexpectedly, please reload. - /// (Originally from ..\FSComp.txt:1427) + /// (Originally from ..\FSComp.txt:1428) static member ilreadFileChanged(a0 : System.String) = (3223, GetStringFunc("ilreadFileChanged",",,,%s,,,") a0) + /// The byref pointer is readonly, so this write is not permitted. + /// (Originally from ..\FSComp.txt:1429) + static member writeToReadOnlyByref() = (3224, GetStringFunc("writeToReadOnlyByref",",,,") ) + /// A ReadOnly attribute has been applied to a struct type with a mutable field. + /// (Originally from ..\FSComp.txt:1430) + static member readOnlyAttributeOnStructWithMutableField() = (3225, GetStringFunc("readOnlyAttributeOnStructWithMutableField",",,,") ) + /// A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + /// (Originally from ..\FSComp.txt:1431) + static member tcByrefReturnImplicitlyDereferenced() = (3226, GetStringFunc("tcByrefReturnImplicitlyDereferenced",",,,") ) + /// A type annotated with IsByRefLike must also be a struct. Consider adding the [] attribute to the type. + /// (Originally from ..\FSComp.txt:1432) + static member tcByRefLikeNotStruct() = (3227, GetStringFunc("tcByRefLikeNotStruct",",,,") ) + /// The address of the variable '%s' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. + /// (Originally from ..\FSComp.txt:1433) + static member chkNoByrefReturnOfLocal(a0 : System.String) = (3228, GetStringFunc("chkNoByrefReturnOfLocal",",,,%s,,,") a0) + /// The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + /// (Originally from ..\FSComp.txt:1434) + static member chkNoReturnOfLimitedSpan() = (3229, GetStringFunc("chkNoReturnOfLimitedSpan",",,,") ) + /// This value can't be assigned because the target '%s' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + /// (Originally from ..\FSComp.txt:1435) + static member chkNoWriteToLimitedSpan(a0 : System.String) = (3230, GetStringFunc("chkNoWriteToLimitedSpan",",,,%s,,,") a0) + /// A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + /// (Originally from ..\FSComp.txt:1436) + static member tastValueMustBeLocal() = (3231, GetStringFunc("tastValueMustBeLocal",",,,") ) + /// A type annotated with IsReadOnly must also be a struct. Consider adding the [] attribute to the type. + /// (Originally from ..\FSComp.txt:1437) + static member tcIsReadOnlyNotStruct() = (3232, GetStringFunc("tcIsReadOnlyNotStruct",",,,") ) + /// Struct members cannot return 'this' or fields by reference + /// (Originally from ..\FSComp.txt:1438) + static member chkStructsMayNotReturnAddressesOfContents() = (3234, GetStringFunc("chkStructsMayNotReturnAddressesOfContents",",,,") ) /// Call this method once to validate that all known resources are valid; throws if not static member RunStartupValidation() = @@ -5619,7 +5649,7 @@ type internal SR private() = ignore(GetString("CallerMemberNameIsOverriden")) ignore(GetString("tcFixedNotAllowed")) ignore(GetString("tcCouldNotFindOffsetToStringData")) - ignore(GetString("chkNoByrefReturnOfLocal")) + ignore(GetString("chkNoByrefAddressOfLocal")) ignore(GetString("tcNamedActivePattern")) ignore(GetString("DefaultParameterValueNotAppropriateForArgument")) ignore(GetString("tcGlobalsSystemTypeNotFound")) @@ -5714,4 +5744,14 @@ type internal SR private() = ignore(GetString("implicitlyDiscardedInSequenceExpression")) ignore(GetString("implicitlyDiscardedSequenceInSequenceExpression")) ignore(GetString("ilreadFileChanged")) + ignore(GetString("writeToReadOnlyByref")) + ignore(GetString("readOnlyAttributeOnStructWithMutableField")) + ignore(GetString("tcByrefReturnImplicitlyDereferenced")) + ignore(GetString("tcByRefLikeNotStruct")) + ignore(GetString("chkNoByrefReturnOfLocal")) + ignore(GetString("chkNoReturnOfLimitedSpan")) + ignore(GetString("chkNoWriteToLimitedSpan")) + ignore(GetString("tastValueMustBeLocal")) + ignore(GetString("tcIsReadOnlyNotStruct")) + ignore(GetString("chkStructsMayNotReturnAddressesOfContents")) () diff --git a/src/buildfromsource/FSharp.Compiler.Private/FSComp.resx b/src/buildfromsource/FSharp.Compiler.Private/FSComp.resx index 5870640845..2289e761c7 100644 --- a/src/buildfromsource/FSharp.Compiler.Private/FSComp.resx +++ b/src/buildfromsource/FSharp.Compiler.Private/FSComp.resx @@ -181,7 +181,7 @@ All branches of an 'if' expression must have the same type. This expression was expected to have type '{0}', but here has type '{1}'. - All branches of a pattern match expression must have the same type. This expression was expected to have type '{0}', but here has type '{1}'. + All branches of a pattern match expression must return values of the same type. The first branch returned a value of type '{0}', but this branch returned a value of type '{1}'. A pattern match guard must be of type 'bool', but this 'when' expression is of type '{0}'. @@ -4029,8 +4029,8 @@ Could not find method System.Runtime.CompilerServices.OffsetToStringData in references when building 'fixed' expression. - - The address of the variable '{0}' cannot be used at this point. A method or function may not return the address of this local value. + + The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. {0} is an active pattern and cannot be treated as a discriminated union case with named fields. @@ -4315,4 +4315,34 @@ The file '{0}' changed on disk unexpectedly, please reload. + + The byref pointer is readonly, so this write is not permitted. + + + A ReadOnly attribute has been applied to a struct type with a mutable field. + + + A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + + + A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + + + The address of the variable '{0}' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. + + + The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + + + This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + + + A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + + + A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + + + Struct members cannot return 'this' or fields by reference + \ No newline at end of file diff --git a/src/fsharp/AttributeChecking.fs b/src/fsharp/AttributeChecking.fs index d8bce9785d..6dffe80d6f 100644 --- a/src/fsharp/AttributeChecking.fs +++ b/src/fsharp/AttributeChecking.fs @@ -248,21 +248,21 @@ let MethInfoHasAttribute g m attribSpec minfo = /// Check IL attributes for 'ObsoleteAttribute', returning errors and warnings as data -let private CheckILAttributes (g: TcGlobals) cattrs m = - let (AttribInfo(tref, _)) = g.attrib_SystemObsolete +let private CheckILAttributes (g: TcGlobals) isByrefLikeTyconRef cattrs m = + let (AttribInfo(tref,_)) = g.attrib_SystemObsolete match TryDecodeILAttribute g tref cattrs with - | Some ([ILAttribElem.String (Some msg) ], _) -> + | Some ([ILAttribElem.String (Some msg) ], _) when not isByrefLikeTyconRef -> WarnD(ObsoleteWarning(msg, m)) - | Some ([ILAttribElem.String (Some msg); ILAttribElem.Bool isError ], _) -> + | Some ([ILAttribElem.String (Some msg); ILAttribElem.Bool isError ], _) when not isByrefLikeTyconRef -> if isError then ErrorD (ObsoleteError(msg, m)) else WarnD (ObsoleteWarning(msg, m)) - | Some ([ILAttribElem.String None ], _) -> + | Some ([ILAttribElem.String None ], _) when not isByrefLikeTyconRef -> WarnD(ObsoleteWarning("", m)) - | Some _ -> + | Some _ when not isByrefLikeTyconRef -> WarnD(ObsoleteWarning("", m)) - | None -> + | _ -> CompleteD /// Check F# attributes for 'ObsoleteAttribute', 'CompilerMessageAttribute' and 'ExperimentalAttribute', @@ -374,7 +374,7 @@ let CheckProvidedAttributesForUnseen (provAttribs: Tainted CheckILAttributes pinfo.TcGlobals pdef.CustomAttrs m + | ILProp(ILPropInfo(_, pdef)) -> CheckILAttributes pinfo.TcGlobals false pdef.CustomAttrs m | FSProp(g, _, Some vref, _) | FSProp(g, _, _, Some vref) -> CheckFSharpAttributes g vref.Attribs m | FSProp _ -> failwith "CheckPropInfoAttributes: unreachable" @@ -389,7 +389,7 @@ let CheckPropInfoAttributes pinfo m = let CheckILFieldAttributes g (finfo:ILFieldInfo) m = match finfo with | ILFieldInfo(_, pd) -> - CheckILAttributes g pd.CustomAttrs m |> CommitOperationResult + CheckILAttributes g false pd.CustomAttrs m |> CommitOperationResult #if !NO_EXTENSIONTYPING | ProvidedField (amap, fi, m) -> CheckProvidedAttributes amap.g m (fi.PApply((fun st -> (st :> IProvidedCustomAttributeProvider)), m)) |> CommitOperationResult @@ -399,7 +399,7 @@ let CheckILFieldAttributes g (finfo:ILFieldInfo) m = let CheckMethInfoAttributes g m tyargsOpt minfo = let search = BindMethInfoAttributes m minfo - (fun ilAttribs -> Some(CheckILAttributes g ilAttribs m)) + (fun ilAttribs -> Some(CheckILAttributes g false ilAttribs m)) (fun fsAttribs -> let res = CheckFSharpAttributes g fsAttribs m ++ (fun () -> @@ -481,7 +481,7 @@ let PropInfoIsUnseen m pinfo = /// Check the attributes on an entity, returning errors and warnings as data. let CheckEntityAttributes g (x:TyconRef) m = if x.IsILTycon then - CheckILAttributes g x.ILTyconRawMetadata.CustomAttrs m + CheckILAttributes g (isByrefLikeTyconRef g m x) x.ILTyconRawMetadata.CustomAttrs m else CheckFSharpAttributes g x.Attribs m diff --git a/src/fsharp/AugmentWithHashCompare.fs b/src/fsharp/AugmentWithHashCompare.fs index 7e914267bd..8654766526 100644 --- a/src/fsharp/AugmentWithHashCompare.fs +++ b/src/fsharp/AugmentWithHashCompare.fs @@ -44,14 +44,19 @@ let mkEqualsSlotSig (g: TcGlobals) = let mkThisTy g ty = if isStructTy g ty then mkByrefTy g ty else ty let mkCompareObjTy g ty = (mkThisTy g ty) --> (g.obj_ty --> g.int_ty) + let mkCompareTy g ty = (mkThisTy g ty) --> (ty --> g.int_ty) + let mkCompareWithComparerTy g ty = (mkThisTy g ty) --> ((mkRefTupledTy g [g.obj_ty ; g.IComparer_ty]) --> g.int_ty) let mkEqualsObjTy g ty = (mkThisTy g ty) --> (g.obj_ty --> g.bool_ty) + let mkEqualsTy g ty = (mkThisTy g ty) --> (ty --> g.bool_ty) + let mkEqualsWithComparerTy g ty = (mkThisTy g ty) --> ((mkRefTupledTy g [g.obj_ty ; g.IEqualityComparer_ty]) --> g.bool_ty) let mkHashTy g ty = (mkThisTy g ty) --> (g.unit_ty --> g.int_ty) + let mkHashWithComparerTy g ty = (mkThisTy g ty) --> (g.IEqualityComparer_ty --> g.int_ty) //------------------------------------------------------------------------- @@ -59,7 +64,9 @@ let mkHashWithComparerTy g ty = (mkThisTy g ty) --> (g.IEqualityComparer_ty --> //------------------------------------------------------------------------- let mkRelBinOp (g: TcGlobals) op m e1 e2 = mkAsmExpr ([ op ],[], [e1; e2],[g.bool_ty],m) + let mkClt g m e1 e2 = mkRelBinOp g IL.AI_clt m e1 e2 + let mkCgt g m e1 e2 = mkRelBinOp g IL.AI_cgt m e1 e2 //------------------------------------------------------------------------- @@ -84,7 +91,9 @@ let mkILCallGetEqualityComparer (g: TcGlobals) m = let mkThisVar g m ty = mkCompGenLocal m "this" (mkThisTy g ty) let mkShl g m acce n = mkAsmExpr([ IL.AI_shl ],[],[acce; mkInt g m n],[g.int_ty],m) + let mkShr g m acce n = mkAsmExpr([ IL.AI_shr ],[],[acce; mkInt g m n],[g.int_ty],m) + let mkAdd (g: TcGlobals) m e1 e2 = mkAsmExpr([ IL.AI_add ],[],[e1;e2],[g.int_ty],m) let mkAddToHashAcc g m e accv acce = @@ -101,6 +110,7 @@ let mkCombineHashGenerators g m exprs accv acce = //------------------------------------------------------------------------- let mkThatAddrLocal g m ty = mkCompGenLocal m "obj" (mkThisTy g ty) + let mkThatAddrLocalIfNeeded g m tcve ty = if isStructTy g ty then let thataddrv, thataddre = mkCompGenLocal m "obj" (mkThisTy g ty) @@ -115,13 +125,13 @@ let mkThisVarThatVar g m ty = let mkThatVarBind g m ty thataddrv expr = if isStructTy g ty then let thatv2,_ = mkMutableCompGenLocal m "obj" ty - thatv2,mkCompGenLet m thataddrv (mkValAddr m (mkLocalValRef thatv2)) expr + thatv2,mkCompGenLet m thataddrv (mkValAddr m false (mkLocalValRef thatv2)) expr else thataddrv,expr let mkBindThatAddr g m ty thataddrv thatv thate expr = if isStructTy g ty then // let thataddrv = &thatv - mkCompGenLet m thataddrv (mkValAddr m (mkLocalValRef thatv)) expr + mkCompGenLet m thataddrv (mkValAddr m false (mkLocalValRef thatv)) expr else // let thataddrv = that mkCompGenLet m thataddrv thate expr @@ -131,7 +141,7 @@ let mkBindThatAddrIfNeeded m thataddrvOpt thatv expr = | None -> expr | Some thataddrv -> // let thataddrv = &thatv - mkCompGenLet m thataddrv (mkValAddr m (mkLocalValRef thatv)) expr + mkCompGenLet m thataddrv (mkValAddr m false (mkLocalValRef thatv)) expr let mkDerefThis g m (thisv: Val) thise = if isByrefTy g thisv.Type then mkAddrGet m (mkLocalValRef thisv) @@ -506,7 +516,6 @@ let mkUnionEquality g tcref (tycon:Tycon) = let expr = if tycon.IsStructOrEnumTycon then expr else mkBindThatNullEquals g m thise thataddre expr thisv,thatv,expr - /// Build the equality implementation for a union type when parameterized by a comparer let mkUnionEqualityWithComparer g tcref (tycon:Tycon) (_thisv,thise) thatobje (thatv,thate) compe = let m = tycon.Range @@ -817,7 +826,7 @@ let TyconIsCandidateForAugmentationWithCompare (g: TcGlobals) (tycon:Tycon) = // This type gets defined in prim-types, before we can add attributes to F# type definitions let isUnit = g.compilingFslib && tycon.DisplayName = "Unit" not isUnit && - + not (TyconRefHasAttribute g tycon.Range g.attrib_IsByRefLikeAttribute (mkLocalTyconRef tycon)) && match getAugmentationAttribs g tycon with // [< >] | true, true, None, None, None, None , None, None, None @@ -832,6 +841,7 @@ let TyconIsCandidateForAugmentationWithEquals (g: TcGlobals) (tycon:Tycon) = // This type gets defined in prim-types, before we can add attributes to F# type definitions let isUnit = g.compilingFslib && tycon.DisplayName = "Unit" not isUnit && + not (TyconRefHasAttribute g tycon.Range g.attrib_IsByRefLikeAttribute (mkLocalTyconRef tycon)) && match getAugmentationAttribs g tycon with // [< >] diff --git a/src/fsharp/ConstraintSolver.fs b/src/fsharp/ConstraintSolver.fs index da17b107bb..1c22277bf4 100644 --- a/src/fsharp/ConstraintSolver.fs +++ b/src/fsharp/ConstraintSolver.fs @@ -80,6 +80,12 @@ let NewInferenceType () = mkTyparTy (NewTypar (TyparKind.Type, TyparRigidity.Fle let NewErrorType () = mkTyparTy (NewErrorTypar ()) let NewErrorMeasure () = Measure.Var (NewErrorMeasureVar ()) +let NewByRefKindInferenceType (g: TcGlobals) m = + let tp = NewTypar (TyparKind.Type, TyparRigidity.Flexible, Typar(compgenId, HeadTypeStaticReq, true), false, TyparDynamicReq.No, [], false, false) + if g.byrefkind_InOut_tcr.CanDeref then + tp.SetConstraints [TyparConstraint.DefaultsTo(10, TType_app(g.byrefkind_InOut_tcr, []), m)] + mkTyparTy tp + let NewInferenceTypes l = l |> List.map (fun _ -> NewInferenceType ()) // QUERY: should 'rigid' ever really be 'true'? We set this when we know @@ -891,6 +897,18 @@ and SolveTypSubsumesTyp (csenv:ConstraintSolverEnv) ndeep m2 (trace: OptionalTra | (TType_app (tc2, [ms]), _) when (tc2.IsMeasureableReprTycon && typeEquiv csenv.g sty2 (reduceTyconRefMeasureableOrProvided csenv.g tc2 [ms])) -> SolveTypEqualsTypKeepAbbrevsWithCxsln csenv ndeep m2 trace cxsln ms (TType_measure Measure.One) + // Special subsumption rule for byref tags + | TType_app (tc1, l1) , TType_app (tc2, l2) when tyconRefEq g tc1 tc2 && g.byref2_tcr.CanDeref && tyconRefEq g g.byref2_tcr tc1 -> + match l1, l2 with + | [ h1; tag1 ], [ h2; tag2 ] -> + SolveTypEqualsTyp csenv ndeep m2 trace None h1 h2 ++ (fun () -> + match stripTyEqnsA csenv.g canShortcut tag1, stripTyEqnsA csenv.g canShortcut tag2 with + | TType_app(tagc1, []), TType_app(tagc2, choices) + when (tyconRefEq g tagc2 g.choice2_tcr && + choices |> List.exists (function AppTy g (choicetc, []) -> tyconRefEq g tagc1 choicetc | _ -> false)) -> CompleteD + | _ -> SolveTypEqualsTyp csenv ndeep m2 trace cxsln tag1 tag2) + | _ -> SolveTypEqualsTypEqns csenv ndeep m2 trace cxsln l1 l2 + | TType_app (tc1, l1) , TType_app (tc2, l2) when tyconRefEq g tc1 tc2 -> SolveTypEqualsTypEqns csenv ndeep m2 trace cxsln l1 l2 @@ -1914,7 +1932,7 @@ and CanMemberSigsMatchUpToCheck if not (permitOptArgs || isNil unnamedCalledOptArgs) then ErrorD(Error(FSComp.SR.csOptionalArgumentNotPermittedHere(), m)) else - let calledObjArgTys = minfo.GetObjArgTypes(amap, m, minst) + let calledObjArgTys = calledMeth.CalledObjArgTys(m) // Check all the argument types. @@ -1932,7 +1950,7 @@ and CanMemberSigsMatchUpToCheck if isArray1DTy g calledArg.CalledArgumentType then let paramArrayElemTy = destArrayTy g calledArg.CalledArgumentType let reflArgInfo = calledArg.ReflArgInfo // propgate the reflected-arg info to each param array argument - calledMeth.ParamArrayCallerArgs |> OptionD (IterateD (fun callerArg -> subsumeArg (CalledArg((0, 0), false, NotOptional, NoCallerInfo, false, None, reflArgInfo, paramArrayElemTy)) callerArg)) + calledMeth.ParamArrayCallerArgs |> OptionD (IterateD (fun callerArg -> subsumeArg (CalledArg((0, 0), false, NotOptional, NoCallerInfo, false, false, None, reflArgInfo, paramArrayElemTy)) callerArg)) else CompleteD) @@ -1955,7 +1973,7 @@ and CanMemberSigsMatchUpToCheck let calledArgTy = rfinfo.FieldType rfinfo.Name, calledArgTy - subsumeArg (CalledArg((-1, 0), false, NotOptional, NoCallerInfo, false, Some (mkSynId m name), ReflectedArgInfo.None, calledArgTy)) caller) )) ++ (fun () -> + subsumeArg (CalledArg((-1, 0), false, NotOptional, NoCallerInfo, false, false, Some (mkSynId m name), ReflectedArgInfo.None, calledArgTy)) caller) )) ++ (fun () -> // - Always take the return type into account for // -- op_Explicit, op_Implicit @@ -1966,11 +1984,17 @@ and CanMemberSigsMatchUpToCheck | Some _ when minfo.IsConstructor -> CompleteD | Some _ when not alwaysCheckReturn && isNil unnamedCalledOutArgs -> CompleteD | Some reqdRetTy -> - let methodRetTy = calledMeth.ReturnTypeAfterOutArgTupling + let methodRetTy = calledMeth.CalledReturnTypeAfterOutArgTupling unifyTypes reqdRetTy methodRetTy ))))) // Assert a subtype constraint, and wrap an ErrorsFromAddingSubsumptionConstraint error around any failure // to allow us to report the outer types involved in the constraint +// +// ty1: expected +// ty2: actual +// +// "ty2 casts to ty1" +// "a value of type ty2 can be used where a value of type ty1 is expected" and private SolveTypSubsumesTypWithReport (csenv:ConstraintSolverEnv) ndeep m trace cxsln ty1 ty2 = TryD (fun () -> SolveTypSubsumesTypKeepAbbrevs csenv ndeep m trace cxsln ty1 ty2) (function @@ -1986,11 +2010,11 @@ and private SolveTypSubsumesTypWithReport (csenv:ConstraintSolverEnv) ndeep m tr // ty1: actual // ty2: expected -and private SolveTypEqualsTypWithReport (csenv:ConstraintSolverEnv) ndeep m trace cxsln ty1 ty2 = - TryD (fun () -> SolveTypEqualsTypKeepAbbrevsWithCxsln csenv ndeep m trace cxsln ty1 ty2) +and private SolveTypEqualsTypWithReport (csenv:ConstraintSolverEnv) ndeep m trace cxsln actual expected = + TryD (fun () -> SolveTypEqualsTypKeepAbbrevsWithCxsln csenv ndeep m trace cxsln actual expected) (function | LocallyAbortOperationThatFailsToResolveOverload -> CompleteD - | res -> ErrorD (ErrorFromAddingTypeEquation(csenv.g, csenv.DisplayEnv, ty1, ty2, res, m))) + | res -> ErrorD (ErrorFromAddingTypeEquation(csenv.g, csenv.DisplayEnv, actual, expected, res, m))) and ArgsMustSubsumeOrConvert (csenv:ConstraintSolverEnv) @@ -2289,15 +2313,21 @@ and ResolveOverloading let c = compareTypes calledArg1.CalledArgumentType calledArg2.CalledArgumentType if c <> 0 then c else - // Func<_> is always considered better than any other delegate type let c = (calledArg1.CalledArgumentType, calledArg2.CalledArgumentType) ||> compareCond (fun ty1 ty2 -> + + // Func<_> is always considered better than any other delegate type match tryDestAppTy csenv.g ty1 with - | Some tcref1 -> + | Some tcref1 when tcref1.DisplayName = "Func" && (match tcref1.PublicPath with Some p -> p.EnclosingPath = [| "System" |] | _ -> false) && isDelegateTy g ty1 && - isDelegateTy g ty2 + isDelegateTy g ty2 -> true + + // T is always better than inref + | _ when isInByrefTy csenv.g ty2 && typeEquiv csenv.g ty1 (destByrefTy csenv.g ty2) -> + true + | _ -> false) if c <> 0 then c else @@ -2451,8 +2481,11 @@ and ResolveOverloading | None -> CompleteD | Some _ when calledMeth.Method.IsConstructor -> CompleteD | Some reqdRetTy -> - let actualRetTy = calledMeth.ReturnTypeAfterOutArgTupling - MustUnify csenv ndeep trace cxsln reqdRetTy actualRetTy) + let actualRetTy = calledMeth.CalledReturnTypeAfterOutArgTupling + if isByrefTy g reqdRetTy then + ErrorD(Error(FSComp.SR.tcByrefReturnImplicitlyDereferenced(), m)) + else + MustUnify csenv ndeep trace cxsln reqdRetTy actualRetTy) | None -> None, errors @@ -2662,7 +2695,7 @@ let CodegenWitnessThatTypSupportsTraitConstraint tcVal g amap m (traitInfo:Trait // the address of the object then go do that if minfo.IsStruct && minfo.IsInstance && (match argExprs with [] -> false | h :: _ -> not (isByrefTy g (tyOfExpr g h))) then let h, t = List.headAndTail argExprs - let wrap, h' = mkExprAddrOfExpr g true false PossiblyMutates h None m + let wrap, h', _readonly = mkExprAddrOfExpr g true false PossiblyMutates h None m ResultD (Some (wrap (Expr.Op(TOp.TraitCall(traitInfo), [], (h' :: t), m)))) else ResultD (Some (MakeMethInfoCall amap m minfo methArgTys argExprs )) @@ -2677,7 +2710,7 @@ let CodegenWitnessThatTypSupportsTraitConstraint tcVal g amap m (traitInfo:Trait // the address of the object then go do that if rfref.Tycon.IsStructOrEnumTycon && not (isByrefTy g (tyOfExpr g argExprs.[0])) then let h = List.head argExprs - let wrap, h' = mkExprAddrOfExpr g true false DefinitelyMutates h None m + let wrap, h', _readonly = mkExprAddrOfExpr g true false DefinitelyMutates h None m Some (wrap (mkRecdFieldSetViaExprAddr (h', rfref, tinst, argExprs.[1], m))) else Some (mkRecdFieldSetViaExprAddr (argExprs.[0], rfref, tinst, argExprs.[1], m)) diff --git a/src/fsharp/ConstraintSolver.fsi b/src/fsharp/ConstraintSolver.fsi index b483c00fb0..a6054be1bd 100644 --- a/src/fsharp/ConstraintSolver.fsi +++ b/src/fsharp/ConstraintSolver.fsi @@ -22,6 +22,9 @@ val NewAnonTypar : TyparKind * range * TyparRigidity * TyparStaticReq * TyparDyn /// Create an inference type variable val NewInferenceType : unit -> TType +/// Create an inference type variable for the kind of a byref pointer +val NewByRefKindInferenceType : TcGlobals -> range -> TType + /// Create an inference type variable representing an error condition when checking an expression val NewErrorType : unit -> TType diff --git a/src/fsharp/DetupleArgs.fs b/src/fsharp/DetupleArgs.fs index ffaa45805f..2dfc01e1cc 100644 --- a/src/fsharp/DetupleArgs.fs +++ b/src/fsharp/DetupleArgs.fs @@ -584,10 +584,10 @@ let decideTransform g z v callPatterns (m, tps, vss:Val list list, rty) = // Public f could be used beyond assembly. // For now, suppressing any transforms on these. // Later, could transform f and fix up local calls and provide an f wrapper for beyond. -let eligibleVal g (v:Val) = +let eligibleVal g m (v:Val) = let dllImportStubOrOtherNeverInline = (v.InlineInfo = ValInline.Never) let mutableVal = v.IsMutable - let byrefVal = isByrefLikeTy g v.Type + let byrefVal = isByrefLikeTy g m v.Type not dllImportStubOrOtherNeverInline && not byrefVal && not mutableVal && @@ -595,8 +595,8 @@ let eligibleVal g (v:Val) = not v.IsCompiledAsTopLevel let determineTransforms g (z : GlobalUsageAnalysis.Results) = - let selectTransform f sites = - if not (eligibleVal g f) then None else + let selectTransform (f: Val) sites = + if not (eligibleVal g f.Range f) then None else // Consider f, if it has top-level lambda (meaning has term args) match Zmap.tryFind f z.Defns with | None -> None // no binding site, so no transform diff --git a/src/fsharp/FSComp.txt b/src/fsharp/FSComp.txt index 3fd40988d7..76a75e7555 100644 --- a/src/fsharp/FSComp.txt +++ b/src/fsharp/FSComp.txt @@ -1331,7 +1331,7 @@ tcTupleStructMismatch,"One tuple type is a struct tuple, the other is a referenc 3206,CallerMemberNameIsOverriden,"The CallerMemberNameAttribute applied to parameter '%s' will have no effect. It is overridden by the CallerFilePathAttribute." 3207,tcFixedNotAllowed,"Invalid use of 'fixed'. 'fixed' may only be used in a declaration of the form 'use x = fixed expr' where the expression is an array, the address of a field, the address of an array element or a string'" 3208,tcCouldNotFindOffsetToStringData,"Could not find method System.Runtime.CompilerServices.OffsetToStringData in references when building 'fixed' expression." -3209,chkNoByrefReturnOfLocal,"The address of the variable '%s' cannot be used at this point. A method or function may not return the address of this local value." +3209,chkNoByrefAddressOfLocal,"The address of the variable '%s' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope." 3210,tcNamedActivePattern,"%s is an active pattern and cannot be treated as a discriminated union case with named fields." 3211,DefaultParameterValueNotAppropriateForArgument,"The default value does not have the same type as the argument. The DefaultParameterValue attribute and any Optional attribute will be ignored. Note: 'null' needs to be annotated with the correct type, e.g. 'DefaultParameterValue(null:obj)'." tcGlobalsSystemTypeNotFound,"The system type '%s' was required but no referenced system DLL contained this type" @@ -1425,4 +1425,14 @@ notAFunctionButMaybeDeclaration,"This value is not a function and cannot be appl 3220,tcTupleMemberNotNormallyUsed,"This method or property is not normally used from F# code, use an explicit tuple pattern for deconstruction instead." 3221,implicitlyDiscardedInSequenceExpression,"This expression returns a value of type '%s' but is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to use the expression as a value in the sequence then use an explicit 'yield'." 3222,implicitlyDiscardedSequenceInSequenceExpression,"This expression returns a value of type '%s' but is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to use the expression as a value in the sequence then use an explicit 'yield!'." -3223,ilreadFileChanged,"The file '%s' changed on disk unexpectedly, please reload." \ No newline at end of file +3223,ilreadFileChanged,"The file '%s' changed on disk unexpectedly, please reload." +3224,writeToReadOnlyByref,"The byref pointer is readonly, so this write is not permitted." +3225,readOnlyAttributeOnStructWithMutableField,"A ReadOnly attribute has been applied to a struct type with a mutable field." +3226,tcByrefReturnImplicitlyDereferenced,"A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'." +3227,tcByRefLikeNotStruct,"A type annotated with IsByRefLike must also be a struct. Consider adding the [] attribute to the type." +3228,chkNoByrefReturnOfLocal,"The address of the variable '%s' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope." +3229,chkNoReturnOfLimitedSpan,"The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope." +3230,chkNoWriteToLimitedSpan,"This value can't be assigned because the target '%s' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope." +3231,tastValueMustBeLocal,"A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...'" +3232,tcIsReadOnlyNotStruct,"A type annotated with IsReadOnly must also be a struct. Consider adding the [] attribute to the type." +3234,chkStructsMayNotReturnAddressesOfContents,"Struct members cannot return the address of fields of the struct by reference" diff --git a/src/fsharp/FSharp.Core/nativeptr.fs b/src/fsharp/FSharp.Core/nativeptr.fs index 29e2ecb67a..db9f81bf8a 100644 --- a/src/fsharp/FSharp.Core/nativeptr.fs +++ b/src/fsharp/FSharp.Core/nativeptr.fs @@ -25,6 +25,14 @@ module NativePtr = [] let inline toNativeInt (address: nativeptr<'T>) = (# "" address : nativeint #) + [] + [] + let inline toVoidPtr (address: nativeptr<'T>) = (# "" address : voidptr #) + + [] + [] + let inline ofVoidPtr (address: voidptr) = (# "" address : nativeptr<'T> #) + [] [] let inline add (address : nativeptr<'T>) (index:int) : nativeptr<'T> = toNativeInt address + nativeint index * (# "sizeof !0" type('T) : nativeint #) |> ofNativeInt diff --git a/src/fsharp/FSharp.Core/nativeptr.fsi b/src/fsharp/FSharp.Core/nativeptr.fsi index 47a0509e71..db6a6d9e2f 100644 --- a/src/fsharp/FSharp.Core/nativeptr.fsi +++ b/src/fsharp/FSharp.Core/nativeptr.fsi @@ -19,6 +19,22 @@ namespace Microsoft.FSharp.NativeInterop /// A typed pointer. val inline ofNativeInt : address:nativeint -> nativeptr<'T> + [] + [] + [] + /// Returns an untyped native pointer for a given typed pointer. + /// The pointer address. + /// A typed pointer. + val inline toVoidPtr : address:nativeptr<'T> -> voidptr + + [] + [] + [] + /// Returns a typed native pointer for a untyped native pointer. + /// The untyped pointer. + /// A typed pointer. + val inline ofVoidPtr : voidptr -> nativeptr<'T> + [] [] [] diff --git a/src/fsharp/FSharp.Core/prim-types-prelude.fs b/src/fsharp/FSharp.Core/prim-types-prelude.fs index f06eb19b96..4a04797d3d 100644 --- a/src/fsharp/FSharp.Core/prim-types-prelude.fs +++ b/src/fsharp/FSharp.Core/prim-types-prelude.fs @@ -64,8 +64,14 @@ namespace Microsoft.FSharp.Core type array<'T> = 'T[] + /// Represents a managed pointer in F# code. + type byref<'T, 'Kind> = (# "!0&" #) + + /// Represents a managed pointer in F# code. For F# 4.5+ this is considered equivalent to byref<'T, ByRefKinds.InOut> type byref<'T> = (# "!0&" #) type nativeptr<'T when 'T : unmanaged> = (# "native int" #) - type ilsigptr<'T> = (# "!0*" #) + type voidptr = (# "void*" #) + + type ilsigptr<'T> = (# "!0*" #) diff --git a/src/fsharp/FSharp.Core/prim-types-prelude.fsi b/src/fsharp/FSharp.Core/prim-types-prelude.fsi index a8c3c589d7..dccc3db6d4 100644 --- a/src/fsharp/FSharp.Core/prim-types-prelude.fsi +++ b/src/fsharp/FSharp.Core/prim-types-prelude.fsi @@ -228,8 +228,10 @@ namespace Microsoft.FSharp.Core /// values. type 'T array = 'T[] - /// Represents a managed pointer in F# code. + type byref<'T, 'Kind> = (# "!0&" #) + + /// Represents a managed pointer in F# code. For F# 4.5+ this is considered equivalent to byref<'T, ByRefKinds.InOut> type byref<'T> = (# "!0&" #) /// Represents an unmanaged pointer in F# code. @@ -241,6 +243,15 @@ namespace Microsoft.FSharp.Core /// by the functions in the NativeInterop.NativePtr module. type nativeptr<'T when 'T : unmanaged> = (# "native int" #) + /// Represents an untyped unmanaged pointer in F# code. + /// + /// This type should only be used when writing F# code that interoperates + /// with native code. Use of this type in F# code may result in + /// unverifiable code being generated. Conversions to and from the + /// nativeint type may be required. Values of this type can be generated + /// by the functions in the NativeInterop.NativePtr module. + type voidptr = (# "void*" #) + /// This type is for internal use by the F# code generator. type ilsigptr<'T> = (# "!0*" #) diff --git a/src/fsharp/FSharp.Core/prim-types.fs b/src/fsharp/FSharp.Core/prim-types.fs index 43d592c4d9..b9cbea4a39 100644 --- a/src/fsharp/FSharp.Core/prim-types.fs +++ b/src/fsharp/FSharp.Core/prim-types.fs @@ -2162,6 +2162,7 @@ namespace Microsoft.FSharp.Core let FloatComparer = MakeGenericComparer() let Float32Comparer = MakeGenericComparer() let DecimalComparer = MakeGenericComparer() + let BoolComparer = MakeGenericComparer() /// Use a type-indexed table to ensure we only create a single FastStructuralComparison function /// for each type @@ -2199,6 +2200,7 @@ namespace Microsoft.FSharp.Core | ty when ty.Equals(typeof) -> null | ty when ty.Equals(typeof) -> null | ty when ty.Equals(typeof) -> unboxPrim (box StringComparer) + | ty when ty.Equals(typeof) -> null | _ -> MakeGenericComparer<'T>() static let f : System.Collections.Generic.IComparer<'T> = @@ -2218,6 +2220,7 @@ namespace Microsoft.FSharp.Core | ty when ty.Equals(typeof) -> unboxPrim (box Float32Comparer) | ty when ty.Equals(typeof) -> unboxPrim (box DecimalComparer) | ty when ty.Equals(typeof) -> unboxPrim (box StringComparer) + | ty when ty.Equals(typeof) -> unboxPrim (box BoolComparer) | _ -> // Review: There are situations where we should be able // to return System.Collections.Generic.Comparer<'T>.Default here. @@ -5690,6 +5693,24 @@ namespace Microsoft.FSharp.Core if n >= 0 then PowDecimal x n else 1.0M / PowDecimal x n) + /// Represents the types of byrefs in F# 4.5+ + module ByRefKinds = + + /// Represents a byref that can be written + type Out() = class end + + /// Represents a byref that can be read + type In() = class end + + /// Represents a byref that can be both read and written + type InOut = Choice + + /// Represents a in-argument or readonly managed pointer in F# code. This type should only be used with F# 4.5+. + type inref<'T> = byref<'T, ByRefKinds.In> + + /// Represents a out-argument managed pointer in F# code. This type should only be used with F# 4.5+. + type outref<'T> = byref<'T, ByRefKinds.Out> + namespace Microsoft.FSharp.Control open System diff --git a/src/fsharp/FSharp.Core/prim-types.fsi b/src/fsharp/FSharp.Core/prim-types.fsi index 97202c3601..32f4f85e1f 100644 --- a/src/fsharp/FSharp.Core/prim-types.fsi +++ b/src/fsharp/FSharp.Core/prim-types.fsi @@ -1723,6 +1723,24 @@ namespace Microsoft.FSharp.Core /// The optimized function. new : unit -> FSharpFunc<'T1,'T2,'T3,'T4,'T5,'U> + /// Represents the types of byrefs in F# 4.5+ + module ByRefKinds = + + /// Represents a byref that can be written + type Out = class end + + /// Represents a byref that can be read + type In = class end + + /// Represents a byref that can be both read and written + type InOut = Choice + + /// Represents a in-argument or readonly managed pointer in F# code. This type should only be used with F# 4.5+. + type inref<'T> = byref<'T, ByRefKinds.In> + + /// Represents a out-argument managed pointer in F# code. This type should only be used with F# 4.5+. + type outref<'T> = byref<'T, ByRefKinds.Out> + /// The type of mutable references. Use the functions [!] and [:=] to get and /// set values of this type. [] @@ -3259,6 +3277,7 @@ namespace Microsoft.FSharp.Core [] val inline char : value:^T -> char when ^T : (static member op_Explicit : ^T -> char) and default ^T : int + namespace Microsoft.FSharp.Control open Microsoft.FSharp.Core diff --git a/src/fsharp/IlxGen.fs b/src/fsharp/IlxGen.fs index 9d5c5d33c1..899b123b59 100644 --- a/src/fsharp/IlxGen.fs +++ b/src/fsharp/IlxGen.fs @@ -363,14 +363,30 @@ let voidCheck m g permits ty = error(InternalError("System.Void unexpectedly detected in IL code generation. This should not occur.",m)) #endif -// When generating parameter and return types generate precise .NET IL pointer types -// These can't be generated for generic instantiations, since .NET generics doesn't -// permit this. But for 'naked' values (locals, parameters, return values etc.) machine -// integer values and native pointer values are compatible (though the code is unverifiable). +/// When generating parameter and return types generate precise .NET IL pointer types. +/// These can't be generated for generic instantiations, since .NET generics doesn't +/// permit this. But for 'naked' values (locals, parameters, return values etc.) machine +/// integer values and native pointer values are compatible (though the code is unverifiable). type PtrsOK = | PtrTypesOK | PtrTypesNotOK +let GenReadOnlyAttributeIfNecessary (g: TcGlobals) ty = + let add = isInByrefTy g ty && g.attrib_IsReadOnlyAttribute.TyconRef.CanDeref + if add then + let attr = mkILCustomAttribute g.ilg (g.attrib_IsReadOnlyAttribute.TypeRef, [], [], []) + Some attr + else + None + +/// Generate "modreq([mscorlib]System.Runtime.InteropServices.InAttribute)" on inref types. +let GenReadOnlyModReqIfNecessary (g: TcGlobals) ty ilTy = + let add = isInByrefTy g ty && g.attrib_InAttribute.TyconRef.CanDeref + if add then + ILType.Modified(true, g.attrib_InAttribute.TypeRef, ilTy) + else + ilTy + let rec GenTypeArgAux amap m tyenv tyarg = GenTypeAux amap m tyenv VoidNotOK PtrTypesNotOK tyarg @@ -395,6 +411,7 @@ and GenTyAppAux amap m tyenv repr tinst = and GenNamedTyAppAux (amap:ImportMap) m tyenv ptrsOK tcref tinst = let g = amap.g let tinst = DropErasedTyargs tinst + // See above note on ptrsOK if ptrsOK = PtrTypesOK && tyconRefEq g tcref g.nativeptr_tcr && (freeInTypes CollectTypars tinst).FreeTypars.IsEmpty then GenNamedTyAppAux amap m tyenv ptrsOK g.ilsigptr_tcr tinst @@ -417,7 +434,10 @@ and GenTypeAux amap m (tyenv: TypeReprEnv) voidOK ptrsOK ty = #endif match stripTyEqnsAndMeasureEqns g ty with | TType_app (tcref, tinst) -> GenNamedTyAppAux amap m tyenv ptrsOK tcref tinst + + | TType_tuple (tupInfo, args) -> GenTypeAux amap m tyenv VoidNotOK ptrsOK (mkCompiledTupleTy g (evalTupInfoIsStruct tupInfo) args) + | TType_fun (dty, returnTy) -> EraseClosures.mkILFuncTy g.ilxPubCloEnv (GenTypeArgAux amap m tyenv dty) (GenTypeArgAux amap m tyenv returnTy) | TType_ucase (ucref, args) -> @@ -428,7 +448,9 @@ and GenTypeAux amap m (tyenv: TypeReprEnv) voidOK ptrsOK ty = let tps = DropErasedTypars tps if tps.IsEmpty then GenTypeAux amap m tyenv VoidNotOK ptrsOK tau else EraseClosures.mkILTyFuncTy g.ilxPubCloEnv + | TType_var tp -> mkILTyvarTy tyenv.[tp,m] + | TType_measure _ -> g.ilg.typ_Int32 //-------------------------------------------------------------------------- @@ -504,13 +526,19 @@ and GenNamedTyApp amap m tyenv tcref tinst = GenNamedTyAppAux amap m tyenv PtrTy and GenReturnType amap m tyenv returnTyOpt = match returnTyOpt with | None -> ILType.Void - | Some returnTy -> GenTypeAux amap m tyenv VoidNotOK(*1*) PtrTypesOK returnTy (*1: generate void from unit, but not accept void *) - -and GenParamType amap m tyenv ty = - ty |> GenTypeAux amap m tyenv VoidNotOK PtrTypesOK + | Some returnTy -> + let ilTy = GenTypeAux amap m tyenv VoidNotOK(*1*) PtrTypesOK returnTy (*1: generate void from unit, but not accept void *) + GenReadOnlyModReqIfNecessary amap.g returnTy ilTy + +and GenParamType amap m tyenv isSlotSig ty = + let ilTy = GenTypeAux amap m tyenv VoidNotOK PtrTypesOK ty + if isSlotSig then + GenReadOnlyModReqIfNecessary amap.g ty ilTy + else + ilTy -and GenParamTypes amap m tyenv tys = - tys |> List.map (GenTypeAux amap m tyenv VoidNotOK PtrTypesOK) +and GenParamTypes amap m tyenv isSlotSig tys = + tys |> List.map (GenParamType amap m tyenv isSlotSig) and GenTypeArgs amap m tyenv tyargs = GenTypeArgsAux amap m tyenv tyargs @@ -607,7 +635,7 @@ type ValStorage = | StaticProperty of ILMethodSpec * OptionalShadowLocal /// Indicates the value is "stored" as a IL static method (in a "main" class for a F# /// compilation unit, or as a member) according to its inferred or specified arity. - | Method of ValReprInfo * ValRef * ILMethodSpec * Range.range * ArgReprInfo list * ArgReprInfo + | Method of ValReprInfo * ValRef * ILMethodSpec * Range.range * ArgReprInfo list * TType list * ArgReprInfo /// Indicates the value is stored at the given position in the closure environment accessed via "ldarg 0" | Env of ILType * int * ILFieldSpec * NamedLocalIlxClosureInfo ref option /// Indicates that the value is an argument of a method being generated @@ -775,7 +803,9 @@ let GetMethodSpecForMemberVal amap g (memberInfo:ValMemberInfo) (vref:ValRef) = let ilActualRetTy = let ilRetTy = GenReturnType amap m tyenvUnderTypars returnTy if isCtor || cctor then ILType.Void else ilRetTy + let ilTy = GenType amap m tyenvUnderTypars (mkAppTy parentTcref (List.map mkTyparTy ctps)) + if isCompiledAsInstance || isCtor then // Find the 'this' argument type if any let thisTy,flatArgInfos = @@ -797,18 +827,19 @@ let GetMethodSpecForMemberVal amap g (memberInfo:ValMemberInfo) (vref:ValRef) = ctps thisArgTys let methodArgTys,paramInfos = List.unzip flatArgInfos - let ilMethodArgTys = GenParamTypes amap m tyenvUnderTypars methodArgTys + let isSlotSig = memberInfo.MemberFlags.IsDispatchSlot || memberInfo.MemberFlags.IsOverrideOrExplicitImpl + let ilMethodArgTys = GenParamTypes amap m tyenvUnderTypars isSlotSig methodArgTys let ilMethodInst = GenTypeArgs amap m tyenvUnderTypars (List.map mkTyparTy mtps) let mspec = mkILInstanceMethSpecInTy (ilTy,vref.CompiledName,ilMethodArgTys,ilActualRetTy,ilMethodInst) - mspec,ctps,mtps,paramInfos,retInfo + mspec,ctps,mtps,paramInfos,retInfo,methodArgTys else let methodArgTys,paramInfos = List.unzip flatArgInfos - let ilMethodArgTys = GenParamTypes amap m tyenvUnderTypars methodArgTys + let ilMethodArgTys = GenParamTypes amap m tyenvUnderTypars false methodArgTys let ilMethodInst = GenTypeArgs amap m tyenvUnderTypars (List.map mkTyparTy mtps) let mspec = mkILStaticMethSpecInTy (ilTy,vref.CompiledName,ilMethodArgTys,ilActualRetTy,ilMethodInst) - mspec,ctps,mtps,paramInfos,retInfo + mspec,ctps,mtps,paramInfos,retInfo,methodArgTys // Generate the ILFieldSpec for a top-level value @@ -894,18 +925,18 @@ let ComputeStorageForTopVal (amap, g, optIntraAssemblyInfo:IlxGenIntraAssemblyIn | _ -> match vref.MemberInfo with | Some memberInfo when not vref.IsExtensionMember -> - let mspec,_,_,paramInfos,retInfo = GetMethodSpecForMemberVal amap g memberInfo vref - Method (topValInfo, vref, mspec, m, paramInfos, retInfo) + let mspec,_,_,paramInfos,retInfo,methodArgTys = GetMethodSpecForMemberVal amap g memberInfo vref + Method (topValInfo, vref, mspec, m, paramInfos, methodArgTys, retInfo) | _ -> let (tps, curriedArgInfos, returnTy, retInfo) = GetTopValTypeInCompiledForm g topValInfo vref.Type m let tyenvUnderTypars = TypeReprEnv.ForTypars tps let (methodArgTys,paramInfos) = curriedArgInfos |> List.concat |> List.unzip - let ilMethodArgTys = GenParamTypes amap m tyenvUnderTypars methodArgTys + let ilMethodArgTys = GenParamTypes amap m tyenvUnderTypars false methodArgTys let ilRetTy = GenReturnType amap m tyenvUnderTypars returnTy let ilLocTy = mkILTyForCompLoc cloc let ilMethodInst = GenTypeArgs amap m tyenvUnderTypars (List.map mkTyparTy tps) let mspec = mkILStaticMethSpecInTy (ilLocTy, nm, ilMethodArgTys, ilRetTy, ilMethodInst) - Method (topValInfo, vref, mspec, m, paramInfos, retInfo) + Method (topValInfo, vref, mspec, m, paramInfos, methodArgTys, retInfo) let ComputeAndAddStorageForLocalTopVal (amap, g, intraAssemblyFieldTable, isInteractive, optShadowLocal) cloc (v:Val) eenv = let storage = ComputeStorageForTopVal (amap, g, Some intraAssemblyFieldTable, isInteractive, optShadowLocal, mkLocalValRef v, cloc) @@ -1881,7 +1912,7 @@ let rec GenExpr (cenv:cenv) (cgbuf:CodeGenBuffer) eenv sp expr sequel = GenGetExnField cenv cgbuf eenv (e,ecref,n,m) sequel | TOp.UnionCaseFieldGet(ucref,n),[e],_ -> GenGetUnionCaseField cenv cgbuf eenv (e,ucref,tyargs,n,m) sequel - | TOp.UnionCaseFieldGetAddr(ucref,n),[e],_ -> + | TOp.UnionCaseFieldGetAddr(ucref,n,_readonly),[e],_ -> GenGetUnionCaseFieldAddr cenv cgbuf eenv (e,ucref,tyargs,n,m) sequel | TOp.UnionCaseTagGet ucref,[e],_ -> GenGetUnionCaseTag cenv cgbuf eenv (e,ucref,tyargs,m) sequel @@ -1895,9 +1926,9 @@ let rec GenExpr (cenv:cenv) (cgbuf:CodeGenBuffer) eenv sp expr sequel = GenGetRecdField cenv cgbuf eenv (e,f,tyargs,m) sequel | TOp.ValFieldGet f,[],_ -> GenGetStaticField cenv cgbuf eenv (f,tyargs,m) sequel - | TOp.ValFieldGetAddr f,[e],_ -> + | TOp.ValFieldGetAddr (f, _readonly),[e],_ -> GenGetRecdFieldAddr cenv cgbuf eenv (e,f,tyargs,m) sequel - | TOp.ValFieldGetAddr f,[],_ -> + | TOp.ValFieldGetAddr (f, _readonly),[],_ -> GenGetStaticFieldAddr cenv cgbuf eenv (f,tyargs,m) sequel | TOp.ValFieldSet f,[e1;e2],_ -> GenSetRecdField cenv cgbuf eenv (e1,f,tyargs,e2,m) sequel @@ -1917,14 +1948,14 @@ let rec GenExpr (cenv:cenv) (cgbuf:CodeGenBuffer) eenv sp expr sequel = GenTryCatch cenv cgbuf eenv (e1,vf,ef,vh,eh,m,resty,spTry,spWith) sequel | TOp.ILCall(virt,_,valu,newobj,valUseFlags,_,isDllImport,ilMethRef,enclArgTys,methArgTys,returnTys),args,[] -> GenILCall cenv cgbuf eenv (virt,valu,newobj,valUseFlags,isDllImport,ilMethRef,enclArgTys,methArgTys,args,returnTys,m) sequel - | TOp.RefAddrGet,[e],[ty] -> GenGetAddrOfRefCellField cenv cgbuf eenv (e,ty,m) sequel + | TOp.RefAddrGet _readonly,[e],[ty] -> GenGetAddrOfRefCellField cenv cgbuf eenv (e,ty,m) sequel | TOp.Coerce,[e],[tgty;srcty] -> GenCoerce cenv cgbuf eenv (e,tgty,m,srcty) sequel | TOp.Reraise,[],[rtnty] -> GenReraise cenv cgbuf eenv (rtnty,m) sequel | TOp.TraitCall(ss),args,[] -> GenTraitCall cenv cgbuf eenv (ss,args, m) expr sequel | TOp.LValueOp(LSet,v),[e],[] -> GenSetVal cenv cgbuf eenv (v,e,m) sequel | TOp.LValueOp(LByrefGet,v),[],[] -> GenGetByref cenv cgbuf eenv (v,m) sequel | TOp.LValueOp(LByrefSet,v),[e],[] -> GenSetByref cenv cgbuf eenv (v,e,m) sequel - | TOp.LValueOp(LGetAddr,v),[],[] -> GenGetValAddr cenv cgbuf eenv (v,m) sequel + | TOp.LValueOp(LAddrOf _,v),[],[] -> GenGetValAddr cenv cgbuf eenv (v,m) sequel | TOp.Array,elems,[elemTy] -> GenNewArray cenv cgbuf eenv (elems,elemTy,m) sequel | TOp.Bytes bytes,[],[] -> if cenv.opts.emitConstantArraysUsingStaticDataBlobs then @@ -2546,7 +2577,7 @@ and GenApp cenv cgbuf eenv (f,fty,tyargs,args,m) sequel = let storage = StorageForValRef m vref eenv match storage with - | Method (_,_,mspec,_,_,_) -> + | Method (_,_,mspec,_,_,_,_) -> CG.EmitInstr cgbuf (pop 0) (Push [cenv.g.iltyp_RuntimeMethodHandle]) (I_ldtoken (ILToken.ILMethod mspec)) | _ -> errorR(Error(FSComp.SR.ilxgenUnexpectedArgumentToMethodHandleOfDuringCodegen(), m)) @@ -2573,7 +2604,7 @@ and GenApp cenv cgbuf eenv (f,fty,tyargs,args,m) sequel = when (let storage = StorageForValRef m vref eenv match storage with - | Method (topValInfo,vref,_,_,_,_) -> + | Method (topValInfo,vref,_,_,_,_,_) -> (let tps,argtys,_,_ = GetTopValTypeInFSharpForm cenv.g topValInfo vref.Type m tps.Length = tyargs.Length && argtys.Length <= args.Length) @@ -2581,7 +2612,7 @@ and GenApp cenv cgbuf eenv (f,fty,tyargs,args,m) sequel = let storage = StorageForValRef m vref eenv match storage with - | Method (topValInfo,vref,mspec,_,_,_) -> + | Method (topValInfo,vref,mspec,_,_,_,_) -> let nowArgs,laterArgs = let _,curriedArgInfos,_,_ = GetTopValTypeInFSharpForm cenv.g topValInfo vref.Type m List.chop curriedArgInfos.Length args @@ -3361,7 +3392,8 @@ and GenGetAddrOfRefCellField cenv cgbuf eenv (e,ty,m) sequel = and GenGetValAddr cenv cgbuf eenv (v: ValRef, m) sequel = let vspec = v.Deref let ilTy = GenTypeOfVal cenv eenv vspec - match StorageForValRef m v eenv with + let storage = StorageForValRef m v eenv + match storage with | Local (idx,None) -> CG.EmitInstrs cgbuf (pop 0) (Push [ILType.Byref ilTy]) [ I_ldloca (uint16 idx) ] | Arg idx -> @@ -3470,16 +3502,24 @@ and GenGenericParam cenv eenv (tp:Typar) = /// Generates the data used for parameters at definitions of abstract method slots such as interface methods or override methods. and GenSlotParam m cenv eenv (TSlotParam(nm,ty,inFlag,outFlag,optionalFlag,attribs)) : ILParameter = - let inFlag2,outFlag2,optionalFlag2,defaultParamValue,paramMarshal2,attribs = GenParamAttribs cenv attribs + let ilTy = GenParamType cenv.amap m eenv.tyenv true ty + let inFlag2,outFlag2,optionalFlag2,defaultParamValue,paramMarshal2,attribs = GenParamAttribs cenv ty attribs + + let ilAttribs = GenAttrs cenv eenv attribs + + let ilAttribs = + match GenReadOnlyAttributeIfNecessary cenv.g ty with + | Some attr -> ilAttribs @ [attr] + | None -> ilAttribs { Name=nm - Type= GenParamType cenv.amap m eenv.tyenv ty + Type= ilTy Default=defaultParamValue Marshal=paramMarshal2 IsIn=inFlag || inFlag2 IsOut=outFlag || outFlag2 IsOptional=optionalFlag || optionalFlag2 - CustomAttrsStored = storeILCustomAttrs (mkILCustomAttrs (GenAttrs cenv eenv attribs)) + CustomAttrsStored = storeILCustomAttrs (mkILCustomAttrs ilAttribs) MetadataIndex = NoMetadataIdx } and GenFormalSlotsig m cenv eenv (TSlotSig(_,typ,ctps,mtps,paraml,returnTy)) = @@ -3489,6 +3529,13 @@ and GenFormalSlotsig m cenv eenv (TSlotSig(_,typ,ctps,mtps,paraml,returnTy)) = let ilParams = paraml |> List.map (GenSlotParam m cenv eenvForSlotSig) let ilRetTy = GenReturnType cenv.amap m eenvForSlotSig.tyenv returnTy let ilRet = mkILReturn ilRetTy + let ilRet = + match returnTy with + | None -> ilRet + | Some ty -> + match GenReadOnlyAttributeIfNecessary cenv.g ty with + | Some attr -> ilRet.WithCustomAttrs (mkILCustomAttrs (ilRet.CustomAttrs.AsList @ [attr])) + | None -> ilRet ilTy, ilParams, ilRet and instSlotParam inst (TSlotParam(nm,ty,inFlag,fl2,fl3,attrs)) = TSlotParam(nm,instType inst ty,inFlag,fl2,fl3,attrs) @@ -4702,11 +4749,11 @@ and GenBindingAfterSequencePoint cenv cgbuf eenv sp (TBind(vspec,rhsExpr,_)) sta CommitStartScope cgbuf startScopeMarkOpt GenExpr cenv cgbuf eenv SPSuppress cctorBody discard - | Method (topValInfo,_,mspec,_,paramInfos,retInfo) -> + | Method (topValInfo,_,mspec,_,paramInfos,methodArgTys,retInfo) -> let tps,ctorThisValOpt,baseValOpt,vsl,body',bodyty = IteratedAdjustArityOfLambda cenv.g cenv.amap topValInfo rhsExpr let methodVars = List.concat vsl CommitStartScope cgbuf startScopeMarkOpt - GenMethodForBinding cenv cgbuf eenv (vspec,mspec,access,paramInfos,retInfo) (topValInfo,ctorThisValOpt,baseValOpt,tps,methodVars, body', bodyty) + GenMethodForBinding cenv cgbuf eenv (vspec,mspec,access,paramInfos,retInfo) (topValInfo,ctorThisValOpt,baseValOpt,tps,methodVars, methodArgTys, body', bodyty) | StaticProperty (ilGetterMethSpec, optShadowLocal) -> @@ -4953,9 +5000,9 @@ and GenMarshal cenv attribs = // No MarshalAs detected None, attribs -and GenParamAttribs cenv attribs = - let inFlag = HasFSharpAttributeOpt cenv.g cenv.g.attrib_InAttribute attribs - let outFlag = HasFSharpAttribute cenv.g cenv.g.attrib_OutAttribute attribs +and GenParamAttribs cenv paramTy attribs = + let inFlag = HasFSharpAttribute cenv.g cenv.g.attrib_InAttribute attribs || isInByrefTy cenv.g paramTy + let outFlag = HasFSharpAttribute cenv.g cenv.g.attrib_OutAttribute attribs || isOutByrefTy cenv.g paramTy let optionalFlag = HasFSharpAttributeOpt cenv.g cenv.g.attrib_OptionalAttribute attribs let defaultValue = TryFindFSharpAttributeOpt cenv.g cenv.g.attrib_DefaultParameterValueAttribute attribs @@ -4964,7 +5011,7 @@ and GenParamAttribs cenv attribs = // as custom attributes in the code - they are implicit from the IL bits for these let attribs = attribs - |> List.filter (IsMatchingFSharpAttributeOpt cenv.g cenv.g.attrib_InAttribute >> not) + |> List.filter (IsMatchingFSharpAttribute cenv.g cenv.g.attrib_InAttribute >> not) |> List.filter (IsMatchingFSharpAttribute cenv.g cenv.g.attrib_OutAttribute >> not) |> List.filter (IsMatchingFSharpAttributeOpt cenv.g cenv.g.attrib_OptionalAttribute >> not) |> List.filter (IsMatchingFSharpAttributeOpt cenv.g cenv.g.attrib_DefaultParameterValueAttribute >> not) @@ -4972,7 +5019,7 @@ and GenParamAttribs cenv attribs = let Marshal,attribs = GenMarshal cenv attribs inFlag,outFlag,optionalFlag,defaultValue,Marshal,attribs -and GenParams cenv eenv (mspec:ILMethodSpec) (attribs:ArgReprInfo list) (implValsOpt: Val list option) = +and GenParams cenv eenv (mspec:ILMethodSpec) (attribs:ArgReprInfo list) methodArgTys (implValsOpt: Val list option) = let ilArgTys = mspec.FormalArgTypes let argInfosAndTypes = if List.length attribs = List.length ilArgTys then List.zip ilArgTys attribs @@ -4985,9 +5032,9 @@ and GenParams cenv eenv (mspec:ILMethodSpec) (attribs:ArgReprInfo list) (implVal | _ -> List.map (fun x -> x,None) argInfosAndTypes - (Set.empty,argInfosAndTypes) - ||> List.mapFold (fun takenNames ((ilArgTy,topArgInfo),implValOpt) -> - let inFlag,outFlag,optionalFlag,defaultParamValue,Marshal,attribs = GenParamAttribs cenv topArgInfo.Attribs + (Set.empty,List.zip methodArgTys argInfosAndTypes) + ||> List.mapFold (fun takenNames (methodArgTy, ((ilArgTy,topArgInfo),implValOpt)) -> + let inFlag,outFlag,optionalFlag,defaultParamValue,Marshal,attribs = GenParamAttribs cenv methodArgTy topArgInfo.Attribs let idOpt = (match topArgInfo.Name with | Some v -> Some v @@ -5003,6 +5050,14 @@ and GenParams cenv eenv (mspec:ILMethodSpec) (attribs:ArgReprInfo list) (implVal | None -> None, takenNames + + let ilAttribs = GenAttrs cenv eenv attribs + + let ilAttribs = + match GenReadOnlyAttributeIfNecessary cenv.g methodArgTy with + | Some attr -> ilAttribs @ [attr] + | None -> ilAttribs + let param : ILParameter = { Name=nmOpt Type= ilArgTy @@ -5011,17 +5066,17 @@ and GenParams cenv eenv (mspec:ILMethodSpec) (attribs:ArgReprInfo list) (implVal IsIn=inFlag IsOut=outFlag IsOptional=optionalFlag - CustomAttrsStored = storeILCustomAttrs (mkILCustomAttrs (GenAttrs cenv eenv attribs)) + CustomAttrsStored = storeILCustomAttrs (mkILCustomAttrs ilAttribs) MetadataIndex = NoMetadataIdx } param, takenNames) |> fst and GenReturnInfo cenv eenv ilRetTy (retInfo : ArgReprInfo) : ILReturn = - let marshal,attrs = GenMarshal cenv retInfo.Attribs + let marshal,attribs = GenMarshal cenv retInfo.Attribs { Type=ilRetTy Marshal=marshal - CustomAttrsStored= storeILCustomAttrs (mkILCustomAttrs (GenAttrs cenv eenv attrs)) + CustomAttrsStored= storeILCustomAttrs (mkILCustomAttrs (GenAttrs cenv eenv attribs)) MetadataIndex = NoMetadataIdx } and GenPropertyForMethodDef compileAsInstance tref mdef (v:Val) (memberInfo:ValMemberInfo) ilArgTys ilPropTy ilAttrs compiledName = @@ -5113,7 +5168,7 @@ and ComputeMethodImplAttribs cenv (_v:Val) attrs = and GenMethodForBinding cenv cgbuf eenv (v:Val,mspec,access,paramInfos,retInfo) - (topValInfo,ctorThisValOpt,baseValOpt,tps,methodVars, body, returnTy) = + (topValInfo,ctorThisValOpt,baseValOpt,tps,methodVars, methodArgTys, body, returnTy) = let m = v.Range let selfMethodVars,nonSelfMethodVars,compileAsInstance = @@ -5127,6 +5182,7 @@ and GenMethodForBinding let nonUnitNonSelfMethodVars,body = BindUnitVars cenv.g (nonSelfMethodVars,paramInfos,body) let nonUnitMethodVars = selfMethodVars@nonUnitNonSelfMethodVars let cmtps,curriedArgInfos,_,_ = GetTopValTypeInCompiledForm cenv.g topValInfo v.Type v.Range + let eenv = bindBaseOrThisVarOpt cenv eenv ctorThisValOpt let eenv = bindBaseOrThisVarOpt cenv eenv baseValOpt @@ -5209,7 +5265,7 @@ and GenMethodForBinding yield! GenCompilationArgumentCountsAttr cenv v ] let ilTypars = GenGenericParams cenv eenvUnderMethLambdaTypars tps - let ilParams = GenParams cenv eenv mspec paramInfos (Some(nonUnitNonSelfMethodVars)) + let ilParams = GenParams cenv eenv mspec paramInfos methodArgTys (Some(nonUnitNonSelfMethodVars)) let ilReturn = GenReturnInfo cenv eenv mspec.FormalReturnType retInfo let methName = mspec.Name let tref = mspec.MethodRef.DeclaringTypeRef @@ -5437,7 +5493,7 @@ and GenSetStorage m cgbuf storage = CG.EmitInstr cgbuf (pop 1) Push0 (I_call(Normalcall,mkILMethSpecForMethRefInTy(ilSetterMethRef,ilContainerTy,[]),None)) | StaticProperty (ilGetterMethSpec,_) -> error(Error(FSComp.SR.ilStaticMethodIsNotLambda(ilGetterMethSpec.Name),m)) - | Method (_,_,mspec,m,_,_) -> + | Method (_,_,mspec,m,_,_,_) -> error(Error(FSComp.SR.ilStaticMethodIsNotLambda(mspec.Name),m)) | Null -> CG.EmitInstr cgbuf (pop 1) Push0 AI_pop | Arg _ -> error(Error(FSComp.SR.ilMutableVariablesCannotEscapeMethod(),m)) @@ -5476,7 +5532,7 @@ and GenGetStorageAndSequel cenv cgbuf eenv m (typ,ilTy) storage storeSequel = CG.EmitInstr cgbuf (pop 0) (Push [ilTy]) (I_call (Normalcall, ilGetterMethSpec, None)) CommitGetStorageSequel cenv cgbuf eenv m typ None storeSequel - | Method (topValInfo,vref,mspec,_,_,_) -> + | Method (topValInfo,vref,mspec,_,_,_,_) -> // Get a toplevel value as a first-class value. // We generate a lambda expression and that simply calls // the toplevel method. However we optimize the case where we are @@ -5729,7 +5785,7 @@ and GenAttr amap g eenv (Attrib(_,k,args,props,_,_,_)) = | ILAttrib(mref) -> mkILMethSpec(mref,AsObject,[],[]) | FSAttrib(vref) -> assert(vref.IsMember) - let mspec,_,_,_,_ = GetMethodSpecForMemberVal amap g (Option.get vref.MemberInfo) vref + let mspec,_,_,_,_,_ = GetMethodSpecForMemberVal amap g (Option.get vref.MemberInfo) vref mspec let ilArgs = List.map2 (fun (AttribExpr(_,vexpr)) ty -> GenAttribArg amap g eenv vexpr ty) args mspec.FormalArgTypes mkILCustomAttribMethRef g.ilg (mspec,ilArgs, props) @@ -6058,11 +6114,11 @@ and GenAbstractBinding cenv eenv tref (vref:ValRef) = [ yield! GenAttrs cenv eenv attribs yield! GenCompilationArgumentCountsAttr cenv vref.Deref ] - let mspec,ctps,mtps,argInfos,retInfo = GetMethodSpecForMemberVal cenv.amap cenv.g memberInfo vref + let mspec,ctps,mtps,argInfos,retInfo,methodArgTys = GetMethodSpecForMemberVal cenv.amap cenv.g memberInfo vref let eenvForMeth = EnvForTypars (ctps@mtps) eenv let ilMethTypars = GenGenericParams cenv eenvForMeth mtps let ilReturn = GenReturnInfo cenv eenvForMeth mspec.FormalReturnType retInfo - let ilParams = GenParams cenv eenvForMeth mspec argInfos None + let ilParams = GenParams cenv eenvForMeth mspec argInfos methodArgTys None let compileAsInstance = ValRefIsCompiledAsInstanceMember cenv.g vref let mdef = mkILGenericVirtualMethod (vref.CompiledName,ILMemberAccess.Public,ilMethTypars,ilParams,ilReturn,MethodBody.Abstract) @@ -6104,7 +6160,7 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon:Tycon) = [ match (eenv.valsInScope.TryFind cenv.g.sprintf_vref.Deref, eenv.valsInScope.TryFind cenv.g.new_format_vref.Deref) with - | Some(Lazy(Method(_,_,sprintfMethSpec,_,_,_))), Some(Lazy(Method(_,_,newFormatMethSpec,_,_,_))) -> + | Some(Lazy(Method(_,_,sprintfMethSpec,_,_,_,_))), Some(Lazy(Method(_,_,newFormatMethSpec,_,_,_,_))) -> // The type returned by the 'sprintf' call let funcTy = EraseClosures.mkILFuncTy cenv.g.ilxPubCloEnv ilThisTy cenv.g.ilg.typ_String // Give the instantiation of the printf format object, i.e. a Format`5 object compatible with StringFormat @@ -6433,7 +6489,7 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon:Tycon) = let (|Lazy|) (x:Lazy<_>) = x.Force() match (eenv.valsInScope.TryFind cenv.g.sprintf_vref.Deref, eenv.valsInScope.TryFind cenv.g.new_format_vref.Deref) with - | Some(Lazy(Method(_,_,sprintfMethSpec,_,_,_))), Some(Lazy(Method(_,_,newFormatMethSpec,_,_,_))) -> + | Some(Lazy(Method(_,_,sprintfMethSpec,_,_,_,_))), Some(Lazy(Method(_,_,newFormatMethSpec,_,_,_,_))) -> // The type returned by the 'sprintf' call let funcTy = EraseClosures.mkILFuncTy cenv.g.ilxPubCloEnv ilThisTy cenv.g.ilg.typ_String // Give the instantiation of the printf format object, i.e. a Format`5 object compatible with StringFormat @@ -6973,7 +7029,7 @@ let defaultOf = let LookupGeneratedValue (amap:ImportMap) (ctxt: ExecutionContext) eenv (v:Val) = try // Convert the v.Type into a System.Type according to ilxgen and ilreflect. - let objTyp = + let objTyp() = let ilTy = GenType amap v.Range TypeReprEnv.Empty v.Type (* TypeReprEnv.Empty ok, not expecting typars *) ctxt.LookupType ilTy // Lookup the compiled v value (as an object). @@ -6991,7 +7047,7 @@ let LookupGeneratedValue (amap:ImportMap) (ctxt: ExecutionContext) eenv (v:Val) // Rather, we look for the getter MethodInfo from the built type and .Invoke on that. let methInfo = staticTyp.GetMethod(ilGetterMethRef.Name, BindingFlags.Static ||| BindingFlags.Public ||| BindingFlags.NonPublic) methInfo.Invoke((null:obj),(null:obj[])) - Some (obj,objTyp) + Some (obj,objTyp()) | StaticProperty (ilGetterMethSpec, _) -> let obj = @@ -7001,10 +7057,10 @@ let LookupGeneratedValue (amap:ImportMap) (ctxt: ExecutionContext) eenv (v:Val) // Rather, we look for the getter MethodInfo from the built type and .Invoke on that. let methInfo = staticTyp.GetMethod(ilGetterMethSpec.Name, BindingFlags.Static ||| BindingFlags.Public ||| BindingFlags.NonPublic) methInfo.Invoke((null:obj),(null:obj[])) - Some (obj,objTyp) + Some (obj,objTyp()) | Null -> - Some (null,objTyp) + Some (null,objTyp()) | Local _ -> None | Method _ -> None | Arg _ -> None diff --git a/src/fsharp/InnerLambdasToTopLevelFuncs.fs b/src/fsharp/InnerLambdasToTopLevelFuncs.fs index f955982350..54e304526a 100644 --- a/src/fsharp/InnerLambdasToTopLevelFuncs.fs +++ b/src/fsharp/InnerLambdasToTopLevelFuncs.fs @@ -149,7 +149,7 @@ let IsRefusedTLR g (f:Val) = // things marked ValInline.Never are special let dllImportStubOrOtherNeverInline = (f.InlineInfo = ValInline.Never) // Cannot have static fields of byref type - let byrefVal = isByrefLikeTy g f.Type + let byrefVal = isByrefLikeTy g f.Range f.Type // Special values are instance methods etc. on .NET types. For now leave these alone let specialVal = f.MemberInfo.IsSome let alreadyChosen = f.ValReprInfo.IsSome @@ -162,10 +162,9 @@ let IsMandatoryTopLevel (f:Val) = specialVal || isModulBinding let IsMandatoryNonTopLevel g (f:Val) = - let byrefVal = isByrefLikeTy g f.Type + let byrefVal = isByrefLikeTy g f.Range f.Type byrefVal - //------------------------------------------------------------------------- // pass1: decide which f are to be TLR? and if so, arity(f) //------------------------------------------------------------------------- @@ -727,7 +726,7 @@ let FlatEnvPacks g fclassM topValS declist (reqdItemsMap: Zmap List.filter (fun v -> not (isByrefLikeTy g v.Type)) + let vals = vals |> List.filter (fun v -> not (isByrefLikeTy g v.Range v.Type)) // Remove values which have been labelled TLR, no need to close over these let vals = vals |> List.filter (Zset.memberOf topValS >> not) diff --git a/src/fsharp/MethodCalls.fs b/src/fsharp/MethodCalls.fs index c274e71355..81d7942b9e 100644 --- a/src/fsharp/MethodCalls.fs +++ b/src/fsharp/MethodCalls.fs @@ -56,16 +56,18 @@ type CalledArg = IsParamArray : bool OptArgInfo : OptionalArgInfo CallerInfoInfo : CallerInfoInfo + IsInArg: bool IsOutArg: bool ReflArgInfo: ReflectedArgInfo NameOpt: Ident option CalledArgumentType : TType } -let CalledArg(pos, isParamArray, optArgInfo, callerInfoInfo, isOutArg, nameOpt, reflArgInfo, calledArgTy) = +let CalledArg (pos, isParamArray, optArgInfo, callerInfoInfo, isInArg, isOutArg, nameOpt, reflArgInfo, calledArgTy) = { Position=pos IsParamArray=isParamArray OptArgInfo =optArgInfo CallerInfoInfo = callerInfoInfo + IsInArg=isInArg IsOutArg=isOutArg ReflArgInfo=reflArgInfo NameOpt=nameOpt @@ -126,48 +128,59 @@ let AdjustCalledArgType (infoReader:InfoReader) isConstraint (calledArg: CalledA let calledArgTy = calledArg.CalledArgumentType let callerArgTy = callerArg.Type let m = callerArg.Range - if isConstraint then calledArgTy else - // If the called method argument is a byref type, then the caller may provide a byref or ref - if isByrefTy g calledArgTy then - if isByrefTy g callerArgTy then - calledArgTy + if isConstraint then + calledArgTy + else + + // If the called method argument is an inref type, then the caller may provide a byref or value + if isInByrefTy g calledArgTy then + if isByrefTy g callerArgTy then + calledArgTy + else + destByrefTy g calledArgTy + + // If the called method argument is a (non inref) byref type, then the caller may provide a byref or ref. + elif isByrefTy g calledArgTy then + if isByrefTy g callerArgTy then + calledArgTy + else + mkRefCellTy g (destByrefTy g calledArgTy) + else - mkRefCellTy g (destByrefTy g calledArgTy) - else - // If the called method argument is a delegate type, then the caller may provide a function - let calledArgTy = - let adjustDelegateTy calledTy = - let (SigOfFunctionForDelegate(_, delArgTys, _, fty)) = GetSigOfFunctionForDelegate infoReader calledTy m AccessibleFromSomewhere - let delArgTys = if isNil delArgTys then [g.unit_ty] else delArgTys - if (fst (stripFunTy g callerArgTy)).Length = delArgTys.Length - then fty - else calledArgTy - - if isDelegateTy g calledArgTy && isFunTy g callerArgTy then - adjustDelegateTy calledArgTy - - elif isLinqExpressionTy g calledArgTy && isFunTy g callerArgTy then - let origArgTy = calledArgTy - let calledArgTy = destLinqExpressionTy g calledArgTy - if isDelegateTy g calledArgTy then + // If the called method argument is a delegate type, then the caller may provide a function + let calledArgTy = + let adjustDelegateTy calledTy = + let (SigOfFunctionForDelegate(_, delArgTys, _, fty)) = GetSigOfFunctionForDelegate infoReader calledTy m AccessibleFromSomewhere + let delArgTys = if isNil delArgTys then [g.unit_ty] else delArgTys + if (fst (stripFunTy g callerArgTy)).Length = delArgTys.Length + then fty + else calledArgTy + + if isDelegateTy g calledArgTy && isFunTy g callerArgTy then adjustDelegateTy calledArgTy - else - // BUG 435170: called arg is Expr<'t> where 't is not delegate - such conversion is not legal -> return original type - origArgTy - - elif calledArg.ReflArgInfo.AutoQuote && isQuotedExprTy g calledArgTy && not (isQuotedExprTy g callerArgTy) then - destQuotedExprTy g calledArgTy - - else calledArgTy - - // Adjust the called argument type to take into account whether the caller's argument is M(?arg=Some(3)) or M(arg=1) - // If the called method argument is optional with type Option, then the caller may provide a T, unless their argument is propagating-optional (i.e. isOptCallerArg) - let calledArgTy = - match calledArg.OptArgInfo with - | NotOptional -> calledArgTy - | CalleeSide when not callerArg.IsOptional && isOptionTy g calledArgTy -> destOptionTy g calledArgTy - | CalleeSide | CallerSide _ -> calledArgTy - calledArgTy + + elif isLinqExpressionTy g calledArgTy && isFunTy g callerArgTy then + let origArgTy = calledArgTy + let calledArgTy = destLinqExpressionTy g calledArgTy + if isDelegateTy g calledArgTy then + adjustDelegateTy calledArgTy + else + // BUG 435170: called arg is Expr<'t> where 't is not delegate - such conversion is not legal -> return original type + origArgTy + + elif calledArg.ReflArgInfo.AutoQuote && isQuotedExprTy g calledArgTy && not (isQuotedExprTy g callerArgTy) then + destQuotedExprTy g calledArgTy + + else calledArgTy + + // Adjust the called argument type to take into account whether the caller's argument is M(?arg=Some(3)) or M(arg=1) + // If the called method argument is optional with type Option, then the caller may provide a T, unless their argument is propagating-optional (i.e. isOptCallerArg) + let calledArgTy = + match calledArg.OptArgInfo with + | NotOptional -> calledArgTy + | CalleeSide when not callerArg.IsOptional && isOptionTy g calledArgTy -> destOptionTy g calledArgTy + | CalleeSide | CallerSide _ -> calledArgTy + calledArgTy //------------------------------------------------------------------------- @@ -193,11 +206,12 @@ type CalledMethArgSet<'T> = let MakeCalledArgs amap m (minfo:MethInfo) minst = // Mark up the arguments with their position, so we can sort them back into order later let paramDatas = minfo.GetParamDatas(amap, m, minst) - paramDatas |> List.mapiSquared (fun i j (ParamData(isParamArrayArg, isOutArg, optArgInfo, callerInfoFlags, nmOpt, reflArgInfo, typeOfCalledArg)) -> - { Position=(i, j) + paramDatas |> List.mapiSquared (fun i j (ParamData(isParamArrayArg, isInArg, isOutArg, optArgInfo, callerInfoFlags, nmOpt, reflArgInfo, typeOfCalledArg)) -> + { Position=(i,j) IsParamArray=isParamArrayArg OptArgInfo=optArgInfo CallerInfoInfo = callerInfoFlags + IsInArg=isInArg IsOutArg=isOutArg ReflArgInfo=reflArgInfo NameOpt=nmOpt @@ -350,6 +364,7 @@ type CalledMeth<'T> let unnamedCalledOutArgs = argSetInfos |> List.collect (fun (_, _, _, _, _, x) -> x) member x.infoReader = infoReader + member x.amap = infoReader.amap /// the method we're attempting to call @@ -372,12 +387,14 @@ type CalledMeth<'T> /// The argument analysis for each set of curried arguments member x.ArgSets = argSets - /// return type - member x.ReturnType = methodRetTy + /// return type after implicit deference of byref returns is taken into account + member x.CalledReturnTypeAfterByrefDeref = + let retTy = methodRetTy + if isByrefTy g retTy then destByrefTy g retTy else retTy /// return type after tupling of out args is taken into account - member x.ReturnTypeAfterOutArgTupling = - let retTy = x.ReturnType + member x.CalledReturnTypeAfterOutArgTupling = + let retTy = x.CalledReturnTypeAfterByrefDeref if isNil unnamedCalledOutArgs then retTy else @@ -405,19 +422,31 @@ type CalledMeth<'T> static member GetMethod (x:CalledMeth<'T>) = x.Method - member x.NumArgSets = x.ArgSets.Length + member x.NumArgSets = x.ArgSets.Length + + member x.HasOptArgs = not (isNil x.UnnamedCalledOptArgs) + + member x.HasOutArgs = not (isNil x.UnnamedCalledOutArgs) - member x.HasOptArgs = not (isNil x.UnnamedCalledOptArgs) - member x.HasOutArgs = not (isNil x.UnnamedCalledOutArgs) member x.UsesParamArrayConversion = x.ArgSets |> List.exists (fun argSet -> argSet.ParamArrayCalledArgOpt.IsSome) + member x.ParamArrayCalledArgOpt = x.ArgSets |> List.tryPick (fun argSet -> argSet.ParamArrayCalledArgOpt) + member x.ParamArrayCallerArgs = x.ArgSets |> List.tryPick (fun argSet -> if Option.isSome argSet.ParamArrayCalledArgOpt then Some argSet.ParamArrayCallerArgs else None ) + member x.ParamArrayElementType = assert (x.UsesParamArrayConversion) x.ParamArrayCalledArgOpt.Value.CalledArgumentType |> destArrayTy x.amap.g + member x.NumAssignedProps = x.AssignedItemSetters.Length - member x.CalledObjArgTys(m) = x.Method.GetObjArgTypes(x.amap, m, x.CalledTyArgs) + + member x.CalledObjArgTys(m) = + match x.Method.GetObjArgTypes(x.amap, m, x.CalledTyArgs) with + | [ thisArgTy ] when isByrefTy g thisArgTy -> [ destByrefTy g thisArgTy ] + | res -> res + member x.NumCalledTyArgs = x.CalledTyArgs.Length + member x.NumCallerTyArgs = x.CallerTyArgs.Length member x.AssignsAllNamedArgs = isNil x.UnassignedNamedArgs @@ -451,8 +480,11 @@ type CalledMeth<'T> x.ArgSets |> List.map (fun argSet -> argSet.AssignedNamedArgs) member x.AllUnnamedCalledArgs = x.ArgSets |> List.collect (fun x -> x.UnnamedCalledArgs) + member x.TotalNumUnnamedCalledArgs = x.ArgSets |> List.sumBy (fun x -> x.NumUnnamedCalledArgs) + member x.TotalNumUnnamedCallerArgs = x.ArgSets |> List.sumBy (fun x -> x.NumUnnamedCallerArgs) + member x.TotalNumAssignedNamedArgs = x.ArgSets |> List.sumBy (fun x -> x.NumAssignedNamedArgs) let NamesOfCalledArgs (calledArgs: CalledArg list) = @@ -547,15 +579,13 @@ let TakeObjAddrForMethodCall g amap (minfo:MethInfo) isMutable m objArgs f = match objArgs with | [objArgExpr] -> let hasCallInfo = ccallInfo.IsSome - let mustTakeAddress = - (minfo.IsStruct && not minfo.IsExtensionMember) // don't take the address of a struct when passing to an extension member - || hasCallInfo + let mustTakeAddress = hasCallInfo || minfo.ObjArgNeedsAddress(amap, m) let objArgTy = tyOfExpr g objArgExpr - let wrap, objArgExpr' = mkExprAddrOfExpr g mustTakeAddress hasCallInfo isMutable objArgExpr None m + let wrap, objArgExpr', _readonly = mkExprAddrOfExpr g mustTakeAddress hasCallInfo isMutable objArgExpr None m // Extension members and calls to class constraints may need a coercion for their object argument let objArgExpr' = - if not hasCallInfo && // minfo.IsExtensionMember && minfo.IsStruct && + if not hasCallInfo && not (TypeDefinitelySubsumesTypeNoCoercion 0 g amap m minfo.ApparentEnclosingType objArgTy) then mkCoerceExpr(objArgExpr', minfo.ApparentEnclosingType, m, objArgTy) else @@ -1074,7 +1104,7 @@ module ProvidedMethodCalls = match ea.PApplyOption((function ProvidedAddressOfExpr x -> Some x | _ -> None), m) with | Some e -> let eT = exprToExpr e - let wrap, ce = mkExprAddrOfExpr g true false DefinitelyMutates eT None m + let wrap,ce, _readonly = mkExprAddrOfExpr g true false DefinitelyMutates eT None m let ce = wrap ce None, (ce, tyOfExpr g ce) | None -> diff --git a/src/fsharp/NameResolution.fs b/src/fsharp/NameResolution.fs index 8884ec5934..4c41d2747d 100644 --- a/src/fsharp/NameResolution.fs +++ b/src/fsharp/NameResolution.fs @@ -467,7 +467,7 @@ let private GetCSharpStyleIndexedExtensionMembersForTyconRef (amap:Import.Import // So we need to go and crack the type of the 'this' argument. let thisTy = minfo.GetParamTypes(amap,m,generalizeTypars minfo.FormalMethodTypars).Head.Head match thisTy with - | AppTy amap.g (tcrefOfTypeExtended, _) -> Some tcrefOfTypeExtended + | AppTy g (tcrefOfTypeExtended, _) when not (isByrefTy g thisTy) -> Some tcrefOfTypeExtended | _ -> None Some rs diff --git a/src/fsharp/NicePrint.fs b/src/fsharp/NicePrint.fs index 28fc141424..3c78e476ac 100755 --- a/src/fsharp/NicePrint.fs +++ b/src/fsharp/NicePrint.fs @@ -906,15 +906,28 @@ module private PrintTypes = | [arg] -> layoutTypeWithInfoAndPrec denv env 2 arg ^^ tcL | args -> bracketIfL (prec <= 1) (bracketL (layoutTypesWithInfoAndPrec denv env 2 (sepL (tagPunctuation ",")) args) --- tcL) - /// Layout a type, taking precedence into account to insert brackets where needed *) + /// Layout a type, taking precedence into account to insert brackets where needed and layoutTypeWithInfoAndPrec denv env prec typ = match stripTyparEqns typ with - // Layout a type application + // Always prefer to format 'byref' as 'inref' + | typ when isInByrefTy denv.g typ && (match typ with TType_app (tc, _) when denv.g.inref_tcr.CanDeref && tyconRefEq denv.g tc denv.g.byref2_tcr -> true | _ -> false) -> + layoutTypeWithInfoAndPrec denv env prec (mkInByrefTy denv.g (destByrefTy denv.g typ)) + + // Always prefer to format 'byref' as 'outref' + | typ when isOutByrefTy denv.g typ && (match typ with TType_app (tc, _) when denv.g.outref_tcr.CanDeref && tyconRefEq denv.g tc denv.g.byref2_tcr -> true | _ -> false) -> + layoutTypeWithInfoAndPrec denv env prec (mkOutByrefTy denv.g (destByrefTy denv.g typ)) + + // Always prefer to format 'byref' as 'byref' + | typ when isByrefTy denv.g typ && (match typ with TType_app (tc, _) when denv.g.byref_tcr.CanDeref && tyconRefEq denv.g tc denv.g.byref2_tcr -> true | _ -> false) -> + layoutTypeWithInfoAndPrec denv env prec (mkByrefTy denv.g (destByrefTy denv.g typ)) + + // Always prefer 'float' to 'float<1>' | TType_app (tc,args) when tc.IsMeasureableReprTycon && List.forall (isDimensionless denv.g) args -> layoutTypeWithInfoAndPrec denv env prec (reduceTyconRefMeasureableOrProvided denv.g tc args) + // Layout a type application | TType_app (tc,args) -> layoutTypeAppWithInfoAndPrec denv env (layoutTyconRef denv tc) prec tc.IsPrefixDisplay args @@ -1228,7 +1241,7 @@ module InfoMemberPrinting = /// Format the arguments of a method to a buffer. /// /// This uses somewhat "old fashioned" printf-style buffer printing. - let layoutParamData denv (ParamData(isParamArray, _isOutArg, optArgInfo, _callerInfoInfo, nmOpt, _reflArgInfo, pty)) = + let layoutParamData denv (ParamData(isParamArray, _isInArg, _isOutArg, optArgInfo, _callerInfoInfo, nmOpt, _reflArgInfo, pty)) = let isOptArg = optArgInfo.IsOptional match isParamArray, nmOpt, isOptArg, tryDestOptionTy denv.g pty with // Layout an optional argument diff --git a/src/fsharp/Optimizer.fs b/src/fsharp/Optimizer.fs index cecd1079de..7066a47ac1 100644 --- a/src/fsharp/Optimizer.fs +++ b/src/fsharp/Optimizer.fs @@ -1248,7 +1248,7 @@ let rec ExprHasEffect g expr = | Expr.Const _ -> false /// type applications do not have effects, with the exception of type functions | Expr.App(f0, _, _, [], _) -> (IsTyFuncValRefExpr f0) || ExprHasEffect g f0 - | Expr.Op(op, _, args, _) -> ExprsHaveEffect g args || OpHasEffect g op + | Expr.Op(op, _, args, m) -> ExprsHaveEffect g args || OpHasEffect g m op | Expr.LetRec(binds, body, _, _) -> BindingsHaveEffect g binds || ExprHasEffect g body | Expr.Let(bind, body, _, _) -> BindingHasEffect g bind || ExprHasEffect g body // REVIEW: could add Expr.Obj on an interface type - these are similar to records of lambda expressions @@ -1256,35 +1256,35 @@ let rec ExprHasEffect g expr = and ExprsHaveEffect g exprs = List.exists (ExprHasEffect g) exprs and BindingsHaveEffect g binds = List.exists (BindingHasEffect g) binds and BindingHasEffect g bind = bind.Expr |> ExprHasEffect g -and OpHasEffect g op = +and OpHasEffect g m op = match op with | TOp.Tuple _ -> false | TOp.Recd (ctor, tcref) -> match ctor with | RecdExprIsObjInit -> true - | RecdExpr -> isRecdOrUnionOrStructTyconRefDefinitelyMutable g tcref - | TOp.UnionCase ucref -> isRecdOrUnionOrStructTyconRefDefinitelyMutable g ucref.TyconRef + | RecdExpr -> not (isRecdOrStructTyconRefReadOnly g m tcref) + | TOp.UnionCase ucref -> isRecdOrUnionOrStructTyconRefDefinitelyMutable ucref.TyconRef | TOp.ExnConstr ecref -> isExnDefinitelyMutable ecref - | TOp.Bytes _ | TOp.UInt16s _ | TOp.Array -> true (* alloc observable *) + | TOp.Bytes _ | TOp.UInt16s _ | TOp.Array -> true // mutable | TOp.UnionCaseTagGet _ -> false | TOp.UnionCaseProof _ -> false | TOp.UnionCaseFieldGet (ucref, n) -> isUnionCaseFieldMutable g ucref n | TOp.ILAsm(instrs, _) -> IlAssemblyCodeHasEffect instrs | TOp.TupleFieldGet(_) -> false | TOp.ExnFieldGet(ecref, n) -> isExnFieldMutable ecref n - | TOp.RefAddrGet -> false - | TOp.ValFieldGet rfref -> rfref.RecdField.IsMutable || (TryFindTyconRefBoolAttribute g Range.range0 g.attrib_AllowNullLiteralAttribute rfref.TyconRef = Some(true)) - | TOp.ValFieldGetAddr rfref -> rfref.RecdField.IsMutable (* data is immutable, so taking address is ok *) - | TOp.UnionCaseFieldGetAddr _ -> false (* data is immutable, so taking address is ok *) - | TOp.LValueOp (LGetAddr, lv) -> lv.IsMutable + | TOp.RefAddrGet _ -> false + | TOp.ValFieldGet rfref -> rfref.RecdField.IsMutable || (TryFindTyconRefBoolAttribute g Range.range0 g.attrib_AllowNullLiteralAttribute rfref.TyconRef = Some true) + | TOp.ValFieldGetAddr (rfref, _readonly) -> rfref.RecdField.IsMutable + | TOp.UnionCaseFieldGetAddr _ -> false // union case fields are immutable + | TOp.LValueOp (LAddrOf _, lv) -> lv.IsMutable | TOp.UnionCaseFieldSet _ | TOp.ExnFieldSet _ | TOp.Coerce | TOp.Reraise | TOp.For _ | TOp.While _ - | TOp.TryCatch _ - | TOp.TryFinally _ (* note: these really go through a different path anyway *) + | TOp.TryCatch _ (* conservative *) + | TOp.TryFinally _ (* conservative *) | TOp.TraitCall _ | TOp.Goto _ | TOp.Label _ @@ -1791,17 +1791,17 @@ and OptimizeExprOp cenv env (op, tyargs, args, m) = MightMakeCriticalTailcall=false Info=UnknownValue } (* Handle addresses *) - | TOp.LValueOp (LGetAddr, lv), _, _ -> + | TOp.LValueOp ((LAddrOf _ as lop), lv), _, _ -> let e, _ = OptimizeExpr cenv env (exprForValRef m lv) let op' = match e with // Do not optimize if it's a top level static binding. - | Expr.Val (v, _, _) when not v.IsCompiledAsTopLevel -> TOp.LValueOp (LGetAddr, v) + | Expr.Val (v, _, _) when not v.IsCompiledAsTopLevel -> TOp.LValueOp (lop, v) | _ -> op Expr.Op (op', tyargs, args, m), { TotalSize = 1 FunctionSize = 1 - HasEffect = OpHasEffect cenv.g op' + HasEffect = OpHasEffect cenv.g m op' MightMakeCriticalTailcall = false Info = UnknownValue } (* Handle these as special cases since mutables are allowed inside their bodies *) @@ -1850,7 +1850,7 @@ and OptimizeExprOpFallback cenv env (op, tyargs, args', m) arginfos valu = let argsFSize = AddFunctionSizes arginfos let argEffects = OrEffects arginfos let argValues = List.map (fun x -> x.Info) arginfos - let effect = OpHasEffect cenv.g op + let effect = OpHasEffect cenv.g m op let cost, valu = match op with | TOp.UnionCase c -> 2, MakeValueInfoForUnionCase c (Array.ofList argValues) @@ -1882,7 +1882,7 @@ and OptimizeExprOpFallback cenv env (op, tyargs, args', m) arginfos valu = | TOp.ValFieldGetAddr _ | TOp.Array | TOp.For _ | TOp.While _ | TOp.TryCatch _ | TOp.TryFinally _ | TOp.ILCall _ | TOp.TraitCall _ | TOp.LValueOp _ | TOp.ValFieldSet _ - | TOp.UnionCaseFieldSet _ | TOp.RefAddrGet | TOp.Coerce | TOp.Reraise + | TOp.UnionCaseFieldSet _ | TOp.RefAddrGet _ | TOp.Coerce | TOp.Reraise | TOp.UnionCaseFieldGetAddr _ | TOp.ExnFieldSet _ -> 1, valu | TOp.Recd (ctorInfo, tcref) -> @@ -2277,7 +2277,7 @@ and TakeAddressOfStructArgumentIfNeeded cenv (vref:ValRef) ty args m = // known calls to known generated F# code for CompareTo, Equals and GetHashCode. // If we ever reuse DevirtualizeApplication to transform an arbitrary virtual call into a // direct call then this assumption is not valid. - let wrap, objArgAddress = mkExprAddrOfExpr cenv.g true false NeverMutates objArg None m + let wrap, objArgAddress, _readonly = mkExprAddrOfExpr cenv.g true false NeverMutates objArg None m wrap, (objArgAddress::rest) | _ -> // no wrapper, args stay the same @@ -2760,7 +2760,7 @@ and OptimizeExprThenConsiderSplit cenv env e = // Decide whether to List.unzip a sub-expression into a new method //------------------------------------------------------------------------- -and ComputeSplitToMethodCondition flag threshold cenv env (e, einfo) = +and ComputeSplitToMethodCondition flag threshold cenv env (e:Expr, einfo) = flag && // REVIEW: The method splitting optimization is completely disabled if we are not taking tailcalls. // REVIEW: This should only apply to methods that actually make self-tailcalls (tested further below). @@ -2771,6 +2771,7 @@ and ComputeSplitToMethodCondition flag threshold cenv env (e, einfo) = // We can only split an expression out as a method if certain conditions are met. // It can't use any protected or base calls, rethrow(), byrefs etc. + let m = e.Range (let fvs = freeInExpr CollectLocals e not fvs.UsesUnboundRethrow && not fvs.UsesMethodLocalConstructs && @@ -2781,12 +2782,12 @@ and ComputeSplitToMethodCondition flag threshold cenv env (e, einfo) = // All the free variables (apart from things with an arity, i.e. compiled as methods) should be normal, i.e. not base/this etc. (v.BaseOrThisInfo = NormalVal && // None of them should be byrefs - not (isByrefLikeTy cenv.g v.Type) && + not (isByrefLikeTy cenv.g m v.Type) && // None of them should be local polymorphic constrained values not (IsGenericValWithGenericContraints cenv.g v) && // None of them should be mutable not v.IsMutable)))) && - not (isByrefLikeTy cenv.g (tyOfExpr cenv.g e)) + not (isByrefLikeTy cenv.g m (tyOfExpr cenv.g e)) and ConsiderSplitToMethod flag threshold cenv env (e, einfo) = if ComputeSplitToMethodCondition flag threshold cenv env (e, einfo) then diff --git a/src/fsharp/PatternMatchCompilation.fs b/src/fsharp/PatternMatchCompilation.fs index 4537c8549d..12d399da0b 100644 --- a/src/fsharp/PatternMatchCompilation.fs +++ b/src/fsharp/PatternMatchCompilation.fs @@ -904,7 +904,7 @@ let CompilePatternBasic when isNil topgtvs && ucref.Tycon.IsStructRecordOrUnionTycon -> let argexp = GetSubExprOfInput subexpr - let vOpt,addrexp = mkExprAddrOfExprAux g true false NeverMutates argexp None matchm + let vOpt, addrexp, _readonly = mkExprAddrOfExprAux g true false NeverMutates argexp None matchm match vOpt with | None -> Some addrexp, None | Some (v,e) -> diff --git a/src/fsharp/PostInferenceChecks.fs b/src/fsharp/PostInferenceChecks.fs index bf1141a73b..0b72eb994d 100644 --- a/src/fsharp/PostInferenceChecks.fs +++ b/src/fsharp/PostInferenceChecks.fs @@ -40,51 +40,6 @@ let testHookMemberBody (membInfo: ValMemberInfo) (expr:Expr) = m.EndLine m.EndColumn -//-------------------------------------------------------------------------- -// NOTES: byref safety checks -// -// The .NET runtime has safety requirements on the use of byrefs. -// These include: -// A1: No generic type/method can be instantiated with byref types (meaning contains byref type). -// A2: No object field may be byref typed. -// -// In F# TAST level, byref types can be introduced/consumed at: -// B1: lambda ... (v:byref) ... -- binding sites for values. -// B2: &m -- address of operator, where m is local mutable or reference cell. -// B3: ms.M() -- method calls on mutable structs. -// B4: *br -- dereference byref -// B5: br <- x -- assign byref -// B6: expr@[byrefType] -- any type instantiation could introduce byref types. -// B7: asm -- TExpr_asm forms that create/consume byrefs. -// a) I_ldfld expr -// b) I_stfld -// -// Closures imply objects. -// Closures are either: -// a) explicit lambda expressions. -// b) functions partially applied below their known arity. -// -// Checks: -// C1: check no instantiation can contain byref types. -// C2: check type declarations to ensure no object field will have byref type. -// C3: check no explicit lambda expressions capture any free byref typed expression. -// C4: check byref type expr occur only as: -// C4.a) arg to functions occurring within their known arity. -// C4.b) arg to IL method calls, e.g. arising from calls to instance methods on mutable structs. -// C4.c) arg to property getter on mutable struct (record field projection) -// C4.d) rhs of byref typed binding (aliasing). -// Note [1] aliasing should not effect safety. The restrictions on RHS byref will also apply to alias. -// Note [2] aliasing happens in the generated hash/compare code. -// C5: when is a byref-typed-binding acceptable? -// a) if it will be a method local, ok. -// b) if it will be a top-level value stored as a field, then no. [These should have arity info]. -// -// Check commentary: -// The C4 checks ensure byref expressions are only passed directly as method arguments (or aliased). -// The C3 check ensures byref expressions are never captured, e.g. passed as direct method arg under a capturing thunk. -// The C2 checks no type can store byrefs (C4 ensures F# code would never actually store them). -// The C1 checks no generic type could be instanced to store byrefs. - //-------------------------------------------------------------------------- // NOTES: reraise safety checks //-------------------------------------------------------------------------- @@ -124,17 +79,28 @@ let testHookMemberBody (membInfo: ValMemberInfo) (expr:Expr) = //-------------------------------------------------------------------------- type env = - { boundTyparNames: string list + { + /// The bound type parameter names in scope + boundTyparNames: string list + + /// The bound type parameters in scope boundTypars: TyparMap + + /// The set of arguments to this method/function argVals: ValMap + /// "module remap info", i.e. hiding information down the signature chain, used to compute what's hidden by a signature sigToImplRemapInfo: (Remap * SignatureHidingInfo) list + /// Constructor limited - are we in the prelude of a constructor, prior to object initialization - limited: bool + ctorLimitedZone: bool + /// Are we in a quotation? quote : bool + /// Are we under []? reflect : bool + /// Are we in an extern declaration? external : bool } @@ -155,11 +121,12 @@ let BindTypars g env (tps:Typar list) = /// Set the set of vals which are arguments in the active lambda. We are allowed to return /// byref arguments as byref returns. -let SetArgVals env (vs: Val list) = +let BindArgVals env (vs: Val list) = { env with argVals = ValMap.OfList (List.map (fun v -> (v,())) vs) } type cenv = { boundVals: Dictionary // really a hash set + limitVals: Dictionary // really a hash set mutable potentialUnboundUsesOfVals: StampMap g: TcGlobals amap: Import.ImportMap @@ -174,6 +141,9 @@ type cenv = mutable usesQuotations : bool mutable entryPointGiven:bool } +let LimitVal cenv (v:Val) = + cenv.limitVals.[v.Stamp] <- 1 + let BindVal cenv env (v:Val) = //printfn "binding %s..." v.DisplayName let alreadyDone = cenv.boundVals.ContainsKey v.Stamp @@ -198,7 +168,7 @@ let BindVals cenv env vs = List.iter (BindVal cenv env) vs // approx walk of type //-------------------------------------------------------------------------- -let rec CheckTypeDeep ((visitTyp,visitTyconRefOpt,visitAppTyOpt,visitTraitSolutionOpt, visitTyparOpt) as f) g env typ = +let rec CheckTypeDeep ((visitTyp,visitTyconRefOpt,visitAppTyOpt,visitTraitSolutionOpt, visitTyparOpt) as f) g env isInner typ = // We iterate the _solved_ constraints as well, to pick up any record of trait constraint solutions // This means we walk _all_ the constraints _everywhere_ in a type, including // those attached to _solved_ type variables. This is used by PostTypeCheckSemanticChecks to detect uses of @@ -223,13 +193,13 @@ let rec CheckTypeDeep ((visitTyp,visitTyconRefOpt,visitAppTyOpt,visitTraitSoluti match typ with | TType_forall (tps,body) -> let env = BindTypars g env tps - CheckTypeDeep f g env body + CheckTypeDeep f g env isInner body tps |> List.iter (fun tp -> tp.Constraints |> List.iter (CheckTypeConstraintDeep f g env)) | TType_measure _ -> () | TType_app (tcref,tinst) -> match visitTyconRefOpt with - | Some visitTyconRef -> visitTyconRef tcref + | Some visitTyconRef -> visitTyconRef isInner tcref | None -> () CheckTypesDeep f g env tinst match visitAppTyOpt with @@ -238,7 +208,7 @@ let rec CheckTypeDeep ((visitTyp,visitTyconRefOpt,visitAppTyOpt,visitTraitSoluti | TType_ucase (_,tinst) -> CheckTypesDeep f g env tinst | TType_tuple (_,typs) -> CheckTypesDeep f g env typs - | TType_fun (s,t) -> CheckTypeDeep f g env s; CheckTypeDeep f g env t + | TType_fun (s,t) -> CheckTypeDeep f g env true s; CheckTypeDeep f g env true t | TType_var tp -> if not tp.IsSolved then match visitTyparOpt with @@ -246,16 +216,17 @@ let rec CheckTypeDeep ((visitTyp,visitTyconRefOpt,visitAppTyOpt,visitTraitSoluti | Some visitTypar -> visitTypar (env,tp) -and CheckTypesDeep f g env tys = List.iter (CheckTypeDeep f g env) tys +and CheckTypesDeep f g env tys = + tys |> List.iter (CheckTypeDeep f g env true) and CheckTypeConstraintDeep f g env x = match x with - | TyparConstraint.CoercesTo(ty,_) -> CheckTypeDeep f g env ty + | TyparConstraint.CoercesTo(ty,_) -> CheckTypeDeep f g env true ty | TyparConstraint.MayResolveMember(traitInfo,_) -> CheckTraitInfoDeep f g env traitInfo - | TyparConstraint.DefaultsTo(_,ty,_) -> CheckTypeDeep f g env ty + | TyparConstraint.DefaultsTo(_,ty,_) -> CheckTypeDeep f g env true ty | TyparConstraint.SimpleChoice(tys,_) -> CheckTypesDeep f g env tys - | TyparConstraint.IsEnum(uty,_) -> CheckTypeDeep f g env uty - | TyparConstraint.IsDelegate(aty,bty,_) -> CheckTypeDeep f g env aty; CheckTypeDeep f g env bty + | TyparConstraint.IsEnum(uty,_) -> CheckTypeDeep f g env true uty + | TyparConstraint.IsDelegate(aty,bty,_) -> CheckTypeDeep f g env true aty; CheckTypeDeep f g env true bty | TyparConstraint.SupportsComparison _ | TyparConstraint.SupportsEquality _ | TyparConstraint.SupportsNull _ @@ -263,60 +234,59 @@ and CheckTypeConstraintDeep f g env x = | TyparConstraint.IsUnmanaged _ | TyparConstraint.IsReferenceType _ | TyparConstraint.RequiresDefaultConstructor _ -> () + and CheckTraitInfoDeep ((_,_,_,visitTraitSolutionOpt,_) as f) g env (TTrait(typs,_,_,argtys,rty,soln)) = CheckTypesDeep f g env typs CheckTypesDeep f g env argtys - Option.iter (CheckTypeDeep f g env) rty + Option.iter (CheckTypeDeep f g env true ) rty match visitTraitSolutionOpt, !soln with | Some visitTraitSolution, Some sln -> visitTraitSolution sln | _ -> () -//-------------------------------------------------------------------------- -// check for byref types -//-------------------------------------------------------------------------- - -let CheckForByrefLikeType cenv env typ check = - CheckTypeDeep (ignore, Some (fun tcref -> if isByrefLikeTyconRef cenv.g tcref then check()), None, None, None) cenv.g env typ +/// Check for byref-like types +let CheckForByrefLikeType cenv env m typ check = + CheckTypeDeep (ignore, Some (fun _deep tcref -> if isByrefLikeTyconRef cenv.g m tcref then check()), None, None, None) cenv.g env false typ +/// Check for byref types +let CheckForByrefType cenv env typ check = + CheckTypeDeep (ignore, Some (fun _deep tcref -> if isByrefTyconRef cenv.g tcref then check()), None, None, None) cenv.g env false typ -//-------------------------------------------------------------------------- -// check captures under lambdas -//-------------------------------------------------------------------------- - +/// check captures under lambdas +/// /// This is the definition of what can/can't be free in a lambda expression. This is checked at lambdas OR TBind(v,e) nodes OR TObjExprMethod nodes. /// For TBind(v,e) nodes we may know an 'arity' which gives as a larger set of legitimate syntactic arguments for a lambda. /// For TObjExprMethod(v,e) nodes we always know the legitimate syntactic arguments. let CheckEscapes cenv allowProtected m syntacticArgs body = (* m is a range suited to error reporting *) if cenv.reportErrors then - let cantBeFree v = - // First, if v is a syntactic argument, then it can be free since it was passed in. + let cantBeFree (v: Val) = + // If v is a syntactic argument, then it can be free since it was passed in. // The following can not be free: // a) BaseVal can never escape. // b) Byref typed values can never escape. // Note that: Local mutables can be free, as they will be boxed later. // These checks must correspond to the tests governing the error messages below. - let passedIn = ListSet.contains valEq v syntacticArgs - if passedIn then - false - else - (v.BaseOrThisInfo = BaseVal) || - (isByrefLikeTy cenv.g v.Type) + ((v.BaseOrThisInfo = BaseVal) || (isByrefLikeTy cenv.g m v.Type)) && + not (ListSet.contains valEq v syntacticArgs) let frees = freeInExpr CollectLocals body let fvs = frees.FreeLocals + if not allowProtected && frees.UsesMethodLocalConstructs then errorR(Error(FSComp.SR.chkProtectedOrBaseCalled(), m)) elif Zset.exists cantBeFree fvs then let v = List.find cantBeFree (Zset.elements fvs) - (* byref error before mutable error (byrefs are mutable...). *) - if (isByrefLikeTy cenv.g v.Type) then + + // byref error before mutable error (byrefs are mutable...). + if (isByrefLikeTy cenv.g m v.Type) then // Inner functions are not guaranteed to compile to method with a predictable arity (number of arguments). // As such, partial applications involving byref arguments could lead to closures containing byrefs. // For safety, such functions are assumed to have no known arity, and so can not accept byrefs. errorR(Error(FSComp.SR.chkByrefUsedInInvalidWay(v.DisplayName), m)) + elif v.BaseOrThisInfo = BaseVal then errorR(Error(FSComp.SR.chkBaseUsedInInvalidWay(), m)) + else (* Should be dead code, unless governing tests change *) errorR(InternalError(FSComp.SR.chkVariableUsedInInvalidWay(v.DisplayName), m)) @@ -325,16 +295,13 @@ let CheckEscapes cenv allowProtected m syntacticArgs body = (* m is a range suit None -//-------------------------------------------------------------------------- -// check type access -//-------------------------------------------------------------------------- - +/// Check type access let AccessInternalsVisibleToAsInternal thisCompPath internalsVisibleToPaths access = - // Each internalsVisibleToPath is a compPath for the internals of some assembly. - // Replace those by the compPath for the internals of this assembly. - // This makes those internals visible here, but still internal. Bug://3737 - (access,internalsVisibleToPaths) ||> List.fold (fun access internalsVisibleToPath -> - accessSubstPaths (thisCompPath,internalsVisibleToPath) access) + // Each internalsVisibleToPath is a compPath for the internals of some assembly. + // Replace those by the compPath for the internals of this assembly. + // This makes those internals visible here, but still internal. Bug://3737 + (access,internalsVisibleToPaths) ||> List.fold (fun access internalsVisibleToPath -> + accessSubstPaths (thisCompPath,internalsVisibleToPath) access) let CheckTypeForAccess (cenv:cenv) env objName valAcc m ty = @@ -351,7 +318,7 @@ let CheckTypeForAccess (cenv:cenv) env objName valAcc m ty = if isLessAccessible tyconAcc valAcc then errorR(Error(FSComp.SR.chkTypeLessAccessibleThanType(tcref.DisplayName, (objName())), m)) - CheckTypeDeep (visitType, None, None, None, None) cenv.g env ty + CheckTypeDeep (visitType, None, None, None, None) cenv.g env false ty let WarnOnWrongTypeForAccess (cenv:cenv) env objName valAcc m ty = if cenv.reportErrors then @@ -369,14 +336,83 @@ let WarnOnWrongTypeForAccess (cenv:cenv) env objName valAcc m ty = let warningText = errorText + System.Environment.NewLine + FSComp.SR.tcTypeAbbreviationsCheckedAtCompileTime() warning(AttributeChecking.ObsoleteWarning(warningText, m)) - CheckTypeDeep (visitType, None, None, None, None) cenv.g env ty + CheckTypeDeep (visitType, None, None, None, None) cenv.g env false ty -//-------------------------------------------------------------------------- -// check type instantiations -//-------------------------------------------------------------------------- +/// Indicates whether a byref or byref-like type is permitted at a particular location +[] +type PermitByRefType = + /// Don't permit any byref or byref-like types + | None + + /// Permit only an outermost Span or IsByRefLike type + | OuterSpanLike + + /// Permit only an outermost Span, IsByRefLike, inref, outref or byref type + | OuterByRefLike + + /// Permit all byref and byref-like types + | All + + +/// Indicates whether an address-of operation is permitted at a particular location +[] +type PermitByRefExpr = + /// Permit a tuple of arguments where elements can be byrefs + | YesTupleOfArgs of int + + /// Context allows for byref typed expr. + | Yes + + /// Context allows for byref typed expr, but the byref must be returnable + | YesReturnable + + /// General (address-of expr and byref values not allowed) + | No + + member context.Disallow = + match context with + | PermitByRefExpr.Yes + | PermitByRefExpr.YesReturnable -> false + | _ -> true + + member context.PermitOnlyReturnable = + match context with + | PermitByRefExpr.YesReturnable -> true + | _ -> false + +let ignoreLimit (_limit: bool) = () + +let mkArgsPermit isByRefReturnCall n = + if n=1 then + if isByRefReturnCall then PermitByRefExpr.YesReturnable else PermitByRefExpr.Yes + else PermitByRefExpr.YesTupleOfArgs n + +/// Work out what byref-values are allowed at input positions to named F# functions or members +let mkArgsForAppliedVal isBaseCall isByRefReturnCall (vref:ValRef) argsl = + match vref.ValReprInfo with + | Some topValInfo -> + let argArities = topValInfo.AritiesOfArgs + let argArities = if isBaseCall && argArities.Length >= 1 then List.tail argArities else argArities + // Check for partial applications: arguments to partial applciations don't get to use byrefs + if List.length argsl >= argArities.Length then + List.map (mkArgsPermit isByRefReturnCall) argArities + else + [] + | None -> [] + +/// Work out what byref-values are allowed at input positions to functions +let rec mkArgsForAppliedExpr isBaseCall isByRefReturnCall argsl x = + match stripExpr x with + // recognise val + | Expr.Val (vref,_,_) -> mkArgsForAppliedVal isBaseCall isByRefReturnCall vref argsl + // step through instantiations + | Expr.App(f,_fty,_tyargs,[],_) -> mkArgsForAppliedExpr isBaseCall isByRefReturnCall argsl f + // step through subsumption coercions + | Expr.Op(TOp.Coerce,_,[f],_) -> mkArgsForAppliedExpr isBaseCall isByRefReturnCall argsl f + | _ -> [] /// Check types occurring in the TAST. -let CheckType permitByrefs (cenv:cenv) env m ty = +let CheckType permitByRefLike (cenv:cenv) env m ty = if cenv.reportErrors then let visitTypar (env,tp) = if not (env.boundTypars.ContainsKey tp) then @@ -385,20 +421,28 @@ let CheckType permitByrefs (cenv:cenv) env m ty = else errorR (Error(FSComp.SR.checkNotSufficientlyGenericBecauseOfScope(tp.DisplayName),m)) - let visitTyconRef tcref = - if not permitByrefs && isByrefLikeTyconRef cenv.g tcref then + let visitTyconRef isInner tcref = + + match permitByRefLike with + | PermitByRefType.None when isByrefLikeTyconRef cenv.g m tcref -> + errorR(Error(FSComp.SR.chkErrorUseOfByref(), m)) + | PermitByRefType.OuterSpanLike when isInner && isByrefTyconRef cenv.g tcref -> + errorR(Error(FSComp.SR.chkErrorUseOfByref(), m)) + | PermitByRefType.OuterByRefLike when isInner && isByrefLikeTyconRef cenv.g m tcref -> errorR(Error(FSComp.SR.chkErrorUseOfByref(), m)) + | _ -> () + if tyconRefEq cenv.g cenv.g.system_Void_tcref tcref then errorR(Error(FSComp.SR.chkSystemVoidOnlyInTypeof(), m)) // check if T contains byref types in case of byref let visitAppTy (tcref,tinst) = - if isByrefLikeTyconRef cenv.g tcref then + if isByrefLikeTyconRef cenv.g m tcref then let visitType ty0 = match tryDestAppTy cenv.g ty0 with | None -> () - | Some tcref -> - if isByrefLikeTyconRef cenv.g tcref then + | Some tcref2 -> + if isByrefTyconRef cenv.g tcref2 then errorR(Error(FSComp.SR.chkNoByrefsOfByrefs(NicePrint.minimalStringOfType cenv.denv ty), m)) CheckTypesDeep (visitType, None, None, None, None) cenv.g env tinst @@ -411,58 +455,28 @@ let CheckType permitByrefs (cenv:cenv) env m ty = cenv.potentialUnboundUsesOfVals <- cenv.potentialUnboundUsesOfVals.Add(vref.Stamp,m) | _ -> () - CheckTypeDeep (ignore, Some visitTyconRef, Some visitAppTy, Some visitTraitSolution, Some visitTypar) cenv.g env ty + CheckTypeDeep (ignore, Some visitTyconRef, Some visitAppTy, Some visitTraitSolution, Some visitTypar) cenv.g env false ty /// Check types occurring in TAST (like CheckType) and additionally reject any byrefs. /// The additional byref checks are to catch "byref instantiations" - one place were byref are not permitted. -let CheckTypeNoByrefs (cenv:cenv) env m ty = CheckType false cenv env m ty -let CheckTypePermitByrefs (cenv:cenv) env m ty = CheckType true cenv env m ty +let CheckTypeNoByrefs (cenv:cenv) env m ty = CheckType PermitByRefType.None cenv env m ty -let CheckTypeInstNoByrefs cenv env m tyargs = - tyargs |> List.iter (CheckTypeNoByrefs cenv env m) +/// Check types occurring in TAST but allow an outer byref. +let CheckTypePermitOuterByRefLike (cenv:cenv) env m ty = CheckType PermitByRefType.OuterByRefLike cenv env m ty -let CheckTypeInstPermitByrefs cenv env m tyargs = - tyargs |> List.iter (CheckType true cenv env m) - - -//-------------------------------------------------------------------------- -// check exprs etc -//-------------------------------------------------------------------------- - -type ByrefContext = - /// Tuple of arguments where elements can be byrefs - | TupleOfArgsPermitByrefs of int - /// Context allows for byref typed expr. Flag indicates if this is a byref-return position - | PermitByref of isReturn: bool - /// General (byref type expr not allowed) - | NoByrefs +/// Check types occurring in TAST but allow an outer Span or similar +let CheckTypePermitOuterSpanLike (cenv:cenv) env m ty = CheckType PermitByRefType.OuterSpanLike cenv env m ty -let noByrefs context = match context with PermitByref _ -> false | _ -> true +/// Check types occurring in TAST but allow all byrefs. Only used on internally-generated types +let CheckTypePermitAllByrefs (cenv:cenv) env m ty = CheckType PermitByRefType.All cenv env m ty -let mkArgsPermitByrefs isByrefReturnCall n = - if n=1 then PermitByref isByrefReturnCall - else TupleOfArgsPermitByrefs n +let CheckTypeInstNoByrefs cenv env m tyargs = + tyargs |> List.iter (CheckTypeNoByrefs cenv env m) -/// Work out what byref-values are allowed at input positions to named F# functions or members -let mkArgsForAppliedVal isByrefReturnCall (vref:ValRef) = - match vref.ValReprInfo with - | Some topValInfo -> List.map (mkArgsPermitByrefs isByrefReturnCall) topValInfo.AritiesOfArgs - | None -> [] +let CheckTypeInstPermitAllByrefs cenv env m tyargs = + tyargs |> List.iter (CheckTypePermitAllByrefs cenv env m) -/// Work out what byref-values are allowed at input positions to functions -let rec mkArgsForAppliedExpr isByrefReturnCall x = - match x with - // recognise val - | Expr.Val (vref,_,_) -> mkArgsForAppliedVal isByrefReturnCall vref - // step through reclink - | Expr.Link eref -> mkArgsForAppliedExpr isByrefReturnCall !eref - // step through instantiations - | Expr.App(f,_fty,_tyargs,[],_) -> mkArgsForAppliedExpr isByrefReturnCall f - // step through subsumption coercions - | Expr.Op(TOp.Coerce,_,[f],_) -> mkArgsForAppliedExpr isByrefReturnCall f - | _ -> [] - /// Applied functions get wrapped in coerce nodes for subsumption coercions let (|OptionalCoerce|) = function | Expr.Op(TOp.Coerce _, _, [Expr.App(f, _, _, [], _)], _) -> f @@ -498,110 +512,211 @@ let CheckMultipleInterfaceInstantiations cenv interfaces m = errorR(Error(FSComp.SR.chkMultipleGenericInterfaceInstantiations((NicePrint.minimalStringOfType cenv.denv typ1), (NicePrint.minimalStringOfType cenv.denv typ2)),m)) /// Check an expression, where the expression is in a position where byrefs can be generated -let rec CheckExprNoByrefs (cenv:cenv) (env:env) expr = - CheckExpr cenv env expr NoByrefs +let rec CheckExprNoByrefs cenv env expr = + CheckExpr cenv env expr PermitByRefExpr.No |> ignoreLimit /// Check a value -and CheckVal (cenv:cenv) (env:env) v m context = +and CheckValRef (cenv:cenv) (env:env) v m (context: PermitByRefExpr) = + if cenv.reportErrors then if isSpliceOperator cenv.g v && not env.quote then errorR(Error(FSComp.SR.chkSplicingOnlyInQuotations(), m)) if isSpliceOperator cenv.g v then errorR(Error(FSComp.SR.chkNoFirstClassSplicing(), m)) if valRefEq cenv.g v cenv.g.addrof_vref then errorR(Error(FSComp.SR.chkNoFirstClassAddressOf(), m)) if valRefEq cenv.g v cenv.g.reraise_vref then errorR(Error(FSComp.SR.chkNoFirstClassRethrow(), m)) - if noByrefs context && isByrefLikeTy cenv.g v.Type then - // byref typed val can only occur in permitting contexts + + // ByRefLike-typed values can only occur in permitting contexts + if context.Disallow && isByrefLikeTy cenv.g m v.Type then errorR(Error(FSComp.SR.chkNoByrefAtThisPoint(v.DisplayName), m)) - CheckTypePermitByrefs cenv env m v.Type + + CheckTypePermitAllByrefs cenv env m v.Type // the byref checks are done at the actual binding of the value + +and IsLimitedType g m ty = + isByrefLikeTy g m ty && + not (isByrefTy g ty) + +and IsLimited cenv env m (vref: ValRef) = + IsLimitedType cenv.g m vref.Type && + // The value is a arg/local.... + vref.ValReprInfo.IsNone && + // The value is a limited Span or might have become one through mutation + let isMutableLocal = not (env.argVals.ContainsVal(vref.Deref)) && vref.IsMutable + let isLimitedLocal = cenv.limitVals.ContainsKey(vref.Stamp) + isMutableLocal || isLimitedLocal + +/// Check a use of a value +and CheckValUse (cenv: cenv) (env: env) (vref: ValRef, vFlags, m) (context: PermitByRefExpr) = + + let g = cenv.g + // Is this a Span-typed value that is limited (i.e. can't be returned) + let limit = IsLimited cenv env m vref + + if cenv.reportErrors then + + if vref.BaseOrThisInfo = BaseVal then + errorR(Error(FSComp.SR.chkLimitationsOfBaseKeyword(), m)) + + let isCallOfConstructorOfAbstractType = + (match vFlags with NormalValUse -> true | _ -> false) && + vref.IsConstructor && + (match vref.DeclaringEntity with Parent tcref -> isAbstractTycon tcref.Deref | _ -> false) + + if isCallOfConstructorOfAbstractType then + errorR(Error(FSComp.SR.tcAbstractTypeCannotBeInstantiated(),m)) + + let isReturnExprBuiltUsingByRefLocal = + context.PermitOnlyReturnable && + isByrefTy g vref.Type && + // The value is a local.... + vref.ValReprInfo.IsNone && + // The value is not an argument.... + not (env.argVals.ContainsVal(vref.Deref)) + + if isReturnExprBuiltUsingByRefLocal then + errorR(Error(FSComp.SR.chkNoByrefReturnOfLocal(vref.DisplayName), m)) + + let isReturnOfStructThis = + context.PermitOnlyReturnable && + isByrefTy g vref.Type && + (vref.BaseOrThisInfo = MemberThisVal) + + if isReturnOfStructThis then + errorR(Error(FSComp.SR.chkStructsMayNotReturnAddressesOfContents(), m)) + + CheckValRef cenv env vref m context + limit /// Check an expression, given information about the position of the expression -and CheckExpr (cenv:cenv) (env:env) expr (context:ByrefContext) = +and CheckForOverAppliedExceptionRaisingPrimitive (cenv:cenv) expr = + let g = cenv.g + let expr = stripExpr expr + + // Some things are more easily checked prior to NormalizeAndAdjustPossibleSubsumptionExprs + match expr with + | Expr.App(f,_fty,_tyargs,argsl,_m) -> + + if cenv.reportErrors then + + // Special diagnostics for `raise`, `failwith`, `failwithf`, `nullArg`, `invalidOp` library intrinsics commonly used to raise exceptions + // to warn on over-application. + match f with + | OptionalCoerce(Expr.Val(v, _, funcRange)) + when (valRefEq g v g.raise_vref || valRefEq g v g.failwith_vref || valRefEq g v g.null_arg_vref || valRefEq g v g.invalid_op_vref) -> + match argsl with + | [] | [_] -> () + | _ :: _ :: _ -> + warning(Error(FSComp.SR.checkRaiseFamilyFunctionArgumentCount(v.DisplayName, 1, argsl.Length), funcRange)) + + | OptionalCoerce(Expr.Val(v, _, funcRange)) when valRefEq g v g.invalid_arg_vref -> + match argsl with + | [] | [_] | [_; _] -> () + | _ :: _ :: _ :: _ -> + warning(Error(FSComp.SR.checkRaiseFamilyFunctionArgumentCount(v.DisplayName, 2, argsl.Length), funcRange)) + + | OptionalCoerce(Expr.Val(failwithfFunc, _, funcRange)) when valRefEq g failwithfFunc g.failwithf_vref -> + match argsl with + | Expr.App (Expr.Val(newFormat, _, _), _, [_; typB; typC; _; _], [Expr.Const(Const.String formatString, formatRange, _)], _) :: xs when valRefEq g newFormat g.new_format_vref -> + match CheckFormatStrings.TryCountFormatStringArguments formatRange g formatString typB typC with + | Some n -> + let expected = n + 1 + let actual = List.length xs + 1 + if expected < actual then + warning(Error(FSComp.SR.checkRaiseFamilyFunctionArgumentCount(failwithfFunc.DisplayName, expected, actual), funcRange)) + | None -> () + | _ -> () + | _ -> () + | _ -> () + +/// Check an expression, given information about the position of the expression +and CheckExpr (cenv:cenv) (env:env) origExpr (context:PermitByRefExpr) : bool = + let g = cenv.g + + let origExpr = stripExpr origExpr + + // CheckForOverAppliedExceptionRaisingPrimitive is more easily checked prior to NormalizeAndAdjustPossibleSubsumptionExprs + CheckForOverAppliedExceptionRaisingPrimitive cenv origExpr + let expr = NormalizeAndAdjustPossibleSubsumptionExprs g origExpr let expr = stripExpr expr match expr with | Expr.Sequential (e1,e2,dir,_,_) -> CheckExprNoByrefs cenv env e1 match dir with - | NormalSeq -> CheckExpr cenv env e2 context // carry context into _;RHS (normal sequencing only) - | ThenDoSeq -> CheckExprNoByrefs cenv {env with limited=false} e2 + | NormalSeq -> + CheckExpr cenv env e2 context // carry context into _;RHS (normal sequencing only) + | ThenDoSeq -> + CheckExprNoByrefs cenv {env with ctorLimitedZone=false} e2 + false | Expr.Let (bind,body,_,_) -> - CheckBinding cenv env false bind + let limit = CheckBinding cenv env false bind BindVal cenv env bind.Var + if limit then + LimitVal cenv bind.Var CheckExpr cenv env body context | Expr.Const (_,m,ty) -> - CheckTypePermitByrefs cenv env m ty + CheckTypePermitOuterByRefLike cenv env m ty + false - | Expr.Val (v,vFlags,m) -> - if cenv.reportErrors then - if v.BaseOrThisInfo = BaseVal then - errorR(Error(FSComp.SR.chkLimitationsOfBaseKeyword(), m)) - if (match vFlags with NormalValUse -> true | _ -> false) && - v.IsConstructor && - (match v.DeclaringEntity with Parent tcref -> isAbstractTycon tcref.Deref | _ -> false) then - errorR(Error(FSComp.SR.tcAbstractTypeCannotBeInstantiated(),m)) - - if isByrefTy cenv.g v.Type && - // A byref return location... - (match context with PermitByref isReturn -> isReturn | _ -> false) && - // The value is a local.... - v.ValReprInfo.IsNone && - // The value is not an argument... - not (env.argVals.ContainsVal(v.Deref)) then - errorR(Error(FSComp.SR.chkNoByrefReturnOfLocal(v.DisplayName), m)) - - CheckVal cenv env v m context + | Expr.Val (vref,vFlags,m) -> + CheckValUse cenv env (vref, vFlags, m) context | Expr.Quote(ast,savedConv,_isFromQueryExpression,m,ty) -> - CheckExprNoByrefs cenv {env with quote=true} ast - if cenv.reportErrors then - cenv.usesQuotations <- true - try - let qscope = QuotationTranslator.QuotationGenerationScope.Create (cenv.g,cenv.amap,cenv.viewCcu, QuotationTranslator.IsReflectedDefinition.No) - let qdata = QuotationTranslator.ConvExprPublic qscope QuotationTranslator.QuotationTranslationEnv.Empty ast - let typeDefs,spliceTypes,spliceExprs = qscope.Close() - match savedConv.Value with - | None -> savedConv:= Some (typeDefs, List.map fst spliceTypes, List.map fst spliceExprs, qdata) - | Some _ -> () - with QuotationTranslator.InvalidQuotedTerm e -> - errorRecovery e m + CheckExprNoByrefs cenv {env with quote=true} ast + if cenv.reportErrors then + cenv.usesQuotations <- true + + // Translate to quotation data + try + let qscope = QuotationTranslator.QuotationGenerationScope.Create (g,cenv.amap,cenv.viewCcu, QuotationTranslator.IsReflectedDefinition.No) + let qdata = QuotationTranslator.ConvExprPublic qscope QuotationTranslator.QuotationTranslationEnv.Empty ast + let typeDefs,spliceTypes,spliceExprs = qscope.Close() + match savedConv.Value with + | None -> savedConv:= Some (typeDefs, List.map fst spliceTypes, List.map fst spliceExprs, qdata) + | Some _ -> () + with QuotationTranslator.InvalidQuotedTerm e -> + errorRecovery e m - CheckTypeNoByrefs cenv env m ty + CheckTypeNoByrefs cenv env m ty + false | Expr.Obj (_,typ,basev,superInitCall,overrides,iimpls,m) -> - CheckExprNoByrefs cenv env superInitCall - CheckMethods cenv env basev overrides - CheckInterfaceImpls cenv env basev iimpls - CheckTypePermitByrefs cenv env m typ - let interfaces = - [ if isInterfaceTy cenv.g typ then - yield! AllSuperTypesOfType cenv.g cenv.amap m AllowMultiIntfInstantiations.Yes typ - for (ty,_) in iimpls do - yield! AllSuperTypesOfType cenv.g cenv.amap m AllowMultiIntfInstantiations.Yes ty ] - |> List.filter (isInterfaceTy cenv.g) - CheckMultipleInterfaceInstantiations cenv interfaces m + CheckExprNoByrefs cenv env superInitCall + CheckMethods cenv env basev overrides + CheckInterfaceImpls cenv env basev iimpls + CheckTypeNoByrefs cenv env m typ + + let interfaces = + [ if isInterfaceTy g typ then + yield! AllSuperTypesOfType g cenv.amap m AllowMultiIntfInstantiations.Yes typ + for (ty,_) in iimpls do + yield! AllSuperTypesOfType g cenv.amap m AllowMultiIntfInstantiations.Yes ty ] + |> List.filter (isInterfaceTy g) + + CheckMultipleInterfaceInstantiations cenv interfaces m + false // Allow base calls to F# methods - | Expr.App((InnerExprPat(ExprValWithPossibleTypeInst(v,vFlags,_,_) as f)),fty,tyargs,(Expr.Val(baseVal,_,_) :: rest),m) + | Expr.App((InnerExprPat(ExprValWithPossibleTypeInst(v,vFlags,_,_) as f)),_fty,tyargs,(Expr.Val(baseVal,_,_) :: rest),m) when ((match vFlags with VSlotDirectCall -> true | _ -> false) && baseVal.BaseOrThisInfo = BaseVal) -> - // dprintfn "GOT BASE VAL USE" + let memberInfo = Option.get v.MemberInfo if memberInfo.MemberFlags.IsDispatchSlot then errorR(Error(FSComp.SR.tcCannotCallAbstractBaseMember(v.DisplayName),m)) + false else - CheckVal cenv env v m NoByrefs - CheckVal cenv env baseVal m NoByrefs - CheckTypePermitByrefs cenv env m fty - CheckTypeInstPermitByrefs cenv env m tyargs - CheckExprs cenv env rest (List.tail (mkArgsForAppliedExpr false f)) + CheckValRef cenv env v m PermitByRefExpr.No + CheckValRef cenv env baseVal m PermitByRefExpr.No + CheckTypeInstNoByrefs cenv env m tyargs + CheckExprs cenv env rest (mkArgsForAppliedExpr true false rest f) // Allow base calls to IL methods | Expr.Op (TOp.ILCall (virt,_,_,_,_,_,_,mref,enclTypeArgs,methTypeArgs,tys),tyargs,(Expr.Val(baseVal,_,_)::rest),m) when not virt && baseVal.BaseOrThisInfo = BaseVal -> // Disallow calls to abstract base methods on IL types. - match tryDestAppTy cenv.g baseVal.Type with + match tryDestAppTy g baseVal.Type with | Some tcref when tcref.IsILTycon -> try // This is awkward - we have to explicitly re-resolve back to the IL metadata to determine if the method is abstract. @@ -613,70 +728,42 @@ and CheckExpr (cenv:cenv) (env:env) expr (context:ByrefContext) = errorR(Error(FSComp.SR.tcCannotCallAbstractBaseMember(mdef.Name),m)) with _ -> () // defensive coding | _ -> () + CheckTypeInstNoByrefs cenv env m tyargs CheckTypeInstNoByrefs cenv env m enclTypeArgs CheckTypeInstNoByrefs cenv env m methTypeArgs CheckTypeInstNoByrefs cenv env m tys - CheckVal cenv env baseVal m NoByrefs - CheckExprsPermitByrefs cenv env rest + CheckValRef cenv env baseVal m PermitByRefExpr.No + CheckExprsPermitByRefLike cenv env rest | Expr.Op (c,tyargs,args,m) -> - CheckExprOp cenv env (c,tyargs,args,m) context expr + CheckExprOp cenv env (c,tyargs,args,m) context expr // Allow 'typeof' calls as a special case, the only accepted use of System.Void! - | TypeOfExpr cenv.g ty when isVoidTy cenv.g ty -> - () // typeof allowed. Special case. No further checks. + | TypeOfExpr g ty when isVoidTy g ty -> + false - | TypeDefOfExpr cenv.g ty when isVoidTy cenv.g ty -> - () // typedefof allowed. Special case. No further checks. + // Allow 'typedefof' calls as a special case, the only accepted use of System.Void! + | TypeDefOfExpr g ty when isVoidTy g ty -> + false // Allow '%expr' in quotations - | Expr.App(Expr.Val(vref,_,_),_,tinst,[arg],m) when isSpliceOperator cenv.g vref && env.quote -> - CheckTypeInstPermitByrefs cenv env m tinst + | Expr.App(Expr.Val(vref,_,_),_,tinst,[arg],m) when isSpliceOperator g vref && env.quote -> + CheckTypeInstPermitAllByrefs cenv env m tinst // it's the splice operator, a byref instantiation is allowed CheckExprNoByrefs cenv env arg + false - | Expr.App(f,fty,tyargs,argsl,m) -> - if cenv.reportErrors then - let g = cenv.g - match f with - | OptionalCoerce(Expr.Val(v, _, funcRange)) - when (valRefEq g v g.raise_vref || valRefEq g v g.failwith_vref || valRefEq g v g.null_arg_vref || valRefEq g v g.invalid_op_vref) -> - match argsl with - | [] | [_] -> () - | _ :: _ :: _ -> - warning(Error(FSComp.SR.checkRaiseFamilyFunctionArgumentCount(v.DisplayName, 1, List.length argsl), funcRange)) - | OptionalCoerce(Expr.Val(v, _, funcRange)) when valRefEq g v g.invalid_arg_vref -> - match argsl with - | [] | [_] | [_; _] -> () - | _ :: _ :: _ :: _ -> - warning(Error(FSComp.SR.checkRaiseFamilyFunctionArgumentCount(v.DisplayName, 2, List.length argsl), funcRange)) - | OptionalCoerce(Expr.Val(failwithfFunc, _, funcRange)) when valRefEq g failwithfFunc g.failwithf_vref -> - match argsl with - | Expr.App (Expr.Val(newFormat, _, _), _, [_; typB; typC; _; _], [Expr.Const(Const.String formatString, formatRange, _)], _) :: xs when valRefEq g newFormat g.new_format_vref -> - match CheckFormatStrings.TryCountFormatStringArguments formatRange g formatString typB typC with - | Some n -> - let expected = n + 1 - let actual = List.length xs + 1 - if expected < actual then - warning(Error(FSComp.SR.checkRaiseFamilyFunctionArgumentCount(failwithfFunc.DisplayName, expected, actual), funcRange)) - | None -> () - | _ -> - () - | _ -> - () + // Check an application + | Expr.App(f,_fty,tyargs,argsl,m) -> CheckTypeInstNoByrefs cenv env m tyargs - CheckTypePermitByrefs cenv env m fty - CheckTypeInstPermitByrefs cenv env m tyargs CheckExprNoByrefs cenv env f - let isByrefReturnCall = - // if return is a byref, and being used as a return, then all arguments must be usable as byref returns - match context with - | PermitByref true when isByrefTy cenv.g (tyOfExpr cenv.g expr) -> true - | _ -> false - CheckExprs cenv env argsl (mkArgsForAppliedExpr isByrefReturnCall f) - - // REVIEW: fold the next two cases together + + // If return is a byref, and being used as a return, then all arguments must be usable as byref returns + let isByRefReturnCall = context.PermitOnlyReturnable && isByrefTy g (tyOfExpr g expr) + + CheckExprs cenv env argsl (mkArgsForAppliedExpr false isByRefReturnCall argsl f) + | Expr.Lambda(_,_ctorThisValOpt,_baseValOpt,argvs,_,m,rty) -> let topValInfo = ValReprInfo ([],[argvs |> List.map (fun _ -> ValReprInfo.unnamedTopArg1)],ValReprInfo.unnamedRetVal) let ty = mkMultiLambdaTy m argvs rty in @@ -688,11 +775,12 @@ and CheckExpr (cenv:cenv) (env:env) expr (context:ByrefContext) = CheckLambdas false None cenv env false topValInfo false expr m ty | Expr.TyChoose(tps,e1,_) -> - let env = BindTypars cenv.g env tps + let env = BindTypars g env tps CheckExprNoByrefs cenv env e1 + false | Expr.Match(_,_,dtree,targets,m,ty) -> - CheckTypePermitByrefs cenv env m ty // computed byrefs allowed at each branch + CheckTypePermitAllByrefs cenv env m ty // computed byrefs allowed at each branch CheckDecisionTree cenv env dtree CheckDecisionTreeTargets cenv env targets context @@ -700,6 +788,7 @@ and CheckExpr (cenv:cenv) (env:env) expr (context:ByrefContext) = BindVals cenv env (valsOfBinds binds) CheckBindings cenv env binds CheckExprNoByrefs cenv env e + false | Expr.StaticOptimization (constraints,e2,e3,m) -> CheckExprNoByrefs cenv env e2 @@ -710,20 +799,24 @@ and CheckExpr (cenv:cenv) (env:env) expr (context:ByrefContext) = CheckTypeNoByrefs cenv env m ty2 | TTyconIsStruct(ty1) -> CheckTypeNoByrefs cenv env m ty1) + false | Expr.Link _ -> failwith "Unexpected reclink" -and CheckMethods cenv env baseValOpt l = - l |> List.iter (CheckMethod cenv env baseValOpt) +and CheckMethods cenv env baseValOpt methods = + methods |> List.iter (CheckMethod cenv env baseValOpt) and CheckMethod cenv env baseValOpt (TObjExprMethod(_,attribs,tps,vs,body,m)) = let env = BindTypars cenv.g env tps let vs = List.concat vs + let env = BindArgVals env vs CheckAttribs cenv env attribs CheckNoReraise cenv None body CheckEscapes cenv true m (match baseValOpt with Some x -> x:: vs | None -> vs) body |> ignore - CheckExprPermitByref cenv env body + let limit = CheckExprPermitReturnableByRef cenv env body + if limit then + errorR(Error(FSComp.SR.chkNoReturnOfLimitedSpan(), body.Range)) and CheckInterfaceImpls cenv env baseValOpt l = l |> List.iter (CheckInterfaceImpl cenv env baseValOpt) @@ -732,183 +825,252 @@ and CheckInterfaceImpl cenv env baseValOpt (_ty,overrides) = CheckMethods cenv env baseValOpt overrides and CheckExprOp cenv env (op,tyargs,args,m) context expr = - let limitedCheck() = - if env.limited then errorR(Error(FSComp.SR.chkObjCtorsCantUseExceptionHandling(), m)) - List.iter (CheckTypePermitByrefs cenv env m) tyargs + let g = cenv.g + let ctorLimitedZoneCheck() = + if env.ctorLimitedZone then errorR(Error(FSComp.SR.chkObjCtorsCantUseExceptionHandling(), m)) + (* Special cases *) match op,tyargs,args with // Handle these as special cases since mutables are allowed inside their bodies | TOp.While _,_,[Expr.Lambda(_,_,_,[_],e1,_,_);Expr.Lambda(_,_,_,[_],e2,_,_)] -> CheckTypeInstNoByrefs cenv env m tyargs - CheckExprsNoByrefs cenv env [e1;e2] + CheckExprsNoByRefLike cenv env [e1;e2] | TOp.TryFinally _,[_],[Expr.Lambda(_,_,_,[_],e1,_,_); Expr.Lambda(_,_,_,[_],e2,_,_)] -> - CheckTypeInstPermitByrefs cenv env m tyargs // result of a try/finally can be a byref - limitedCheck() - CheckExpr cenv env e1 context // result of a try/finally can be a byref if in a position where the overall expression is can be a byref + CheckTypeInstPermitAllByrefs cenv env m tyargs // result of a try/finally can be a byref + ctorLimitedZoneCheck() + let limit = CheckExpr cenv env e1 context // result of a try/finally can be a byref if in a position where the overall expression is can be a byref CheckExprNoByrefs cenv env e2 + limit | TOp.For(_),_,[Expr.Lambda(_,_,_,[_],e1,_,_);Expr.Lambda(_,_,_,[_],e2,_,_);Expr.Lambda(_,_,_,[_],e3,_,_)] -> CheckTypeInstNoByrefs cenv env m tyargs - CheckExprsNoByrefs cenv env [e1;e2;e3] + CheckExprsNoByRefLike cenv env [e1;e2;e3] | TOp.TryCatch _,[_],[Expr.Lambda(_,_,_,[_],e1,_,_); Expr.Lambda(_,_,_,[_],_e2,_,_); Expr.Lambda(_,_,_,[_],e3,_,_)] -> - CheckTypeInstPermitByrefs cenv env m tyargs // result of a try/catch can be a byref - limitedCheck() - CheckExpr cenv env e1 context // result of a try/catch can be a byref if in a position where the overall expression is can be a byref + CheckTypeInstPermitAllByrefs cenv env m tyargs // result of a try/catch can be a byref + ctorLimitedZoneCheck() + let limit1 = CheckExpr cenv env e1 context // result of a try/catch can be a byref if in a position where the overall expression is can be a byref // [(* e2; -- don't check filter body - duplicates logic in 'catch' body *) e3] - CheckExpr cenv env e3 context // result of a try/catch can be a byref if in a position where the overall expression is can be a byref + let limit2 = CheckExpr cenv env e3 context // result of a try/catch can be a byref if in a position where the overall expression is can be a byref + limit1 || limit2 | TOp.ILCall (_,_,_,_,_,_,_,_,enclTypeArgs,methTypeArgs,tys),_,_ -> CheckTypeInstNoByrefs cenv env m tyargs CheckTypeInstNoByrefs cenv env m enclTypeArgs CheckTypeInstNoByrefs cenv env m methTypeArgs - CheckTypeInstPermitByrefs cenv env m tys // permit byref returns + CheckTypeInstPermitAllByrefs cenv env m tys // permit byref returns // if return is a byref, and being used as a return, then all arguments must be usable as byref returns - match context,tys with - | PermitByref true, [ty] when isByrefTy cenv.g ty -> CheckExprsPermitByrefReturns cenv env args - | _ -> CheckExprsPermitByrefs cenv env args - + match tys with + | [ty] when context.PermitOnlyReturnable && isByrefLikeTy g m ty -> CheckExprsPermitReturnableByRef cenv env args + | _ -> CheckExprsPermitByRefLike cenv env args | TOp.Tuple tupInfo,_,_ when not (evalTupInfoIsStruct tupInfo) -> match context with - | TupleOfArgsPermitByrefs nArity -> + | PermitByRefExpr.YesTupleOfArgs nArity -> if cenv.reportErrors then if args.Length <> nArity then errorR(InternalError("Tuple arity does not correspond to planned function argument arity",m)) // This tuple should not be generated. The known function arity // means it just bundles arguments. - CheckExprsPermitByrefs cenv env args + CheckExprsPermitByRefLike cenv env args | _ -> CheckTypeInstNoByrefs cenv env m tyargs - CheckExprsNoByrefs cenv env args + CheckExprsNoByRefLike cenv env args - | TOp.LValueOp(LGetAddr,v),_,_ -> + | TOp.LValueOp(LAddrOf _,vref),_,_ -> if cenv.reportErrors then - if noByrefs context && cenv.reportErrors then - errorR(Error(FSComp.SR.chkNoAddressOfAtThisPoint(v.DisplayName), m)) - elif (// The context is a byref return.... - match context with PermitByref isReturn -> isReturn | _ -> false) && - // The value is a local.... - v.ValReprInfo.IsNone && - // The value is not an argument... - not (env.argVals.ContainsVal(v.Deref)) then - errorR(Error(FSComp.SR.chkNoByrefReturnOfLocal(v.DisplayName), m)) - - // Address-of operator generates byref, and context permits this. - CheckExprsNoByrefs cenv env args + + if context.Disallow then + errorR(Error(FSComp.SR.chkNoAddressOfAtThisPoint(vref.DisplayName), m)) + + let returningAddrOfLocal = + context.PermitOnlyReturnable && + // The value is a local.... + vref.ValReprInfo.IsNone && + // The value is not an argument... + not (env.argVals.ContainsVal(vref.Deref)) + + if returningAddrOfLocal then + errorR(Error(FSComp.SR.chkNoByrefAddressOfLocal(vref.DisplayName), m)) + + let limit1 = IsLimited cenv env m vref + let limit2 = CheckExprsNoByRefLike cenv env args + limit1 || limit2 + + | TOp.LValueOp(LByrefSet,vref),_,[arg] -> + let limit1 = IsLimitedType g m (tyOfExpr g arg) && not (env.argVals.ContainsVal(vref.Deref)) + let limit2 = CheckExprPermitByRefLike cenv env arg + if not limit1 && limit2 then + errorR(Error(FSComp.SR.chkNoWriteToLimitedSpan(vref.DisplayName), m)) + false + + | TOp.LValueOp(LByrefGet,vref),_,[] -> + let limit1 = isByrefTy g vref.Type && IsLimitedType g m (destByrefTy g vref.Type) && not (env.argVals.ContainsVal(vref.Deref)) + limit1 + + | TOp.LValueOp(LSet _, vref),_,[arg] -> + let limit1 = IsLimited cenv env m vref + let limit2 = CheckExprPermitByRefLike cenv env arg + if not limit1 && limit2 then + errorR(Error(FSComp.SR.chkNoWriteToLimitedSpan(vref.DisplayName), m)) + false | TOp.TupleFieldGet _,_,[arg1] -> CheckTypeInstNoByrefs cenv env m tyargs - CheckExprsPermitByrefs cenv env [arg1] (* Compiled pattern matches on immutable value structs come through here. *) + CheckExprsPermitByRefLike cenv env [arg1] (* Compiled pattern matches on immutable value structs come through here. *) | TOp.ValFieldGet _rf,_,[arg1] -> CheckTypeInstNoByrefs cenv env m tyargs //See mkRecdFieldGetViaExprAddr -- byref arg1 when #args =1 // Property getters on mutable structs come through here. - CheckExprsPermitByrefs cenv env [arg1] + CheckExprsPermitByRefLike cenv env [arg1] | TOp.ValFieldSet _rf,_,[arg1;arg2] -> CheckTypeInstNoByrefs cenv env m tyargs // See mkRecdFieldSetViaExprAddr -- byref arg1 when #args=2 // Field setters on mutable structs come through here - CheckExprsPermitByrefs cenv env [arg1] - CheckExprsNoByrefs cenv env [arg2] + CheckExprsPermitByRefLike cenv env [arg1; arg2] - | TOp.Coerce,[_ty1;_ty2],[x] -> - // Subsumption coercions of functions may involve byrefs in other argument positions - CheckTypeInstPermitByrefs cenv env m tyargs - CheckExpr cenv env x context + | TOp.Coerce,[tgty;srcty],[x] -> + if TypeRelations.TypeDefinitelySubsumesTypeNoCoercion 0 g cenv.amap m tgty srcty then + CheckExpr cenv env x context + else + CheckTypeInstNoByrefs cenv env m tyargs + CheckExprNoByrefs cenv env x + false | TOp.Reraise,[_ty1],[] -> - CheckTypeInstNoByrefs cenv env m tyargs + CheckTypeInstNoByrefs cenv env m tyargs + false - | TOp.ValFieldGetAddr rfref,tyargs,[] -> - if noByrefs context && cenv.reportErrors && isByrefLikeTy cenv.g (tyOfExpr cenv.g expr) then + // Check get of static field + | TOp.ValFieldGetAddr (rfref, _readonly),tyargs,[] -> + + if context.Disallow && cenv.reportErrors && isByrefLikeTy g m (tyOfExpr g expr) then errorR(Error(FSComp.SR.chkNoAddressStaticFieldAtThisPoint(rfref.FieldName), m)) + CheckTypeInstNoByrefs cenv env m tyargs - // NOTE: there are no arg exprs to check in this case + false + + // Check get of instance field + | TOp.ValFieldGetAddr (rfref, _readonly),tyargs,[obj] -> + + if context.Disallow && cenv.reportErrors && isByrefLikeTy g m (tyOfExpr g expr) then + errorR(Error(FSComp.SR.chkNoAddressFieldAtThisPoint(rfref.FieldName), m)) + + // C# applies a rule where the APIs to struct types can't return the addresses of fields in that struct. + // There seems no particular reason for this given that other protections in the language, though allowing + // it would mean "readonly" on a struct doesn't imply immutabality-of-contents - it only implies + if context.PermitOnlyReturnable && (match obj with Expr.Val(vref, _, _) -> vref.BaseOrThisInfo = MemberThisVal | _ -> false) && isByrefTy g (tyOfExpr g obj) then + errorR(Error(FSComp.SR.chkStructsMayNotReturnAddressesOfContents(), m)) - | TOp.ValFieldGetAddr rfref,tyargs,[rx] -> - if noByrefs context && cenv.reportErrors && isByrefLikeTy cenv.g (tyOfExpr cenv.g expr) then + if context.Disallow && cenv.reportErrors && isByrefLikeTy g m (tyOfExpr g expr) then errorR(Error(FSComp.SR.chkNoAddressFieldAtThisPoint(rfref.FieldName), m)) + // This construct is used for &(rx.rfield) and &(rx->rfield). Relax to permit byref types for rx. [See Bug 1263]. CheckTypeInstNoByrefs cenv env m tyargs - CheckExprPermitByref cenv env rx + + // Recursively check in same context, e.g. if at PermitOnlyReturnable the obj arg must also be returnable + CheckExpr cenv env obj context | TOp.UnionCaseFieldGet _,_,[arg1] -> CheckTypeInstNoByrefs cenv env m tyargs - CheckExprPermitByref cenv env arg1 + CheckExprPermitByRefLike cenv env arg1 | TOp.UnionCaseTagGet _,_,[arg1] -> CheckTypeInstNoByrefs cenv env m tyargs - CheckExprPermitByref cenv env arg1 // allow byref - it may be address-of-struct + CheckExprPermitByRefLike cenv env arg1 // allow byref - it may be address-of-struct + + | TOp.UnionCaseFieldGetAddr (uref, _idx, _readonly),tyargs,[obj] -> - | TOp.UnionCaseFieldGetAddr (uref, _idx),tyargs,[rx] -> - if noByrefs context && cenv.reportErrors && isByrefLikeTy cenv.g (tyOfExpr cenv.g expr) then + if context.Disallow && cenv.reportErrors && isByrefLikeTy g m (tyOfExpr g expr) then errorR(Error(FSComp.SR.chkNoAddressFieldAtThisPoint(uref.CaseName), m)) + + if context.PermitOnlyReturnable && (match obj with Expr.Val(vref, _, _) -> vref.BaseOrThisInfo = MemberThisVal | _ -> false) && isByrefTy g (tyOfExpr g obj) then + errorR(Error(FSComp.SR.chkStructsMayNotReturnAddressesOfContents(), m)) + CheckTypeInstNoByrefs cenv env m tyargs - // allow rx to be byref here, for struct unions - CheckExprPermitByref cenv env rx + + // Recursively check in same context, e.g. if at PermitOnlyReturnable the obj arg must also be returnable + CheckExpr cenv env obj context | TOp.ILAsm (instrs,tys),_,_ -> - CheckTypeInstPermitByrefs cenv env m tys + CheckTypeInstPermitAllByrefs cenv env m tys CheckTypeInstNoByrefs cenv env m tyargs match instrs,args with - | [ I_stfld (_alignment,_vol,_fspec) ],[lhs;rhs] -> + // Write a .NET instance field + | [ I_stfld (_alignment,_vol,_fspec) ],_ -> // permit byref for lhs lvalue - CheckExprPermitByref cenv env lhs - CheckExprNoByrefs cenv env rhs - | [ I_ldfld (_alignment,_vol,_fspec) ],[lhs] -> + // permit byref for rhs lvalue (field would have to have ByRefLike type, i.e. be a field in another ByRefLike type) + CheckExprsPermitByRefLike cenv env args + + // Read a .NET instance field + | [ I_ldfld (_alignment,_vol,_fspec) ],_ -> // permit byref for lhs lvalue - CheckExprPermitByref cenv env lhs - | [ I_ldfld (_alignment,_vol,_fspec); AI_nop ],[lhs] -> + CheckExprsPermitByRefLike cenv env args + + // Read a .NET instance field + | [ I_ldfld (_alignment,_vol,_fspec); AI_nop ],_ -> // permit byref for lhs lvalue of readonly value - CheckExprPermitByref cenv env lhs - | [ I_ldflda (fspec) | I_ldsflda (fspec) ],[lhs] -> - if noByrefs context && cenv.reportErrors && isByrefLikeTy cenv.g (tyOfExpr cenv.g expr) then + CheckExprsPermitByRefLike cenv env args + + | [ I_ldsflda (fspec) ], [] -> + if context.Disallow && cenv.reportErrors && isByrefLikeTy g m (tyOfExpr g expr) then + errorR(Error(FSComp.SR.chkNoAddressFieldAtThisPoint(fspec.Name), m)) + + false + + | [ I_ldflda (fspec) ], [obj] -> + if context.Disallow && cenv.reportErrors && isByrefLikeTy g m (tyOfExpr g expr) then errorR(Error(FSComp.SR.chkNoAddressFieldAtThisPoint(fspec.Name), m)) - // permit byref for lhs lvalue - CheckExprPermitByref cenv env lhs + + // Recursively check in same context, e.g. if at PermitOnlyReturnable the obj arg must also be returnable + CheckExpr cenv env obj context + | [ I_ldelema (_,isNativePtr,_,_) ],lhsArray::indices -> - if noByrefs context && cenv.reportErrors && not isNativePtr && isByrefLikeTy cenv.g (tyOfExpr cenv.g expr) then + if context.Disallow && cenv.reportErrors && not isNativePtr && isByrefLikeTy g m (tyOfExpr g expr) then errorR(Error(FSComp.SR.chkNoAddressOfArrayElementAtThisPoint(), m)) // permit byref for lhs lvalue - CheckExprPermitByref cenv env lhsArray - CheckExprsNoByrefs cenv env indices + let limit = CheckExprPermitByRefLike cenv env lhsArray + CheckExprsNoByRefLike cenv env indices |> ignoreLimit + limit + | [ AI_conv _ ],_ -> // permit byref for args to conv - CheckExprsPermitByrefs cenv env args + CheckExprsPermitByRefLike cenv env args + | _ -> - CheckExprsNoByrefs cenv env args + CheckExprsNoByRefLike cenv env args | TOp.TraitCall _,_,_ -> CheckTypeInstNoByrefs cenv env m tyargs // allow args to be byref here - CheckExprsPermitByrefs cenv env args + CheckExprsPermitByRefLike cenv env args | _ -> CheckTypeInstNoByrefs cenv env m tyargs - CheckExprsNoByrefs cenv env args + CheckExprsNoByRefLike cenv env args and CheckLambdas isTop (memInfo: ValMemberInfo option) cenv env inlined topValInfo alwaysCheckNoReraise e m ety = + let g = cenv.g // The topValInfo here says we are _guaranteeing_ to compile a function value // as a .NET method with precisely the corresponding argument counts. match e with | Expr.TyChoose(tps,e1,m) -> - let env = BindTypars cenv.g env tps + let env = BindTypars g env tps CheckLambdas isTop memInfo cenv env inlined topValInfo alwaysCheckNoReraise e1 m ety | Expr.Lambda (_,_,_,_,_,m,_) | Expr.TyLambda(_,_,_,m,_) -> - let tps,ctorThisValOpt,baseValOpt,vsl,body,bodyty = destTopLambda cenv.g cenv.amap topValInfo (e, ety) in - let env = BindTypars cenv.g env tps + let tps,ctorThisValOpt,baseValOpt,vsl,body,bodyty = destTopLambda g cenv.amap topValInfo (e, ety) in + let env = BindTypars g env tps let thisAndBase = Option.toList ctorThisValOpt @ Option.toList baseValOpt let restArgs = List.concat vsl let syntacticArgs = thisAndBase @ restArgs - let env = SetArgVals env restArgs + let env = BindArgVals env restArgs match memInfo with | None -> () @@ -920,7 +1082,7 @@ and CheckLambdas isTop (memInfo: ValMemberInfo option) cenv env inlined topValIn | true, firstArg::_ -> firstArg.SetHasBeenReferenced() | _ -> () // any byRef arguments are considered used, as they may be 'out's - restArgs |> List.iter (fun arg -> if isByrefTy cenv.g arg.Type then arg.SetHasBeenReferenced()) + restArgs |> List.iter (fun arg -> if isByrefTy g arg.Type then arg.SetHasBeenReferenced()) syntacticArgs |> List.iter (CheckValSpec cenv env) syntacticArgs |> List.iter (BindVal cenv env) @@ -931,67 +1093,83 @@ and CheckLambdas isTop (memInfo: ValMemberInfo option) cenv env inlined topValIn | Some membInfo -> testHookMemberBody membInfo body // Check escapes in the body. Allow access to protected things within members. - let freesOpt = CheckEscapes cenv (Option.isSome memInfo) m syntacticArgs body + let freesOpt = CheckEscapes cenv memInfo.IsSome m syntacticArgs body // no reraise under lambda expression CheckNoReraise cenv freesOpt body // Check the body of the lambda - if (not (isNil tps) || not (isNil vsl)) && isTop && not cenv.g.compilingFslib && isByrefTy cenv.g bodyty then - // allow byref to occur as return position for byref-typed top level function or method - CheckExprPermitByrefReturn cenv env body - else - CheckExprNoByrefs cenv env body + let limit = + if isTop && not g.compilingFslib && isByrefLikeTy g m bodyty then + // allow byref to occur as return position for byref-typed top level function or method + CheckExprPermitReturnableByRef cenv env body + else + CheckExprNoByrefs cenv env body + false // Check byref return types if cenv.reportErrors then - if (not inlined && (isNil tps && isNil vsl)) || not isTop then - CheckForByrefLikeType cenv env bodyty (fun () -> + if not isTop then + CheckForByrefLikeType cenv env m bodyty (fun () -> errorR(Error(FSComp.SR.chkFirstClassFuncNoByref(), m))) - elif not cenv.g.compilingFslib && isByrefTy cenv.g bodyty then + elif not g.compilingFslib && isByrefTy g bodyty then // check no byrefs-in-the-byref - CheckForByrefLikeType cenv env (destByrefTy cenv.g bodyty) (fun () -> + CheckForByrefType cenv env (destByrefTy g bodyty) (fun () -> errorR(Error(FSComp.SR.chkReturnTypeNoByref(), m))) + if limit then + errorR(Error(FSComp.SR.chkNoReturnOfLimitedSpan(), m)) + for tp in tps do - if tp.Constraints |> List.sumBy (function TyparConstraint.CoercesTo(ty,_) when isClassTy cenv.g ty -> 1 | _ -> 0) > 1 then + if tp.Constraints |> List.sumBy (function TyparConstraint.CoercesTo(ty,_) when isClassTy g ty -> 1 | _ -> 0) > 1 then errorR(Error(FSComp.SR.chkTyparMultipleClassConstraints(), m)) + + false // This path is for expression bindings that are not actually lambdas | _ -> // Permit byrefs for let x = ... - CheckTypePermitByrefs cenv env m ety - if not inlined && (isByrefLikeTy cenv.g ety || isNativePtrTy cenv.g ety) then - // allow byref to occur as RHS of byref binding. - CheckExprPermitByref cenv env e - else - CheckExprNoByrefs cenv env e + CheckTypePermitAllByrefs cenv env m ety + let limit = + if not inlined && (isByrefLikeTy g m ety || isNativePtrTy g ety) then + // allow byref to occur as RHS of byref binding. + CheckExprPermitByRefLike cenv env e + else + CheckExprNoByrefs cenv env e + false + if alwaysCheckNoReraise then CheckNoReraise cenv None e + limit -and CheckExprs cenv env exprs contexts = +and CheckExprs cenv env exprs contexts : bool = let contexts = Array.ofList contexts - let argArity i = if i < contexts.Length then contexts.[i] else NoByrefs - exprs |> List.iteri (fun i exp -> CheckExpr cenv env exp (argArity i)) + let argArity i = if i < contexts.Length then contexts.[i] else PermitByRefExpr.No + let limits = exprs |> List.mapi (fun i exp -> CheckExpr cenv env exp (argArity i)) + limits |> List.existsTrue -and CheckExprsNoByrefs cenv env exprs = +and CheckExprsNoByRefLike cenv env exprs : bool = exprs |> List.iter (CheckExprNoByrefs cenv env) + false -and CheckExprsPermitByrefs cenv env exprs = - exprs |> List.iter (CheckExprPermitByref cenv env) +and CheckExprsPermitByRefLike cenv env exprs = + let limits = exprs |> List.map (CheckExprPermitByRefLike cenv env) + limits |> List.existsTrue -and CheckExprsPermitByrefReturns cenv env exprs = - exprs |> List.iter (CheckExprPermitByrefReturn cenv env) +and CheckExprsPermitReturnableByRef cenv env exprs : bool = + let limits = exprs |> List.map (CheckExprPermitReturnableByRef cenv env) + limits |> List.existsTrue -and CheckExprPermitByref cenv env expr = - CheckExpr cenv env expr (PermitByref false) +and CheckExprPermitByRefLike cenv env expr = + CheckExpr cenv env expr PermitByRefExpr.Yes -and CheckExprPermitByrefReturn cenv env expr = - CheckExpr cenv env expr (PermitByref true) +and CheckExprPermitReturnableByRef cenv env expr : bool = + CheckExpr cenv env expr PermitByRefExpr.YesReturnable and CheckDecisionTreeTargets cenv env targets context = - targets |> Array.iter (CheckDecisionTreeTarget cenv env context) + let limits = targets |> Array.map (CheckDecisionTreeTarget cenv env context) + limits |> Array.existsTrue and CheckDecisionTreeTarget cenv env context (TTarget(vs,e,_)) = BindVals cenv env vs @@ -1000,22 +1178,26 @@ and CheckDecisionTreeTarget cenv env context (TTarget(vs,e,_)) = and CheckDecisionTree cenv env x = match x with - | TDSuccess (es,_) -> CheckExprsNoByrefs cenv env es - | TDBind(bind,rest) -> CheckBinding cenv env false bind; CheckDecisionTree cenv env rest - | TDSwitch (e,cases,dflt,m) -> CheckDecisionTreeSwitch cenv env (e,cases,dflt,m) + | TDSuccess (es,_) -> + CheckExprsNoByRefLike cenv env es |> ignoreLimit + | TDBind(bind,rest) -> + CheckBinding cenv env false bind |> ignoreLimit + CheckDecisionTree cenv env rest + | TDSwitch (e,cases,dflt,m) -> + CheckDecisionTreeSwitch cenv env (e,cases,dflt,m) and CheckDecisionTreeSwitch cenv env (e,cases,dflt,m) = - CheckExprPermitByref cenv env e // can be byref for struct union switch + CheckExprPermitByRefLike cenv env e |> ignoreLimit // can be byref for struct union switch cases |> List.iter (fun (TCase(discrim,e)) -> CheckDecisionTreeTest cenv env m discrim; CheckDecisionTree cenv env e) dflt |> Option.iter (CheckDecisionTree cenv env) and CheckDecisionTreeTest cenv env m discrim = match discrim with - | DecisionTreeTest.UnionCase (_,tinst) -> CheckTypeInstPermitByrefs cenv env m tinst - | DecisionTreeTest.ArrayLength (_,typ) -> CheckTypePermitByrefs cenv env m typ + | DecisionTreeTest.UnionCase (_,tinst) -> CheckTypeInstPermitAllByrefs cenv env m tinst + | DecisionTreeTest.ArrayLength (_,typ) -> CheckTypePermitAllByrefs cenv env m typ | DecisionTreeTest.Const _ -> () | DecisionTreeTest.IsNull -> () - | DecisionTreeTest.IsInst (srcTyp,dstTyp) -> CheckTypePermitByrefs cenv env m srcTyp; CheckTypePermitByrefs cenv env m dstTyp + | DecisionTreeTest.IsInst (srcTyp,dstTyp) -> CheckTypePermitAllByrefs cenv env m srcTyp; CheckTypePermitAllByrefs cenv env m dstTyp | DecisionTreeTest.ActivePatternCase (exp,_,_,_,_) -> CheckExprNoByrefs cenv env exp and CheckAttrib cenv env (Attrib(_,_,args,props,_,_,_)) = @@ -1029,6 +1211,7 @@ and CheckAttribExpr cenv env (AttribExpr(expr,vexpr)) = CheckAttribArgExpr cenv env vexpr and CheckAttribArgExpr cenv env expr = + let g = cenv.g match expr with // Detect standard constants @@ -1055,15 +1238,15 @@ and CheckAttribArgExpr cenv env expr = | Expr.Op(TOp.Array,[_elemTy],args,_m) -> List.iter (CheckAttribArgExpr cenv env) args - | TypeOfExpr cenv.g _ -> + | TypeOfExpr g _ -> () - | TypeDefOfExpr cenv.g _ -> + | TypeDefOfExpr g _ -> () | Expr.Op(TOp.Coerce,_,[arg],_) -> CheckAttribArgExpr cenv env arg - | EnumExpr cenv.g arg1 -> + | EnumExpr g arg1 -> CheckAttribArgExpr cenv env arg1 - | AttribBitwiseOrExpr cenv.g (arg1,arg2) -> + | AttribBitwiseOrExpr g (arg1,arg2) -> CheckAttribArgExpr cenv env arg1 CheckAttribArgExpr cenv env arg2 | _ -> @@ -1101,7 +1284,7 @@ and CheckArgInfo cenv env (argInfo : ArgReprInfo) = and CheckValSpec cenv env (v:Val) = v.Attribs |> CheckAttribs cenv env v.ValReprInfo |> Option.iter (CheckValInfo cenv env) - v.Type |> CheckTypePermitByrefs cenv env v.Range + v.Type |> CheckTypePermitAllByrefs cenv env v.Range and AdjustAccess isHidden (cpath: unit -> CompilationPath) access = if isHidden then @@ -1112,16 +1295,17 @@ and AdjustAccess isHidden (cpath: unit -> CompilationPath) access = else access -and CheckBinding cenv env alwaysCheckNoReraise (TBind(v,bindRhs,_) as bind) = +and CheckBinding cenv env alwaysCheckNoReraise (TBind(v,bindRhs,_) as bind) : bool = + let g = cenv.g let isTop = Option.isSome bind.Var.ValReprInfo //printfn "visiting %s..." v.DisplayName - let env = { env with external = env.external || cenv.g.attrib_DllImportAttribute |> Option.exists (fun attr -> HasFSharpAttribute cenv.g attr v.Attribs) } + let env = { env with external = env.external || g.attrib_DllImportAttribute |> Option.exists (fun attr -> HasFSharpAttribute g attr v.Attribs) } // Check that active patterns don't have free type variables in their result match TryGetActivePatternInfo (mkLocalValRef v) with | Some _apinfo when _apinfo.ActiveTags.Length > 1 -> - if doesActivePatternHaveFreeTypars cenv.g (mkLocalValRef v) then + if doesActivePatternHaveFreeTypars g (mkLocalValRef v) then errorR(Error(FSComp.SR.activePatternChoiceHasFreeTypars(v.LogicalName),v.Range)) | _ -> () @@ -1132,7 +1316,7 @@ and CheckBinding cenv env alwaysCheckNoReraise (TBind(v,bindRhs,_) as bind) = errorR(Error(FSComp.SR.chkMemberUsedInInvalidWay(nm, nm, stringOfRange m), v.Range)) // Byrefs allowed for x in 'let x = ...' - v.Type |> CheckTypePermitByrefs cenv env v.Range + v.Type |> CheckTypePermitAllByrefs cenv env v.Range v.Attribs |> CheckAttribs cenv env v.ValReprInfo |> Option.iter (CheckValInfo cenv env) @@ -1141,14 +1325,14 @@ and CheckBinding cenv env alwaysCheckNoReraise (TBind(v,bindRhs,_) as bind) = let access = AdjustAccess (IsHiddenVal env.sigToImplRemapInfo v) (fun () -> v.TopValDeclaringEntity.CompilationPath) v.Accessibility CheckTypeForAccess cenv env (fun () -> NicePrint.stringOfQualifiedValOrMember cenv.denv v) access v.Range v.Type - let env = if v.IsConstructor && not v.IsIncrClassConstructor then { env with limited=true } else env + let env = if v.IsConstructor && not v.IsIncrClassConstructor then { env with ctorLimitedZone=true } else env if cenv.reportErrors then // Check top-level let-bound values match bind.Var.ValReprInfo with | Some info when info.HasNoArgs -> - CheckForByrefLikeType cenv env v.Type (fun () -> errorR(Error(FSComp.SR.chkNoByrefAsTopValue(),v.Range))) + CheckForByrefLikeType cenv env v.Range v.Type (fun () -> errorR(Error(FSComp.SR.chkNoByrefAsTopValue(),v.Range))) | _ -> () if Option.isSome v.PublicPath then @@ -1160,11 +1344,11 @@ and CheckBinding cenv env alwaysCheckNoReraise (TBind(v,bindRhs,_) as bind) = (// Check the attributes on any enclosing module env.reflect || // Check the attributes on the value - HasFSharpAttribute cenv.g cenv.g.attrib_ReflectedDefinitionAttribute v.Attribs || + HasFSharpAttribute g g.attrib_ReflectedDefinitionAttribute v.Attribs || // Also check the enclosing type for members - for historical reasons, in the TAST member values // are stored in the entity that encloses the type, hence we will not have noticed the ReflectedDefinition // on the enclosing type at this point. - HasFSharpAttribute cenv.g cenv.g.attrib_ReflectedDefinitionAttribute v.TopValDeclaringEntity.Attribs) then + HasFSharpAttribute g g.attrib_ReflectedDefinitionAttribute v.TopValDeclaringEntity.Attribs) then if v.IsInstanceMember && v.MemberApparentEntity.IsStructOrEnumTycon then errorR(Error(FSComp.SR.chkNoReflectedDefinitionOnStructMember(),v.Range)) @@ -1179,13 +1363,13 @@ and CheckBinding cenv env alwaysCheckNoReraise (TBind(v,bindRhs,_) as bind) = // no real need for that except that it helps us to bundle all reflected definitions up into // one blob for pickling to the binary format try - let ety = tyOfExpr cenv.g bindRhs + let ety = tyOfExpr g bindRhs let tps,taue,_ = match bindRhs with - | Expr.TyLambda (_,tps,b,_,_) -> tps,b,applyForallTy cenv.g ety (List.map mkTyparTy tps) + | Expr.TyLambda (_,tps,b,_,_) -> tps,b,applyForallTy g ety (List.map mkTyparTy tps) | _ -> [],bindRhs,ety let env = QuotationTranslator.QuotationTranslationEnv.Empty.BindTypars tps - let qscope = QuotationTranslator.QuotationGenerationScope.Create (cenv.g,cenv.amap,cenv.viewCcu, QuotationTranslator.IsReflectedDefinition.Yes) + let qscope = QuotationTranslator.QuotationGenerationScope.Create (g,cenv.amap,cenv.viewCcu, QuotationTranslator.IsReflectedDefinition.Yes) QuotationTranslator.ConvExprPublic qscope env taue |> ignore let _,_,argExprs = qscope.Close() if not (isNil argExprs) then @@ -1200,8 +1384,8 @@ and CheckBinding cenv env alwaysCheckNoReraise (TBind(v,bindRhs,_) as bind) = match memberInfo.MemberFlags.MemberKind with | (MemberKind.PropertySet | MemberKind.PropertyGet) -> // These routines raise errors for ill-formed properties - v |> ReturnTypeOfPropertyVal cenv.g |> ignore - v |> ArgInfosOfPropertyVal cenv.g |> ignore + v |> ReturnTypeOfPropertyVal g |> ignore + v |> ArgInfosOfPropertyVal g |> ignore | _ -> () @@ -1211,11 +1395,13 @@ and CheckBinding cenv env alwaysCheckNoReraise (TBind(v,bindRhs,_) as bind) = CheckLambdas isTop v.MemberInfo cenv env v.MustInline topValInfo alwaysCheckNoReraise bindRhs v.Range v.Type -and CheckBindings cenv env xs = List.iter (CheckBinding cenv env false) xs +and CheckBindings cenv env xs = + xs |> List.iter (CheckBinding cenv env false >> ignoreLimit) // Top binds introduce expression, check they are reraise free. let CheckModuleBinding cenv env (TBind(v,e,_) as bind) = - let isExplicitEntryPoint = HasFSharpAttribute cenv.g cenv.g.attrib_EntryPointAttribute v.Attribs + let g = cenv.g + let isExplicitEntryPoint = HasFSharpAttribute g g.attrib_EntryPointAttribute v.Attribs if isExplicitEntryPoint then cenv.entryPointGiven <- true let isLastCompiland = fst cenv.isLastCompiland @@ -1226,14 +1412,14 @@ let CheckModuleBinding cenv env (TBind(v,e,_) as bind) = if // Mutable values always have fields not v.IsMutable && // Literals always have fields - not (HasFSharpAttribute cenv.g cenv.g.attrib_LiteralAttribute v.Attribs) && - not (HasFSharpAttributeOpt cenv.g cenv.g.attrib_ThreadStaticAttribute v.Attribs) && - not (HasFSharpAttributeOpt cenv.g cenv.g.attrib_ContextStaticAttribute v.Attribs) && + not (HasFSharpAttribute g g.attrib_LiteralAttribute v.Attribs) && + not (HasFSharpAttributeOpt g g.attrib_ThreadStaticAttribute v.Attribs) && + not (HasFSharpAttributeOpt g g.attrib_ContextStaticAttribute v.Attribs) && // Having a field makes the binding a static initialization trigger - IsSimpleSyntacticConstantExpr cenv.g e && + IsSimpleSyntacticConstantExpr g e && // Check the thing is actually compiled as a property - IsCompiledAsStaticProperty cenv.g v || - (cenv.g.compilingFslib && v.Attribs |> List.exists(fun (Attrib(tc,_,_,_,_,_,_)) -> tc.CompiledName = "ValueAsStaticPropertyAttribute")) + IsCompiledAsStaticProperty g v || + (g.compilingFslib && v.Attribs |> List.exists(fun (Attrib(tc,_,_,_,_,_,_)) -> tc.CompiledName = "ValueAsStaticPropertyAttribute")) then v.SetIsCompiledAsStaticPropertyWithoutField() @@ -1244,7 +1430,7 @@ let CheckModuleBinding cenv env (TBind(v,e,_) as bind) = // Skip compiler generated values if v.IsCompilerGenerated then () else // Skip explicit implementations of interface methods - if ValIsExplicitImpl cenv.g v then () else + if ValIsExplicitImpl g v then () else match v.DeclaringEntity with | ParentNone -> () // this case can happen after error recovery from earlier error @@ -1252,7 +1438,7 @@ let CheckModuleBinding cenv env (TBind(v,e,_) as bind) = let tcref = v.TopValDeclaringEntity let hasDefaultAugmentation = tcref.IsUnionTycon && - match TryFindFSharpAttribute cenv.g cenv.g.attrib_DefaultAugmentationAttribute tcref.Attribs with + match TryFindFSharpAttribute g g.attrib_DefaultAugmentationAttribute tcref.Attribs with | Some(Attrib(_,_,[ AttribBoolArg(b) ],_,_,_,_)) -> b | _ -> true (* not hiddenRepr *) @@ -1316,10 +1502,10 @@ let CheckModuleBinding cenv env (TBind(v,e,_) as bind) = if v.IsExtensionMember then tcref.ModuleOrNamespaceType.AllValsAndMembersByLogicalNameUncached.[v.LogicalName] |> List.iter (fun v2 -> if v2.IsExtensionMember && not (valEq v v2) && v.CompiledName = v2.CompiledName then - let minfo1 = FSMeth(cenv.g, generalizedTyconRef tcref, mkLocalValRef v, Some 0UL) - let minfo2 = FSMeth(cenv.g, generalizedTyconRef tcref, mkLocalValRef v2, Some 0UL) - if tyconRefEq cenv.g v.MemberApparentEntity v2.MemberApparentEntity && - MethInfosEquivByNameAndSig EraseAll true cenv.g cenv.amap v.Range minfo1 minfo2 then + let minfo1 = FSMeth(g, generalizedTyconRef tcref, mkLocalValRef v, Some 0UL) + let minfo2 = FSMeth(g, generalizedTyconRef tcref, mkLocalValRef v2, Some 0UL) + if tyconRefEq g v.MemberApparentEntity v2.MemberApparentEntity && + MethInfosEquivByNameAndSig EraseAll true g cenv.amap v.Range minfo1 minfo2 then errorR(Duplicate(kind,v.DisplayName,v.Range))) @@ -1338,44 +1524,61 @@ let CheckModuleBinding cenv env (TBind(v,e,_) as bind) = with e -> errorRecovery e v.Range end - CheckBinding cenv env true bind + CheckBinding cenv env true bind |> ignoreLimit -let CheckModuleBindings cenv env binds = List.iter (CheckModuleBinding cenv env) binds +let CheckModuleBindings cenv env binds = + binds |> List.iter (CheckModuleBinding cenv env) //-------------------------------------------------------------------------- // check tycons //-------------------------------------------------------------------------- let CheckRecdField isUnion cenv env (tycon:Tycon) (rfield:RecdField) = + let g = cenv.g + let tcref = mkLocalTyconRef tycon + let m = rfield.Range let isHidden = IsHiddenTycon env.sigToImplRemapInfo tycon || IsHiddenTyconRepr env.sigToImplRemapInfo tycon || - (not isUnion && IsHiddenRecdField env.sigToImplRemapInfo ((mkLocalTyconRef tycon).MakeNestedRecdFieldRef rfield)) + (not isUnion && IsHiddenRecdField env.sigToImplRemapInfo (tcref.MakeNestedRecdFieldRef rfield)) let access = AdjustAccess isHidden (fun () -> tycon.CompilationPath) rfield.Accessibility - CheckTypeForAccess cenv env (fun () -> rfield.Name) access rfield.Range rfield.FormalType - CheckTypeNoByrefs cenv env rfield.Range rfield.FormalType + CheckTypeForAccess cenv env (fun () -> rfield.Name) access m rfield.FormalType + + if TyconRefHasAttribute g m g.attrib_IsByRefLikeAttribute tcref then + // Permit Span fields in IsByRefLike types + CheckTypePermitOuterSpanLike cenv env m rfield.FormalType + else + CheckTypeNoByrefs cenv env m rfield.FormalType + if cenv.reportErrors then + CheckForByrefLikeType cenv env m rfield.FormalType (fun () -> errorR(Error(FSComp.SR.chkCantStoreByrefValue(), tycon.Range))) + CheckAttribs cenv env rfield.PropertyAttribs CheckAttribs cenv env rfield.FieldAttribs - if cenv.reportErrors then - CheckForByrefLikeType cenv env rfield.FormalType (fun () -> errorR(Error(FSComp.SR.chkCantStoreByrefValue(), tycon.Range))) let CheckEntityDefn cenv env (tycon:Entity) = #if !NO_EXTENSIONTYPING if not tycon.IsProvidedGeneratedTycon then #endif - let env = { env with reflect = env.reflect || HasFSharpAttribute cenv.g cenv.g.attrib_ReflectedDefinitionAttribute tycon.Attribs } + let g = cenv.g let m = tycon.Range - let env = BindTypars cenv.g env (tycon.Typars(m)) + let tcref = mkLocalTyconRef tycon + let typ = generalizedTyconRef tcref + + let env = { env with reflect = env.reflect || HasFSharpAttribute g g.attrib_ReflectedDefinitionAttribute tycon.Attribs } + let env = BindTypars g env (tycon.Typars(m)) + CheckAttribs cenv env tycon.Attribs + match tycon.TypeAbbrev with | Some abbrev -> WarnOnWrongTypeForAccess cenv env (fun () -> tycon.CompiledName) tycon.Accessibility tycon.Range abbrev | _ -> () if cenv.reportErrors then + if not tycon.IsTypeAbbrev then - let typ = generalizedTyconRef (mkLocalTyconRef tycon) + let allVirtualMethsInParent = - match GetSuperTypeOfType cenv.g cenv.amap m typ with + match GetSuperTypeOfType g cenv.amap m typ with | Some super -> GetIntrinsicMethInfosOfType cenv.infoReader (None,AccessibleFromSomewhere,AllowMultiIntfInstantiations.Yes) IgnoreOverrides m super |> List.filter (fun minfo -> minfo.IsVirtual) @@ -1385,14 +1588,14 @@ let CheckEntityDefn cenv env (tycon:Entity) = let methodUniquenessIncludesReturnType (minfo:MethInfo) = List.contains minfo.LogicalName namesOfMethodsThatMayDifferOnlyInReturnType let MethInfosEquivWrtUniqueness eraseFlag m minfo minfo2 = if methodUniquenessIncludesReturnType minfo - then MethInfosEquivByNameAndSig eraseFlag true cenv.g cenv.amap m minfo minfo2 - else MethInfosEquivByNameAndPartialSig eraseFlag true cenv.g cenv.amap m minfo minfo2 (* partial ignores return type *) + then MethInfosEquivByNameAndSig eraseFlag true g cenv.amap m minfo minfo2 + else MethInfosEquivByNameAndPartialSig eraseFlag true g cenv.amap m minfo minfo2 (* partial ignores return type *) let immediateMeths = - [ for v in tycon.AllGeneratedValues do yield FSMeth (cenv.g,typ,v,None) - yield! GetImmediateIntrinsicMethInfosOfType (None,AccessibleFromSomewhere) cenv.g cenv.amap m typ ] + [ for v in tycon.AllGeneratedValues do yield FSMeth (g,typ,v,None) + yield! GetImmediateIntrinsicMethInfosOfType (None,AccessibleFromSomewhere) g cenv.amap m typ ] - let immediateProps = GetImmediateIntrinsicPropInfosOfType (None,AccessibleFromSomewhere) cenv.g cenv.amap m typ + let immediateProps = GetImmediateIntrinsicPropInfosOfType (None,AccessibleFromSomewhere) g cenv.amap m typ let getHash (hash:Dictionary) nm = match hash.TryGetValue(nm) with @@ -1447,34 +1650,35 @@ let CheckEntityDefn cenv env (tycon:Entity) = if numCurriedArgSets > 1 && (minfo.GetParamDatas(cenv.amap, m, minfo.FormalMethodInst) - |> List.existsSquared (fun (ParamData(isParamArrayArg, isOutArg, optArgInfo, callerInfoInfo, _, reflArgInfo, ty)) -> - isParamArrayArg || isOutArg || reflArgInfo.AutoQuote || optArgInfo.IsOptional || callerInfoInfo <> NoCallerInfo || isByrefTy cenv.g ty)) then + |> List.existsSquared (fun (ParamData(isParamArrayArg, _isInArg, isOutArg, optArgInfo, callerInfoInfo, _, reflArgInfo, ty)) -> + isParamArrayArg || isOutArg || reflArgInfo.AutoQuote || optArgInfo.IsOptional || callerInfoInfo <> NoCallerInfo || isByrefLikeTy g m ty)) then errorR(Error(FSComp.SR.chkCurriedMethodsCantHaveOutParams(), m)) if numCurriedArgSets = 1 then minfo.GetParamDatas(cenv.amap, m, minfo.FormalMethodInst) - |> List.iterSquared (fun (ParamData(_, _, optArgInfo, callerInfoInfo, _, _, ty)) -> + |> List.iterSquared (fun (ParamData(_, isInArg, _, optArgInfo, callerInfoInfo, _, _, ty)) -> + ignore isInArg match (optArgInfo, callerInfoInfo) with | _, NoCallerInfo -> () | NotOptional, _ -> errorR(Error(FSComp.SR.tcCallerInfoNotOptional(callerInfoInfo.ToString()),m)) | CallerSide(_), CallerLineNumber -> - if not (typeEquiv cenv.g cenv.g.int32_ty ty) then + if not (typeEquiv g g.int32_ty ty) then errorR(Error(FSComp.SR.tcCallerInfoWrongType(callerInfoInfo.ToString(), "int", NicePrint.minimalStringOfType cenv.denv ty),m)) | CalleeSide, CallerLineNumber -> - if not ((isOptionTy cenv.g ty) && (typeEquiv cenv.g cenv.g.int32_ty (destOptionTy cenv.g ty))) then - errorR(Error(FSComp.SR.tcCallerInfoWrongType(callerInfoInfo.ToString(), "int", NicePrint.minimalStringOfType cenv.denv (destOptionTy cenv.g ty)),m)) + if not ((isOptionTy g ty) && (typeEquiv g g.int32_ty (destOptionTy g ty))) then + errorR(Error(FSComp.SR.tcCallerInfoWrongType(callerInfoInfo.ToString(), "int", NicePrint.minimalStringOfType cenv.denv (destOptionTy g ty)),m)) | CallerSide(_), CallerFilePath -> - if not (typeEquiv cenv.g cenv.g.string_ty ty) then + if not (typeEquiv g g.string_ty ty) then errorR(Error(FSComp.SR.tcCallerInfoWrongType(callerInfoInfo.ToString(), "string", NicePrint.minimalStringOfType cenv.denv ty),m)) | CalleeSide, CallerFilePath -> - if not ((isOptionTy cenv.g ty) && (typeEquiv cenv.g cenv.g.string_ty (destOptionTy cenv.g ty))) then - errorR(Error(FSComp.SR.tcCallerInfoWrongType(callerInfoInfo.ToString(), "string", NicePrint.minimalStringOfType cenv.denv (destOptionTy cenv.g ty)),m)) + if not ((isOptionTy g ty) && (typeEquiv g g.string_ty (destOptionTy g ty))) then + errorR(Error(FSComp.SR.tcCallerInfoWrongType(callerInfoInfo.ToString(), "string", NicePrint.minimalStringOfType cenv.denv (destOptionTy g ty)),m)) | CallerSide(_), CallerMemberName -> - if not (typeEquiv cenv.g cenv.g.string_ty ty) then + if not (typeEquiv g g.string_ty ty) then errorR(Error(FSComp.SR.tcCallerInfoWrongType(callerInfoInfo.ToString(), "string", NicePrint.minimalStringOfType cenv.denv ty),m)) | CalleeSide, CallerMemberName -> - if not ((isOptionTy cenv.g ty) && (typeEquiv cenv.g cenv.g.string_ty (destOptionTy cenv.g ty))) then - errorR(Error(FSComp.SR.tcCallerInfoWrongType(callerInfoInfo.ToString(), "string", NicePrint.minimalStringOfType cenv.denv (destOptionTy cenv.g ty)),m))) + if not ((isOptionTy g ty) && (typeEquiv g g.string_ty (destOptionTy g ty))) then + errorR(Error(FSComp.SR.tcCallerInfoWrongType(callerInfoInfo.ToString(), "string", NicePrint.minimalStringOfType cenv.denv (destOptionTy g ty)),m))) for pinfo in immediateProps do let nm = pinfo.PropertyName @@ -1497,7 +1701,7 @@ let CheckEntityDefn cenv env (tycon:Entity) = x.IsDispatchSlot && y.IsDefiniteFSharpOverride not (IsAbstractDefaultPair pinfo pinfo2 || IsAbstractDefaultPair pinfo2 pinfo) - && PropInfosEquivByNameAndPartialSig erasureFlag cenv.g cenv.amap m pinfo pinfo2 (* partial ignores return type *) + && PropInfosEquivByNameAndPartialSig erasureFlag g cenv.amap m pinfo pinfo2 (* partial ignores return type *) if others |> List.exists (checkForDup EraseAll) then if others |> List.exists (checkForDup EraseNone) then @@ -1527,7 +1731,7 @@ let CheckEntityDefn cenv env (tycon:Entity) = hashOfImmediateProps.[nm] <- pinfo::others - if not (isInterfaceTy cenv.g typ) then + if not (isInterfaceTy g typ) then let hashOfAllVirtualMethsInParent = new Dictionary() for minfo in allVirtualMethsInParent do let nm = minfo.LogicalName @@ -1538,7 +1742,7 @@ let CheckEntityDefn cenv env (tycon:Entity) = let nm = minfo.LogicalName let m = (match minfo.ArbitraryValRef with None -> m | Some vref -> vref.DefinitionRange) let parentMethsOfSameName = getHash hashOfAllVirtualMethsInParent nm - let checkForDup erasureFlag (minfo2:MethInfo) = minfo2.IsDispatchSlot && MethInfosEquivByNameAndSig erasureFlag true cenv.g cenv.amap m minfo minfo2 + let checkForDup erasureFlag (minfo2:MethInfo) = minfo2.IsDispatchSlot && MethInfosEquivByNameAndSig erasureFlag true g cenv.amap m minfo minfo2 match parentMethsOfSameName |> List.tryFind (checkForDup EraseAll) with | None -> () | Some minfo -> @@ -1553,7 +1757,7 @@ let CheckEntityDefn cenv env (tycon:Entity) = let nm = minfo.LogicalName let m = (match minfo.ArbitraryValRef with None -> m | Some vref -> vref.DefinitionRange) let parentMethsOfSameName = getHash hashOfAllVirtualMethsInParent nm - let checkForDup erasureFlag minfo2 = MethInfosEquivByNameAndSig erasureFlag true cenv.g cenv.amap m minfo minfo2 + let checkForDup erasureFlag minfo2 = MethInfosEquivByNameAndSig erasureFlag true g cenv.amap m minfo minfo2 //if minfo.NumArgs.Length > 1 then // warning(Error(sprintf "Abstract methods taking curried arguments Duplicate method. The method '%s' has curried arguments but has the same name as another method in this type. Methods with curried arguments may not be overloaded" nm,(match minfo.ArbitraryValRef with None -> m | Some vref -> vref.DefinitionRange))) if parentMethsOfSameName |> List.exists (checkForDup EraseAll) then @@ -1561,17 +1765,34 @@ let CheckEntityDefn cenv env (tycon:Entity) = errorR(Error(FSComp.SR.chkDuplicateMethodInheritedType(nm),m)) else errorR(Error(FSComp.SR.chkDuplicateMethodInheritedTypeWithSuffix(nm),m)) + + if TyconRefHasAttribute g m g.attrib_IsByRefLikeAttribute tcref && not tycon.IsStructOrEnumTycon then + errorR(Error(FSComp.SR.tcByRefLikeNotStruct(), tycon.Range)) + + if TyconRefHasAttribute g m g.attrib_IsReadOnlyAttribute tcref && not tycon.IsStructOrEnumTycon then + errorR(Error(FSComp.SR.tcIsReadOnlyNotStruct(), tycon.Range)) + // Considers TFSharpObjectRepr, TRecdRepr and TUnionRepr. // [Review] are all cases covered: TILObjectRepr,TAsmRepr. [Yes - these are FSharp.Core.dll only] tycon.AllFieldsArray |> Array.iter (CheckRecdField false cenv env tycon) // Abstract slots can have byref arguments and returns - abstractSlotValsOfTycons [tycon] |> List.iter (typeOfVal >> CheckTypePermitByrefs cenv env m) + for vref in abstractSlotValsOfTycons [tycon] do + match vref.ValReprInfo with + | Some topValInfo -> + let tps, argtysl, rty, _ = GetTopValTypeInFSharpForm g topValInfo vref.Type m + let env = BindTypars g env tps + for argtys in argtysl do + for (argty, _) in argtys do + CheckTypePermitOuterByRefLike cenv env m argty + CheckTypePermitOuterByRefLike cenv env m rty + + | None -> () - // Interface slots can have byref arguments and returns - tycon.ImmediateInterfaceTypesOfFSharpTycon |> List.iter (CheckTypePermitByrefs cenv env m) + // Supported interface may not have byrefs + tycon.ImmediateInterfaceTypesOfFSharpTycon |> List.iter (CheckTypeNoByrefs cenv env m) - superOfTycon cenv.g tycon |> CheckTypeNoByrefs cenv env m + superOfTycon g tycon |> CheckTypeNoByrefs cenv env m if tycon.IsUnionTycon then tycon.UnionCasesAsList |> List.iter (fun uc -> @@ -1581,11 +1802,13 @@ let CheckEntityDefn cenv env (tycon:Entity) = // Access checks let access = AdjustAccess (IsHiddenTycon env.sigToImplRemapInfo tycon) (fun () -> tycon.CompilationPath) tycon.Accessibility let visitType ty = CheckTypeForAccess cenv env (fun () -> tycon.DisplayNameWithStaticParametersAndUnderscoreTypars) access tycon.Range ty + abstractSlotValsOfTycons [tycon] |> List.iter (typeOfVal >> visitType) - superOfTycon cenv.g tycon |> visitType + + superOfTycon g tycon |> visitType // We do not have to check access of interface implementations. See FSharp 1.0 5042 - //implements_of_tycon cenv.g tycon |> List.iter visitType + //implements_of_tycon g tycon |> List.iter visitType if tycon.IsFSharpDelegateTycon then match tycon.TypeReprInfo with | TFSharpObjectRepr r -> @@ -1600,19 +1823,21 @@ let CheckEntityDefn cenv env (tycon:Entity) = let interfaces = - AllSuperTypesOfType cenv.g cenv.amap tycon.Range AllowMultiIntfInstantiations.Yes (generalizedTyconRef (mkLocalTyconRef tycon)) - |> List.filter (isInterfaceTy cenv.g) + AllSuperTypesOfType g cenv.amap tycon.Range AllowMultiIntfInstantiations.Yes typ + |> List.filter (isInterfaceTy g) if tycon.IsFSharpInterfaceTycon then List.iter visitType interfaces // Check inherited interface is as accessible + + if not (isRecdOrStructTyconRefAssumedImmutable g tcref) && isRecdOrStructTyconRefReadOnly g m tcref then + errorR(Error(FSComp.SR.readOnlyAttributeOnStructWithMutableField(),m)) if cenv.reportErrors then if not tycon.IsTypeAbbrev then - let typ = generalizedTyconRef (mkLocalTyconRef tycon) - let immediateInterfaces = GetImmediateInterfacesOfType SkipUnrefInterfaces.Yes cenv.g cenv.amap m typ + let immediateInterfaces = GetImmediateInterfacesOfType SkipUnrefInterfaces.Yes g cenv.amap m typ let interfaces = [ for ty in immediateInterfaces do - yield! AllSuperTypesOfType cenv.g cenv.amap m AllowMultiIntfInstantiations.Yes ty ] + yield! AllSuperTypesOfType g cenv.amap m AllowMultiIntfInstantiations.Yes ty ] CheckMultipleInterfaceInstantiations cenv interfaces m // Check struct fields. We check these late because we have to have first checked that the structs are @@ -1620,17 +1845,18 @@ let CheckEntityDefn cenv env (tycon:Entity) = if tycon.IsStructOrEnumTycon then for f in tycon.AllInstanceFieldsAsList do // Check if it's marked unsafe - let zeroInitUnsafe = TryFindFSharpBoolAttribute cenv.g cenv.g.attrib_DefaultValueAttribute f.FieldAttribs + let zeroInitUnsafe = TryFindFSharpBoolAttribute g g.attrib_DefaultValueAttribute f.FieldAttribs if zeroInitUnsafe = Some(true) then - let ty' = generalizedTyconRef (mkLocalTyconRef tycon) - if not (TypeHasDefaultValue cenv.g m ty') then + if not (TypeHasDefaultValue g m typ) then errorR(Error(FSComp.SR.chkValueWithDefaultValueMustHaveDefaultValue(), m)) // Check type abbreviations match tycon.TypeAbbrev with | None -> () | Some typ -> - CheckForByrefLikeType cenv env typ (fun () -> errorR(Error(FSComp.SR.chkNoByrefInTypeAbbrev(), tycon.Range))) + // Library-defined outref<'T> and inref<'T> contain byrefs on the r.h.s. + if not g.compilingFslib then + CheckForByrefType cenv env typ (fun () -> errorR(Error(FSComp.SR.chkNoByrefInTypeAbbrev(), tycon.Range))) let CheckEntityDefns cenv env tycons = tycons |> List.iter (CheckEntityDefn cenv env) @@ -1686,6 +1912,7 @@ let CheckTopImpl (g,amap,reportErrors,infoReader,internalsVisibleToPaths,viewCcu { g =g reportErrors=reportErrors boundVals= new Dictionary<_,_>(100, HashIdentity.Structural) + limitVals= new Dictionary<_,_>(100, HashIdentity.Structural) potentialUnboundUsesOfVals=Map.empty usesQuotations=false infoReader=infoReader @@ -1699,18 +1926,18 @@ let CheckTopImpl (g,amap,reportErrors,infoReader,internalsVisibleToPaths,viewCcu // Certain type equality checks go faster if these TyconRefs are pre-resolved. // This is because pre-resolving allows tycon equality to be determined by pointer equality on the entities. // See primEntityRefEq. - cenv.g.system_Void_tcref.TryDeref |> ignore - cenv.g.byref_tcr.TryDeref |> ignore + g.system_Void_tcref.TryDeref |> ignore + g.byref_tcr.TryDeref |> ignore let resolve = function Some(t : TyconRef) -> ignore(t.TryDeref) | _ -> () - resolve cenv.g.system_TypedReference_tcref - resolve cenv.g.system_ArgIterator_tcref - resolve cenv.g.system_RuntimeArgumentHandle_tcref + resolve g.system_TypedReference_tcref + resolve g.system_ArgIterator_tcref + resolve g.system_RuntimeArgumentHandle_tcref let env = { sigToImplRemapInfo=[] quote=false - limited=false + ctorLimitedZone=false boundTyparNames=[] argVals = ValMap.Empty boundTypars= TyparMap.Empty @@ -1719,6 +1946,6 @@ let CheckTopImpl (g,amap,reportErrors,infoReader,internalsVisibleToPaths,viewCcu CheckModuleExpr cenv env mexpr CheckAttribs cenv env extraAttribs - if cenv.usesQuotations && QuotationTranslator.QuotationGenerationScope.ComputeQuotationFormat(cenv.g) = QuotationTranslator.QuotationSerializationFormat.FSharp_20_Plus then + if cenv.usesQuotations && QuotationTranslator.QuotationGenerationScope.ComputeQuotationFormat(g) = QuotationTranslator.QuotationSerializationFormat.FSharp_20_Plus then viewCcu.UsesFSharp20PlusQuotations <- true cenv.entryPointGiven diff --git a/src/fsharp/QuotationTranslator.fs b/src/fsharp/QuotationTranslator.fs index eacd5ca599..f9eac0c07a 100644 --- a/src/fsharp/QuotationTranslator.fs +++ b/src/fsharp/QuotationTranslator.fs @@ -426,7 +426,7 @@ and private ConvExprCore cenv (env : QuotationTranslationEnv) (expr: Expr) : QP. | TOp.UnionCaseFieldGet (ucref,n),tyargs,[e] -> ConvUnionFieldGet cenv env m ucref n tyargs e - | TOp.ValFieldGetAddr(_rfref),_tyargs,_ -> + | TOp.ValFieldGetAddr(_rfref, _readonly),_tyargs,_ -> wfail(Error(FSComp.SR.crefQuotationsCantContainAddressOf(), m)) | TOp.UnionCaseFieldGetAddr _,_tyargs,_ -> @@ -518,7 +518,7 @@ and private ConvExprCore cenv (env : QuotationTranslationEnv) (expr: Expr) : QP. // rebuild reraise() and Convert mkReraiseLibCall cenv.g toTy m |> ConvExpr cenv env - | TOp.LValueOp(LGetAddr,vref),[],[] -> + | TOp.LValueOp(LAddrOf _,vref),[],[] -> QP.mkAddressOf(ConvValRef false cenv env m vref []) | TOp.LValueOp(LByrefSet,vref),[],[e] -> @@ -586,7 +586,7 @@ and private ConvExprCore cenv (env : QuotationTranslationEnv) (expr: Expr) : QP. | TOp.UnionCaseTagGet _tycr,_tinst,[_cx] -> wfail(Error(FSComp.SR.crefQuotationsCantFetchUnionIndexes(), m)) | TOp.UnionCaseFieldSet (_c,_i),_tinst,[_cx;_x] -> wfail(Error(FSComp.SR.crefQuotationsCantSetUnionFields(), m)) | TOp.ExnFieldSet(_tcref,_i),[],[_ex;_x] -> wfail(Error(FSComp.SR.crefQuotationsCantSetExceptionFields(), m)) - | TOp.RefAddrGet,_,_ -> wfail(Error(FSComp.SR.crefQuotationsCantRequireByref(), m)) + | TOp.RefAddrGet _,_,_ -> wfail(Error(FSComp.SR.crefQuotationsCantRequireByref(), m)) | TOp.TraitCall (_ss),_,_ -> wfail(Error(FSComp.SR.crefQuotationsCantCallTraitMembers(), m)) | _ -> wfail(InternalError( "Unexpected expression shape",m)) @@ -665,9 +665,9 @@ and ConvLValueExprCore cenv env expr = match expr with | Expr.Op(op,tyargs,args,m) -> match op, args, tyargs with - | TOp.LValueOp(LGetAddr,vref),_,_ -> ConvValRef false cenv env m vref [] - | TOp.ValFieldGetAddr(rfref),_,_ -> ConvClassOrRecdFieldGet cenv env m rfref tyargs args - | TOp.UnionCaseFieldGetAddr(ucref,n),[e],_ -> ConvUnionFieldGet cenv env m ucref n tyargs e + | TOp.LValueOp(LAddrOf _,vref),_,_ -> ConvValRef false cenv env m vref [] + | TOp.ValFieldGetAddr(rfref, _),_,_ -> ConvClassOrRecdFieldGet cenv env m rfref tyargs args + | TOp.UnionCaseFieldGetAddr(ucref,n, _),[e],_ -> ConvUnionFieldGet cenv env m ucref n tyargs e | TOp.ILAsm([ I_ldflda(fspec) ],_rtys),_,_ -> ConvLdfld cenv env m fspec tyargs args | TOp.ILAsm([ I_ldsflda(fspec) ],_rtys),_,_ -> ConvLdfld cenv env m fspec tyargs args | TOp.ILAsm(([ I_ldelema(_ro,_isNativePtr,shape,_tyarg) ] ),_), (arr::idxs), [elemty] -> diff --git a/src/fsharp/TastOps.fs b/src/fsharp/TastOps.fs index 6efc464da5..729553b212 100644 --- a/src/fsharp/TastOps.fs +++ b/src/fsharp/TastOps.fs @@ -560,8 +560,45 @@ let tryNormalizeMeasureInType g ty = // Some basic type builders //--------------------------------------------------------------------------- -let mkNativePtrTy (g:TcGlobals) ty = TType_app (g.nativeptr_tcr, [ty]) -let mkByrefTy (g:TcGlobals) ty = TType_app (g.byref_tcr, [ty]) +let mkNativePtrTy (g:TcGlobals) ty = + assert g.nativeptr_tcr.CanDeref // this should always be available, but check anyway + TType_app (g.nativeptr_tcr, [ty]) + +let mkByrefTy (g:TcGlobals) ty = + assert g.byref_tcr.CanDeref // this should always be available, but check anyway + TType_app (g.byref_tcr, [ty]) + +let mkInByrefTy (g:TcGlobals) ty = + if g.inref_tcr.CanDeref then // If not using sufficient FSharp.Core, then inref = byref, see RFC FS-1053.md + TType_app (g.inref_tcr, [ty]) + else + mkByrefTy g ty + +let mkOutByrefTy (g:TcGlobals) ty = + if g.outref_tcr.CanDeref then // If not using sufficient FSharp.Core, then outref = byref, see RFC FS-1053.md + TType_app (g.outref_tcr, [ty]) + else + mkByrefTy g ty + +let mkByrefTyWithFlag g readonly ty = + if readonly then + mkInByrefTy g ty + else + mkByrefTy g ty + +let mkByref2Ty (g:TcGlobals) ty1 ty2 = + assert g.byref2_tcr.CanDeref // check we are using sufficient FSharp.Core, caller should check this + TType_app (g.byref2_tcr, [ty1; ty2]) + +let mkVoidPtrTy (g:TcGlobals) = + assert g.voidptr_tcr.CanDeref // check we are using sufficient FSharp.Core , caller should check this + TType_app (g.voidptr_tcr, []) + +let mkByrefTyWithInference (g:TcGlobals) ty1 ty2 = + if g.byref2_tcr.CanDeref then // If not using sufficient FSharp.Core, then inref = byref, see RFC FS-1053.md + TType_app (g.byref2_tcr, [ty1; ty2]) + else + TType_app (g.byref_tcr, [ty1]) let mkArrayTy (g:TcGlobals) rank ty m = if rank < 1 || rank > 32 then @@ -675,7 +712,16 @@ let rec stripTyEqnsA g canShortcut ty = | Some abbrevTy -> stripTyEqnsA g canShortcut (applyTyconAbbrev abbrevTy tycon tinst) | None -> - if tycon.IsMeasureableReprTycon && List.forall (isDimensionless g) tinst then + // This is the point where we get to add additional coditional normalizing equations + // into the type system. Such power! + // + // Add the equation byref<'T> = byref<'T, ByRefKinds.InOut> for when using sufficient FSharp.Core + // See RFC FS-1053.md + if tyconRefEq g tcref g.byref_tcr && g.byref2_tcr.CanDeref && g.byrefkind_InOut_tcr.CanDeref then + mkByref2Ty g tinst.[0] (TType_app(g.byrefkind_InOut_tcr, [])) + + // Add the equation double<1> = double for units of measure. + elif tycon.IsMeasureableReprTycon && List.forall (isDimensionless g) tinst then stripTyEqnsA g canShortcut (reduceTyconMeasureableOrProvided g tycon tinst) else ty @@ -782,11 +828,6 @@ let (|StripNullableTy|) g ty = | AppTy g (tcr, [tyarg]) when tyconRefEq g tcr g.system_Nullable_tcref -> tyarg | _ -> ty -let (|ByrefTy|_|) g ty = - match ty with - | AppTy g (tcr, [tyarg]) when tyconRefEq g tcr g.byref_tcr -> Some tyarg - | _ -> None - let mkInstForAppTy g typ = match typ with | AppTy g (tcref, tinst) -> mkTyconRefInst tcref tinst @@ -1231,13 +1272,14 @@ let mkExnExpr(uc, args, m) = Expr.Op (TOp.ExnConstr uc, let mkTupleFieldGetViaExprAddr(tupInfo, e, tinst, i, m) = Expr.Op (TOp.TupleFieldGet(tupInfo, i), tinst, [e], m) let mkRecdFieldGetViaExprAddr(e, fref, tinst, m) = Expr.Op (TOp.ValFieldGet(fref), tinst, [e], m) -let mkRecdFieldGetAddrViaExprAddr(e, fref, tinst, m) = Expr.Op (TOp.ValFieldGetAddr(fref), tinst, [e], m) +let mkRecdFieldGetAddrViaExprAddr(readonly, e, fref, tinst, m) = Expr.Op (TOp.ValFieldGetAddr(fref, readonly), tinst, [e], m) -let mkStaticRecdFieldGetAddr(fref, tinst, m) = Expr.Op (TOp.ValFieldGetAddr(fref), tinst, [], m) +let mkStaticRecdFieldGetAddr(readonly, fref, tinst, m) = Expr.Op (TOp.ValFieldGetAddr(fref, readonly), tinst, [], m) let mkStaticRecdFieldGet(fref, tinst, m) = Expr.Op (TOp.ValFieldGet(fref), tinst, [], m) let mkStaticRecdFieldSet(fref, tinst, e, m) = Expr.Op (TOp.ValFieldSet(fref), tinst, [e], m) -let mkArrayElemAddress g (readonly, isNativePtr, shape, elemTy, aexpr, nexpr, m) = Expr.Op (TOp.ILAsm ([IL.I_ldelema(readonly, isNativePtr, shape, mkILTyvarTy 0us)], [mkByrefTy g elemTy]), [elemTy], [aexpr;nexpr], m) +let mkArrayElemAddress g (readonly, ilInstrReadOnlyAnnotation, isNativePtr, shape, elemTy, exprs, m) = + Expr.Op (TOp.ILAsm ([IL.I_ldelema(ilInstrReadOnlyAnnotation, isNativePtr, shape, mkILTyvarTy 0us)], [mkByrefTyWithFlag g readonly elemTy]), [elemTy], exprs, m) let mkRecdFieldSetViaExprAddr (e1, fref, tinst, e2, m) = Expr.Op (TOp.ValFieldSet(fref), tinst, [e1;e2], m) @@ -1254,7 +1296,7 @@ let mkUnionCaseFieldGetProvenViaExprAddr (e1, cref, tinst, j, m) = Expr.Op (TO /// Build a 'TOp.UnionCaseFieldGetAddr' expression for a field of a union when we've already determined the value to be a particular union case. For ref-unions, /// the input expression has 'TType_ucase', which is an F# compiler internal "type" corresponding to the union case. For struct-unions, /// the input should be the address of the expression. -let mkUnionCaseFieldGetAddrProvenViaExprAddr (e1, cref, tinst, j, m) = Expr.Op (TOp.UnionCaseFieldGetAddr(cref, j), tinst, [e1], m) +let mkUnionCaseFieldGetAddrProvenViaExprAddr (readonly, e1, cref, tinst, j, m) = Expr.Op (TOp.UnionCaseFieldGetAddr(cref, j, readonly), tinst, [e1], m) /// Build a 'get' expression for something we've already determined to be a particular union case, but where /// the static type of the input is not yet proven to be that particular union case. This requires a type @@ -1287,7 +1329,7 @@ let mkDefault (m, ty) = Expr.Const(Const.Zero, m, ty) let mkValSet m v e = Expr.Op (TOp.LValueOp (LSet, v), [], [e], m) let mkAddrSet m v e = Expr.Op (TOp.LValueOp (LByrefSet, v), [], [e], m) let mkAddrGet m v = Expr.Op (TOp.LValueOp (LByrefGet, v), [], [], m) -let mkValAddr m v = Expr.Op (TOp.LValueOp (LGetAddr, v), [], [], m) +let mkValAddr m readonly v = Expr.Op (TOp.LValueOp (LAddrOf readonly, v), [], [], m) //-------------------------------------------------------------------------- // Maps tracking extra information for values @@ -1315,14 +1357,21 @@ type ValHash<'T> = [] type ValMultiMap<'T>(contents: StampMap<'T list>) = + + member m.ContainsKey (v: Val) = + contents.ContainsKey v.Stamp + member m.Find (v: Val) = match contents |> Map.tryFind v.Stamp with | Some vals -> vals | _ -> [] member m.Add (v:Val, x) = ValMultiMap<'T>(contents.Add (v.Stamp, x :: m.Find v)) + member m.Remove (v: Val) = ValMultiMap<'T>(contents.Remove v.Stamp) + member m.Contents = contents + static member Empty = ValMultiMap<'T>(Map.empty) [] @@ -1529,17 +1578,11 @@ let destListTy (g:TcGlobals) ty = | AppTy g (tcref, [ty]) when tyconRefEq g tcref g.list_tcr_canon -> ty | _ -> failwith "destListTy" -let isTypeConstructorEqualToOptional g tcOpt tc = +let tyconRefEqOpt g tcOpt tc = match tcOpt with | None -> false | Some tc2 -> tyconRefEq g tc2 tc -let isByrefLikeTyconRef g tcref = - tyconRefEq g g.byref_tcr tcref || - isTypeConstructorEqualToOptional g g.system_TypedReference_tcref tcref || - isTypeConstructorEqualToOptional g g.system_ArgIterator_tcref tcref || - isTypeConstructorEqualToOptional g g.system_RuntimeArgumentHandle_tcref tcref - let isStringTy g ty = ty |> stripTyEqns g |> (function TType_app(tcref, _) -> tyconRefEq g tcref g.system_String_tcref | _ -> false) let isListTy g ty = ty |> stripTyEqns g |> (function TType_app(tcref, _) -> tyconRefEq g tcref g.list_tcr_canon | _ -> false) let isArrayTy g ty = ty |> stripTyEqns g |> (function TType_app(tcref, _) -> isArrayTyconRef g tcref | _ -> false) @@ -1549,8 +1592,25 @@ let isObjTy g ty = ty |> stripTyEqns g |> (function TType_app(tcref, _) -> let isVoidTy g ty = ty |> stripTyEqns g |> (function TType_app(tcref, _) -> tyconRefEq g g.system_Void_tcref tcref | _ -> false) let isILAppTy g ty = ty |> stripTyEqns g |> (function TType_app(tcref, _) -> tcref.IsILTycon | _ -> false) let isNativePtrTy g ty = ty |> stripTyEqns g |> (function TType_app(tcref, _) -> tyconRefEq g g.nativeptr_tcr tcref | _ -> false) -let isByrefTy g ty = ty |> stripTyEqns g |> (function TType_app(tcref, _) -> tyconRefEq g g.byref_tcr tcref | _ -> false) -let isByrefLikeTy g ty = ty |> stripTyEqns g |> (function TType_app(tcref, _) -> isByrefLikeTyconRef g tcref | _ -> false) + +let isByrefTy g ty = + ty |> stripTyEqns g |> (function + | TType_app(tcref, _) when g.byref2_tcr.CanDeref -> tyconRefEq g g.byref2_tcr tcref + | TType_app(tcref, _) -> tyconRefEq g g.byref_tcr tcref + | _ -> false) + +let isInByrefTag g ty = ty |> stripTyEqns g |> (function TType_app(tcref, []) -> tyconRefEq g g.byrefkind_In_tcr tcref | _ -> false) +let isInByrefTy g ty = + ty |> stripTyEqns g |> (function + | TType_app(tcref, [_; tag]) when g.byref2_tcr.CanDeref -> tyconRefEq g g.byref2_tcr tcref && isInByrefTag g tag + | _ -> false) + +let isOutByrefTag g ty = ty |> stripTyEqns g |> (function TType_app(tcref, []) -> tyconRefEq g g.byrefkind_Out_tcr tcref | _ -> false) +let isOutByrefTy g ty = + ty |> stripTyEqns g |> (function + | TType_app(tcref, [_; tag]) when g.byref2_tcr.CanDeref -> tyconRefEq g g.byref2_tcr tcref && isOutByrefTag g tag + | _ -> false) + #if !NO_EXTENSIONTYPING let extensionInfoOfTy g ty = ty |> stripTyEqns g |> (function TType_app(tcref, _) -> tcref.TypeReprInfo | _ -> TNoRepr) #endif @@ -2754,7 +2814,7 @@ let isILAttribByName (tencl:string list, tname: string) (attr: ILAttribute) = (attr.Method.DeclaringType.TypeSpec.Name = tname) && (attr.Method.DeclaringType.TypeSpec.Enclosing = tencl) -// AbsIL view of attributes (we read these from .NET binaries) +// AbsIL view of attributes (we read these from .NET binaries). The comparison is done by name. let isILAttrib (tref:ILTypeRef) (attr: ILAttribute) = isILAttribByName (tref.Enclosing, tref.Name) attr @@ -2762,18 +2822,12 @@ let isILAttrib (tref:ILTypeRef) (attr: ILAttribute) = // These linear iterations cost us a fair bit when there are lots of attributes // on imported types. However this is fairly rare and can also be solved by caching the // results of attribute lookups in the TAST -let HasILAttribute tref (attrs: ILAttributes) = Array.exists (isILAttrib tref) attrs.AsArray - -let HasILAttributeByName tname (attrs: ILAttributes) = Array.exists (isILAttribByName ([], tname)) attrs.AsArray +let HasILAttribute tref (attrs: ILAttributes) = + attrs.AsArray |> Array.exists (isILAttrib tref) let TryDecodeILAttribute (g:TcGlobals) tref (attrs: ILAttributes) = attrs.AsArray |> Array.tryPick (fun x -> if isILAttrib tref x then Some(decodeILAttribData g.ilg x) else None) -// This one is done by name to ensure the compiler doesn't take a dependency on dereferencing a type that only exists in .NET 3.5 -let ILThingHasExtensionAttribute (attrs : ILAttributes) = - attrs.AsArray - |> Array.exists (fun attr -> attr.Method.DeclaringType.TypeSpec.Name = "System.Runtime.CompilerServices.ExtensionAttribute") - // F# view of attributes (these get converted to AbsIL attributes in ilxgen) let IsMatchingFSharpAttribute g (AttribInfo(_, tcref)) (Attrib(tcref2, _, _, _, _, _, _)) = tyconRefEq g tcref tcref2 let HasFSharpAttribute g tref attrs = List.exists (IsMatchingFSharpAttribute g tref) attrs @@ -2881,15 +2935,44 @@ let TyconRefHasAttribute g m attribSpec tcref = (fun _ -> Some ()) |> Option.isSome +let isByrefTyconRef (g: TcGlobals) (tcref: TyconRef) = + (g.byref_tcr.CanDeref && tyconRefEq g g.byref_tcr tcref) || + (g.byref2_tcr.CanDeref && tyconRefEq g g.byref2_tcr tcref) || + (g.inref_tcr.CanDeref && tyconRefEq g g.inref_tcr tcref) || + (g.outref_tcr.CanDeref && tyconRefEq g g.outref_tcr tcref) || + tyconRefEqOpt g g.system_TypedReference_tcref tcref || + tyconRefEqOpt g g.system_ArgIterator_tcref tcref || + tyconRefEqOpt g g.system_RuntimeArgumentHandle_tcref tcref + +// See RFC FS-1053.md +let isByrefLikeTyconRef (g: TcGlobals) m (tcref: TyconRef) = + tcref.CanDeref && + match tcref.TryIsByRefLike with + | Some res -> res + | None -> + let res = + isByrefTyconRef g tcref || + TyconRefHasAttribute g m g.attrib_IsByRefLikeAttribute tcref + tcref.SetIsByRefLike res + res + +let isByrefLikeTy g m ty = + ty |> stripTyEqns g |> (function TType_app(tcref, _) -> isByrefLikeTyconRef g m tcref | _ -> false) + //------------------------------------------------------------------------- // List and reference types... //------------------------------------------------------------------------- let destByrefTy g ty = match ty |> stripTyEqns g with - | TType_app(tcref, [x]) when tyconRefEq g g.byref_tcr tcref -> x + | TType_app(tcref, [x; _]) when g.byref2_tcr.CanDeref && tyconRefEq g g.byref2_tcr tcref -> x // Check sufficient FSharp.Core + | TType_app(tcref, [x]) when tyconRefEq g g.byref_tcr tcref -> x // all others | _ -> failwith "destByrefTy: not a byref type" +let (|ByrefTy|_|) g ty = + // Because of byref = byref2 it is better to write this using is/dest + if isByrefTy g ty then Some (destByrefTy g ty) else None + let destNativePtrTy g ty = match ty |> stripTyEqns g with | TType_app(tcref, [x]) when tyconRefEq g g.nativeptr_tcr tcref -> x @@ -3062,7 +3145,7 @@ module DebugPrint = begin let lvalopL x = match x with - | LGetAddr -> wordL (tagText "LGetAddr") + | LAddrOf readonly -> wordL (tagText (sprintf "LAddrOf(%b)" readonly)) | LByrefGet -> wordL (tagText "LByrefGet") | LSet -> wordL (tagText "LSet") | LByrefSet -> wordL (tagText "LByrefSet") @@ -3539,9 +3622,9 @@ module DebugPrint = begin (atomL rx ^^ rightL(tagText ".#") ^^ recdFieldRefL rf) | Expr.Op (TOp.ValFieldGet rf, _, [], _) -> recdFieldRefL rf - | Expr.Op (TOp.ValFieldGetAddr rf, _, [rx], _) -> + | Expr.Op (TOp.ValFieldGetAddr (rf, _), _, [rx], _) -> leftL(tagText "&") ^^ bracketL (atomL rx ^^ rightL(tagText ".!") ^^ recdFieldRefL rf) - | Expr.Op (TOp.ValFieldGetAddr rf, _, [], _) -> + | Expr.Op (TOp.ValFieldGetAddr (rf, _), _, [], _) -> leftL(tagText "&") ^^ (recdFieldRefL rf) | Expr.Op (TOp.UnionCaseTagGet tycr, _, [x], _) -> wordL (tagText ("#" + tycr.LogicalName + ".tag")) ^^ atomL x @@ -3584,7 +3667,7 @@ module DebugPrint = begin | Expr.Op (TOp.Bytes _, _ , _ , _) -> wordL(tagText "bytes++") | Expr.Op (TOp.UInt16s _, _ , _ , _) -> wordL(tagText "uint16++") - | Expr.Op (TOp.RefAddrGet, _tyargs, _args, _) -> wordL(tagText "GetRefLVal...") + | Expr.Op (TOp.RefAddrGet _, _tyargs, _args, _) -> wordL(tagText "GetRefLVal...") | Expr.Op (TOp.TraitCall _, _tyargs, _args, _) -> wordL(tagText "traitcall...") | Expr.Op (TOp.ExnFieldGet _, _tyargs, _args, _) -> wordL(tagText "TOp.ExnFieldGet...") | Expr.Op (TOp.ExnFieldSet _, _tyargs, _args, _) -> wordL(tagText "TOp.ExnFieldSet...") @@ -4307,7 +4390,7 @@ and accFreeInOp opts op acc = | TOp.TryFinally _ | TOp.For _ | TOp.Coerce - | TOp.RefAddrGet + | TOp.RefAddrGet _ | TOp.Array | TOp.While _ | TOp.Goto _ | TOp.Label _ | TOp.Return @@ -4320,7 +4403,7 @@ and accFreeInOp opts op acc = // Things containing just a union case reference | TOp.UnionCaseProof cr | TOp.UnionCase cr - | TOp.UnionCaseFieldGetAddr (cr, _) + | TOp.UnionCaseFieldGetAddr (cr, _, _) | TOp.UnionCaseFieldGet (cr, _) | TOp.UnionCaseFieldSet (cr, _) -> accFreeUnionCaseRef opts cr acc @@ -4330,7 +4413,7 @@ and accFreeInOp opts op acc = | TOp.ExnFieldSet (ecr, _) -> accFreeExnRef ecr acc | TOp.ValFieldGet fr - | TOp.ValFieldGetAddr fr + | TOp.ValFieldGetAddr (fr, _) | TOp.ValFieldSet fr -> accFreeRecdFieldRef opts fr acc | TOp.Recd (kind, tcr) -> @@ -4756,23 +4839,23 @@ and remapExpr (g: TcGlobals) (compgen:ValCopyFlag) (tmenv:Remap) x = // of a temporary local, e.g. // &(E.RF) --> let mutable v = E.RF in &v - | Expr.Op (TOp.ValFieldGetAddr rfref, tinst, [arg], m) when + | Expr.Op (TOp.ValFieldGetAddr (rfref, readonly), tinst, [arg], m) when not rfref.RecdField.IsMutable && not (entityRefInThisAssembly g.compilingFslib rfref.TyconRef) -> let tinst = remapTypes tmenv tinst let arg = remapExpr g compgen tmenv arg let tmp, _ = mkMutableCompGenLocal m "copyOfStruct" (actualTyOfRecdFieldRef rfref tinst) - mkCompGenLet m tmp (mkRecdFieldGetViaExprAddr(arg, rfref, tinst, m)) (mkValAddr m (mkLocalValRef tmp)) + mkCompGenLet m tmp (mkRecdFieldGetViaExprAddr(arg, rfref, tinst, m)) (mkValAddr m readonly (mkLocalValRef tmp)) - | Expr.Op (TOp.UnionCaseFieldGetAddr (uref, cidx), tinst, [arg], m) when + | Expr.Op (TOp.UnionCaseFieldGetAddr (uref, cidx, readonly), tinst, [arg], m) when not (uref.FieldByIndex(cidx).IsMutable) && not (entityRefInThisAssembly g.compilingFslib uref.TyconRef) -> let tinst = remapTypes tmenv tinst let arg = remapExpr g compgen tmenv arg let tmp, _ = mkMutableCompGenLocal m "copyOfStruct" (actualTyOfUnionFieldRef uref cidx tinst) - mkCompGenLet m tmp (mkUnionCaseFieldGetProvenViaExprAddr(arg, uref, tinst, cidx, m)) (mkValAddr m (mkLocalValRef tmp)) + mkCompGenLet m tmp (mkUnionCaseFieldGetProvenViaExprAddr(arg, uref, tinst, cidx, m)) (mkValAddr m readonly (mkLocalValRef tmp)) | Expr.Op (op, tinst, args, m) -> let op' = remapOp tmenv op @@ -4842,8 +4925,9 @@ and remapOp tmenv op = | TOp.ExnFieldSet(ec, n) -> TOp.ExnFieldSet(remapTyconRef tmenv.tyconRefRemap ec, n) | TOp.ValFieldSet rfref -> TOp.ValFieldSet(remapRecdFieldRef tmenv.tyconRefRemap rfref) | TOp.ValFieldGet rfref -> TOp.ValFieldGet(remapRecdFieldRef tmenv.tyconRefRemap rfref) - | TOp.ValFieldGetAddr rfref -> TOp.ValFieldGetAddr(remapRecdFieldRef tmenv.tyconRefRemap rfref) + | TOp.ValFieldGetAddr (rfref, readonly) -> TOp.ValFieldGetAddr(remapRecdFieldRef tmenv.tyconRefRemap rfref, readonly) | TOp.UnionCaseFieldGet(ucref, n) -> TOp.UnionCaseFieldGet(remapUnionCaseRef tmenv.tyconRefRemap ucref, n) + | TOp.UnionCaseFieldGetAddr(ucref, n, readonly) -> TOp.UnionCaseFieldGetAddr(remapUnionCaseRef tmenv.tyconRefRemap ucref, n, readonly) | TOp.UnionCaseFieldSet(ucref, n) -> TOp.UnionCaseFieldSet(remapUnionCaseRef tmenv.tyconRefRemap ucref, n) | TOp.ILAsm (instrs, tys) -> let tys2 = remapTypes tmenv tys @@ -5236,15 +5320,16 @@ let isUnionCaseDefinitelyMutable (uc:UnionCase) = uc.FieldTable.FieldsByIndex |> let isUnionCaseRefDefinitelyMutable (uc:UnionCaseRef) = uc.UnionCase |> isUnionCaseDefinitelyMutable /// This is an incomplete check for .NET struct types. Returning 'false' doesn't mean the thing is immutable. -let isRecdOrUnionOrStructTyconDefinitelyMutable (_g:TcGlobals) (tycon:Tycon) = +let isRecdOrUnionOrStructTyconRefDefinitelyMutable (tcref: TyconRef) = + let tycon = tcref.Deref if tycon.IsUnionTycon then tycon.UnionCasesArray |> Array.exists isUnionCaseDefinitelyMutable elif tycon.IsRecordTycon || tycon.IsStructOrEnumTycon then + // Note: This only looks at the F# fields, causing oddities. + // See https://github.com/Microsoft/visualfsharp/pull/4576 tycon.AllFieldsArray |> Array.exists isRecdOrStructFieldDefinitelyMutable else false - -let isRecdOrUnionOrStructTyconRefDefinitelyMutable g (tcr : TyconRef) = isRecdOrUnionOrStructTyconDefinitelyMutable g tcr.Deref // Although from the pure F# perspective exception values cannot be changed, the .NET // implementation of exception objects attaches a whole bunch of stack information to @@ -5255,7 +5340,7 @@ let isExnDefinitelyMutable (_ecref:TyconRef) = true // of the cons cell. These cells are always private, i.e. not accessible by any other // code until the construction of the entire return list has been completed. // However, within the implementation code reads of the tail cell must in theory be treated -// with caution. Hence we are conservative and within fslib we don't treat list +// with caution. Hence we are conservative and within FSharp.Core we don't treat list // reads as if they were pure. let isUnionCaseFieldMutable (g: TcGlobals) (ucref:UnionCaseRef) n = (g.compilingFslib && tyconRefEq g ucref.TyconRef g.list_tcr_canon && n = 1) || @@ -5331,16 +5416,16 @@ let rec tyOfExpr g e = | (TOp.For _ | TOp.While _) -> g.unit_ty | TOp.Array -> (match tinst with [ty] -> mkArrayType g ty | _ -> failwith "bad TOp.Array node") | (TOp.TryCatch _ | TOp.TryFinally _) -> (match tinst with [ty] -> ty | _ -> failwith "bad TOp_try node") - | TOp.ValFieldGetAddr(fref) -> mkByrefTy g (actualTyOfRecdFieldRef fref tinst) + | TOp.ValFieldGetAddr(fref, readonly) -> mkByrefTyWithFlag g readonly (actualTyOfRecdFieldRef fref tinst) | TOp.ValFieldGet(fref) -> actualTyOfRecdFieldRef fref tinst | (TOp.ValFieldSet _ | TOp.UnionCaseFieldSet _ | TOp.ExnFieldSet _ | TOp.LValueOp ((LSet | LByrefSet), _)) ->g.unit_ty | TOp.UnionCaseTagGet _ -> g.int_ty - | TOp.UnionCaseFieldGetAddr(cref, j) -> mkByrefTy g (actualTyOfRecdField (mkTyconRefInst cref.TyconRef tinst) (cref.FieldByIndex j)) + | TOp.UnionCaseFieldGetAddr(cref, j, readonly) -> mkByrefTyWithFlag g readonly (actualTyOfRecdField (mkTyconRefInst cref.TyconRef tinst) (cref.FieldByIndex j)) | TOp.UnionCaseFieldGet(cref, j) -> actualTyOfRecdField (mkTyconRefInst cref.TyconRef tinst) (cref.FieldByIndex j) | TOp.ExnFieldGet(ecref, j) -> recdFieldTyOfExnDefRefByIdx ecref j | TOp.LValueOp (LByrefGet, v) -> destByrefTy g v.Type - | TOp.LValueOp (LGetAddr, v) -> mkByrefTy g v.Type - | TOp.RefAddrGet -> (match tinst with [ty] -> mkByrefTy g ty | _ -> failwith "bad TOp.RefAddrGet node") + | TOp.LValueOp (LAddrOf readonly, v) -> mkByrefTyWithFlag g readonly v.Type + | TOp.RefAddrGet readonly -> (match tinst with [ty] -> mkByrefTyWithFlag g readonly ty | _ -> failwith "bad TOp.RefAddrGet node") | TOp.TraitCall (TTrait(_, _, _, _, ty, _)) -> GetFSharpViewOfReturnType g ty | TOp.Reraise -> (match tinst with [rtn_ty] -> rtn_ty | _ -> failwith "bad TOp.Reraise node") | TOp.Goto _ | TOp.Label _ | TOp.Return -> @@ -5565,16 +5650,38 @@ let mkAndSimplifyMatch spBind exprm matchm ty tree targets = // mkExprAddrOfExprAux //------------------------------------------------------------------------- -type Mutates = DefinitelyMutates | PossiblyMutates | NeverMutates +type Mutates = AddressOfOp | DefinitelyMutates | PossiblyMutates | NeverMutates exception DefensiveCopyWarning of string * range -let isRecdOrStructTyReadOnly g ty = +let isRecdOrStructTyconRefAssumedImmutable (g: TcGlobals) (tcref: TyconRef) = + tcref.CanDeref && + not (isRecdOrUnionOrStructTyconRefDefinitelyMutable tcref) || + tyconRefEq g tcref g.decimal_tcr || + tyconRefEq g tcref g.date_tcr + +let isRecdOrStructTyconRefReadOnly (g: TcGlobals) m (tcref: TyconRef) = + tcref.CanDeref && + match tcref.TryIsReadOnly with + | Some res -> res + | None -> + let isImmutable = isRecdOrStructTyconRefAssumedImmutable g tcref + let hasAttrib = TyconRefHasAttribute g m g.attrib_IsReadOnlyAttribute tcref + let res = isImmutable || hasAttrib + tcref.SetIsReadOnly res + res + +let isRecdOrStructTyReadOnly (g: TcGlobals) m ty = match tryDestAppTy g ty with | None -> false - | Some tcref -> - not (isRecdOrUnionOrStructTyconRefDefinitelyMutable g tcref) || - tyconRefEq g tcref g.decimal_tcr || - tyconRefEq g tcref g.date_tcr + | Some tcref -> isRecdOrStructTyconRefReadOnly g m tcref + + +let CanTakeAddressOf g m typ mut = + match mut with + | NeverMutates -> true + | PossiblyMutates -> isRecdOrStructTyReadOnly g m typ + | DefinitelyMutates -> false + | AddressOfOp -> true // you can take the address but you might get a (readonly) inref as a result // We can take the address of values of struct type even if the value is immutable // under certain conditions @@ -5591,144 +5698,184 @@ let isRecdOrStructTyReadOnly g ty = // // We only do this for true local or closure fields because we can't take addresses of immutable static // fields across assemblies. -let CanTakeAddressOfImmutableVal g (v:ValRef) mut = +let CanTakeAddressOfImmutableVal (g: TcGlobals) m (vref:ValRef) mut = // We can take the address of values of struct type if the operation doesn't mutate // and the value is a true local or closure field. - not v.IsMutable && - not v.IsMemberOrModuleBinding && - (match mut with - | NeverMutates -> true - | PossiblyMutates -> isRecdOrStructTyReadOnly g v.Type - | DefinitelyMutates -> false) - -let MustTakeAddressOfVal (g:TcGlobals) (v:ValRef) = - v.IsMutable && + not vref.IsMutable && + not vref.IsMemberOrModuleBinding && + // Note: We can't add this: + // || valRefInThisAssembly g.compilingFslib vref + // This is because we don't actually guarantee to generate static backing fields for all values like these, e.g. simple constants "let x = 1". + // We always generate a static property but there is no field to take an address of + CanTakeAddressOf g m vref.Type mut + +let MustTakeAddressOfVal (g:TcGlobals) (vref:ValRef) = + vref.IsMutable && // We can only take the address of mutable values in the same assembly - valRefInThisAssembly g.compilingFslib v + valRefInThisAssembly g.compilingFslib vref + +let MustTakeAddressOfByrefGet (g:TcGlobals) (vref:ValRef) = + isByrefTy g vref.Type && not (isInByrefTy g vref.Type) -let MustTakeAddressOfRecdField (rf: RecdField) = +let CanTakeAddressOfByrefGet (g:TcGlobals) (vref:ValRef) mut = + isInByrefTy g vref.Type && + CanTakeAddressOf g vref.Range (destByrefTy g vref.Type) mut + +let MustTakeAddressOfRecdField (rfref: RecdField) = // Static mutable fields must be private, hence we don't have to take their address - not rf.IsStatic && - rf.IsMutable + not rfref.IsStatic && + rfref.IsMutable let MustTakeAddressOfRecdFieldRef (rfref: RecdFieldRef) = MustTakeAddressOfRecdField rfref.RecdField -let CanTakeAddressOfRecdFieldRef (g:TcGlobals) (rfref: RecdFieldRef) mut tinst = - mut <> DefinitelyMutates && +let CanTakeAddressOfRecdFieldRef (g:TcGlobals) m (rfref: RecdFieldRef) tinst mut = // We only do this if the field is defined in this assembly because we can't take addresses across assemblies for immutable fields entityRefInThisAssembly g.compilingFslib rfref.TyconRef && - isRecdOrStructTyReadOnly g (actualTyOfRecdFieldRef rfref tinst) + not rfref.RecdField.IsMutable && + CanTakeAddressOf g m (actualTyOfRecdFieldRef rfref tinst) mut -let CanTakeAddressOfUnionFieldRef (g:TcGlobals) (uref: UnionCaseRef) mut tinst cidx = - mut <> DefinitelyMutates && +let CanTakeAddressOfUnionFieldRef (g:TcGlobals) m (uref: UnionCaseRef) cidx tinst mut = // We only do this if the field is defined in this assembly because we can't take addresses across assemblies for immutable fields entityRefInThisAssembly g.compilingFslib uref.TyconRef && - isRecdOrStructTyReadOnly g (actualTyOfUnionFieldRef uref cidx tinst) - - -let rec mkExprAddrOfExprAux g mustTakeAddress useReadonlyForGenericArrayAddress mut e addrExprVal m = - if not mustTakeAddress then None, e else - match e with - // LVALUE: "x" where "x" is byref - | Expr.Op (TOp.LValueOp (LByrefGet, v), _, [], m) -> - None, exprForValRef m v - // LVALUE: "x" where "x" is mutable local, mutable intra-assembly module/static binding, or operation doesn't mutate - // Note: we can always take the address of mutable values - | Expr.Val(v, _, m) when MustTakeAddressOfVal g v || CanTakeAddressOfImmutableVal g v mut -> - None, mkValAddr m v - // LVALUE: "x" where "e.x" is record field. - | Expr.Op (TOp.ValFieldGet rfref, tinst, [e], m) when MustTakeAddressOfRecdFieldRef rfref || CanTakeAddressOfRecdFieldRef g rfref mut tinst -> - let exprty = tyOfExpr g e - let wrap, expra = mkExprAddrOfExprAux g (isStructTy g exprty) false mut e None m - wrap, mkRecdFieldGetAddrViaExprAddr(expra, rfref, tinst, m) - // LVALUE: "x" where "e.x" is union field - | Expr.Op (TOp.UnionCaseFieldGet (uref, cidx), tinst, [e], m) when MustTakeAddressOfRecdField (uref.FieldByIndex(cidx)) || CanTakeAddressOfUnionFieldRef g uref mut tinst cidx -> - let exprty = tyOfExpr g e - let wrap, expra = mkExprAddrOfExprAux g (isStructTy g exprty) false mut e None m - wrap, mkUnionCaseFieldGetAddrProvenViaExprAddr(expra, uref, tinst, cidx, m) - - // LVALUE: "x" where "e.x" is a .NET static field. - | Expr.Op (TOp.ILAsm ([IL.I_ldsfld(_vol, fspec)], [ty2]), tinst, [], m) -> - None, Expr.Op (TOp.ILAsm ([IL.I_ldsflda(fspec)], [mkByrefTy g ty2]), tinst, [], m) - - // LVALUE: "x" where "e.x" is a .NET instance field. "e" may be an lvalue - | Expr.Op (TOp.ILAsm ([IL.I_ldfld(_align, _vol, fspec)], [ty2]), tinst, [e], m) - -> - let exprty = tyOfExpr g e - let wrap, expra = mkExprAddrOfExprAux g (isStructTy g exprty) false mut e None m - wrap, Expr.Op (TOp.ILAsm ([IL.I_ldflda(fspec)], [mkByrefTy g ty2]), tinst, [expra], m) - - // LVALUE: "x" where "x" is mutable static field. - | Expr.Op (TOp.ValFieldGet rfref, tinst, [], m) when MustTakeAddressOfRecdFieldRef rfref || CanTakeAddressOfRecdFieldRef g rfref mut tinst -> - None, mkStaticRecdFieldGetAddr(rfref, tinst, m) - - // LVALUE: "e.[n]" where e is an array of structs - | Expr.App(Expr.Val(vf, _, _), _, [elemTy], [aexpr;nexpr], _) - when (valRefEq g vf g.array_get_vref) -> + let rfref = uref.FieldByIndex cidx + not rfref.IsMutable && + CanTakeAddressOf g m (actualTyOfUnionFieldRef uref cidx tinst) mut + +/// Make the address-of expression and return a wrapper that adds any allocated locals at an appropriate scope. +/// Also return a flag that indicates if the resulting pointer is a not a pointer where writing is allowed and will +/// have intended effect (i.e. is a readonly pointer and/or a defensive copy). +let rec mkExprAddrOfExprAux g mustTakeAddress useReadonlyForGenericArrayAddress mut expr addrExprVal m = + if mustTakeAddress then + match expr with + // LVALUE of "*x" where "x" is byref is just the byref itself + | Expr.Op (TOp.LValueOp (LByrefGet, vref), _, [], m) when MustTakeAddressOfByrefGet g vref || CanTakeAddressOfByrefGet g vref mut -> + let readonly = not (MustTakeAddressOfByrefGet g vref) + None, exprForValRef m vref, readonly + + // LVALUE of "x" where "x" is mutable local, mutable intra-assembly module/static binding, or operation doesn't mutate. + // Note: we can always take the address of mutable intra-assembly values + | Expr.Val(vref, _, m) when MustTakeAddressOfVal g vref || CanTakeAddressOfImmutableVal g m vref mut -> + let readonly = not (MustTakeAddressOfVal g vref) + None, mkValAddr m readonly vref, readonly + + // LVALUE of "e.f" where "f" is record field. + | Expr.Op (TOp.ValFieldGet rfref, tinst, [obje], m) when MustTakeAddressOfRecdFieldRef rfref || CanTakeAddressOfRecdFieldRef g m rfref tinst mut -> + let exprty = tyOfExpr g obje + let wrap, expra, readonly = mkExprAddrOfExprAux g (isStructTy g exprty) false mut obje None m + let readonly = readonly || not (MustTakeAddressOfRecdFieldRef rfref) + wrap, mkRecdFieldGetAddrViaExprAddr(readonly, expra, rfref, tinst, m), readonly + + // LVALUE of "e.f" where "f" is union field. + | Expr.Op (TOp.UnionCaseFieldGet (uref, cidx), tinst, [obje], m) when MustTakeAddressOfRecdField (uref.FieldByIndex(cidx)) || CanTakeAddressOfUnionFieldRef g m uref cidx tinst mut -> + let exprty = tyOfExpr g obje + let wrap, expra, readonly = mkExprAddrOfExprAux g (isStructTy g exprty) false mut obje None m + let readonly = readonly || not (MustTakeAddressOfRecdField (uref.FieldByIndex(cidx))) + wrap, mkUnionCaseFieldGetAddrProvenViaExprAddr(readonly, expra, uref, tinst, cidx, m), readonly + + // LVALUE of "f" where "f" is a .NET static field. + | Expr.Op (TOp.ILAsm ([IL.I_ldsfld(_vol, fspec)], [ty2]), tinst, [], m) -> + let readonly = false // we never consider taking the address of a .NET static field to give an inref pointer + None, Expr.Op (TOp.ILAsm ([IL.I_ldsflda(fspec)], [mkByrefTy g ty2]), tinst, [], m), readonly + + // LVALUE of "e.f" where "f" is a .NET instance field. + | Expr.Op (TOp.ILAsm ([IL.I_ldfld(_align, _vol, fspec)], [ty2]), tinst, [obje], m) -> + let exprty = tyOfExpr g obje + // we never consider taking the address of an .NET instance field to give an inref pointer, unless the object pointer is an inref pointer + let wrap, expra, readonly = mkExprAddrOfExprAux g (isStructTy g exprty) false mut obje None m + wrap, Expr.Op (TOp.ILAsm ([IL.I_ldflda(fspec)], [mkByrefTyWithFlag g readonly ty2]), tinst, [expra], m), readonly + + // LVALUE of "f" where "f" is a static F# field. + | Expr.Op (TOp.ValFieldGet rfref, tinst, [], m) when MustTakeAddressOfRecdFieldRef rfref || CanTakeAddressOfRecdFieldRef g m rfref tinst mut -> + let readonly = not (MustTakeAddressOfRecdFieldRef rfref) + None, mkStaticRecdFieldGetAddr(readonly, rfref, tinst, m), readonly + + // LVALUE of "e.[n]" where e is an array of structs + | Expr.App(Expr.Val(vf, _, _), _, [elemTy], [aexpr;nexpr], _) when (valRefEq g vf g.array_get_vref) -> - let shape = ILArrayShape.SingleDimensional - let readonly = if isTyparTy g elemTy && useReadonlyForGenericArrayAddress then ReadonlyAddress else NormalAddress - let isNativePtr = - match addrExprVal with - | Some(vf) -> valRefEq g vf g.addrof2_vref - | _ -> false - None, mkArrayElemAddress g (readonly, isNativePtr, shape, elemTy, aexpr, nexpr, m) - - // LVALUE: "e.[n1, n2]", "e.[n1, n2, n3]", "e.[n1, n2, n3, n4]" where e is an array of structs - | Expr.App(Expr.Val(vf, _, _), _, [elemTy], (aexpr::args), _) - when (valRefEq g vf g.array2D_get_vref || valRefEq g vf g.array3D_get_vref || valRefEq g vf g.array4D_get_vref) -> + let readonly = false // array address is never forced to be readonly + let shape = ILArrayShape.SingleDimensional + let ilInstrReadOnlyAnnotation = if isTyparTy g elemTy && useReadonlyForGenericArrayAddress then ReadonlyAddress else NormalAddress + let isNativePtr = + match addrExprVal with + | Some(vf) -> valRefEq g vf g.addrof2_vref + | _ -> false + None, mkArrayElemAddress g (readonly, ilInstrReadOnlyAnnotation, isNativePtr, shape, elemTy, [aexpr; nexpr], m), readonly + + // LVALUE of "e.[n1, n2]", "e.[n1, n2, n3]", "e.[n1, n2, n3, n4]" where e is an array of structs + | Expr.App(Expr.Val(vref, _, _), _, [elemTy], (aexpr::args), _) + when (valRefEq g vref g.array2D_get_vref || valRefEq g vref g.array3D_get_vref || valRefEq g vref g.array4D_get_vref) -> - let shape = ILArrayShape.FromRank args.Length - let readonly = if isTyparTy g elemTy && useReadonlyForGenericArrayAddress then ReadonlyAddress else NormalAddress - let isNativePtr = - match addrExprVal with - | Some(vf) -> valRefEq g vf g.addrof2_vref - | _ -> false + let readonly = false // array address is never forced to be readonly + let shape = ILArrayShape.FromRank args.Length + let ilInstrReadOnlyAnnotation = if isTyparTy g elemTy && useReadonlyForGenericArrayAddress then ReadonlyAddress else NormalAddress + let isNativePtr = + match addrExprVal with + | Some(vf) -> valRefEq g vf g.addrof2_vref + | _ -> false - None, Expr.Op (TOp.ILAsm ([IL.I_ldelema(readonly, isNativePtr, shape, mkILTyvarTy 0us)], [mkByrefTy g elemTy]), [elemTy], (aexpr::args), m) - - // Give a nice error message for DefinitelyMutates on immutable values, or mutable values in other assemblies - | Expr.Val(v, _, m) when mut = DefinitelyMutates - -> - if isByrefTy g v.Type then error(Error(FSComp.SR.tastUnexpectedByRef(), m)); - if v.IsMutable then - error(Error(FSComp.SR.tastInvalidAddressOfMutableAcrossAssemblyBoundary(), m)); - else - error(Error(FSComp.SR.tastValueMustBeMutable(), m)); + None, mkArrayElemAddress g (readonly, ilInstrReadOnlyAnnotation, isNativePtr, shape, elemTy, (aexpr::args), m), readonly + + // LVALUE: "&meth(args)" where meth has a byref or inref return. Includes "&span.[idx]". + | Expr.Let(TBind(vref, e, _), Expr.Op(TOp.LValueOp (LByrefGet, vref2), _, _, _), _, _) when (valRefEq g (mkLocalValRef vref) vref2) && (MustTakeAddressOfByrefGet g vref2 || CanTakeAddressOfByrefGet g vref2 mut) -> + let readonly = isInByrefTy g (tyOfExpr g e) + None, e, readonly + + // Give a nice error message for address-of-byref + | Expr.Val(vref, _, m) when isByrefTy g vref.Type -> + error(Error(FSComp.SR.tastUnexpectedByRef(), m)) + + // Give a nice error message for DefinitelyMutates of address-of on mutable values in other assemblies + | Expr.Val(vref, _, m) when (mut = DefinitelyMutates || mut = AddressOfOp) && vref.IsMutable -> + error(Error(FSComp.SR.tastInvalidAddressOfMutableAcrossAssemblyBoundary(), m)) + + // Give a nice error message for AddressOfOp on immutable values + | Expr.Val _ when mut = AddressOfOp -> + error(Error(FSComp.SR.tastValueMustBeLocal(), m)) - | _ -> - let ty = tyOfExpr g e - if isStructTy g ty then - match mut with - | NeverMutates -> () - | DefinitelyMutates -> - errorR(Error(FSComp.SR.tastInvalidMutationOfConstant(), m)); - | PossiblyMutates -> - warning(DefensiveCopyWarning(FSComp.SR.tastValueHasBeenCopied(), m)); - let tmp, _ = - match mut with - | NeverMutates -> mkCompGenLocal m "copyOfStruct" ty - | _ -> mkMutableCompGenLocal m "copyOfStruct" ty - Some (tmp, e), (mkValAddr m (mkLocalValRef tmp)) + // Give a nice error message for mutating a value we can't take the address of + | Expr.Val _ when mut = DefinitelyMutates -> + error(Error(FSComp.SR.tastValueMustBeMutable(), m)) + + | _ -> + let ty = tyOfExpr g expr + if isStructTy g ty then + match mut with + | NeverMutates -> () + | AddressOfOp -> () // we get an inref + | DefinitelyMutates -> + // Give a nice error message for mutating something we can't take the address of + errorR(Error(FSComp.SR.tastInvalidMutationOfConstant(), m)) + | PossiblyMutates -> + // Warn on defensive copy of something we can't take the address of + warning(DefensiveCopyWarning(FSComp.SR.tastValueHasBeenCopied(), m)) + // Take a defensive copy + let tmp, _ = + match mut with + | NeverMutates -> mkCompGenLocal m "copyOfStruct" ty + | _ -> mkMutableCompGenLocal m "copyOfStruct" ty + let readonly = true + Some (tmp, expr), (mkValAddr m readonly (mkLocalValRef tmp)), readonly + else + None, expr, false let mkExprAddrOfExpr g mustTakeAddress useReadonlyForGenericArrayAddress mut e addrExprVal m = - let optBind, addre = mkExprAddrOfExprAux g mustTakeAddress useReadonlyForGenericArrayAddress mut e addrExprVal m + let optBind, addre, readonly = mkExprAddrOfExprAux g mustTakeAddress useReadonlyForGenericArrayAddress mut e addrExprVal m match optBind with - | None -> (fun x -> x), addre - | Some (tmp, rval) -> (fun x -> mkCompGenLet m tmp rval x), addre + | None -> (fun x -> x), addre, readonly + | Some (tmp, rval) -> (fun x -> mkCompGenLet m tmp rval x), addre, readonly let mkTupleFieldGet g (tupInfo, e, tinst, i, m) = - let wrap, e' = mkExprAddrOfExpr g (evalTupInfoIsStruct tupInfo) false NeverMutates e None m + let wrap, e', _readonly = mkExprAddrOfExpr g (evalTupInfoIsStruct tupInfo) false NeverMutates e None m wrap (mkTupleFieldGetViaExprAddr(tupInfo, e', tinst, i, m)) let mkRecdFieldGet g (e, fref:RecdFieldRef, tinst, m) = assert (not (isByrefTy g (tyOfExpr g e))) - let wrap, e' = mkExprAddrOfExpr g fref.Tycon.IsStructOrEnumTycon false NeverMutates e None m + let wrap, e', _readonly = mkExprAddrOfExpr g fref.Tycon.IsStructOrEnumTycon false NeverMutates e None m wrap (mkRecdFieldGetViaExprAddr(e', fref, tinst, m)) let mkUnionCaseFieldGetUnproven g (e, cref:UnionCaseRef, tinst, j, m) = assert (not (isByrefTy g (tyOfExpr g e))) - let wrap, e' = mkExprAddrOfExpr g cref.Tycon.IsStructOrEnumTycon false NeverMutates e None m + let wrap, e', _readonly = mkExprAddrOfExpr g cref.Tycon.IsStructOrEnumTycon false NeverMutates e None m wrap (mkUnionCaseFieldGetUnprovenViaExprAddr (e', cref, tinst, j, m)) diff --git a/src/fsharp/TastOps.fsi b/src/fsharp/TastOps.fsi index 55e1086a0a..5628704e56 100755 --- a/src/fsharp/TastOps.fsi +++ b/src/fsharp/TastOps.fsi @@ -164,6 +164,9 @@ val isBeingGeneralized : Typar -> TypeScheme -> bool val mkLazyAnd : TcGlobals -> range -> Expr -> Expr -> Expr val mkLazyOr : TcGlobals -> range -> Expr -> Expr -> Expr val mkByrefTy : TcGlobals -> TType -> TType +val mkByrefTyWithInference : TcGlobals -> TType -> TType -> TType +val mkInByrefTy : TcGlobals -> TType -> TType +val mkOutByrefTy : TcGlobals -> TType -> TType //------------------------------------------------------------------------- // Make construction operations @@ -182,12 +185,12 @@ val mkReraiseLibCall : TcGlobals -> TType -> range -> Expr //------------------------------------------------------------------------- val mkTupleFieldGet : TcGlobals -> TupInfo * Expr * TypeInst * int * range -> Expr -val mkRecdFieldGetViaExprAddr : Expr * RecdFieldRef * TypeInst * range -> Expr -val mkRecdFieldGetAddrViaExprAddr : Expr * RecdFieldRef * TypeInst * range -> Expr -val mkStaticRecdFieldGet : RecdFieldRef * TypeInst * range -> Expr -val mkStaticRecdFieldSet : RecdFieldRef * TypeInst * Expr * range -> Expr -val mkStaticRecdFieldGetAddr : RecdFieldRef * TypeInst * range -> Expr -val mkRecdFieldSetViaExprAddr : Expr * RecdFieldRef * TypeInst * Expr * range -> Expr +val mkRecdFieldGetViaExprAddr : Expr * RecdFieldRef * TypeInst * range -> Expr +val mkRecdFieldGetAddrViaExprAddr : readonly: bool * Expr * RecdFieldRef * TypeInst * range -> Expr +val mkStaticRecdFieldGet : RecdFieldRef * TypeInst * range -> Expr +val mkStaticRecdFieldSet : RecdFieldRef * TypeInst * Expr * range -> Expr +val mkStaticRecdFieldGetAddr : readonly: bool * RecdFieldRef * TypeInst * range -> Expr +val mkRecdFieldSetViaExprAddr : Expr * RecdFieldRef * TypeInst * Expr * range -> Expr val mkUnionCaseTagGetViaExprAddr : Expr * TyconRef * TypeInst * range -> Expr /// Make a 'TOp.UnionCaseProof' expression, which proves a union value is over a particular case (used only for ref-unions, not struct-unions) @@ -201,7 +204,7 @@ val mkUnionCaseFieldGetProvenViaExprAddr : Expr * UnionCaseRef * TypeInst * in /// Build a 'TOp.UnionCaseFieldGetAddr' expression for a field of a union when we've already determined the value to be a particular union case. For ref-unions, /// the input expression has 'TType_ucase', which is an F# compiler internal "type" corresponding to the union case. For struct-unions, /// the input should be the address of the expression. -val mkUnionCaseFieldGetAddrProvenViaExprAddr : Expr * UnionCaseRef * TypeInst * int * range -> Expr +val mkUnionCaseFieldGetAddrProvenViaExprAddr : readonly: bool * Expr * UnionCaseRef * TypeInst * int * range -> Expr /// Build a 'TOp.UnionCaseFieldGetAddr' expression for a field of a union when we've already determined the value to be a particular union case. For ref-unions, /// the input expression has 'TType_ucase', which is an F# compiler internal "type" corresponding to the union case. For struct-unions, @@ -219,7 +222,7 @@ val mkUnionCaseFieldGetUnproven : TcGlobals -> Expr * UnionCaseRef * TypeIn val mkExnCaseFieldGet : Expr * TyconRef * int * range -> Expr val mkExnCaseFieldSet : Expr * TyconRef * int * Expr * range -> Expr -val mkArrayElemAddress : TcGlobals -> ILReadonly * bool * ILArrayShape * TType * Expr * Expr * range -> Expr +val mkArrayElemAddress : TcGlobals -> readonly: bool * ILReadonly * bool * ILArrayShape * TType * Expr list * range -> Expr //------------------------------------------------------------------------- // Compiled view of tuples @@ -263,9 +266,9 @@ val convertToTypeWithMetadataIfPossible : TcGlobals -> TType -> TType //------------------------------------------------------------------------- exception DefensiveCopyWarning of string * range -type Mutates = DefinitelyMutates | PossiblyMutates | NeverMutates -val mkExprAddrOfExprAux : TcGlobals -> bool -> bool -> Mutates -> Expr -> ValRef option -> range -> (Val * Expr) option * Expr -val mkExprAddrOfExpr : TcGlobals -> bool -> bool -> Mutates -> Expr -> ValRef option -> range -> (Expr -> Expr) * Expr +type Mutates = AddressOfOp | DefinitelyMutates | PossiblyMutates | NeverMutates +val mkExprAddrOfExprAux : TcGlobals -> bool -> bool -> Mutates -> Expr -> ValRef option -> range -> (Val * Expr) option * Expr * bool +val mkExprAddrOfExpr : TcGlobals -> bool -> bool -> Mutates -> Expr -> ValRef option -> range -> (Expr -> Expr) * Expr * bool //------------------------------------------------------------------------- // Tables keyed on values and/or type parameters @@ -296,41 +299,64 @@ type ValHash<'T> = /// Maps Val's to list of T based on stamp keys [] type ValMultiMap<'T> = + + member ContainsKey : Val -> bool + member Find : Val -> 'T list + member Add : Val * 'T -> ValMultiMap<'T> + member Remove : Val -> ValMultiMap<'T> + member Contents : StampMap<'T list> + static member Empty : ValMultiMap<'T> [] /// Maps Typar to T based on stamp keys type TyparMap<'T> = + member Item : Typar -> 'T with get + member ContainsKey : Typar -> bool + member TryFind : Typar -> 'T option + member Add : Typar * 'T -> TyparMap<'T> + static member Empty : TyparMap<'T> [] /// Maps TyconRef to T based on stamp keys type TyconRefMap<'T> = + member Item : TyconRef -> 'T with get + member TryFind : TyconRef -> 'T option + member ContainsKey : TyconRef -> bool + member Add : TyconRef -> 'T -> TyconRefMap<'T> + member Remove : TyconRef -> TyconRefMap<'T> + member IsEmpty : bool + static member Empty : TyconRefMap<'T> + static member OfList : (TyconRef * 'T) list -> TyconRefMap<'T> /// Maps TyconRef to list of T based on stamp keys [] type TyconRefMultiMap<'T> = + member Find : TyconRef -> 'T list + member Add : TyconRef * 'T -> TyconRefMultiMap<'T> + static member Empty : TyconRefMultiMap<'T> - static member OfList : (TyconRef * 'T) list -> TyconRefMultiMap<'T> + static member OfList : (TyconRef * 'T) list -> TyconRefMultiMap<'T> //------------------------------------------------------------------------- // Orderings on Tycon, Val, RecdFieldRef, Typar @@ -874,7 +900,7 @@ val mkAddrSet : range -> ValRef -> Expr -> Expr /// *localv_ptr val mkAddrGet : range -> ValRef -> Expr /// &localv -val mkValAddr : range -> ValRef -> Expr +val mkValAddr : range -> readonly: bool -> ValRef -> Expr //------------------------------------------------------------------------- // Note these take the address of the record expression if it is a struct, and @@ -978,6 +1004,7 @@ val ExprStats : Expr -> string //------------------------------------------------------------------------- val mkNativePtrTy : TcGlobals -> TType -> TType +val mkVoidPtrTy : TcGlobals -> TType val mkArrayType : TcGlobals -> TType -> TType val isOptionTy : TcGlobals -> TType -> bool val destOptionTy : TcGlobals -> TType -> TType @@ -1095,10 +1122,13 @@ val TypeHasDefaultValue : TcGlobals -> range -> TType -> bool val isAbstractTycon : Tycon -> bool val isUnionCaseRefDefinitelyMutable : UnionCaseRef -> bool -val isRecdOrUnionOrStructTyconRefDefinitelyMutable : TcGlobals -> TyconRef -> bool +val isRecdOrUnionOrStructTyconRefDefinitelyMutable : TyconRef -> bool val isExnDefinitelyMutable : TyconRef -> bool val isUnionCaseFieldMutable : TcGlobals -> UnionCaseRef -> int -> bool val isExnFieldMutable : TyconRef -> int -> bool +val isRecdOrStructTyconRefReadOnly: TcGlobals -> range -> TyconRef -> bool +val isRecdOrStructTyconRefAssumedImmutable: TcGlobals -> TyconRef -> bool +val isRecdOrStructTyReadOnly: TcGlobals -> range -> TType -> bool val useGenuineField : Tycon -> RecdField -> bool val ComputeFieldName : Tycon -> RecdField -> string @@ -1377,7 +1407,6 @@ val TryFindAttributeUsageAttribute : TcGlobals -> range -> TyconRef -> bool opti val TryDecodeTypeProviderAssemblyAttr : ILGlobals -> ILAttribute -> string option #endif val IsSignatureDataVersionAttr : ILAttribute -> bool -val ILThingHasExtensionAttribute : ILAttributes -> bool val TryFindAutoOpenAttr : IL.ILGlobals -> ILAttribute -> string option val TryFindInternalsVisibleToAttr : IL.ILGlobals -> ILAttribute -> string option val IsMatchingSignatureDataVersionAttr : IL.ILGlobals -> ILVersionInfo -> ILAttribute -> bool @@ -1396,13 +1425,17 @@ val mkCompilerGeneratedAttr : TcGlobals -> int -> ILAtt // More common type construction //------------------------------------------------------------------------- +val isInByrefTy : TcGlobals -> TType -> bool +val isOutByrefTy : TcGlobals -> TType -> bool val isByrefTy : TcGlobals -> TType -> bool + val isNativePtrTy : TcGlobals -> TType -> bool val destByrefTy : TcGlobals -> TType -> TType val destNativePtrTy : TcGlobals -> TType -> TType -val isByrefLikeTyconRef : TcGlobals -> TyconRef -> bool -val isByrefLikeTy : TcGlobals -> TType -> bool +val isByrefTyconRef : TcGlobals -> TyconRef -> bool +val isByrefLikeTyconRef : TcGlobals -> range -> TyconRef -> bool +val isByrefLikeTy : TcGlobals -> range -> TType -> bool //------------------------------------------------------------------------- // Tuple constructors/destructors diff --git a/src/fsharp/TastPickle.fs b/src/fsharp/TastPickle.fs index 81a2dd85aa..ceceb737ca 100755 --- a/src/fsharp/TastPickle.fs +++ b/src/fsharp/TastPickle.fs @@ -2221,7 +2221,7 @@ and p_target (TTarget(a,b,_)) st = p_tup2 p_Vals p_expr (a,b) st and p_bind (TBind(a,b,_)) st = p_tup2 p_Val p_expr (a,b) st and p_lval_op_kind x st = - p_byte (match x with LGetAddr -> 0 | LByrefGet -> 1 | LSet -> 2 | LByrefSet -> 3) st + p_byte (match x with LAddrOf _ -> 0 | LByrefGet -> 1 | LSet -> 2 | LByrefSet -> 3) st and p_recdInfo x st = match x with @@ -2254,7 +2254,7 @@ and u_bind st = let a = u_Val st in let b = u_expr st in TBind(a,b,NoSequencePoi and u_lval_op_kind st = match u_byte st with - | 0 -> LGetAddr + | 0 -> LAddrOf false | 1 -> LByrefGet | 2 -> LSet | 3 -> LByrefSet @@ -2283,8 +2283,8 @@ and p_op x st = p_byte 30 st; p_int a st else p_byte 11 st; p_int a st - | TOp.ILAsm (a,b) -> p_byte 12 st; p_tup2 (p_list p_ILInstr) p_typs (a,b) st - | TOp.RefAddrGet -> p_byte 13 st + | TOp.ILAsm (a,b) -> p_byte 12 st; p_tup2 (p_list p_ILInstr) p_typs (a,b) st + | TOp.RefAddrGet _ -> p_byte 13 st | TOp.UnionCaseProof (a) -> p_byte 14 st; p_ucref a st | TOp.Coerce -> p_byte 15 st | TOp.TraitCall (b) -> p_byte 16 st; p_trait b st @@ -2297,10 +2297,10 @@ and p_op x st = | TOp.Bytes bytes -> p_byte 22 st; p_bytes bytes st | TOp.TryCatch _ -> p_byte 23 st | TOp.TryFinally _ -> p_byte 24 st - | TOp.ValFieldGetAddr (a) -> p_byte 25 st; p_rfref a st + | TOp.ValFieldGetAddr (a, _) -> p_byte 25 st; p_rfref a st | TOp.UInt16s arr -> p_byte 26 st; p_array p_uint16 arr st | TOp.Reraise -> p_byte 27 st - | TOp.UnionCaseFieldGetAddr (a,b) -> p_byte 28 st; p_tup2 p_ucref p_int (a,b) st + | TOp.UnionCaseFieldGetAddr (a,b, _) -> p_byte 28 st; p_tup2 p_ucref p_int (a,b) st // Note tag byte 29 is taken for struct tuples, see above // Note tag byte 30 is taken for struct tuples, see above | TOp.Goto _ | TOp.Label _ | TOp.Return -> failwith "unexpected backend construct in pickled TAST" @@ -2338,7 +2338,7 @@ and u_op st = | 12 -> let a = (u_list u_ILInstr) st let b = u_typs st TOp.ILAsm (a,b) - | 13 -> TOp.RefAddrGet + | 13 -> TOp.RefAddrGet false // ok to set the 'readonly' flag on these operands to false on re-read since the flag is only used for typechecking purposes | 14 -> let a = u_ucref st TOp.UnionCaseProof a | 15 -> TOp.Coerce @@ -2360,12 +2360,12 @@ and u_op st = | 23 -> TOp.TryCatch(NoSequencePointAtTry,NoSequencePointAtWith) | 24 -> TOp.TryFinally(NoSequencePointAtTry,NoSequencePointAtFinally) | 25 -> let a = u_rfref st - TOp.ValFieldGetAddr a + TOp.ValFieldGetAddr (a, false) | 26 -> TOp.UInt16s (u_array u_uint16 st) | 27 -> TOp.Reraise | 28 -> let a = u_ucref st let b = u_int st - TOp.UnionCaseFieldGetAddr (a,b) + TOp.UnionCaseFieldGetAddr (a,b, false) | 29 -> TOp.Tuple tupInfoStruct | 30 -> let a = u_int st TOp.TupleFieldGet (tupInfoStruct, a) @@ -2523,7 +2523,7 @@ let _ = fill_u_Vals (u_list u_Val) //--------------------------------------------------------------------------- let pickleModuleOrNamespace mspec st = p_tycon_spec mspec st -let pickleCcuInfo minfo st = +let pickleCcuInfo (minfo: PickledCcuInfo) st = p_tup4 pickleModuleOrNamespace p_string p_bool (p_space 3) (minfo.mspec, minfo.compileTimeWorkingDir, minfo.usesQuotations,()) st let unpickleModuleOrNamespace st = u_tycon_spec st diff --git a/src/fsharp/TcGlobals.fs b/src/fsharp/TcGlobals.fs index 64ea4e96d6..c4235f6fe4 100755 --- a/src/fsharp/TcGlobals.fs +++ b/src/fsharp/TcGlobals.fs @@ -8,7 +8,9 @@ /// comparison and hashing functions. module internal Microsoft.FSharp.Compiler.TcGlobals -open Internal.Utilities +open System.Collections.Generic +open System.Diagnostics + open Microsoft.FSharp.Compiler open Microsoft.FSharp.Compiler.AbstractIL open Microsoft.FSharp.Compiler.AbstractIL.IL @@ -21,13 +23,25 @@ open Microsoft.FSharp.Compiler.Ast open Microsoft.FSharp.Compiler.Lib open Microsoft.FSharp.Compiler.PrettyNaming -open System.Collections.Generic +open Internal.Utilities let internal DummyFileNameForRangesWithoutASpecificLocation = "startup" let private envRange = rangeN DummyFileNameForRangesWithoutASpecificLocation 0 -type public IntrinsicValRef = IntrinsicValRef of NonLocalEntityRef * string * bool * TType * ValLinkageFullKey +/// Represents an intrinsic value from FSharp.Core known to the compiler +[] +type IntrinsicValRef = + | IntrinsicValRef of NonLocalEntityRef * string * bool * TType * ValLinkageFullKey + + member x.Name = (let (IntrinsicValRef(_, nm, _, _, _)) = x in nm) + /// For debugging + [] + member x.DebugText = x.ToString() + + /// For debugging + override x.ToString() = x.Name + let ValRefForIntrinsic (IntrinsicValRef(mvr, _, _, _, key)) = mkNonLocalValRef mvr key //------------------------------------------------------------------------- @@ -37,7 +51,6 @@ let ValRefForIntrinsic (IntrinsicValRef(mvr, _, _, _, key)) = mkNonLocalValRef [] module FSharpLib = - let CoreOperatorsName = FSharpLib.Root + ".Core.Operators" let CoreOperatorsCheckedName = FSharpLib.Root + ".Core.Operators.Checked" let ControlName = FSharpLib.Root + ".Control" let LinqName = FSharpLib.Root + ".Linq" @@ -47,22 +60,18 @@ module FSharpLib = let LinqRuntimeHelpersName = FSharpLib.Root + ".Linq.RuntimeHelpers" let RuntimeHelpersName = FSharpLib.Root + ".Core.CompilerServices.RuntimeHelpers" let ExtraTopLevelOperatorsName = FSharpLib.Root + ".Core.ExtraTopLevelOperators" - let HashCompareName = FSharpLib.Root + ".Core.LanguagePrimitives.HashCompare" + let NativeInteropName = FSharpLib.Root + ".NativeInterop" let QuotationsName = FSharpLib.Root + ".Quotations" - let OperatorsPath = IL.splitNamespace CoreOperatorsName |> Array.ofList - let OperatorsCheckedPath = IL.splitNamespace CoreOperatorsCheckedName |> Array.ofList let ControlPath = IL.splitNamespace ControlName let LinqPath = IL.splitNamespace LinqName let CollectionsPath = IL.splitNamespace CollectionsName - let LanguagePrimitivesPath = IL.splitNamespace LanguagePrimitivesName |> Array.ofList - let HashComparePath = IL.splitNamespace HashCompareName |> Array.ofList + let NativeInteropPath = IL.splitNamespace NativeInteropName |> Array.ofList let CompilerServicesPath = IL.splitNamespace CompilerServicesName |> Array.ofList let LinqRuntimeHelpersPath = IL.splitNamespace LinqRuntimeHelpersName |> Array.ofList let RuntimeHelpersPath = IL.splitNamespace RuntimeHelpersName |> Array.ofList let QuotationsPath = IL.splitNamespace QuotationsName |> Array.ofList - let ExtraTopLevelOperatorsPath = IL.splitNamespace ExtraTopLevelOperatorsName |> Array.ofList let RootPathArray = FSharpLib.RootPath |> Array.ofList let CorePathArray = FSharpLib.CorePath |> Array.ofList @@ -87,11 +96,23 @@ let mk_MFRuntimeHelpers_tcref ccu n = mkNonLocalTyconRef2 ccu FSharpLib.Runtim let mk_MFControl_tcref ccu n = mkNonLocalTyconRef2 ccu FSharpLib.ControlPathArray n -type public BuiltinAttribInfo = +type + [] + BuiltinAttribInfo = | AttribInfo of ILTypeRef * TyconRef + member this.TyconRef = let (AttribInfo(_, tcref)) = this in tcref + member this.TypeRef = let (AttribInfo(tref, _)) = this in tref + /// For debugging + [] + member x.DebugText = x.ToString() + + /// For debugging + override x.ToString() = x.TyconRef.ToString() + + [] let tname_DebuggerNonUserCodeAttribute = "System.Diagnostics.DebuggerNonUserCodeAttribute" [] @@ -201,7 +222,11 @@ type public TcGlobals(compilingFslib: bool, ilg:ILGlobals, fslibCcu: CcuThunk, d let v_pint16_tcr = mk_MFCore_tcref fslibCcu "int16`1" let v_pint64_tcr = mk_MFCore_tcref fslibCcu "int64`1" let v_byref_tcr = mk_MFCore_tcref fslibCcu "byref`1" + let v_byref2_tcr = mk_MFCore_tcref fslibCcu "byref`2" + let v_outref_tcr = mk_MFCore_tcref fslibCcu "outref`1" + let v_inref_tcr = mk_MFCore_tcref fslibCcu "inref`1" let v_nativeptr_tcr = mk_MFCore_tcref fslibCcu "nativeptr`1" + let v_voidptr_tcr = mk_MFCore_tcref fslibCcu "voidptr" let v_ilsigptr_tcr = mk_MFCore_tcref fslibCcu "ilsigptr`1" let v_fastFunc_tcr = mk_MFCore_tcref fslibCcu "FSharpFunc`2" let v_refcell_tcr_canon = mk_MFCore_tcref fslibCcu "Ref`1" @@ -384,12 +409,14 @@ type public TcGlobals(compilingFslib: bool, ilg:ILGlobals, fslibCcu: CcuThunk, d let fslib_MFCompilerServices_nleref = mkNonLocalEntityRef fslibCcu FSharpLib.CompilerServicesPath let fslib_MFLinqRuntimeHelpers_nleref = mkNonLocalEntityRef fslibCcu FSharpLib.LinqRuntimeHelpersPath let fslib_MFControl_nleref = mkNonLocalEntityRef fslibCcu FSharpLib.ControlPathArray + let fslib_MFNativeInterop_nleref = mkNonLocalEntityRef fslibCcu FSharpLib.NativeInteropPath let fslib_MFLanguagePrimitives_nleref = mkNestedNonLocalEntityRef fslib_MFCore_nleref "LanguagePrimitives" let fslib_MFIntrinsicOperators_nleref = mkNestedNonLocalEntityRef fslib_MFLanguagePrimitives_nleref "IntrinsicOperators" let fslib_MFIntrinsicFunctions_nleref = mkNestedNonLocalEntityRef fslib_MFLanguagePrimitives_nleref "IntrinsicFunctions" let fslib_MFHashCompare_nleref = mkNestedNonLocalEntityRef fslib_MFLanguagePrimitives_nleref "HashCompare" let fslib_MFOperators_nleref = mkNestedNonLocalEntityRef fslib_MFCore_nleref "Operators" + let fslib_MFByRefKinds_nleref = mkNestedNonLocalEntityRef fslib_MFCore_nleref "ByRefKinds" let fslib_MFOperatorIntrinsics_nleref = mkNestedNonLocalEntityRef fslib_MFOperators_nleref "OperatorIntrinsics" let fslib_MFOperatorsUnchecked_nleref = mkNestedNonLocalEntityRef fslib_MFOperators_nleref "Unchecked" let fslib_MFOperatorsChecked_nleref = mkNestedNonLocalEntityRef fslib_MFOperators_nleref "Checked" @@ -408,6 +435,7 @@ type public TcGlobals(compilingFslib: bool, ilg:ILGlobals, fslibCcu: CcuThunk, d let fslib_MFSetModule_nleref = mkNestedNonLocalEntityRef fslib_MFCollections_nleref "SetModule" let fslib_MFMapModule_nleref = mkNestedNonLocalEntityRef fslib_MFCollections_nleref "MapModule" let fslib_MFStringModule_nleref = mkNestedNonLocalEntityRef fslib_MFCollections_nleref "StringModule" + let fslib_MFNativePtrModule_nleref = mkNestedNonLocalEntityRef fslib_MFNativeInterop_nleref "NativePtrModule" let fslib_MFOptionModule_nleref = mkNestedNonLocalEntityRef fslib_MFCore_nleref "OptionModule" let fslib_MFRuntimeHelpers_nleref = mkNestedNonLocalEntityRef fslib_MFCompilerServices_nleref "RuntimeHelpers" let fslib_MFQuotations_nleref = mkNestedNonLocalEntityRef fslib_MF_nleref "Quotations" @@ -471,6 +499,7 @@ type public TcGlobals(compilingFslib: bool, ilg:ILGlobals, fslibCcu: CcuThunk, d fslib_MFSetModule_nleref fslib_MFMapModule_nleref fslib_MFStringModule_nleref + fslib_MFNativePtrModule_nleref fslib_MFOptionModule_nleref fslib_MFRuntimeHelpers_nleref ] do @@ -650,6 +679,8 @@ type public TcGlobals(compilingFslib: bool, ilg:ILGlobals, fslibCcu: CcuThunk, d let v_array3D_set_info = makeIntrinsicValRef(fslib_MFIntrinsicFunctions_nleref, "SetArray3D" , None , None , [vara], ([[mkArrayType 3 varaTy];[v_int_ty]; [v_int_ty]; [v_int_ty]; [varaTy]], v_unit_ty)) let v_array4D_set_info = makeIntrinsicValRef(fslib_MFIntrinsicFunctions_nleref, "SetArray4D" , None , None , [vara], ([[mkArrayType 4 varaTy];[v_int_ty]; [v_int_ty]; [v_int_ty]; [v_int_ty]; [varaTy]], v_unit_ty)) + let v_nativeptr_tobyref_info = makeIntrinsicValRef(fslib_MFNativePtrModule_nleref, "toByRef" , None , Some "ToByRefInlined", [vara], ([[mkNativePtrTy varaTy]], mkByrefTy varaTy)) + let v_seq_collect_info = makeIntrinsicValRef(fslib_MFSeqModule_nleref, "collect" , None , Some "Collect", [vara;varb;varc], ([[varaTy --> varbTy]; [mkSeqTy varaTy]], mkSeqTy varcTy)) let v_seq_delay_info = makeIntrinsicValRef(fslib_MFSeqModule_nleref, "delay" , None , Some "Delay" , [varb], ([[v_unit_ty --> mkSeqTy varbTy]], mkSeqTy varbTy)) let v_seq_append_info = makeIntrinsicValRef(fslib_MFSeqModule_nleref, "append" , None , Some "Append" , [varb], ([[mkSeqTy varbTy]; [mkSeqTy varbTy]], mkSeqTy varbTy)) @@ -915,7 +946,11 @@ type public TcGlobals(compilingFslib: bool, ilg:ILGlobals, fslibCcu: CcuThunk, d member __.pint16_tcr = v_pint16_tcr member __.pint64_tcr = v_pint64_tcr member __.byref_tcr = v_byref_tcr + member __.byref2_tcr = v_byref2_tcr + member __.outref_tcr = v_outref_tcr + member __.inref_tcr = v_inref_tcr member __.nativeptr_tcr = v_nativeptr_tcr + member __.voidptr_tcr = v_voidptr_tcr member __.ilsigptr_tcr = v_ilsigptr_tcr member __.fastFunc_tcr = v_fastFunc_tcr member __.tcref_IQueryable = v_tcref_IQueryable @@ -925,6 +960,9 @@ type public TcGlobals(compilingFslib: bool, ilg:ILGlobals, fslibCcu: CcuThunk, d member __.fslib_IDelegateEvent_tcr = v_fslib_IDelegateEvent_tcr member __.seq_tcr = v_seq_tcr member val seq_base_tcr = mk_MFCompilerServices_tcref fslibCcu "GeneratedSequenceBase`1" + member val byrefkind_In_tcr = mkNonLocalTyconRef fslib_MFByRefKinds_nleref "In" + member val byrefkind_Out_tcr = mkNonLocalTyconRef fslib_MFByRefKinds_nleref "Out" + member val byrefkind_InOut_tcr = mkNonLocalTyconRef fslib_MFByRefKinds_nleref "InOut" member val measureproduct_tcr = mk_MFCompilerServices_tcref fslibCcu "MeasureProduct`2" member val measureinverse_tcr = mk_MFCompilerServices_tcref fslibCcu "MeasureInverse`1" member val measureone_tcr = mk_MFCompilerServices_tcref fslibCcu "MeasureOne" @@ -1073,6 +1111,11 @@ type public TcGlobals(compilingFslib: bool, ilg:ILGlobals, fslibCcu: CcuThunk, d member val attrib_ParamArrayAttribute = findSysAttrib "System.ParamArrayAttribute" member val attrib_IDispatchConstantAttribute = tryFindSysAttrib "System.Runtime.CompilerServices.IDispatchConstantAttribute" member val attrib_IUnknownConstantAttribute = tryFindSysAttrib "System.Runtime.CompilerServices.IUnknownConstantAttribute" + + // We use 'findSysAttrib' here because lookup on attribute is done by name comparison, and can proceed + // even if the type is not found in a system assembly. + member val attrib_IsByRefLikeAttribute = findSysAttrib "System.Runtime.CompilerServices.IsByRefLikeAttribute" + member val attrib_IsReadOnlyAttribute = findSysAttrib "System.Runtime.CompilerServices.IsReadOnlyAttribute" member val attrib_SystemObsolete = findSysAttrib "System.ObsoleteAttribute" member val attrib_DllImportAttribute = tryFindSysAttrib "System.Runtime.InteropServices.DllImportAttribute" @@ -1082,7 +1125,7 @@ type public TcGlobals(compilingFslib: bool, ilg:ILGlobals, fslibCcu: CcuThunk, d member val attrib_ComImportAttribute = tryFindSysAttrib "System.Runtime.InteropServices.ComImportAttribute" member val attrib_FieldOffsetAttribute = findSysAttrib "System.Runtime.InteropServices.FieldOffsetAttribute" member val attrib_MarshalAsAttribute = tryFindSysAttrib "System.Runtime.InteropServices.MarshalAsAttribute" - member val attrib_InAttribute = tryFindSysAttrib "System.Runtime.InteropServices.InAttribute" + member val attrib_InAttribute = findSysAttrib "System.Runtime.InteropServices.InAttribute" member val attrib_OutAttribute = findSysAttrib "System.Runtime.InteropServices.OutAttribute" member val attrib_OptionalAttribute = tryFindSysAttrib "System.Runtime.InteropServices.OptionalAttribute" member val attrib_DefaultParameterValueAttribute = tryFindSysAttrib "System.Runtime.InteropServices.DefaultParameterValueAttribute" @@ -1299,6 +1342,7 @@ type public TcGlobals(compilingFslib: bool, ilg:ILGlobals, fslibCcu: CcuThunk, d member val array4D_get_vref = ValRefForIntrinsic v_array4D_get_info member val seq_singleton_vref = ValRefForIntrinsic v_seq_singleton_info member val seq_collect_vref = ValRefForIntrinsic v_seq_collect_info + member val nativeptr_tobyref_vref = ValRefForIntrinsic v_nativeptr_tobyref_info member val seq_using_vref = ValRefForIntrinsic v_seq_using_info member val seq_delay_vref = ValRefForIntrinsic v_seq_delay_info member val seq_append_vref = ValRefForIntrinsic v_seq_append_info diff --git a/src/fsharp/TypeChecker.fs b/src/fsharp/TypeChecker.fs index b2ee344b11..7bff195ce5 100755 --- a/src/fsharp/TypeChecker.fs +++ b/src/fsharp/TypeChecker.fs @@ -537,8 +537,8 @@ type cenv = let CopyAndFixupTypars m rigid tpsorig = ConstraintSolver.FreshenAndFixupTypars m rigid [] [] tpsorig -let UnifyTypes cenv (env: TcEnv) m expectedTy actualTy = - ConstraintSolver.AddCxTypeEqualsType env.eContextInfo env.DisplayEnv cenv.css m (tryNormalizeMeasureInType cenv.g expectedTy) (tryNormalizeMeasureInType cenv.g actualTy) +let UnifyTypes cenv (env: TcEnv) m actualTy expectedTy = + ConstraintSolver.AddCxTypeEqualsType env.eContextInfo env.DisplayEnv cenv.css m (tryNormalizeMeasureInType cenv.g actualTy) (tryNormalizeMeasureInType cenv.g expectedTy) /// Make the initial type checking environment for a single file with an empty accumulator for the overall contents for the file let MakeInitialEnv env = @@ -864,7 +864,7 @@ let TcConst cenv ty m env c = | SynMeasure.Anon _ -> error(Error(FSComp.SR.tcUnexpectedMeasureAnon(), m)) | SynMeasure.Var(_, m) -> error(Error(FSComp.SR.tcNonZeroConstantCannotHaveGenericUnit(), m)) - let unif ty2 = UnifyTypes cenv env m ty ty2 + let unif expected = UnifyTypes cenv env m ty expected let unifyMeasureArg iszero tcr c = let measureTy = @@ -2100,32 +2100,37 @@ module GeneralizationHelpers = let rec IsGeneralizableValue g t = match t with - | Expr.Lambda _ | Expr.TyLambda _ | Expr.Const _ | Expr.Val _ -> true + | Expr.Lambda _ | Expr.TyLambda _ | Expr.Const _ -> true + + // let f(x: byref) = let v = &x in ... shouldn't generalize "v" + | Expr.Val (vref, _, m) -> not (isByrefLikeTy g m vref.Type) // Look through coercion nodes corresponding to introduction of subsumption | Expr.Op(TOp.Coerce, [inputTy;actualTy], [e1], _) when isFunTy g actualTy && isFunTy g inputTy -> IsGeneralizableValue g e1 | Expr.Op(op, _, args, _) -> - match op with - | TOp.Tuple _ -> true - | TOp.UnionCase uc -> not (isUnionCaseRefDefinitelyMutable uc) - | TOp.Recd(ctorInfo, tcref) -> - match ctorInfo with - | RecdExpr -> not (isRecdOrUnionOrStructTyconRefDefinitelyMutable g tcref) - | RecdExprIsObjInit -> false - | TOp.Array -> isNil args - | TOp.ExnConstr ec -> not (isExnDefinitelyMutable ec) - | TOp.ILAsm([], _) -> true - - | _ -> false - && List.forall (IsGeneralizableValue g) args + let canGeneralizeOp = + match op with + | TOp.Tuple _ -> true + | TOp.UnionCase uc -> not (isUnionCaseRefDefinitelyMutable uc) + | TOp.Recd(ctorInfo, tcref) -> + match ctorInfo with + | RecdExpr -> not (isRecdOrUnionOrStructTyconRefDefinitelyMutable tcref) + | RecdExprIsObjInit -> false + | TOp.Array -> isNil args + | TOp.ExnConstr ec -> not (isExnDefinitelyMutable ec) + | TOp.ILAsm([], _) -> true + | _ -> false + + canGeneralizeOp && List.forall (IsGeneralizableValue g) args | Expr.LetRec(binds, body, _, _) -> binds |> List.forall (fun b -> not b.Var.IsMutable) && binds |> List.forall (fun b -> IsGeneralizableValue g b.Expr) && IsGeneralizableValue g body + | Expr.Let(bind, body, _, _) -> not bind.Var.IsMutable && IsGeneralizableValue g bind.Expr && @@ -2641,7 +2646,10 @@ let FreshenObjectArgType cenv m rigid tcref isExtrinsic declaredTyconTypars = // Struct members have a byref 'this' type (unless they are extrinsic extension members) let thisTy = if not isExtrinsic && tcref.IsStructOrEnumTycon then - mkByrefTy cenv.g objTy + if isRecdOrStructTyReadOnly cenv.g m objTy then + mkInByrefTy cenv.g objTy + else + mkByrefTy cenv.g objTy else objTy tcrefObjTy, enclosingDeclaredTypars, renaming, objTy, thisTy @@ -3070,7 +3078,7 @@ let BuildILFieldGet g amap m objExpr (finfo:ILFieldInfo) = Expr.Const(TcFieldInit m lit, m, fieldType) | _ -> #endif - let wrap, objExpr = mkExprAddrOfExpr g isValueType false NeverMutates objExpr None m + let wrap, objExpr, _readonly = mkExprAddrOfExpr g isValueType false NeverMutates objExpr None m // The empty instantiation on the AbstractIL fspec is OK, since we make the correct fspec in IlxGen.GenAsm // This ensures we always get the type instantiation right when doing this from // polymorphic code, after inlining etc. * @@ -3088,7 +3096,7 @@ let BuildILFieldSet g m objExpr (finfo:ILFieldInfo) argExpr = // polymorphic code, after inlining etc. * let fspec = mkILFieldSpec(fref, mkILNamedTy valu fref.DeclaringTypeRef []) if finfo.IsInitOnly then error (Error (FSComp.SR.tcFieldIsReadonly(), m)) - let wrap, objExpr = mkExprAddrOfExpr g isValueType false DefinitelyMutates objExpr None m + let wrap, objExpr, _readonly = mkExprAddrOfExpr g isValueType false DefinitelyMutates objExpr None m wrap (mkAsmExpr ([ mkNormalStfld fspec ], tinst, [objExpr; argExpr], [], m)) let BuildILStaticFieldSet m (finfo:ILFieldInfo) argExpr = @@ -3107,7 +3115,7 @@ let BuildRecdFieldSet g m objExpr (rfinfo:RecdFieldInfo) argExpr = let tgty = rfinfo.DeclaringType let valu = isStructTy g tgty let objExpr = if valu then objExpr else mkCoerceExpr(objExpr, tgty, m, tyOfExpr g objExpr) - let wrap, objExpr = mkExprAddrOfExpr g valu false DefinitelyMutates objExpr None m + let wrap, objExpr, _readonly = mkExprAddrOfExpr g valu false DefinitelyMutates objExpr None m wrap (mkRecdFieldSetViaExprAddr (objExpr, rfinfo.RecdFieldRef, rfinfo.TypeInst, argExpr, m) ) @@ -3964,30 +3972,75 @@ let CheckAndRewriteObjectCtor g env (ctorLambaExpr:Expr) = /// Post-typechecking normalizations to enforce semantic constraints /// lazy and, lazy or, rethrow, address-of -let buildApp cenv expr exprty arg m = +let buildApp cenv expr resultTy arg m = let g = cenv.g match expr, arg with + + // Special rule for building applications of the 'x && y' operator | ApplicableExpr(_, Expr.App(Expr.Val(vf, _, _), _, _, [x0], _), _) , _ when valRefEq g vf g.and_vref || valRefEq g vf g.and2_vref -> - MakeApplicableExprNoFlex cenv (mkLazyAnd g m x0 arg) + MakeApplicableExprNoFlex cenv (mkLazyAnd g m x0 arg), resultTy + + // Special rule for building applications of the 'x || y' operator | ApplicableExpr(_, Expr.App(Expr.Val(vf, _, _), _, _, [x0], _), _), _ when valRefEq g vf g.or_vref || valRefEq g vf g.or2_vref -> - MakeApplicableExprNoFlex cenv (mkLazyOr g m x0 arg ) + MakeApplicableExprNoFlex cenv (mkLazyOr g m x0 arg ), resultTy + + // Special rule for building applications of the 'reraise' operator | ApplicableExpr(_, Expr.App(Expr.Val(vf, _, _), _, _, [], _), _), _ when valRefEq g vf g.reraise_vref -> + // exprty is of type: "unit -> 'a". Break it and store the 'a type here, used later as return type. - let _unit_ty, rtn_ty = destFunTy g exprty - MakeApplicableExprNoFlex cenv (mkCompGenSequential m arg (mkReraise m rtn_ty)) + MakeApplicableExprNoFlex cenv (mkCompGenSequential m arg (mkReraise m resultTy)), resultTy + + // Special rules for NativePtr.ofByRef to generalize result. + // See RFC FS-1053.md + | ApplicableExpr(_, Expr.App(Expr.Val(vf, _, _), _, _, [], _), _), _ + when (valRefEq g vf g.nativeptr_tobyref_vref) -> + + let argty = NewInferenceType() + let resultTy = mkByrefTyWithInference g argty (NewByRefKindInferenceType g m) + expr.SupplyArgument(arg, m), resultTy + + // Special rules for building applications of the '&expr' operator, which gets the + // address of an expression. + // + // See also RFC FS-1053.md | ApplicableExpr(_, Expr.App(Expr.Val(vf, _, _), _, _, [], _), _), _ - when (valRefEq g vf g.addrof_vref || - valRefEq g vf g.addrof2_vref) -> - if valRefEq g vf g.addrof2_vref then warning(UseOfAddressOfOperator(m)) - let wrap, e1a' = mkExprAddrOfExpr g true false DefinitelyMutates arg (Some(vf)) m - MakeApplicableExprNoFlex cenv (wrap(e1a')) + when valRefEq g vf g.addrof_vref -> + + let wrap, e1a', readonly = mkExprAddrOfExpr g true false AddressOfOp arg (Some(vf)) m + // Assert the result type to be readonly if we couldn't take the address + let resultTy = + let argTy = tyOfExpr g arg + if readonly then + mkInByrefTy g argTy + else + mkByrefTyWithInference g argTy (NewByRefKindInferenceType g m) + + MakeApplicableExprNoFlex cenv (wrap(e1a')), resultTy + + // Special rules for building applications of the &&expr' operators, which gets the + // address of an expression. + | ApplicableExpr(_, Expr.App(Expr.Val(vf, _, _), _, _, [], _), _), _ + when valRefEq g vf g.addrof2_vref -> + + warning(UseOfAddressOfOperator(m)) + let wrap, e1a', _readonly = mkExprAddrOfExpr g true false AddressOfOp arg (Some(vf)) m + MakeApplicableExprNoFlex cenv (wrap(e1a')), resultTy + + | _ when isByrefTy g resultTy -> + // Handle byref returns, byref-typed returns get implicitly dereferenced + let v, _ = mkCompGenLocal m "byrefReturn" resultTy + let expr = expr.SupplyArgument(arg, m) + let expr = mkCompGenLet m v expr.Expr (mkAddrGet m (mkLocalValRef v)) + let resultTy = destByrefTy g resultTy + MakeApplicableExprNoFlex cenv expr, resultTy + | _ -> - expr.SupplyArgument(arg, m) + expr.SupplyArgument(arg, m), resultTy //------------------------------------------------------------------------- // Additional data structures used by type checking @@ -5996,6 +6049,10 @@ and TcExprUndelayed cenv overallTy env tpenv (expr: SynExpr) = let mExprAndDotLookup = unionRanges e1.Range (rangeOfLid longId) TcExprThen cenv overallTy env tpenv e1 [DelayedDotLookup(longId, mExprAndDotLookup); MakeDelayedSet(e2, mStmt)] + /// e1 <- e2 + | SynExpr.Set (e1, e2, mStmt) -> + TcExprThen cenv overallTy env tpenv e1 [MakeDelayedSet(e2, mStmt)] + /// e1.longId(e2) <- e3, very rarely used named property setters | SynExpr.DotNamedIndexedPropertySet (e1, (LongIdentWithDots(longId, _) as lidwd), e2, e3, mStmt) -> if lidwd.ThereIsAnExtraDotAtTheEnd then @@ -6197,7 +6254,7 @@ and TcIndexerThen cenv env overallTy mWholeExpr mDot tpenv wholeExpr e1 indexArg let f, fty, tpenv = TcExprOfUnknownType cenv env tpenv operPath let domainTy, resultTy = UnifyFunctionType (Some mWholeExpr) cenv env.DisplayEnv mWholeExpr fty UnifyTypes cenv env mWholeExpr domainTy e1ty - let f' = buildApp cenv (MakeApplicableExprNoFlex cenv f) fty e1' mWholeExpr + let f', resultTy = buildApp cenv (MakeApplicableExprNoFlex cenv f) resultTy e1' mWholeExpr let delayed = List.foldBack (fun idx acc -> DelayedApp(ExprAtomicFlag.Atomic, idx, mWholeExpr) :: acc) indexArgs delayed // atomic, otherwise no ar.[1] <- xyz Some (PropagateThenTcDelayed cenv overallTy env tpenv mWholeExpr f' resultTy ExprAtomicFlag.Atomic delayed ) else None @@ -6330,7 +6387,7 @@ and TcRecordConstruction cenv overallTy env tpenv optOrigExpr objTy fldsList m = match optOrigExpr with | None -> [], id | Some (_, _, oldve) -> - let wrap, oldveaddr = mkExprAddrOfExpr cenv.g tycon.IsStructOrEnumTycon false NeverMutates oldve None m + let wrap, oldveaddr, _readonly = mkExprAddrOfExpr cenv.g tycon.IsStructOrEnumTycon false NeverMutates oldve None m let fieldNameUnbound nom = List.forall (fun (name, _) -> name <> nom) fldsList let flds = fspecs |> List.choose (fun rfld -> @@ -8305,24 +8362,50 @@ and TcSequenceExpression cenv env tpenv comp overallTy m = /// of function application syntax unambiguously implies that 'overallTy' is a function type. and Propagate cenv overallTy env tpenv (expr: ApplicableExpr) exprty delayed = - let rec propagate delayedList mExpr exprty = + let rec propagate isAddrOf delayedList mExpr exprty = match delayedList with | [] -> - // Avoid unifying twice: we're about to unify in TcDelayed + if not (isNil delayed) then + + // We generate a tag inference parameter to the return type for "&x" and 'NativePtr.toByRef' + // See RFC FS-1053.md + let exprty = + if isAddrOf && isByrefTy cenv.g exprty then + mkByrefTyWithInference cenv.g (destByrefTy cenv.g exprty) (NewByRefKindInferenceType cenv.g mExpr) + elif isByrefTy cenv.g exprty then + // Implicit dereference on byref on return + if isByrefTy cenv.g overallTy then + errorR(Error(FSComp.SR.tcByrefReturnImplicitlyDereferenced(), mExpr)) + destByrefTy cenv.g exprty + else + exprty + UnifyTypesAndRecover cenv env mExpr overallTy exprty + | DelayedDot :: _ | DelayedSet _ :: _ | DelayedDotLookup _ :: _ -> () | DelayedTypeApp (_, _mTypeArgs, mExprAndTypeArgs) :: delayedList' -> // Note this case should not occur: would eventually give an "Unexpected type application" error in TcDelayed - propagate delayedList' mExprAndTypeArgs exprty + propagate isAddrOf delayedList' mExprAndTypeArgs exprty | DelayedApp (_, arg, mExprAndArg) :: delayedList' -> let denv = env.DisplayEnv match UnifyFunctionTypeUndoIfFailed cenv denv mExpr exprty with | Some (_, resultTy) -> - propagate delayedList' mExprAndArg resultTy + + // We add tag parameter to the return type for "&x" and 'NativePtr.toByRef' + // See RFC FS-1053.md + let isAddrOf = + match expr with + | ApplicableExpr(_, Expr.App(Expr.Val(vf, _, _), _, _, [], _), _) + when (valRefEq cenv.g vf cenv.g.addrof_vref || + valRefEq cenv.g vf cenv.g.nativeptr_tobyref_vref) -> true + | _ -> false + + propagate isAddrOf delayedList' mExprAndArg resultTy + | None -> let mArg = arg.Range match arg with @@ -8343,7 +8426,7 @@ and Propagate cenv overallTy env tpenv (expr: ApplicableExpr) exprty delayed = RecordNameAndTypeResolutions_IdeallyWithoutHavingOtherEffects_Delayed cenv env tpenv delayed error (NotAFunction(denv, overallTy, mExpr, mArg)) - propagate delayed expr.Range exprty + propagate false delayed expr.Range exprty and PropagateThenTcDelayed cenv overallTy env tpenv mExpr expr exprty (atomicFlag:ExprAtomicFlag) delayed = Propagate cenv overallTy env tpenv expr exprty delayed @@ -8368,15 +8451,23 @@ and TcDelayed cenv overallTy env tpenv mExpr expr exprty (atomicFlag:ExprAtomicF // expr.M(args) where x.M is a .NET method or index property // expr.M where x.M is a .NET method or index property | DelayedDotLookup (longId, mDotLookup) :: otherDelayed -> - TcLookupThen cenv overallTy env tpenv mExpr expr.Expr exprty longId otherDelayed mDotLookup + TcLookupThen cenv overallTy env tpenv mExpr expr.Expr exprty longId otherDelayed mDotLookup // f x | DelayedApp (hpa, arg, mExprAndArg) :: otherDelayed -> TcFunctionApplicationThen cenv overallTy env tpenv mExprAndArg expr exprty arg hpa otherDelayed // f | DelayedTypeApp (_, mTypeArgs, _mExprAndTypeArgs) :: _ -> error(Error(FSComp.SR.tcUnexpectedTypeArguments(), mTypeArgs)) - | DelayedSet _ :: _ -> - error(Error(FSComp.SR.tcInvalidAssignment(), mExpr)) + | DelayedSet (synExpr2, mStmt) :: otherDelayed -> + if not (isNil otherDelayed) then error(Error(FSComp.SR.tcInvalidAssignment(), mExpr)) + UnifyTypes cenv env mExpr overallTy cenv.g.unit_ty + let expr = expr.Expr + let _wrap, exprAddress, _readonly = mkExprAddrOfExpr cenv.g true false DefinitelyMutates expr None mExpr + let vty = tyOfExpr cenv.g expr + // Always allow subsumption on assignment to fields + let expr2, tpenv = TcExprFlex cenv true false vty env tpenv synExpr2 + let v, _ve = mkCompGenLocal mExpr "addr" (mkByrefTy cenv.g vty) + mkCompGenLet mStmt v exprAddress (mkAddrSet mStmt (mkLocalValRef v) expr2), tpenv /// Convert the delayed identifiers to a dot-lookup. @@ -8418,7 +8509,7 @@ and TcFunctionApplicationThen cenv overallTy env tpenv mExprAndArg expr exprty ( | _ -> () let arg, tpenv = TcExpr cenv domainTy env tpenv synArg - let exprAndArg = buildApp cenv expr exprty arg mExprAndArg + let exprAndArg, resultTy = buildApp cenv expr resultTy arg mExprAndArg TcDelayed cenv overallTy env tpenv mExprAndArg exprAndArg resultTy atomicFlag delayed | None -> // OK, 'expr' doesn't have function type, but perhaps 'expr' is a computation expression builder, and 'arg' is '{ ... }' @@ -8807,6 +8898,7 @@ and TcItemThen cenv overallTy env tpenv (item, mItem, rest, afterResolution) del | SynExpr.DotSet _ | SynExpr.DotIndexedSet _ | SynExpr.LongIdentSet _ + | SynExpr.Set _ | SynExpr.JoinIn _ | SynExpr.NamedIndexedPropertySet _ | SynExpr.DotNamedIndexedPropertySet _ @@ -8880,10 +8972,13 @@ and TcItemThen cenv overallTy env tpenv (item, mItem, rest, afterResolution) del // Always allow subsumption on assignment to fields let e2', tpenv = TcExprFlex cenv true false vty2 env tpenv e2 let vexp = - if isByrefTy cenv.g vty then - mkAddrSet mStmt vref e2' + if isInByrefTy cenv.g vty then + errorR(Error(FSComp.SR.writeToReadOnlyByref(), mStmt)) + mkAddrSet mStmt vref e2' + elif isByrefTy cenv.g vty then + mkAddrSet mStmt vref e2' else - mkValSet mStmt vref e2' + mkValSet mStmt vref e2' PropagateThenTcDelayed cenv overallTy env tpenv mStmt (MakeApplicableExprNoFlex cenv vexp) (tyOfExpr cenv.g vexp) ExprAtomicFlag.NonAtomic otherDelayed @@ -8918,14 +9013,24 @@ and TcItemThen cenv overallTy env tpenv (item, mItem, rest, afterResolution) del if not pinfo.IsStatic then error (Error (FSComp.SR.tcPropertyIsNotStatic(nm), mItem)) match delayed with | DelayedSet(e2, mStmt) :: otherDelayed -> - let args = if pinfo.IsIndexer then args else [] if not (isNil otherDelayed) then error(Error(FSComp.SR.tcInvalidAssignment(), mStmt)) // Static Property Set (possibly indexer) UnifyTypes cenv env mStmt overallTy cenv.g.unit_ty let meths = pinfos |> SettersOfPropInfos - if isNil meths then error (Error (FSComp.SR.tcPropertyCannotBeSet1 nm, mItem)) - // Note: static calls never mutate a struct object argument - TcMethodApplicationThen cenv env overallTy None tpenv tyargsOpt [] mStmt mItem nm ad NeverMutates true meths afterResolution NormalValUse (args@[e2]) ExprAtomicFlag.NonAtomic otherDelayed + if meths.IsEmpty then + let meths = pinfos |> GettersOfPropInfos + let isByrefMethReturnSetter = meths |> List.exists (function (_,Some pinfo) -> isByrefTy cenv.g (pinfo.GetPropertyType(cenv.amap,mItem)) | _ -> false) + if isByrefMethReturnSetter then + // x.P <- ... byref setter + if isNil meths then error (Error (FSComp.SR.tcPropertyIsNotReadable(nm), mItem)) + TcMethodApplicationThen cenv env overallTy None tpenv tyargsOpt [] mItem mItem nm ad NeverMutates true meths afterResolution NormalValUse args ExprAtomicFlag.Atomic delayed + else + error (Error (FSComp.SR.tcPropertyCannotBeSet1 nm, mItem)) + else + let args = if pinfo.IsIndexer then args else [] + if isNil meths then error (Error (FSComp.SR.tcPropertyCannotBeSet1 nm, mItem)) + // Note: static calls never mutate a struct object argument + TcMethodApplicationThen cenv env overallTy None tpenv tyargsOpt [] mStmt mItem nm ad NeverMutates true meths afterResolution NormalValUse (args@[e2]) ExprAtomicFlag.NonAtomic otherDelayed | _ -> // Static Property Get (possibly indexer) let meths = pinfos |> GettersOfPropInfos @@ -9093,14 +9198,23 @@ and TcLookupThen cenv overallTy env tpenv mObjExpr objExpr objExprTy longId dela match delayed with | DelayedSet(e2, mStmt) :: otherDelayed -> - let args = if pinfo.IsIndexer then args else [] if not (isNil otherDelayed) then error(Error(FSComp.SR.tcInvalidAssignment(), mStmt)) // Instance property setter UnifyTypes cenv env mStmt overallTy cenv.g.unit_ty let meths = SettersOfPropInfos pinfos - if isNil meths then error (Error (FSComp.SR.tcPropertyCannotBeSet1 nm, mItem)) - let mut = (if isStructTy cenv.g (tyOfExpr cenv.g objExpr) then DefinitelyMutates else PossiblyMutates) - TcMethodApplicationThen cenv env overallTy None tpenv tyargsOpt objArgs mStmt mItem nm ad mut true meths afterResolution NormalValUse (args @ [e2]) atomicFlag [] + if meths.IsEmpty then + let meths = pinfos |> GettersOfPropInfos + let isByrefMethReturnSetter = meths |> List.exists (function (_,Some pinfo) -> isByrefTy cenv.g (pinfo.GetPropertyType(cenv.amap,mItem)) | _ -> false) + if isByrefMethReturnSetter then + // x.P <- ... byref setter + if isNil meths then error (Error (FSComp.SR.tcPropertyIsNotReadable(nm), mItem)) + TcMethodApplicationThen cenv env overallTy None tpenv tyargsOpt objArgs mExprAndItem mItem nm ad PossiblyMutates true meths afterResolution NormalValUse args atomicFlag delayed + else + error (Error (FSComp.SR.tcPropertyCannotBeSet1 nm, mItem)) + else + let args = if pinfo.IsIndexer then args else [] + let mut = (if isStructTy cenv.g (tyOfExpr cenv.g objExpr) then DefinitelyMutates else PossiblyMutates) + TcMethodApplicationThen cenv env overallTy None tpenv tyargsOpt objArgs mStmt mItem nm ad mut true meths afterResolution NormalValUse (args @ [e2]) atomicFlag [] | _ -> // Instance property getter let meths = GettersOfPropInfos pinfos @@ -9254,7 +9368,7 @@ and TcMethodApplicationThen and GetNewInferenceTypeForMethodArg cenv env tpenv x = match x with | SynExprParen(a, _, _, _) -> GetNewInferenceTypeForMethodArg cenv env tpenv a - | SynExpr.AddressOf(true, a, _, _) -> mkByrefTy cenv.g (GetNewInferenceTypeForMethodArg cenv env tpenv a) + | SynExpr.AddressOf(true, a, _, m) -> mkByrefTyWithInference cenv.g (GetNewInferenceTypeForMethodArg cenv env tpenv a) (NewByRefKindInferenceType cenv.g m) | SynExpr.Lambda(_, _, _, a, _) -> mkFunTy (NewInferenceType ()) (GetNewInferenceTypeForMethodArg cenv env tpenv a) | SynExpr.Quote(_, raw, a, _, _) -> if raw then mkRawQuotedExprTy cenv.g @@ -9286,7 +9400,7 @@ and TcMethodApplication let denv = env.DisplayEnv - let isSimpleFormalArg (isParamArrayArg, isOutArg, optArgInfo: OptionalArgInfo, callerInfoInfo: CallerInfoInfo, _reflArgInfo: ReflectedArgInfo) = + let isSimpleFormalArg (isParamArrayArg, _isInArg, isOutArg, optArgInfo: OptionalArgInfo, callerInfoInfo: CallerInfoInfo, _reflArgInfo: ReflectedArgInfo) = not isParamArrayArg && not isOutArg && not optArgInfo.IsOptional && callerInfoInfo = NoCallerInfo let callerObjArgTys = objArgs |> List.map (tyOfExpr cenv.g) @@ -9408,7 +9522,7 @@ and TcMethodApplication resultTy) curriedArgTys, returnTy - if isProp && Option.isNone curriedCallerArgsOpt then + if isProp && Option.isNone curriedCallerArgsOpt then error(Error(FSComp.SR.parsIndexerPropertyRequiresAtLeastOneArgument(), mItem)) // STEP 1. UnifyUniqueOverloading. This happens BEFORE we type check the arguments. @@ -9665,7 +9779,7 @@ and TcMethodApplication if HasHeadType cenv.g cenv.g.tcref_System_Collections_Generic_Dictionary finalCalledMethInfo.ApparentEnclosingType && finalCalledMethInfo.IsConstructor && not (finalCalledMethInfo.GetParamDatas(cenv.amap, mItem, finalCalledMeth.CalledTyArgs) - |> List.existsSquared (fun (ParamData(_, _, _, _, _, _, ty)) -> + |> List.existsSquared (fun (ParamData(_, _, _, _, _, _, _, ty)) -> HasHeadType cenv.g cenv.g.tcref_System_Collections_Generic_IEqualityComparer ty)) then match argsOfAppTy cenv.g finalCalledMethInfo.ApparentEnclosingType with @@ -9700,53 +9814,65 @@ and TcMethodApplication // Handle adhoc argument conversions let coerceExpr isOutArg calledArgTy (reflArgInfo: ReflectedArgInfo) callerArgTy m callerArgExpr = + let g = cenv.g + + if isByrefTy g calledArgTy && isRefCellTy g callerArgTy then + None, Expr.Op(TOp.RefAddrGet false, [destRefCellTy g callerArgTy], [callerArgExpr], m) - if isByrefTy cenv.g calledArgTy && isRefCellTy cenv.g callerArgTy then - Expr.Op(TOp.RefAddrGet, [destRefCellTy cenv.g callerArgTy], [callerArgExpr], m) + elif isInByrefTy g calledArgTy && not (isByrefTy cenv.g callerArgTy) then + let wrap, callerArgExprAddress, _readonly = mkExprAddrOfExpr g true false NeverMutates callerArgExpr None m + Some wrap, callerArgExprAddress elif isDelegateTy cenv.g calledArgTy && isFunTy cenv.g callerArgTy then - CoerceFromFSharpFuncToDelegate cenv.g cenv.amap cenv.infoReader ad callerArgTy m callerArgExpr calledArgTy + None, CoerceFromFSharpFuncToDelegate cenv.g cenv.amap cenv.infoReader ad callerArgTy m callerArgExpr calledArgTy elif isLinqExpressionTy cenv.g calledArgTy && isDelegateTy cenv.g (destLinqExpressionTy cenv.g calledArgTy) && isFunTy cenv.g callerArgTy then let delegateTy = destLinqExpressionTy cenv.g calledArgTy let expr = CoerceFromFSharpFuncToDelegate cenv.g cenv.amap cenv.infoReader ad callerArgTy m callerArgExpr delegateTy - mkCallQuoteToLinqLambdaExpression cenv.g m delegateTy (Expr.Quote(expr, ref None, false, m, mkQuotedExprTy cenv.g delegateTy)) + None, mkCallQuoteToLinqLambdaExpression cenv.g m delegateTy (Expr.Quote(expr, ref None, false, m, mkQuotedExprTy cenv.g delegateTy)) // auto conversions to quotations (to match auto conversions to LINQ expressions) elif reflArgInfo.AutoQuote && isQuotedExprTy cenv.g calledArgTy && not (isQuotedExprTy cenv.g callerArgTy) then match reflArgInfo with | ReflectedArgInfo.Quote true -> - mkCallLiftValueWithDefn cenv.g m calledArgTy callerArgExpr + None, mkCallLiftValueWithDefn cenv.g m calledArgTy callerArgExpr | ReflectedArgInfo.Quote false -> - Expr.Quote(callerArgExpr, ref None, false, m, calledArgTy) + None, Expr.Quote(callerArgExpr, ref None, false, m, calledArgTy) | ReflectedArgInfo.None -> failwith "unreachable" // unreachable due to reflArgInfo.AutoQuote condition // Note: out args do not need to be coerced elif isOutArg then - callerArgExpr + None, callerArgExpr // Note: not all these casts are reported in quotations else - mkCoerceIfNeeded cenv.g calledArgTy callerArgTy callerArgExpr + None, mkCoerceIfNeeded cenv.g calledArgTy callerArgTy callerArgExpr - // Handle optional arguments - let optArgPreBinder, allArgs, outArgExprs, outArgTmpBinds = + // Handle param array and optional arguments + let optArgPreBinder, paramArrayPreBinders, allArgs, outArgExprs, outArgTmpBinds = let normalUnnamedArgs = (finalUnnamedCalledArgs, finalUnnamedCallerArgs) ||> List.map2 (fun called caller -> { NamedArgIdOpt = None; CalledArg=called; CallerArg=caller }) - let paramArrayArgs = - match finalCalledMeth.ParamArrayCalledArgOpt with - | None -> [] - | Some paramArrayCalledArg -> - let paramArrayCalledArgElementType = destArrayTy cenv.g paramArrayCalledArg.CalledArgumentType - - let es = - finalParamArrayCallerArgs |> List.map (fun callerArg -> - let (CallerArg(callerArgTy, m, isOutArg, callerArgExpr)) = callerArg - coerceExpr isOutArg paramArrayCalledArgElementType paramArrayCalledArg.ReflArgInfo callerArgTy m callerArgExpr) - - [ { NamedArgIdOpt = None; CalledArg=paramArrayCalledArg; CallerArg=CallerArg(paramArrayCalledArg.CalledArgumentType, mMethExpr, false, Expr.Op(TOp.Array, [paramArrayCalledArgElementType], es , mMethExpr)) } ] + let paramArrayPreBinders, paramArrayArgs = + match finalCalledMeth.ParamArrayCalledArgOpt with + | None -> + [], [] + | Some paramArrayCalledArg -> + let paramArrayCalledArgElementType = destArrayTy cenv.g paramArrayCalledArg.CalledArgumentType + + let paramArrayPreBinders, es = + finalParamArrayCallerArgs + |> List.map (fun callerArg -> + let (CallerArg(callerArgTy, m, isOutArg, callerArgExpr)) = callerArg + coerceExpr isOutArg paramArrayCalledArgElementType paramArrayCalledArg.ReflArgInfo callerArgTy m callerArgExpr) + |> List.unzip + + let arg = + [ { NamedArgIdOpt = None + CalledArg=paramArrayCalledArg + CallerArg=CallerArg(paramArrayCalledArg.CalledArgumentType, mMethExpr, false, Expr.Op(TOp.Array, [paramArrayCalledArgElementType], es , mMethExpr)) } ] + paramArrayPreBinders, arg // CLEANUP: Move all this code into some isolated file, e.g. "optional.fs" // @@ -9823,7 +9949,7 @@ and TcMethodApplication | PassByRef (ty, dfltVal2) -> let v, _ = mkCompGenLocal mMethExpr "defaultByrefArg" ty let wrapper2, rhs = build currCalledArgTy dfltVal2 - (wrapper2 >> mkCompGenLet mMethExpr v rhs), mkValAddr mMethExpr (mkLocalValRef v) + (wrapper2 >> mkCompGenLet mMethExpr v rhs), mkValAddr mMethExpr false (mkLocalValRef v) build calledArgTy dfltVal | CalleeSide -> let calledNonOptTy = @@ -9890,7 +10016,7 @@ and TcMethodApplication let outArgTy = destByrefTy cenv.g calledArgTy let outv, outArgExpr = mkMutableCompGenLocal mMethExpr "outArg" outArgTy // mutable! let expr = mkDefault(mMethExpr, outArgTy) - let callerArg = CallerArg(calledArgTy, mMethExpr, false, mkValAddr mMethExpr (mkLocalValRef outv)) + let callerArg = CallerArg(calledArgTy, mMethExpr, false, mkValAddr mMethExpr false (mkLocalValRef outv)) let outArg = { NamedArgIdOpt=None;CalledArg=calledArg;CallerArg=callerArg } (outArg, outArgExpr), mkCompGenBind outv expr) |> List.unzip @@ -9907,7 +10033,7 @@ and TcMethodApplication let allArgs = allArgs |> List.sortBy (fun x -> x.Position) - optArgPreBinder, allArgs, outArgExprs, outArgTmpBinds + optArgPreBinder, paramArrayPreBinders, allArgs, outArgExprs, outArgTmpBinds let coerce (assignedArg: AssignedCalledArg<_>) = let isOutArg = assignedArg.CalledArg.IsOutArg @@ -9925,13 +10051,21 @@ and TcMethodApplication let item = Item.ArgName (defaultArg assignedArg.CalledArg.NameOpt id, assignedArg.CalledArg.CalledArgumentType, Some(ArgumentContainer.Method(finalCalledMethInfo))) CallNameResolutionSink cenv.tcSink (id.idRange, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.Use, env.DisplayEnv, ad)) - let allArgsCoerced = List.map coerce allArgs - + let allArgsPreBinders, allArgsCoerced = List.map coerce allArgs |> List.unzip // Make the call expression let expr, exprty = BuildPossiblyConditionalMethodCall cenv env mut mMethExpr isProp finalCalledMethInfo isSuperInit finalCalledMethInst objArgs allArgsCoerced + // Handle byref returns + let expr = + // byref-typed returns get implicitly dereferenced + let vty = tyOfExpr cenv.g expr + if isByrefTy cenv.g vty then + let v, _ = mkCompGenLocal mMethExpr "byrefReturn" vty + mkCompGenLet mMethExpr v expr (mkAddrGet mMethExpr (mkLocalValRef v)) + else + expr // Bind "out" parameters as part of the result tuple let expr, exprty = @@ -9944,51 +10078,54 @@ and TcMethodApplication expr, tyOfExpr cenv.g expr // Handle post-hoc property assignments - let expr = - if isCheckingAttributeCall then expr else - if isNil finalAssignedItemSetters then expr else + let setterExprPrebinders, expr = + if isCheckingAttributeCall then + [], expr + elif isNil finalAssignedItemSetters then + [], expr + else // This holds the result of the call let objv, objExpr = mkMutableCompGenLocal mMethExpr "returnVal" exprty // mutable in case it's a struct // This expression mutates the properties on the result of the call - let propSetExpr = - (mkUnit cenv.g mMethExpr, finalAssignedItemSetters) ||> List.fold (fun acc (AssignedItemSetter(id, setter, CallerArg(callerArgTy, m, isOptCallerArg, argExpr))) -> + let setterExprPrebinders, propSetExpr = + (mkUnit cenv.g mMethExpr, finalAssignedItemSetters) ||> List.mapFold (fun acc (AssignedItemSetter(id, setter, CallerArg(callerArgTy, m, isOptCallerArg, argExpr))) -> if isOptCallerArg then error(Error(FSComp.SR.tcInvalidOptionalAssignmentToPropertyOrField(), m)) - let action, defnItem = + let argExprPrebinder, action, defnItem = match setter with | AssignedPropSetter (pinfo, pminfo, pminst) -> MethInfoChecks cenv.g cenv.amap true None [objExpr] ad m pminfo let calledArgTy = List.head (List.head (pminfo.GetParamTypes(cenv.amap, m, pminst))) - let argExpr = coerceExpr false calledArgTy ReflectedArgInfo.None callerArgTy m argExpr + let argExprPrebinder, argExpr = coerceExpr false calledArgTy ReflectedArgInfo.None callerArgTy m argExpr let mut = (if isStructTy cenv.g (tyOfExpr cenv.g objExpr) then DefinitelyMutates else PossiblyMutates) let action = BuildPossiblyConditionalMethodCall cenv env mut m true pminfo NormalValUse pminst [objExpr] [argExpr] |> fst - action, Item.Property (pinfo.PropertyName, [pinfo]) + argExprPrebinder, action, Item.Property (pinfo.PropertyName, [pinfo]) | AssignedILFieldSetter finfo -> // Get or set instance IL field ILFieldInstanceChecks cenv.g cenv.amap ad m finfo let calledArgTy = finfo.FieldType (cenv.amap, m) - let argExpr = coerceExpr false calledArgTy ReflectedArgInfo.None callerArgTy m argExpr + let argExprPrebinder, argExpr = coerceExpr false calledArgTy ReflectedArgInfo.None callerArgTy m argExpr let action = BuildILFieldSet cenv.g m objExpr finfo argExpr - action, Item.ILField finfo + argExprPrebinder, action, Item.ILField finfo | AssignedRecdFieldSetter rfinfo -> RecdFieldInstanceChecks cenv.g cenv.amap ad m rfinfo let calledArgTy = rfinfo.FieldType CheckRecdFieldMutation m denv rfinfo - let argExpr = coerceExpr false calledArgTy ReflectedArgInfo.None callerArgTy m argExpr + let argExprPrebinder, argExpr = coerceExpr false calledArgTy ReflectedArgInfo.None callerArgTy m argExpr let action = BuildRecdFieldSet cenv.g m objExpr rfinfo argExpr - action, Item.RecdField rfinfo + argExprPrebinder, action, Item.RecdField rfinfo // Record the resolution for the Language Service let item = Item.SetterArg (id, defnItem) CallNameResolutionSink cenv.tcSink (id.idRange, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.Use, env.DisplayEnv, ad) - mkCompGenSequential m acc action) + argExprPrebinder, mkCompGenSequential m acc action) // now put them together let expr = mkCompGenLet mMethExpr objv expr (mkCompGenSequential mMethExpr propSetExpr objExpr) - expr + setterExprPrebinders, expr // Build the lambda expression if any let expr = @@ -10014,6 +10151,10 @@ and TcMethodApplication expr, tpenv // Apply the PreBinders, if any + let expr = (expr, setterExprPrebinders) ||> List.fold (fun expr argPreBinder -> match argPreBinder with None -> expr | Some f -> f expr) + let expr = (expr, paramArrayPreBinders) ||> List.fold (fun expr argPreBinder -> match argPreBinder with None -> expr | Some f -> f expr) + let expr = (expr, allArgsPreBinders) ||> List.fold (fun expr argPreBinder -> match argPreBinder with None -> expr | Some f -> f expr) + let expr = optArgPreBinder expr let expr = objArgPreBinder expr @@ -10222,7 +10363,7 @@ and TcAndBuildFixedExpr cenv env (overallPatTy, fixedExpr, overallExprTy, mBindi match stripExpr fixedExpr with | Expr.Op (op, tyargs, args, _) -> match op, tyargs, args with - | TOp.ValFieldGetAddr rfref, _, [_] -> not rfref.Tycon.IsStructOrEnumTycon + | TOp.ValFieldGetAddr (rfref, _), _, [_] -> not rfref.Tycon.IsStructOrEnumTycon | TOp.ILAsm ([ I_ldflda (fspec)], _), _, _ -> fspec.DeclaringType.Boxity = ILBoxity.AsObject | TOp.ILAsm ([ I_ldelema _], _), _, _ -> true | TOp.RefAddrGet _, _, _ -> true @@ -10271,7 +10412,7 @@ and TcAndBuildFixedExpr cenv env (overallPatTy, fixedExpr, overallExprTy, mBindi // mkCompGenLetIn mBinding "tmpArray" overallExprTy fixedExpr (fun (_, ve) -> // This is &arr.[0] - let elemZeroAddress = mkArrayElemAddress cenv.g (ILReadonly.NormalAddress, false, ILArrayShape.SingleDimensional, elemTy, ve, mkInt32 cenv.g mBinding 0, mBinding) + let elemZeroAddress = mkArrayElemAddress cenv.g (false, ILReadonly.NormalAddress, false, ILArrayShape.SingleDimensional, elemTy, [ve; mkInt32 cenv.g mBinding 0], mBinding) // check for non-null and non-empty let zero = mkConvToNativeInt cenv.g (mkInt32 cenv.g mBinding 0) mBinding // This is arr.Length @@ -12459,6 +12600,12 @@ module IncrClassChecking = | InVar false -> true | _ -> false + member localRep.IsValRepresentedAsMethod (v:Val) = + localRep.IsValWithRepresentation(v) && + match localRep.LookupRepr(v) with + | InMethod _ -> true + | _ -> false + /// Make the elaborated expression that represents a use of a /// a "let v = ..." class binding member localRep.MakeValueLookup thisValOpt tinst safeStaticInitInfo v tyargs m = @@ -12504,19 +12651,19 @@ module IncrClassChecking = | InMethod _, _ -> error(InternalError("Local was given method storage, yet later it's been assigned to", m)) - member localRep.MakeValueGetAddress thisValOpt tinst safeStaticInitInfo v m = + member localRep.MakeValueGetAddress readonly thisValOpt tinst safeStaticInitInfo v m = let g = localRep.RepInfoTcGlobals match localRep.LookupRepr v, thisValOpt with | InField(false, _, rfref), Some(thisVal) -> let thise = exprForVal m thisVal - mkRecdFieldGetAddrViaExprAddr(thise, rfref, tinst, m) + mkRecdFieldGetAddrViaExprAddr(readonly, thise, rfref, tinst, m) | InField(false, _, _rfref), None -> error(InternalError("Unexpected missing 'this' variable in MakeValueGetAddress", m)) | InField(true, idx, rfref), _ -> - let expr = mkStaticRecdFieldGetAddr(rfref, tinst, m) + let expr = mkStaticRecdFieldGetAddr(readonly, rfref, tinst, m) MakeCheckSafeInit g tinst safeStaticInitInfo (mkInt g m idx) expr | InVar _, _ -> - mkValAddr m (mkLocalValRef v) + mkValAddr m readonly (mkLocalValRef v) | InMethod _, _ -> error(InternalError("Local was given method storage, yet later it's address was required", m)) @@ -12556,42 +12703,42 @@ module IncrClassChecking = /// Fix up the references to the locals, e.g. /// v -> this.fieldv /// f x -> this.method x - member localRep.FixupIncrClassExprPhase2C thisValOpt safeStaticInitInfo (thisTyInst:TypeInst) expr = + member localRep.FixupIncrClassExprPhase2C cenv thisValOpt safeStaticInitInfo (thisTyInst:TypeInst) expr = // fixup: intercept and expr rewrite let FixupExprNode rw e = //dprintfn "Fixup %s" (showL (exprL e)) + let g = localRep.RepInfoTcGlobals + let e = NormalizeAndAdjustPossibleSubsumptionExprs g e match e with // Rewrite references to applied let-bound-functions-compiled-as-methods - | Expr.App(Expr.Val (ValDeref(v), _, _), _, tyargs, args, m) - when (localRep.IsValWithRepresentation(v) && - (match localRep.LookupRepr(v) with - | InMethod _ -> true //(methodVal.Typars.Length > thisTyInst.Length) - | _ -> false )) -> - - //dprintfn "Found application of %s" v.LogicalName - let g = localRep.RepInfoTcGlobals + // Rewrite references to applied recursive let-bound-functions-compiled-as-methods + // Rewrite references to applied recursive generic let-bound-functions-compiled-as-methods + | Expr.App(Expr.Val (ValDeref v, _, _), _, tyargs, args, m) + | Expr.App(Expr.Link {contents = Expr.Val (ValDeref v, _, _) }, _, tyargs, args, m) + | Expr.App(Expr.Link {contents = Expr.App(Expr.Val (ValDeref v, _, _), _, tyargs, [], _) }, _, [], args, m) + when localRep.IsValRepresentedAsMethod(v) && not (cenv.recUses.ContainsKey v) -> + let expr = localRep.MakeValueLookup thisValOpt thisTyInst safeStaticInitInfo v tyargs m let args = args |> List.map rw Some (MakeApplicationAndBetaReduce g (expr, (tyOfExpr g expr), [], args, m)) - // Rewrite references to values stored as fields and first class uses of method values - | Expr.Val (ValDeref(v), _, m) + | Expr.Val (ValDeref v, _, m) when localRep.IsValWithRepresentation(v) -> //dprintfn "Found use of %s" v.LogicalName Some (localRep.MakeValueLookup thisValOpt thisTyInst safeStaticInitInfo v [] m) // Rewrite assignments to mutable values stored as fields - | Expr.Op(TOp.LValueOp (LSet, ValDeref(v)) , [], [arg], m) + | Expr.Op(TOp.LValueOp (LSet, ValDeref v) , [], [arg], m) when localRep.IsValWithRepresentation(v) -> let arg = rw arg Some (localRep.MakeValueAssign thisValOpt thisTyInst safeStaticInitInfo v arg m) // Rewrite taking the address of mutable values stored as fields - | Expr.Op(TOp.LValueOp (LGetAddr, ValDeref(v)), [], [] , m) + | Expr.Op(TOp.LValueOp (LAddrOf readonly, ValDeref v), [], [] , m) when localRep.IsValWithRepresentation(v) -> - Some (localRep.MakeValueGetAddress thisValOpt thisTyInst safeStaticInitInfo v m) + Some (localRep.MakeValueGetAddress readonly thisValOpt thisTyInst safeStaticInitInfo v m) | _ -> None Tastops.RewriteExpr { PreIntercept = Some FixupExprNode @@ -12698,7 +12845,7 @@ module IncrClassChecking = let TransBind (reps:IncrClassReprInfo) (TBind(v, rhsExpr, spBind)) = if v.MustInline then error(Error(FSComp.SR.tcLocalClassBindingsCannotBeInline(), v.Range)) - let rhsExpr = reps.FixupIncrClassExprPhase2C (Some thisVal) safeStaticInitInfo thisTyInst rhsExpr + let rhsExpr = reps.FixupIncrClassExprPhase2C cenv (Some thisVal) safeStaticInitInfo thisTyInst rhsExpr // The initialization of the 'ref cell' variable for 'this' is the only binding which comes prior to the super init let isPriorToSuperInit = @@ -12750,7 +12897,7 @@ module IncrClassChecking = match safeStaticInitInfo with | SafeInitField (rfref, _) -> let setExpr = mkStaticRecdFieldSet (rfref, thisTyInst, mkInt cenv.g m idx, m) - let setExpr = reps.FixupIncrClassExprPhase2C (Some(thisVal)) NoSafeInitInfo thisTyInst setExpr + let setExpr = reps.FixupIncrClassExprPhase2C cenv (Some(thisVal)) NoSafeInitInfo thisTyInst setExpr Some setExpr | NoSafeInitInfo -> None @@ -12786,7 +12933,7 @@ module IncrClassChecking = ([], actions, methodBinds), reps | IncrClassDo (doExpr, isStatic) -> - let doExpr = reps.FixupIncrClassExprPhase2C (Some(thisVal)) safeStaticInitInfo thisTyInst doExpr + let doExpr = reps.FixupIncrClassExprPhase2C cenv (Some(thisVal)) safeStaticInitInfo thisTyInst doExpr let binder = (fun e -> mkSequential SequencePointsAtSeq doExpr.Range doExpr e) let isPriorToSuperInit = false if isStatic then @@ -12806,7 +12953,7 @@ module IncrClassChecking = | None -> () | Some v -> let setExpr = mkRefCellSet cenv.g m ctorInfo.InstanceCtorThisVal.Type (exprForVal m v) (exprForVal m ctorInfo.InstanceCtorThisVal) - let setExpr = reps.FixupIncrClassExprPhase2C (Some(thisVal)) safeStaticInitInfo thisTyInst setExpr + let setExpr = reps.FixupIncrClassExprPhase2C cenv (Some(thisVal)) safeStaticInitInfo thisTyInst setExpr let binder = (fun e -> mkSequential SequencePointsAtSeq setExpr.Range setExpr e) let isPriorToSuperInit = false yield (isPriorToSuperInit, binder) ] @@ -12820,7 +12967,7 @@ module IncrClassChecking = [ match ctorInfo.InstanceCtorSafeInitInfo with | SafeInitField (rfref, _) -> let setExpr = mkRecdFieldSetViaExprAddr (exprForVal m thisVal, rfref, thisTyInst, mkOne cenv.g m, m) - let setExpr = reps.FixupIncrClassExprPhase2C (Some(thisVal)) safeStaticInitInfo thisTyInst setExpr + let setExpr = reps.FixupIncrClassExprPhase2C cenv (Some(thisVal)) safeStaticInitInfo thisTyInst setExpr let binder = (fun e -> mkSequential SequencePointsAtSeq setExpr.Range setExpr e) let isPriorToSuperInit = false yield (isPriorToSuperInit, binder) @@ -12903,7 +13050,7 @@ module IncrClassChecking = // Rewrite the expression to convert it to a load of a field if needed. // We are allowed to load fields from our own object even though we haven't called // the super class constructor yet. - let ldexpr = reps.FixupIncrClassExprPhase2C (Some(thisVal)) safeStaticInitInfo thisTyInst (exprForVal m v) + let ldexpr = reps.FixupIncrClassExprPhase2C cenv (Some(thisVal)) safeStaticInitInfo thisTyInst (exprForVal m v) mkInvisibleLet m v ldexpr inheritsExpr | _ -> inheritsExpr @@ -13577,7 +13724,7 @@ module MutRecBindingChecking = // Members have at least as many type parameters as the enclosing class. Just grab the type variables for the type. let thisTyInst = List.map mkTyparTy (List.take (tcref.Typars(v.Range).Length) v.Typars) - let x = localReps.FixupIncrClassExprPhase2C thisValOpt safeStaticInitInfo thisTyInst x + let x = localReps.FixupIncrClassExprPhase2C cenv thisValOpt safeStaticInitInfo thisTyInst x { pgrbind with Binding = TBind(v, x, spBind) } ) @@ -14238,7 +14385,7 @@ module TyconConstraintInference = // If the type was excluded, say why if not res then match TryFindFSharpBoolAttribute g g.attrib_StructuralEqualityAttribute tycon.Attribs with - | Some(true) -> + | Some true -> if AugmentWithHashCompare.TyconIsCandidateForAugmentationWithEquals cenv.g tycon then match structuralTypes |> List.tryFind (fst >> checkIfFieldTypeSupportsEquality tycon >> not) with | None -> diff --git a/src/fsharp/ast.fs b/src/fsharp/ast.fs index 8094995e68..caf84422bc 100644 --- a/src/fsharp/ast.fs +++ b/src/fsharp/ast.fs @@ -629,6 +629,9 @@ and /// F# syntax: expr.ident...ident <- expr | DotSet of SynExpr * longDotId:LongIdentWithDots * SynExpr * range:range + /// F# syntax: expr <- expr + | Set of SynExpr * SynExpr * range:range + /// F# syntax: expr.[expr,...,expr] | DotIndexedGet of SynExpr * SynIndexerArg list * range * range:range @@ -763,6 +766,7 @@ and | SynExpr.DotIndexedSet (range=m) | SynExpr.DotGet (range=m) | SynExpr.DotSet (range=m) + | SynExpr.Set (range=m) | SynExpr.DotNamedIndexedPropertySet (range=m) | SynExpr.LibraryOnlyUnionCaseFieldGet (range=m) | SynExpr.LibraryOnlyUnionCaseFieldSet (range=m) @@ -824,6 +828,7 @@ and | SynExpr.DotIndexedGet (range=m) | SynExpr.DotIndexedSet (range=m) | SynExpr.DotSet (range=m) + | SynExpr.Set (range=m) | SynExpr.DotNamedIndexedPropertySet (range=m) | SynExpr.LibraryOnlyUnionCaseFieldGet (range=m) | SynExpr.LibraryOnlyUnionCaseFieldSet (range=m) @@ -887,6 +892,7 @@ and | SynExpr.DotIndexedSet (range=m) | SynExpr.DotGet (range=m) | SynExpr.DotSet (range=m) + | SynExpr.Set (range=m) | SynExpr.DotNamedIndexedPropertySet (range=m) | SynExpr.LibraryOnlyUnionCaseFieldGet (range=m) | SynExpr.LibraryOnlyUnionCaseFieldSet (range=m) @@ -1857,7 +1863,8 @@ let mkSynAssign (l: SynExpr) (r: SynExpr) = mkSynDotParenSet m a b r | SynExpr.App (_, _, SynExpr.LongIdent(false,v,None,_),x,_) -> SynExpr.NamedIndexedPropertySet (v,x,r,m) | SynExpr.App (_, _, SynExpr.DotGet(e,_,v,_),x,_) -> SynExpr.DotNamedIndexedPropertySet (e,v,x,r,m) - | _ -> errorR(Error(FSComp.SR.astInvalidExprLeftHandOfAssignment(), m)); l // return just the LHS, so the typechecker can see it and capture expression typings that may be useful for dot lookups + | l -> SynExpr.Set (l,r,m) + //| _ -> errorR(Error(FSComp.SR.astInvalidExprLeftHandOfAssignment(), m)); l // return just the LHS, so the typechecker can see it and capture expression typings that may be useful for dot lookups let rec mkSynDot dotm m l r = match l with @@ -2356,6 +2363,7 @@ let rec synExprContainsError inpExpr = | SynExpr.NamedIndexedPropertySet (_,e1,e2,_) | SynExpr.DotSet (e1,_,e2,_) + | SynExpr.Set (e1,e2,_) | SynExpr.LibraryOnlyUnionCaseFieldSet (e1,_,_,e2,_) | SynExpr.JoinIn (e1,_,e2,_) | SynExpr.App (_,_,e1,e2,_) -> diff --git a/src/fsharp/autobox.fs b/src/fsharp/autobox.fs index 963717e25e..35f2ec04ec 100644 --- a/src/fsharp/autobox.fs +++ b/src/fsharp/autobox.fs @@ -140,16 +140,16 @@ let TransformExpr g (nvs: ValMap<_>) exprF expr = Some (mkRefCellGet g m v.Type nve) // Rewrite assignments to mutable values - | Expr.Op(TOp.LValueOp (LSet, ValDeref(v)) , [], [arg], m) when nvs.ContainsVal v -> + | Expr.Op(TOp.LValueOp (LSet, ValDeref(v)), [], [arg], m) when nvs.ContainsVal v -> let _nv, nve = nvs.[v] let arg = exprF arg Some (mkRefCellSet g m v.Type nve arg) // Rewrite taking the address of mutable values - | Expr.Op(TOp.LValueOp (LGetAddr, ValDeref(v)), [], [] , m) when nvs.ContainsVal v -> - let _nv, nve = nvs.[v] - Some (mkRecdFieldGetAddrViaExprAddr (nve, mkRefCellContentsRef g, [v.Type], m)) + | Expr.Op(TOp.LValueOp (LAddrOf readonly, ValDeref(v)), [], [], m) when nvs.ContainsVal v -> + let _nv,nve = nvs.[v] + Some (mkRecdFieldGetAddrViaExprAddr (readonly, nve, mkRefCellContentsRef g, [v.Type], m)) | _ -> None @@ -183,9 +183,10 @@ let TransformImplFile g amap implFile = |> ValMap.OfList implFile |> - RewriteImplFile { PreIntercept = Some(TransformExpr g nvs) - PreInterceptBinding = Some(TransformBinding g nvs) - PostTransform = (fun _ -> None) - IsUnderQuotations = false } + RewriteImplFile + { PreIntercept = Some(TransformExpr g nvs) + PreInterceptBinding = Some(TransformBinding g nvs) + PostTransform = (fun _ -> None) + IsUnderQuotations = false } diff --git a/src/fsharp/fsi/xlf/FSIstrings.txt.cs.xlf b/src/fsharp/fsi/xlf/FSIstrings.txt.cs.xlf index cca73ffc52..2567d3f26f 100644 --- a/src/fsharp/fsi/xlf/FSIstrings.txt.cs.xlf +++ b/src/fsharp/fsi/xlf/FSIstrings.txt.cs.xlf @@ -134,7 +134,7 @@ \n\nException raised during pretty printing.\nPlease report this so it can be fixed.\nTrace: {0}\n - \n\nFunkce Pretty Printing vyvolala výjimku.\nNahlaste prosím tento problém, abychom ho mohli opravit.\nTrasování: {0}\n + \n\nFunkce přehledného výpisu vyvolala výjimku.\nNahlaste prosím tento problém, abychom ho mohli opravit.\nTrasování: {0}\n diff --git a/src/fsharp/fsi/xlf/FSIstrings.txt.fr.xlf b/src/fsharp/fsi/xlf/FSIstrings.txt.fr.xlf index 8c37c49348..4343c88666 100644 --- a/src/fsharp/fsi/xlf/FSIstrings.txt.fr.xlf +++ b/src/fsharp/fsi/xlf/FSIstrings.txt.fr.xlf @@ -134,7 +134,7 @@ \n\nException raised during pretty printing.\nPlease report this so it can be fixed.\nTrace: {0}\n - \n\nException déclenchée durant l'impression automatique.\nSignalez ce problème afin qu'il soit corrigé.\nTrace : {0}\n + \n\nException déclenchée durant l'impression en mode Pretty.\nSignalez ce problème afin qu'il soit corrigé.\nTrace : {0}\n diff --git a/src/fsharp/fsi/xlf/FSIstrings.txt.it.xlf b/src/fsharp/fsi/xlf/FSIstrings.txt.it.xlf index bdce732134..bdba37d1c7 100644 --- a/src/fsharp/fsi/xlf/FSIstrings.txt.it.xlf +++ b/src/fsharp/fsi/xlf/FSIstrings.txt.it.xlf @@ -134,7 +134,7 @@ \n\nException raised during pretty printing.\nPlease report this so it can be fixed.\nTrace: {0}\n - \n\nEccezione durante la stampa.\nSegnalare il problema affinché possa essere risolto.\nTraccia: {0}\n + \n\nEccezione durante la riformattazione.\nSegnalare il problema affinché possa essere risolto.\nTraccia: {0}\n diff --git a/src/fsharp/fsi/xlf/FSIstrings.txt.ko.xlf b/src/fsharp/fsi/xlf/FSIstrings.txt.ko.xlf index 03a39145f1..6f6d927ebf 100644 --- a/src/fsharp/fsi/xlf/FSIstrings.txt.ko.xlf +++ b/src/fsharp/fsi/xlf/FSIstrings.txt.ko.xlf @@ -134,7 +134,7 @@ \n\nException raised during pretty printing.\nPlease report this so it can be fixed.\nTrace: {0}\n - \n\n보기 쉽게 출력하는 동안 예외가 발생했습니다.\n문제를 해결할 수 있도록 보고하세요.\n추적: {0}\n + \n\n자동 서식 지정 중 예외가 발생했습니다.\n문제를 해결할 수 있도록 보고하세요.\n추적: {0}\n diff --git a/src/fsharp/fsi/xlf/FSIstrings.txt.pl.xlf b/src/fsharp/fsi/xlf/FSIstrings.txt.pl.xlf index 7179b3a859..82960cad8f 100644 --- a/src/fsharp/fsi/xlf/FSIstrings.txt.pl.xlf +++ b/src/fsharp/fsi/xlf/FSIstrings.txt.pl.xlf @@ -134,7 +134,7 @@ \n\nException raised during pretty printing.\nPlease report this so it can be fixed.\nTrace: {0}\n - \n\nWystąpił wyjątek podczas automatycznego formatowania kodu.\nZgłoś go, aby można było rozwiązać ten problem.\nŚlad: {0}\n + \n\nWystąpił wyjątek podczas formatowania kodu.\nZgłoś go, aby można było rozwiązać ten problem.\nŚlad: {0}\n diff --git a/src/fsharp/fsi/xlf/FSIstrings.txt.pt-BR.xlf b/src/fsharp/fsi/xlf/FSIstrings.txt.pt-BR.xlf index 155ad889e9..7d8838f24f 100644 --- a/src/fsharp/fsi/xlf/FSIstrings.txt.pt-BR.xlf +++ b/src/fsharp/fsi/xlf/FSIstrings.txt.pt-BR.xlf @@ -134,7 +134,7 @@ \n\nException raised during pretty printing.\nPlease report this so it can be fixed.\nTrace: {0}\n - \n\nExceção levantadas durante formatação.\nReporte esta exceção para ela que possa ser corrigida.\nRastrear: {0}\n + \n\nExceção levantadas durante a reformatação automática.\nReporte esta exceção para ela que possa ser corrigida.\nRastrear: {0}\n diff --git a/src/fsharp/fsi/xlf/FSIstrings.txt.ru.xlf b/src/fsharp/fsi/xlf/FSIstrings.txt.ru.xlf index 97ded6f6e3..1d6ce4e963 100644 --- a/src/fsharp/fsi/xlf/FSIstrings.txt.ru.xlf +++ b/src/fsharp/fsi/xlf/FSIstrings.txt.ru.xlf @@ -134,7 +134,7 @@ \n\nException raised during pretty printing.\nPlease report this so it can be fixed.\nTrace: {0}\n - \n\nВозникло исключение при качественной печати.\nОтправьте отчет об этой неполадке для ее устранения.\nТрассировка: {0}\n + \n\nВозникло исключение при автоматическом форматировании.\nОтправьте отчет об этой неполадке для ее устранения.\nТрассировка: {0}\n diff --git a/src/fsharp/import.fs b/src/fsharp/import.fs index 571c20b6d9..8d862e98c6 100644 --- a/src/fsharp/import.fs +++ b/src/fsharp/import.fs @@ -168,7 +168,9 @@ let rec ImportILType (env:ImportMap) m tinst typ = let inst = tspec.GenericArgs |> List.map (ImportILType env m tinst) ImportTyconRefApp env tcref inst + | ILType.Modified(_,tref,ILType.Byref ty) when tref.Name = "System.Runtime.InteropServices.InAttribute" -> mkInByrefTy env.g (ImportILType env m tinst ty) | ILType.Byref ty -> mkByrefTy env.g (ImportILType env m tinst ty) + | ILType.Ptr ILType.Void when env.g.voidptr_tcr.CanDeref -> mkVoidPtrTy env.g | ILType.Ptr ty -> mkNativePtrTy env.g (ImportILType env m tinst ty) | ILType.FunctionPointer _ -> env.g.nativeint_ty (* failwith "cannot import this kind of type (ptr, fptr)" *) | ILType.Modified(_,_,ty) -> @@ -260,7 +262,10 @@ let rec ImportProvidedType (env:ImportMap) (m:range) (* (tinst:TypeInst) *) (st: mkByrefTy g elemTy elif st.PUntaint((fun st -> st.IsPointer),m) then let elemTy = (ImportProvidedType env m (* tinst *) (st.PApply((fun st -> st.GetElementType()),m))) - mkNativePtrTy g elemTy + if isUnitTy g elemTy || isVoidTy g elemTy && g.voidptr_tcr.CanDeref then + mkVoidPtrTy g + else + mkNativePtrTy g elemTy else // REVIEW: Extension type could try to be its own generic arg (or there could be a type loop) diff --git a/src/fsharp/infos.fs b/src/fsharp/infos.fs index 10883ebabc..7eab2d0a11 100755 --- a/src/fsharp/infos.fs +++ b/src/fsharp/infos.fs @@ -573,7 +573,7 @@ type ParamNameAndType = /// Full information about a parameter returned for use by the type checker and language service. type ParamData = /// ParamData(isParamArray, isOut, optArgInfo, callerInfoInfo, nameOpt, reflArgInfo, ttype) - ParamData of bool * bool * OptionalArgInfo * CallerInfoInfo * Ident option * ReflectedArgInfo * TType + ParamData of bool * bool * bool * OptionalArgInfo * CallerInfoInfo * Ident option * ReflectedArgInfo * TType //------------------------------------------------------------------------- @@ -1182,6 +1182,13 @@ type MethInfo = | ILMeth (_,_,Some _) -> true | _ -> false + /// Indicates if this is an extension member (e.g. on a struct) that takes a byref arg + member x.ObjArgNeedsAddress (amap: Import.ImportMap, m) = + (x.IsStruct && not x.IsExtensionMember) || + match x.GetObjArgTypes (amap, m, x.FormalMethodInst) with + | [h] -> isByrefTy amap.g h + | _ -> false + /// Indicates if this is an F# extension member. member x.IsFSharpStyleExtensionMember = match x with FSMeth (_,_,vref,_) -> vref.IsExtensionMember | _ -> false @@ -1350,6 +1357,7 @@ type MethInfo = | Some _ -> ReflectedArgInfo.Quote false | _ -> ReflectedArgInfo.None let isOutArg = (p.IsOut && not p.IsIn) + let isInArg = (p.IsIn && not p.IsOut) // Note: we get default argument values from VB and other .NET language metadata let optArgInfo = OptionalArgInfo.FromILParameter g amap m ilMethInfo.MetadataScope ilMethInfo.DeclaringTypeInst p @@ -1369,7 +1377,7 @@ type MethInfo = if p.Type.TypeRef.FullName = "System.Int32" then CallerFilePath else CallerLineNumber - yield (isParamArrayArg, isOutArg, optArgInfo, callerInfoInfo, reflArgInfo) ] ] + yield (isParamArrayArg, isInArg, isOutArg, optArgInfo, callerInfoInfo, reflArgInfo) ] ] | FSMeth(g,_,vref,_) -> GetArgInfosOfMember x.IsCSharpStyleExtensionMember g vref @@ -1379,7 +1387,8 @@ type MethInfo = match TryFindFSharpBoolAttributeAssumeFalse g g.attrib_ReflectedDefinitionAttribute argInfo.Attribs with | Some b -> ReflectedArgInfo.Quote b | None -> ReflectedArgInfo.None - let isOutArg = HasFSharpAttribute g g.attrib_OutAttribute argInfo.Attribs && isByrefTy g ty + let isOutArg = (HasFSharpAttribute g g.attrib_OutAttribute argInfo.Attribs && isByrefTy g ty) || isOutByrefTy g ty + let isInArg = (HasFSharpAttribute g g.attrib_InAttribute argInfo.Attribs && isByrefTy g ty) || isInByrefTy g ty let isCalleeSideOptArg = HasFSharpAttribute g g.attrib_OptionalArgumentAttribute argInfo.Attribs let isCallerSideOptArg = HasFSharpAttributeOpt g g.attrib_OptionalAttribute argInfo.Attribs let optArgInfo = @@ -1430,7 +1439,7 @@ type MethInfo = | Some optTy when typeEquiv g g.int32_ty optTy -> CallerFilePath | _ -> CallerLineNumber - (isParamArrayArg, isOutArg, optArgInfo, callerInfoInfo, reflArgInfo)) + (isParamArrayArg, isInArg, isOutArg, optArgInfo, callerInfoInfo, reflArgInfo)) | DefaultStructCtor _ -> [[]] @@ -1446,7 +1455,9 @@ type MethInfo = | Some ([ Some (:? bool as b) ], _) -> ReflectedArgInfo.Quote b | Some _ -> ReflectedArgInfo.Quote false | None -> ReflectedArgInfo.None - yield (isParamArrayArg, p.PUntaint((fun p -> p.IsOut), m), optArgInfo, NoCallerInfo, reflArgInfo)] ] + let isOutArg = p.PUntaint((fun p -> p.IsOut && not p.IsIn), m) + let isInArg = p.PUntaint((fun p -> p.IsIn && not p.IsOut), m) + yield (isParamArrayArg, isInArg, isOutArg, optArgInfo, NoCallerInfo, reflArgInfo)] ] #endif @@ -1546,12 +1557,12 @@ type MethInfo = #endif let paramAttribs = x.GetParamAttribs(amap, m) - (paramAttribs,paramNamesAndTypes) ||> List.map2 (List.map2 (fun (isParamArrayArg,isOutArg,optArgInfo,callerInfoInfo,reflArgInfo) (ParamNameAndType(nmOpt,pty)) -> - ParamData(isParamArrayArg,isOutArg,optArgInfo,callerInfoInfo,nmOpt,reflArgInfo,pty))) + (paramAttribs,paramNamesAndTypes) ||> List.map2 (List.map2 (fun (isParamArrayArg, isInArg, isOutArg, optArgInfo, callerInfoInfo, reflArgInfo) (ParamNameAndType(nmOpt,pty)) -> + ParamData(isParamArrayArg, isInArg, isOutArg, optArgInfo, callerInfoInfo, nmOpt, reflArgInfo, pty))) /// Get the ParamData objects for the parameters of a MethInfo member x.HasParamArrayArg(amap, m, minst) = - x.GetParamDatas(amap, m, minst) |> List.existsSquared (fun (ParamData(isParamArrayArg,_,_,_,_,_,_)) -> isParamArrayArg) + x.GetParamDatas(amap, m, minst) |> List.existsSquared (fun (ParamData(isParamArrayArg,_,_,_,_,_,_,_)) -> isParamArrayArg) /// Select all the type parameters of the declaring type of a method. @@ -2134,7 +2145,7 @@ type PropInfo = /// Get the details of the indexer parameters associated with the property member x.GetParamDatas(amap,m) = x.GetParamNamesAndTypes(amap,m) - |> List.map (fun (ParamNameAndType(nmOpt,pty)) -> ParamData(false, false, NotOptional, NoCallerInfo, nmOpt, ReflectedArgInfo.None, pty)) + |> List.map (fun (ParamNameAndType(nmOpt,pty)) -> ParamData(false, false, false, NotOptional, NoCallerInfo, nmOpt, ReflectedArgInfo.None, pty)) /// Get the types of the indexer parameters associated with the property member x.GetParamTypes(amap,m) = diff --git a/src/fsharp/service/ServiceAssemblyContent.fs b/src/fsharp/service/ServiceAssemblyContent.fs index f454c5ef29..8f0a7dbc59 100644 --- a/src/fsharp/service/ServiceAssemblyContent.fs +++ b/src/fsharp/service/ServiceAssemblyContent.fs @@ -663,6 +663,9 @@ module ParsedInput = walkExpr e1 addLongIdentWithDots idents walkExpr e2 + | SynExpr.Set (e1, e2, _) -> + walkExpr e1 + walkExpr e2 | SynExpr.DotIndexedGet (e, args, _, _) -> walkExpr e List.iter walkIndexerArg args diff --git a/src/fsharp/service/ServiceDeclarationLists.fs b/src/fsharp/service/ServiceDeclarationLists.fs index 83f1bccba0..420be3fab7 100644 --- a/src/fsharp/service/ServiceDeclarationLists.fs +++ b/src/fsharp/service/ServiceDeclarationLists.fs @@ -85,14 +85,14 @@ module internal DescriptionListsImpl = else // TODO: in this case ucinst is ignored - it gives the instantiation of the type parameters of // the union type containing this case. - NicePrint.layoutOfParamData denv (ParamData(false, false, NotOptional, NoCallerInfo, Some f.Id, ReflectedArgInfo.None, f.FormalType)) + NicePrint.layoutOfParamData denv (ParamData(false, false, false, NotOptional, NoCallerInfo, Some f.Id, ReflectedArgInfo.None, f.FormalType)) FSharpMethodGroupItemParameter( name=initial.ParameterName, canonicalTypeTextForSorting=initial.CanonicalTypeTextForSorting, display=display, isOptional=false) - let ParamOfParamData g denv (ParamData(_isParamArrayArg, _isOutArg, optArgInfo, _callerInfoInfo, nmOpt, _reflArgInfo, pty) as paramData) = + let ParamOfParamData g denv (ParamData(_isParamArrayArg, _isInArg, _isOutArg, optArgInfo, _callerInfoInfo, nmOpt, _reflArgInfo, pty) as paramData) = FSharpMethodGroupItemParameter( name = (match nmOpt with None -> "" | Some pn -> pn.idText), canonicalTypeTextForSorting = printCanonicalizedTypeName g denv pty, @@ -103,7 +103,7 @@ module internal DescriptionListsImpl = let PrettyParamsOfParamDatas g denv typarInst (paramDatas:ParamData list) rty = let paramInfo,paramTypes = paramDatas - |> List.map (fun (ParamData(isParamArrayArg, _isOutArg, optArgInfo, _callerInfoInfo, nmOpt, _reflArgInfo, pty)) -> + |> List.map (fun (ParamData(isParamArrayArg, _isInArg, _isOutArg, optArgInfo, _callerInfoInfo, nmOpt, _reflArgInfo, pty)) -> let isOptArg = optArgInfo.IsOptional match nmOpt, isOptArg, tryDestOptionTy denv.g pty with // Layout an optional argument @@ -237,7 +237,7 @@ module internal DescriptionListsImpl = let firstCurriedParamDatas = firstCurriedArgInfo |> List.map ParamNameAndType.FromArgInfo - |> List.map (fun (ParamNameAndType(nmOpt, pty)) -> ParamData(false, false, NotOptional, NoCallerInfo, nmOpt, ReflectedArgInfo.None, pty)) + |> List.map (fun (ParamNameAndType(nmOpt, pty)) -> ParamData(false, false, false, NotOptional, NoCallerInfo, nmOpt, ReflectedArgInfo.None, pty)) // Adjust the return type so it only strips the first argument let curriedRetTy = @@ -321,7 +321,7 @@ module internal DescriptionListsImpl = | None -> let argNamesAndTys = SymbolHelpers.ParamNameAndTypesOfUnaryCustomOperation g minfo let argTys, _ = PrettyTypes.PrettifyTypes g (argNamesAndTys |> List.map (fun (ParamNameAndType(_,ty)) -> ty)) - let paramDatas = (argNamesAndTys, argTys) ||> List.map2 (fun (ParamNameAndType(nmOpt, _)) argTy -> ParamData(false, false, NotOptional, NoCallerInfo, nmOpt, ReflectedArgInfo.None,argTy)) + let paramDatas = (argNamesAndTys, argTys) ||> List.map2 (fun (ParamNameAndType(nmOpt, _)) argTy -> ParamData(false, false, false, NotOptional, NoCallerInfo, nmOpt, ReflectedArgInfo.None,argTy)) let rty = minfo.GetFSharpReturnTy(amap, m, minfo.FormalMethodInst) let _prettyTyparInst, prettyParams, prettyRetTyL, _prettyConstraintsL = PrettyParamsOfParamDatas g denv item.TyparInst paramDatas rty @@ -342,7 +342,7 @@ module internal DescriptionListsImpl = let (SigOfFunctionForDelegate(_, _, _, fty)) = GetSigOfFunctionForDelegate infoReader delty m AccessibleFromSomewhere // No need to pass more generic type information in here since the instanitations have already been applied - let _prettyTyparInst, prettyParams, prettyRetTyL, _prettyConstraintsL = PrettyParamsOfParamDatas g denv item.TyparInst [ParamData(false, false, NotOptional, NoCallerInfo, None, ReflectedArgInfo.None, fty)] delty + let _prettyTyparInst, prettyParams, prettyRetTyL, _prettyConstraintsL = PrettyParamsOfParamDatas g denv item.TyparInst [ParamData(false, false, false, NotOptional, NoCallerInfo, None, ReflectedArgInfo.None, fty)] delty // FUTURE: prettyTyparInst is the pretty version of the known instantiations of type parameters in the output. It could be returned // for display as part of the method group diff --git a/src/fsharp/service/ServiceInterfaceStubGenerator.fs b/src/fsharp/service/ServiceInterfaceStubGenerator.fs index 7532449dc9..2d42bb7c60 100644 --- a/src/fsharp/service/ServiceInterfaceStubGenerator.fs +++ b/src/fsharp/service/ServiceInterfaceStubGenerator.fs @@ -840,17 +840,22 @@ module internal InterfaceStubGenerator = | SynExpr.Ident(_ident) -> None + | SynExpr.LongIdent(_, _longIdent, _altNameRefCell, _range) -> None | SynExpr.LongIdentSet(_longIdent, synExpr, _range) -> walkExpr synExpr + | SynExpr.DotGet(synExpr, _dotm, _longIdent, _range) -> walkExpr synExpr | SynExpr.DotSet(synExpr1, _longIdent, synExpr2, _range) -> List.tryPick walkExpr [synExpr1; synExpr2] + | SynExpr.Set(synExpr1, synExpr2, _range) -> + List.tryPick walkExpr [synExpr1; synExpr2] + | SynExpr.DotIndexedGet(synExpr, IndexerArgList synExprList, _range, _range2) -> Option.orElse (walkExpr synExpr) (List.tryPick walkExpr synExprList) diff --git a/src/fsharp/service/ServiceParseTreeWalk.fs b/src/fsharp/service/ServiceParseTreeWalk.fs index 74777d0e2e..a8eb0bfed2 100755 --- a/src/fsharp/service/ServiceParseTreeWalk.fs +++ b/src/fsharp/service/ServiceParseTreeWalk.fs @@ -394,7 +394,8 @@ module public AstTraversal = | SynExpr.LongIdent(_, _longIdent, _altNameRefCell, _range) -> None | SynExpr.LongIdentSet(_longIdent, synExpr, _range) -> traverseSynExpr synExpr | SynExpr.DotGet(synExpr, _dotm, _longIdent, _range) -> traverseSynExpr synExpr - | SynExpr.DotSet(synExpr, _longIdent, synExpr2, _range) -> + | SynExpr.Set(synExpr, synExpr2, _) + | SynExpr.DotSet(synExpr, _, synExpr2, _) -> [dive synExpr synExpr.Range traverseSynExpr dive synExpr2 synExpr2.Range traverseSynExpr] |> pick expr diff --git a/src/fsharp/service/ServiceStructure.fs b/src/fsharp/service/ServiceStructure.fs index ffe2461d95..e2f1c8780d 100644 --- a/src/fsharp/service/ServiceStructure.fs +++ b/src/fsharp/service/ServiceStructure.fs @@ -223,10 +223,14 @@ module Structure = | SynExpr.InferredUpcast (e,_) | SynExpr.DotGet (e,_,_,_) | SynExpr.Do (e,_) - | SynExpr.DotSet (e,_,_,_) | SynExpr.Typed (e,_,_) - | SynExpr.DotIndexedGet (e,_,_,_) - | SynExpr.DotIndexedSet (e,_,_,_,_,_) -> parseExpr e + | SynExpr.DotIndexedGet (e,_,_,_) -> + parseExpr e + | SynExpr.Set (e1,e2,_) + | SynExpr.DotSet (e1,_,e2,_) + | SynExpr.DotIndexedSet (e1,_,e2,_,_,_) -> + parseExpr e1 + parseExpr e2 | SynExpr.New (_,_,expr,r) -> rcheck Scope.New Collapse.Below r expr.Range parseExpr expr diff --git a/src/fsharp/service/ServiceUntypedParse.fs b/src/fsharp/service/ServiceUntypedParse.fs index 211bcc5833..4c6bbe8f9c 100755 --- a/src/fsharp/service/ServiceUntypedParse.fs +++ b/src/fsharp/service/ServiceUntypedParse.fs @@ -212,6 +212,7 @@ type FSharpParseFileResults(errors: FSharpErrorInfo[], input: Ast.ParsedInput op | SynExpr.NamedIndexedPropertySet (_,e1,e2,_) | SynExpr.DotSet (e1,_,e2,_) + | SynExpr.Set (e1,e2,_) | SynExpr.LibraryOnlyUnionCaseFieldSet (e1,_,_,e2,_) | SynExpr.App (_,_,e1,e2,_) -> yield! walkExpr false e1 @@ -480,6 +481,13 @@ module UntypedParseImpl = else // see comment below for SynExpr.DotSet Some((unionRanges synExpr.Range r)) + | SynExpr.Set(synExpr, synExpr2, range) -> + if AstTraversal.rangeContainsPosLeftEdgeInclusive synExpr.Range pos then + traverseSynExpr synExpr + elif AstTraversal.rangeContainsPosLeftEdgeInclusive synExpr2.Range pos then + traverseSynExpr synExpr2 + else + Some(range) | SynExpr.DotSet(synExpr, LongIdentWithDots(longIdent,_), synExpr2, _range) -> if AstTraversal.rangeContainsPosLeftEdgeInclusive synExpr.Range pos then traverseSynExpr synExpr @@ -642,6 +650,10 @@ module UntypedParseImpl = dive lidwd lidwd.Range (traverseLidOrElse(Some exprLeft)) dive exprRhs exprRhs.Range traverseSynExpr ] |> pick expr + | SynExpr.Set(exprLeft, exprRhs, _m) -> + [ dive exprLeft exprLeft.Range traverseSynExpr + dive exprRhs exprRhs.Range traverseSynExpr + ] |> pick expr | SynExpr.NamedIndexedPropertySet(lidwd, exprIndexer, exprRhs, _m) -> [ dive lidwd lidwd.Range (traverseLidOrElse None) dive exprIndexer exprIndexer.Range traverseSynExpr @@ -843,6 +855,7 @@ module UntypedParseImpl = | SynExpr.LongIdentSet(_, e, _) -> walkExprWithKind parentKind e | SynExpr.DotGet(e, _, _, _) -> walkExprWithKind parentKind e | SynExpr.DotSet(e, _, _, _) -> walkExprWithKind parentKind e + | SynExpr.Set(e, _, _) -> walkExprWithKind parentKind e | SynExpr.DotIndexedGet(e, args, _, _) -> walkExprWithKind parentKind e |> Option.orElse (List.tryPick walkIndexerArg args) | SynExpr.DotIndexedSet(e, args, _, _, _, _) -> walkExprWithKind parentKind e |> Option.orElse (List.tryPick walkIndexerArg args) | SynExpr.NamedIndexedPropertySet(_, e1, e2, _) -> List.tryPick (walkExprWithKind parentKind) [e1; e2] @@ -1235,6 +1248,9 @@ module UntypedParseImpl = | _ -> defaultTraverse synBinding match headPat with + | SynPat.LongIdent(longDotId = lidwd) when rangeContainsPos lidwd.Range pos -> + // let fo|o x = () + Some CompletionContext.Invalid | SynPat.LongIdent(_,_,_,ctorArgs,_,_) -> match ctorArgs with | SynConstructorArgs.Pats(pats) -> @@ -1251,6 +1267,9 @@ module UntypedParseImpl = | _ -> visitParam pat ) | _ -> defaultTraverse synBinding + | SynPat.Named(range = range) when rangeContainsPos range pos -> + // let fo|o = 1 + Some CompletionContext.Invalid | _ -> defaultTraverse synBinding member __.VisitHashDirective(range) = diff --git a/src/fsharp/service/service.fs b/src/fsharp/service/service.fs index 4f5bb2e797..be87c41117 100644 --- a/src/fsharp/service/service.fs +++ b/src/fsharp/service/service.fs @@ -353,7 +353,7 @@ type TypeCheckInfo methods |> List.collect (fun meth -> match meth.GetParamDatas(amap, m, meth.FormalMethodInst) with - | x::_ -> x |> List.choose(fun (ParamData(_isParamArray, _isOut, _optArgInfo, _callerInfoInfo, name, _, ty)) -> + | x::_ -> x |> List.choose(fun (ParamData(_isParamArray, _isInArg, _isOutArg, _optArgInfo, _callerInfoInfo, name, _, ty)) -> match name with | Some n -> Some (Item.ArgName(n, ty, Some (ArgumentContainer.Method meth))) | None -> None diff --git a/src/fsharp/symbols/Exprs.fs b/src/fsharp/symbols/Exprs.fs index ecbcea1019..31aa2e29d7 100644 --- a/src/fsharp/symbols/Exprs.fs +++ b/src/fsharp/symbols/Exprs.fs @@ -302,10 +302,10 @@ module FSharpExprConvert = match expr with | Expr.Op(op, tyargs, args, m) -> match op, args, tyargs with - | TOp.LValueOp(LGetAddr, vref), _, _ -> exprForValRef m vref - | TOp.ValFieldGetAddr(rfref), [], _ -> mkStaticRecdFieldGet(rfref, tyargs, m) - | TOp.ValFieldGetAddr(rfref), [arg], _ -> mkRecdFieldGetViaExprAddr(exprOfExprAddr cenv arg, rfref, tyargs, m) - | TOp.UnionCaseFieldGetAddr(uref, n), [arg], _ -> mkUnionCaseFieldGetProvenViaExprAddr(exprOfExprAddr cenv arg, uref, tyargs, n, m) + | TOp.LValueOp(LAddrOf _, vref), _, _ -> exprForValRef m vref + | TOp.ValFieldGetAddr(rfref, _), [], _ -> mkStaticRecdFieldGet(rfref, tyargs, m) + | TOp.ValFieldGetAddr(rfref, _), [arg], _ -> mkRecdFieldGetViaExprAddr(exprOfExprAddr cenv arg, rfref, tyargs, m) + | TOp.UnionCaseFieldGetAddr(uref, n, _), [arg], _ -> mkUnionCaseFieldGetProvenViaExprAddr(exprOfExprAddr cenv arg, uref, tyargs, n, m) | TOp.ILAsm([ I_ldflda(fspec) ], rtys), [arg], _ -> mkAsmExpr([ mkNormalLdfld(fspec) ], tyargs, [exprOfExprAddr cenv arg], rtys, m) | TOp.ILAsm([ I_ldsflda(fspec) ], rtys), _, _ -> mkAsmExpr([ mkNormalLdsfld(fspec) ], tyargs, args, rtys, m) | TOp.ILAsm(([ I_ldelema(_ro, _isNativePtr, shape, _tyarg) ] ), _), (arr::idxs), [elemty] -> @@ -581,10 +581,10 @@ module FSharpExprConvert = let projR = FSharpField(cenv, ucref, n) E.UnionCaseSet(ConvExpr cenv env e1, typR, mkR, projR, ConvExpr cenv env e2) - | TOp.UnionCaseFieldGetAddr (_ucref, _n), _tyargs, _ -> + | TOp.UnionCaseFieldGetAddr _, _tyargs, _ -> E.AddressOf(ConvLValueExpr cenv env expr) - | TOp.ValFieldGetAddr(_rfref), _tyargs, _ -> + | TOp.ValFieldGetAddr _, _tyargs, _ -> E.AddressOf(ConvLValueExpr cenv env expr) | TOp.ValFieldGet(rfref), tyargs, [] -> @@ -755,7 +755,7 @@ module FSharpExprConvert = // rebuild reraise() and Convert mkReraiseLibCall cenv.g toTy m |> ConvExprPrim cenv env - | TOp.LValueOp(LGetAddr, vref), [], [] -> + | TOp.LValueOp(LAddrOf _, vref), [], [] -> E.AddressOf(ConvExpr cenv env (exprForValRef m vref)) | TOp.LValueOp(LByrefSet, vref), [], [e] -> @@ -815,8 +815,8 @@ module FSharpExprConvert = let argsR = ConvExprs cenv env args E.TraitCall(tysR, nm, memFlags, argtysR, tyargsR, argsR) - | TOp.RefAddrGet, [ty], [e] -> - let replExpr = mkRecdFieldGetAddrViaExprAddr(e, mkRefCellContentsRef cenv.g, [ty], m) + | TOp.RefAddrGet readonly, [ty], [e] -> + let replExpr = mkRecdFieldGetAddrViaExprAddr(readonly, e, mkRefCellContentsRef cenv.g, [ty], m) ConvExprPrim cenv env replExpr | _ -> wfail (sprintf "unhandled construct in AST", m) diff --git a/src/fsharp/symbols/Symbols.fs b/src/fsharp/symbols/Symbols.fs index def12ebfed..55cd2e90ed 100644 --- a/src/fsharp/symbols/Symbols.fs +++ b/src/fsharp/symbols/Symbols.fs @@ -285,7 +285,7 @@ type FSharpSymbol(cenv: SymbolEnv, item: (unit -> Item), access: (FSharpSymbol - FSharpActivePatternCase(cenv, apinfo, typ, n, None, item) :> _ | Item.ArgName(id, ty, _) -> - FSharpParameter(cenv, ty, {Attribs=[]; Name=Some id}, Some id.idRange, isParamArrayArg=false, isOutArg=false, isOptionalArg=false) :> _ + FSharpParameter(cenv, ty, {Attribs=[]; Name=Some id}, Some id.idRange, isParamArrayArg=false, isInArg=false, isOutArg=false, isOptionalArg=false) :> _ // TODO: the following don't currently return any interesting subtype | Item.ImplicitOp _ @@ -1747,11 +1747,11 @@ and FSharpMemberOrFunctionOrValue(cenv, d:FSharpMemberOrValData, item) = match d with | P p -> - [ [ for (ParamData(isParamArrayArg, isOutArg, optArgInfo, _callerInfoInfo, nmOpt, _reflArgInfo, pty)) in p.GetParamDatas(cenv.amap, range0) do + [ [ for (ParamData(isParamArrayArg, isInArg, isOutArg, optArgInfo, _callerInfoInfo, nmOpt, _reflArgInfo, pty)) in p.GetParamDatas(cenv.amap, range0) do // INCOMPLETENESS: Attribs is empty here, so we can't look at attributes for // either .NET or F# parameters let argInfo: ArgReprInfo = { Name=nmOpt; Attribs= [] } - yield FSharpParameter(cenv, pty, argInfo, x.DeclarationLocationOpt, isParamArrayArg, isOutArg, optArgInfo.IsOptional) ] + yield FSharpParameter(cenv, pty, argInfo, x.DeclarationLocationOpt, isParamArrayArg, isInArg, isOutArg, optArgInfo.IsOptional) ] |> makeReadOnlyCollection ] |> makeReadOnlyCollection @@ -1759,11 +1759,11 @@ and FSharpMemberOrFunctionOrValue(cenv, d:FSharpMemberOrValData, item) = | M m | C m -> [ for argtys in m.GetParamDatas(cenv.amap, range0, m.FormalMethodInst) do yield - [ for (ParamData(isParamArrayArg, isOutArg, optArgInfo, _callerInfoInfo, nmOpt, _reflArgInfo, pty)) in argtys do + [ for (ParamData(isParamArrayArg, isInArg, isOutArg, optArgInfo, _callerInfoInfo, nmOpt, _reflArgInfo, pty)) in argtys do // INCOMPLETENESS: Attribs is empty here, so we can't look at attributes for // either .NET or F# parameters let argInfo: ArgReprInfo = { Name=nmOpt; Attribs= [] } - yield FSharpParameter(cenv, pty, argInfo, x.DeclarationLocationOpt, isParamArrayArg, isOutArg, optArgInfo.IsOptional) ] + yield FSharpParameter(cenv, pty, argInfo, x.DeclarationLocationOpt, isParamArrayArg, isInArg, isOutArg, optArgInfo.IsOptional) ] |> makeReadOnlyCollection ] |> makeReadOnlyCollection @@ -1780,7 +1780,7 @@ and FSharpMemberOrFunctionOrValue(cenv, d:FSharpMemberOrValData, item) = else [typ] yield allArguments - |> List.map (fun arg -> FSharpParameter(cenv, arg, { Name=None; Attribs= [] }, x.DeclarationLocationOpt, false, false, false)) + |> List.map (fun arg -> FSharpParameter(cenv, arg, { Name=None; Attribs= [] }, x.DeclarationLocationOpt, false, false, false, false)) |> makeReadOnlyCollection ] |> makeReadOnlyCollection else makeReadOnlyCollection [] @@ -1792,9 +1792,10 @@ and FSharpMemberOrFunctionOrValue(cenv, d:FSharpMemberOrValData, item) = yield [ for argty, argInfo in argtys do let isParamArrayArg = HasFSharpAttribute cenv.g cenv.g.attrib_ParamArrayAttribute argInfo.Attribs + let isInArg = HasFSharpAttribute cenv.g cenv.g.attrib_InAttribute argInfo.Attribs && isByrefTy cenv.g argty let isOutArg = HasFSharpAttribute cenv.g cenv.g.attrib_OutAttribute argInfo.Attribs && isByrefTy cenv.g argty let isOptionalArg = HasFSharpAttribute cenv.g cenv.g.attrib_OptionalArgumentAttribute argInfo.Attribs - yield FSharpParameter(cenv, argty, argInfo, x.DeclarationLocationOpt, isParamArrayArg, isOutArg, isOptionalArg) ] + yield FSharpParameter(cenv, argty, argInfo, x.DeclarationLocationOpt, isParamArrayArg, isInArg, isOutArg, isOptionalArg) ] |> makeReadOnlyCollection ] |> makeReadOnlyCollection @@ -1810,29 +1811,29 @@ and FSharpMemberOrFunctionOrValue(cenv, d:FSharpMemberOrValData, item) = // For non-standard events, just use the delegate type as the ReturnParameter type e.GetDelegateType(cenv.amap, range0) - FSharpParameter(cenv, rty, retInfo, x.DeclarationLocationOpt, isParamArrayArg=false, isOutArg=false, isOptionalArg=false) + FSharpParameter(cenv, rty, retInfo, x.DeclarationLocationOpt, isParamArrayArg=false, isInArg=false, isOutArg=false, isOptionalArg=false) | P p -> // INCOMPLETENESS: Attribs is empty here, so we can't look at return attributes for .NET or F# methods let retInfo: ArgReprInfo = { Name=None; Attribs= [] } let rty = p.GetPropertyType(cenv.amap, range0) - FSharpParameter(cenv, rty, retInfo, x.DeclarationLocationOpt, isParamArrayArg=false, isOutArg=false, isOptionalArg=false) + FSharpParameter(cenv, rty, retInfo, x.DeclarationLocationOpt, isParamArrayArg=false, isInArg=false, isOutArg=false, isOptionalArg=false) | M m | C m -> // INCOMPLETENESS: Attribs is empty here, so we can't look at return attributes for .NET or F# methods let retInfo: ArgReprInfo = { Name=None; Attribs= [] } let rty = m.GetFSharpReturnTy(cenv.amap, range0, m.FormalMethodInst) - FSharpParameter(cenv, rty, retInfo, x.DeclarationLocationOpt, isParamArrayArg=false, isOutArg=false, isOptionalArg=false) + FSharpParameter(cenv, rty, retInfo, x.DeclarationLocationOpt, isParamArrayArg=false, isInArg=false, isOutArg=false, isOptionalArg=false) | V v -> match v.ValReprInfo with | None -> let _, tau = v.TypeScheme let _argtysl, rty = stripFunTy cenv.g tau let empty: ArgReprInfo = { Name=None; Attribs= [] } - FSharpParameter(cenv, rty, empty, x.DeclarationLocationOpt, isParamArrayArg=false, isOutArg=false, isOptionalArg=false) + FSharpParameter(cenv, rty, empty, x.DeclarationLocationOpt, isParamArrayArg=false, isInArg=false, isOutArg=false, isOptionalArg=false) | Some (ValReprInfo(_typars, argInfos, retInfo)) -> let tau = v.TauType let _c, rty = GetTopTauTypeInFSharpForm cenv.g argInfos tau range0 - FSharpParameter(cenv, rty, retInfo, x.DeclarationLocationOpt, isParamArrayArg=false, isOutArg=false, isOptionalArg=false) + FSharpParameter(cenv, rty, retInfo, x.DeclarationLocationOpt, isParamArrayArg=false, isInArg=false, isOutArg=false, isOptionalArg=false) member __.Attributes = @@ -2249,7 +2250,7 @@ and FSharpStaticParameter(cenv, sp: Tainted< ExtensionTyping.ProvidedParameterIn override x.ToString() = "static parameter " + x.Name #endif -and FSharpParameter(cenv, typ:TType, topArgInfo:ArgReprInfo, mOpt, isParamArrayArg, isOutArg, isOptionalArg) = +and FSharpParameter(cenv, typ:TType, topArgInfo:ArgReprInfo, mOpt, isParamArrayArg, isInArg, isOutArg, isOptionalArg) = inherit FSharpSymbol(cenv, (fun () -> let m = match mOpt with Some m -> m | None -> range0 @@ -2263,7 +2264,7 @@ and FSharpParameter(cenv, typ:TType, topArgInfo:ArgReprInfo, mOpt, isParamArrayA member __.cenv: SymbolEnv = cenv - member __.AdjustType(t) = FSharpParameter(cenv, t, topArgInfo, mOpt, isParamArrayArg, isOutArg, isOptionalArg) + member __.AdjustType(t) = FSharpParameter(cenv, t, topArgInfo, mOpt, isParamArrayArg, isInArg, isOutArg, isOptionalArg) member __.Type: FSharpType = FSharpType(cenv, typ) @@ -2276,6 +2277,8 @@ and FSharpParameter(cenv, typ:TType, topArgInfo:ArgReprInfo, mOpt, isParamArrayA member __.IsParamArrayArg = isParamArrayArg + member __.IsInArg = isInArg + member __.IsOutArg = isOutArg member __.IsOptionalArg = isOptionalArg diff --git a/src/fsharp/symbols/Symbols.fsi b/src/fsharp/symbols/Symbols.fsi index 68110b3927..27ec674526 100644 --- a/src/fsharp/symbols/Symbols.fsi +++ b/src/fsharp/symbols/Symbols.fsi @@ -853,6 +853,9 @@ and [] public FSharpParameter = /// Indicate this is an out argument member IsOutArg: bool + /// Indicate this is an in argument + member IsInArg: bool + /// Indicate this is an optional argument member IsOptionalArg: bool diff --git a/src/fsharp/tast.fs b/src/fsharp/tast.fs index 87aa4b76f3..ccabbcd023 100644 --- a/src/fsharp/tast.fs +++ b/src/fsharp/tast.fs @@ -8,6 +8,7 @@ module internal Microsoft.FSharp.Compiler.Tast open System open System.Collections.Generic +open System.Diagnostics open System.Reflection open Internal.Utilities open Microsoft.FSharp.Compiler.AbstractIL @@ -239,7 +240,7 @@ type ValFlags(flags:int64) = member x.HasBeenReferenced = (flags &&& 0b0001000000000000000L) <> 0L - member x.WithHasBeenReferenced = ValFlags(flags ||| 0b0001000000000000000L) + member x.WithHasBeenReferenced = ValFlags(flags ||| 0b0001000000000000000L) member x.IsCompiledAsStaticPropertyWithoutField = (flags &&& 0b0010000000000000000L) <> 0L @@ -260,7 +261,7 @@ type ValFlags(flags:int64) = (flags &&& ~~~0b0011001100000000000L) /// Represents the kind of a type parameter -[] +[] type TyparKind = | Type @@ -272,6 +273,9 @@ type TyparKind = | TyparKind.Type -> None | TyparKind.Measure -> Some "Measure" + [] + member x.DebugText = x.ToString() + override x.ToString() = match x with | TyparKind.Type -> "type" @@ -418,14 +422,46 @@ type EntityFlags(flags:int64) = // case sub-classes must protect themselves against early access to their contents. member x.HasSelfReferentialConstructor = (flags &&& 0b000000000001000L) <> 0x0L + /// This bit is reserved for us in the pickle format, see pickle.fs, it's being listed here to stop it ever being used for anything else + static member ReservedBitForPickleFormatTyconReprFlag = 0b000000000010000L + /// This bit represents a F# record that is a value type, or a struct record. member x.IsStructRecordOrUnionType = (flags &&& 0b000000000100000L) <> 0x0L - /// This bit is reserved for us in the pickle format, see pickle.fs, it's being listed here to stop it ever being used for anything else - static member ReservedBitForPickleFormatTyconReprFlag = 0b000000000010000L + /// These two bits represents the on-demand analysis about whether the entity has the IsByRefLike attribute + member x.TryIsByRefLike = (flags &&& 0b000000011000000L) + |> function + | 0b000000011000000L -> Some true + | 0b000000010000000L -> Some false + | _ -> None + + /// Adjust the on-demand analysis about whether the entity has the IsByRefLike attribute + member x.WithIsByRefLike(flag) = + let flags = + (flags &&& ~~~0b000000011000000L) ||| + (match flag with + | true -> 0b000000011000000L + | false -> 0b000000010000000L) + EntityFlags(flags) + + /// These two bits represents the on-demand analysis about whether the entity has the IsReadOnly attribute or is otherwise determined to be a readonly struct + member x.TryIsReadOnly = (flags &&& 0b000001100000000L) + |> function + | 0b000001100000000L -> Some true + | 0b000001000000000L -> Some false + | _ -> None + + /// Adjust the on-demand analysis about whether the entity has the IsReadOnly attribute or is otherwise determined to be a readonly struct + member x.WithIsReadOnly(flag) = + let flags = + (flags &&& ~~~0b000001100000000L) ||| + (match flag with + | true -> 0b000001100000000L + | false -> 0b000001000000000L) + EntityFlags(flags) /// Get the flags as included in the F# binary metadata - member x.PickledBits = (flags &&& ~~~0b000000000000100L) + member x.PickledBits = (flags &&& ~~~0b000001111000100L) #if DEBUG @@ -519,6 +555,7 @@ type CompilationPath = +[] type EntityOptionalData = { /// The name of the type, possibly with `n mangling @@ -558,10 +595,13 @@ type EntityOptionalData = mutable entity_exn_info: ExceptionInfo } + [] + member x.DebugText = x.ToString() + override x.ToString() = "EntityOptionalData(...)" and /// Represents a type definition, exception definition, module definition or namespace definition. - [] + [] Entity = { /// The declared type parameters of the type // MUTABILITY; used only during creation and remapping of tycons @@ -1008,6 +1048,18 @@ and /// Represents a type definition, exception definition, module definition or /// Indicates if this is an F# type definition whose r.h.s. is known to be a record type definition that is a value type. member x.IsStructRecordOrUnionTycon = match x.TypeReprInfo with TRecdRepr _ | TUnionRepr _ -> x.entity_flags.IsStructRecordOrUnionType | _ -> false + /// The on-demand analysis about whether the entity has the IsByRefLike attribute + member x.TryIsByRefLike = x.entity_flags.TryIsByRefLike + + /// Set the on-demand analysis about whether the entity has the IsByRefLike attribute + member x.SetIsByRefLike b = x.entity_flags <- x.entity_flags.WithIsByRefLike b + + /// These two bits represents the on-demand analysis about whether the entity has the IsReadOnly attribute or is otherwise determined to be a readonly struct + member x.TryIsReadOnly = x.entity_flags.TryIsReadOnly + + /// Set the on-demand analysis about whether the entity has the IsReadOnly attribute or is otherwise determined to be a readonly struct + member x.SetIsReadOnly b = x.entity_flags <- x.entity_flags.WithIsReadOnly b + /// Indicates if this is an F# type definition whose r.h.s. is known to be some kind of F# object model definition member x.IsFSharpObjectModelTycon = match x.TypeReprInfo with | TFSharpObjectRepr _ -> true | _ -> false @@ -1195,6 +1247,9 @@ and /// Represents a type definition, exception definition, module definition or /// Sets the structness of a record or union type definition member x.SetIsStructRecordOrUnion b = let flags = x.entity_flags in x.entity_flags <- EntityFlags(flags.IsPrefixDisplay, flags.IsModuleOrNamespace, flags.PreEstablishedHasDefaultConstructor, flags.HasSelfReferentialConstructor, b) + [] + member x.DebugText = x.ToString() + override x.ToString() = x.LogicalName and [] MaybeLazy<'T> = @@ -1218,7 +1273,7 @@ and ParentRef = | ParentNone and - [] + [] TyconAugmentation = { /// This is the value implementing the auto-generated comparison /// semantics if any. It is not present if the type defines its own implementation @@ -1288,10 +1343,13 @@ and tcaug_closed=false tcaug_abstract=false } + [] + member x.DebugText = x.ToString() + override x.ToString() = "TyconAugmentation(...)" and - [] + [] /// The information for the contents of a type. Also used for a provided namespace. TyconRepresentation = @@ -1335,20 +1393,26 @@ and /// The information for exception definitions should be folded into here. | TNoRepr + [] + member x.DebugText = x.ToString() + override x.ToString() = "TyconRepresentation(...)" and - [] + [] /// TILObjectReprData(scope, nesting, definition) TILObjectReprData = | TILObjectReprData of ILScopeRef * ILTypeDef list * ILTypeDef + [] + member x.DebugText = x.ToString() + override x.ToString() = "TILObjectReprData(...)" #if !NO_EXTENSIONTYPING and - [] + [] /// The information kept about a provided type TProvidedTypeInfo = @@ -1399,6 +1463,9 @@ and if info.IsErased then info.LazyBaseType.Force (m,objTy) else failwith "expect erased type" + [] + member x.DebugText = x.ToString() + override x.ToString() = "TProvidedTypeInfo(...)" #endif @@ -1426,7 +1493,7 @@ and | TTyconStruct | TTyconEnum -> true and - [] + [] TyconObjModelData = { /// Indicates whether the type declaration is a class, interface, enum, delegate or struct fsobjmodel_kind: TyconObjModelKind @@ -1437,10 +1504,13 @@ and /// The fields of the class, struct or enum fsobjmodel_rfields: TyconRecdFields } + [] + member x.DebugText = x.ToString() + override x.ToString() = "TyconObjModelData(...)" and - [] + [] TyconRecdFields = { /// The fields of the record, in declaration order. FieldsByIndex: RecdField[] @@ -1460,10 +1530,13 @@ and member x.TrueInstanceFieldsAsList = x.AllFieldsAsList |> List.filter (fun f -> not f.IsStatic && not f.IsCompilerGenerated) + [] + member x.DebugText = x.ToString() + override x.ToString() = "TyconRecdFields(...)" and - [] + [] TyconUnionCases = { /// The cases of the discriminated union, in declaration order. CasesByIndex: UnionCase[] @@ -1476,10 +1549,13 @@ and member x.UnionCasesAsList = x.CasesByIndex |> Array.toList + [] + member x.DebugText = x.ToString() + override x.ToString() = "TyconUnionCases(...)" and - [] + [] TyconUnionData = { /// The cases contained in the discriminated union. CasesTable: TyconUnionCases @@ -1489,11 +1565,13 @@ and member x.UnionCasesAsList = x.CasesTable.CasesByIndex |> Array.toList + [] + member x.DebugText = x.ToString() + override x.ToString() = "TyconUnionData(...)" and - [] - [] + [] UnionCase = { /// Data carried by the case. FieldTable: TyconRecdFields @@ -1547,12 +1625,15 @@ and member uc.IsNullary = (uc.FieldTable.FieldsByIndex.Length = 0) + [] + member x.DebugText = x.ToString() + override x.ToString() = "UnionCase(" + x.DisplayName + ")" and /// This may represent a "field" in either a struct, class, record or union /// It is normally compiled to a property. - [] + [] RecdField = { /// Is the field declared mutable in F#? rfield_mutable: bool @@ -1664,9 +1745,14 @@ and | Some Const.Zero -> true | _ -> false - override x.ToString() = "RecdField(" + x.Name + ")" + [] + member x.DebugText = x.ToString() + + override x.ToString() = x.Name -and ExceptionInfo = +and + [] + ExceptionInfo = /// Indicates that an exception is an abbreviation for the given exception | TExnAbbrevRepr of TyconRef @@ -1679,9 +1765,13 @@ and ExceptionInfo = /// Indicates that an exception is abstract, i.e. is in a signature file, and we do not know the representation | TExnNone + [] + member x.DebugText = x.ToString() + override x.ToString() = "ExceptionInfo(...)" -and [] ModuleOrNamespaceType(kind: ModuleOrNamespaceKind, vals: QueueList, entities: QueueList) = +and [] + ModuleOrNamespaceType(kind: ModuleOrNamespaceKind, vals: QueueList, entities: QueueList) = /// Mutation used during compilation of FSharp.Core.dll let mutable entities = entities @@ -1847,6 +1937,9 @@ and [] ModuleOrNamespaceType(kind: ModuleOrNamespaceKind, vals: QueueLis cacheOptRef modulesByDemangledNameCache (fun () -> QueueList.foldBack add entities Map.empty) + [] + member x.DebugText = x.ToString() + override x.ToString() = "ModuleOrNamespaceType(...)" and ModuleOrNamespace = Entity @@ -1974,13 +2067,19 @@ and Construct = | XmlDoc [||], TAccess [] -> None | _ -> Some { Entity.EmptyEntityOptData with entity_xmldoc = xml; entity_tycon_repr_accessibility = access; entity_accessiblity = access } } -and Accessibility = +and + [] + Accessibility = /// Indicates the construct can only be accessed from any code in the given type constructor, module or assembly. [] indicates global scope. | TAccess of CompilationPath list + [] + member x.DebugText = x.ToString() + override x.ToString() = "Accessibility(...)" -and [] +and + [] TyparOptionalData = { /// MUTABILITY: we set the names of generalized inference type parameters to make the look nice for IL code generation @@ -1997,13 +2096,15 @@ and [] mutable typar_attribs: Attribs } + [] + member x.DebugText = x.ToString() + override __.ToString() = sprintf "TyparOptionalData(...)" and TyparData = Typar and - [] - [] + [] /// A declared generic type/measure parameter, or a type/measure inference variable. Typar = // Backing data for type parameters and type inference variables @@ -2190,10 +2291,13 @@ and /// Sets whether the comparison constraint of a type definition depends on this type variable member x.SetComparisonDependsOn b = let flags = x.typar_flags in x.typar_flags <- TyparFlags(flags.Kind, flags.Rigidity, flags.IsFromError, flags.IsCompilerGenerated, flags.StaticReq, flags.DynamicReq, flags.EqualityConditionalOn, b) + [] + member x.DebugText = x.ToString() + override x.ToString() = x.Name and - [] + [] TyparConstraint = /// Indicates a constraint that a type is a subtype of the given type | CoercesTo of TType * range @@ -2236,11 +2340,15 @@ and /// Indicates a constraint that a type is .NET unmanaged type | IsUnmanaged of range - override x.ToString() = "TyparConstraint(...)" + // Prefer the default formatting of this union type + //[] + //member x.DebugText = x.ToString() + // + //override x.ToString() = "TyparConstraint(...)" /// The specification of a member constraint that must be solved and - [] + [] TraitConstraintInfo = /// TTrait(tys,nm,memFlags,argtys,rty,colution) @@ -2260,10 +2368,13 @@ and with get() = (let (TTrait(_,_,_,_,_,sln)) = x in sln.Value) and set v = (let (TTrait(_,_,_,_,_,sln)) = x in sln.Value <- v) + [] + member x.DebugText = x.ToString() + override x.ToString() = "TTrait(" + x.MemberName + ")" and - [] + [] /// Indicates the solution of a member constraint during inference. TraitConstraintSln = @@ -2300,10 +2411,13 @@ and /// Indicates a trait is solved by a 'fake' instance of an operator, like '+' on integers | BuiltInSln + [] + member x.DebugText = x.ToString() + override x.ToString() = "TraitConstraintSln(...)" /// The partial information used to index the methods of all those in a ModuleOrNamespace. -and [] +and [] ValLinkagePartialKey = { /// The name of the type with which the member is associated. None for non-member values. MemberParentMangledName : string option @@ -2317,11 +2431,16 @@ and [] /// Indicates the total argument count of the member. TotalArgCount: int } + [] + member x.DebugText = x.ToString() + override x.ToString() = "ValLinkagePartialKey(" + x.LogicalName + ")" /// The full information used to identify a specific overloaded method /// amongst all those in a ModuleOrNamespace. -and ValLinkageFullKey(partialKey: ValLinkagePartialKey, typeForLinkage:TType option) = +and + [< (* NoEquality; NoComparison; *) StructuredFormatDisplay("{DebugText}")>] + ValLinkageFullKey(partialKey: ValLinkagePartialKey, typeForLinkage:TType option) = /// The partial information used to index the value in a ModuleOrNamespace. member x.PartialKey = partialKey @@ -2329,9 +2448,14 @@ and ValLinkageFullKey(partialKey: ValLinkagePartialKey, typeForLinkage:TType op /// The full type of the value for the purposes of linking. May be None for non-members, since they can't be overloaded. member x.TypeForLinkage = typeForLinkage + [] + member x.DebugText = x.ToString() + override x.ToString() = "ValLinkageFullKey(" + partialKey.LogicalName + ")" -and ValOptionalData = +and + [] + ValOptionalData = { /// MUTABILITY: for unpickle linkage mutable val_compiled_name: string option @@ -2382,10 +2506,13 @@ and ValOptionalData = mutable val_attribs: Attribs } + [] + member x.DebugText = x.ToString() + override x.ToString() = "ValOptionalData(...)" and ValData = Val -and [] +and [] Val = { /// Mutable for unpickle linkage @@ -2661,7 +2788,7 @@ and [] // We use it here: // - in opt.fs : when compiling fslib, we bind an entry for the value in a global table (see bind_escaping_local_vspec) // - in ilxgen.fs: when compiling fslib, we bind an entry for the value in a global table (see bind_escaping_local_vspec) - // - in opt.fs : (fullDisplayTextOfValRef) for error reporting of non-inlinable values + // - in opt.fs : (fullDebugTextOfValRef) for error reporting of non-inlinable values // - in service.fs (boutput_item_description): to display the full text of a value's binding location // - in check.fs: as a boolean to detect public values for saving quotations // - in ilxgen.fs: as a boolean to detect public values for saving quotations @@ -2848,12 +2975,15 @@ and [] /// Indicates if a value is linked to backing data yet. Only used during unpickling of F# metadata. member x.IsLinked = match box x.val_logical_name with null -> false | _ -> true + [] + member x.DebugText = x.ToString() + override x.ToString() = x.LogicalName and /// Represents the extra information stored for a member - [] + [] ValMemberInfo = { /// The parent type. For an extension member this is the type being extended ApparentEnclosingEntity: TyconRef @@ -2866,10 +2996,13 @@ and MemberFlags: MemberFlags } + [] + member x.DebugText = x.ToString() + override x.ToString() = "ValMemberInfo(...)" and - [] + [] NonLocalValOrMemberRef = { /// A reference to the entity containing the value or member. This will always be a non-local reference EnclosingEntity : EntityRef @@ -2884,18 +3017,26 @@ and member x.AssemblyName = x.EnclosingEntity.nlr.AssemblyName /// For debugging - member x.Display = x.ToString() + [] + member x.DebugText = x.ToString() /// For debugging override x.ToString() = x.EnclosingEntity.nlr.ToString() + "::" + x.ItemKey.PartialKey.LogicalName -and ValPublicPath = +and + [] + ValPublicPath = | ValPubPath of PublicPath * ValLinkageFullKey + [] + member x.DebugText = x.ToString() + override __.ToString() = sprintf "ValPubPath(...)" /// Index into the namespace/module structure of a particular CCU -and NonLocalEntityRef = +and + [] + NonLocalEntityRef = | NonLocalEntityRef of CcuThunk * string[] /// Try to find the entity corresponding to the given path in the given CCU @@ -3063,11 +3204,13 @@ and NonLocalEntityRef = member nleref.ModuleOrNamespaceType = nleref.Deref.ModuleOrNamespaceType + [] + member x.DebugText = x.ToString() + override x.ToString() = x.DisplayName and - [] - [] + [] EntityRef = { /// Indicates a reference to something bound in this CCU mutable binding: NonNullSlot @@ -3117,12 +3260,6 @@ and /// Is the destination assembly available? member tcr.CanDeref = tcr.TryDeref.IsSome - override x.ToString() = - if x.IsLocalRef then - x.ResolvedTarget.DisplayName - else - x.nlr.DisplayName - /// Gets the data indicating the compiled representation of a type or module in terms of Abstract IL data structures. member x.CompiledRepresentation = x.Deref.CompiledRepresentation @@ -3362,6 +3499,18 @@ and /// Indicates if this is an F# type definition whose r.h.s. is known to be some kind of F# object model definition member x.IsFSharpObjectModelTycon = x.Deref.IsFSharpObjectModelTycon + /// The on-demand analysis about whether the entity has the IsByRefLike attribute + member x.TryIsByRefLike = x.Deref.TryIsByRefLike + + /// Set the on-demand analysis about whether the entity has the IsByRefLike attribute + member x.SetIsByRefLike b = x.Deref.SetIsByRefLike b + + /// The on-demand analysis about whether the entity has the IsByRefLike attribute + member x.TryIsReadOnly = x.Deref.TryIsReadOnly + + /// Set the on-demand analysis about whether the entity has the IsReadOnly attribute or is otherwise determined to be a readonly struct + member x.SetIsReadOnly b = x.Deref.SetIsReadOnly b + /// Indicates if this is an F# type definition whose r.h.s. definition is unknown (i.e. a traditional ML 'abstract' type in a signature, /// which in F# is called a 'unknown representation' type). member x.IsHiddenReprTycon = x.Deref.IsHiddenReprTycon @@ -3403,6 +3552,15 @@ and member x.MakeNestedUnionCaseRef (uc: UnionCase) = UCRef (x, uc.Id.idText) + [] + member x.DebugText = x.ToString() + + override x.ToString() = + if x.IsLocalRef then + x.ResolvedTarget.DisplayName + else + x.nlr.DisplayName + /// note: ModuleOrNamespaceRef and TyconRef are type equivalent and ModuleOrNamespaceRef = EntityRef @@ -3411,8 +3569,7 @@ and TyconRef = EntityRef /// References are either local or nonlocal and - [] - [] + [] ValRef = { /// Indicates a reference to something bound in this CCU mutable binding: NonNullSlot @@ -3623,12 +3780,17 @@ and /// Get the number of 'this'/'self' object arguments for the member. Instance extension members return '1'. member x.NumObjArgs = x.Deref.NumObjArgs + [] + member x.DebugText = x.ToString() + override x.ToString() = if x.IsLocalRef then x.ResolvedTarget.DisplayName else x.nlr.ToString() /// Represents a reference to a case of a union type -and UnionCaseRef = +and + [] + UnionCaseRef = | UCRef of TyconRef * string /// Get a reference to the type containing this union case @@ -3678,10 +3840,15 @@ and UnionCaseRef = /// Get a field of the union case by index member x.FieldByIndex n = x.UnionCase.FieldTable.FieldByIndex n - override x.ToString() = sprintf "UnionCase(%s)" x.CaseName + [] + member x.DebugText = x.ToString() + + override x.ToString() = x.CaseName /// Represents a reference to a field in a record, class or struct -and RecdFieldRef = +and + [] + RecdFieldRef = | RFRef of TyconRef * string /// Get a reference to the type containing this union case @@ -3723,11 +3890,14 @@ and RecdFieldRef = with :? KeyNotFoundException -> error(InternalError(sprintf "field %s not found in type %s" id tcref.LogicalName, tcref.Range)) - override x.ToString() = sprintf "RecdField(%s)" x.FieldName + [] + member x.DebugText = x.ToString() + + override x.ToString() = x.FieldName and /// The algebra of types - [] + [] TType = /// TType_forall(typars, bodyTy). @@ -3777,9 +3947,12 @@ and let (TILObjectReprData(scope,_nesting,_definition)) = _uc.Tycon.ILTyconInfo scope.QualifiedName + [] + member x.DebugText = x.ToString() + override x.ToString() = match x with - | TType_forall (_tps,ty) -> "forall _. " + ty.ToString() + | TType_forall (_tps,ty) -> "forall ... " + ty.ToString() | TType_app (tcref, tinst) -> tcref.DisplayName + (match tinst with [] -> "" | tys -> "<" + String.concat "," (List.map string tys) + ">") | TType_tuple (tupInfo, tinst) -> (match tupInfo with @@ -3787,12 +3960,12 @@ and | TupInfo.Const true -> "struct ") + String.concat "," (List.map string tinst) + ")" | TType_fun (d,r) -> "(" + string d + " -> " + string r + ")" - | TType_ucase (uc,tinst) -> "union case type " + uc.CaseName + (match tinst with [] -> "" | tys -> "<" + String.concat "," (List.map string tys) + ">") + | TType_ucase (uc,tinst) -> "ucase " + uc.CaseName + (match tinst with [] -> "" | tys -> "<" + String.concat "," (List.map string tys) + ">") | TType_var tp -> match tp.Solution with | None -> tp.DisplayName - | Some _ -> tp.DisplayName + " (solved, see Solution property)" - | TType_measure ms -> sprintf "%A" ms + | Some _ -> tp.DisplayName + " (solved)" + | TType_measure ms -> ms.ToString() and TypeInst = TType list @@ -3802,7 +3975,9 @@ and [] TupInfo = /// Some constant, e.g. true or false for tupInfo | Const of bool -and [] Measure = +and + [] + Measure = /// A variable unit-of-measure | Var of Typar @@ -3821,10 +3996,14 @@ and [] Measure = /// Raising a measure to a rational power | RationalPower of Measure * Rational - override x.ToString() = "Measure(...)" + // Prefer the default formatting of this union type + //[] + //member x.DebugText = x.ToString() + // + //override x.ToString() = "Measure(...)" and - [] + [] CcuData = { /// Holds the filename for the DLL, if any FileName: string option @@ -3874,6 +4053,9 @@ and /// The table of .NET CLI type forwarders for this assembly TypeForwarders : CcuTypeForwarderTable } + [] + member x.DebugText = x.ToString() + override x.ToString() = sprintf "CcuData(%A)" x.FileName /// Represents a table of .NET CLI type forwarders for an assembly @@ -3900,7 +4082,9 @@ and CcuReference = string // ILAssemblyRef /// by ccu-thunks. Ultimately, a ccu-thunk is either a (named) element of /// the data structure, or it is a delayed fixup, i.e. an invalid dangling /// reference that has not had an appropriate fixup applied. -and CcuThunk = +and + [] + CcuThunk = { mutable target: CcuData /// ccu.orphanfixup is true when a reference is missing in the transitive closure of static references that @@ -4021,25 +4205,38 @@ and CcuThunk = member ccu.MemberSignatureEquality(ty1:TType, ty2:TType) = ccu.Deref.MemberSignatureEquality ty1 ty2 + [] + member x.DebugText = x.ToString() + override ccu.ToString() = ccu.AssemblyName /// The result of attempting to resolve an assembly name to a full ccu. /// UnresolvedCcu will contain the name of the assembly that could not be resolved. -and CcuResolutionResult = +and + [] + CcuResolutionResult = | ResolvedCcu of CcuThunk | UnresolvedCcu of string - override __.ToString() = "CcuResolutionResult(...)" + [] + member x.DebugText = x.ToString() + + override x.ToString() = match x with ResolvedCcu ccu -> ccu.ToString() | UnresolvedCcu s -> "unresolved " + s /// Represents the information saved in the assembly signature data resource for an F# assembly -and PickledCcuInfo = - { mspec: ModuleOrNamespace +and + [] + PickledCcuInfo = + { mspec: ModuleOrNamespace + + compileTimeWorkingDir: string - compileTimeWorkingDir: string + usesQuotations : bool } - usesQuotations : bool } + [] + member x.DebugText = x.ToString() override __.ToString() = "PickledCcuInfo(...)" @@ -4051,7 +4248,9 @@ and PickledCcuInfo = and Attribs = Attrib list -and AttribKind = +and + [] + AttribKind = /// Indicates an attribute refers to a type defined in an imported .NET assembly | ILAttrib of ILMethodRef @@ -4059,27 +4258,47 @@ and AttribKind = /// Indicates an attribute refers to a type defined in an imported F# assembly | FSAttrib of ValRef + [] + member x.DebugText = x.ToString() + override x.ToString() = sprintf "AttribKind(...)" /// Attrib(kind,unnamedArgs,propVal,appliedToAGetterOrSetter,targetsOpt,range) -and Attrib = +and + [] + Attrib = | Attrib of TyconRef * AttribKind * AttribExpr list * AttribNamedArg list * bool * AttributeTargets option * range - override x.ToString() = sprintf "Attrib(...)" + [] + member x.DebugText = x.ToString() + + member x.TyconRef = (let (Attrib(tcref, _, _, _, _, _, _)) = x in tcref) + + override x.ToString() = "attrib" + x.TyconRef.ToString() /// We keep both source expression and evaluated expression around to help intellisense and signature printing -and AttribExpr = +and + [] + AttribExpr = /// AttribExpr(source, evaluated) | AttribExpr of Expr * Expr + [] + member x.DebugText = x.ToString() + override x.ToString() = sprintf "AttribExpr(...)" /// AttribNamedArg(name,type,isField,value) -and AttribNamedArg = +and + [] + AttribNamedArg = | AttribNamedArg of (string*TType*bool*AttribExpr) + [] + member x.DebugText = x.ToString() + override x.ToString() = sprintf "AttribNamedArg(...)" /// Constants in expressions @@ -4109,7 +4328,7 @@ and [] /// the decision tree are labelled by integers that are unique for that /// particular tree. and - [] + [] DecisionTree = /// TDSwitch(input, cases, default, range) @@ -4138,10 +4357,15 @@ and /// body -- the rest of the decision tree | TDBind of Binding * DecisionTree + [] + member x.DebugText = x.ToString() + override x.ToString() = sprintf "DecisionTree(...)" /// Represents a test and a subsequent decision tree -and DecisionTreeCase = +and + [] + DecisionTreeCase = | TCase of DecisionTreeTest * DecisionTree /// Get the discriminator associated with the case @@ -4150,10 +4374,13 @@ and DecisionTreeCase = /// Get the decision tree or a successful test member x.CaseTree = let (TCase(_,d)) = x in d + [] + member x.DebugText = x.ToString() + override x.ToString() = sprintf "DecisionTreeCase(...)" and - [] + [] DecisionTreeTest = /// Test if the input to a decision tree matches the given union case | UnionCase of UnionCaseRef * TypeInst @@ -4183,19 +4410,29 @@ and /// activePatternInfo -- The extracted info for the active pattern. | ActivePatternCase of Expr * TTypes * (ValRef * TypeInst) option * int * ActivePatternInfo + [] + member x.DebugText = x.ToString() + override x.ToString() = sprintf "DecisionTreeTest(...)" /// A target of a decision tree. Can be thought of as a little function, though is compiled as a local block. -and DecisionTreeTarget = +and + [] + DecisionTreeTarget = | TTarget of Vals * Expr * SequencePointInfoForTarget + [] + member x.DebugText = x.ToString() + override x.ToString() = sprintf "DecisionTreeTarget(...)" /// A collection of simultaneous bindings and Bindings = Binding list /// A binding of a variable to an expression, as in a `let` binding or similar -and Binding = +and + [] + Binding = | TBind of Val * Expr * SequencePointInfoForBinding /// The value being bound @@ -4207,11 +4444,16 @@ and Binding = /// The information about whether to emit a sequence point for the binding member x.SequencePointInfo = (let (TBind(_,_,sp)) = x in sp) + [] + member x.DebugText = x.ToString() + override x.ToString() = sprintf "TBind(%s, ...)" x.Var.CompiledName /// Represents a reference to an active pattern element. The /// integer indicates which choice in the target set is being selected by this item. -and ActivePatternElemRef = +and + [] + ActivePatternElemRef = | APElemRef of ActivePatternInfo * ValRef * int /// Get the full information about the active pattern being referred to @@ -4223,11 +4465,16 @@ and ActivePatternElemRef = /// Get the index of the active pattern element within the overall active pattern member x.CaseIndex = (let (APElemRef(_,_,n)) = x in n) + [] + member x.DebugText = x.ToString() + override __.ToString() = "ActivePatternElemRef(...)" /// Records the "extra information" for a value compiled as a method (rather /// than a closure or a local), including argument names, attributes etc. -and ValReprInfo = +and + [] + ValReprInfo = /// ValReprInfo (numTypars, args, result) | ValReprInfo of TyparReprInfo list * ArgReprInfo list list * ArgReprInfo @@ -4262,12 +4509,15 @@ and ValReprInfo = | (_::_::h)::t -> loop t (acc + h.Length + 2) loop args 0 + [] + member x.DebugText = x.ToString() + override __.ToString() = "ValReprInfo(...)" /// Records the "extra information" for an argument compiled as a real /// method argument, specifically the argument name and attributes. and - [] + [] ArgReprInfo = { // MUTABILITY: used when propagating signature attributes into the implementation. @@ -4276,6 +4526,9 @@ and // MUTABILITY: used when propagating names of parameters from signature into the implementation. mutable Name : Ident option } + [] + member x.DebugText = x.ToString() + override __.ToString() = "ArgReprInfo(...)" /// Records the extra metadata stored about typars for type parameters @@ -4292,7 +4545,7 @@ and Vals = Val list /// The big type of expressions. and - [] + [] Expr = /// A constant expression. | Const of Const * range * TType @@ -4372,10 +4625,14 @@ and /// appropriate type instantiation. These are immediately eliminated on subsequent rewrites. | Link of Expr ref - override __.ToString() = "Expr(...)" + // Prefer to use the default formatting of this union type + //[] + //member x.DebugText = x.ToString() + // + //override __.ToString() = "Expr(...)" and - [] + [] TOp = /// An operation representing the creation of a union value of the particular union case @@ -4421,7 +4678,7 @@ and | ValFieldGet of RecdFieldRef /// An operation representing getting the address of a record field - | ValFieldGetAddr of RecdFieldRef + | ValFieldGetAddr of RecdFieldRef * readonly: bool /// An operation representing getting an integer tag for a union value representing the union case number | UnionCaseTagGet of TyconRef @@ -4434,7 +4691,7 @@ and | UnionCaseFieldGet of UnionCaseRef * int /// An operation representing a field-get from a union value, where that value has been proven to be of the corresponding union case. - | UnionCaseFieldGetAddr of UnionCaseRef * int + | UnionCaseFieldGetAddr of UnionCaseRef * int * readonly: bool /// An operation representing a field-get from a union value. The value is not assumed to have been proven to be of the corresponding union case. | UnionCaseFieldSet of UnionCaseRef * int @@ -4452,7 +4709,7 @@ and | ILAsm of ILInstr list * TTypes /// Generate a ldflda on an 'a ref. - | RefAddrGet + | RefAddrGet of bool /// Conversion node, compiled via type-directed translation or to box/unbox | Coerce @@ -4486,7 +4743,11 @@ and /// retTy -- the types of pushed values, if any | ILCall of bool * bool * bool * bool * ValUseFlag * bool * bool * ILMethodRef * TypeInst * TypeInst * TTypes - override __.ToString() = "TOp(...)" + // Prefer to use the default formatting of this union type + //[] + //member x.DebugText = x.ToString() + // + //override __.ToString() = "TOp(...)" /// Indicates the kind of record construction operation. and RecordConstructionInfo = @@ -4523,12 +4784,12 @@ and ForLoopStyle = /// Indicates what kind of pointer operation this is. and LValueOperation = /// In C syntax this is: &localv - | LGetAddr + | LAddrOf of readonly: bool /// In C syntax this is: *localv_ptr | LByrefGet - /// In C syntax this is: localv = e , note == *(&localv) = e == LGetAddr; LByrefSet + /// In C syntax this is: localv = e , note == *(&localv) = e == LAddrOf; LByrefSet | LSet /// In C syntax this is: *localv_ptr = e @@ -4572,18 +4833,25 @@ and StaticOptimization = /// A representation of a method in an object expression. /// /// TObjExprMethod(slotsig,attribs,methTyparsOfOverridingMethod,methodParams,methodBodyExpr,m) -and ObjExprMethod = +and + [] + ObjExprMethod = | TObjExprMethod of SlotSig * Attribs * Typars * Val list list * Expr * range member x.Id = let (TObjExprMethod(slotsig,_,_,_,_,m)) = x in mkSynId m slotsig.Name + [] + member x.DebugText = x.ToString() + override x.ToString() = sprintf "TObjExprMethod(%s, ...)" x.Id.idText /// Represents an abstract method slot, or delegate signature. /// /// TSlotSig(methodName,declaringType,declaringTypeParameters,methodTypeParameters,slotParameters,returnTy) -and SlotSig = +and + [] + SlotSig = | TSlotSig of string * TType * Typars * Typars * SlotParam list list * TType option @@ -4599,22 +4867,32 @@ and SlotSig = member ss.FormalReturnType = let (TSlotSig(_,_,_,_,_,rt)) = ss in rt + [] + member x.DebugText = x.ToString() + override ss.ToString() = sprintf "TSlotSig(%s, ...)" ss.Name /// Represents a parameter to an abstract method slot. /// /// TSlotParam(nm,ty,inFlag,outFlag,optionalFlag,attribs) -and SlotParam = +and + [] + SlotParam = | TSlotParam of string option * TType * bool (* in *) * bool (* out *) * bool (* optional *) * Attribs member x.Type = let (TSlotParam(_,ty,_,_,_,_)) = x in ty + [] + member x.DebugText = x.ToString() + override x.ToString() = "TSlotParam(...)" /// A type for a module-or-namespace-fragment and the actual definition of the module-or-namespace-fragment /// The first ModuleOrNamespaceType is the signature and is a binder. However the bindings are not used in the ModuleOrNamespaceExpr: it is only referenced from the 'outside' /// is for use by FCS only to report the "hidden" contents of the assembly prior to applying the signature. -and ModuleOrNamespaceExprWithSig = +and + [] + ModuleOrNamespaceExprWithSig = | ModuleOrNamespaceExprWithSig of ModuleOrNamespaceType * ModuleOrNamespaceExpr @@ -4622,10 +4900,15 @@ and ModuleOrNamespaceExprWithSig = member x.Type = let (ModuleOrNamespaceExprWithSig(mtyp,_,_)) = x in mtyp + [] + member x.DebugText = x.ToString() + override x.ToString() = "ModuleOrNamespaceExprWithSig(...)" /// The contents of a module-or-namespace-fragment definition -and ModuleOrNamespaceExpr = +and + [] + ModuleOrNamespaceExpr = /// Indicates the module is a module with a signature | TMAbstract of ModuleOrNamespaceExprWithSig @@ -4641,10 +4924,14 @@ and ModuleOrNamespaceExpr = /// Indicates the module fragment is a 'rec' or 'non-rec' definition of types and modules | TMDefRec of isRec:bool * Tycon list * ModuleOrNamespaceBinding list * range + [] + member x.DebugText = x.ToString() + override x.ToString() = "ModuleOrNamespaceExpr(...)" /// A named module-or-namespace-fragment definition -and [] +and + [] ModuleOrNamespaceBinding = | Binding of Binding @@ -4656,22 +4943,34 @@ and [] /// This is the body of the module/namespace ModuleOrNamespaceExpr - override x.ToString() = "ModuleOrNamespaceBinding(...)" + [] + member x.DebugText = x.ToString() + override __.ToString() = "ModuleOrNamespaceBinding(...)" /// Represents a complete typechecked implementation file, including its typechecked signature if any. /// /// TImplFile(qualifiedNameOfFile,pragmas,implementationExpressionWithSignature,hasExplicitEntryPoint,isScript) -and TypedImplFile = +and + [] + TypedImplFile = | TImplFile of QualifiedNameOfFile * ScopedPragma list * ModuleOrNamespaceExprWithSig * bool * bool + [] + member x.DebugText = x.ToString() + override x.ToString() = "TImplFile(...)" /// Represents a complete typechecked assembly, made up of multiple implementation files. /// -and TypedAssemblyAfterOptimization = +and + [] + TypedAssemblyAfterOptimization = | TypedAssemblyAfterOptimization of (TypedImplFile * (* optimizeDuringCodeGen: *) (Expr -> Expr)) list + [] + member x.DebugText = x.ToString() + override x.ToString() = "TypedAssemblyAfterOptimization(...)" //--------------------------------------------------------------------------- @@ -4697,7 +4996,9 @@ and FreeUnionCases = Zset /// Represents a set of 'free' type-related elements, including named types, trait solutions, union cases and /// record fields. -and FreeTyvars = +and + [] + FreeTyvars = { /// The summary of locally defined type definitions used in the expression. These may be made private by a signature /// and we have to check various conditions associated with that. FreeTycons: FreeTycons @@ -4709,13 +5010,18 @@ and FreeTyvars = /// and we have to check various conditions associated with that. FreeTypars: FreeTypars } + [] + member x.DebugText = x.ToString() + override x.ToString() = "FreeTyvars(...)" /// Represents an amortized computation of the free variables in an expression and FreeVarsCache = FreeVars cache /// Represents the set of free variables in an expression -and FreeVars = +and + [] + FreeVars = { /// The summary of locally defined variables used in the expression. These may be hidden at let bindings etc. /// or made private by a signature or marked 'internal' or 'private', and we have to check various conditions associated with that. FreeLocals: FreeLocals @@ -4743,13 +5049,17 @@ and FreeVars = /// See FreeTyvars above. FreeTyvars: FreeTyvars } + [] + member x.DebugText = x.ToString() + override x.ToString() = "FreeVars(...)" /// Specifies the compiled representations of type and exception definitions. Basically /// just an ILTypeRef. Computed and cached by later phases. Stored in /// type and exception definitions. Not pickled. Store an optional ILType object for /// non-generic types. -and [] +and + [] CompiledTypeRepr = /// An AbstractIL type representation that is just the name of a type. @@ -4773,6 +5083,9 @@ and [] // type ilsigptr<'T> = (# "!0*" #) | ILAsmOpen of ILType + [] + member x.DebugText = x.ToString() + override x.ToString() = "CompiledTypeRepr(...)" //--------------------------------------------------------------------------- diff --git a/src/fsharp/xlf/FSComp.txt.cs.xlf b/src/fsharp/xlf/FSComp.txt.cs.xlf index dbf10a3bfb..ceb6d658d5 100644 --- a/src/fsharp/xlf/FSComp.txt.cs.xlf +++ b/src/fsharp/xlf/FSComp.txt.cs.xlf @@ -412,11 +412,6 @@ Neočekávané použití proměnné typu ByRef. - - A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' - Hodnota musí být proměnlivá, aby se dal změnit obsah nebo aby se dala převzít adresa typu hodnoty, třeba let mutable x = ... - - Invalid mutation of a constant expression. Consider copying the expression to a mutable local, e.g. 'let mutable x = ...'. Neplatná mutace konstantního výrazu. Zvažte možnost zkopírovat výraz do lokální proměnné, třeba let mutable x = ... @@ -6523,8 +6518,8 @@ - The address of the variable '{0}' cannot be used at this point. A method or function may not return the address of this local value. - Adresa proměnné {0} se na tomto místě nedá použít. Metoda nebo funkce možná nebude vracet adresu této místní hodnoty. + The address of the variable '{0}' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. + Adresa proměnné {0} se na tomto místě nedá použít. Metoda nebo funkce možná nebude vracet adresu této místní hodnoty. @@ -6992,6 +6987,61 @@ Soubor {0} se na disku neočekávaně změnil, opakujte prosím načtení. + + The byref pointer is readonly, so this write is not permitted. + The byref pointer is readonly, so this write is not permitted. + + + + A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + + + + A ReadOnly attribute has been applied to a struct type with a mutable field. + A ReadOnly attribute has been applied to a struct type with a mutable field. + + + + A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + + + + A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + + + + The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + + + + This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + + + + A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + + + + A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + + + + Struct members cannot return the address of fields of the struct by reference + Struct members cannot return the address of fields of the struct by reference + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.de.xlf b/src/fsharp/xlf/FSComp.txt.de.xlf index 2b2f389f8c..957653a606 100644 --- a/src/fsharp/xlf/FSComp.txt.de.xlf +++ b/src/fsharp/xlf/FSComp.txt.de.xlf @@ -412,11 +412,6 @@ Unerwartete Verwendung einer Variablen vom Typ "byref". - - A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' - Ein Wert muss änderbar sein, um die Inhalte eines Werttyps zu mutieren oder seine Adresse zu übernehmen, z.B. "let mutable x = ...". - - Invalid mutation of a constant expression. Consider copying the expression to a mutable local, e.g. 'let mutable x = ...'. Ungültige Mutation eines konstanten Ausdrucks. Kopieren Sie den Ausdruck in eine änderbare lokale Variable, z.B. "let mutable x = ...". @@ -6523,8 +6518,8 @@ - The address of the variable '{0}' cannot be used at this point. A method or function may not return the address of this local value. - Die Adresse der Variablen "{0}" kann an dieser Stelle nicht verwendet werden. Eine Methode oder Funktion gibt ggf. nicht die Adresse dieses lokalen Werts zurück. + The address of the variable '{0}' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. + Die Adresse der Variablen "{0}" kann an dieser Stelle nicht verwendet werden. Eine Methode oder Funktion gibt ggf. nicht die Adresse dieses lokalen Werts zurück. @@ -6992,6 +6987,61 @@ Die Datei "{0}" wurde auf dem Datenträger unerwartet geändert. Laden Sie sie erneut. + + The byref pointer is readonly, so this write is not permitted. + The byref pointer is readonly, so this write is not permitted. + + + + A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + + + + A ReadOnly attribute has been applied to a struct type with a mutable field. + A ReadOnly attribute has been applied to a struct type with a mutable field. + + + + A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + + + + A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + + + + The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + + + + This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + + + + A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + + + + A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + + + + Struct members cannot return the address of fields of the struct by reference + Struct members cannot return the address of fields of the struct by reference + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.en.xlf b/src/fsharp/xlf/FSComp.txt.en.xlf index a6d5886d83..fb84a93857 100644 --- a/src/fsharp/xlf/FSComp.txt.en.xlf +++ b/src/fsharp/xlf/FSComp.txt.en.xlf @@ -412,11 +412,6 @@ Unexpected use of a byref-typed variable - - A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' - A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' - - Invalid mutation of a constant expression. Consider copying the expression to a mutable local, e.g. 'let mutable x = ...'. Invalid mutation of a constant expression. Consider copying the expression to a mutable local, e.g. 'let mutable x = ...'. @@ -6523,8 +6518,8 @@ - The address of the variable '{0}' cannot be used at this point. A method or function may not return the address of this local value. - The address of the variable '{0}' cannot be used at this point. A method or function may not return the address of this local value. + The address of the variable '{0}' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. + The address of the variable '{0}' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. @@ -6992,6 +6987,61 @@ The file '{0}' changed on disk unexpectedly, please reload. + + The byref pointer is readonly, so this write is not permitted. + The byref pointer is readonly, so this write is not permitted. + + + + A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + + + + A ReadOnly attribute has been applied to a struct type with a mutable field. + A ReadOnly attribute has been applied to a struct type with a mutable field. + + + + A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + + + + A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + + + + The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + + + + This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + + + + A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + + + + A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + + + + Struct members cannot return the address of fields of the struct by reference + Struct members cannot return the address of fields of the struct by reference + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.es.xlf b/src/fsharp/xlf/FSComp.txt.es.xlf index 8b9e946075..8187e6b689 100644 --- a/src/fsharp/xlf/FSComp.txt.es.xlf +++ b/src/fsharp/xlf/FSComp.txt.es.xlf @@ -412,11 +412,6 @@ Uso inesperado de una variable de tipo byref. - - A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' - Un valor debe ser mutable para poder mutar el contenido o tomar la dirección de un tipo de valor; por ejemplo, 'let mutable x = ...' - - Invalid mutation of a constant expression. Consider copying the expression to a mutable local, e.g. 'let mutable x = ...'. Mutación no válida de una expresión constante. Considere copiar la expresión en un local mutable; por ejemplo, 'let mutable x = ...'. @@ -6523,8 +6518,8 @@ - The address of the variable '{0}' cannot be used at this point. A method or function may not return the address of this local value. - La dirección de la variable '{0}' no se puede usar en este punto. Puede que el método o la función no devuelvan la dirección de este valor local. + The address of the variable '{0}' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. + La dirección de la variable '{0}' no se puede usar en este punto. Puede que el método o la función no devuelvan la dirección de este valor local. @@ -6992,6 +6987,61 @@ El archivo "{0}" cambió en el disco de manera inesperada; cárguelo de nuevo. + + The byref pointer is readonly, so this write is not permitted. + The byref pointer is readonly, so this write is not permitted. + + + + A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + + + + A ReadOnly attribute has been applied to a struct type with a mutable field. + A ReadOnly attribute has been applied to a struct type with a mutable field. + + + + A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + + + + A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + + + + The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + + + + This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + + + + A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + + + + A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + + + + Struct members cannot return the address of fields of the struct by reference + Struct members cannot return the address of fields of the struct by reference + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.fr.xlf b/src/fsharp/xlf/FSComp.txt.fr.xlf index 02c238295c..7596000991 100644 --- a/src/fsharp/xlf/FSComp.txt.fr.xlf +++ b/src/fsharp/xlf/FSComp.txt.fr.xlf @@ -412,11 +412,6 @@ Utilisation inattendue d'une variable typée byref - - A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' - Une valeur doit être mutable pour pouvoir muter le contenu ou accepter l'adresse d'un type valeur, par exemple 'let mutable x = ...' - - Invalid mutation of a constant expression. Consider copying the expression to a mutable local, e.g. 'let mutable x = ...'. Mutation non valide d'une expression constante. Copiez l'expression dans une variable locale mutable, par exemple 'let mutable x = ...'. @@ -6523,8 +6518,8 @@ - The address of the variable '{0}' cannot be used at this point. A method or function may not return the address of this local value. - Impossible d'utiliser l'adresse de la variable '{0}'. Une méthode ou une fonction ne doit pas retourner l'adresse de cette valeur locale. + The address of the variable '{0}' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. + Impossible d'utiliser l'adresse de la variable '{0}'. Une méthode ou une fonction ne doit pas retourner l'adresse de cette valeur locale. @@ -6992,6 +6987,61 @@ Changement inattendu du fichier '{0}' sur le disque. Rechargez le fichier. + + The byref pointer is readonly, so this write is not permitted. + The byref pointer is readonly, so this write is not permitted. + + + + A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + + + + A ReadOnly attribute has been applied to a struct type with a mutable field. + A ReadOnly attribute has been applied to a struct type with a mutable field. + + + + A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + + + + A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + + + + The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + + + + This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + + + + A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + + + + A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + + + + Struct members cannot return the address of fields of the struct by reference + Struct members cannot return the address of fields of the struct by reference + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.it.xlf b/src/fsharp/xlf/FSComp.txt.it.xlf index 5234a47fed..220d7a72a9 100644 --- a/src/fsharp/xlf/FSComp.txt.it.xlf +++ b/src/fsharp/xlf/FSComp.txt.it.xlf @@ -412,11 +412,6 @@ Utilizzo non previsto di una variabile di tipo byref - - A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' - Un valore deve essere modificabile per poter modificare i contenuti oppure utilizzare l'indirizzo di un tipo di valore, ad esempio 'let mutable x = ...' - - Invalid mutation of a constant expression. Consider copying the expression to a mutable local, e.g. 'let mutable x = ...'. Modifica non valida di un'espressione costante. Provare a copiare l'espressione in un locale modificabile, ad esempio 'let mutable x = ...'. @@ -6523,8 +6518,8 @@ - The address of the variable '{0}' cannot be used at this point. A method or function may not return the address of this local value. - In questo punto non è possibile usare l'indirizzo della variabile '{0}'. Un metodo o una funzione potrebbero non restituire l'indirizzo di questo valore di variabile locale. + The address of the variable '{0}' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. + In questo punto non è possibile usare l'indirizzo della variabile '{0}'. Un metodo o una funzione potrebbero non restituire l'indirizzo di questo valore di variabile locale. @@ -6992,6 +6987,61 @@ Il file '{0}' è stato modificato su disco in modo imprevisto. Ricaricare. + + The byref pointer is readonly, so this write is not permitted. + The byref pointer is readonly, so this write is not permitted. + + + + A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + + + + A ReadOnly attribute has been applied to a struct type with a mutable field. + A ReadOnly attribute has been applied to a struct type with a mutable field. + + + + A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + + + + A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + + + + The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + + + + This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + + + + A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + + + + A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + + + + Struct members cannot return the address of fields of the struct by reference + Struct members cannot return the address of fields of the struct by reference + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.ja.xlf b/src/fsharp/xlf/FSComp.txt.ja.xlf index f2897a4d7b..20af7a1608 100644 --- a/src/fsharp/xlf/FSComp.txt.ja.xlf +++ b/src/fsharp/xlf/FSComp.txt.ja.xlf @@ -412,11 +412,6 @@ byref 型変数の予期しない使用方法です: - - A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' - 値の型の内容を変更するか、値の型のアドレスを使用するために、値は変更可能にする必要があります (たとえば、'let mutable x = ...') - - Invalid mutation of a constant expression. Consider copying the expression to a mutable local, e.g. 'let mutable x = ...'. 定数式の変更は無効です。変更可能なローカルに式をコピーしてください (たとえば、'let mutable x = ...')。 @@ -6523,8 +6518,8 @@ - The address of the variable '{0}' cannot be used at this point. A method or function may not return the address of this local value. - 変数 '{0}' のアドレスはこのポイントでは使用できません。メソッドまたは関数がこのローカル値のアドレスを返さない可能性があります。 + The address of the variable '{0}' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. + 変数 '{0}' のアドレスはこのポイントでは使用できません。メソッドまたは関数がこのローカル値のアドレスを返さない可能性があります。 @@ -6992,6 +6987,61 @@ ファイル '{0}' がディスク上で予期せず変更されました。再度読み込んでください。 + + The byref pointer is readonly, so this write is not permitted. + The byref pointer is readonly, so this write is not permitted. + + + + A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + + + + A ReadOnly attribute has been applied to a struct type with a mutable field. + A ReadOnly attribute has been applied to a struct type with a mutable field. + + + + A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + + + + A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + + + + The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + + + + This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + + + + A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + + + + A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + + + + Struct members cannot return the address of fields of the struct by reference + Struct members cannot return the address of fields of the struct by reference + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.ko.xlf b/src/fsharp/xlf/FSComp.txt.ko.xlf index d13f1ff608..5b84f48e06 100644 --- a/src/fsharp/xlf/FSComp.txt.ko.xlf +++ b/src/fsharp/xlf/FSComp.txt.ko.xlf @@ -412,11 +412,6 @@ 예기치 않은 byref 형식 변수의 사용입니다. - - A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' - 내용을 변경하거나 값 형식의 주소를 사용하려면 값을 변경할 수 있어야 합니다(예: 'let mutable x = ...'). - - Invalid mutation of a constant expression. Consider copying the expression to a mutable local, e.g. 'let mutable x = ...'. 상수 식을 잘못 변경했습니다. 식을 변경할 수 있는 로컬로 복사하십시오(예: 'let mutable x = ...'). @@ -6523,8 +6518,8 @@ - The address of the variable '{0}' cannot be used at this point. A method or function may not return the address of this local value. - 지금은 '{0}' 변수의 주소를 사용할 수 없습니다. 메서드 또는 함수가 이 로컬 값의 주소를 반환할 수 없습니다. + The address of the variable '{0}' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. + 지금은 '{0}' 변수의 주소를 사용할 수 없습니다. 메서드 또는 함수가 이 로컬 값의 주소를 반환할 수 없습니다. @@ -6992,6 +6987,61 @@ '{0}' 파일이 디스크에서 예기치 않게 변경되었습니다. 다시 로드하세요. + + The byref pointer is readonly, so this write is not permitted. + The byref pointer is readonly, so this write is not permitted. + + + + A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + + + + A ReadOnly attribute has been applied to a struct type with a mutable field. + A ReadOnly attribute has been applied to a struct type with a mutable field. + + + + A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + + + + A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + + + + The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + + + + This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + + + + A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + + + + A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + + + + Struct members cannot return the address of fields of the struct by reference + Struct members cannot return the address of fields of the struct by reference + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.pl.xlf b/src/fsharp/xlf/FSComp.txt.pl.xlf index 7815511799..7b58742f3e 100644 --- a/src/fsharp/xlf/FSComp.txt.pl.xlf +++ b/src/fsharp/xlf/FSComp.txt.pl.xlf @@ -412,11 +412,6 @@ Nieoczekiwane użycie zmiennej typu byref - - A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' - Aby można było zmodyfikować zawartość lub pobrać adres typu wartości, wartość musi być modyfikowalna, na przykład „let mutable x = ...” - - Invalid mutation of a constant expression. Consider copying the expression to a mutable local, e.g. 'let mutable x = ...'. Nieprawidłowa mutacja wyrażenia stałej. Rozważ skopiowanie wyrażenia do modyfikowalnej wartości lokalnej, na przykład „let mutable x = ...”. @@ -6523,8 +6518,8 @@ - The address of the variable '{0}' cannot be used at this point. A method or function may not return the address of this local value. - Adres zmiennej „{0}” nie może być użyty w tym punkcie. Metoda lub funkcja może nie zwrócić adresu tej wartości lokalnej. + The address of the variable '{0}' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. + Adres zmiennej „{0}” nie może być użyty w tym punkcie. Metoda lub funkcja może nie zwrócić adresu tej wartości lokalnej. @@ -6992,6 +6987,61 @@ Plik „{0}” nieoczekiwanie uległ zmianie na dysku. Załaduj go ponownie. + + The byref pointer is readonly, so this write is not permitted. + The byref pointer is readonly, so this write is not permitted. + + + + A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + + + + A ReadOnly attribute has been applied to a struct type with a mutable field. + A ReadOnly attribute has been applied to a struct type with a mutable field. + + + + A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + + + + A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + + + + The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + + + + This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + + + + A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + + + + A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + + + + Struct members cannot return the address of fields of the struct by reference + Struct members cannot return the address of fields of the struct by reference + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf index 6098e8f232..a7f4e1c252 100644 --- a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf +++ b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf @@ -412,11 +412,6 @@ Uso inesperado de uma variável do tipo byref - - A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' - Um valor deve ser mutável para que seja possível mudar o conteúdo ou pegar o endereço de um tipo de valor, por exemplo: 'let mutable x = ...' - - Invalid mutation of a constant expression. Consider copying the expression to a mutable local, e.g. 'let mutable x = ...'. Mutação inválida de uma expressão constante. Considere copiar a expressão para um local mutável, por exemplo: 'let mutable x = ...'. @@ -6523,8 +6518,8 @@ - The address of the variable '{0}' cannot be used at this point. A method or function may not return the address of this local value. - O endereço da variável '{0}' não pode ser usado neste momento. Um método ou uma função pode não retornar o endereço deste valor local. + The address of the variable '{0}' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. + O endereço da variável '{0}' não pode ser usado neste momento. Um método ou uma função pode não retornar o endereço deste valor local. @@ -6992,6 +6987,61 @@ O arquivo '{0}' foi alterado no disco inesperadamente. Recarregue-o. + + The byref pointer is readonly, so this write is not permitted. + The byref pointer is readonly, so this write is not permitted. + + + + A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + + + + A ReadOnly attribute has been applied to a struct type with a mutable field. + A ReadOnly attribute has been applied to a struct type with a mutable field. + + + + A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + + + + A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + + + + The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + + + + This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + + + + A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + + + + A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + + + + Struct members cannot return the address of fields of the struct by reference + Struct members cannot return the address of fields of the struct by reference + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.ru.xlf b/src/fsharp/xlf/FSComp.txt.ru.xlf index 5ea6fd8115..d8cbe9424c 100644 --- a/src/fsharp/xlf/FSComp.txt.ru.xlf +++ b/src/fsharp/xlf/FSComp.txt.ru.xlf @@ -412,11 +412,6 @@ Недопустимое использование переменной типа byref - - A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' - Чтобы изменить содержимое или получить адрес типа значения, значение должно быть изменяемым, например, "let mutable x = ..." - - Invalid mutation of a constant expression. Consider copying the expression to a mutable local, e.g. 'let mutable x = ...'. Недопустимое изменение константного выражения. Рекомендуется скопировать выражение в изменяемую локальную переменную, например, "let mutable x = ...". @@ -6523,8 +6518,8 @@ - The address of the variable '{0}' cannot be used at this point. A method or function may not return the address of this local value. - Адрес переменной "{0}" сейчас невозможно использовать. Метод или функция могут не возвратить адрес этого локального значения. + The address of the variable '{0}' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. + Адрес переменной "{0}" сейчас невозможно использовать. Метод или функция могут не возвратить адрес этого локального значения. @@ -6992,6 +6987,61 @@ Файл "{0}" был неожиданно изменен на диске, повторите загрузку. + + The byref pointer is readonly, so this write is not permitted. + The byref pointer is readonly, so this write is not permitted. + + + + A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + + + + A ReadOnly attribute has been applied to a struct type with a mutable field. + A ReadOnly attribute has been applied to a struct type with a mutable field. + + + + A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + + + + A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + + + + The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + + + + This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + + + + A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + + + + A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + + + + Struct members cannot return the address of fields of the struct by reference + Struct members cannot return the address of fields of the struct by reference + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.tr.xlf b/src/fsharp/xlf/FSComp.txt.tr.xlf index e83e67cdae..211cead74d 100644 --- a/src/fsharp/xlf/FSComp.txt.tr.xlf +++ b/src/fsharp/xlf/FSComp.txt.tr.xlf @@ -412,11 +412,6 @@ Beklenmeyen byref olarak belirtilmiş değişken kullanımı - - A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' - İçeriği değiştirmek veya değer türünün adresini almak için bir değerin değiştirilebilir olması gerekir, örn. 'let mutable x = ...' - - Invalid mutation of a constant expression. Consider copying the expression to a mutable local, e.g. 'let mutable x = ...'. Sabit ifadesinin geçersiz olarak değiştirilmesi. İfadeyi değiştirilebilir bir yerel değere kopyalamayı düşünün, örn. 'let mutable x = ...'. @@ -6523,8 +6518,8 @@ - The address of the variable '{0}' cannot be used at this point. A method or function may not return the address of this local value. - '{0}' değişkeninin adresi bu noktada kullanılamaz. Bir metot veya işlev, bu yerel değerin adresini döndüremez. + The address of the variable '{0}' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. + '{0}' değişkeninin adresi bu noktada kullanılamaz. Bir metot veya işlev, bu yerel değerin adresini döndüremez. @@ -6992,6 +6987,61 @@ Diskte '{0}' dosyası beklenmedik şekilde değiştirildi. Lütfen yeniden yükleyin. + + The byref pointer is readonly, so this write is not permitted. + The byref pointer is readonly, so this write is not permitted. + + + + A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + + + + A ReadOnly attribute has been applied to a struct type with a mutable field. + A ReadOnly attribute has been applied to a struct type with a mutable field. + + + + A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + + + + A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + + + + The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + + + + This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + + + + A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + + + + A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + + + + Struct members cannot return the address of fields of the struct by reference + Struct members cannot return the address of fields of the struct by reference + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf index 51c322df89..f61822ca96 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf @@ -412,11 +412,6 @@ 对 byref 类型化变量的意外使用 - - A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' - 值必须是可变的,以便更改内容或采用值类型的地址,例如“let mutable x = ...” - - Invalid mutation of a constant expression. Consider copying the expression to a mutable local, e.g. 'let mutable x = ...'. 常数表达式的变化无效。请考虑将该表达式复制一个可变的本地变量,例如“let mutable x = ...”。 @@ -6523,8 +6518,8 @@ - The address of the variable '{0}' cannot be used at this point. A method or function may not return the address of this local value. - 当前无法使用变量 {0} 的地址。方法或函数可能没有返回该本地值的地址。 + The address of the variable '{0}' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. + 当前无法使用变量 {0} 的地址。方法或函数可能没有返回该本地值的地址。 @@ -6992,6 +6987,61 @@ 文件“{0}”在磁盘上意外更改,请重新加载。 + + The byref pointer is readonly, so this write is not permitted. + The byref pointer is readonly, so this write is not permitted. + + + + A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + + + + A ReadOnly attribute has been applied to a struct type with a mutable field. + A ReadOnly attribute has been applied to a struct type with a mutable field. + + + + A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + + + + A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + + + + The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + + + + This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + + + + A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + + + + A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + + + + Struct members cannot return the address of fields of the struct by reference + Struct members cannot return the address of fields of the struct by reference + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf index a3db27ef51..e6f85883d1 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf @@ -412,11 +412,6 @@ 未預期的 ByRef 類型變數用法 - - A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' - 值必須是可變動的,才能變動內容或接受實值類型的位址,例如 'let mutable x = ...' - - Invalid mutation of a constant expression. Consider copying the expression to a mutable local, e.g. 'let mutable x = ...'. 常數運算式無效的變動。請考慮將運算式複製到可變動的區域變數,例如 'let mutable x = ...'。 @@ -6523,8 +6518,8 @@ - The address of the variable '{0}' cannot be used at this point. A method or function may not return the address of this local value. - 目前無法使用變數 '{0}' 的位址。方法或函式無法傳回此本機值的位址。 + The address of the variable '{0}' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. + 目前無法使用變數 '{0}' 的位址。方法或函式無法傳回此本機值的位址。 @@ -6992,6 +6987,61 @@ 檔案 '{0}' 在磁碟上意外變更,請重新載入。 + + The byref pointer is readonly, so this write is not permitted. + The byref pointer is readonly, so this write is not permitted. + + + + A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + + + + A ReadOnly attribute has been applied to a struct type with a mutable field. + A ReadOnly attribute has been applied to a struct type with a mutable field. + + + + A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + + + + A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + + + + The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + + + + This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + + + + A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + + + + A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + + + + Struct members cannot return the address of fields of the struct by reference + Struct members cannot return the address of fields of the struct by reference + + \ No newline at end of file diff --git a/src/scripts/scriptlib.fsx b/src/scripts/scriptlib.fsx index 79481efb7c..6835b9418f 100644 --- a/src/scripts/scriptlib.fsx +++ b/src/scripts/scriptlib.fsx @@ -7,6 +7,7 @@ namespace global open System open System.IO +open System.Text open System.Diagnostics [] @@ -117,15 +118,23 @@ module Scripting = let p = new Process() p.EnableRaisingEvents <- true p.StartInfo <- processInfo + let out = StringBuilder() + let err = StringBuilder() cmdArgs.RedirectOutput|> Option.iter (fun f -> processInfo.RedirectStandardOutput <- true - p.OutputDataReceived.Add (fun ea -> if ea.Data <> null then f ea.Data) + p.OutputDataReceived.Add (fun ea -> + if ea.Data <> null then + out.Append(ea.Data + Environment.NewLine) |> ignore + f ea.Data) ) cmdArgs.RedirectError |> Option.iter (fun f -> processInfo.RedirectStandardError <- true - p.ErrorDataReceived.Add (fun ea -> if ea.Data <> null then f ea.Data) + p.ErrorDataReceived.Add (fun ea -> + if ea.Data <> null then + err.Append(ea.Data + Environment.NewLine) |> ignore + f ea.Data) ) cmdArgs.RedirectInput @@ -151,7 +160,7 @@ module Scripting = match p.ExitCode with | 0 -> Success | err -> - let msg = sprintf "Error running command '%s' with args '%s' in directory '%s'" exePath arguments workDir + let msg = sprintf "Error running command '%s' with args '%s' in directory '%s'.\n---- stdout below --- \n%s\n---- stderr below --- \n%s " exePath arguments workDir (out.ToString()) (err.ToString()) ErrorLevel (msg, err) type OutPipe (writer: TextWriter) = diff --git a/tests/FSharp.Core.UnitTests/SurfaceArea.coreclr.fs b/tests/FSharp.Core.UnitTests/SurfaceArea.coreclr.fs index 11dbf82716..8881326be0 100644 --- a/tests/FSharp.Core.UnitTests/SurfaceArea.coreclr.fs +++ b/tests/FSharp.Core.UnitTests/SurfaceArea.coreclr.fs @@ -797,6 +797,20 @@ Microsoft.FSharp.Core.AutoSerializableAttribute: Int32 GetHashCode() Microsoft.FSharp.Core.AutoSerializableAttribute: System.String ToString() Microsoft.FSharp.Core.AutoSerializableAttribute: System.Type GetType() Microsoft.FSharp.Core.AutoSerializableAttribute: Void .ctor(Boolean) +Microsoft.FSharp.Core.ByRefKinds+In: Boolean Equals(System.Object) +Microsoft.FSharp.Core.ByRefKinds+In: Int32 GetHashCode() +Microsoft.FSharp.Core.ByRefKinds+In: System.String ToString() +Microsoft.FSharp.Core.ByRefKinds+In: System.Type GetType() +Microsoft.FSharp.Core.ByRefKinds+Out: Boolean Equals(System.Object) +Microsoft.FSharp.Core.ByRefKinds+Out: Int32 GetHashCode() +Microsoft.FSharp.Core.ByRefKinds+Out: System.String ToString() +Microsoft.FSharp.Core.ByRefKinds+Out: System.Type GetType() +Microsoft.FSharp.Core.ByRefKinds: Boolean Equals(System.Object) +Microsoft.FSharp.Core.ByRefKinds: Int32 GetHashCode() +Microsoft.FSharp.Core.ByRefKinds: Microsoft.FSharp.Core.ByRefKinds+In +Microsoft.FSharp.Core.ByRefKinds: Microsoft.FSharp.Core.ByRefKinds+Out +Microsoft.FSharp.Core.ByRefKinds: System.String ToString() +Microsoft.FSharp.Core.ByRefKinds: System.Type GetType() Microsoft.FSharp.Core.CLIEventAttribute: Boolean Equals(System.Object) Microsoft.FSharp.Core.CLIEventAttribute: Boolean Match(System.Object) Microsoft.FSharp.Core.CLIEventAttribute: Int32 GetHashCode() @@ -3208,6 +3222,8 @@ Microsoft.FSharp.NativeInterop.NativePtrModule: T GetPointerInlined[T](IntPtr, I Microsoft.FSharp.NativeInterop.NativePtrModule: T ReadPointerInlined[T](IntPtr) Microsoft.FSharp.NativeInterop.NativePtrModule: Void SetPointerInlined[T](IntPtr, Int32, T) Microsoft.FSharp.NativeInterop.NativePtrModule: Void WritePointerInlined[T](IntPtr, T) +Microsoft.FSharp.NativeInterop.NativePtrModule: IntPtr OfVoidPtrInlined[T](Void*) +Microsoft.FSharp.NativeInterop.NativePtrModule: Void* ToVoidPtrInlined[T](IntPtr) Microsoft.FSharp.Quotations.DerivedPatternsModule: Boolean Equals(System.Object) Microsoft.FSharp.Quotations.DerivedPatternsModule: Int32 GetHashCode() Microsoft.FSharp.Quotations.DerivedPatternsModule: Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Quotations.FSharpExpr,Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`3[Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Quotations.FSharpExpr],Microsoft.FSharp.Collections.FSharpList`1[System.Type],Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpExpr]]]] SpecificCallPattern(Microsoft.FSharp.Quotations.FSharpExpr) diff --git a/tests/FSharp.Core.UnitTests/SurfaceArea.net40.fs b/tests/FSharp.Core.UnitTests/SurfaceArea.net40.fs index 2071364450..82f5487988 100644 --- a/tests/FSharp.Core.UnitTests/SurfaceArea.net40.fs +++ b/tests/FSharp.Core.UnitTests/SurfaceArea.net40.fs @@ -801,6 +801,20 @@ Microsoft.FSharp.Core.AutoSerializableAttribute: System.Object get_TypeId() Microsoft.FSharp.Core.AutoSerializableAttribute: System.String ToString() Microsoft.FSharp.Core.AutoSerializableAttribute: System.Type GetType() Microsoft.FSharp.Core.AutoSerializableAttribute: Void .ctor(Boolean) +Microsoft.FSharp.Core.ByRefKinds+In: Boolean Equals(System.Object) +Microsoft.FSharp.Core.ByRefKinds+In: Int32 GetHashCode() +Microsoft.FSharp.Core.ByRefKinds+In: System.String ToString() +Microsoft.FSharp.Core.ByRefKinds+In: System.Type GetType() +Microsoft.FSharp.Core.ByRefKinds+Out: Boolean Equals(System.Object) +Microsoft.FSharp.Core.ByRefKinds+Out: Int32 GetHashCode() +Microsoft.FSharp.Core.ByRefKinds+Out: System.String ToString() +Microsoft.FSharp.Core.ByRefKinds+Out: System.Type GetType() +Microsoft.FSharp.Core.ByRefKinds: Boolean Equals(System.Object) +Microsoft.FSharp.Core.ByRefKinds: Int32 GetHashCode() +Microsoft.FSharp.Core.ByRefKinds: Microsoft.FSharp.Core.ByRefKinds+In +Microsoft.FSharp.Core.ByRefKinds: Microsoft.FSharp.Core.ByRefKinds+Out +Microsoft.FSharp.Core.ByRefKinds: System.String ToString() +Microsoft.FSharp.Core.ByRefKinds: System.Type GetType() Microsoft.FSharp.Core.CLIEventAttribute: Boolean Equals(System.Object) Microsoft.FSharp.Core.CLIEventAttribute: Boolean IsDefaultAttribute() Microsoft.FSharp.Core.CLIEventAttribute: Boolean Match(System.Object) @@ -3355,6 +3369,8 @@ Microsoft.FSharp.NativeInterop.NativePtrModule: T GetPointerInlined[T](IntPtr, I Microsoft.FSharp.NativeInterop.NativePtrModule: T ReadPointerInlined[T](IntPtr) Microsoft.FSharp.NativeInterop.NativePtrModule: Void SetPointerInlined[T](IntPtr, Int32, T) Microsoft.FSharp.NativeInterop.NativePtrModule: Void WritePointerInlined[T](IntPtr, T) +Microsoft.FSharp.NativeInterop.NativePtrModule: IntPtr OfVoidPtrInlined[T](Void*) +Microsoft.FSharp.NativeInterop.NativePtrModule: Void* ToVoidPtrInlined[T](IntPtr) Microsoft.FSharp.Quotations.DerivedPatternsModule: Boolean Equals(System.Object) Microsoft.FSharp.Quotations.DerivedPatternsModule: Int32 GetHashCode() Microsoft.FSharp.Quotations.DerivedPatternsModule: Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Quotations.FSharpExpr,Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`3[Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Quotations.FSharpExpr],Microsoft.FSharp.Collections.FSharpList`1[System.Type],Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpExpr]]]] SpecificCallPattern(Microsoft.FSharp.Quotations.FSharpExpr) diff --git a/tests/fsharp/core/byrefs/test.fsx b/tests/fsharp/core/byrefs/test.fsx index 6c4f3d960b..21416333c1 100644 --- a/tests/fsharp/core/byrefs/test.fsx +++ b/tests/fsharp/core/byrefs/test.fsx @@ -1,9 +1,9 @@ // #Conformance #Constants #Recursion #LetBindings #MemberDefinitions #Mutable #if TESTS_AS_APP -module Core_apporder +module Core_byrefs #endif -#light + let failures = ref false let report_failure (s) = stderr.WriteLine ("NO: " + s); failures := true @@ -19,6 +19,316 @@ let check s actual expected = let check2 s expected actual = check s actual expected +// Test a simple ref argument +module CompareExchangeTests = + let mutable x = 3 + let v = System.Threading.Interlocked.CompareExchange(&x, 4, 3) + check "cweweoiwekla" v 3 + let v2 = System.Threading.Interlocked.CompareExchange(&x, 5, 3) + check "cweweoiweklb" v2 4 + +// Test a simple out argument +module TryGetValueTests = + let d = dict [ (3,4) ] + let mutable res = 9 + let v = d.TryGetValue(3, &res) + check "cweweoiwekl1" v true + check "cweweoiwekl2" res 4 + let v2 = d.TryGetValue(5, &res) + check "cweweoiwekl3" v2 false + check "cweweoiwekl4" res 4 + + +module ByRefParam = + type C() = + static member M(x: byref) = x <- 5 + let mutable res = 9 + let v = C.M(&res) + check "cwvereweoiwekl4" res 5 + + let minfo = typeof.GetMethod("M") + check "cwnoreeker1" (minfo.GetParameters().[0].IsIn) false + check "cwnoreeker2" (minfo.GetParameters().[0].IsOut) false + check "cwnoreeker3" (minfo.ReturnParameter.IsIn) false + check "cwnoreeker4" (minfo.ReturnParameter.IsOut) false + +module ByRefParam_ExplicitOutAttribute = + type C() = + static member M([] x: byref) = x <- 5 + let mutable res = 9 + let v = C.M(&res) + check "cwvereweoiwekl4" res 5 + + let minfo = typeof.GetMethod("M") + check "cwnoreeker5" (minfo.GetParameters().[0].IsIn) false + check "cwnoreeker6a" (minfo.GetParameters().[0].IsOut) true + check "cwnoreeker6b" (minfo.GetParameters().[0].GetRequiredCustomModifiers().Length) 0 + check "cwnoreekers1" (minfo.ReturnParameter.GetRequiredCustomModifiers().Length) 0 + check "cwnoreeker7" (minfo.ReturnParameter.IsIn) false + check "cwnoreeker8" (minfo.ReturnParameter.IsOut) false + +module ByRefParam_ExplicitInAttribute = + type C() = + static member M([] x: byref) = x <- 5 + let mutable res = 9 + let v = C.M(&res) + check "cwvereweoiwekl4" res 5 + + let minfo = typeof.GetMethod("M") + check "cwnoreeker9" (minfo.GetParameters().[0].IsIn) true + check "cwnoreekerq" (minfo.GetParameters().[0].IsOut) false + check "cwnoreeker6c" (minfo.GetParameters().[0].GetRequiredCustomModifiers().Length) 0 + check "cwnoreekers2" (minfo.ReturnParameter.GetRequiredCustomModifiers().Length) 0 + check "cwnoreekerw" (minfo.ReturnParameter.IsIn) false + check "cwnoreekere" (minfo.ReturnParameter.IsOut) false + +module ByRefReturn = + type C() = + static member M(x: byref) = x <- x + 1; &x + let mutable res = 9 + let v = C.M(&res) + check "cwvereweoiwvw4" v 10 + + let minfo = typeof.GetMethod("M") + check "cwnoreeker6d" (minfo.GetParameters().[0].GetRequiredCustomModifiers().Length) 0 + check "cwnoreekerr" (minfo.ReturnParameter.IsIn) false + check "cwnoreekert" (minfo.ReturnParameter.IsOut) false + + +module Slot_ByRefReturn = + type I = + abstract M : x: byref -> byref + type C() = + interface I with + member __.M(x: byref) = x <- 5; &x + let mutable res = 9 + let v = (C() :> I).M(&res) + check "cweweoiwek28989" res 5 + check "cweweoiwek28989" v 5 + + let minfo = typeof.GetMethod("M") + check "cwnoreeker6e" (minfo.GetParameters().[0].GetRequiredCustomModifiers().Length) 0 + check "cwnoreekery" (minfo.GetParameters().[0].IsIn) false + check "cwnoreekeru" (minfo.GetParameters().[0].IsOut) false + check "cwnoreekeri" (minfo.ReturnParameter.IsIn) false + check "cwnoreekers" (minfo.ReturnParameter.GetRequiredCustomModifiers().Length) 0 + check "cwnoreekero" (minfo.ReturnParameter.IsOut) false + +module InRefReturn = + type C() = + static member M(x: inref) = &x + let mutable res = 9 + let v = C.M(&res) + check "cwvereweoiwvw4" v 9 + + let minfo = typeof.GetMethod("M") + check "cwnoreekerp" (minfo.GetParameters().[0].IsIn) true + check "cwnoreekera" (minfo.GetParameters().[0].IsOut) false + check "cwnoreeker6f" (minfo.GetParameters().[0].GetRequiredCustomModifiers().Length) 0 // modreq only placed on abstract/virtual + check "cwnoreekers3" (minfo.ReturnParameter.IsIn) false // has modreq 'In' but reflection never returns true for ReturnParameter.IsIn + check "cwnoreekers4" (minfo.ReturnParameter.GetRequiredCustomModifiers().Length) 1 + check "cwnoreekerd" (minfo.ReturnParameter.IsOut) false + +module Slot_InRefReturn = + type I = + abstract M : x: inref -> inref + type C() = + interface I with + member __.M(x: inref) = &x + let mutable res = 9 + let v = (C() :> I).M(&res) + check "cweweoiwek28989" res 9 + check "cweweoiwek28989" v 9 + + let minfo = typeof.GetMethod("M") + check "cwnoreekerp" (minfo.GetParameters().[0].IsIn) true + check "cwnoreekera" (minfo.GetParameters().[0].IsOut) false + check "cwnoreeker6g" (minfo.GetParameters().[0].GetRequiredCustomModifiers().Length) 1 + check "cwnoreekers5" (minfo.ReturnParameter.IsIn) false // has modreq 'In' but reflection never returns true for ReturnParameter.IsIn + check "cwnoreekers6" (minfo.ReturnParameter.GetRequiredCustomModifiers().Length) 1 + check "cwnoreekerd" (minfo.ReturnParameter.IsOut) false + + +module OutRefParam_ExplicitOutAttribute = + type C() = + static member M([] x: outref) = x <- 5 + let mutable res = 9 + C.M(&res) + check "cweweoiweklceew4" res 5 + +module OutRefParam = + type C() = + static member M(x: outref) = x <- 5 + let mutable res = 9 + C.M(&res) + check "cweweoiwek28989" res 5 + +module Slot_OutRefParam = + type I = + abstract M : x: outref -> unit + type C() = + interface I with + member __.M(x: outref) = x <- 5 + let mutable res = 9 + (C() :> I).M(&res) + check "cweweoiwek28989" res 5 + +module ByRefParam_OverloadedTest_ExplicitOutAttribute = + type C() = + static member M(a: int, [] x: byref) = x <- 7 + static member M(a: string, [] x: byref) = x <- 8 + let mutable res = 9 + C.M("a", &res) + check "cweweoiwek2cbe9" res 8 + C.M(3, &res) + check "cweweoiwek28498" res 7 + +module OutRefParam_Overloaded_ExplicitOutAttribute = + type C() = + static member M(a: int, [] x: outref) = x <- 7 + static member M(a: string, [] x: outref) = x <- 8 + let mutable res = 9 + C.M("a", &res) + check "cweweoiwek2v90" res 8 + C.M(3, &res) + check "cweweoiwek2c98" res 7 + +module OutRefParam_Overloaded = + type C() = + static member M(a: int, x: outref) = x <- 7 + static member M(a: string, x: outref) = x <- 8 + let mutable res = 9 + C.M("a", &res) + check "cweweoiwek2v99323" res 8 + C.M(3, &res) + check "cweweoiwe519" res 7 + +module InRefParam_ExplicitInAttribute = + type C() = + static member M([] x: inref) = () + let mutable res = 9 + C.M(&res) + check "cweweoiwe519btr" res 9 + +module InRefParam_ExplicitInAttributeDateTime = + type C() = + static member M([] x: inref) = x + let Test() = + let res = System.DateTime.Now + let v = C.M(&res) + check "cweweoiwe519cw" v res + Test() + +module InRefParam = + type C() = + static member M(x: inref) = x + let Test() = + let res = System.DateTime.Now + let v = C.M(&res) + check "cweweoiwe51btw" v res + + let minfo = typeof.GetMethod("M") + check "cwnoreekerf" (minfo.GetParameters().[0].IsIn) true + check "cwnoreekerg" (minfo.GetParameters().[0].IsOut) false + Test() + +module InRefParamOverload_ExplicitAddressOfAtCallSite = + type C() = + static member M(x: System.DateTime) = x.AddDays(1.0) + static member M(x: inref) = x.AddDays(2.0) + static member M2(x: System.DateTime, y: int) = x.AddDays(1.0) + static member M2(x: inref, y: int) = x.AddDays(2.0) + + let Test() = + let res = System.DateTime.Now + let v = C.M(&res) + check "cweweoiwe51btw8" v (res.AddDays(2.0)) + let v2 = C.M2(&res, 0) + check "cweweoiwe51btw6" v2 (res.AddDays(2.0)) + + Test() + +module InRefParamOverload_ImplicitAddressOfAtCallSite = + type C() = + static member M(x: System.DateTime) = x.AddDays(1.0) + static member M(x: inref) = x.AddDays(2.0) + static member M2(x: System.DateTime, y: int) = x.AddDays(1.0) + static member M2(x: inref, y: int) = x.AddDays(2.0) + let res = System.DateTime.Now + let v = C.M(res) + check "cweweoiwe51btw1" v (res.AddDays(1.0)) + let v2 = C.M2(res, 4) + check "cweweoiwe51btw2" v2 (res.AddDays(1.0)) + + +module InRefParamOverload_ImplicitAddressOfAtCallSite2 = + type C() = + static member M(x: System.DateTime) = x.AddDays(1.0) + static member M(x: inref) = x.AddDays(2.0) + static member M2(x: System.DateTime, y: int) = x.AddDays(1.0) + static member M2(x: inref, y: int) = x.AddDays(2.0) + let Test() = + let res = System.DateTime.Now + let v = C.M(res) + check "cweweoiwe51btw1" v (res.AddDays(1.0)) + let v2 = C.M2(res, 4) + check "cweweoiwe51btw2" v2 (res.AddDays(1.0)) + Test() + + +module InRefParam_DateTime = + type C() = + static member M(x: inref) = x + let w = System.DateTime.Now + let v = C.M(w) + check "cweweoiwe51btw" v w + +module InRefParam_DateTime_ImplicitAddressOfAtCallSite = + type C() = + static member M(x: inref) = x + let v = C.M(System.DateTime.Now) + check "cweweoiwe51btw" v.Date System.DateTime.Now.Date + +module InRefParam_DateTime_ImplicitAddressOfAtCallSite2 = + type C() = + static member M(x: inref) = x + let v = C.M(System.DateTime.Now.AddDays(1.0)) + check "cweweoiwe51btw" v.Date (System.DateTime.Now.AddDays(1.0).Date) + +module InRefParam_DateTime_ImplicitAddressOfAtCallSite3 = + type C() = + static member M(x: inref) = x + let mutable w = System.DateTime.Now + let v = C.M(w) + check "cweweoiwe51btw" v w + +module InRefParam_DateTime_ImplicitAddressOfAtCallSite4 = + type C() = + static member M(x: inref) = x + let date = System.DateTime.Now.Date + let w = [| date |] + let v = C.M(w.[0]) + check "lmvjvwo1" v date + +module InRefParam_Generic_ExplicitAddressOfAttCallSite1 = + type C() = + static member M(x: inref<'T>) = x + let Test() = + let res = "abc" + let v = C.M(&res) + check "lmvjvwo2" res "abc" + check "lmvjvwo3" v "abc" + Test() + +module InRefParam_Generic_ExplicitAddressOfAttCallSite2 = + type C() = + static member M(x: inref<'T>) = x + let Test() = + let res = "abc" + let v = C.M(&res) + check "lmvjvwo4" v "abc" + Test() + module ByrefReturnTests = module TestImmediateReturn = @@ -27,11 +337,18 @@ module ByrefReturnTests = let f () = &x let test() = - let addr = f () + let addr : byref = &f() addr <- addr + 1 check2 "cepojcwem1" 2 x + + let test2() = + let v = f() + let res = v + 1 + check2 "cepojcwem1b" 3 res + test() + test2() module TestMatchReturn = let mutable x = 1 @@ -40,16 +357,23 @@ module ByrefReturnTests = let f inp = match inp with 3 -> &x | _ -> &y let test() = - let addr = f 3 + let addr = &f 3 addr <- addr + 1 check2 "cepojcwem2" 2 x check2 "cepojcwem3" 1 y - let addr = f 4 + let addr = &f 4 addr <- addr + 1 check2 "cepojcwem4" 2 x check2 "cepojcwem5" 2 y + let test2() = + let res = f 3 + let res2 = res + 1 + check2 "cepojcwem2b" 3 res2 + check2 "cepojcwem3b" 2 res + test() + test2() module TestConditionalReturn = let mutable x = 1 @@ -58,16 +382,23 @@ module ByrefReturnTests = let f inp = if inp = 3 then &x else &y let test() = - let addr = f 3 + let addr = &f 3 addr <- addr + 1 check2 "cepojcwem6" 2 x check2 "cepojcwem7" 1 y - let addr = f 4 + let addr = &f 4 addr <- addr + 1 check2 "cepojcwem8" 2 x check2 "cepojcwem9" 2 y + let test2() = + let res = f 3 + let res2 = res + 1 + check2 "cepojcwem8b" 3 res2 + check2 "cepojcwem9b" 2 res + test() + test2() module TestTryCatchReturn = let mutable x = 1 @@ -76,16 +407,23 @@ module ByrefReturnTests = let f inp = try &x with _ -> &y let test() = - let addr = f 3 + let addr = &f 3 addr <- addr + 1 check2 "cepojcwem6b" 2 x check2 "cepojcwem7b" 1 y - let addr = f 4 + let addr = &f 4 addr <- addr + 1 check2 "cepojcwem8b" 3 x check2 "cepojcwem9b" 1 y + let test2() = + let res = f 3 + let res2 = res + 1 + check2 "cepojcwem2ff" 4 res2 + check2 "cepojcwem3gg" 3 res + test() + test2() module TestTryFinallyReturn = let mutable x = 1 @@ -94,16 +432,23 @@ module ByrefReturnTests = let f inp = try &x with _ -> &y let test() = - let addr = f 3 + let addr = &f 3 addr <- addr + 1 check2 "cepojcwem6b" 2 x check2 "cepojcwem7b" 1 y - let addr = f 4 + let addr = &f 4 addr <- addr + 1 check2 "cepojcwem8b" 3 x check2 "cepojcwem9b" 1 y + let test2() = + let res = f 3 + let res2 = res + 1 + check2 "cepojcwem2tf" 4 res2 + check2 "cepojcwem3qw" 3 res + test() + test2() module TestOneArgument = @@ -111,7 +456,7 @@ module ByrefReturnTests = let test() = let mutable r1 = 1 - let addr = f &r1 + let addr = &f &r1 addr <- addr + 1 check2 "cepojcwem10" 2 r1 @@ -124,7 +469,7 @@ module ByrefReturnTests = let test() = let mutable r1 = 1 let mutable r2 = 0 - let addr = f (&r1, &r2) + let addr = &f (&r1, &r2) addr <- addr + 1 check2 "cepojcwem11" 2 r1 @@ -137,7 +482,7 @@ module ByrefReturnTests = let test() = let r = { z = 1 } - let addr = f r + let addr = &f r addr <- addr + 1 check2 "cepojcwem12" 2 r.z @@ -150,7 +495,7 @@ module ByrefReturnTests = let test() = let mutable r = { z = 1 } - let addr = f &r + let addr = &f &r addr <- addr + 1 check2 "cepojcwem13a" 2 r.z @@ -164,7 +509,7 @@ module ByrefReturnTests = let test() = let c = C() - let addr = f c + let addr = &f c addr <- addr + 1 check2 "cepojcwem13b" 1 c.z @@ -176,7 +521,7 @@ module ByrefReturnTests = let test() = let r = [| 1 |] - let addr = f r + let addr = &f r addr <- addr + 1 check2 "cepojcwem14" 2 r.[0] @@ -191,7 +536,7 @@ module ByrefReturnTests = let test() = let mutable r = { z = 1 } - let addr = f &r + let addr = &f &r addr <- addr + 1 check2 "cepojcwem15" 2 r.z @@ -211,12 +556,12 @@ module ByrefReturnTests = { new I with member this.M() = &x } - let f (i:I) = i.M() + let f (i:I) = &i.M() let test() = - let addr = f (C()) + let addr = &f (C()) addr <- addr + 1 - let addr = f (ObjExpr()) + let addr = &f (ObjExpr()) addr <- addr + 1 check2 "cepojcwem16" 3 x @@ -236,12 +581,12 @@ module ByrefReturnTests = { new I with member this.P = &x } - let f (i:I) = i.P + let f (i:I) = &i.P let test() = - let addr = f (C()) + let addr = &f (C()) addr <- addr + 1 - let addr = f (ObjExpr()) + let addr = &f (ObjExpr()) addr <- addr + 1 check2 "cepojcwem17" 3 x @@ -254,10 +599,10 @@ module ByrefReturnTests = let d() = D(fun () -> &x) - let f (d:D) = d.Invoke() + let f (d:D) = &d.Invoke() let test() = - let addr = f (d()) + let addr = &f (d()) check2 "cepojcwem18a" 1 x addr <- addr + 1 check2 "cepojcwem18b" 2 x @@ -284,16 +629,620 @@ module ByrefReturnTests = let d() = D(fun xb -> &xb) - let f (d:D) = d.Invoke(&x) + let f (d:D) = &d.Invoke(&x) let test() = - let addr = f (d()) + let addr = &f (d()) check2 "cepojcwem18a2" 1 x addr <- addr + 1 check2 "cepojcwem18b3" 2 x test() +module ByrefReturnMemberTests = + + module TestImmediateReturn = + let mutable x = 1 + + type C() = + static member M () = &x + + let test() = + let addr : byref = &C.M() + addr <- addr + 1 + check2 "mepojcwem1" 2 x + + + let test2() = + let v = &C.M() + let res = v + 1 + check2 "mepojcwem1b" 3 res + + test() + test2() + + module TestMatchReturn = + let mutable x = 1 + let mutable y = 1 + + type C() = + static member M inp = match inp with 3 -> &x | _ -> &y + + let test() = + let addr = &C.M 3 + addr <- addr + 1 + check2 "mepojcwem2" 2 x + check2 "mepojcwem3" 1 y + let addr = &C.M 4 + addr <- addr + 1 + check2 "mepojcwem4" 2 x + check2 "mepojcwem5" 2 y + + let test2() = + let res = &C.M 3 + let res2 = res + 1 + check2 "mepojcwem2b" 3 res2 + check2 "mepojcwem3b" 2 res + + test() + test2() + + module TestConditionalReturn = + let mutable x = 1 + let mutable y = 1 + + type C() = + static member M inp = if inp = 3 then &x else &y + + let test() = + let addr = &C.M 3 + addr <- addr + 1 + check2 "mepojcwem6" 2 x + check2 "mepojcwem7" 1 y + let addr = &C.M 4 + addr <- addr + 1 + check2 "mepojcwem8" 2 x + check2 "mepojcwem9" 2 y + + let test2() = + let res = &C.M 3 + let res2 = res + 1 + check2 "mepojcwem8b" 3 res2 + check2 "mepojcwem9b" 2 res + + test() + test2() + + module TestTryCatchReturn = + let mutable x = 1 + let mutable y = 1 + + type C() = + static member M inp = try &x with _ -> &y + + let test() = + let addr = &C.M 3 + addr <- addr + 1 + check2 "mepojcwem6b" 2 x + check2 "mepojcwem7b" 1 y + let addr = &C.M 4 + addr <- addr + 1 + check2 "mepojcwem8b" 3 x + check2 "mepojcwem9b" 1 y + + let test2() = + let res = &C.M 3 + let res2 = res + 1 + check2 "mepojcwem2ff" 4 res2 + check2 "mepojcwem3gg" 3 res + + test() + test2() + + module TestTryFinallyReturn = + let mutable x = 1 + let mutable y = 1 + + type C() = + static member M inp = try &x with _ -> &y + + let test() = + let addr = &C.M 3 + addr <- addr + 1 + check2 "mepojcwem6b" 2 x + check2 "mepojcwem7b" 1 y + let addr = &C.M 4 + addr <- addr + 1 + check2 "mepojcwem8b" 3 x + check2 "mepojcwem9b" 1 y + + let test2() = + let res = &C.M 3 + let res2 = res + 1 + check2 "mepojcwem2tf" 4 res2 + check2 "mepojcwem3qw" 3 res + + test() + test2() + + module TestOneArgument = + + type C() = + static member M (x:byref) = &x + + let test() = + let mutable r1 = 1 + let addr = &C.M (&r1) + addr <- addr + 1 + check2 "mepojcwem10" 2 r1 + + test() + + module TestOneArgumentInRefReturned = + + type C() = + static member M (x:inref) = &x + + let test() = + let mutable r1 = 1 + let addr = &C.M (&r1) + let x = addr + 1 + check2 "mepojcwem10" 1 r1 + check2 "mepojcwem10vr" 2 x + + test() + + module TestOneArgumentOutRef = + + type C() = + static member M (x:outref) = &x + + let test() = + let mutable r1 = 1 + let addr = &C.M (&r1) + addr <- addr + 1 + check2 "mepojcwem10" 2 r1 + + test() + + module TestTwoArguments = + + type C() = + static member M (x:byref, y:byref) = &x + + let test() = + let mutable r1 = 1 + let mutable r2 = 0 + let addr = &C.M (&r1, &r2) + addr <- addr + 1 + check2 "mepojcwem11" 2 r1 + + test() + + module TestRecordParam = + + type R = { mutable z : int } + type C() = + static member M (x:R) = &x.z + + let test() = + let r = { z = 1 } + let addr = &C.M r + addr <- addr + 1 + check2 "mepojcwem12" 2 r.z + + test() + + module TestRecordParam2 = + + type R = { mutable z : int } + type C() = + static member M (x:byref) = &x.z + + let test() = + let mutable r = { z = 1 } + let addr = &C.M(&r) + addr <- addr + 1 + check2 "mepojcwem13a" 2 r.z + + test() + + module TestClassParamMutableField = + + type C() = [] val mutable z : int + + type C2() = + static member M (x:C) = &x.z + + let test() = + let c = C() + let addr = &C2.M c + addr <- addr + 1 + check2 "mepojcwem13b" 1 c.z + + test() + + module TestArrayParam = + + type C() = + static member M (x:int[]) = &x.[0] + + let test() = + let r = [| 1 |] + let addr = &C.M r + addr <- addr + 1 + check2 "mepojcwem14" 2 r.[0] + + test() + + module TestStructParam = + + [] + type R = { mutable z : int } + + type C() = + static member M (x:byref) = &x.z + + let test() = + let mutable r = { z = 1 } + let addr = &C.M(&r) + addr <- addr + 1 + check2 "mepojcwem15" 2 r.z + + test() + + module TestInterfaceMethod = + let mutable x = 1 + + type I = + abstract M : unit -> byref + + type C() = + interface I with + member this.M() = &x + + let ObjExpr() = + { new I with + member this.M() = &x } + + let test() = + let addr = &(C() :> I).M() + addr <- addr + 1 + let addr = &(ObjExpr()).M() + addr <- addr + 1 + check2 "mepojcwem16" 3 x + + test() + + module TestInterfaceProperty = + let mutable x = 1 + + type I = + abstract P : byref + + type C() = + interface I with + member this.P = &x + + let ObjExpr() = + { new I with + member this.P = &x } + + let test() = + let addr = &(C() :> I).P + addr <- addr + 1 + let addr = &(ObjExpr()).P + addr <- addr + 1 + check2 "mepojcwem17" 3 x + + test() + + module TestDelegateMethod = + let mutable x = 1 + + type D = delegate of unit -> byref + + let test() = + let d = D(fun () -> &x) + let addr = &d.Invoke() + check2 "mepojcwem18a" 1 x + addr <- addr + 1 + check2 "mepojcwem18b" 2 x + + test() + + module TestBaseCall = + type Incrementor(z) = + abstract member Increment : int byref * int byref -> unit + default this.Increment(i : int byref,j : int byref) = + i <- i + z + + type Decrementor(z) = + inherit Incrementor(z) + override this.Increment(i, j) = + base.Increment(&i, &j) + + i <- i - z + + module TestDelegateMethod2 = + let mutable x = 1 + + type D = delegate of byref -> byref + + let d = D(fun xb -> &xb) + + let test() = + let addr = &d.Invoke(&x) + check2 "mepojcwem18a2" 1 x + addr <- addr + 1 + check2 "mepojcwem18b3" 2 x + + test() + + + module ByRefExtensionMethods1 = + + open System + open System.Runtime.CompilerServices + + [] + type Ext = + + [] + static member ExtDateTime2(dt: inref, x:int) = dt.AddDays(double x) + + module UseExt = + let now = DateTime.Now + let dt2 = now.ExtDateTime2(3) + check "£f3mllkm2" dt2 (now.AddDays(3.0)) + + +(* + module ByRefExtensionMethodsOverloading = + + open System + open System.Runtime.CompilerServices + + [] + type Ext = + [] + static member ExtDateTime(dt: DateTime, x:int) = dt.AddDays(double x) + + [] + static member ExtDateTime(dt: inref, x:int) = dt.AddDays(2.0 * double x) + + module UseExt = + let dt = DateTime.Now.ExtDateTime(3) + let dt2 = DateTime.Now.ExtDateTime(3) +*) + module TestReadOnlyAddressOfStaticField = + type C() = + static let x = 1 + static member F() = &x + + let test() = + let addr = &C.F() + check2 "mepojcwem18a2dw" 1 addr + + test() + + module TestAssignToReturnByref = + type C() = + static let mutable v = System.DateTime.Now + static member M() = &v + static member P = &v + member __.InstanceM() = &v + member __.InstanceP with get() = &v + static member Value = v + + let F1() = + let today = System.DateTime.Now.Date + C.M() <- today + check "cwecjc" C.Value today + C.P <- C.M().AddDays(1.0) + check "cwecjc1" C.Value (today.AddDays(1.0)) + let c = C() + c.InstanceM() <- today.AddDays(2.0) + check "cwecjc2" C.Value (today.AddDays(2.0)) + c.InstanceP <- today.AddDays(3.0) + check "cwecjc1" C.Value (today.AddDays(3.0)) + + F1() + + module TestAssignToReturnByref2 = + let mutable v = System.DateTime.Now + let M() = &v + + let F1() = + let today = System.DateTime.Now.Date + M() <- today + check "cwecjc" v today + + F1() + + module BaseCallByref = + + type Incrementor(z) = + abstract member Increment : int byref * int byref -> unit + default this.Increment(i : int byref,j : int byref) = + i <- i + z + + type Decrementor(z) = + inherit Incrementor(z) + override this.Increment(i, j) = + base.Increment(&i, &j) + + i <- i - z + + + module Bug820 = + + let inline f (x, r:byref<_>) = r <- x + let mutable x = Unchecked.defaultof<_> + f (0, &x) + + module Bug820b = + + type Bug820x() = + let f (x, r:byref<_>) = r <- x + let mutable x = Unchecked.defaultof<_> + member __.P = f (0, &x) + + // check recursive functions + module BeefModuleGeneric = + + let rec beef (unused: 'T) id (data: byref) : unit = + if id = 10 then + data <- 3uy + else + beef unused (id + 1) &data + let Test() = + let mutable x = 0uy + beef "unused" 0 &x + check "vruoer" x 3uy + Test() + + module BeefModuleNonGeneric = + + let rec beef id (data: byref) : unit = + if id = 10 then + data <- 3uy + else + beef (id + 1) &data + + let Test() = + let mutable x = 0uy + beef 0 &x + check "vruoer3r" x 3uy + Test() + + module BeefModuleNonGenericSubsume = + + let rec beef id (data: byref) (y: System.IComparable) : unit = + if id = 10 then + data <- 3uy + else + beef (id + 1) &data y + + let Test() = + let mutable x = 0uy + beef 0 &x Unchecked.defaultof + check "vruoer3r" x 3uy + + Test() + + type GenericBeefRecursive() = + + let rec beef unused id (data: byref) : unit = + if id = 10 then data <- 3uy else beef unused (id + 1) &data + + static do GenericBeefRecursive().Test() + + member __.Test() = + let mutable x = 0uy + beef "unused" 0 &x + check "vruoer3rv" x 3uy + let mutable z = 0uy + beef 6L 0 &z + check "vruoer3rvwqf" z 3uy + + type NonGenericBeefRecursiveInClass() = + + let rec beef id (data: byref) : unit = + if id = 10 then + data <- 3uy + else + beef (id + 1) &data + + static do NonGenericBeefRecursiveInClass().Test() + + member __.Test() = + let mutable x = 0uy + beef 0 &x + check "vruoer3rvvremtys" x 3uy + + + type NonGenericBeefRecursiveInClassSubsume() = + + let rec beef id (data: byref) (y:System.IComparable) : unit = + if id = 10 then + data <- 3uy + else + beef (id + 1) &data y + + static do NonGenericBeefRecursiveInClassSubsume().Test() + + member __.Test() = + let mutable x = 0uy + beef 0 &x Unchecked.defaultof + check "vruoer3rvvremtys" x 3uy + + type StaticGenericBeefRecursiveInClass() = + + static let rec beef unused id (data: byref) : unit = + if id = 10 then data <- 3uy else beef unused (id + 1) &data + + static do StaticGenericBeefRecursiveInClass.Test() + + static member Test() = + let mutable x = 0uy + beef "unused" 0 &x + check "vruoer3rv" x 3uy + let mutable z = 0uy + beef 6L 0 &z + check "vruoer3rvwqfgw" z 3uy + + type StaticNonGenericBeefRecursiveInClass() = + + static let rec beef id (data: byref) : unit = + if id = 10 then data <- 3uy else beef (id + 1) &data + + static do StaticNonGenericBeefRecursiveInClass.Test() + + static member Test() = + let mutable x = 0uy + beef 0 &x + check "vruoer3rvvrebae" x 3uy + + module TestInRefMutation = + [] + type TestMut = + + val mutable x : int + + member this.AnAction() = + this.x <- 1 + + let testAction (m: inref) = + m.AnAction() + check "vleoij" m.x 0 + + let test() = + let x = TestMut() + //testIn (&x) + testAction (&x) + x + test() + + module MutateInRef3 = + [] + type TestMut(x: int ref) = + + member this.X = x.contents + member this.XAddr = &x.contents + + let testIn (m: inref) = + // If the struct API indirectly reveals a byref return of a field in a reference type then + // there is nothing stopping it being written to. + m.XAddr <- 1 + + let test() = + let m = TestMut(ref 0) + testIn (&m) + check "vleoij" m.X 1 + + test() + let aa = if !failures then (stdout.WriteLine "Test Failed"; exit 1) diff --git a/tests/fsharp/core/fsfromfsviacs/lib2.cs b/tests/fsharp/core/fsfromfsviacs/lib2.cs index ea58238f26..eb6d6acc14 100644 --- a/tests/fsharp/core/fsfromfsviacs/lib2.cs +++ b/tests/fsharp/core/fsfromfsviacs/lib2.cs @@ -50,11 +50,26 @@ public static class Extensions { /// Extend an F# type + static public ref readonly DateTime ExtendCSharpTypeWithInRefReturnExtension(in this DateTime inp) { return ref inp; } + static public ref DateTime ExtendCSharpTypeWithRefReturnExtension(ref this DateTime inp) { return ref inp; } + static public void ExtendCSharpTypeWithOutRefExtension(ref this DateTime inp) { inp = inp.Date; } + static public int ExtendCSharpTypeWithInRefExtension(ref this DateTime inp) { return inp.Year; } static public int ExtendFSharpType(this Lib.recd1 recd) { return 5; } static public int ExtendCSharpType(this Lib2 recd) { return 4; } } } +namespace Fields +{ + public class Fields + { + + /// Extend an F# type + static public int StaticIntField => 3; + static public System.DateTime StaticDateTimeField => System.DateTime.Now.Date; + } +} + namespace Newtonsoft.Json.Converters { internal class SomeClass diff --git a/tests/fsharp/core/fsfromfsviacs/test.fsx b/tests/fsharp/core/fsfromfsviacs/test.fsx index 8a7e7c7152..137b4df15a 100644 --- a/tests/fsharp/core/fsfromfsviacs/test.fsx +++ b/tests/fsharp/core/fsfromfsviacs/test.fsx @@ -16,6 +16,11 @@ let test (s : string) b = if b then stderr.WriteLine " OK" else report_failure (s) +let check (s : string) x y = + stderr.Write(s) + if x = y then stderr.WriteLine " OK" + else report_failure (sprintf "%s: expected %A, got %A" s y x) + #if NO_LIB_REFERENCE // Test for https://github.com/Microsoft/visualfsharp/issues/2453#issuecomment-280946177 module TestExtensions = open CustomExtensions @@ -154,8 +159,19 @@ let TestAccessibility() = module TestExtensions = open CustomExtensions - test "dfeweeon" (r1.ExtendFSharpType() = 5) - test "dfeweeon" (Lib2().ExtendCSharpType() = 4) + check "dfeweeon" (r1.ExtendFSharpType()) 5 + check "dfeweeon" (Lib2().ExtendCSharpType()) 4 + + let x = System.DateTime.Now + check "dfeweeon1" (System.DateTime.Now.ExtendCSharpTypeWithInRefReturnExtension()).Date x.Date + check "dfeweeon2" (x.ExtendCSharpTypeWithInRefReturnExtension()).Date x.Date + + check "dfeweeon3" (x.ExtendCSharpTypeWithRefReturnExtension()).Date x.Date + + let mutable mx = x + check "dfeweeon4" (mx.ExtendCSharpTypeWithOutRefExtension(); mx) x.Date + + check "dfeweeon5" (x.ExtendCSharpTypeWithInRefExtension()) x.Year let ToFSharpFunc() = diff --git a/tests/fsharp/core/fsiAndModifiers/prepare.fsx b/tests/fsharp/core/fsiAndModifiers/prepare.fsx index 6a5b171467..1179c8623a 100644 --- a/tests/fsharp/core/fsiAndModifiers/prepare.fsx +++ b/tests/fsharp/core/fsiAndModifiers/prepare.fsx @@ -31,4 +31,6 @@ try asmBuilder.Save(filename) exit 0 -with _ -> exit 1 \ No newline at end of file +with err -> + printfn "Error: %A" err + exit 1 \ No newline at end of file diff --git a/tests/fsharp/core/span/test.fsx b/tests/fsharp/core/span/test.fsx new file mode 100644 index 0000000000..b6bbf9bb9f --- /dev/null +++ b/tests/fsharp/core/span/test.fsx @@ -0,0 +1,401 @@ +#r @"..\..\..\..\packages\System.Memory.4.5.0-rc1\lib\netstandard2.0\System.Memory.dll" +#r @"..\..\..\..\packages\NETStandard.Library.NETFramework.2.0.0-preview2-25405-01\build\net461\ref\netstandard.dll" + +namespace System.Runtime.CompilerServices + + open System + open System.Runtime.CompilerServices + open System.Runtime.InteropServices + [] + [] + type IsReadOnlyAttribute() = + inherit System.Attribute() + + [] + [] + type IsByRefLikeAttribute() = + inherit System.Attribute() + +namespace Tests + open System + open System.Runtime.CompilerServices + open System.Runtime.InteropServices + open FSharp.NativeInterop + + [] + module Helpers = + let failures = ref false + let report_failure (s) = + stderr.WriteLine ("NO: " + s); + failures := true + let test s b = if b then () else report_failure(s) + + (* TEST SUITE FOR Int32 *) + + let out r (s:string) = r := !r @ [s] + + let check s actual expected = + if actual = expected then printfn "%s: OK" s + else report_failure (sprintf "%s: FAILED, expected %A, got %A" s expected actual) + + let check2 s expected actual = check s actual expected + + + [] + type ReadOnlyStruct(count1: int, count2: int) = + member x.Count1 = count1 + member x.Count2 = count2 + + [] + type ByRefLikeStruct(count1: int, count2: int) = + member x.Count1 = count1 + member x.Count2 = count2 + + module TypeRefTests = + + let f1 (x: ByRefLikeStruct) = () + let f2 (x: ReadOnlyStruct) = x.Count1 + let f3 (x: ReadOnlyStruct) = x + let f4 (x: Span) = () + let f5 (x: Memory) = () + let f6 (x: ReadOnlySpan) = () + let f7 (x: ReadOnlyMemory) = () + + module Sample1 = + open FSharp.NativeInterop + open System.Runtime.InteropServices + // this method does not care what kind of memory it works on + let SafeSum(bytes: Span) = + let mutable sum = 0 + for i in 0 .. bytes.Length - 1 do + sum <- sum + int bytes.[i] + sum + + let SafeSum2(bytes: Span) = + let mutable sum = 0 + for i in 0 .. bytes.Length - 1 do + let byteAddr = &bytes.[i] + sum <- sum + int byteAddr + sum + + let SafeSum3(bytes: Memory) = + let bytes = bytes.Span + let mutable sum = 0 + for i in 0 .. bytes.Length - 1 do + let byteAddr = &bytes.[i] + sum <- sum + int byteAddr + sum + + let SafeSum4(bytes: Memory) = + let bytes = bytes.Span + let mutable sum = 0 + for i in 0 .. bytes.Length - 1 do + sum <- sum + int bytes.[i] + sum + + let SafeSum5(bytes: ReadOnlySpan) = + let mutable sum = 0 + for i in 0 .. bytes.Length - 1 do + sum <- sum + int bytes.[i] + sum + + let SafeSum6(bytes: ReadOnlySpan) = + let mutable sum = 0 + for i in 0 .. bytes.Length - 1 do + let byteAddr = &bytes.[i] + sum <- sum + int byteAddr + sum + + let SafeSum7(bytes: ReadOnlyMemory) = + let bytes = bytes.Span + let mutable sum = 0 + for i in 0 .. bytes.Length - 1 do + let byteAddr = &bytes.[i] + sum <- sum + int byteAddr + sum + + let SafeSum8(bytes: ReadOnlyMemory) = + let bytes = bytes.Span + let mutable sum = 0 + for i in 0 .. bytes.Length - 1 do + sum <- sum + int bytes.[i] + sum + + + let f6() = + // managed memory + let arrayMemory = Array.zeroCreate(100) + let arraySpan = new Span(arrayMemory) + for i in 0 .. 99 do arrayMemory.[i] <- byte i + SafeSum(arraySpan)|> printfn "res = %d" + + // native memory + let nativeMemory = Marshal.AllocHGlobal(100) + let nativeSpan = new Span(nativeMemory.ToPointer(), 100) + for i in 0 .. 99 do Marshal.WriteByte(nativeMemory, i, byte i) + SafeSum(nativeSpan)|> printfn "res = %d" + Marshal.FreeHGlobal(nativeMemory) + + // stack memory + let mem = NativePtr.stackalloc(100) + let mem2 = mem |> NativePtr.toVoidPtr + for i in 0 .. 99 do NativePtr.set mem i (byte i) + let stackSpan = Span(mem2, 100) + SafeSum(stackSpan) |> printfn "res = %d" + f6() + + + + [] + type AllowedEvilStruct = + [] + val mutable v : int + member x.Replace(y:AllowedEvilStruct) = x <- y + + module SubsumptionOnMember = + type Doot() = class end + + [] + type GiantDad() = + + let test (data: Span) (doot: Doot) = + () + + member __.Test(data: Span) = + test data Unchecked.defaultof + + module AssignToByrefReturn = + type C() = + static let mutable v = System.DateTime.Now + static member M() = &v + + let F1() = + C.M() <- System.DateTime.Now + + module AssignToSpanItem = + let F2() = + let data = Span.Empty + data.[0] <- 1uy + + module AssignToSpanItemGeneric = + let F2<'T>() = + let data = Span<'T>.Empty + data.[0] <- Unchecked.defaultof<'T> + + module CheckReturnOfSpan1 = + let test () = + let s = Span.Empty + s + + module CheckReturnOfSpan2 = + + type Jopac() = + + member this.Create() = + let mutable x = 1 + this.Create(&x) + + member __.Create(x: byref) = + Span.Empty + + module CheckReturnOfSpan3 = + type Jopac_NotCompile_WhichIsMightBeIncorrect() = + + member __.Create(x: byref) = + Span.Empty + + member this.Create() = + let mutable x = 1 + let x = this.Create(&x) + x + + member this.CreateAgain() = + let mutable x = 1 + this.Create(&x) + + module ByRefSpanParam = + type C() = + static member M(x: byref>) = x.[0] <- 5 + + let Test() = + let mutable res = 9 + let mutable span = Span(NativePtr.toVoidPtr &&res,1) + let v = C.M(&span) + check "cwvereweoiwekl4" res 5 + + let minfo = typeof.GetMethod("M") + check "cwnoreeker1" (minfo.GetParameters().[0].IsIn) false + check "cwnoreeker2" (minfo.GetParameters().[0].IsOut) false + check "cwnoreeker3" (minfo.ReturnParameter.IsIn) false + check "cwnoreeker4" (minfo.ReturnParameter.IsOut) false + + Test() + + module SpanByRefReturn = + type C() = + static member M(x: byref>) = x.[0] <- x.[0] + 1; &x + + let Test() = + let mutable res = 9 + let mutable span = Span(NativePtr.toVoidPtr &&res,1) + let v = &C.M(&span) + check "cwvereweoiwvw4" v.[0] 10 + + let minfo = typeof.GetMethod("M") + check "cwnoreeker6d" (minfo.GetParameters().[0].GetRequiredCustomModifiers().Length) 0 + check "cwnoreekerr" (minfo.ReturnParameter.IsIn) false + check "cwnoreekert" (minfo.ReturnParameter.IsOut) false + + Test() + + + module SpanReturn = + type C() = + static member M(x: byref>) = x.[0] <- x.[0] + 1; x + + let Test() = + let mutable res = 9 + let mutable span = Span(NativePtr.toVoidPtr &&res,1) + let v = C.M(&span) + check "cwvereweoiwvw4" v.[0] 10 + + let minfo = typeof.GetMethod("M") + check "cwnoreeker6d" (minfo.GetParameters().[0].GetRequiredCustomModifiers().Length) 0 + check "cwnoreekerr" (minfo.ReturnParameter.IsIn) false + check "cwnoreekert" (minfo.ReturnParameter.IsOut) false + + Test() + + module SpanSafetyTests0 = + + type SpanLikeType = Span + + let m1 (x: byref>) (y: Span) = + // this is all valid, unconcerned with stack-referring stuff + let local = SpanLikeType() + x <- local + x + + module SpanSafetyTests1 = + type SpanLikeType = Span + let m1 (x: byref>) (y: Span) = + // this is all valid, unconcerned with stack-referring stuff + let local = SpanLikeType() + x <- local + x + let test1 (param1: byref>) (param2: Span) = + let mutable stackReferringBecauseMutable1 = Span() + + //let stackReferringBecauseMutable1 = Span(NativePtr.toVoidPtr(&&x), 1) + //let stackReferringBecauseMutable1 = Span(NativePtr.toVoidPtr(NativePtr.ofByRef(&&x)), 1) + //let stackReferring1 = Span(NativePtr.toVoidPtr(NativePtr.stackalloc< byte>(100), 1) + + let mutable stackReferringBecauseMutable2 = Span() + + // this is allowed + stackReferringBecauseMutable2 <- m1 &stackReferringBecauseMutable2 stackReferringBecauseMutable1 + + // this is allowed + stackReferringBecauseMutable2 <- m1 ¶m1 stackReferringBecauseMutable1 + +#if NEGATIVE + // this is NOT allowed + param1 <- m1 &stackReferringBecauseMutable2 stackReferringBecauseMutable1 + + // this is NOT allowed + param1 <- stackReferringBecauseMutable2.Slice(10) +#endif + + // this is allowed + param1 <- Span() + + // this is allowed + stackReferringBecauseMutable2 <- param1 + + module SpanSafetyTests2 = + let m2 (x: byref>) = + // should compile + &x + + module SpanSafetyTests3 = + type SpanLikeType = Span + let m1 (x: byref>) (y: Span) = + // this is all valid, unconcerned with stack-referring stuff + let local = SpanLikeType() + x <- local + x + let m2 (x: byref>) = + // should compile + &x + + let test2 (param1: byref>) (param2: Span) = + let mutable stackReferringBecauseMutable1 = Span() + let mutable stackReferringBecauseMutable2 = Span() + + let stackReferring3 = &(m2 &stackReferringBecauseMutable2) + + // this is allowed + stackReferring3 <- m1 &stackReferringBecauseMutable2 stackReferringBecauseMutable1 + + // this is allowed + m2(&stackReferring3) <- stackReferringBecauseMutable2 + +#if NEGATIVE2 + // this is NOT allowed + m1(¶m1) <- stackReferringBecauseMutable2 + + // this is NOT allowed + param1 <- stackReferring3 + + // this is NOT allowed + &stackReferring3 +#endif + + // this is allowed + //¶m1 - uncomment to test return + + module SpanSafetyTests4 = + let test2 (param1: byref>) (param2: Span) = + // this is allowed + ¶m1 // uncomment to test return + +#if NEGATIVE + + module CheckReturnOfSpan4 = + type Jopac_NotCompile_WhichIsCorrect() = + + member __.Create(x: byref) = + &x + + member this.Create() = + let mutable x = 1 + let x = &this.Create(&x) + &x + + member this.CreateAgain() = + let mutable x = 1 + &this.Create(&x) + +#endif + +#if NOT_YET + + // Disallow this: + [] + type DisallowedIsReadOnlyStruct = + [] + val mutable X : int + + + // Allow this: + [] + type ByRefLikeStructWithSpanField(count1: Span, count2: int) = + member x.Count1 = count1 + member x.Count2 = count2 + + [] + type ByRefLikeStructWithByrefField(count1: Span, count2: int) = + member x.Count1 = count1 + member x.Count2 = count2 +#endif + diff --git a/tests/fsharp/core/span/testlib.fs b/tests/fsharp/core/span/testlib.fs new file mode 100644 index 0000000000..9f8ee20650 --- /dev/null +++ b/tests/fsharp/core/span/testlib.fs @@ -0,0 +1,15 @@ +namespace System.Runtime.CompilerServices + + open System + open System.Runtime.CompilerServices + open System.Runtime.InteropServices + [] + [] + type IsReadOnlyAttribute() = + inherit System.Attribute() + + [] + [] + type IsByRefLikeAttribute() = + inherit System.Attribute() + diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index a4c8031404..29e276fe9d 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -1,5 +1,5 @@ -#if INTERACTIVE -//#r @"../../release/net40/bin/FSharp.Compiler.dll" +// vvvvvvvvvvvvv To run these tests in F# Interactive , 'build net40', then send this chunk, then evaluate body of a test vvvvvvvvvvvvvvvv +#if INTERACTIVE #r @"../../packages/NUnit.3.5.0/lib/net45/nunit.framework.dll" #load "../../src/scripts/scriptlib.fsx" #load "test-framework.fs" @@ -25,6 +25,7 @@ let FSI_BASIC = FSI_CORECLR let FSC_BASIC = FSC_OPT_PLUS_DEBUG let FSI_BASIC = FSI_FILE #endif +// ^^^^^^^^^^^^ To run these tests in F# Interactive , 'build net40', then send this chunk, then evaluate body of a test ^^^^^^^^^^^^ module CoreTests = // These tests are enabled for .NET Framework and .NET Core @@ -176,17 +177,61 @@ module CoreTests = let cfg = testConfig "core/byrefs" - use testOkFile = fileguard cfg "test.ok" + begin + use testOkFile = fileguard cfg "test.ok" - fsc cfg "%s -o:test.exe -g" cfg.fsc_flags ["test.fsx"] + fsc cfg "%s -o:test.exe -g" cfg.fsc_flags ["test.fsx"] - exec cfg ("." ++ "test.exe") "" + exec cfg ("." ++ "test.exe") "" - testOkFile.CheckExists() + testOkFile.CheckExists() + end - fsi cfg "" ["test.fsx"] + begin + use testOkFile = fileguard cfg "test.ok" + fsi cfg "" ["test.fsx"] - testOkFile.CheckExists() + testOkFile.CheckExists() + end + + begin + + use testOkFile = fileguard cfg "test.ok" + + fsiAnyCpu cfg "" ["test.fsx"] + + testOkFile.CheckExists() + end + + [] + let span () = + + let cfg = testConfig "core/span" + + begin + use testOkFile = fileguard cfg "test.ok" + + fsc cfg "%s -o:test.exe -g" cfg.fsc_flags ["test.fsx"] + + // Execution is disabled until we can be sure .NET 4.7.2 is on the machine + //exec cfg ("." ++ "test.exe") "" + + //testOkFile.CheckExists() + end + + // Execution is disabled until we can be sure .NET 4.7.2 is on the machine + //begin + // use testOkFile = fileguard cfg "test.ok" + // fsi cfg "" ["test.fsx"] + // testOkFile.CheckExists() + //end + + // Execution is disabled until we can be sure .NET 4.7.2 is on the machine + //begin + // use testOkFile = fileguard cfg "test.ok" + // fsiAnyCpu cfg "" ["test.fsx"] + // testOkFile.CheckExists() + //end [] let asyncStackTraces () = @@ -381,9 +426,9 @@ module CoreTests = peverify cfg "lib.dll" - csc cfg """/nologo /target:library /r:"%s" /r:lib.dll /out:lib2.dll""" cfg.FSCOREDLLPATH ["lib2.cs"] + csc cfg """/nologo /target:library /r:"%s" /r:lib.dll /out:lib2.dll /langversion:7.2""" cfg.FSCOREDLLPATH ["lib2.cs"] - csc cfg """/nologo /target:library /r:"%s" /out:lib3.dll""" cfg.FSCOREDLLPATH ["lib3.cs"] + csc cfg """/nologo /target:library /r:"%s" /out:lib3.dll /langversion:7.2""" cfg.FSCOREDLLPATH ["lib3.cs"] fsc cfg "%s -r:lib.dll -r:lib2.dll -r:lib3.dll -o:test.exe -g" cfg.fsc_flags ["test.fsx"] @@ -2308,6 +2353,12 @@ module TypecheckTests = [] let ``type check neg102`` () = singleNegTest (testConfig "typecheck/sigs") "neg102" + [] + let ``type check neg106`` () = singleNegTest (testConfig "typecheck/sigs") "neg106" + + [] + let ``type check neg107`` () = singleNegTest (testConfig "typecheck/sigs") "neg107" + [] let ``type check neg103`` () = singleNegTest (testConfig "typecheck/sigs") "neg103" diff --git a/tests/fsharp/typeProviders/helloWorld/provided.fs b/tests/fsharp/typeProviders/helloWorld/provided.fs index f3ce98f61d..bcdc86452e 100644 --- a/tests/fsharp/typeProviders/helloWorld/provided.fs +++ b/tests/fsharp/typeProviders/helloWorld/provided.fs @@ -1,5 +1,8 @@ namespace global +[] +do () + type TheGeneratedType1() = member x.Prop1 = 1 static member (+) (x1:TheGeneratedType1,x2:TheGeneratedType1) = x1 diff --git a/tests/fsharp/typecheck/sigs/neg106.bsl b/tests/fsharp/typecheck/sigs/neg106.bsl new file mode 100644 index 0000000000..ac6228a569 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg106.bsl @@ -0,0 +1,124 @@ + +neg106.fs(8,59,8,61): typecheck error FS3231: A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + +neg106.fs(13,18,13,72): typecheck error FS0041: No overloads match for method 'CompareExchange'. The available overloads are shown below. +neg106.fs(13,18,13,72): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: int, comparand: int) : int'. Type constraint mismatch. The type + 'inref' +is not compatible with type + 'byref' +. +neg106.fs(13,18,13,72): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: int64, comparand: int64) : int64'. Type constraint mismatch. The type + 'inref' +is not compatible with type + 'byref' +. +neg106.fs(13,18,13,72): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: float32, comparand: float32) : float32'. Type constraint mismatch. The type + 'inref' +is not compatible with type + 'byref' +. +neg106.fs(13,18,13,72): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: float, comparand: float) : float'. Type constraint mismatch. The type + 'inref' +is not compatible with type + 'byref' +. +neg106.fs(13,18,13,72): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: obj, comparand: obj) : obj'. Type constraint mismatch. The type + 'inref' +is not compatible with type + 'byref' +. +neg106.fs(13,18,13,72): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: nativeint, comparand: nativeint) : nativeint'. Type constraint mismatch. The type + 'inref' +is not compatible with type + 'byref' +. +neg106.fs(13,18,13,72): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange<'T when 'T : not struct>(location1: byref<'T>, value: 'T, comparand: 'T) : 'T'. Type constraint mismatch. The type + 'inref' +is not compatible with type + 'byref<'a>' +. + +neg106.fs(17,14,17,68): typecheck error FS0041: No overloads match for method 'CompareExchange'. The available overloads are shown below. +neg106.fs(17,14,17,68): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: int, comparand: int) : int'. Type constraint mismatch. The type + 'inref' +is not compatible with type + 'byref' +. +neg106.fs(17,14,17,68): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: int64, comparand: int64) : int64'. Type constraint mismatch. The type + 'inref' +is not compatible with type + 'byref' +. +neg106.fs(17,14,17,68): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: float32, comparand: float32) : float32'. Type constraint mismatch. The type + 'inref' +is not compatible with type + 'byref' +. +neg106.fs(17,14,17,68): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: float, comparand: float) : float'. Type constraint mismatch. The type + 'inref' +is not compatible with type + 'byref' +. +neg106.fs(17,14,17,68): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: obj, comparand: obj) : obj'. Type constraint mismatch. The type + 'inref' +is not compatible with type + 'byref' +. +neg106.fs(17,14,17,68): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: nativeint, comparand: nativeint) : nativeint'. Type constraint mismatch. The type + 'inref' +is not compatible with type + 'byref' +. +neg106.fs(17,14,17,68): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange<'T when 'T : not struct>(location1: byref<'T>, value: 'T, comparand: 'T) : 'T'. Type constraint mismatch. The type + 'inref' +is not compatible with type + 'byref<'a>' +. + +neg106.fs(23,35,23,39): typecheck error FS0001: Type mismatch. Expecting a + 'byref' +but given a + 'inref' +The type 'ByRefKinds.InOut' does not match the type 'ByRefKinds.In' + +neg106.fs(31,22,31,26): typecheck error FS0001: Type mismatch. Expecting a + 'byref' +but given a + 'inref' +The type 'ByRefKinds.InOut' does not match the type 'ByRefKinds.In' + +neg106.fs(40,18,40,32): typecheck error FS0041: No overloads match for method 'M'. The available overloads are shown below. +neg106.fs(40,18,40,32): typecheck error FS0041: Possible overload: 'static member C.M : a:string * x:byref -> unit'. Type constraint mismatch. The type + 'inref' +is not compatible with type + 'byref' +. +neg106.fs(40,18,40,32): typecheck error FS0041: Possible overload: 'static member C.M : a:int * x:byref -> unit'. Type constraint mismatch. The type + 'string' +is not compatible with type + 'int' +. + +neg106.fs(41,19,41,31): typecheck error FS0041: No overloads match for method 'M'. The available overloads are shown below. +neg106.fs(41,19,41,31): typecheck error FS0041: Possible overload: 'static member C.M : a:string * x:byref -> unit'. Type constraint mismatch. The type + 'int' +is not compatible with type + 'string' +. +neg106.fs(41,19,41,31): typecheck error FS0041: Possible overload: 'static member C.M : a:int * x:byref -> unit'. Type constraint mismatch. The type + 'inref' +is not compatible with type + 'byref' +. + +neg106.fs(49,22,49,26): typecheck error FS0001: Type mismatch. Expecting a + 'byref' +but given a + 'inref' +The type 'ByRefKinds.InOut' does not match the type 'ByRefKinds.In' + +neg106.fs(60,9,60,25): typecheck error FS3224: The byref pointer is readonly, so this write is not permitted. + +neg106.fs(65,42,65,48): typecheck error FS3224: The byref pointer is readonly, so this write is not permitted. + +neg106.fs(74,9,74,17): typecheck error FS0257: Invalid mutation of a constant expression. Consider copying the expression to a mutable local, e.g. 'let mutable x = ...'. diff --git a/tests/fsharp/typecheck/sigs/neg106.fs b/tests/fsharp/typecheck/sigs/neg106.fs new file mode 100644 index 0000000000..938d13309b --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg106.fs @@ -0,0 +1,74 @@ +module M + +//#r @"..\..\..\..\packages\System.Memory.4.5.0-rc1\lib\netstandard2.0\System.Memory.dll" +//#r @"..\..\..\..\packages\NETStandard.Library.NETFramework\2.0.0-preview2-25405-01\build\net461\ref\netstandard.dll" + +module CompareExchangeTests_Negative1 = + let x = 3 + let v = System.Threading.Interlocked.CompareExchange(&x, 3, 4) // No overloads match for method 'CompareExchange'. 'inref' is not compatible with type 'byref' + +module CompareExchangeTests_Negative1b = + let Test() = + let x = 3 + let v = System.Threading.Interlocked.CompareExchange(&x, 3, 4) // No overloads match for method 'CompareExchange'. 'inref' is not compatible with type 'byref' + () + +module CompareExchangeTests_Negative2 = + let v = System.Threading.Interlocked.CompareExchange(&3, 3, 4) // 'inref' is not compatible with type 'byref' + +module TryGetValueTests_Negative1 = + let Test() = + let d = dict [ (3,4) ] + let res = 9 + let v = d.TryGetValue(3, &res) // 'inref' is not compatible with type 'byref' + () + +module FSharpDeclaredOutParamTest_Negaative1 = + type C() = + static member M([] x: byref) = () + let Test() = + let res = 9 + let v = C.M(&res) //'inref' is not compatible with type 'byref' + () + +module FSharpDeclaredOverloadedOutParamTest_Negative1 = + type C() = + static member M(a: int, [] x: byref) = x <- 7 + static member M(a: string, [] x: byref) = x <- 8 + let Test() = + let res = 9 + let v = C.M("a", &res) //'inref' is not compatible with type 'byref' + let v2 = C.M(3, &res) //'inref' is not compatible with type 'byref' + () + +module FSharpDeclaredOutParamTest_Negative1 = + type C() = + static member M([] x: byref) = () + let Test() = + let res = 9 + let v = C.M(&res) // 'inref' is not compatible with type 'byref' + () + +module TestOneArgumentInRefThenMutate_Negative1 = + + type C() = + static member M (x:inref) = &x + + let test() = + let mutable r1 = 1 + let addr = &C.M (&r1) // Expecting a 'byref' but given a 'inref'. The type 'ByRefKinds.Out' does not match the type 'ByRefKinds.In' + addr <- addr + 1 // "The byref pointer is readonly, so this write is not permitted" + +module EvilStruct_Negative1 = + [] + type EvilStruct(s: int) = + member x.Replace(y:EvilStruct) = x <- y + +module MutateInRef1 = + [] + type TestMut = + + val mutable x : int + + let testIn (m: inref) = + m.x <- 1 diff --git a/tests/fsharp/typecheck/sigs/neg106.vsbsl b/tests/fsharp/typecheck/sigs/neg106.vsbsl new file mode 100644 index 0000000000..ac6228a569 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg106.vsbsl @@ -0,0 +1,124 @@ + +neg106.fs(8,59,8,61): typecheck error FS3231: A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + +neg106.fs(13,18,13,72): typecheck error FS0041: No overloads match for method 'CompareExchange'. The available overloads are shown below. +neg106.fs(13,18,13,72): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: int, comparand: int) : int'. Type constraint mismatch. The type + 'inref' +is not compatible with type + 'byref' +. +neg106.fs(13,18,13,72): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: int64, comparand: int64) : int64'. Type constraint mismatch. The type + 'inref' +is not compatible with type + 'byref' +. +neg106.fs(13,18,13,72): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: float32, comparand: float32) : float32'. Type constraint mismatch. The type + 'inref' +is not compatible with type + 'byref' +. +neg106.fs(13,18,13,72): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: float, comparand: float) : float'. Type constraint mismatch. The type + 'inref' +is not compatible with type + 'byref' +. +neg106.fs(13,18,13,72): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: obj, comparand: obj) : obj'. Type constraint mismatch. The type + 'inref' +is not compatible with type + 'byref' +. +neg106.fs(13,18,13,72): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: nativeint, comparand: nativeint) : nativeint'. Type constraint mismatch. The type + 'inref' +is not compatible with type + 'byref' +. +neg106.fs(13,18,13,72): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange<'T when 'T : not struct>(location1: byref<'T>, value: 'T, comparand: 'T) : 'T'. Type constraint mismatch. The type + 'inref' +is not compatible with type + 'byref<'a>' +. + +neg106.fs(17,14,17,68): typecheck error FS0041: No overloads match for method 'CompareExchange'. The available overloads are shown below. +neg106.fs(17,14,17,68): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: int, comparand: int) : int'. Type constraint mismatch. The type + 'inref' +is not compatible with type + 'byref' +. +neg106.fs(17,14,17,68): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: int64, comparand: int64) : int64'. Type constraint mismatch. The type + 'inref' +is not compatible with type + 'byref' +. +neg106.fs(17,14,17,68): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: float32, comparand: float32) : float32'. Type constraint mismatch. The type + 'inref' +is not compatible with type + 'byref' +. +neg106.fs(17,14,17,68): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: float, comparand: float) : float'. Type constraint mismatch. The type + 'inref' +is not compatible with type + 'byref' +. +neg106.fs(17,14,17,68): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: obj, comparand: obj) : obj'. Type constraint mismatch. The type + 'inref' +is not compatible with type + 'byref' +. +neg106.fs(17,14,17,68): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: nativeint, comparand: nativeint) : nativeint'. Type constraint mismatch. The type + 'inref' +is not compatible with type + 'byref' +. +neg106.fs(17,14,17,68): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange<'T when 'T : not struct>(location1: byref<'T>, value: 'T, comparand: 'T) : 'T'. Type constraint mismatch. The type + 'inref' +is not compatible with type + 'byref<'a>' +. + +neg106.fs(23,35,23,39): typecheck error FS0001: Type mismatch. Expecting a + 'byref' +but given a + 'inref' +The type 'ByRefKinds.InOut' does not match the type 'ByRefKinds.In' + +neg106.fs(31,22,31,26): typecheck error FS0001: Type mismatch. Expecting a + 'byref' +but given a + 'inref' +The type 'ByRefKinds.InOut' does not match the type 'ByRefKinds.In' + +neg106.fs(40,18,40,32): typecheck error FS0041: No overloads match for method 'M'. The available overloads are shown below. +neg106.fs(40,18,40,32): typecheck error FS0041: Possible overload: 'static member C.M : a:string * x:byref -> unit'. Type constraint mismatch. The type + 'inref' +is not compatible with type + 'byref' +. +neg106.fs(40,18,40,32): typecheck error FS0041: Possible overload: 'static member C.M : a:int * x:byref -> unit'. Type constraint mismatch. The type + 'string' +is not compatible with type + 'int' +. + +neg106.fs(41,19,41,31): typecheck error FS0041: No overloads match for method 'M'. The available overloads are shown below. +neg106.fs(41,19,41,31): typecheck error FS0041: Possible overload: 'static member C.M : a:string * x:byref -> unit'. Type constraint mismatch. The type + 'int' +is not compatible with type + 'string' +. +neg106.fs(41,19,41,31): typecheck error FS0041: Possible overload: 'static member C.M : a:int * x:byref -> unit'. Type constraint mismatch. The type + 'inref' +is not compatible with type + 'byref' +. + +neg106.fs(49,22,49,26): typecheck error FS0001: Type mismatch. Expecting a + 'byref' +but given a + 'inref' +The type 'ByRefKinds.InOut' does not match the type 'ByRefKinds.In' + +neg106.fs(60,9,60,25): typecheck error FS3224: The byref pointer is readonly, so this write is not permitted. + +neg106.fs(65,42,65,48): typecheck error FS3224: The byref pointer is readonly, so this write is not permitted. + +neg106.fs(74,9,74,17): typecheck error FS0257: Invalid mutation of a constant expression. Consider copying the expression to a mutable local, e.g. 'let mutable x = ...'. diff --git a/tests/fsharp/typecheck/sigs/neg107.bsl b/tests/fsharp/typecheck/sigs/neg107.bsl new file mode 100644 index 0000000000..8fd63e7a80 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg107.bsl @@ -0,0 +1,66 @@ + +neg107.fsx(26,48,26,59): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. + +neg107.fsx(27,69,27,80): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. + +neg107.fsx(28,43,28,59): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +neg107.fsx(28,47,28,58): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. + +neg107.fsx(28,57,28,58): typecheck error FS0418: The byref typed value 'a' cannot be used at this point + +neg107.fsx(28,47,28,58): typecheck error FS0425: The type of a first-class function cannot contain byrefs + +neg107.fsx(29,51,29,67): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +neg107.fsx(29,55,29,66): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. + +neg107.fsx(29,65,29,66): typecheck error FS0418: The byref typed value 'a' cannot be used at this point + +neg107.fsx(29,55,29,66): typecheck error FS0425: The type of a first-class function cannot contain byrefs + +neg107.fsx(31,49,31,54): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. + +neg107.fsx(31,57,31,65): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. + +neg107.fsx(32,70,32,75): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. + +neg107.fsx(32,78,32,86): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. + +neg107.fsx(33,48,33,53): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. + +neg107.fsx(33,48,33,53): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +neg107.fsx(33,56,33,64): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. + +neg107.fsx(33,56,33,64): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +neg107.fsx(33,56,33,64): typecheck error FS0425: The type of a first-class function cannot contain byrefs + +neg107.fsx(33,48,33,53): typecheck error FS0425: The type of a first-class function cannot contain byrefs + +neg107.fsx(34,56,34,61): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. + +neg107.fsx(34,56,34,61): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +neg107.fsx(34,64,34,72): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. + +neg107.fsx(34,64,34,72): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +neg107.fsx(34,64,34,72): typecheck error FS0425: The type of a first-class function cannot contain byrefs + +neg107.fsx(34,56,34,61): typecheck error FS0425: The type of a first-class function cannot contain byrefs + +neg107.fsx(37,33,37,34): typecheck error FS0425: The type of a first-class function cannot contain byrefs + +neg107.fsx(37,33,37,34): typecheck error FS0425: The type of a first-class function cannot contain byrefs + +neg107.fsx(45,34,45,40): typecheck error FS3234: Struct members cannot return the address of fields of the struct by reference + +neg107.fsx(45,34,45,38): typecheck error FS3234: Struct members cannot return the address of fields of the struct by reference + +neg107.fsx(53,34,53,38): typecheck error FS3234: Struct members cannot return the address of fields of the struct by reference + +neg107.fsx(67,34,67,40): typecheck error FS3234: Struct members cannot return the address of fields of the struct by reference + +neg107.fsx(67,34,67,38): typecheck error FS3234: Struct members cannot return the address of fields of the struct by reference diff --git a/tests/fsharp/typecheck/sigs/neg107.fsx b/tests/fsharp/typecheck/sigs/neg107.fsx new file mode 100644 index 0000000000..2dcaafee7a --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg107.fsx @@ -0,0 +1,67 @@ +#r @"..\..\..\..\packages\System.Memory.4.5.0-rc1\lib\netstandard2.0\System.Memory.dll" +#r @"..\..\..\..\packages\NETStandard.Library.NETFramework.2.0.0-preview2-25405-01\build\net461\ref\netstandard.dll" + +namespace System.Runtime.CompilerServices + + open System + open System.Runtime.CompilerServices + open System.Runtime.InteropServices + [] + [] + type IsReadOnlyAttribute() = + inherit System.Attribute() + + [] + [] + type IsByRefLikeAttribute() = + inherit System.Attribute() + +namespace Test + + open System.Runtime.CompilerServices + open System.Runtime.InteropServices + open System + + module Span_Negative1 = + let TestClosure1 (a: inref) = id (fun () -> a) + let TestClosure1b ([] a: byref) = id (fun () -> a) + let TestClosure2 (a: Span) = id (fun () -> a) + let TestClosure3 (a: ReadOnlySpan) = id (fun () -> a) + + let TestAsyncClosure1 (a: inref) = async { return a } + let TestAsyncClosure1b ([] a: byref) = async { return a } + let TestAsyncClosure2 (a: Span) = async { return a } + let TestAsyncClosure3 (a: ReadOnlySpan) = async { return a } + + module Span_Negative2 = + let TestLocal1 () = let x = Span() in x + + module MutateInRef2 = + [] + type TestMut = + + val mutable x : int + + member this.XAddr = &this.x // not allowed, Struct members cannot return the address of fields of the struct by reference", not entirely clear why C# disallowed this + + module MutateInRef3 = + [] + type TestMut = + + val mutable x : int + + member this.XAddr = &this // not allowed, Struct members cannot return the address of fields of the struct by reference", not entirely clear why C# disallowed this + + + module MutateInRef4 = + [] + type TestMut1 = + + val mutable x : int + + [] + type TestMut2 = + + val mutable x : TestMut1 + + member this.XAddr = &this.x.x // not allowed, Struct members cannot return the address of fields of the struct by reference", not entirely clear why C# disallowed this diff --git a/tests/fsharp/typecheck/sigs/neg107.vsbsl b/tests/fsharp/typecheck/sigs/neg107.vsbsl new file mode 100644 index 0000000000..8fd63e7a80 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg107.vsbsl @@ -0,0 +1,66 @@ + +neg107.fsx(26,48,26,59): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. + +neg107.fsx(27,69,27,80): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. + +neg107.fsx(28,43,28,59): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +neg107.fsx(28,47,28,58): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. + +neg107.fsx(28,57,28,58): typecheck error FS0418: The byref typed value 'a' cannot be used at this point + +neg107.fsx(28,47,28,58): typecheck error FS0425: The type of a first-class function cannot contain byrefs + +neg107.fsx(29,51,29,67): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +neg107.fsx(29,55,29,66): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. + +neg107.fsx(29,65,29,66): typecheck error FS0418: The byref typed value 'a' cannot be used at this point + +neg107.fsx(29,55,29,66): typecheck error FS0425: The type of a first-class function cannot contain byrefs + +neg107.fsx(31,49,31,54): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. + +neg107.fsx(31,57,31,65): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. + +neg107.fsx(32,70,32,75): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. + +neg107.fsx(32,78,32,86): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. + +neg107.fsx(33,48,33,53): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. + +neg107.fsx(33,48,33,53): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +neg107.fsx(33,56,33,64): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. + +neg107.fsx(33,56,33,64): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +neg107.fsx(33,56,33,64): typecheck error FS0425: The type of a first-class function cannot contain byrefs + +neg107.fsx(33,48,33,53): typecheck error FS0425: The type of a first-class function cannot contain byrefs + +neg107.fsx(34,56,34,61): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. + +neg107.fsx(34,56,34,61): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +neg107.fsx(34,64,34,72): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. + +neg107.fsx(34,64,34,72): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +neg107.fsx(34,64,34,72): typecheck error FS0425: The type of a first-class function cannot contain byrefs + +neg107.fsx(34,56,34,61): typecheck error FS0425: The type of a first-class function cannot contain byrefs + +neg107.fsx(37,33,37,34): typecheck error FS0425: The type of a first-class function cannot contain byrefs + +neg107.fsx(37,33,37,34): typecheck error FS0425: The type of a first-class function cannot contain byrefs + +neg107.fsx(45,34,45,40): typecheck error FS3234: Struct members cannot return the address of fields of the struct by reference + +neg107.fsx(45,34,45,38): typecheck error FS3234: Struct members cannot return the address of fields of the struct by reference + +neg107.fsx(53,34,53,38): typecheck error FS3234: Struct members cannot return the address of fields of the struct by reference + +neg107.fsx(67,34,67,40): typecheck error FS3234: Struct members cannot return the address of fields of the struct by reference + +neg107.fsx(67,34,67,38): typecheck error FS3234: Struct members cannot return the address of fields of the struct by reference diff --git a/tests/fsharp/typecheck/sigs/neg63.bsl b/tests/fsharp/typecheck/sigs/neg63.bsl index 63f7da210c..b5df880f02 100644 --- a/tests/fsharp/typecheck/sigs/neg63.bsl +++ b/tests/fsharp/typecheck/sigs/neg63.bsl @@ -9,6 +9,6 @@ neg63.fs(11,5,11,13): typecheck error FS0412: A type instantiation involves a by neg63.fs(14,8,14,9): typecheck error FS3155: A quotation may not involve an assignment to or taking the address of a captured local variable -neg63.fs(18,6,18,7): typecheck error FS3209: The address of the variable 'x' cannot be used at this point. A method or function may not return the address of this local value. +neg63.fs(18,6,18,7): typecheck error FS3209: The address of the variable 'x' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. -neg63.fs(26,6,26,10): typecheck error FS3209: The address of the variable 'addr' cannot be used at this point. A method or function may not return the address of this local value. +neg63.fs(26,6,26,10): typecheck error FS3228: The address of the variable 'addr' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. diff --git a/tests/fsharp/typecheck/sigs/neg97.bsl b/tests/fsharp/typecheck/sigs/neg97.bsl index db02521eaf..1e882f98b6 100644 --- a/tests/fsharp/typecheck/sigs/neg97.bsl +++ b/tests/fsharp/typecheck/sigs/neg97.bsl @@ -1,5 +1,5 @@ -neg97.fs(13,1,13,2): typecheck error FS0256: A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' +neg97.fs(13,1,13,10): typecheck error FS0256: A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' neg97.fs(16,9,16,10): typecheck error FS0009: Uses of this construct may result in the generation of unverifiable .NET IL code. This warning can be disabled using '--nowarn:9' or '#nowarn "9"'. diff --git a/tests/fsharp/typecheck/sigs/neg97.vsbsl b/tests/fsharp/typecheck/sigs/neg97.vsbsl new file mode 100644 index 0000000000..1e882f98b6 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg97.vsbsl @@ -0,0 +1,28 @@ + +neg97.fs(13,1,13,10): typecheck error FS0256: A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + +neg97.fs(16,9,16,10): typecheck error FS0009: Uses of this construct may result in the generation of unverifiable .NET IL code. This warning can be disabled using '--nowarn:9' or '#nowarn "9"'. + +neg97.fs(16,9,16,10): typecheck error FS3207: Invalid use of 'fixed'. 'fixed' may only be used in a declaration of the form 'use x = fixed expr' where the expression is an array, the address of a field, the address of an array element or a string' + +neg97.fs(20,9,20,10): typecheck error FS0009: Uses of this construct may result in the generation of unverifiable .NET IL code. This warning can be disabled using '--nowarn:9' or '#nowarn "9"'. + +neg97.fs(20,9,20,10): typecheck error FS3207: Invalid use of 'fixed'. 'fixed' may only be used in a declaration of the form 'use x = fixed expr' where the expression is an array, the address of a field, the address of an array element or a string' + +neg97.fs(25,9,25,10): typecheck error FS0009: Uses of this construct may result in the generation of unverifiable .NET IL code. This warning can be disabled using '--nowarn:9' or '#nowarn "9"'. + +neg97.fs(25,9,25,10): typecheck error FS3207: Invalid use of 'fixed'. 'fixed' may only be used in a declaration of the form 'use x = fixed expr' where the expression is an array, the address of a field, the address of an array element or a string' + +neg97.fs(30,9,30,10): typecheck error FS0009: Uses of this construct may result in the generation of unverifiable .NET IL code. This warning can be disabled using '--nowarn:9' or '#nowarn "9"'. + +neg97.fs(30,9,30,10): typecheck error FS3207: Invalid use of 'fixed'. 'fixed' may only be used in a declaration of the form 'use x = fixed expr' where the expression is an array, the address of a field, the address of an array element or a string' + +neg97.fs(36,20,36,32): typecheck error FS0698: Invalid constraint: the type used for the constraint is sealed, which means the constraint could only be satisfied by at most one solution + +neg97.fs(36,20,36,32): typecheck error FS0064: This construct causes code to be less generic than indicated by the type annotations. The type variable 'T has been constrained to be type 'string'. + +neg97.fs(36,12,36,14): typecheck error FS0663: This type parameter has been used in a way that constrains it to always be 'string' + +neg97.fs(42,20,42,22): typecheck error FS0039: The type parameter 'T is not defined. Maybe you want one of the following: + + 'U diff --git a/tests/fsharp/typecheck/sigs/neg_byref_16.bsl b/tests/fsharp/typecheck/sigs/neg_byref_16.bsl index 91e5f4fe78..529156816d 100644 --- a/tests/fsharp/typecheck/sigs/neg_byref_16.bsl +++ b/tests/fsharp/typecheck/sigs/neg_byref_16.bsl @@ -1,2 +1,4 @@ neg_byref_16.fs(3,33,3,42): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +neg_byref_16.fs(3,40,3,41): typecheck error FS0421: The address of the variable 'a' cannot be used at this point diff --git a/tests/fsharp/typecheck/sigs/neg_byref_17.bsl b/tests/fsharp/typecheck/sigs/neg_byref_17.bsl index 3d857907b8..270d06fbfc 100644 --- a/tests/fsharp/typecheck/sigs/neg_byref_17.bsl +++ b/tests/fsharp/typecheck/sigs/neg_byref_17.bsl @@ -1,6 +1,10 @@ -neg_byref_17.fs(2,5,2,8): typecheck error FS0431: A byref typed value would be stored here. Top-level let-bound byref values are not permitted. +neg_byref_17.fs(2,17,2,27): typecheck error FS0001: This expression was expected to have type + 'byref' +but here has type + 'int' -neg_byref_17.fs(2,17,2,22): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. - -neg_byref_17.fs(3,17,3,22): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. +neg_byref_17.fs(3,17,3,24): typecheck error FS0001: This expression was expected to have type + 'byref' +but here has type + 'int' diff --git a/tests/fsharp/typecheck/sigs/neg_byref_22.bsl b/tests/fsharp/typecheck/sigs/neg_byref_22.bsl index 675eefac32..f295dc0d47 100644 --- a/tests/fsharp/typecheck/sigs/neg_byref_22.bsl +++ b/tests/fsharp/typecheck/sigs/neg_byref_22.bsl @@ -1,4 +1,16 @@ +neg_byref_22.fs(3,16,3,20): typecheck error FS3226: A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + +neg_byref_22.fs(3,16,3,20): typecheck error FS0001: This expression was expected to have type + 'byref' +but here has type + 'int' + +neg_byref_22.fs(3,16,3,20): typecheck error FS0001: This expression was expected to have type + 'byref' +but here has type + 'int' + neg_byref_22.fs(5,16,5,17): typecheck error FS0001: This expression was expected to have type 'float' but here has type diff --git a/tests/fsharp/typecheck/sigs/neg_byref_7.bsl b/tests/fsharp/typecheck/sigs/neg_byref_7.bsl index 8b085ebcf5..ef21f974eb 100644 --- a/tests/fsharp/typecheck/sigs/neg_byref_7.bsl +++ b/tests/fsharp/typecheck/sigs/neg_byref_7.bsl @@ -19,4 +19,4 @@ neg_byref_7.fs(2,47,2,53): typecheck error FS0412: A type instantiation involves neg_byref_7.fs(2,47,2,53): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. -neg_byref_7.fs(4,41,4,42): typecheck error FS3209: The address of the variable 'y' cannot be used at this point. A method or function may not return the address of this local value. +neg_byref_7.fs(4,41,4,42): typecheck error FS3228: The address of the variable 'y' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. diff --git a/tests/fsharpqa/Source/Conformance/InferenceProcedures/ByrefSafetyAnalysis/E_SetFieldToByref04.fs b/tests/fsharpqa/Source/Conformance/InferenceProcedures/ByrefSafetyAnalysis/E_SetFieldToByref04.fs index af9e70f512..f192ad47c2 100644 --- a/tests/fsharpqa/Source/Conformance/InferenceProcedures/ByrefSafetyAnalysis/E_SetFieldToByref04.fs +++ b/tests/fsharpqa/Source/Conformance/InferenceProcedures/ByrefSafetyAnalysis/E_SetFieldToByref04.fs @@ -2,7 +2,7 @@ // Verify appropriate error if attempting to assign a ByRef value to an // object field. (Disallowed by the CLR.) - +//A type instantiation involves a byref type\. This is not permitted by the rules of Common IL\.$ //The address of the variable 'x' cannot be used at this point$ //A type instantiation involves a byref type\. This is not permitted by the rules of Common IL\.$ let mutable mutableObjectField : obj = null diff --git a/tests/service/ExprTests.fs b/tests/service/ExprTests.fs index 2770265abf..f2e0819310 100644 --- a/tests/service/ExprTests.fs +++ b/tests/service/ExprTests.fs @@ -1,7 +1,7 @@  #if INTERACTIVE #r "../../debug/fcs/net45/FSharp.Compiler.Service.dll" // note, run 'build fcs debug' to generate this, this DLL has a public API so can be used from F# Interactive -#r "../../Debug/net40/bin/FSharp.Compiler.Service.ProjectCracker.dll" +#r "../../debug/fcs/net45/FSharp.Compiler.Service.ProjectCracker.dll" #r "../../packages/NUnit.3.5.0/lib/net45/nunit.framework.dll" #load "FsUnit.fs" #load "Common.fs" @@ -673,7 +673,6 @@ let ``Test Unoptimized Declarations Project1`` () = "member M2(__) (unitVar1) = __.compiledAsInstanceMethod(()) @ (56,21--56,47)"; "member SM1(unitVar0) = Operators.op_Addition (compiledAsStaticField,let x: Microsoft.FSharp.Core.int = compiledAsStaticField in ClassWithImplicitConstructor.compiledAsGenericStaticMethod (x)) @ (57,26--57,101)"; "member SM2(unitVar0) = ClassWithImplicitConstructor.compiledAsStaticMethod (()) @ (58,26--58,50)"; - //"member ToString(__) (unitVar1) = Operators.op_Addition (base.ToString(),Operators.ToString (999)) @ (59,29--59,57)"; "member TestCallinToString(this) (unitVar1) = this.ToString() @ (60,39--60,54)"; "type Error"; "let err = {Data0 = 3; Data1 = 4} @ (64,10--64,20)"; "let matchOnException(err) = match (if err :? M.Error then $0 else $1) targets ... @ (66,33--66,36)"; @@ -693,16 +692,13 @@ let ``Test Unoptimized Declarations Project1`` () = "let v = M.c ().get_InstanceProperty(()) @ (98,8--98,26)"; "do Console.WriteLine (\"777\")"; "let functionWithSubmsumption(x) = IntrinsicFunctions.UnboxGeneric (x) @ (102,40--102,52)"; - //"let functionWithCoercion(x) = Operators.op_PipeRight (Operators.op_PipeRight (IntrinsicFunctions.UnboxGeneric (x :> Microsoft.FSharp.Core.obj),fun x -> M.functionWithSubmsumption (x :> Microsoft.FSharp.Core.obj)),fun x -> M.functionWithSubmsumption (x :> Microsoft.FSharp.Core.obj)) @ (103,39--103,116)"; "type MultiArgMethods"; "member .ctor(c,d) = (new Object(); ()) @ (105,5--105,20)"; "member Method(x) (a,b) = 1 @ (106,37--106,38)"; "member CurriedMethod(x) (a1,b1) (a2,b2) = 1 @ (107,63--107,64)"; "let testFunctionThatCallsMultiArgMethods(unitVar0) = let m: M.MultiArgMethods = new MultiArgMethods(3,4) in Operators.op_Addition (m.Method(7,8),fun tupledArg -> let arg00: Microsoft.FSharp.Core.int = tupledArg.Item0 in let arg01: Microsoft.FSharp.Core.int = tupledArg.Item1 in fun tupledArg -> let arg10: Microsoft.FSharp.Core.int = tupledArg.Item0 in let arg11: Microsoft.FSharp.Core.int = tupledArg.Item1 in m.CurriedMethod(arg00,arg01,arg10,arg11) (9,10) (11,12)) @ (110,8--110,9)"; - //"let functionThatUsesObjectExpression(unitVar0) = { new Object() with member x.ToString(unitVar1) = Operators.ToString (888) } @ (114,3--114,55)"; - //"let functionThatUsesObjectExpressionWithInterfaceImpl(unitVar0) = { new Object() with member x.ToString(unitVar1) = Operators.ToString (888) interface System.IComparable with member x.CompareTo(y) = 0 } :> System.IComparable @ (117,3--120,38)"; "let testFunctionThatUsesUnitsOfMeasure(x) (y) = Operators.op_Addition,Microsoft.FSharp.Core.float<'u>,Microsoft.FSharp.Core.float<'u>> (x,y) @ (122,70--122,75)"; - "let testFunctionThatUsesAddressesAndByrefs(x) = let mutable w: Microsoft.FSharp.Core.int = 4 in let y1: Microsoft.FSharp.Core.byref = x in let y2: Microsoft.FSharp.Core.byref = &w in let arr: Microsoft.FSharp.Core.int Microsoft.FSharp.Core.[] = [|3; 4|] in let r: Microsoft.FSharp.Core.int Microsoft.FSharp.Core.ref = Operators.Ref (3) in let y3: Microsoft.FSharp.Core.byref = [I_ldelema (NormalAddress,false,ILArrayShape [(Some 0, None)],TypeVar 0us)](arr,0) in let y4: Microsoft.FSharp.Core.byref = &r.contents in let z: Microsoft.FSharp.Core.int = Operators.op_Addition (Operators.op_Addition (Operators.op_Addition (x,y1),y2),y3) in (w <- 3; (x <- 4; (y2 <- 4; (y3 <- 5; Operators.op_Addition (Operators.op_Addition (Operators.op_Addition (Operators.op_Addition (Operators.op_Addition (Operators.op_Addition (Operators.op_Addition (z,x),y1),y2),y3),y4),IntrinsicFunctions.GetArray (arr,0)),r.contents))))) @ (125,16--125,17)"; + "let testFunctionThatUsesAddressesAndByrefs(x) = let mutable w: Microsoft.FSharp.Core.int = 4 in let y1: Microsoft.FSharp.Core.byref = x in let y2: Microsoft.FSharp.Core.byref = &w in let arr: Microsoft.FSharp.Core.int Microsoft.FSharp.Core.[] = [|3; 4|] in let r: Microsoft.FSharp.Core.int Microsoft.FSharp.Core.ref = Operators.Ref (3) in let y3: Microsoft.FSharp.Core.byref = [I_ldelema (NormalAddress,false,ILArrayShapeFIX,!0)](arr,0) in let y4: Microsoft.FSharp.Core.byref = &r.contents in let z: Microsoft.FSharp.Core.int = Operators.op_Addition (Operators.op_Addition (Operators.op_Addition (x,y1),y2),y3) in (w <- 3; (x <- 4; (y2 <- 4; (y3 <- 5; Operators.op_Addition (Operators.op_Addition (Operators.op_Addition (Operators.op_Addition (Operators.op_Addition (Operators.op_Addition (Operators.op_Addition (z,x),y1),y2),y3),y4),IntrinsicFunctions.GetArray (arr,0)),r.contents))))) @ (125,16--125,17)"; "let testFunctionThatUsesStructs1(dt) = dt.AddDays(3) @ (139,57--139,72)"; "let testFunctionThatUsesStructs2(unitVar0) = let dt1: System.DateTime = DateTime.get_Now () in let mutable dt2: System.DateTime = DateTime.get_Now () in let dt3: System.TimeSpan = Operators.op_Subtraction (dt1,dt2) in let dt4: System.DateTime = dt1.AddDays(3) in let dt5: Microsoft.FSharp.Core.int = dt1.get_Millisecond() in let dt6: Microsoft.FSharp.Core.byref = &dt2 in let dt7: System.TimeSpan = Operators.op_Subtraction (dt6,dt4) in dt7 @ (142,7--142,10)"; "let testFunctionThatUsesWhileLoop(unitVar0) = let mutable x: Microsoft.FSharp.Core.int = 1 in (while Operators.op_LessThan (x,100) do x <- Operators.op_Addition (x,1) done; x) @ (152,15--152,16)"; @@ -815,11 +811,6 @@ let ``Test Optimized Declarations Project1`` () = "member M2(__) (unitVar1) = __.compiledAsInstanceMethod(()) @ (56,21--56,47)"; "member SM1(unitVar0) = Operators.op_Addition (compiledAsStaticField,ClassWithImplicitConstructor.compiledAsGenericStaticMethod (compiledAsStaticField)) @ (57,26--57,101)"; "member SM2(unitVar0) = ClassWithImplicitConstructor.compiledAsStaticMethod (()) @ (58,26--58,50)"; -//#if NO_PROJECTCRACKER // proxy for COMPILER -// "member ToString(__) (unitVar1) = String.Concat (base.ToString(),let value: Microsoft.FSharp.Core.int = 999 in let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (value) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ...) @ (59,29--59,57)"; -//#else -// //"member ToString(__) (unitVar1) = String.Concat (base.ToString(),let x: Microsoft.FSharp.Core.int = 999 in let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (x) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ...) @ (59,29--59,57)"; -//#endif "member TestCallinToString(this) (unitVar1) = this.ToString() @ (60,39--60,54)"; "type Error"; "let err = {Data0 = 3; Data1 = 4} @ (64,10--64,20)"; "let matchOnException(err) = match (if err :? M.Error then $0 else $1) targets ... @ (66,33--66,36)"; @@ -839,25 +830,13 @@ let ``Test Optimized Declarations Project1`` () = "let v = M.c ().get_InstanceProperty(()) @ (98,8--98,26)"; "do Console.WriteLine (\"777\")"; "let functionWithSubmsumption(x) = IntrinsicFunctions.UnboxGeneric (x) @ (102,40--102,52)"; -//#if NO_PROJECTCRACKER // proxy for COMPILER -// "let functionWithCoercion(x) = let arg: Microsoft.FSharp.Core.string = let arg: Microsoft.FSharp.Core.string = IntrinsicFunctions.UnboxGeneric (x :> Microsoft.FSharp.Core.obj) in M.functionWithSubmsumption (arg :> Microsoft.FSharp.Core.obj) in M.functionWithSubmsumption (arg :> Microsoft.FSharp.Core.obj) @ (103,39--103,116)"; -//#else -// "let functionWithCoercion(x) = let x: Microsoft.FSharp.Core.string = let x: Microsoft.FSharp.Core.string = IntrinsicFunctions.UnboxGeneric (x :> Microsoft.FSharp.Core.obj) in M.functionWithSubmsumption (x :> Microsoft.FSharp.Core.obj) in M.functionWithSubmsumption (x :> Microsoft.FSharp.Core.obj) @ (103,39--103,116)"; -//#endif "type MultiArgMethods"; "member .ctor(c,d) = (new Object(); ()) @ (105,5--105,20)"; "member Method(x) (a,b) = 1 @ (106,37--106,38)"; "member CurriedMethod(x) (a1,b1) (a2,b2) = 1 @ (107,63--107,64)"; "let testFunctionThatCallsMultiArgMethods(unitVar0) = let m: M.MultiArgMethods = new MultiArgMethods(3,4) in Operators.op_Addition (m.Method(7,8),let arg00: Microsoft.FSharp.Core.int = 9 in let arg01: Microsoft.FSharp.Core.int = 10 in let arg10: Microsoft.FSharp.Core.int = 11 in let arg11: Microsoft.FSharp.Core.int = 12 in m.CurriedMethod(arg00,arg01,arg10,arg11)) @ (110,8--110,9)"; -//#if NO_PROJECTCRACKER // proxy for COMPILER -// "let functionThatUsesObjectExpression(unitVar0) = { new Object() with member x.ToString(unitVar1) = let value: Microsoft.FSharp.Core.int = 888 in let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (value) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... } @ (114,3--114,55)"; -// "let functionThatUsesObjectExpressionWithInterfaceImpl(unitVar0) = { new Object() with member x.ToString(unitVar1) = let value: Microsoft.FSharp.Core.int = 888 in let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (value) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... interface System.IComparable with member x.CompareTo(y) = 0 } :> System.IComparable @ (117,3--120,38)"; -//#else -// "let functionThatUsesObjectExpression(unitVar0) = { new Object() with member x.ToString(unitVar1) = let x: Microsoft.FSharp.Core.int = 888 in let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (x) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... } @ (114,3--114,55)"; -// "let functionThatUsesObjectExpressionWithInterfaceImpl(unitVar0) = { new Object() with member x.ToString(unitVar1) = let x: Microsoft.FSharp.Core.int = 888 in let matchValue: Microsoft.FSharp.Core.obj = Operators.Box (x) in match (if Operators.op_Equality (matchValue,dflt) then $0 else (if matchValue :? System.IFormattable then $1 else $2)) targets ... interface System.IComparable with member x.CompareTo(y) = 0 } :> System.IComparable @ (117,3--120,38)"; -//#endif "let testFunctionThatUsesUnitsOfMeasure(x) (y) = Operators.op_Addition,Microsoft.FSharp.Core.float<'u>,Microsoft.FSharp.Core.float<'u>> (x,y) @ (122,70--122,75)"; - "let testFunctionThatUsesAddressesAndByrefs(x) = let mutable w: Microsoft.FSharp.Core.int = 4 in let y1: Microsoft.FSharp.Core.byref = x in let y2: Microsoft.FSharp.Core.byref = &w in let arr: Microsoft.FSharp.Core.int Microsoft.FSharp.Core.[] = [|3; 4|] in let r: Microsoft.FSharp.Core.int Microsoft.FSharp.Core.ref = Operators.Ref (3) in let y3: Microsoft.FSharp.Core.byref = [I_ldelema (NormalAddress,false,ILArrayShapeFIX,TypeVar 0us)](arr,0) in let y4: Microsoft.FSharp.Core.byref = &r.contents in let z: Microsoft.FSharp.Core.int = Operators.op_Addition (Operators.op_Addition (Operators.op_Addition (x,y1),y2),y3) in (w <- 3; (x <- 4; (y2 <- 4; (y3 <- 5; Operators.op_Addition (Operators.op_Addition (Operators.op_Addition (Operators.op_Addition (Operators.op_Addition (Operators.op_Addition (Operators.op_Addition (z,x),y1),y2),y3),y4),IntrinsicFunctions.GetArray (arr,0)),r.contents))))) @ (125,16--125,17)"; + "let testFunctionThatUsesAddressesAndByrefs(x) = let mutable w: Microsoft.FSharp.Core.int = 4 in let y1: Microsoft.FSharp.Core.byref = x in let y2: Microsoft.FSharp.Core.byref = &w in let arr: Microsoft.FSharp.Core.int Microsoft.FSharp.Core.[] = [|3; 4|] in let r: Microsoft.FSharp.Core.int Microsoft.FSharp.Core.ref = Operators.Ref (3) in let y3: Microsoft.FSharp.Core.byref = [I_ldelema (NormalAddress,false,ILArrayShapeFIX,!0)](arr,0) in let y4: Microsoft.FSharp.Core.byref = &r.contents in let z: Microsoft.FSharp.Core.int = Operators.op_Addition (Operators.op_Addition (Operators.op_Addition (x,y1),y2),y3) in (w <- 3; (x <- 4; (y2 <- 4; (y3 <- 5; Operators.op_Addition (Operators.op_Addition (Operators.op_Addition (Operators.op_Addition (Operators.op_Addition (Operators.op_Addition (Operators.op_Addition (z,x),y1),y2),y3),y4),IntrinsicFunctions.GetArray (arr,0)),r.contents))))) @ (125,16--125,17)"; "let testFunctionThatUsesStructs1(dt) = dt.AddDays(3) @ (139,57--139,72)"; "let testFunctionThatUsesStructs2(unitVar0) = let dt1: System.DateTime = DateTime.get_Now () in let mutable dt2: System.DateTime = DateTime.get_Now () in let dt3: System.TimeSpan = DateTime.op_Subtraction (dt1,dt2) in let dt4: System.DateTime = dt1.AddDays(3) in let dt5: Microsoft.FSharp.Core.int = dt1.get_Millisecond() in let dt6: Microsoft.FSharp.Core.byref = &dt2 in let dt7: System.TimeSpan = DateTime.op_Subtraction (dt6,dt4) in dt7 @ (142,7--142,10)"; "let testFunctionThatUsesWhileLoop(unitVar0) = let mutable x: Microsoft.FSharp.Core.int = 1 in (while Operators.op_LessThan (x,100) do x <- Operators.op_Addition (x,1) done; x) @ (152,15--152,16)"; diff --git a/tests/service/ProjectOptionsTests.fs b/tests/service/ProjectOptionsTests.fs index 3ab2e1c2da..b390f53e62 100644 --- a/tests/service/ProjectOptionsTests.fs +++ b/tests/service/ProjectOptionsTests.fs @@ -1,6 +1,6 @@ #if INTERACTIVE #r "../../debug/fcs/net45/FSharp.Compiler.Service.dll" // note, run 'build fcs debug' to generate this, this DLL has a public API so can be used from F# Interactive -#r "../../Debug/net40/bin/FSharp.Compiler.Service.ProjectCracker.dll" +#r "../../debug/fcs/net45/FSharp.Compiler.Service.ProjectCracker.dll" #r "../../packages/NUnit.3.5.0/lib/net45/nunit.framework.dll" #load "FsUnit.fs" #load "Common.fs" diff --git a/vsintegration/tests/UnitTests/CompletionProviderTests.fs b/vsintegration/tests/UnitTests/CompletionProviderTests.fs index a5c6e7d31f..ac9502edc6 100644 --- a/vsintegration/tests/UnitTests/CompletionProviderTests.fs +++ b/vsintegration/tests/UnitTests/CompletionProviderTests.fs @@ -457,13 +457,37 @@ type T VerifyNoCompletionList(fileContents, "type T") [] -let ``No completion on function name at declaration site``() = +let ``No completion on name of unfinished function declaration``() = let fileContents = """ let f """ VerifyNoCompletionList(fileContents, "let f") +[] +let ``No completion on name of value declaration``() = + let fileContents = """ +let xyz = 1 + +""" + VerifyNoCompletionList(fileContents, "let xy") + +[] +let ``No completion on name of function declaration``() = + let fileContents = """ +let foo x = 1 + +""" + VerifyNoCompletionList(fileContents, "let fo") + +[] +let ``No completion on name of tupled function declaration``() = + let fileContents = """ +let foo (x, y) = 1 + +""" + VerifyNoCompletionList(fileContents, "let fo") + [] let ``No completion on member name at declaration site``() = let fileContents = """ From 39fce718a05d805019acd5db9e41c9017ff6ab25 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Thu, 31 May 2018 10:38:19 -0700 Subject: [PATCH 029/150] Fix TypeProviders with managed resources (#5036) * Fix TypeProviders with managed resources * Revert "Fix TypeProviders with managed resources" This reverts commit 6f925b323bbe2cf2e1a24d887cb47234389c9ef5. * Fix Type Providers still don't compile in 15.7.2 #4972 --- src/absil/ilread.fs | 20 ++++++++++++-------- src/absil/ilwrite.fs | 34 ++++++++++++++++++---------------- 2 files changed, 30 insertions(+), 24 deletions(-) diff --git a/src/absil/ilread.fs b/src/absil/ilread.fs index 2e0e757f9a..ec789e028e 100644 --- a/src/absil/ilread.fs +++ b/src/absil/ilread.fs @@ -3228,14 +3228,18 @@ and seekReadManifestResources (ctxt: ILMetadataReader) (mdv: BinaryView) (pectxt let scoref = seekReadImplAsScopeRef ctxt mdv implIdx let location = - match scoref with - | ILScopeRef.Local -> - let start = pectxtEager.anyV2P ("resource", offset + pectxtEager.resourcesAddr) - let resourceLength = seekReadInt32 pevEager start - let offsetOfBytesFromStartOfPhysicalPEFile = start + 4 - ILResourceLocation.LocalIn (ctxt.fileName, offsetOfBytesFromStartOfPhysicalPEFile, resourceLength) - | ILScopeRef.Module mref -> ILResourceLocation.File (mref, offset) - | ILScopeRef.Assembly aref -> ILResourceLocation.Assembly aref + match scoref with + | ILScopeRef.Local -> + let start = pectxtEager.anyV2P ("resource", offset + pectxtEager.resourcesAddr) + let resourceLength = seekReadInt32 pevEager start + let offsetOfBytesFromStartOfPhysicalPEFile = start + 4 + if pectxtEager.noFileOnDisk then + ILResourceLocation.LocalOut (seekReadBytes pevEager offsetOfBytesFromStartOfPhysicalPEFile resourceLength) + else + ILResourceLocation.LocalIn (ctxt.fileName, offsetOfBytesFromStartOfPhysicalPEFile, resourceLength) + + | ILScopeRef.Module mref -> ILResourceLocation.File (mref, offset) + | ILScopeRef.Assembly aref -> ILResourceLocation.Assembly aref let r = { Name= readStringHeap ctxt nameIdx diff --git a/src/absil/ilwrite.fs b/src/absil/ilwrite.fs index b7ef6be5f5..3662ad279e 100644 --- a/src/absil/ilwrite.fs +++ b/src/absil/ilwrite.fs @@ -2679,22 +2679,24 @@ and GenEventPass3 cenv env (md: ILEventDef) = let rec GetResourceAsManifestResourceRow cenv r = let data, impl = - match r.Location with - | ILResourceLocation.LocalIn _ - | ILResourceLocation.LocalOut _ -> - let bytes = r.GetBytes() - // Embedded managed resources must be word-aligned. However resource format is - // not specified in ECMA. Some mscorlib resources appear to be non-aligned - it seems it doesn't matter.. - let offset = cenv.resources.Position - let alignedOffset = (align 0x8 offset) - let pad = alignedOffset - offset - let resourceSize = bytes.Length - cenv.resources.EmitPadding pad - cenv.resources.EmitInt32 resourceSize - cenv.resources.EmitBytes bytes - Data (alignedOffset, true), (i_File, 0) - | ILResourceLocation.File (mref, offset) -> ULong offset, (i_File, GetModuleRefAsFileIdx cenv mref) - | ILResourceLocation.Assembly aref -> ULong 0x0, (i_AssemblyRef, GetAssemblyRefAsIdx cenv aref) + let embedManagedResources (bytes:byte[]) = + // Embedded managed resources must be word-aligned. However resource format is + // not specified in ECMA. Some mscorlib resources appear to be non-aligned - it seems it doesn't matter.. + let offset = cenv.resources.Position + let alignedOffset = (align 0x8 offset) + let pad = alignedOffset - offset + let resourceSize = bytes.Length + cenv.resources.EmitPadding pad + cenv.resources.EmitInt32 resourceSize + cenv.resources.EmitBytes bytes + Data (alignedOffset, true), (i_File, 0) + + match r.Location with + | ILResourceLocation.LocalIn _ -> embedManagedResources (r.GetBytes()) + | ILResourceLocation.LocalOut bytes -> embedManagedResources bytes + | ILResourceLocation.File (mref, offset) -> ULong offset, (i_File, GetModuleRefAsFileIdx cenv mref) + | ILResourceLocation.Assembly aref -> ULong 0x0, (i_AssemblyRef, GetAssemblyRefAsIdx cenv aref) + UnsharedRow [| data ULong (match r.Access with ILResourceAccess.Public -> 0x01 | ILResourceAccess.Private -> 0x02) From b481145feeab13e736a2ad666809963a3bb0e626 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Wed, 30 May 2018 09:25:30 -0700 Subject: [PATCH 030/150] Unsafe LoadFrom (#5038) --- src/absil/illib.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/absil/illib.fs b/src/absil/illib.fs index 01aa270788..0286a45e63 100644 --- a/src/absil/illib.fs +++ b/src/absil/illib.fs @@ -1237,7 +1237,7 @@ module Shim = interface IFileSystem with member __.AssemblyLoadFrom(fileName: string) = - Assembly.LoadFrom fileName + Assembly.UnsafeLoadFrom fileName member __.AssemblyLoad(assemblyName: AssemblyName) = Assembly.Load assemblyName From 6fb952b030706cba06f8b1b8c22aa95178f48dc9 Mon Sep 17 00:00:00 2001 From: dotnet bot Date: Tue, 5 Jun 2018 10:17:53 -0700 Subject: [PATCH 031/150] Fix annotation view (#4938) (#5088) --- .../src/FSharp.Editor/LanguageService/LanguageService.fs | 2 -- 1 file changed, 2 deletions(-) diff --git a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs index 81012992aa..8cf6d94af9 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs @@ -675,9 +675,7 @@ type internal FSharpLanguageService(package : FSharpPackage) = // This is the path for .fs/.fsi files in legacy projects this.SetupProjectFile(siteProvider, this.Workspace, "SetupNewTextView") - | h when not (isNull h) && not (IsScript(filename)) -> - let docId = this.Workspace.CurrentSolution.GetDocumentIdsWithFilePath(filename).FirstOrDefault() match docId with | null -> From 4c9d7062c99011ec88db9b6c6c205b2727a74ee4 Mon Sep 17 00:00:00 2001 From: Kevin Ransom Date: Tue, 5 Jun 2018 21:02:17 -0700 Subject: [PATCH 032/150] Update templates to FSharp.Core 4.5.0 --- build/config/AssemblySignToolData.json | 2 +- packages.config | 2 +- .../ConsoleProject/Template/ConsoleApplication.fsproj | 2 +- .../ConsoleProject/Template/ConsoleApplication.vstemplate | 2 +- .../ProjectTemplates/LibraryProject/Template/Library.fsproj | 2 +- .../LibraryProject/Template/Library.vstemplate | 2 +- .../ProjectTemplates/TutorialProject/Template/Tutorial.fsproj | 2 +- .../TutorialProject/Template/Tutorial.vstemplate | 2 +- vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj | 4 ++-- .../Vsix/VisualFSharpTemplates/VisualFSharpTemplates.csproj | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/build/config/AssemblySignToolData.json b/build/config/AssemblySignToolData.json index 00dc796e59..ef269dd564 100644 --- a/build/config/AssemblySignToolData.json +++ b/build/config/AssemblySignToolData.json @@ -57,7 +57,7 @@ } ], "exclude": [ - "FSharp.Core.4.3.4.nupkg", + "FSharp.Core.4.5.0.nupkg", "FSharp.Data.TypeProviders.dll", "Microsoft.Build.Conversion.Core.dll", "Microsoft.Build.dll", diff --git a/packages.config b/packages.config index 5fa5156e43..cb18c8e91f 100644 --- a/packages.config +++ b/packages.config @@ -19,7 +19,7 @@ - + diff --git a/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.fsproj b/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.fsproj index b7d0837dde..e2b643f6c5 100644 --- a/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.fsproj +++ b/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.fsproj @@ -42,7 +42,7 @@ - ..\packages\FSharp.Core.4.3.4\lib\net45\FSharp.Core.dll + ..\packages\FSharp.Core.4.5.0\lib\net45\FSharp.Core.dll True diff --git a/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.vstemplate b/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.vstemplate index 29a82e5291..193eab4557 100644 --- a/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.vstemplate +++ b/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.vstemplate @@ -27,7 +27,7 @@ - + diff --git a/vsintegration/ProjectTemplates/LibraryProject/Template/Library.fsproj b/vsintegration/ProjectTemplates/LibraryProject/Template/Library.fsproj index a4625ff579..9249b782e0 100644 --- a/vsintegration/ProjectTemplates/LibraryProject/Template/Library.fsproj +++ b/vsintegration/ProjectTemplates/LibraryProject/Template/Library.fsproj @@ -38,7 +38,7 @@ - ..\packages\FSharp.Core.4.3.4\lib\net45\FSharp.Core.dll + ..\packages\FSharp.Core.4.5.0\lib\net45\FSharp.Core.dll True diff --git a/vsintegration/ProjectTemplates/LibraryProject/Template/Library.vstemplate b/vsintegration/ProjectTemplates/LibraryProject/Template/Library.vstemplate index ed830caa37..7473220c3b 100644 --- a/vsintegration/ProjectTemplates/LibraryProject/Template/Library.vstemplate +++ b/vsintegration/ProjectTemplates/LibraryProject/Template/Library.vstemplate @@ -27,7 +27,7 @@ - + diff --git a/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.fsproj b/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.fsproj index 4b4a8ff037..61927697e8 100644 --- a/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.fsproj +++ b/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.fsproj @@ -45,7 +45,7 @@ - ..\packages\FSharp.Core.4.3.4\lib\net45\FSharp.Core.dll + ..\packages\FSharp.Core.4.5.0\lib\net45\FSharp.Core.dll True diff --git a/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.vstemplate b/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.vstemplate index 1c3aeb1443..53b273e1aa 100644 --- a/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.vstemplate +++ b/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.vstemplate @@ -25,7 +25,7 @@ - + diff --git a/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj b/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj index e85f7b6f98..7ae22377e9 100644 --- a/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj +++ b/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj @@ -23,9 +23,9 @@ License.txt true - + PreserveNewest - packages\FSharp.Core.4.3.4.nupkg + packages\FSharp.Core.4.5.0.nupkg true diff --git a/vsintegration/Vsix/VisualFSharpTemplates/VisualFSharpTemplates.csproj b/vsintegration/Vsix/VisualFSharpTemplates/VisualFSharpTemplates.csproj index c3a446ae60..fc25dfbe59 100644 --- a/vsintegration/Vsix/VisualFSharpTemplates/VisualFSharpTemplates.csproj +++ b/vsintegration/Vsix/VisualFSharpTemplates/VisualFSharpTemplates.csproj @@ -7,7 +7,7 @@ net46 Library Microsoft\FSharpTemplates - false + true From 91f490660c80f5c64fe930f7425275909f4c10d3 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Thu, 7 Jun 2018 11:19:21 -0700 Subject: [PATCH 033/150] UIThread (#5128) --- .../DocumentTask.cs | 3 ++- .../LanguageService.cs | 4 ++-- .../Project/Automation/OAFileItem.cs | 1 - .../Project/Automation/OAFolderItem.cs | 1 - .../Automation/OANavigableProjectItems.cs | 1 - .../Project/Automation/OAProject.cs | 1 - .../Project/Automation/OAProjectItem.cs | 1 - .../Project/Automation/OAProjectItems.cs | 2 -- .../Project/Automation/OAProperties.cs | 1 - .../Automation/VSProject/OAReferenceBase.cs | 1 - .../Automation/VSProject/OAReferences.cs | 1 - .../Project/ConfigurationProperties.cs | 1 - .../Project/HierarchyNode.cs | 4 ++-- .../Project/IDEBuildLogger.cs | 19 +++++++++---------- .../Project/NodeProperties.cs | 1 - .../Project/ProjectConfig.cs | 1 - .../Project/ProjectNode.cs | 2 -- .../Project/ProjectReferenceNode.cs | 6 +++--- .../Project/UIThread.cs | 2 +- .../FSharp.ProjectSystem.FSharp/Project.fs | 3 ++- .../tests/UnitTests/TestLib.Utils.fs | 1 + 21 files changed, 22 insertions(+), 35 deletions(-) diff --git a/vsintegration/src/FSharp.LanguageService.Base/DocumentTask.cs b/vsintegration/src/FSharp.LanguageService.Base/DocumentTask.cs index 058562cf0f..d6664bb6a5 100644 --- a/vsintegration/src/FSharp.LanguageService.Base/DocumentTask.cs +++ b/vsintegration/src/FSharp.LanguageService.Base/DocumentTask.cs @@ -21,7 +21,8 @@ using VsShell = Microsoft.VisualStudio.Shell.VsShellUtilities; using System.Diagnostics.CodeAnalysis; -namespace Microsoft.VisualStudio.FSharp.LanguageService { +namespace Microsoft.VisualStudio.FSharp.LanguageService +{ internal static class UIThread { static SynchronizationContext ctxt; static bool isUnitTestingMode = false; diff --git a/vsintegration/src/FSharp.LanguageService.Base/LanguageService.cs b/vsintegration/src/FSharp.LanguageService.Base/LanguageService.cs index 18a00ea5f3..257f638cb4 100644 --- a/vsintegration/src/FSharp.LanguageService.Base/LanguageService.cs +++ b/vsintegration/src/FSharp.LanguageService.Base/LanguageService.cs @@ -685,8 +685,8 @@ internal BackgroundRequest_DEPRECATED CreateBackgroundRequest(FSharpSourceBase_D // Implemented in FSharpLanguageService.fs internal abstract BackgroundRequest_DEPRECATED CreateBackgroundRequest(int line, int col, TokenInfo info, string sourceText, ITextSnapshot snapshot, MethodTipMiscellany_DEPRECATED methodTipMiscellany, string fname, BackgroundRequestReason reason, IVsTextView view,AuthoringSink sink, ISource source, int timestamp, bool synchronous); - // Implemented in FSharpLanguageService.fs - internal abstract void OnParseFileOrCheckFileComplete(BackgroundRequest_DEPRECATED req); + // Implemented in FSharpLanguageService.fs + internal abstract void OnParseFileOrCheckFileComplete(BackgroundRequest_DEPRECATED req); internal void EnsureBackgroundThreadStarted() { diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OAFileItem.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OAFileItem.cs index 1d78317e97..02480c0972 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OAFileItem.cs +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OAFileItem.cs @@ -15,7 +15,6 @@ using System.Diagnostics.CodeAnalysis; using System.Globalization; using Microsoft.VisualStudio.FSharp.ProjectSystem; -using Microsoft.VisualStudio.FSharp.LanguageService; namespace Microsoft.VisualStudio.FSharp.ProjectSystem.Automation { diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OAFolderItem.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OAFolderItem.cs index d3c6b2edc2..af1fadcee6 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OAFolderItem.cs +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OAFolderItem.cs @@ -13,7 +13,6 @@ using EnvDTE; using System.Diagnostics.CodeAnalysis; using Microsoft.VisualStudio.FSharp.ProjectSystem; -using Microsoft.VisualStudio.FSharp.LanguageService; namespace Microsoft.VisualStudio.FSharp.ProjectSystem.Automation { diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OANavigableProjectItems.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OANavigableProjectItems.cs index 00856b2e54..6c2ae1e591 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OANavigableProjectItems.cs +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OANavigableProjectItems.cs @@ -13,7 +13,6 @@ using Microsoft.VisualStudio.OLE.Interop; using System.Diagnostics.CodeAnalysis; using Microsoft.VisualStudio.FSharp.ProjectSystem; -using Microsoft.VisualStudio.FSharp.LanguageService; namespace Microsoft.VisualStudio.FSharp.ProjectSystem.Automation { diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OAProject.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OAProject.cs index 985f641888..412c70e0c9 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OAProject.cs +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OAProject.cs @@ -15,7 +15,6 @@ using EnvDTE; using System.Globalization; using Microsoft.VisualStudio.FSharp.ProjectSystem; -using Microsoft.VisualStudio.FSharp.LanguageService; namespace Microsoft.VisualStudio.FSharp.ProjectSystem.Automation { diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OAProjectItem.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OAProjectItem.cs index 30f5ba319f..90dc6bfec7 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OAProjectItem.cs +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OAProjectItem.cs @@ -12,7 +12,6 @@ using Microsoft.VisualStudio.OLE.Interop; using EnvDTE; using Microsoft.VisualStudio.FSharp.ProjectSystem; -using Microsoft.VisualStudio.FSharp.LanguageService; namespace Microsoft.VisualStudio.FSharp.ProjectSystem.Automation diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OAProjectItems.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OAProjectItems.cs index 7b03444742..a9e5c8aff4 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OAProjectItems.cs +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OAProjectItems.cs @@ -16,8 +16,6 @@ using System.Diagnostics.CodeAnalysis; using System.Globalization; using Microsoft.VisualStudio.FSharp.ProjectSystem; -using Microsoft.VisualStudio.FSharp.LanguageService; - namespace Microsoft.VisualStudio.FSharp.ProjectSystem.Automation { diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OAProperties.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OAProperties.cs index 86b2369a6c..f8079efb6b 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OAProperties.cs +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OAProperties.cs @@ -14,7 +14,6 @@ using System.Diagnostics.CodeAnalysis; using System.Globalization; using Microsoft.VisualStudio.FSharp.ProjectSystem; -using Microsoft.VisualStudio.FSharp.LanguageService; namespace Microsoft.VisualStudio.FSharp.ProjectSystem.Automation { diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/VSProject/OAReferenceBase.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/VSProject/OAReferenceBase.cs index 6b819efea6..47190a2b7f 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/VSProject/OAReferenceBase.cs +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/VSProject/OAReferenceBase.cs @@ -6,7 +6,6 @@ using Microsoft.VisualStudio.FSharp.ProjectSystem; using VSLangProj; using System.Diagnostics.CodeAnalysis; -using Microsoft.VisualStudio.FSharp.LanguageService; namespace Microsoft.VisualStudio.FSharp.ProjectSystem.Automation { diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/VSProject/OAReferences.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/VSProject/OAReferences.cs index 474acd48c3..bd6be170d2 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/VSProject/OAReferences.cs +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/VSProject/OAReferences.cs @@ -11,7 +11,6 @@ using VSLangProj; using System.Collections; using System.Diagnostics.CodeAnalysis; -using Microsoft.VisualStudio.FSharp.LanguageService; namespace Microsoft.VisualStudio.FSharp.ProjectSystem.Automation { diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ConfigurationProperties.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ConfigurationProperties.cs index b553ef663d..ce799dbfe2 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ConfigurationProperties.cs +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ConfigurationProperties.cs @@ -11,7 +11,6 @@ using System.IO; using System.Linq; using System.Collections.Generic; -using Microsoft.VisualStudio.FSharp.LanguageService; namespace Microsoft.VisualStudio.FSharp.ProjectSystem { diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/HierarchyNode.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/HierarchyNode.cs index 7d8bcaa1be..f26be0429f 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/HierarchyNode.cs +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/HierarchyNode.cs @@ -3172,7 +3172,7 @@ string newTargetFrameworkMoniker // replace existing fscore with one that has matching version with current target framework var existingFsCore = - Microsoft.VisualStudio.FSharp.LanguageService.UIThread.DoOnUIThread( + UIThread.DoOnUIThread( () => references .OfType() .FirstOrDefault(r => r.Name == fsCoreName.Name && r.PublicKeyToken == Utilities.FsCorePublicKeyToken && r.Culture == fsCoreName.CultureName) @@ -3180,7 +3180,7 @@ string newTargetFrameworkMoniker if (existingFsCore != null) { - Microsoft.VisualStudio.FSharp.LanguageService.UIThread.DoOnUIThread(() => + UIThread.DoOnUIThread(() => { // save copyLocal value - after calling existingFsCore.Remove() becomes invalid and can raise exceptions var copyLocal = existingFsCore.CopyLocal; diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/IDEBuildLogger.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/IDEBuildLogger.cs index 9c14f377ca..edb1883ff8 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/IDEBuildLogger.cs +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/IDEBuildLogger.cs @@ -14,7 +14,6 @@ using Microsoft.VisualStudio.TextManager.Interop; using Microsoft.Win32; using IOleServiceProvider = Microsoft.VisualStudio.OLE.Interop.IServiceProvider; -using Microsoft.VisualStudio.FSharp.LanguageService; namespace Microsoft.VisualStudio.FSharp.ProjectSystem { @@ -251,22 +250,22 @@ private void AddToErrorList( span.iEndLine = endLine < startLine ? span.iStartLine : endLine; span.iEndIndex = (endColumn < startColumn) && (span.iStartLine == span.iEndLine) ? span.iStartIndex : endColumn; - if (OutputWindowPane != null - && (this.Verbosity != LoggerVerbosity.Quiet || errorEvent is BuildErrorEventArgs)) - { - // Format error and output it to the output window - string message = this.FormatMessage(errorEvent.Message); + if (OutputWindowPane != null + && (this.Verbosity != LoggerVerbosity.Quiet || errorEvent is BuildErrorEventArgs)) + { + // Format error and output it to the output window + string message = this.FormatMessage(errorEvent.Message); DefaultCompilerError e = new DefaultCompilerError(file, span.iStartLine, span.iStartIndex, span.iEndLine, span.iEndIndex, errorCode, - message); - e.IsWarning = isWarning; + message); + e.IsWarning = isWarning; - Output(GetFormattedErrorMessage(e)); - } + Output(GetFormattedErrorMessage(e)); + } UIThread.Run(delegate() { diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/NodeProperties.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/NodeProperties.cs index 13ca5d368d..bf72d2f473 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/NodeProperties.cs +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/NodeProperties.cs @@ -20,7 +20,6 @@ using IOleServiceProvider = Microsoft.VisualStudio.OLE.Interop.IServiceProvider; using IServiceProvider = System.IServiceProvider; using System.Diagnostics.CodeAnalysis; -using Microsoft.VisualStudio.FSharp.LanguageService; using System.Runtime.Versioning; namespace Microsoft.VisualStudio.FSharp.ProjectSystem diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectConfig.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectConfig.cs index 44a3bfa5dd..41832e24b2 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectConfig.cs +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectConfig.cs @@ -12,7 +12,6 @@ using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Linq; -using Microsoft.VisualStudio.FSharp.LanguageService; using Microsoft.Win32; namespace Microsoft.VisualStudio.FSharp.ProjectSystem diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectNode.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectNode.cs index fae3278f5d..c69c4a1229 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectNode.cs +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectNode.cs @@ -35,8 +35,6 @@ using System.Diagnostics.CodeAnalysis; using System.Linq; using Microsoft.Build.Execution; - -using Microsoft.VisualStudio.FSharp.LanguageService; using Microsoft.VisualStudio.TextManager.Interop; namespace Microsoft.VisualStudio.FSharp.ProjectSystem diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectReferenceNode.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectReferenceNode.cs index 850f0ea2ed..e843985a16 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectReferenceNode.cs +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectReferenceNode.cs @@ -244,7 +244,7 @@ public void DropReferencedProjectCache() /// public void CleanProjectReferenceErrorState() { - Microsoft.VisualStudio.FSharp.LanguageService.UIThread.DoOnUIThread(() => + UIThread.DoOnUIThread(() => { if (projectRefError != null) { @@ -262,7 +262,7 @@ public void CleanProjectReferenceErrorState() /// private void SetError(string text) { - Microsoft.VisualStudio.FSharp.LanguageService.UIThread.DoOnUIThread(() => + UIThread.DoOnUIThread(() => { // delete existing error if exists CleanProjectReferenceErrorState(); @@ -295,7 +295,7 @@ private void SetProjectReferencesHigherVersionWarningMessage() /// public void RefreshProjectReferenceErrorState() { - Microsoft.VisualStudio.FSharp.LanguageService.UIThread.DoOnUIThread(() => + UIThread.DoOnUIThread(() => { CleanProjectReferenceErrorState(); diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/UIThread.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/UIThread.cs index 1a0bb06e4e..e35eccd131 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/UIThread.cs +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/UIThread.cs @@ -21,7 +21,7 @@ using VsShell = Microsoft.VisualStudio.Shell.VsShellUtilities; using System.Diagnostics.CodeAnalysis; -namespace Microsoft.VisualStudio.FSharp.LanguageService +namespace Microsoft.VisualStudio.FSharp.ProjectSystem { internal static class UIThread { diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/Project.fs b/vsintegration/src/FSharp.ProjectSystem.FSharp/Project.fs index 33bb1245c6..d33ea17447 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/Project.fs +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/Project.fs @@ -200,7 +200,8 @@ namespace rec Microsoft.VisualStudio.FSharp.ProjectSystem resourceValue override this.Initialize() = - UIThread.CaptureSynchronizationContext() + Microsoft.VisualStudio.FSharp.LanguageService.UIThread.CaptureSynchronizationContext() + Microsoft.VisualStudio.FSharp.ProjectSystem.UIThread.CaptureSynchronizationContext() base.Initialize() diff --git a/vsintegration/tests/UnitTests/TestLib.Utils.fs b/vsintegration/tests/UnitTests/TestLib.Utils.fs index 378e0ee25b..377384039c 100644 --- a/vsintegration/tests/UnitTests/TestLib.Utils.fs +++ b/vsintegration/tests/UnitTests/TestLib.Utils.fs @@ -52,6 +52,7 @@ module Asserts = module UIStuff = let SetupSynchronizationContext() = + Microsoft.VisualStudio.FSharp.ProjectSystem.UIThread.InitUnitTestingMode() Microsoft.VisualStudio.FSharp.LanguageService.UIThread.InitUnitTestingMode() module FilesystemHelpers = From 929920738fefd55d56ee3dc55a58f6448745ec0e Mon Sep 17 00:00:00 2001 From: Kevin Ransom Date: Fri, 8 Jun 2018 16:10:35 -0700 Subject: [PATCH 034/150] Remove ValueTuple 4.3.1 from vsix deployment --- build/config/AssemblySignToolData.json | 1 - packages.config | 1 - vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj | 5 ----- 3 files changed, 7 deletions(-) diff --git a/build/config/AssemblySignToolData.json b/build/config/AssemblySignToolData.json index 00dc796e59..14918028cf 100644 --- a/build/config/AssemblySignToolData.json +++ b/build/config/AssemblySignToolData.json @@ -68,7 +68,6 @@ "Newtonsoft.Json.dll", "System.Collections.Immutable.dll", "System.Reflection.Metadata.dll", - "System.ValueTuple.4.3.1.nupkg", "System.ValueTuple.4.4.0.nupkg", "System.ValueTuple.dll" ] diff --git a/packages.config b/packages.config index 5fa5156e43..20abd791e7 100644 --- a/packages.config +++ b/packages.config @@ -17,7 +17,6 @@ - diff --git a/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj b/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj index e85f7b6f98..ff312730c5 100644 --- a/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj +++ b/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj @@ -28,11 +28,6 @@ packages\FSharp.Core.4.3.4.nupkg true - - PreserveNewest - packages\System.ValueTuple.4.3.1.nupkg - true - PreserveNewest packages\System.ValueTuple.4.4.0.nupkg From 13896d0b92dbdbd2d12dacfcce0b1c2a23d2a0e2 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Mon, 11 Jun 2018 14:11:52 -0700 Subject: [PATCH 035/150] Update default fsharp.core to 4.5.0 and valuetuple to 4.4.0 for dotnet sdk apps (#5152) * Update default fsharp.core to 4.5.0 and valuetuple to 4.4.0 for dotnet sdk apps * FCS --- .../FSharp.Compiler.Service.MSBuild.v12.fsproj | 1 + .../FSharp.Compiler.Service.ProjectCracker.fsproj | 1 + .../FSharp.Compiler.Service.ProjectCrackerTool.fsproj | 1 + .../FSharp.Compiler.Service.Tests.fsproj | 1 + fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj | 1 + fcs/samples/EditorService/EditorService.fsproj | 1 + fcs/samples/FscExe/FscExe.fsproj | 1 + fcs/samples/FsiExe/FsiExe.fsproj | 1 + fcs/samples/InteractiveService/InteractiveService.fsproj | 1 + fcs/samples/Tokenizer/Tokenizer.fsproj | 1 + fcs/samples/UntypedTree/UntypedTree.fsproj | 1 + src/fsharp/FSharp.Build/Microsoft.FSharp.NetSdk.props | 4 ++-- tests/fsharp/core/samename/tempet.fsproj | 7 +------ tests/service/data/samename/tempet.fsproj | 6 +----- 14 files changed, 15 insertions(+), 13 deletions(-) diff --git a/fcs/FSharp.Compiler.Service.MSBuild.v12/FSharp.Compiler.Service.MSBuild.v12.fsproj b/fcs/FSharp.Compiler.Service.MSBuild.v12/FSharp.Compiler.Service.MSBuild.v12.fsproj index 04068b1784..1f229a322c 100644 --- a/fcs/FSharp.Compiler.Service.MSBuild.v12/FSharp.Compiler.Service.MSBuild.v12.fsproj +++ b/fcs/FSharp.Compiler.Service.MSBuild.v12/FSharp.Compiler.Service.MSBuild.v12.fsproj @@ -6,6 +6,7 @@ net45 + true ..\..\$(Configuration.ToLower())\fcs $(DefineConstants);CROSS_PLATFORM_COMPILER $(DefineConstants);ENABLE_MONO_SUPPORT diff --git a/fcs/FSharp.Compiler.Service.ProjectCracker/FSharp.Compiler.Service.ProjectCracker.fsproj b/fcs/FSharp.Compiler.Service.ProjectCracker/FSharp.Compiler.Service.ProjectCracker.fsproj index da847099c0..c86a069ed7 100644 --- a/fcs/FSharp.Compiler.Service.ProjectCracker/FSharp.Compiler.Service.ProjectCracker.fsproj +++ b/fcs/FSharp.Compiler.Service.ProjectCracker/FSharp.Compiler.Service.ProjectCracker.fsproj @@ -6,6 +6,7 @@ net45 + true ..\..\$(Configuration.ToLower())\fcs diff --git a/fcs/FSharp.Compiler.Service.ProjectCrackerTool/FSharp.Compiler.Service.ProjectCrackerTool.fsproj b/fcs/FSharp.Compiler.Service.ProjectCrackerTool/FSharp.Compiler.Service.ProjectCrackerTool.fsproj index 7034715245..8b701c586f 100644 --- a/fcs/FSharp.Compiler.Service.ProjectCrackerTool/FSharp.Compiler.Service.ProjectCrackerTool.fsproj +++ b/fcs/FSharp.Compiler.Service.ProjectCrackerTool/FSharp.Compiler.Service.ProjectCrackerTool.fsproj @@ -7,6 +7,7 @@ Exe net45 + true $(DefineConstants);CROSS_PLATFORM_COMPILER $(DefineConstants);ENABLE_MONO_SUPPORT $(OtherFlags) --staticlink:FSharp.Core diff --git a/fcs/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj b/fcs/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj index e6c52607c9..6872772ba1 100644 --- a/fcs/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj +++ b/fcs/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj @@ -6,6 +6,7 @@ net46;netcoreapp2.0 + true $(NoWarn);44;75; true true diff --git a/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj b/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj index 489b9188a2..5e1db94e1a 100644 --- a/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj +++ b/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj @@ -6,6 +6,7 @@ net45;netstandard2.0 + true $(DefineConstants);COMPILER_SERVICE_AS_DLL $(DefineConstants);COMPILER $(DefineConstants);ENABLE_MONO_SUPPORT diff --git a/fcs/samples/EditorService/EditorService.fsproj b/fcs/samples/EditorService/EditorService.fsproj index f68de82cb0..7066f79c8f 100644 --- a/fcs/samples/EditorService/EditorService.fsproj +++ b/fcs/samples/EditorService/EditorService.fsproj @@ -3,6 +3,7 @@ net46;netcoreapp2.0 + true Exe false diff --git a/fcs/samples/FscExe/FscExe.fsproj b/fcs/samples/FscExe/FscExe.fsproj index 253ba8c7cc..c482656827 100644 --- a/fcs/samples/FscExe/FscExe.fsproj +++ b/fcs/samples/FscExe/FscExe.fsproj @@ -3,6 +3,7 @@ net46 + true Exe false $(DefineConstants);RESIDENT_COMPILER diff --git a/fcs/samples/FsiExe/FsiExe.fsproj b/fcs/samples/FsiExe/FsiExe.fsproj index c0468d9feb..7377f2c291 100644 --- a/fcs/samples/FsiExe/FsiExe.fsproj +++ b/fcs/samples/FsiExe/FsiExe.fsproj @@ -3,6 +3,7 @@ net46 + true Exe false diff --git a/fcs/samples/InteractiveService/InteractiveService.fsproj b/fcs/samples/InteractiveService/InteractiveService.fsproj index bae4532d87..7aa4249726 100644 --- a/fcs/samples/InteractiveService/InteractiveService.fsproj +++ b/fcs/samples/InteractiveService/InteractiveService.fsproj @@ -3,6 +3,7 @@ net46 + true Exe false diff --git a/fcs/samples/Tokenizer/Tokenizer.fsproj b/fcs/samples/Tokenizer/Tokenizer.fsproj index bae4532d87..7aa4249726 100644 --- a/fcs/samples/Tokenizer/Tokenizer.fsproj +++ b/fcs/samples/Tokenizer/Tokenizer.fsproj @@ -3,6 +3,7 @@ net46 + true Exe false diff --git a/fcs/samples/UntypedTree/UntypedTree.fsproj b/fcs/samples/UntypedTree/UntypedTree.fsproj index bae4532d87..7aa4249726 100644 --- a/fcs/samples/UntypedTree/UntypedTree.fsproj +++ b/fcs/samples/UntypedTree/UntypedTree.fsproj @@ -3,6 +3,7 @@ net46 + true Exe false diff --git a/src/fsharp/FSharp.Build/Microsoft.FSharp.NetSdk.props b/src/fsharp/FSharp.Build/Microsoft.FSharp.NetSdk.props index 6972f3fa8f..ec9a9c4f87 100644 --- a/src/fsharp/FSharp.Build/Microsoft.FSharp.NetSdk.props +++ b/src/fsharp/FSharp.Build/Microsoft.FSharp.NetSdk.props @@ -72,8 +72,8 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and - 4.3.1 - 4.3.4 + 4.4.0 + 4.5.0 $(DefaultValueTuplePackageVersion) $(DefaultFSharpCorePackageVersion) diff --git a/tests/fsharp/core/samename/tempet.fsproj b/tests/fsharp/core/samename/tempet.fsproj index 66280fa2b6..d6ac10eab9 100644 --- a/tests/fsharp/core/samename/tempet.fsproj +++ b/tests/fsharp/core/samename/tempet.fsproj @@ -1,4 +1,4 @@ - + netstandard1.6 @@ -15,9 +15,4 @@ - - - - - diff --git a/tests/service/data/samename/tempet.fsproj b/tests/service/data/samename/tempet.fsproj index 8e647890c8..682a3ec1a3 100644 --- a/tests/service/data/samename/tempet.fsproj +++ b/tests/service/data/samename/tempet.fsproj @@ -1,4 +1,4 @@ - + netstandard1.6 @@ -6,8 +6,4 @@ - - - - \ No newline at end of file From 5ff8b334ed924ea15c52bfd75ea0b4b122afd037 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Mon, 11 Jun 2018 18:40:59 -0700 Subject: [PATCH 036/150] don't unconditionally deploy templates package; it can lock the build machines --- .../Vsix/VisualFSharpTemplates/VisualFSharpTemplates.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vsintegration/Vsix/VisualFSharpTemplates/VisualFSharpTemplates.csproj b/vsintegration/Vsix/VisualFSharpTemplates/VisualFSharpTemplates.csproj index fc25dfbe59..c3a446ae60 100644 --- a/vsintegration/Vsix/VisualFSharpTemplates/VisualFSharpTemplates.csproj +++ b/vsintegration/Vsix/VisualFSharpTemplates/VisualFSharpTemplates.csproj @@ -7,7 +7,7 @@ net46 Library Microsoft\FSharpTemplates - true + false From 0e1c9c0e79fbc3f1e43c84631c884047da020f4a Mon Sep 17 00:00:00 2001 From: Tomas Matousek Date: Mon, 11 Jun 2018 13:45:47 -0700 Subject: [PATCH 037/150] Update SCI, SRM to the latest RTM packages --- NuGet.Config | 1 - build/targets/PackageVersions.props | 2 +- fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj | 4 ++-- fcs/samples/EditorService/EditorService.fsproj | 2 +- packages.config | 4 ++-- setup/packages.config | 4 ++-- src/FSharpSource.Settings.targets | 2 +- .../FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj | 4 ++-- .../FSharp.Compiler.Private.netcore.nuspec | 4 ++-- src/fsharp/FSharp.Compiler.Private/project.json | 4 ++-- .../FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuspec | 4 ++-- .../FSharp.Compiler.nuget/Testing.FSharp.Compiler.nuspec | 4 ++-- src/fsharp/Fsc-proto/Fsc-proto.fsproj | 4 ++-- src/fsharp/Fsc-proto/app.config | 2 +- src/fsharp/Fsc/app.config | 2 +- src/fsharp/Fsc/project.json | 2 +- src/fsharp/fsi/app.config | 2 +- src/fsharp/fsi/project.json | 2 +- src/fsharp/fsiAnyCpu/app.config | 2 +- tests/fsharp/FSharp.Tests.FSharpSuite.fsproj | 4 ++-- tests/fsharp/app.config | 2 +- tests/fsharp/packages.config | 4 ++-- tests/fsharpqa/testenv/src/HostedCompilerServer/App.config | 2 +- .../tests/UnitTests/VisualFSharp.UnitTests.dll.config | 2 +- 24 files changed, 34 insertions(+), 35 deletions(-) diff --git a/NuGet.Config b/NuGet.Config index 372e8b1c31..c89208eb6d 100644 --- a/NuGet.Config +++ b/NuGet.Config @@ -15,7 +15,6 @@ - diff --git a/build/targets/PackageVersions.props b/build/targets/PackageVersions.props index b56251e723..f4bcf0d7ba 100644 --- a/build/targets/PackageVersions.props +++ b/build/targets/PackageVersions.props @@ -6,7 +6,7 @@ $([System.IO.File]::ReadAllText('$(MSBuildThisFileDirectory)..\..\RoslynPackageVersion.txt').Trim()) - 1.3.1 + 1.5.0 $(RoslynPackageVersion) diff --git a/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj b/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj index 5e1db94e1a..1705a3c3bd 100644 --- a/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj +++ b/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj @@ -636,8 +636,8 @@ - - + + diff --git a/fcs/samples/EditorService/EditorService.fsproj b/fcs/samples/EditorService/EditorService.fsproj index 7066f79c8f..05847e67f9 100644 --- a/fcs/samples/EditorService/EditorService.fsproj +++ b/fcs/samples/EditorService/EditorService.fsproj @@ -14,7 +14,7 @@ - + diff --git a/packages.config b/packages.config index caf79970a4..c09a626345 100644 --- a/packages.config +++ b/packages.config @@ -15,8 +15,8 @@ - - + + diff --git a/setup/packages.config b/setup/packages.config index f62527d8ca..930e870e4b 100644 --- a/setup/packages.config +++ b/setup/packages.config @@ -1,7 +1,7 @@ - - + + diff --git a/src/FSharpSource.Settings.targets b/src/FSharpSource.Settings.targets index 3fb2ba1bc6..b4b4f9f940 100644 --- a/src/FSharpSource.Settings.targets +++ b/src/FSharpSource.Settings.targets @@ -88,7 +88,7 @@ 15.0.26201 - 1.3.1 + 1.5.0 Microsoft.VSSDK.BuildTools.15.1.192 15.3.23 diff --git a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj index 989a9970ee..0a3da05652 100644 --- a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj +++ b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj @@ -675,10 +675,10 @@ - ..\..\..\packages\System.Reflection.Metadata.1.4.2\lib\portable-net45+win8\System.Reflection.Metadata.dll + ..\..\..\packages\System.Reflection.Metadata.1.6.0\lib\netstandard1.1\System.Reflection.Metadata.dll - ..\..\..\packages\System.Collections.Immutable.$(SystemCollectionsImmutableVersion)\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll + ..\..\..\packages\System.Collections.Immutable.$(SystemCollectionsImmutableVersion)\lib\netstandard1.3\System.Collections.Immutable.dll ..\..\..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll diff --git a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.netcore.nuspec b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.netcore.nuspec index 5f1ffaf131..dc8c6aa297 100644 --- a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.netcore.nuspec +++ b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.netcore.nuspec @@ -16,14 +16,14 @@ - + - + diff --git a/src/fsharp/FSharp.Compiler.Private/project.json b/src/fsharp/FSharp.Compiler.Private/project.json index 5a42750905..46a8b02f9b 100644 --- a/src/fsharp/FSharp.Compiler.Private/project.json +++ b/src/fsharp/FSharp.Compiler.Private/project.json @@ -1,14 +1,14 @@ { "dependencies": { "NETStandard.Library": "1.6.1", - "System.Collections.Immutable":"1.3.1", + "System.Collections.Immutable": "1.5.0", "System.Diagnostics.Process": "4.3.0", "System.Diagnostics.TraceSource": "4.3.0", "System.Linq.Expressions": "4.3.0", "System.Linq.Queryable": "4.3.0", "System.Net.Requests": "4.3.0", "System.Reflection.Emit": "4.3.0", - "System.Reflection.Metadata": "1.4.2", + "System.Reflection.Metadata": "1.6.0", "System.Reflection.TypeExtensions": "4.3.0", "System.Runtime": "4.3.0", "System.Runtime.InteropServices": "4.3.0", diff --git a/src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuspec b/src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuspec index e26b6dd36e..7e887dd6d6 100644 --- a/src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuspec +++ b/src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuspec @@ -18,7 +18,7 @@ - + @@ -26,7 +26,7 @@ - + diff --git a/src/fsharp/FSharp.Compiler.nuget/Testing.FSharp.Compiler.nuspec b/src/fsharp/FSharp.Compiler.nuget/Testing.FSharp.Compiler.nuspec index e512806ebc..2f5c7e4aab 100644 --- a/src/fsharp/FSharp.Compiler.nuget/Testing.FSharp.Compiler.nuspec +++ b/src/fsharp/FSharp.Compiler.nuget/Testing.FSharp.Compiler.nuspec @@ -16,7 +16,7 @@ - + @@ -24,7 +24,7 @@ - + diff --git a/src/fsharp/Fsc-proto/Fsc-proto.fsproj b/src/fsharp/Fsc-proto/Fsc-proto.fsproj index 4577e7535b..0b3e27226f 100644 --- a/src/fsharp/Fsc-proto/Fsc-proto.fsproj +++ b/src/fsharp/Fsc-proto/Fsc-proto.fsproj @@ -461,10 +461,10 @@ - $(FSharpSourcesRoot)\..\packages\System.Reflection.Metadata.1.4.2\lib\portable-net45+win8\System.Reflection.Metadata.dll + $(FSharpSourcesRoot)\..\packages\System.Reflection.Metadata.1.6.0\lib\netstandard1.1\System.Reflection.Metadata.dll - $(FSharpSourcesRoot)\..\packages\System.Collections.Immutable.$(SystemCollectionsImmutableVersion)\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll + $(FSharpSourcesRoot)\..\packages\System.Collections.Immutable.$(SystemCollectionsImmutableVersion)\lib\netstandard1.3\System.Collections.Immutable.dll $(FSharpSourcesRoot)\..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll diff --git a/src/fsharp/Fsc-proto/app.config b/src/fsharp/Fsc-proto/app.config index 46b5e39962..be4549ea2d 100644 --- a/src/fsharp/Fsc-proto/app.config +++ b/src/fsharp/Fsc-proto/app.config @@ -4,7 +4,7 @@ - + diff --git a/src/fsharp/Fsc/app.config b/src/fsharp/Fsc/app.config index f8b3fb396b..80d8576365 100644 --- a/src/fsharp/Fsc/app.config +++ b/src/fsharp/Fsc/app.config @@ -10,7 +10,7 @@ - + diff --git a/src/fsharp/Fsc/project.json b/src/fsharp/Fsc/project.json index 9c96ba5a00..09458a531e 100644 --- a/src/fsharp/Fsc/project.json +++ b/src/fsharp/Fsc/project.json @@ -3,7 +3,7 @@ "Microsoft.NETCore.Platforms": "1.1.0", "NETStandard.Library": "1.6.1", "System.Linq.Expressions": "4.3.0", - "System.Reflection.Metadata": "1.4.2", + "System.Reflection.Metadata": "1.6.0", "System.Runtime.Loader": "4.3.0" }, "runtimes": { diff --git a/src/fsharp/fsi/app.config b/src/fsharp/fsi/app.config index df4baf6b49..e6feb514fa 100644 --- a/src/fsharp/fsi/app.config +++ b/src/fsharp/fsi/app.config @@ -9,7 +9,7 @@ - + diff --git a/src/fsharp/fsi/project.json b/src/fsharp/fsi/project.json index 8c336a3e67..8fdb41c7a8 100644 --- a/src/fsharp/fsi/project.json +++ b/src/fsharp/fsi/project.json @@ -8,7 +8,7 @@ "System.Reflection.TypeExtensions": "4.3.0", "System.Runtime.Loader": "4.3.0", "System.Threading.Thread": "4.3.0", - "System.Reflection.Metadata": "1.4.2" + "System.Reflection.Metadata": "1.6.0" }, "runtimes": { "win7-x86": { }, diff --git a/src/fsharp/fsiAnyCpu/app.config b/src/fsharp/fsiAnyCpu/app.config index 231a002c17..a7514bd602 100644 --- a/src/fsharp/fsiAnyCpu/app.config +++ b/src/fsharp/fsiAnyCpu/app.config @@ -10,7 +10,7 @@ - + diff --git a/tests/fsharp/FSharp.Tests.FSharpSuite.fsproj b/tests/fsharp/FSharp.Tests.FSharpSuite.fsproj index 20052813a6..c80bb8cc7a 100644 --- a/tests/fsharp/FSharp.Tests.FSharpSuite.fsproj +++ b/tests/fsharp/FSharp.Tests.FSharpSuite.fsproj @@ -46,11 +46,11 @@ - $(FSharpSourcesRoot)\..\packages\System.Collections.Immutable.$(SystemCollectionsImmutableVersion)\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll + $(FSharpSourcesRoot)\..\packages\System.Collections.Immutable.$(SystemCollectionsImmutableVersion)\lib\netstandard1.3\System.Collections.Immutable.dll True - $(FSharpSourcesRoot)\..\packages\System.Reflection.Metadata.1.4.2\lib\portable-net45+win8\System.Reflection.Metadata.dll + $(FSharpSourcesRoot)\..\packages\System.Reflection.Metadata.1.6.0\lib\netstandard1.1\System.Reflection.Metadata.dll True diff --git a/tests/fsharp/app.config b/tests/fsharp/app.config index bd1c9c33df..b64cfc5852 100644 --- a/tests/fsharp/app.config +++ b/tests/fsharp/app.config @@ -4,7 +4,7 @@ - + diff --git a/tests/fsharp/packages.config b/tests/fsharp/packages.config index 1d5c24f97f..cf755012d5 100644 --- a/tests/fsharp/packages.config +++ b/tests/fsharp/packages.config @@ -6,6 +6,6 @@ - - + + \ No newline at end of file diff --git a/tests/fsharpqa/testenv/src/HostedCompilerServer/App.config b/tests/fsharpqa/testenv/src/HostedCompilerServer/App.config index 885af92830..ab88e62ffc 100644 --- a/tests/fsharpqa/testenv/src/HostedCompilerServer/App.config +++ b/tests/fsharpqa/testenv/src/HostedCompilerServer/App.config @@ -13,7 +13,7 @@ - + diff --git a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.dll.config b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.dll.config index 9215b5d965..fbdc6fa374 100644 --- a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.dll.config +++ b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.dll.config @@ -41,7 +41,7 @@ - + From f5f2f0a2afe2f746150aea95b5ba0ad457a27246 Mon Sep 17 00:00:00 2001 From: Tomas Matousek Date: Tue, 12 Jun 2018 18:06:16 -0700 Subject: [PATCH 038/150] Use SCI netstandard1.0 --- .../FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj | 2 +- src/fsharp/Fsc-proto/Fsc-proto.fsproj | 2 +- tests/fsharp/FSharp.Tests.FSharpSuite.fsproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj index 0a3da05652..fdda3ce7c8 100644 --- a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj +++ b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj @@ -678,7 +678,7 @@ ..\..\..\packages\System.Reflection.Metadata.1.6.0\lib\netstandard1.1\System.Reflection.Metadata.dll - ..\..\..\packages\System.Collections.Immutable.$(SystemCollectionsImmutableVersion)\lib\netstandard1.3\System.Collections.Immutable.dll + ..\..\..\packages\System.Collections.Immutable.$(SystemCollectionsImmutableVersion)\lib\netstandard1.0\System.Collections.Immutable.dll ..\..\..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll diff --git a/src/fsharp/Fsc-proto/Fsc-proto.fsproj b/src/fsharp/Fsc-proto/Fsc-proto.fsproj index 0b3e27226f..b4f86c8943 100644 --- a/src/fsharp/Fsc-proto/Fsc-proto.fsproj +++ b/src/fsharp/Fsc-proto/Fsc-proto.fsproj @@ -464,7 +464,7 @@ $(FSharpSourcesRoot)\..\packages\System.Reflection.Metadata.1.6.0\lib\netstandard1.1\System.Reflection.Metadata.dll - $(FSharpSourcesRoot)\..\packages\System.Collections.Immutable.$(SystemCollectionsImmutableVersion)\lib\netstandard1.3\System.Collections.Immutable.dll + $(FSharpSourcesRoot)\..\packages\System.Collections.Immutable.$(SystemCollectionsImmutableVersion)\lib\netstandard1.0\System.Collections.Immutable.dll $(FSharpSourcesRoot)\..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll diff --git a/tests/fsharp/FSharp.Tests.FSharpSuite.fsproj b/tests/fsharp/FSharp.Tests.FSharpSuite.fsproj index c80bb8cc7a..066de62f40 100644 --- a/tests/fsharp/FSharp.Tests.FSharpSuite.fsproj +++ b/tests/fsharp/FSharp.Tests.FSharpSuite.fsproj @@ -46,7 +46,7 @@ - $(FSharpSourcesRoot)\..\packages\System.Collections.Immutable.$(SystemCollectionsImmutableVersion)\lib\netstandard1.3\System.Collections.Immutable.dll + $(FSharpSourcesRoot)\..\packages\System.Collections.Immutable.$(SystemCollectionsImmutableVersion)\lib\netstandard1.0\System.Collections.Immutable.dll True From d8c7a8d810f56d04ed02f1fe013a63c764b6cf8b Mon Sep 17 00:00:00 2001 From: Don Syme Date: Wed, 13 Jun 2018 12:43:39 +0100 Subject: [PATCH 039/150] fix mono build/install --- mono/config.make | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mono/config.make b/mono/config.make index f7002c1119..91351b8ef8 100644 --- a/mono/config.make +++ b/mono/config.make @@ -212,11 +212,11 @@ install-sdk-lib: $(INSTALL_LIB) $(outdir)Microsoft.FSharp.NetSdk.targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v14.0/FSharp/; \ $(INSTALL_LIB) $(outdir)Microsoft.FSharp.NetSdk.targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v15.0/FSharp/; \ \ - $(INSTALL_LIB) $(outdir)Microsoft.FSharp.NetSdk.Overrides.targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v/FSharp/; \ - $(INSTALL_LIB) $(outdir)Microsoft.FSharp.NetSdk.Overrides.targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v11.0/FSharp/; \ - $(INSTALL_LIB) $(outdir)Microsoft.FSharp.NetSdk.Overrides.targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v12.0/FSharp/; \ - $(INSTALL_LIB) $(outdir)Microsoft.FSharp.NetSdk.Overrides.targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v14.0/FSharp/; \ - $(INSTALL_LIB) $(outdir)Microsoft.FSharp.NetSdk.Overrides.targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v15.0/FSharp/; \ + $(INSTALL_LIB) $(outdir)Microsoft.FSharp.Overrides.NetSdk.targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v/FSharp/; \ + $(INSTALL_LIB) $(outdir)Microsoft.FSharp.Overrides.NetSdk.targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v11.0/FSharp/; \ + $(INSTALL_LIB) $(outdir)Microsoft.FSharp.Overrides.NetSdk.targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v12.0/FSharp/; \ + $(INSTALL_LIB) $(outdir)Microsoft.FSharp.Overrides.NetSdk.targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v14.0/FSharp/; \ + $(INSTALL_LIB) $(outdir)Microsoft.FSharp.Overrides.NetSdk.targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v15.0/FSharp/; \ fi @if test x-$(outsuffix) = x-net40; then \ if test -e $(outdir)$(NAME).dll; then \ From 43cbb79ef5bd925c32c62e1a3eb99f17c821a3a0 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Wed, 13 Jun 2018 13:51:00 +0100 Subject: [PATCH 040/150] revert change which used variable that was not defined --- .../Sample_VS2012_FSharp_ConsoleApp_net40.fsproj | 2 +- ...Sample_VS2012_FSharp_ConsoleApp_net40_upgraded_VS2013.fsproj | 2 +- .../Sample_VS2012_FSharp_Portable_Library.fsproj | 2 +- .../Sample_VS2012_FSharp_Portable_Library_upgraded_2013.fsproj | 2 +- .../Sample_VS2013_FSharp_Portable_Library_Legacy_net40.fsproj | 2 +- .../Sample_VS2013_FSharp_Portable_Library_Legacy_net45.fsproj | 2 +- .../Sample_VS2013_FSharp_Portable_Library_Legacy_net451.fsproj | 2 +- .../Sample_VS2013_FSharp_Portable_Library_net45.fsproj | 2 +- .../Sample_VS2013_FSharp_Portable_Library_net451.fsproj | 2 +- .../Sample_VS2013_FSharp_Portable_Library_net451.fsproj | 2 +- .../Sample_VS2013_FSharp_Portable_Library_net451.fsproj | 2 +- .../Sample_VS2015_FSharp_Portable259_Library.fsproj | 2 +- .../Sample_VS2015_FSharp_Portable47_Library.fsproj | 2 +- .../Sample_VS2015_FSharp_Portable78_Library.fsproj | 2 +- .../Sample_VS2015_FSharp_Portable7_Library.fsproj | 2 +- tests/service/data/DifferingOutputDir/Dir1/Test1.fsproj | 2 +- tests/service/data/DifferingOutputDir/Dir2/Test2.fsproj | 2 +- tests/service/data/FsAndFsiFiles.fsproj | 2 +- .../data/MultiLanguageProject/ConsoleApplication1.fsproj | 2 +- .../data/MultiLanguageProject/ConsoleApplication2.fsproj | 2 +- tests/service/data/TestProject/TestProject.fsproj | 2 +- tests/service/data/TestTP/TestTP.fsproj | 2 +- .../service/data/TypeProviderConsole/TypeProviderConsole.fsproj | 2 +- .../service/data/TypeProviderLibrary/TypeProviderLibrary.fsproj | 2 +- .../data/TypeProvidersBug/TestConsole/TestConsole.fsproj | 2 +- .../TypeProvidersBug/TypeProvidersBug/TypeProvidersBug.fsproj | 2 +- tests/service/data/sqlite-net-spike/sqlite-net-spike.fsproj | 2 +- 27 files changed, 27 insertions(+), 27 deletions(-) diff --git a/tests/projects/Sample_VS2012_FSharp_ConsoleApp_net40/Sample_VS2012_FSharp_ConsoleApp_net40/Sample_VS2012_FSharp_ConsoleApp_net40.fsproj b/tests/projects/Sample_VS2012_FSharp_ConsoleApp_net40/Sample_VS2012_FSharp_ConsoleApp_net40/Sample_VS2012_FSharp_ConsoleApp_net40.fsproj index 0b4c365d7b..bc17dde612 100644 --- a/tests/projects/Sample_VS2012_FSharp_ConsoleApp_net40/Sample_VS2012_FSharp_ConsoleApp_net40/Sample_VS2012_FSharp_ConsoleApp_net40.fsproj +++ b/tests/projects/Sample_VS2012_FSharp_ConsoleApp_net40/Sample_VS2012_FSharp_ConsoleApp_net40/Sample_VS2012_FSharp_ConsoleApp_net40.fsproj @@ -43,7 +43,7 @@ - ..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\portable-net45+sl5+netcore45\FSharp.Core.dll + ..\..\..\packages\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\portable-net45+sl5+netcore45\FSharp.Core.dll diff --git a/tests/projects/Sample_VS2012_FSharp_ConsoleApp_net40_upgraded_VS2013/Sample_VS2012_FSharp_ConsoleApp_net40_upgraded_VS2013/Sample_VS2012_FSharp_ConsoleApp_net40_upgraded_VS2013.fsproj b/tests/projects/Sample_VS2012_FSharp_ConsoleApp_net40_upgraded_VS2013/Sample_VS2012_FSharp_ConsoleApp_net40_upgraded_VS2013/Sample_VS2012_FSharp_ConsoleApp_net40_upgraded_VS2013.fsproj index ed2fa4ea5e..bc7a0ed88b 100644 --- a/tests/projects/Sample_VS2012_FSharp_ConsoleApp_net40_upgraded_VS2013/Sample_VS2012_FSharp_ConsoleApp_net40_upgraded_VS2013/Sample_VS2012_FSharp_ConsoleApp_net40_upgraded_VS2013.fsproj +++ b/tests/projects/Sample_VS2012_FSharp_ConsoleApp_net40_upgraded_VS2013/Sample_VS2012_FSharp_ConsoleApp_net40_upgraded_VS2013/Sample_VS2012_FSharp_ConsoleApp_net40_upgraded_VS2013.fsproj @@ -43,7 +43,7 @@ - ..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\portable-net45+sl5+netcore45\FSharp.Core.dll + ..\..\..\packages\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\portable-net45+sl5+netcore45\FSharp.Core.dll diff --git a/tests/projects/Sample_VS2012_FSharp_Portable_Library/Sample_VS2012_FSharp_Portable_Library.fsproj b/tests/projects/Sample_VS2012_FSharp_Portable_Library/Sample_VS2012_FSharp_Portable_Library.fsproj index 1bd9fcf104..9c27d79cb8 100644 --- a/tests/projects/Sample_VS2012_FSharp_Portable_Library/Sample_VS2012_FSharp_Portable_Library.fsproj +++ b/tests/projects/Sample_VS2012_FSharp_Portable_Library/Sample_VS2012_FSharp_Portable_Library.fsproj @@ -36,7 +36,7 @@ FSharp.Core FSharp.Core.dll - ..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\portable-net45+sl5+netcore45\FSharp.Core.dll + ..\..\..\packages\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\portable-net45+sl5+netcore45\FSharp.Core.dll diff --git a/tests/projects/Sample_VS2012_FSharp_Portable_Library_upgraded_2013/Sample_VS2012_FSharp_Portable_Library_upgraded_2013.fsproj b/tests/projects/Sample_VS2012_FSharp_Portable_Library_upgraded_2013/Sample_VS2012_FSharp_Portable_Library_upgraded_2013.fsproj index deff760e73..56d6c2b9cf 100644 --- a/tests/projects/Sample_VS2012_FSharp_Portable_Library_upgraded_2013/Sample_VS2012_FSharp_Portable_Library_upgraded_2013.fsproj +++ b/tests/projects/Sample_VS2012_FSharp_Portable_Library_upgraded_2013/Sample_VS2012_FSharp_Portable_Library_upgraded_2013.fsproj @@ -35,7 +35,7 @@ - ..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\portable-net45+sl5+netcore45\FSharp.Core.dll + ..\..\..\packages\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\portable-net45+sl5+netcore45\FSharp.Core.dll True diff --git a/tests/projects/Sample_VS2013_FSharp_Portable_Library_Legacy_net40/Sample_VS2013_FSharp_Portable_Library_Legacy_net40.fsproj b/tests/projects/Sample_VS2013_FSharp_Portable_Library_Legacy_net40/Sample_VS2013_FSharp_Portable_Library_Legacy_net40.fsproj index 14fe941407..7774a0a2c1 100644 --- a/tests/projects/Sample_VS2013_FSharp_Portable_Library_Legacy_net40/Sample_VS2013_FSharp_Portable_Library_Legacy_net40.fsproj +++ b/tests/projects/Sample_VS2013_FSharp_Portable_Library_Legacy_net40/Sample_VS2013_FSharp_Portable_Library_Legacy_net40.fsproj @@ -37,7 +37,7 @@ FSharp.Core FSharp.Core.dll - ..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\portable-net45+sl5+netcore45\FSharp.Core.dll + ..\..\..\packages\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\portable-net45+sl5+netcore45\FSharp.Core.dll diff --git a/tests/projects/Sample_VS2013_FSharp_Portable_Library_Legacy_net45/Sample_VS2013_FSharp_Portable_Library_Legacy_net45.fsproj b/tests/projects/Sample_VS2013_FSharp_Portable_Library_Legacy_net45/Sample_VS2013_FSharp_Portable_Library_Legacy_net45.fsproj index e541b68e46..906473f386 100644 --- a/tests/projects/Sample_VS2013_FSharp_Portable_Library_Legacy_net45/Sample_VS2013_FSharp_Portable_Library_Legacy_net45.fsproj +++ b/tests/projects/Sample_VS2013_FSharp_Portable_Library_Legacy_net45/Sample_VS2013_FSharp_Portable_Library_Legacy_net45.fsproj @@ -37,7 +37,7 @@ FSharp.Core FSharp.Core.dll - ..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\portable-net45+sl5+netcore45\FSharp.Core.dll + ..\..\..\packages\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\portable-net45+sl5+netcore45\FSharp.Core.dll diff --git a/tests/projects/Sample_VS2013_FSharp_Portable_Library_Legacy_net451/Sample_VS2013_FSharp_Portable_Library_Legacy_net451.fsproj b/tests/projects/Sample_VS2013_FSharp_Portable_Library_Legacy_net451/Sample_VS2013_FSharp_Portable_Library_Legacy_net451.fsproj index 207cd13232..68d22cdc7e 100644 --- a/tests/projects/Sample_VS2013_FSharp_Portable_Library_Legacy_net451/Sample_VS2013_FSharp_Portable_Library_Legacy_net451.fsproj +++ b/tests/projects/Sample_VS2013_FSharp_Portable_Library_Legacy_net451/Sample_VS2013_FSharp_Portable_Library_Legacy_net451.fsproj @@ -37,7 +37,7 @@ FSharp.Core FSharp.Core.dll - ..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\portable-net45+sl5+netcore45\FSharp.Core.dll + ..\..\..\packages\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\portable-net45+sl5+netcore45\FSharp.Core.dll diff --git a/tests/projects/Sample_VS2013_FSharp_Portable_Library_net45/Sample_VS2013_FSharp_Portable_Library_net45.fsproj b/tests/projects/Sample_VS2013_FSharp_Portable_Library_net45/Sample_VS2013_FSharp_Portable_Library_net45.fsproj index b44150d5af..c55b136d48 100644 --- a/tests/projects/Sample_VS2013_FSharp_Portable_Library_net45/Sample_VS2013_FSharp_Portable_Library_net45.fsproj +++ b/tests/projects/Sample_VS2013_FSharp_Portable_Library_net45/Sample_VS2013_FSharp_Portable_Library_net45.fsproj @@ -38,7 +38,7 @@ FSharp.Core FSharp.Core.dll - ..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\portable-net45+netcore45\FSharp.Core.dll + ..\..\..\packages\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\portable-net45+netcore45\FSharp.Core.dll diff --git a/tests/projects/Sample_VS2013_FSharp_Portable_Library_net451/Sample_VS2013_FSharp_Portable_Library_net451.fsproj b/tests/projects/Sample_VS2013_FSharp_Portable_Library_net451/Sample_VS2013_FSharp_Portable_Library_net451.fsproj index eb60ed1d6c..04ed727eea 100644 --- a/tests/projects/Sample_VS2013_FSharp_Portable_Library_net451/Sample_VS2013_FSharp_Portable_Library_net451.fsproj +++ b/tests/projects/Sample_VS2013_FSharp_Portable_Library_net451/Sample_VS2013_FSharp_Portable_Library_net451.fsproj @@ -38,7 +38,7 @@ FSharp.Core FSharp.Core.dll - ..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\portable-net45+netcore45\FSharp.Core.dll + ..\..\..\packages\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\portable-net45+netcore45\FSharp.Core.dll diff --git a/tests/projects/Sample_VS2013_FSharp_Portable_Library_net451_adjusted_to_profile259/Sample_VS2013_FSharp_Portable_Library_net451.fsproj b/tests/projects/Sample_VS2013_FSharp_Portable_Library_net451_adjusted_to_profile259/Sample_VS2013_FSharp_Portable_Library_net451.fsproj index 119d6805e7..c1db72928d 100644 --- a/tests/projects/Sample_VS2013_FSharp_Portable_Library_net451_adjusted_to_profile259/Sample_VS2013_FSharp_Portable_Library_net451.fsproj +++ b/tests/projects/Sample_VS2013_FSharp_Portable_Library_net451_adjusted_to_profile259/Sample_VS2013_FSharp_Portable_Library_net451.fsproj @@ -38,7 +38,7 @@ FSharp.Core FSharp.Core.dll - ..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\portable-net45+netcore45+wpa81+wp8\FSharp.Core.dll + ..\..\..\packages\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\portable-net45+netcore45+wpa81+wp8\FSharp.Core.dll diff --git a/tests/projects/Sample_VS2013_FSharp_Portable_Library_net451_adjusted_to_profile78/Sample_VS2013_FSharp_Portable_Library_net451.fsproj b/tests/projects/Sample_VS2013_FSharp_Portable_Library_net451_adjusted_to_profile78/Sample_VS2013_FSharp_Portable_Library_net451.fsproj index 319f6dc420..58174f27f4 100644 --- a/tests/projects/Sample_VS2013_FSharp_Portable_Library_net451_adjusted_to_profile78/Sample_VS2013_FSharp_Portable_Library_net451.fsproj +++ b/tests/projects/Sample_VS2013_FSharp_Portable_Library_net451_adjusted_to_profile78/Sample_VS2013_FSharp_Portable_Library_net451.fsproj @@ -38,7 +38,7 @@ FSharp.Core FSharp.Core.dll - ..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\portable-net45+netcore45+wp8\FSharp.Core.dll + ..\..\..\packages\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\portable-net45+netcore45+wp8\FSharp.Core.dll diff --git a/tests/projects/Sample_VS2015_FSharp_Portable259_Library/Sample_VS2015_FSharp_Portable259_Library.fsproj b/tests/projects/Sample_VS2015_FSharp_Portable259_Library/Sample_VS2015_FSharp_Portable259_Library.fsproj index 160e117760..313b99560d 100644 --- a/tests/projects/Sample_VS2015_FSharp_Portable259_Library/Sample_VS2015_FSharp_Portable259_Library.fsproj +++ b/tests/projects/Sample_VS2015_FSharp_Portable259_Library/Sample_VS2015_FSharp_Portable259_Library.fsproj @@ -39,7 +39,7 @@ FSharp.Core FSharp.Core.dll - ..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\portable-net45+netcore45+wpa81+wp8\FSharp.Core.dll + ..\..\..\packages\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\portable-net45+netcore45+wpa81+wp8\FSharp.Core.dll diff --git a/tests/projects/Sample_VS2015_FSharp_Portable47_Library/Sample_VS2015_FSharp_Portable47_Library.fsproj b/tests/projects/Sample_VS2015_FSharp_Portable47_Library/Sample_VS2015_FSharp_Portable47_Library.fsproj index ace02e6235..1c7684916c 100644 --- a/tests/projects/Sample_VS2015_FSharp_Portable47_Library/Sample_VS2015_FSharp_Portable47_Library.fsproj +++ b/tests/projects/Sample_VS2015_FSharp_Portable47_Library/Sample_VS2015_FSharp_Portable47_Library.fsproj @@ -38,7 +38,7 @@ FSharp.Core FSharp.Core.dll - ..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\portable-net45+sl5+netcore45\FSharp.Core.dll + ..\..\..\packages\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\portable-net45+sl5+netcore45\FSharp.Core.dll diff --git a/tests/projects/Sample_VS2015_FSharp_Portable78_Library/Sample_VS2015_FSharp_Portable78_Library.fsproj b/tests/projects/Sample_VS2015_FSharp_Portable78_Library/Sample_VS2015_FSharp_Portable78_Library.fsproj index c422bd847c..5040c8b8b4 100644 --- a/tests/projects/Sample_VS2015_FSharp_Portable78_Library/Sample_VS2015_FSharp_Portable78_Library.fsproj +++ b/tests/projects/Sample_VS2015_FSharp_Portable78_Library/Sample_VS2015_FSharp_Portable78_Library.fsproj @@ -39,7 +39,7 @@ FSharp.Core FSharp.Core.dll - ..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\portable-net45+netcore45+wp8\FSharp.Core.dll + ..\..\..\packages\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\portable-net45+netcore45+wp8\FSharp.Core.dll diff --git a/tests/projects/Sample_VS2015_FSharp_Portable7_Library/Sample_VS2015_FSharp_Portable7_Library.fsproj b/tests/projects/Sample_VS2015_FSharp_Portable7_Library/Sample_VS2015_FSharp_Portable7_Library.fsproj index 08c0756194..c3566afa24 100644 --- a/tests/projects/Sample_VS2015_FSharp_Portable7_Library/Sample_VS2015_FSharp_Portable7_Library.fsproj +++ b/tests/projects/Sample_VS2015_FSharp_Portable7_Library/Sample_VS2015_FSharp_Portable7_Library.fsproj @@ -39,7 +39,7 @@ FSharp.Core FSharp.Core.dll - ..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\portable-net45+netcore45+wpa81+wp8\FSharp.Core.dll + ..\..\..\packages\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\portable-net45+netcore45+wpa81+wp8\FSharp.Core.dll diff --git a/tests/service/data/DifferingOutputDir/Dir1/Test1.fsproj b/tests/service/data/DifferingOutputDir/Dir1/Test1.fsproj index 8e6ca90674..668428f1ac 100644 --- a/tests/service/data/DifferingOutputDir/Dir1/Test1.fsproj +++ b/tests/service/data/DifferingOutputDir/Dir1/Test1.fsproj @@ -37,7 +37,7 @@ - ..\..\..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\net40\FSharp.Core.dll + ..\..\..\..\..\packages\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\net40\FSharp.Core.dll false diff --git a/tests/service/data/DifferingOutputDir/Dir2/Test2.fsproj b/tests/service/data/DifferingOutputDir/Dir2/Test2.fsproj index caf9056708..e90751876d 100644 --- a/tests/service/data/DifferingOutputDir/Dir2/Test2.fsproj +++ b/tests/service/data/DifferingOutputDir/Dir2/Test2.fsproj @@ -37,7 +37,7 @@ - ..\..\..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\net40\FSharp.Core.dll + ..\..\..\..\..\packages\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\net40\FSharp.Core.dll false diff --git a/tests/service/data/FsAndFsiFiles.fsproj b/tests/service/data/FsAndFsiFiles.fsproj index 509c940e78..a31365c73f 100644 --- a/tests/service/data/FsAndFsiFiles.fsproj +++ b/tests/service/data/FsAndFsiFiles.fsproj @@ -35,7 +35,7 @@ - ..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\net40\FSharp.Core.dll + ..\..\..\packages\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\net40\FSharp.Core.dll diff --git a/tests/service/data/MultiLanguageProject/ConsoleApplication1.fsproj b/tests/service/data/MultiLanguageProject/ConsoleApplication1.fsproj index 16909bc1ee..4aef2e1336 100644 --- a/tests/service/data/MultiLanguageProject/ConsoleApplication1.fsproj +++ b/tests/service/data/MultiLanguageProject/ConsoleApplication1.fsproj @@ -39,7 +39,7 @@ - ..\..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\net40\FSharp.Core.dll + ..\..\..\..\packages\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\net40\FSharp.Core.dll false diff --git a/tests/service/data/MultiLanguageProject/ConsoleApplication2.fsproj b/tests/service/data/MultiLanguageProject/ConsoleApplication2.fsproj index 654d211367..f70cb6693a 100644 --- a/tests/service/data/MultiLanguageProject/ConsoleApplication2.fsproj +++ b/tests/service/data/MultiLanguageProject/ConsoleApplication2.fsproj @@ -39,7 +39,7 @@ - ..\..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\net40\FSharp.Core.dll + ..\..\..\..\packages\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\net40\FSharp.Core.dll false diff --git a/tests/service/data/TestProject/TestProject.fsproj b/tests/service/data/TestProject/TestProject.fsproj index 6737ca00c0..b58304907f 100644 --- a/tests/service/data/TestProject/TestProject.fsproj +++ b/tests/service/data/TestProject/TestProject.fsproj @@ -35,7 +35,7 @@ - ..\..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\net40\FSharp.Core.dll + ..\..\..\..\packages\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\net40\FSharp.Core.dll false diff --git a/tests/service/data/TestTP/TestTP.fsproj b/tests/service/data/TestTP/TestTP.fsproj index 5490fdb320..2e0ac9aa19 100644 --- a/tests/service/data/TestTP/TestTP.fsproj +++ b/tests/service/data/TestTP/TestTP.fsproj @@ -47,7 +47,7 @@ - ..\..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\net40\FSharp.Core.dll + ..\..\..\..\packages\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\net40\FSharp.Core.dll false diff --git a/tests/service/data/TypeProviderConsole/TypeProviderConsole.fsproj b/tests/service/data/TypeProviderConsole/TypeProviderConsole.fsproj index 4c710eb122..144efa90d7 100644 --- a/tests/service/data/TypeProviderConsole/TypeProviderConsole.fsproj +++ b/tests/service/data/TypeProviderConsole/TypeProviderConsole.fsproj @@ -39,7 +39,7 @@ - ..\..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\net40\FSharp.Core.dll + ..\..\..\..\packages\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\net40\FSharp.Core.dll false diff --git a/tests/service/data/TypeProviderLibrary/TypeProviderLibrary.fsproj b/tests/service/data/TypeProviderLibrary/TypeProviderLibrary.fsproj index 418a07dbe5..f7125ac2d2 100644 --- a/tests/service/data/TypeProviderLibrary/TypeProviderLibrary.fsproj +++ b/tests/service/data/TypeProviderLibrary/TypeProviderLibrary.fsproj @@ -37,7 +37,7 @@ - ..\..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\net40\FSharp.Core.dll + ..\..\..\..\packages\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\net40\FSharp.Core.dll false diff --git a/tests/service/data/TypeProvidersBug/TestConsole/TestConsole.fsproj b/tests/service/data/TypeProvidersBug/TestConsole/TestConsole.fsproj index aec8ba3924..572852c024 100644 --- a/tests/service/data/TypeProvidersBug/TestConsole/TestConsole.fsproj +++ b/tests/service/data/TypeProvidersBug/TestConsole/TestConsole.fsproj @@ -47,7 +47,7 @@ - ..\..\..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\net40\FSharp.Core.dll + ..\..\..\..\..\packages\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\net40\FSharp.Core.dll false diff --git a/tests/service/data/TypeProvidersBug/TypeProvidersBug/TypeProvidersBug.fsproj b/tests/service/data/TypeProvidersBug/TypeProvidersBug/TypeProvidersBug.fsproj index 52056e47c9..1ee42f8d19 100644 --- a/tests/service/data/TypeProvidersBug/TypeProvidersBug/TypeProvidersBug.fsproj +++ b/tests/service/data/TypeProvidersBug/TypeProvidersBug/TypeProvidersBug.fsproj @@ -42,7 +42,7 @@ - ..\..\..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\net40\FSharp.Core.dll + ..\..\..\..\..\packages\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\net40\FSharp.Core.dll false diff --git a/tests/service/data/sqlite-net-spike/sqlite-net-spike.fsproj b/tests/service/data/sqlite-net-spike/sqlite-net-spike.fsproj index 9655c32ab5..1b843e4531 100644 --- a/tests/service/data/sqlite-net-spike/sqlite-net-spike.fsproj +++ b/tests/service/data/sqlite-net-spike/sqlite-net-spike.fsproj @@ -37,7 +37,7 @@ - ..\..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\net40\FSharp.Core.dll + ..\..\..\..\packages\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\net40\FSharp.Core.dll false From 172116b0acb0126d7a95cff52e00fe06b39684b0 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Wed, 13 Jun 2018 10:26:28 -0700 Subject: [PATCH 041/150] Re-enable more tests (#5186) --- .../tests/UnitTests/VisualFSharp.UnitTests.fsproj | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj index 2309c0f876..2e48f7f72c 100644 --- a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj +++ b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj @@ -71,11 +71,9 @@ CompilerService\ProjectAnalysisTests.fs - CompilerService\PerfTests.fs @@ -96,19 +94,15 @@ CompilerService\StructureTests.fs - CompilerService\ServiceUntypedParseTests.fs - Roslyn\SyntacticColorizationServiceTests.fs @@ -116,9 +110,11 @@ Roslyn\SemanticColorizationServiceTests.fs +--> Roslyn\BraceMatchingServiceTests.fs + Roslyn\LanguageDebugInfoServiceTests.fs - Roslyn\ProjectDiagnosticAnalyzerTests.fs @@ -149,9 +141,11 @@ Roslyn\CompletionProviderTests.fs +--> Roslyn\SignatureHelpProviderTests.fs + CompilerService\CSharpProjectAnalysis.fs From 70dee190c8f393dd5fc4652754423c70f746f70b Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Wed, 13 Jun 2018 20:51:57 -0700 Subject: [PATCH 043/150] Retry restore (#5187) * Retry restore * because reasons * because not focussing --- fcs/build.fsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/fcs/build.fsx b/fcs/build.fsx index c596e51432..145d4c88e8 100644 --- a/fcs/build.fsx +++ b/fcs/build.fsx @@ -77,11 +77,13 @@ Target "Restore" (fun _ -> // We assume a paket restore has already been run runDotnet __SOURCE_DIRECTORY__ "restore FSharp.Compiler.Service.sln -v n" for p in [ "../packages.config" ] do - ExecProcess (fun info -> - info.FileName <- FullName @"./../.nuget/NuGet.exe" - info.WorkingDirectory <- FullName @"./.." - info.Arguments <- sprintf "restore %s -PackagesDirectory \"%s\" -ConfigFile \"%s\"" (FullName p) (FullName "./../packages") (FullName "./../NuGet.Config")) TimeSpan.MaxValue - |> assertExitCodeZero + let rec executeProcess count = + let result = ExecProcess (fun info -> + info.FileName <- FullName @"./../.nuget/NuGet.exe" + info.WorkingDirectory <- FullName @"./.." + info.Arguments <- sprintf "restore %s -PackagesDirectory \"%s\" -ConfigFile \"%s\"" (FullName p) (FullName "./../packages") (FullName "./../NuGet.Config")) TimeSpan.MaxValue + if result <> 0 && count > 1 then executeProcess (count - 1) else result + (executeProcess 5) |> assertExitCodeZero ) Target "BuildVersion" (fun _ -> From e7b51cf551984396a3a51bf80cbebb432a59692b Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Thu, 14 Jun 2018 10:19:54 -0700 Subject: [PATCH 044/150] Revert valuetuple for Product Build (#5190) * Revert product to use System.ValueTuple 4.3.0 * Revert "Update templates to FSharp.Core 4.5.0" This reverts commit 4c9d7062c99011ec88db9b6c6c205b2727a74ee4. * Revert "Update default fsharp.core to 4.5.0 and valuetuple to 4.4.0 for dotnet sdk apps (#5152)" This reverts commit 13896d0b92dbdbd2d12dacfcce0b1c2a23d2a0e2. * Revert "Revert "Update default fsharp.core to 4.5.0 and valuetuple to 4.4.0 for dotnet sdk apps (#5152)"" This reverts commit d1fcc8a8957f385ac7f0461e1bcf4643df769a52. * Revert "Revert "Update templates to FSharp.Core 4.5.0"" This reverts commit 42bdccfdf3744170156fd9dfa7b7321e524468c4. * disable implicit references to valuetuple --- packages.config | 1 + .../FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj | 2 +- .../FSharp.Compiler.Private.netcore.nuspec | 2 +- src/fsharp/FSharp.Compiler.Private/project.json | 2 +- .../FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuspec | 2 +- src/fsharp/FSharp.Compiler.nuget/Testing.FSharp.Compiler.nuspec | 2 +- src/fsharp/Fsc-proto/Fsc-proto.fsproj | 2 +- .../FSharp.Compiler.UnitTests/FSharp.Compiler.Unittests.fsproj | 2 +- tests/FSharp.Core.UnitTests/FSharp.Core.Unittests.fsproj | 2 +- .../FSharp.Core/SampleTuples/TupleSample.csproj | 2 +- tests/FSharp.Core.UnitTests/project.json | 2 +- .../src/HostedCompilerServer/HostedCompilerServer.fsproj | 2 +- .../LanguageServiceProfiling/LanguageServiceProfiling.fsproj | 1 + vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj | 1 + .../src/FSharp.LanguageService/FSharp.LanguageService.fsproj | 1 + .../src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj | 1 + vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj | 1 + vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj | 1 + vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj | 1 + 19 files changed, 19 insertions(+), 11 deletions(-) diff --git a/packages.config b/packages.config index c09a626345..686a11da97 100644 --- a/packages.config +++ b/packages.config @@ -17,6 +17,7 @@ + diff --git a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj index fdda3ce7c8..6f0fd54fff 100644 --- a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj +++ b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj @@ -681,7 +681,7 @@ ..\..\..\packages\System.Collections.Immutable.$(SystemCollectionsImmutableVersion)\lib\netstandard1.0\System.Collections.Immutable.dll - ..\..\..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll + ..\..\..\packages\System.ValueTuple.4.3.0\lib\netstandard1.0\System.ValueTuple.dll true diff --git a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.netcore.nuspec b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.netcore.nuspec index dc8c6aa297..dfac86f356 100644 --- a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.netcore.nuspec +++ b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.netcore.nuspec @@ -31,7 +31,7 @@ - + diff --git a/src/fsharp/FSharp.Compiler.Private/project.json b/src/fsharp/FSharp.Compiler.Private/project.json index 46a8b02f9b..b9bf7861ae 100644 --- a/src/fsharp/FSharp.Compiler.Private/project.json +++ b/src/fsharp/FSharp.Compiler.Private/project.json @@ -17,7 +17,7 @@ "System.Threading.Tasks.Parallel": "4.3.0", "System.Threading.Thread": "4.3.0", "System.Threading.ThreadPool": "4.3.0", - "System.ValueTuple": "4.4.0" + "System.ValueTuple": "4.3.0" }, "runtimes": { "win7-x86": { }, diff --git a/src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuspec b/src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuspec index 7e887dd6d6..4130025ffb 100644 --- a/src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuspec +++ b/src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuspec @@ -33,7 +33,7 @@ - + diff --git a/src/fsharp/FSharp.Compiler.nuget/Testing.FSharp.Compiler.nuspec b/src/fsharp/FSharp.Compiler.nuget/Testing.FSharp.Compiler.nuspec index 2f5c7e4aab..d2dd36b317 100644 --- a/src/fsharp/FSharp.Compiler.nuget/Testing.FSharp.Compiler.nuspec +++ b/src/fsharp/FSharp.Compiler.nuget/Testing.FSharp.Compiler.nuspec @@ -31,7 +31,7 @@ - + diff --git a/src/fsharp/Fsc-proto/Fsc-proto.fsproj b/src/fsharp/Fsc-proto/Fsc-proto.fsproj index b4f86c8943..fe41539137 100644 --- a/src/fsharp/Fsc-proto/Fsc-proto.fsproj +++ b/src/fsharp/Fsc-proto/Fsc-proto.fsproj @@ -467,7 +467,7 @@ $(FSharpSourcesRoot)\..\packages\System.Collections.Immutable.$(SystemCollectionsImmutableVersion)\lib\netstandard1.0\System.Collections.Immutable.dll - $(FSharpSourcesRoot)\..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll + $(FSharpSourcesRoot)\..\packages\System.ValueTuple.4.3.0\lib\netstandard1.0\System.ValueTuple.dll {DED3BBD7-53F4-428A-8C9F-27968E768605} diff --git a/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.Unittests.fsproj b/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.Unittests.fsproj index 5357d4ffad..7dde66e5b6 100644 --- a/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.Unittests.fsproj +++ b/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.Unittests.fsproj @@ -44,7 +44,7 @@ - ..\..\..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll + ..\..\..\packages\System.ValueTuple.4.3.0\lib\netstandard1.0\System.ValueTuple.dll diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core.Unittests.fsproj b/tests/FSharp.Core.UnitTests/FSharp.Core.Unittests.fsproj index aca29fe00a..c3e553f595 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core.Unittests.fsproj +++ b/tests/FSharp.Core.UnitTests/FSharp.Core.Unittests.fsproj @@ -52,7 +52,7 @@ $(FsCheckLibDir)\net452\FsCheck.dll - ..\..\packages\System.ValueTuple.4.4.0\lib\portable-net40+sl4+win8+wp8\System.ValueTuple.dll + ..\..\packages\System.ValueTuple.4.3.0\lib\portable-net40+sl4+win8+wp8\System.ValueTuple.dll True diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/SampleTuples/TupleSample.csproj b/tests/FSharp.Core.UnitTests/FSharp.Core/SampleTuples/TupleSample.csproj index c4e46fb690..c35cd8ac84 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/SampleTuples/TupleSample.csproj +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/SampleTuples/TupleSample.csproj @@ -25,7 +25,7 @@ - ..\..\..\..\..\packages\System.ValueTuple.4.4.0\lib\portable-net40+sl4+win8+wp8\System.ValueTuple.dll + ..\..\..\..\..\packages\System.ValueTuple.4.3.0\lib\portable-net40+sl4+win8+wp8\System.ValueTuple.dll diff --git a/tests/FSharp.Core.UnitTests/project.json b/tests/FSharp.Core.UnitTests/project.json index 36a6823bf2..901129da26 100644 --- a/tests/FSharp.Core.UnitTests/project.json +++ b/tests/FSharp.Core.UnitTests/project.json @@ -8,7 +8,7 @@ "dependencies": { "nunit": "3.5.0", "nunitlite": "3.5.0", - "System.ValueTuple": "4.4.0", + "System.ValueTuple": "4.3.0", "FsCheck": "3.0.0-alpha3", "Testing.FSharp.Core": "4.2.4", "Microsoft.FSharp.TupleSample": "1.0.0-alpha-161112" diff --git a/tests/fsharpqa/testenv/src/HostedCompilerServer/HostedCompilerServer.fsproj b/tests/fsharpqa/testenv/src/HostedCompilerServer/HostedCompilerServer.fsproj index 8a5ff94b44..c835da7b6f 100644 --- a/tests/fsharpqa/testenv/src/HostedCompilerServer/HostedCompilerServer.fsproj +++ b/tests/fsharpqa/testenv/src/HostedCompilerServer/HostedCompilerServer.fsproj @@ -50,7 +50,7 @@ FSharp.Compiler.Private - $(FSharpSourcesRoot)\..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll + $(FSharpSourcesRoot)\..\packages\System.ValueTuple.4.3.0\lib\netstandard1.0\System.ValueTuple.dll true diff --git a/vsintegration/Utils/LanguageServiceProfiling/LanguageServiceProfiling.fsproj b/vsintegration/Utils/LanguageServiceProfiling/LanguageServiceProfiling.fsproj index 08d3108041..58257f0b93 100644 --- a/vsintegration/Utils/LanguageServiceProfiling/LanguageServiceProfiling.fsproj +++ b/vsintegration/Utils/LanguageServiceProfiling/LanguageServiceProfiling.fsproj @@ -5,6 +5,7 @@ net46 Exe true + true true diff --git a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj index bfca154034..504b85959d 100644 --- a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj +++ b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj @@ -9,6 +9,7 @@ false $(NoWarn);75 true + true $(OtherFlags) --warnon:1182 --subsystemversion:6.00 true false diff --git a/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj b/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj index 3e5a4c453d..0515bf323e 100644 --- a/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj +++ b/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj @@ -9,6 +9,7 @@ false $(NoWarn);75 true + true $(OtherFlags) --warnon:1182 --subsystemversion:6.00 true false diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj b/vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj index 786ea003f6..0851e3c5c2 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj @@ -10,6 +10,7 @@ false $(NoWarn);52;62;75 true + true $(OtherFlags) --warnon:1182 --subsystemversion:6.00 true false diff --git a/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj b/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj index 03ff7cd35a..2586b5c826 100644 --- a/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj +++ b/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj @@ -9,6 +9,7 @@ false $(NoWarn);47;75 true + true $(OtherFlags) --subsystemversion:6.00 true false diff --git a/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj b/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj index 9b938e3b8c..2202c29904 100644 --- a/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj +++ b/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj @@ -7,6 +7,7 @@ Library $(NoWarn);45;47;52;58;75 true + true true false diff --git a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj index 97cf7089b1..bc02e96a99 100644 --- a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj +++ b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj @@ -8,6 +8,7 @@ $(NoWarn);58;75 NO_PROJECTCRACKER;$(DefineConstants) true + true true false From ba5829a300ccae6156cab5ee9c7ef06bab3dd637 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Fri, 15 Jun 2018 13:31:14 -0700 Subject: [PATCH 045/150] resolve mscorlib (#5183) (#5203) --- .../SimulatedMSBuildReferenceResolver.fs | 36 +++++++++++-------- .../UnitTests/VisualFSharp.UnitTests.fsproj | 4 +++ 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/src/fsharp/SimulatedMSBuildReferenceResolver.fs b/src/fsharp/SimulatedMSBuildReferenceResolver.fs index 4fac34e618..2241acfe23 100644 --- a/src/fsharp/SimulatedMSBuildReferenceResolver.fs +++ b/src/fsharp/SimulatedMSBuildReferenceResolver.fs @@ -3,7 +3,7 @@ #if INTERACTIVE #load "../utils/ResizeArray.fs" "../absil/illib.fs" "../fsharp/ReferenceResolver.fs" #else -module internal Microsoft.FSharp.Compiler.SimulatedMSBuildReferenceResolver +module internal Microsoft.FSharp.Compiler.SimulatedMSBuildReferenceResolver #endif open System @@ -15,21 +15,27 @@ open Microsoft.FSharp.Compiler.ReferenceResolver open Microsoft.FSharp.Compiler.AbstractIL.Internal.Library let internal SimulatedMSBuildResolver = + let supportedFrameworks = [| + "v4.7.2"; + "v4.7.1"; + "v4.7"; + "v4.6.2"; + "v4.6.1"; + "v4.6"; + "v4.5.1"; + "v4.5"; + "v4.0" + |] { new Resolver with - member x.HighestInstalledNetFrameworkVersion() = + member x.HighestInstalledNetFrameworkVersion() = + let root = x.DotNetFrameworkReferenceAssembliesRootDirectory - if Directory.Exists(Path.Combine(root,"v4.7.1")) then "v4.7.2" - elif Directory.Exists(Path.Combine(root,"v4.7.1")) then "v4.7.1" - elif Directory.Exists(Path.Combine(root,"v4.7")) then "v4.7" - elif Directory.Exists(Path.Combine(root,"v4.6.2")) then "v4.6.2" - elif Directory.Exists(Path.Combine(root,"v4.6.1")) then "v4.6.1" - elif Directory.Exists(Path.Combine(root,"v4.6")) then "v4.6" - elif Directory.Exists(Path.Combine(root,"v4.5.1")) then "v4.5.1" - elif Directory.Exists(Path.Combine(root,"v4.5")) then "v4.5" - elif Directory.Exists(Path.Combine(root,"v4.0")) then "v4.0" - else "v4.5" - - member __.DotNetFrameworkReferenceAssembliesRootDirectory = + let fwOpt = supportedFrameworks |> Seq.tryFind(fun fw -> Directory.Exists(Path.Combine(root, fw) )) + match fwOpt with + | Some fw -> fw + | None -> "v4.5" + + member __.DotNetFrameworkReferenceAssembliesRootDirectory = #if !FX_RESHAPED_MSBUILD if System.Environment.OSVersion.Platform = System.PlatformID.Win32NT then let PF = @@ -41,7 +47,7 @@ let internal SimulatedMSBuildResolver = #endif "" - member __.Resolve(resolutionEnvironment, references, targetFrameworkVersion, targetFrameworkDirectories, targetProcessorArchitecture, + member __.Resolve(resolutionEnvironment, references, targetFrameworkVersion, targetFrameworkDirectories, targetProcessorArchitecture, fsharpCoreDir, explicitIncludeDirs, implicitIncludeDir, logMessage, logWarningOrError) = #if !FX_NO_WIN_REGISTRY diff --git a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj index bc02e96a99..4074ac2b69 100644 --- a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj +++ b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj @@ -70,18 +70,22 @@ CompilerService\ProjectAnalysisTests.fs + CompilerService\PerfTests.fs CompilerService\InteractiveCheckerTests.fs + CompilerService\CSharpProjectAnalysis.fs From 347b20901339b7dcca121d4a0bceaa97d649fd27 Mon Sep 17 00:00:00 2001 From: jwosty Date: Sat, 16 Jun 2018 16:00:28 -0600 Subject: [PATCH 046/150] Fix FS104 incorrectly handling non-F# enum values --- src/fsharp/PatternMatchCompilation.fs | 46 ++++++++++++++++++++++----- 1 file changed, 38 insertions(+), 8 deletions(-) diff --git a/src/fsharp/PatternMatchCompilation.fs b/src/fsharp/PatternMatchCompilation.fs index 0705c5c4fb..9be6f0d545 100644 --- a/src/fsharp/PatternMatchCompilation.fs +++ b/src/fsharp/PatternMatchCompilation.fs @@ -4,6 +4,7 @@ module internal Microsoft.FSharp.Compiler.PatternMatchCompilation open System.Collections.Generic open Microsoft.FSharp.Compiler +open Microsoft.FSharp.Compiler.AbstractIL.IL open Microsoft.FSharp.Compiler.AbstractIL.Internal.Library open Microsoft.FSharp.Compiler.AbstractIL.Diagnostics open Microsoft.FSharp.Compiler.Range @@ -154,6 +155,24 @@ let rec pathEq p1 p2 = | PathEmpty(_), PathEmpty(_) -> true | _ -> false +//// (Temporarily copy-pasted from TypeChecker.fs) +let TcFieldInit lit = + match lit with + | ILFieldInit.String s -> Const.String s + | ILFieldInit.Null -> Const.Zero + | ILFieldInit.Bool b -> Const.Bool b + | ILFieldInit.Char c -> Const.Char (char (int c)) + | ILFieldInit.Int8 x -> Const.SByte x + | ILFieldInit.Int16 x -> Const.Int16 x + | ILFieldInit.Int32 x -> Const.Int32 x + | ILFieldInit.Int64 x -> Const.Int64 x + | ILFieldInit.UInt8 x -> Const.Byte x + | ILFieldInit.UInt16 x -> Const.UInt16 x + | ILFieldInit.UInt32 x -> Const.UInt32 x + | ILFieldInit.UInt64 x -> Const.UInt64 x + | ILFieldInit.Single f -> Const.Single f + | ILFieldInit.Double f -> Const.Double f + //--------------------------------------------------------------------------- // Counter example generation @@ -238,16 +257,27 @@ let RefuteDiscrimSet g m path discrims = | Some c -> match tryDestAppTy g ty with | Some tcref when tcref.IsEnumTycon -> - // search for an enum value that pattern match (consts) does not contain - let nonCoveredEnumValues = - tcref.AllFieldsArray |> Array.tryFind (fun f -> - match f.rfield_const with - | None -> false - | Some fieldValue -> (not (consts.Contains fieldValue)) && f.rfield_static) + let enumValues = + if tcref.IsILEnumTycon then + let (TILObjectReprData(_, _, tdef)) = tcref.ILTyconInfo + tdef.Fields.AsList + |> Seq.choose (fun ilField -> + if ilField.IsStatic then + ilField.LiteralValue |> Option.map (fun ilValue -> + ilField.Name, TcFieldInit ilValue) + else None) + else + tcref.AllFieldsArray |> Seq.choose (fun fsField -> + match fsField.rfield_const, fsField.rfield_static with + | Some fsFieldValue, true -> Some (fsField.rfield_id.idText, fsFieldValue) + | _ -> None) + + let nonCoveredEnumValues = Seq.tryFind (fun (_, fldValue) -> not (consts.Contains fldValue)) enumValues + match nonCoveredEnumValues with | None -> Expr.Const(c,m,ty), true - | Some f -> - let v = RecdFieldRef.RFRef(tcref, f.rfield_id.idText) + | Some (fldName, _) -> + let v = RecdFieldRef.RFRef(tcref, fldName) Expr.Op(TOp.ValFieldGet v, [ty], [], m), false | _ -> Expr.Const(c,m,ty), false From d8ab424eb4b67e0883f42826a8621cc461912ecf Mon Sep 17 00:00:00 2001 From: jwosty Date: Sat, 16 Jun 2018 16:26:31 -0600 Subject: [PATCH 047/150] Add tests that expose the bug --- tests/fsharp/typecheck/sigs/neg102.bsl | 8 ++++++-- tests/fsharp/typecheck/sigs/neg102.fs | 13 +++++++++++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/tests/fsharp/typecheck/sigs/neg102.bsl b/tests/fsharp/typecheck/sigs/neg102.bsl index d428a9e4df..333f0e34d1 100644 --- a/tests/fsharp/typecheck/sigs/neg102.bsl +++ b/tests/fsharp/typecheck/sigs/neg102.bsl @@ -9,6 +9,10 @@ neg102.fs(18,14,18,22): typecheck error FS0025: Incomplete pattern matches on th neg102.fs(22,14,22,22): typecheck error FS0025: Incomplete pattern matches on this expression. For example, the value 'Some (EnumABC.C)' may indicate a case not covered by the pattern(s). -neg102.fs(29,14,29,22): typecheck error FS0104: Enums may take values outside known cases. For example, the value 'enum (2)' may indicate a case not covered by the pattern(s). +neg102.fs(27,14,27,22): typecheck error FS0025: Incomplete pattern matches on this expression. For example, the value 'System.DateTimeKind.Utc' may indicate a case not covered by the pattern(s). -neg102.fs(34,14,34,22): typecheck error FS0104: Enums may take values outside known cases. For example, the value 'Some (enum (2))' may indicate a case not covered by the pattern(s). +neg102.fs(32,14,32,22): typecheck error FS0104: Enums may take values outside known cases. For example, the value 'enum (2)' may indicate a case not covered by the pattern(s). + +neg102.fs(37,14,37,22): typecheck error FS0104: Enums may take values outside known cases. For example, the value 'Some (enum (2))' may indicate a case not covered by the pattern(s). + +neg102.fs(44,14,44,22): typecheck error FS0104: Enums may take values outside known cases. For example, the value 'enum (3)' may indicate a case not covered by the pattern(s). diff --git a/tests/fsharp/typecheck/sigs/neg102.fs b/tests/fsharp/typecheck/sigs/neg102.fs index 4620a55fee..5eb13cdc79 100644 --- a/tests/fsharp/typecheck/sigs/neg102.fs +++ b/tests/fsharp/typecheck/sigs/neg102.fs @@ -4,7 +4,7 @@ type UnionAB = A | B module FS0025 = // All of these should emit warning FS0025 ("Incomplete pattern match....") - + let f1 = function | UnionAB.A -> "A" @@ -23,6 +23,9 @@ module FS0025 = | Some(EnumABC.A) | Some(EnumABC.B) -> "A|B" | None -> "neither" + // try a non-F#-defined enum + let f6 = function System.DateTimeKind.Unspecified -> 0 + module FS0104 = // These should emit warning FS0104 ("Enums may take values outside of known cases....") @@ -35,4 +38,10 @@ module FS0104 = | Some(EnumABC.A) -> "A" | Some(EnumABC.B) -> "B" | Some(EnumABC.C) -> "C" - | None -> "none" \ No newline at end of file + | None -> "none" + + // try a non-F#-defined enum + let f3 = function + | System.DateTimeKind.Unspecified -> "Unspecified" + | System.DateTimeKind.Utc -> "Utc" + | System.DateTimeKind.Local -> "Local" \ No newline at end of file From 9723be6337b44f152ea96c0c9c9c57f33436cfa9 Mon Sep 17 00:00:00 2001 From: jwosty Date: Sun, 17 Jun 2018 13:42:58 -0600 Subject: [PATCH 048/150] Refactor TcFieldInit function (formerly duplicated in PatternMatchCompilation) --- src/fsharp/PatternMatchCompilation.fs | 37 +++++++++++++------------- src/fsharp/PatternMatchCompilation.fsi | 3 +++ src/fsharp/TypeChecker.fs | 18 +------------ 3 files changed, 23 insertions(+), 35 deletions(-) diff --git a/src/fsharp/PatternMatchCompilation.fs b/src/fsharp/PatternMatchCompilation.fs index 9be6f0d545..16c9453f5e 100644 --- a/src/fsharp/PatternMatchCompilation.fs +++ b/src/fsharp/PatternMatchCompilation.fs @@ -155,8 +155,24 @@ let rec pathEq p1 p2 = | PathEmpty(_), PathEmpty(_) -> true | _ -> false -//// (Temporarily copy-pasted from TypeChecker.fs) -let TcFieldInit lit = + +//--------------------------------------------------------------------------- +// Counter example generation +//--------------------------------------------------------------------------- + +type RefutedSet = + /// A value RefutedInvestigation(path,discrim) indicates that the value at the given path is known + /// to NOT be matched by the given discriminator + | RefutedInvestigation of Path * DecisionTreeTest list + /// A value RefutedWhenClause indicates that a 'when' clause failed + | RefutedWhenClause + +let notNullText = "some-non-null-value" +let otherSubtypeText = "some-other-subtype" + +/// Create a TAST const value from an IL-initialized field read from .NET metadata +// (Originally moved from TcFieldInit in TypeChecker.fs -- feel free to move this somewhere more appropriate) +let ilFieldToTastConst lit = match lit with | ILFieldInit.String s -> Const.String s | ILFieldInit.Null -> Const.Zero @@ -173,21 +189,6 @@ let TcFieldInit lit = | ILFieldInit.Single f -> Const.Single f | ILFieldInit.Double f -> Const.Double f - -//--------------------------------------------------------------------------- -// Counter example generation -//--------------------------------------------------------------------------- - -type RefutedSet = - /// A value RefutedInvestigation(path,discrim) indicates that the value at the given path is known - /// to NOT be matched by the given discriminator - | RefutedInvestigation of Path * DecisionTreeTest list - /// A value RefutedWhenClause indicates that a 'when' clause failed - | RefutedWhenClause - -let notNullText = "some-non-null-value" -let otherSubtypeText = "some-other-subtype" - exception CannotRefute let RefuteDiscrimSet g m path discrims = let mkUnknown ty = snd(mkCompGenLocal m "_" ty) @@ -264,7 +265,7 @@ let RefuteDiscrimSet g m path discrims = |> Seq.choose (fun ilField -> if ilField.IsStatic then ilField.LiteralValue |> Option.map (fun ilValue -> - ilField.Name, TcFieldInit ilValue) + ilField.Name, ilFieldToTastConst ilValue) else None) else tcref.AllFieldsArray |> Seq.choose (fun fsField -> diff --git a/src/fsharp/PatternMatchCompilation.fsi b/src/fsharp/PatternMatchCompilation.fsi index 160396caf0..348f37ae94 100644 --- a/src/fsharp/PatternMatchCompilation.fsi +++ b/src/fsharp/PatternMatchCompilation.fsi @@ -2,6 +2,7 @@ module internal Microsoft.FSharp.Compiler.PatternMatchCompilation +open Microsoft.FSharp.Compiler.AbstractIL.IL open Microsoft.FSharp.Compiler open Microsoft.FSharp.Compiler.Tast open Microsoft.FSharp.Compiler.Tastops @@ -42,6 +43,8 @@ and PatternValBinding = and TypedMatchClause = | TClause of Pattern * Expr option * DecisionTreeTarget * range +val ilFieldToTastConst : ILFieldInit -> Tast.Const + /// Compile a pattern into a decision tree and a set of targets. val internal CompilePattern : TcGlobals -> diff --git a/src/fsharp/TypeChecker.fs b/src/fsharp/TypeChecker.fs index b068a063f3..3bfbd86d19 100755 --- a/src/fsharp/TypeChecker.fs +++ b/src/fsharp/TypeChecker.fs @@ -905,23 +905,7 @@ let TcConst cenv ty m env c = | SynConst.Bytes _ -> error (InternalError(FSComp.SR.tcUnexpectedConstByteArray(), m)) /// Convert an Abstract IL ILFieldInit value read from .NET metadata to a TAST constant -let TcFieldInit (_m:range) lit = - match lit with - | ILFieldInit.String s -> Const.String s - | ILFieldInit.Null -> Const.Zero - | ILFieldInit.Bool b -> Const.Bool b - | ILFieldInit.Char c -> Const.Char (char (int c)) - | ILFieldInit.Int8 x -> Const.SByte x - | ILFieldInit.Int16 x -> Const.Int16 x - | ILFieldInit.Int32 x -> Const.Int32 x - | ILFieldInit.Int64 x -> Const.Int64 x - | ILFieldInit.UInt8 x -> Const.Byte x - | ILFieldInit.UInt16 x -> Const.UInt16 x - | ILFieldInit.UInt32 x -> Const.UInt32 x - | ILFieldInit.UInt64 x -> Const.UInt64 x - | ILFieldInit.Single f -> Const.Single f - | ILFieldInit.Double f -> Const.Double f - +let TcFieldInit (_m:range) lit = PatternMatchCompilation.ilFieldToTastConst lit //------------------------------------------------------------------------- // Arities. These serve two roles in the system: From 9885bfd2b8efc1f9dbe0236d5bd3503df32fdacf Mon Sep 17 00:00:00 2001 From: jwosty Date: Sun, 17 Jun 2018 13:49:22 -0600 Subject: [PATCH 049/150] Add a comment --- src/fsharp/PatternMatchCompilation.fs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/fsharp/PatternMatchCompilation.fs b/src/fsharp/PatternMatchCompilation.fs index 16c9453f5e..3ffbc94b04 100644 --- a/src/fsharp/PatternMatchCompilation.fs +++ b/src/fsharp/PatternMatchCompilation.fs @@ -258,6 +258,7 @@ let RefuteDiscrimSet g m path discrims = | Some c -> match tryDestAppTy g ty with | Some tcref when tcref.IsEnumTycon -> + // We must distinguish between F#-defined enums and other .NET enums, as they are represented differently in the TAST let enumValues = if tcref.IsILEnumTycon then let (TILObjectReprData(_, _, tdef)) = tcref.ILTyconInfo From 42008195cb4d1b806c8e998cea1246ec81302d10 Mon Sep 17 00:00:00 2001 From: Phillip Carter Date: Wed, 20 Jun 2018 11:20:41 -0700 Subject: [PATCH 050/150] Clean up IntelliSense perf UI and flow options for IntelliSense (#5211) * Clean up IntelliSense perf UI and flow options for IntelliSense * Tooltips, bindings, and removing redundant code * Change tooltip to include guidance and un-bind project options --- .../CodeFix/AddOpenCodeFixProvider.fs | 2 +- .../ImplementInterfaceCodeFixProvider.fs | 2 +- .../CodeFix/RenameUnusedValue.fs | 2 +- .../Commands/HelpContextService.fs | 2 +- .../Completion/CompletionProvider.fs | 2 +- .../SimplifyNameDiagnosticAnalyzer.fs | 2 +- .../Diagnostics/UnusedDeclarationsAnalyzer.fs | 2 +- .../UnusedOpensDiagnosticAnalyzer.fs | 2 +- .../DocumentHighlightsService.fs | 2 +- .../InlineRename/InlineRenameService.fs | 2 +- .../FSharpCheckerExtensions.fs | 6 +-- .../LanguageService/SymbolHelpers.fs | 4 +- .../Navigation/FindUsagesService.fs | 2 +- .../Navigation/GoToDefinition.fs | 6 +-- .../FSharp.Editor/Options/EditorOptions.fs | 2 + .../QuickInfo/QuickInfoProvider.fs | 2 +- .../FSharp.UIResources.csproj | 10 +++- ...nguageServicePerformanceOptionControl.xaml | 53 ++++++++++++------- .../FSharp.UIResources/Strings.Designer.cs | 49 ++++++++++++++++- .../src/FSharp.UIResources/Strings.resx | 19 ++++++- .../src/FSharp.UIResources/xlf/Strings.cs.xlf | 33 ++++++++++-- .../src/FSharp.UIResources/xlf/Strings.de.xlf | 33 ++++++++++-- .../src/FSharp.UIResources/xlf/Strings.en.xlf | 33 ++++++++++-- .../src/FSharp.UIResources/xlf/Strings.es.xlf | 33 ++++++++++-- .../src/FSharp.UIResources/xlf/Strings.fr.xlf | 33 ++++++++++-- .../src/FSharp.UIResources/xlf/Strings.it.xlf | 33 ++++++++++-- .../src/FSharp.UIResources/xlf/Strings.ja.xlf | 33 ++++++++++-- .../src/FSharp.UIResources/xlf/Strings.ko.xlf | 33 ++++++++++-- .../src/FSharp.UIResources/xlf/Strings.pl.xlf | 33 ++++++++++-- .../FSharp.UIResources/xlf/Strings.pt-BR.xlf | 33 ++++++++++-- .../src/FSharp.UIResources/xlf/Strings.ru.xlf | 33 ++++++++++-- .../src/FSharp.UIResources/xlf/Strings.tr.xlf | 33 ++++++++++-- .../xlf/Strings.zh-Hans.xlf | 33 ++++++++++-- .../xlf/Strings.zh-Hant.xlf | 33 ++++++++++-- 34 files changed, 535 insertions(+), 100 deletions(-) diff --git a/vsintegration/src/FSharp.Editor/CodeFix/AddOpenCodeFixProvider.fs b/vsintegration/src/FSharp.Editor/CodeFix/AddOpenCodeFixProvider.fs index b90e44f91e..2e9381e5fb 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/AddOpenCodeFixProvider.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/AddOpenCodeFixProvider.fs @@ -98,7 +98,7 @@ type internal FSharpAddOpenCodeFixProvider let document = context.Document let! parsingOptions, projectOptions = projectInfoManager.TryGetOptionsForEditingDocumentOrProject document let! sourceText = context.Document.GetTextAsync(context.CancellationToken) - let! _, parsedInput, checkResults = checker.ParseAndCheckDocument(document, projectOptions, allowStaleResults = true, sourceText = sourceText, userOpName = userOpName) + let! _, parsedInput, checkResults = checker.ParseAndCheckDocument(document, projectOptions, allowStaleResults = Settings.LanguageServicePerformance.AllowStaleCompletionResults, sourceText = sourceText, userOpName = userOpName) let line = sourceText.Lines.GetLineFromPosition(context.Span.End) let linePos = sourceText.Lines.GetLinePosition(context.Span.End) let defines = CompilerEnvironment.GetCompilationDefinesForEditing parsingOptions diff --git a/vsintegration/src/FSharp.Editor/CodeFix/ImplementInterfaceCodeFixProvider.fs b/vsintegration/src/FSharp.Editor/CodeFix/ImplementInterfaceCodeFixProvider.fs index bdd9d0a53f..6056c8861a 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/ImplementInterfaceCodeFixProvider.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/ImplementInterfaceCodeFixProvider.fs @@ -141,7 +141,7 @@ type internal FSharpImplementInterfaceCodeFixProvider let! parsingOptions, projectOptions = projectInfoManager.TryGetOptionsForEditingDocumentOrProject context.Document let cancellationToken = context.CancellationToken let! sourceText = context.Document.GetTextAsync(cancellationToken) - let! _, parsedInput, checkFileResults = checker.ParseAndCheckDocument(context.Document, projectOptions, sourceText = sourceText, allowStaleResults = true, userOpName = userOpName) + let! _, parsedInput, checkFileResults = checker.ParseAndCheckDocument(context.Document, projectOptions, sourceText = sourceText, allowStaleResults = Settings.LanguageServicePerformance.AllowStaleCompletionResults, userOpName = userOpName) let textLine = sourceText.Lines.GetLineFromPosition context.Span.Start let defines = CompilerEnvironment.GetCompilationDefinesForEditing parsingOptions // Notice that context.Span doesn't return reliable ranges to find tokens at exact positions. diff --git a/vsintegration/src/FSharp.Editor/CodeFix/RenameUnusedValue.fs b/vsintegration/src/FSharp.Editor/CodeFix/RenameUnusedValue.fs index 949b76b657..db85e02747 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/RenameUnusedValue.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/RenameUnusedValue.fs @@ -58,7 +58,7 @@ type internal FSharpRenameUnusedValueCodeFixProvider // where backtickes are replaced with parens. if not (PrettyNaming.IsOperatorOrBacktickedName ident) && not (ident.StartsWith "``") then let! parsingOptions, projectOptions = projectInfoManager.TryGetOptionsForEditingDocumentOrProject document - let! _, _, checkResults = checker.ParseAndCheckDocument(document, projectOptions, allowStaleResults = true, sourceText = sourceText, userOpName=userOpName) + let! _, _, checkResults = checker.ParseAndCheckDocument(document, projectOptions, allowStaleResults = Settings.LanguageServicePerformance.AllowStaleCompletionResults, sourceText = sourceText, userOpName=userOpName) let m = RoslynHelpers.TextSpanToFSharpRange(document.FilePath, context.Span, sourceText) let defines = CompilerEnvironment.GetCompilationDefinesForEditing parsingOptions let! lexerSymbol = Tokenizer.getSymbolAtPosition (document.Id, sourceText, context.Span.Start, document.FilePath, defines, SymbolLookupKind.Greedy, false) diff --git a/vsintegration/src/FSharp.Editor/Commands/HelpContextService.fs b/vsintegration/src/FSharp.Editor/Commands/HelpContextService.fs index 2e56b8574e..5c8d54404d 100644 --- a/vsintegration/src/FSharp.Editor/Commands/HelpContextService.fs +++ b/vsintegration/src/FSharp.Editor/Commands/HelpContextService.fs @@ -25,7 +25,7 @@ type internal FSharpHelpContextService static let userOpName = "ImplementInterfaceCodeFix" static member GetHelpTerm(checker: FSharpChecker, sourceText : SourceText, fileName, options, span: TextSpan, tokens: List, textVersion) : Async = asyncMaybe { - let! _, _, check = checker.ParseAndCheckDocument(fileName, textVersion, sourceText.ToString(), options, allowStaleResults = true, userOpName = userOpName) + let! _, _, check = checker.ParseAndCheckDocument(fileName, textVersion, sourceText.ToString(), options, allowStaleResults = Settings.LanguageServicePerformance.AllowStaleCompletionResults, userOpName = userOpName) let textLines = sourceText.Lines let lineInfo = textLines.GetLineFromPosition(span.Start) let line = lineInfo.LineNumber diff --git a/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs b/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs index 1ec9696d55..3efa2574a1 100644 --- a/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs +++ b/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs @@ -103,7 +103,7 @@ type internal FSharpCompletionProvider static member ProvideCompletionsAsyncAux(checker: FSharpChecker, sourceText: SourceText, caretPosition: int, options: FSharpProjectOptions, filePath: string, textVersionHash: int, getAllSymbols: FSharpCheckFileResults -> AssemblySymbol list) = asyncMaybe { - let! parseResults, _, checkFileResults = checker.ParseAndCheckDocument(filePath, textVersionHash, sourceText.ToString(), options, allowStaleResults = true, userOpName = userOpName) + let! parseResults, _, checkFileResults = checker.ParseAndCheckDocument(filePath, textVersionHash, sourceText.ToString(), options, allowStaleResults = Settings.LanguageServicePerformance.AllowStaleCompletionResults, userOpName = userOpName) let textLines = sourceText.Lines let caretLinePos = textLines.GetLinePosition(caretPosition) diff --git a/vsintegration/src/FSharp.Editor/Diagnostics/SimplifyNameDiagnosticAnalyzer.fs b/vsintegration/src/FSharp.Editor/Diagnostics/SimplifyNameDiagnosticAnalyzer.fs index 2832265ae1..cfc0c1ccad 100644 --- a/vsintegration/src/FSharp.Editor/Diagnostics/SimplifyNameDiagnosticAnalyzer.fs +++ b/vsintegration/src/FSharp.Editor/Diagnostics/SimplifyNameDiagnosticAnalyzer.fs @@ -62,7 +62,7 @@ type internal SimplifyNameDiagnosticAnalyzer() = | _ -> let! sourceText = document.GetTextAsync() let checker = getChecker document - let! _, _, checkResults = checker.ParseAndCheckDocument(document, projectOptions, sourceText = sourceText, allowStaleResults = true, userOpName=userOpName) + let! _, _, checkResults = checker.ParseAndCheckDocument(document, projectOptions, sourceText = sourceText, allowStaleResults = Settings.LanguageServicePerformance.AllowStaleCompletionResults, userOpName=userOpName) let! symbolUses = checkResults.GetAllUsesOfAllSymbolsInFile() |> liftAsync let mutable result = ResizeArray() let symbolUses = diff --git a/vsintegration/src/FSharp.Editor/Diagnostics/UnusedDeclarationsAnalyzer.fs b/vsintegration/src/FSharp.Editor/Diagnostics/UnusedDeclarationsAnalyzer.fs index 7e4a819900..23cb921524 100644 --- a/vsintegration/src/FSharp.Editor/Diagnostics/UnusedDeclarationsAnalyzer.fs +++ b/vsintegration/src/FSharp.Editor/Diagnostics/UnusedDeclarationsAnalyzer.fs @@ -110,7 +110,7 @@ type internal UnusedDeclarationsAnalyzer() = | Some (_parsingOptions, projectOptions) -> let! sourceText = document.GetTextAsync() let checker = getChecker document - let! _, _, checkResults = checker.ParseAndCheckDocument(document, projectOptions, sourceText = sourceText, allowStaleResults = true, userOpName = userOpName) + let! _, _, checkResults = checker.ParseAndCheckDocument(document, projectOptions, sourceText = sourceText, allowStaleResults = Settings.LanguageServicePerformance.AllowStaleCompletionResults, userOpName = userOpName) let! allSymbolUsesInFile = checkResults.GetAllUsesOfAllSymbolsInFile() |> liftAsync let unusedRanges = getUnusedDeclarationRanges allSymbolUsesInFile (isScriptFile document.FilePath) return diff --git a/vsintegration/src/FSharp.Editor/Diagnostics/UnusedOpensDiagnosticAnalyzer.fs b/vsintegration/src/FSharp.Editor/Diagnostics/UnusedOpensDiagnosticAnalyzer.fs index b8a5b67f66..2e01e595b8 100644 --- a/vsintegration/src/FSharp.Editor/Diagnostics/UnusedOpensDiagnosticAnalyzer.fs +++ b/vsintegration/src/FSharp.Editor/Diagnostics/UnusedOpensDiagnosticAnalyzer.fs @@ -43,7 +43,7 @@ type internal UnusedOpensDiagnosticAnalyzer() = asyncMaybe { do! Option.guard Settings.CodeFixes.UnusedOpens let! sourceText = document.GetTextAsync() - let! _, _, checkResults = checker.ParseAndCheckDocument(document, options, sourceText = sourceText, allowStaleResults = true, userOpName = userOpName) + let! _, _, checkResults = checker.ParseAndCheckDocument(document, options, sourceText = sourceText, allowStaleResults = Settings.LanguageServicePerformance.AllowStaleCompletionResults, userOpName = userOpName) #if DEBUG let sw = Stopwatch.StartNew() #endif diff --git a/vsintegration/src/FSharp.Editor/DocumentHighlights/DocumentHighlightsService.fs b/vsintegration/src/FSharp.Editor/DocumentHighlights/DocumentHighlightsService.fs index b4c5bd2dc5..5579d28438 100644 --- a/vsintegration/src/FSharp.Editor/DocumentHighlights/DocumentHighlightsService.fs +++ b/vsintegration/src/FSharp.Editor/DocumentHighlights/DocumentHighlightsService.fs @@ -59,7 +59,7 @@ type internal FSharpDocumentHighlightsService [] (checkerP let textLinePos = sourceText.Lines.GetLinePosition(position) let fcsTextLineNumber = Line.fromZ textLinePos.Line let! symbol = Tokenizer.getSymbolAtPosition(documentKey, sourceText, position, filePath, defines, SymbolLookupKind.Greedy, false) - let! _, _, checkFileResults = checker.ParseAndCheckDocument(filePath, textVersionHash, sourceText.ToString(), options, allowStaleResults = true, userOpName = userOpName) + let! _, _, checkFileResults = checker.ParseAndCheckDocument(filePath, textVersionHash, sourceText.ToString(), options, allowStaleResults = Settings.LanguageServicePerformance.AllowStaleCompletionResults, userOpName = userOpName) let! symbolUse = checkFileResults.GetSymbolUseAtLocation(fcsTextLineNumber, symbol.Ident.idRange.EndColumn, textLine.ToString(), symbol.FullIsland, userOpName=userOpName) let! symbolUses = checkFileResults.GetUsesOfSymbolInFile(symbolUse.Symbol) |> liftAsync return diff --git a/vsintegration/src/FSharp.Editor/InlineRename/InlineRenameService.fs b/vsintegration/src/FSharp.Editor/InlineRename/InlineRenameService.fs index 9a03d6971f..2f6bf67d9d 100644 --- a/vsintegration/src/FSharp.Editor/InlineRename/InlineRenameService.fs +++ b/vsintegration/src/FSharp.Editor/InlineRename/InlineRenameService.fs @@ -149,7 +149,7 @@ type internal InlineRenameService let textLinePos = sourceText.Lines.GetLinePosition(position) let fcsTextLineNumber = Line.fromZ textLinePos.Line let! symbol = Tokenizer.getSymbolAtPosition(document.Id, sourceText, position, document.FilePath, defines, SymbolLookupKind.Greedy, false) - let! _, _, checkFileResults = checker.ParseAndCheckDocument(document, options, allowStaleResults = true, userOpName = userOpName) + let! _, _, checkFileResults = checker.ParseAndCheckDocument(document, options, allowStaleResults = Settings.LanguageServicePerformance.AllowStaleCompletionResults, userOpName = userOpName) let! symbolUse = checkFileResults.GetSymbolUseAtLocation(fcsTextLineNumber, symbol.Ident.idRange.EndColumn, textLine.Text.ToString(), symbol.FullIsland, userOpName=userOpName) let! declLoc = symbolUse.GetDeclarationLocation(document) diff --git a/vsintegration/src/FSharp.Editor/LanguageService/FSharpCheckerExtensions.fs b/vsintegration/src/FSharp.Editor/LanguageService/FSharpCheckerExtensions.fs index d73451d0bb..d8b892aec5 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/FSharpCheckerExtensions.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/FSharpCheckerExtensions.fs @@ -63,10 +63,10 @@ type FSharpChecker with | Ready x -> async.Return x | StillRunning worker -> async { - match allowStaleResults, checker.TryGetRecentCheckResultsForFile(filePath, options) with - | true, Some (parseResults, checkFileResults, _) -> + match checker.TryGetRecentCheckResultsForFile(filePath, options) with + | Some (parseResults, checkFileResults, _) -> return Some (parseResults, checkFileResults) - | _ -> + | None -> return! worker } return bindParsedInput results diff --git a/vsintegration/src/FSharp.Editor/LanguageService/SymbolHelpers.fs b/vsintegration/src/FSharp.Editor/LanguageService/SymbolHelpers.fs index 3b47b1b55e..6cbba468dd 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/SymbolHelpers.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/SymbolHelpers.fs @@ -33,7 +33,7 @@ module internal SymbolHelpers = let! parsingOptions, projectOptions = projectInfoManager.TryGetOptionsForEditingDocumentOrProject(document) let defines = CompilerEnvironment.GetCompilationDefinesForEditing parsingOptions let! symbol = Tokenizer.getSymbolAtPosition(document.Id, sourceText, position, document.FilePath, defines, SymbolLookupKind.Greedy, false) - let! _, _, checkFileResults = checker.ParseAndCheckDocument(document.FilePath, textVersionHash, sourceText.ToString(), projectOptions, allowStaleResults = true, userOpName = userOpName) + let! _, _, checkFileResults = checker.ParseAndCheckDocument(document.FilePath, textVersionHash, sourceText.ToString(), projectOptions, allowStaleResults = Settings.LanguageServicePerformance.AllowStaleCompletionResults, userOpName = userOpName) let! symbolUse = checkFileResults.GetSymbolUseAtLocation(fcsTextLineNumber, symbol.Ident.idRange.EndColumn, textLine.ToString(), symbol.FullIsland, userOpName=userOpName) let! symbolUses = checkFileResults.GetUsesOfSymbolInFile(symbolUse.Symbol) |> liftAsync return symbolUses @@ -106,7 +106,7 @@ module internal SymbolHelpers = let! parsingOptions, projectOptions = projectInfoManager.TryGetOptionsForEditingDocumentOrProject document let defines = CompilerEnvironment.GetCompilationDefinesForEditing parsingOptions let! symbol = Tokenizer.getSymbolAtPosition(document.Id, sourceText, symbolSpan.Start, document.FilePath, defines, SymbolLookupKind.Greedy, false) - let! _, _, checkFileResults = checker.ParseAndCheckDocument(document, projectOptions, allowStaleResults = true, userOpName = userOpName) + let! _, _, checkFileResults = checker.ParseAndCheckDocument(document, projectOptions, allowStaleResults = Settings.LanguageServicePerformance.AllowStaleCompletionResults, userOpName = userOpName) let textLine = sourceText.Lines.GetLineFromPosition(symbolSpan.Start) let textLinePos = sourceText.Lines.GetLinePosition(symbolSpan.Start) let fcsTextLineNumber = Line.fromZ textLinePos.Line diff --git a/vsintegration/src/FSharp.Editor/Navigation/FindUsagesService.fs b/vsintegration/src/FSharp.Editor/Navigation/FindUsagesService.fs index 1177b18ad9..e99fab65e6 100644 --- a/vsintegration/src/FSharp.Editor/Navigation/FindUsagesService.fs +++ b/vsintegration/src/FSharp.Editor/Navigation/FindUsagesService.fs @@ -52,7 +52,7 @@ type internal FSharpFindUsagesService let! sourceText = document.GetTextAsync(context.CancellationToken) |> Async.AwaitTask |> liftAsync let checker = checkerProvider.Checker let! parsingOptions, _, projectOptions = projectInfoManager.TryGetOptionsForDocumentOrProject(document) - let! _, _, checkFileResults = checker.ParseAndCheckDocument(document, projectOptions, sourceText = sourceText, allowStaleResults = true, userOpName = userOpName) + let! _, _, checkFileResults = checker.ParseAndCheckDocument(document, projectOptions, sourceText = sourceText, allowStaleResults = Settings.LanguageServicePerformance.AllowStaleCompletionResults, userOpName = userOpName) let textLine = sourceText.Lines.GetLineFromPosition(position).ToString() let lineNumber = sourceText.Lines.GetLinePosition(position).Line + 1 let defines = CompilerEnvironment.GetCompilationDefinesForEditing parsingOptions diff --git a/vsintegration/src/FSharp.Editor/Navigation/GoToDefinition.fs b/vsintegration/src/FSharp.Editor/Navigation/GoToDefinition.fs index 2c2aef7845..a72b5355cc 100644 --- a/vsintegration/src/FSharp.Editor/Navigation/GoToDefinition.fs +++ b/vsintegration/src/FSharp.Editor/Navigation/GoToDefinition.fs @@ -181,7 +181,7 @@ type internal GoToDefinition(checker: FSharpChecker, projectInfoManager: FSharpP let fcsTextLineNumber = Line.fromZ textLinePos.Line let lineText = (sourceText.Lines.GetLineFromPosition position).ToString() - let! _, _, checkFileResults = checker.ParseAndCheckDocument (originDocument, projectOptions, allowStaleResults=true,sourceText=sourceText, userOpName=userOpName) + let! _, _, checkFileResults = checker.ParseAndCheckDocument (originDocument, projectOptions, allowStaleResults=Settings.LanguageServicePerformance.AllowStaleCompletionResults,sourceText=sourceText, userOpName=userOpName) let idRange = lexerSymbol.Ident.idRange let! fsSymbolUse = checkFileResults.GetSymbolUseAtLocation (fcsTextLineNumber, idRange.EndColumn, lineText, lexerSymbol.FullIsland, userOpName=userOpName) let symbol = fsSymbolUse.Symbol @@ -194,7 +194,7 @@ type internal GoToDefinition(checker: FSharpChecker, projectInfoManager: FSharpP let! implDoc = originDocument.Project.Solution.TryGetDocumentFromPath fsfilePath let! implSourceText = implDoc.GetTextAsync () let! _parsingOptions, projectOptions = projectInfoManager.TryGetOptionsForEditingDocumentOrProject implDoc - let! _, _, checkFileResults = checker.ParseAndCheckDocument (implDoc, projectOptions, allowStaleResults=true, sourceText=implSourceText, userOpName=userOpName) + let! _, _, checkFileResults = checker.ParseAndCheckDocument (implDoc, projectOptions, allowStaleResults=Settings.LanguageServicePerformance.AllowStaleCompletionResults, sourceText=implSourceText, userOpName=userOpName) let! symbolUses = checkFileResults.GetUsesOfSymbolInFile symbol |> liftAsync let! implSymbol = symbolUses |> Array.tryHead let! implTextSpan = RoslynHelpers.TryFSharpRangeToTextSpan (implSourceText, implSymbol.RangeAlternate) @@ -233,7 +233,7 @@ type internal GoToDefinition(checker: FSharpChecker, projectInfoManager: FSharpP let preferSignature = isSignatureFile originDocument.FilePath - let! _, _, checkFileResults = checker.ParseAndCheckDocument (originDocument, projectOptions, allowStaleResults=true, sourceText=sourceText, userOpName=userOpName) + let! _, _, checkFileResults = checker.ParseAndCheckDocument (originDocument, projectOptions, allowStaleResults=Settings.LanguageServicePerformance.AllowStaleCompletionResults, sourceText=sourceText, userOpName=userOpName) let! lexerSymbol = Tokenizer.getSymbolAtPosition (originDocument.Id, sourceText, position,originDocument.FilePath, defines, SymbolLookupKind.Greedy, false) let idRange = lexerSymbol.Ident.idRange diff --git a/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs b/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs index 10298f2219..2d7b07ef4a 100644 --- a/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs +++ b/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs @@ -43,6 +43,7 @@ type CodeFixesOptions = [] type LanguageServicePerformanceOptions = { EnableInMemoryCrossProjectReferences: bool + AllowStaleCompletionResults: bool TimeUntilStaleCompletion: int ProjectCheckCacheSize: int } @@ -74,6 +75,7 @@ type internal Settings [](store: SettingsStore) = store.RegisterDefault { EnableInMemoryCrossProjectReferences = true + AllowStaleCompletionResults = true TimeUntilStaleCompletion = 2000 // In ms, so this is 2 seconds ProjectCheckCacheSize = 200 } diff --git a/vsintegration/src/FSharp.Editor/QuickInfo/QuickInfoProvider.fs b/vsintegration/src/FSharp.Editor/QuickInfo/QuickInfoProvider.fs index a41fa05a5d..69886526e1 100644 --- a/vsintegration/src/FSharp.Editor/QuickInfo/QuickInfoProvider.fs +++ b/vsintegration/src/FSharp.Editor/QuickInfo/QuickInfoProvider.fs @@ -169,7 +169,7 @@ type internal FSharpAsyncQuickInfoSource // test helper static member ProvideQuickInfo(checker:FSharpChecker, documentId:DocumentId, sourceText:SourceText, filePath:string, position:int, parsingOptions:FSharpParsingOptions, options:FSharpProjectOptions, textVersionHash:int) = asyncMaybe { - let! _, _, checkFileResults = checker.ParseAndCheckDocument(filePath, textVersionHash, sourceText.ToString(), options, allowStaleResults=true, userOpName=FSharpQuickInfo.userOpName) + let! _, _, checkFileResults = checker.ParseAndCheckDocument(filePath, textVersionHash, sourceText.ToString(), options, allowStaleResults=Settings.LanguageServicePerformance.AllowStaleCompletionResults, userOpName=FSharpQuickInfo.userOpName) let textLine = sourceText.Lines.GetLineFromPosition position let textLineNumber = textLine.LineNumber + 1 // Roslyn line numbers are zero-based let defines = CompilerEnvironment.GetCompilationDefinesForEditing parsingOptions diff --git a/vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj b/vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj index 17c2438c32..3261a886e8 100644 --- a/vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj +++ b/vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj @@ -35,9 +35,17 @@ + + + True + True + Strings.resx + + - + PublicResXFileCodeGenerator + Strings.Designer.cs diff --git a/vsintegration/src/FSharp.UIResources/LanguageServicePerformanceOptionControl.xaml b/vsintegration/src/FSharp.UIResources/LanguageServicePerformanceOptionControl.xaml index b871fa6c98..e67690250d 100644 --- a/vsintegration/src/FSharp.UIResources/LanguageServicePerformanceOptionControl.xaml +++ b/vsintegration/src/FSharp.UIResources/LanguageServicePerformanceOptionControl.xaml @@ -17,46 +17,61 @@ - + + Content="{x:Static local:Strings.Enable_in_memory_cross_project_references}" + ToolTip="{x:Static local:Strings.Tooltip_in_memory_cross_project_references}"/> - + - - + + + + + + - + - diff --git a/vsintegration/src/FSharp.UIResources/Strings.Designer.cs b/vsintegration/src/FSharp.UIResources/Strings.Designer.cs index db7e10903a..14ed3eb2d6 100644 --- a/vsintegration/src/FSharp.UIResources/Strings.Designer.cs +++ b/vsintegration/src/FSharp.UIResources/Strings.Designer.cs @@ -123,6 +123,24 @@ public static string Enable_in_memory_cross_project_references { } } + /// + /// Looks up a localized string similar to Enable stale data for IntelliSense features. + /// + public static string Enable_Stale_IntelliSense_Results { + get { + return ResourceManager.GetString("Enable_Stale_IntelliSense_Results", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to IntelliSense Performance Options. + /// + public static string IntelliSense_Performance { + get { + return ResourceManager.GetString("IntelliSense_Performance", resourceCulture); + } + } + /// /// Looks up a localized string similar to Performance. /// @@ -151,7 +169,7 @@ public static string Outlining { } /// - /// Looks up a localized string similar to Project check cache size. + /// Looks up a localized string similar to Number of projects whose data is cached in memory. /// public static string Project_check_cache_size { get { @@ -159,6 +177,15 @@ public static string Project_check_cache_size { } } + /// + /// Looks up a localized string similar to F# Project and Caching Performance Options. + /// + public static string Project_Performance { + get { + return ResourceManager.GetString("Project_Performance", resourceCulture); + } + } + /// /// Looks up a localized string similar to Show s_ymbols in unopened namespaces. /// @@ -232,7 +259,7 @@ public static string Solid_underline { } /// - /// Looks up a localized string similar to Time until stale results for completion (in milliseconds). + /// Looks up a localized string similar to Time until stale results are used (in milliseconds). /// public static string Time_until_stale_completion { get { @@ -240,6 +267,24 @@ public static string Time_until_stale_completion { } } + /// + /// Looks up a localized string similar to In-memory cross-project references store project-level data in memory to allow IDE features to work across projects.. + /// + public static string Tooltip_in_memory_cross_project_references { + get { + return ResourceManager.GetString("Tooltip_in_memory_cross_project_references", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions.. + /// + public static string Tooltip_project_check_cache_size { + get { + return ResourceManager.GetString("Tooltip_project_check_cache_size", resourceCulture); + } + } + /// /// Looks up a localized string similar to Analyze and suggest fixes for unused values. /// diff --git a/vsintegration/src/FSharp.UIResources/Strings.resx b/vsintegration/src/FSharp.UIResources/Strings.resx index 5c65cadfb8..3490fbd916 100644 --- a/vsintegration/src/FSharp.UIResources/Strings.resx +++ b/vsintegration/src/FSharp.UIResources/Strings.resx @@ -151,7 +151,7 @@ _Enable in-memory cross project references - Project check cache size + Number of projects whose data is cached in memory S_how navigation links as @@ -181,6 +181,21 @@ Show outlining and collapsable nodes for F# code - Time until stale results for completion (in milliseconds) + Time until stale results are used (in milliseconds) + + + IntelliSense Performance Options + + + F# Project and Caching Performance Options + + + Enable stale data for IntelliSense features + + + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + + + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf index dea9016246..a433049aaa 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf @@ -58,8 +58,8 @@ - Project check cache size - Velikost mezipaměti pro kontrolu projektů + Number of projects whose data is cached in memory + Velikost mezipaměti pro kontrolu projektů @@ -108,8 +108,33 @@ - Time until stale results for completion (in milliseconds) - Time until stale results for completion (in milliseconds) + Time until stale results are used (in milliseconds) + Time until stale results are used (in milliseconds) + + + + IntelliSense Performance Options + IntelliSense Performance Options + + + + F# Project and Caching Performance Options + F# Project and Caching Performance Options + + + + Enable stale data for IntelliSense features + Enable stale data for IntelliSense features + + + + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + + + + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf index 7404ecdd86..5ecab7182f 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf @@ -58,8 +58,8 @@ - Project check cache size - Überprüfung der Projektcachegröße + Number of projects whose data is cached in memory + Überprüfung der Projektcachegröße @@ -108,8 +108,33 @@ - Time until stale results for completion (in milliseconds) - Time until stale results for completion (in milliseconds) + Time until stale results are used (in milliseconds) + Time until stale results are used (in milliseconds) + + + + IntelliSense Performance Options + IntelliSense Performance Options + + + + F# Project and Caching Performance Options + F# Project and Caching Performance Options + + + + Enable stale data for IntelliSense features + Enable stale data for IntelliSense features + + + + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + + + + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.en.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.en.xlf index 24a821572d..ac554cc370 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.en.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.en.xlf @@ -58,8 +58,8 @@ - Project check cache size - Project check cache size + Number of projects whose data is cached in memory + Number of projects whose data is cached in memory @@ -108,8 +108,33 @@ - Time until stale results for completion (in milliseconds) - Time until stale results for completion (in milliseconds) + Time until stale results are used (in milliseconds) + Time until stale results are used (in milliseconds) + + + + IntelliSense Performance Options + IntelliSense Performance Options + + + + F# Project and Caching Performance Options + F# Project and Caching Performance Options + + + + Enable stale data for IntelliSense features + Enable stale data for IntelliSense features + + + + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + + + + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf index d80965180e..169ab6e70b 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf @@ -58,8 +58,8 @@ - Project check cache size - Tamaño de caché de comprobación de proyectos + Number of projects whose data is cached in memory + Tamaño de caché de comprobación de proyectos @@ -108,8 +108,33 @@ - Time until stale results for completion (in milliseconds) - Time until stale results for completion (in milliseconds) + Time until stale results are used (in milliseconds) + Time until stale results are used (in milliseconds) + + + + IntelliSense Performance Options + IntelliSense Performance Options + + + + F# Project and Caching Performance Options + F# Project and Caching Performance Options + + + + Enable stale data for IntelliSense features + Enable stale data for IntelliSense features + + + + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + + + + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf index b179df1874..25775dd37e 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf @@ -58,8 +58,8 @@ - Project check cache size - Taille du cache de vérification du projet + Number of projects whose data is cached in memory + Taille du cache de vérification du projet @@ -108,8 +108,33 @@ - Time until stale results for completion (in milliseconds) - Time until stale results for completion (in milliseconds) + Time until stale results are used (in milliseconds) + Time until stale results are used (in milliseconds) + + + + IntelliSense Performance Options + IntelliSense Performance Options + + + + F# Project and Caching Performance Options + F# Project and Caching Performance Options + + + + Enable stale data for IntelliSense features + Enable stale data for IntelliSense features + + + + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + + + + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf index 76b79b76cc..ce04c11939 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf @@ -58,8 +58,8 @@ - Project check cache size - Dimensioni della cache di controllo del progetto + Number of projects whose data is cached in memory + Dimensioni della cache di controllo del progetto @@ -108,8 +108,33 @@ - Time until stale results for completion (in milliseconds) - Time until stale results for completion (in milliseconds) + Time until stale results are used (in milliseconds) + Time until stale results are used (in milliseconds) + + + + IntelliSense Performance Options + IntelliSense Performance Options + + + + F# Project and Caching Performance Options + F# Project and Caching Performance Options + + + + Enable stale data for IntelliSense features + Enable stale data for IntelliSense features + + + + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + + + + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf index 483e008001..121f92eeb6 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf @@ -58,8 +58,8 @@ - Project check cache size - プロジェクト チェックのキャッシュ サイズ + Number of projects whose data is cached in memory + プロジェクト チェックのキャッシュ サイズ @@ -108,8 +108,33 @@ - Time until stale results for completion (in milliseconds) - Time until stale results for completion (in milliseconds) + Time until stale results are used (in milliseconds) + Time until stale results are used (in milliseconds) + + + + IntelliSense Performance Options + IntelliSense Performance Options + + + + F# Project and Caching Performance Options + F# Project and Caching Performance Options + + + + Enable stale data for IntelliSense features + Enable stale data for IntelliSense features + + + + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + + + + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf index e3ff369e27..5584ac9b35 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf @@ -58,8 +58,8 @@ - Project check cache size - 프로젝트 검사 캐시 크기 + Number of projects whose data is cached in memory + 프로젝트 검사 캐시 크기 @@ -108,8 +108,33 @@ - Time until stale results for completion (in milliseconds) - Time until stale results for completion (in milliseconds) + Time until stale results are used (in milliseconds) + Time until stale results are used (in milliseconds) + + + + IntelliSense Performance Options + IntelliSense Performance Options + + + + F# Project and Caching Performance Options + F# Project and Caching Performance Options + + + + Enable stale data for IntelliSense features + Enable stale data for IntelliSense features + + + + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + + + + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf index 48408ed3f0..4b6fd9bb9a 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf @@ -58,8 +58,8 @@ - Project check cache size - Rozmiar pamięci podręcznej sprawdzania projektu + Number of projects whose data is cached in memory + Rozmiar pamięci podręcznej sprawdzania projektu @@ -108,8 +108,33 @@ - Time until stale results for completion (in milliseconds) - Time until stale results for completion (in milliseconds) + Time until stale results are used (in milliseconds) + Time until stale results are used (in milliseconds) + + + + IntelliSense Performance Options + IntelliSense Performance Options + + + + F# Project and Caching Performance Options + F# Project and Caching Performance Options + + + + Enable stale data for IntelliSense features + Enable stale data for IntelliSense features + + + + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + + + + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf index 5d7a57aa08..3df31e3689 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf @@ -58,8 +58,8 @@ - Project check cache size - Tamanho do cache de verificação do projeto + Number of projects whose data is cached in memory + Tamanho do cache de verificação do projeto @@ -108,8 +108,33 @@ - Time until stale results for completion (in milliseconds) - Time until stale results for completion (in milliseconds) + Time until stale results are used (in milliseconds) + Time until stale results are used (in milliseconds) + + + + IntelliSense Performance Options + IntelliSense Performance Options + + + + F# Project and Caching Performance Options + F# Project and Caching Performance Options + + + + Enable stale data for IntelliSense features + Enable stale data for IntelliSense features + + + + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + + + + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf index db0304bfc1..46deaa9227 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf @@ -58,8 +58,8 @@ - Project check cache size - Размер кэша проверки проекта + Number of projects whose data is cached in memory + Размер кэша проверки проекта @@ -108,8 +108,33 @@ - Time until stale results for completion (in milliseconds) - Time until stale results for completion (in milliseconds) + Time until stale results are used (in milliseconds) + Time until stale results are used (in milliseconds) + + + + IntelliSense Performance Options + IntelliSense Performance Options + + + + F# Project and Caching Performance Options + F# Project and Caching Performance Options + + + + Enable stale data for IntelliSense features + Enable stale data for IntelliSense features + + + + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + + + + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf index 737e38f4bc..018e8300a9 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf @@ -58,8 +58,8 @@ - Project check cache size - Proje denetimi önbelleği boyutu + Number of projects whose data is cached in memory + Proje denetimi önbelleği boyutu @@ -108,8 +108,33 @@ - Time until stale results for completion (in milliseconds) - Time until stale results for completion (in milliseconds) + Time until stale results are used (in milliseconds) + Time until stale results are used (in milliseconds) + + + + IntelliSense Performance Options + IntelliSense Performance Options + + + + F# Project and Caching Performance Options + F# Project and Caching Performance Options + + + + Enable stale data for IntelliSense features + Enable stale data for IntelliSense features + + + + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + + + + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf index bfe2a33143..05d5f382e6 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf @@ -58,8 +58,8 @@ - Project check cache size - 项目检查缓存大小 + Number of projects whose data is cached in memory + 项目检查缓存大小 @@ -108,8 +108,33 @@ - Time until stale results for completion (in milliseconds) - Time until stale results for completion (in milliseconds) + Time until stale results are used (in milliseconds) + Time until stale results are used (in milliseconds) + + + + IntelliSense Performance Options + IntelliSense Performance Options + + + + F# Project and Caching Performance Options + F# Project and Caching Performance Options + + + + Enable stale data for IntelliSense features + Enable stale data for IntelliSense features + + + + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + + + + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf index 551cf811ab..35ba349890 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf @@ -58,8 +58,8 @@ - Project check cache size - 專案檢查快取大小 + Number of projects whose data is cached in memory + 專案檢查快取大小 @@ -108,8 +108,33 @@ - Time until stale results for completion (in milliseconds) - Time until stale results for completion (in milliseconds) + Time until stale results are used (in milliseconds) + Time until stale results are used (in milliseconds) + + + + IntelliSense Performance Options + IntelliSense Performance Options + + + + F# Project and Caching Performance Options + F# Project and Caching Performance Options + + + + Enable stale data for IntelliSense features + Enable stale data for IntelliSense features + + + + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + + + + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. From 582b9677084d3156dfe808a34cbeb3d32156cc7c Mon Sep 17 00:00:00 2001 From: Will Smith Date: Wed, 20 Jun 2018 12:13:29 -0700 Subject: [PATCH 051/150] Ref/Span fixes (#5146) * Added LimitedValFlags for PostInferenceChecks * More work * Renamed IsLimited to IsLimitedSpanLike * Don't use isByRefReturnCall in CheckExprs * Minor cleanup * Changed error message. Fixed safety rule regarding byrefs returning and passing. * Fixed an edge case with returning span. Simplified Expr.App * Cleanup * Fixed a few ref return checks. Partially handling byref of span-like types * Simplifying flags. Added CheckCall * Updated test baseline. Added several CheckCall functions * Updated baseline tests * Handling byref of span likes * Added a little bit better error msg for LByrefGet * Removed commented code * Fixed test * Fixed inability to use byref> for delegates and slots * Minor cleanup with some comments * Few more comments * Running neg tests in core/span. Fixed bug in IsByRefLike structs with span fields * Updated baseline * Fixed more issues with slots. Simplified PermitByRefType * Added a little better error messages on spans * Fixed record construction for span likes. Fixed setting fields on mutable structs not having any rules for span likes. Updated a few error msgs. Added lots of tests. * Updated error msg on function call. Added a removed comment from previous commit. Updated baselines * Added internalTestSpanStackReferring test option * Added special handling for receivers * Fixing build * Fixing build * Fixing build * More tests, updated baseline --- .../FSharp.Compiler.Private/FSComp.fs | 20 +- .../FSharp.Compiler.Private/FSComp.resx | 15 +- src/fsharp/CompileOps.fs | 7 +- src/fsharp/CompileOps.fsi | 3 + src/fsharp/CompileOptions.fs | 1 + src/fsharp/FSComp.txt | 7 +- src/fsharp/PostInferenceChecks.fs | 505 +++++++++++++----- src/fsharp/PostInferenceChecks.fsi | 2 +- src/fsharp/TastOps.fs | 8 + src/fsharp/TastOps.fsi | 4 + src/fsharp/TypeChecker.fs | 16 +- src/fsharp/TypeChecker.fsi | 4 +- src/fsharp/xlf/FSComp.txt.cs.xlf | 29 +- src/fsharp/xlf/FSComp.txt.de.xlf | 29 +- src/fsharp/xlf/FSComp.txt.en.xlf | 29 +- src/fsharp/xlf/FSComp.txt.es.xlf | 29 +- src/fsharp/xlf/FSComp.txt.fr.xlf | 29 +- src/fsharp/xlf/FSComp.txt.it.xlf | 29 +- src/fsharp/xlf/FSComp.txt.ja.xlf | 29 +- src/fsharp/xlf/FSComp.txt.ko.xlf | 29 +- src/fsharp/xlf/FSComp.txt.pl.xlf | 29 +- src/fsharp/xlf/FSComp.txt.pt-BR.xlf | 29 +- src/fsharp/xlf/FSComp.txt.ru.xlf | 29 +- src/fsharp/xlf/FSComp.txt.tr.xlf | 29 +- src/fsharp/xlf/FSComp.txt.zh-Hans.xlf | 29 +- src/fsharp/xlf/FSComp.txt.zh-Hant.xlf | 29 +- tests/fsharp/core/span/test.bsl | 16 + tests/fsharp/core/span/test.fsx | 23 +- tests/fsharp/core/span/test2.bsl | 52 ++ tests/fsharp/core/span/test2.fsx | 324 +++++++++++ tests/fsharp/single-test.fs | 2 + tests/fsharp/tests.fs | 29 +- tests/fsharp/typecheck/sigs/neg63.bsl | 2 +- tests/fsharp/typecheck/sigs/neg_byref_7.bsl | 2 - 34 files changed, 1156 insertions(+), 292 deletions(-) create mode 100644 tests/fsharp/core/span/test.bsl create mode 100644 tests/fsharp/core/span/test2.bsl create mode 100644 tests/fsharp/core/span/test2.fsx diff --git a/src/buildfromsource/FSharp.Compiler.Private/FSComp.fs b/src/buildfromsource/FSharp.Compiler.Private/FSComp.fs index b1c033de96..32f0d89eb7 100644 --- a/src/buildfromsource/FSharp.Compiler.Private/FSComp.fs +++ b/src/buildfromsource/FSharp.Compiler.Private/FSComp.fs @@ -4324,10 +4324,10 @@ type internal SR private() = /// A type annotated with IsByRefLike must also be a struct. Consider adding the [] attribute to the type. /// (Originally from ..\FSComp.txt:1432) static member tcByRefLikeNotStruct() = (3227, GetStringFunc("tcByRefLikeNotStruct",",,,") ) - /// The address of the variable '%s' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. + /// The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. /// (Originally from ..\FSComp.txt:1433) - static member chkNoByrefReturnOfLocal(a0 : System.String) = (3228, GetStringFunc("chkNoByrefReturnOfLocal",",,,%s,,,") a0) - /// The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + static member chkNoByrefAddressOfValueFromExpression() = (3228, GetStringFunc("chkNoByrefAddressOfValueFromExpression",",,,") ) + /// The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. /// (Originally from ..\FSComp.txt:1434) static member chkNoReturnOfLimitedSpan() = (3229, GetStringFunc("chkNoReturnOfLimitedSpan",",,,") ) /// This value can't be assigned because the target '%s' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. @@ -4342,6 +4342,15 @@ type internal SR private() = /// Struct members cannot return the address of fields of the struct by reference /// (Originally from ..\FSComp.txt:1438) static member chkStructsMayNotReturnAddressesOfContents() = (3234, GetStringFunc("chkStructsMayNotReturnAddressesOfContents",",,,") ) + /// The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + /// (Originally from ..\FSComp.txt:1439) + static member chkNoByrefLikeFunctionCall() = (3235, GetStringFunc("chkNoByrefLikeFunctionCall",",,,") ) + /// The Span or IsByRefLike variable '%s' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + /// (Originally from ..\FSComp.txt:1440) + static member chkNoSpanLikeVariable(a0 : System.String) = (3236, GetStringFunc("chkNoSpanLikeVariable",",,,%s,,,") a0) + /// A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + /// (Originally from ..\FSComp.txt:1441) + static member chkNoSpanLikeValueFromExpression() = (3237, GetStringFunc("chkNoSpanLikeValueFromExpression",",,,") ) /// Call this method once to validate that all known resources are valid; throws if not static member RunStartupValidation() = @@ -5748,10 +5757,13 @@ type internal SR private() = ignore(GetString("readOnlyAttributeOnStructWithMutableField")) ignore(GetString("tcByrefReturnImplicitlyDereferenced")) ignore(GetString("tcByRefLikeNotStruct")) - ignore(GetString("chkNoByrefReturnOfLocal")) + ignore(GetString("chkNoByrefAddressOfValueFromExpression")) ignore(GetString("chkNoReturnOfLimitedSpan")) ignore(GetString("chkNoWriteToLimitedSpan")) ignore(GetString("tastValueMustBeLocal")) ignore(GetString("tcIsReadOnlyNotStruct")) ignore(GetString("chkStructsMayNotReturnAddressesOfContents")) + ignore(GetString("chkNoByrefLikeFunctionCall")) + ignore(GetString("chkNoSpanLikeVariable")) + ignore(GetString("chkNoSpanLikeValueFromExpression")) () diff --git a/src/buildfromsource/FSharp.Compiler.Private/FSComp.resx b/src/buildfromsource/FSharp.Compiler.Private/FSComp.resx index 648490ca5c..c24e17e1f2 100644 --- a/src/buildfromsource/FSharp.Compiler.Private/FSComp.resx +++ b/src/buildfromsource/FSharp.Compiler.Private/FSComp.resx @@ -4327,11 +4327,11 @@ A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. - - The address of the variable '{0}' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. + + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. @@ -4345,4 +4345,13 @@ Struct members cannot return the address of fields of the struct by reference + + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + + + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + \ No newline at end of file diff --git a/src/fsharp/CompileOps.fs b/src/fsharp/CompileOps.fs index 42528dd388..d54373c554 100644 --- a/src/fsharp/CompileOps.fs +++ b/src/fsharp/CompileOps.fs @@ -2347,6 +2347,7 @@ type TcConfigBuilder = /// and from which we can read the metadata. Only used when metadataOnly=true. mutable tryGetMetadataSnapshot : ILReaderTryGetMetadataSnapshot + mutable internalTestSpanStackReferring : bool } static member Initial = @@ -2483,6 +2484,7 @@ type TcConfigBuilder = copyFSharpCore = CopyFSharpCoreFlag.No shadowCopyReferences = false tryGetMetadataSnapshot = (fun _ -> None) + internalTestSpanStackReferring = false } static member CreateNew(legacyReferenceResolver, defaultFSharpBinariesDir, reduceMemoryUsage, implicitIncludeDir, @@ -2943,6 +2945,7 @@ type TcConfig private (data : TcConfigBuilder, validate:bool) = member x.copyFSharpCore = data.copyFSharpCore member x.shadowCopyReferences = data.shadowCopyReferences member x.tryGetMetadataSnapshot = data.tryGetMetadataSnapshot + member x.internalTestSpanStackReferring = data.internalTestSpanStackReferring static member Create(builder, validate) = use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Parameter TcConfig(builder, validate) @@ -5431,7 +5434,7 @@ let TypeCheckOneInputEventually (checkForErrors, tcConfig:TcConfig, tcImports:Tc // Typecheck the signature file let! (tcEnv, sigFileType, createsGeneratedProvidedTypes) = - TypeCheckOneSigFile (tcGlobals, tcState.tcsNiceNameGen, amap, tcState.tcsCcu, checkForErrors, tcConfig.conditionalCompilationDefines, tcSink) tcState.tcsTcSigEnv file + TypeCheckOneSigFile (tcGlobals, tcState.tcsNiceNameGen, amap, tcState.tcsCcu, checkForErrors, tcConfig.conditionalCompilationDefines, tcSink, tcConfig.internalTestSpanStackReferring) tcState.tcsTcSigEnv file let rootSigs = Zmap.add qualNameOfFile sigFileType tcState.tcsRootSigs @@ -5468,7 +5471,7 @@ let TypeCheckOneInputEventually (checkForErrors, tcConfig:TcConfig, tcImports:Tc // Typecheck the implementation file let! topAttrs, implFile, _implFileHiddenType, tcEnvAtEnd, createsGeneratedProvidedTypes = - TypeCheckOneImplFile (tcGlobals, tcState.tcsNiceNameGen, amap, tcState.tcsCcu, checkForErrors, tcConfig.conditionalCompilationDefines, tcSink) tcImplEnv rootSigOpt file + TypeCheckOneImplFile (tcGlobals, tcState.tcsNiceNameGen, amap, tcState.tcsCcu, checkForErrors, tcConfig.conditionalCompilationDefines, tcSink, tcConfig.internalTestSpanStackReferring) tcImplEnv rootSigOpt file let hadSig = rootSigOpt.IsSome let implFileSigType = SigTypeOfImplFile implFile diff --git a/src/fsharp/CompileOps.fsi b/src/fsharp/CompileOps.fsi index b7ceb11c41..eb371fa592 100755 --- a/src/fsharp/CompileOps.fsi +++ b/src/fsharp/CompileOps.fsi @@ -363,6 +363,9 @@ type TcConfigBuilder = /// A function to call to try to get an object that acts as a snapshot of the metadata section of a .NET binary, /// and from which we can read the metadata. Only used when metadataOnly=true. mutable tryGetMetadataSnapshot : ILReaderTryGetMetadataSnapshot + + /// if true - 'let mutable x = Span.Empty', the value 'x' is a stack referring span. Used for internal testing purposes only until we get true stack spans. + mutable internalTestSpanStackReferring : bool } static member Initial: TcConfigBuilder diff --git a/src/fsharp/CompileOptions.fs b/src/fsharp/CompileOptions.fs index d660eb712d..6ae18644de 100644 --- a/src/fsharp/CompileOptions.fs +++ b/src/fsharp/CompileOptions.fs @@ -832,6 +832,7 @@ let advancedFlagsFsc tcConfigB = let testFlag tcConfigB = CompilerOption("test", tagString, OptionString (fun s -> match s with + | "StackSpan" -> tcConfigB.internalTestSpanStackReferring <- true | "ErrorRanges" -> tcConfigB.errorStyle <- ErrorStyle.TestErrors | "MemberBodyRanges" -> PostTypeCheckSemanticChecks.testFlagMemberBody := true | "Tracking" -> Lib.tracking := true (* general purpose on/off diagnostics flag *) diff --git a/src/fsharp/FSComp.txt b/src/fsharp/FSComp.txt index 76a75e7555..b3a60ed307 100644 --- a/src/fsharp/FSComp.txt +++ b/src/fsharp/FSComp.txt @@ -1430,9 +1430,12 @@ notAFunctionButMaybeDeclaration,"This value is not a function and cannot be appl 3225,readOnlyAttributeOnStructWithMutableField,"A ReadOnly attribute has been applied to a struct type with a mutable field." 3226,tcByrefReturnImplicitlyDereferenced,"A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'." 3227,tcByRefLikeNotStruct,"A type annotated with IsByRefLike must also be a struct. Consider adding the [] attribute to the type." -3228,chkNoByrefReturnOfLocal,"The address of the variable '%s' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope." -3229,chkNoReturnOfLimitedSpan,"The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope." +3228,chkNoByrefAddressOfValueFromExpression,"The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope." +3229,chkNoReturnOfLimitedSpan,"The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope." 3230,chkNoWriteToLimitedSpan,"This value can't be assigned because the target '%s' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope." 3231,tastValueMustBeLocal,"A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...'" 3232,tcIsReadOnlyNotStruct,"A type annotated with IsReadOnly must also be a struct. Consider adding the [] attribute to the type." 3234,chkStructsMayNotReturnAddressesOfContents,"Struct members cannot return the address of fields of the struct by reference" +3235,chkNoByrefLikeFunctionCall,"The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope." +3236,chkNoSpanLikeVariable,"The Span or IsByRefLike variable '%s' cannot be used at this point. This is to ensure the address of the local value does not escape its scope." +3237,chkNoSpanLikeValueFromExpression,"A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope." \ No newline at end of file diff --git a/src/fsharp/PostInferenceChecks.fs b/src/fsharp/PostInferenceChecks.fs index db5205e896..a04ad30459 100644 --- a/src/fsharp/PostInferenceChecks.fs +++ b/src/fsharp/PostInferenceChecks.fs @@ -125,9 +125,20 @@ let BindTypars g env (tps:Typar list) = let BindArgVals env (vs: Val list) = { env with argVals = ValMap.OfList (List.map (fun v -> (v,())) vs) } +/// Limit flags represent a type(s) returned from checking an expression(s) that is interesting to impose rules on. +[] +type LimitFlags = + | None = 0b000000 + | LocalByRef = 0b000001 + | LocalByRefOfSpanLike = 0b000011 + | LocalByRefOfStackReferringSpanLike = 0b000101 + | SpanLike = 0b001000 + | StackReferringSpanLike = 0b010000 + | ByRefOfSpanLike = 0b100000 + type cenv = - { boundVals: Dictionary // really a hash set - limitVals: Dictionary // really a hash set + { boundVals: Dictionary // really a hash set + limitVals: Dictionary mutable potentialUnboundUsesOfVals: StampMap g: TcGlobals amap: Import.ImportMap @@ -138,12 +149,79 @@ type cenv = viewCcu : CcuThunk reportErrors: bool isLastCompiland : bool*bool + isInternalTestSpanStackReferring: bool // outputs mutable usesQuotations : bool mutable entryPointGiven:bool } -let LimitVal cenv (v:Val) = - cenv.limitVals.[v.Stamp] <- 1 +/// Check if the value is an argument of a function +let IsValArgument env (v: Val) = + env.argVals.ContainsVal(v) + +/// Check if the value is a local, not an argument of a function. +let IsValLocal env (v: Val) = + v.ValReprInfo.IsNone && not (IsValArgument env v) + +/// Check if the limit has the target limit. +let inline HasLimitFlag targetLimit limit = + limit &&& targetLimit = targetLimit + +/// Get the limit of the val. +let GetLimitVal cenv env m (v: Val) = + let limit = + match cenv.limitVals.TryGetValue(v.Stamp) with + | true, limit -> limit + | _ -> LimitFlags.None + + if isSpanLikeTy cenv.g m v.Type then + // The value is a limited Span or might have become one through mutation + let isLocal = IsValLocal env v + let isMutableLocal = isLocal && v.IsMutable && cenv.isInternalTestSpanStackReferring + let isLimitedLocal = isLocal && HasLimitFlag LimitFlags.StackReferringSpanLike limit + if isMutableLocal || isLimitedLocal then + LimitFlags.StackReferringSpanLike + else + LimitFlags.SpanLike + + elif isByrefTy cenv.g v.Type then + let isLocal = IsValLocal env v + let isLimitedLocal = isLocal && HasLimitFlag LimitFlags.LocalByRef limit + let isByRefOfSpanLike = isSpanLikeTy cenv.g m (destByrefTy cenv.g v.Type) + + match isLimitedLocal, isByRefOfSpanLike with + | true, false -> LimitFlags.LocalByRef + | true, true -> + if HasLimitFlag LimitFlags.LocalByRefOfStackReferringSpanLike limit then + LimitFlags.LocalByRefOfStackReferringSpanLike + else + LimitFlags.LocalByRefOfSpanLike + | false, true -> LimitFlags.ByRefOfSpanLike + | _ -> LimitFlags.None + + else + LimitFlags.None + +/// Get the limit of the val by reference. +let GetLimitValByRef cenv env m v = + let limit = GetLimitVal cenv env m v + + if HasLimitFlag LimitFlags.StackReferringSpanLike limit then + LimitFlags.LocalByRefOfStackReferringSpanLike + + elif IsValLocal env v || IsValArgument env v then + if HasLimitFlag LimitFlags.SpanLike limit then + LimitFlags.LocalByRefOfSpanLike + else + LimitFlags.LocalByRef + + elif HasLimitFlag LimitFlags.SpanLike limit then + LimitFlags.ByRefOfSpanLike + + else + LimitFlags.None + +let LimitVal cenv (v:Val) limit = + cenv.limitVals.[v.Stamp] <- limit let BindVal cenv env (v:Val) = //printfn "binding %s..." v.DisplayName @@ -345,11 +423,8 @@ type PermitByRefType = /// Don't permit any byref or byref-like types | None - /// Permit only an outermost Span or IsByRefLike type - | OuterSpanLike - - /// Permit only an outermost Span, IsByRefLike, inref, outref or byref type - | OuterByRefLike + /// Permit only a Span or IsByRefLike type + | SpanLike /// Permit all byref and byref-like types | All @@ -381,35 +456,32 @@ type PermitByRefExpr = | PermitByRefExpr.YesReturnable -> true | _ -> false -let ignoreLimit (_limit: bool) = () - -let mkArgsPermit isByRefReturnCall n = - if n=1 then - if isByRefReturnCall then PermitByRefExpr.YesReturnable else PermitByRefExpr.Yes +let mkArgsPermit n = + if n=1 then PermitByRefExpr.Yes else PermitByRefExpr.YesTupleOfArgs n /// Work out what byref-values are allowed at input positions to named F# functions or members -let mkArgsForAppliedVal isBaseCall isByRefReturnCall (vref:ValRef) argsl = +let mkArgsForAppliedVal isBaseCall (vref:ValRef) argsl = match vref.ValReprInfo with | Some topValInfo -> let argArities = topValInfo.AritiesOfArgs let argArities = if isBaseCall && argArities.Length >= 1 then List.tail argArities else argArities // Check for partial applications: arguments to partial applciations don't get to use byrefs if List.length argsl >= argArities.Length then - List.map (mkArgsPermit isByRefReturnCall) argArities + List.map mkArgsPermit argArities else [] | None -> [] /// Work out what byref-values are allowed at input positions to functions -let rec mkArgsForAppliedExpr isBaseCall isByRefReturnCall argsl x = +let rec mkArgsForAppliedExpr isBaseCall argsl x = match stripExpr x with // recognise val - | Expr.Val (vref,_,_) -> mkArgsForAppliedVal isBaseCall isByRefReturnCall vref argsl + | Expr.Val (vref,_,_) -> mkArgsForAppliedVal isBaseCall vref argsl // step through instantiations - | Expr.App(f,_fty,_tyargs,[],_) -> mkArgsForAppliedExpr isBaseCall isByRefReturnCall argsl f + | Expr.App(f,_fty,_tyargs,[],_) -> mkArgsForAppliedExpr isBaseCall argsl f // step through subsumption coercions - | Expr.Op(TOp.Coerce,_,[f],_) -> mkArgsForAppliedExpr isBaseCall isByRefReturnCall argsl f + | Expr.Op(TOp.Coerce,_,[f],_) -> mkArgsForAppliedExpr isBaseCall argsl f | _ -> [] /// Check types occurring in the TAST. @@ -422,14 +494,12 @@ let CheckType permitByRefLike (cenv:cenv) env m ty = else errorR (Error(FSComp.SR.checkNotSufficientlyGenericBecauseOfScope(tp.DisplayName),m)) - let visitTyconRef isInner tcref = + let visitTyconRef _isInner tcref = match permitByRefLike with | PermitByRefType.None when isByrefLikeTyconRef cenv.g m tcref -> errorR(Error(FSComp.SR.chkErrorUseOfByref(), m)) - | PermitByRefType.OuterSpanLike when isInner && isByrefTyconRef cenv.g tcref -> - errorR(Error(FSComp.SR.chkErrorUseOfByref(), m)) - | PermitByRefType.OuterByRefLike when isInner && isByrefLikeTyconRef cenv.g m tcref -> + | PermitByRefType.SpanLike when isByrefTyconRef cenv.g tcref -> errorR(Error(FSComp.SR.chkErrorUseOfByref(), m)) | _ -> () @@ -463,11 +533,8 @@ let CheckType permitByRefLike (cenv:cenv) env m ty = /// The additional byref checks are to catch "byref instantiations" - one place were byref are not permitted. let CheckTypeNoByrefs (cenv:cenv) env m ty = CheckType PermitByRefType.None cenv env m ty -/// Check types occurring in TAST but allow an outer byref. -let CheckTypePermitOuterByRefLike (cenv:cenv) env m ty = CheckType PermitByRefType.OuterByRefLike cenv env m ty - -/// Check types occurring in TAST but allow an outer Span or similar -let CheckTypePermitOuterSpanLike (cenv:cenv) env m ty = CheckType PermitByRefType.OuterSpanLike cenv env m ty +/// Check types occurring in TAST but allow a Span or similar +let CheckTypePermitSpanLike (cenv:cenv) env m ty = CheckType PermitByRefType.SpanLike cenv env m ty /// Check types occurring in TAST but allow all byrefs. Only used on internally-generated types let CheckTypePermitAllByrefs (cenv:cenv) env m ty = CheckType PermitByRefType.All cenv env m ty @@ -514,7 +581,7 @@ let CheckMultipleInterfaceInstantiations cenv interfaces m = /// Check an expression, where the expression is in a position where byrefs can be generated let rec CheckExprNoByrefs cenv env expr = - CheckExpr cenv env expr PermitByRefExpr.No |> ignoreLimit + CheckExpr cenv env expr PermitByRefExpr.No |> ignore /// Check a value and CheckValRef (cenv:cenv) (env:env) v m (context: PermitByRefExpr) = @@ -531,25 +598,12 @@ and CheckValRef (cenv:cenv) (env:env) v m (context: PermitByRefExpr) = CheckTypePermitAllByrefs cenv env m v.Type // the byref checks are done at the actual binding of the value -and IsLimitedType g m ty = - isByrefLikeTy g m ty && - not (isByrefTy g ty) - -and IsLimited cenv env m (vref: ValRef) = - IsLimitedType cenv.g m vref.Type && - // The value is a arg/local.... - vref.ValReprInfo.IsNone && - // The value is a limited Span or might have become one through mutation - let isMutableLocal = not (env.argVals.ContainsVal(vref.Deref)) && vref.IsMutable - let isLimitedLocal = cenv.limitVals.ContainsKey(vref.Stamp) - isMutableLocal || isLimitedLocal - /// Check a use of a value and CheckValUse (cenv: cenv) (env: env) (vref: ValRef, vFlags, m) (context: PermitByRefExpr) = let g = cenv.g - // Is this a Span-typed value that is limited (i.e. can't be returned) - let limit = IsLimited cenv env m vref + + let limit = GetLimitVal cenv env m vref.Deref if cenv.reportErrors then @@ -564,16 +618,23 @@ and CheckValUse (cenv: cenv) (env: env) (vref: ValRef, vFlags, m) (context: Perm if isCallOfConstructorOfAbstractType then errorR(Error(FSComp.SR.tcAbstractTypeCannotBeInstantiated(),m)) - let isReturnExprBuiltUsingByRefLocal = + // This is used to handle this case: + // let x = 1 + // let y = &x + // &y + let isReturnExprBuiltUsingStackReferringByRefLike = context.PermitOnlyReturnable && - isByrefTy g vref.Type && - // The value is a local.... - vref.ValReprInfo.IsNone && - // The value is not an argument.... - not (env.argVals.ContainsVal(vref.Deref)) - - if isReturnExprBuiltUsingByRefLocal then - errorR(Error(FSComp.SR.chkNoByrefReturnOfLocal(vref.DisplayName), m)) + (HasLimitFlag LimitFlags.LocalByRef limit || + HasLimitFlag LimitFlags.StackReferringSpanLike limit) + + if isReturnExprBuiltUsingStackReferringByRefLike then + let isSpanLike = isSpanLikeTy g m vref.Type + let isCompGen = vref.IsCompilerGenerated + match isSpanLike, isCompGen with + | true, true -> errorR(Error(FSComp.SR.chkNoSpanLikeValueFromExpression(), m)) + | true, false -> errorR(Error(FSComp.SR.chkNoSpanLikeVariable(vref.DisplayName), m)) + | false, true -> errorR(Error(FSComp.SR.chkNoByrefAddressOfValueFromExpression(), m)) + | false, false -> errorR(Error(FSComp.SR.chkNoByrefAddressOfLocal(vref.DisplayName), m)) let isReturnOfStructThis = context.PermitOnlyReturnable && @@ -584,6 +645,7 @@ and CheckValUse (cenv: cenv) (env: env) (vref: ValRef, vFlags, m) (context: Perm errorR(Error(FSComp.SR.chkStructsMayNotReturnAddressesOfContents(), m)) CheckValRef cenv env vref m context + limit /// Check an expression, given information about the position of the expression @@ -627,8 +689,112 @@ and CheckForOverAppliedExceptionRaisingPrimitive (cenv:cenv) expr = | _ -> () | _ -> () +and CheckCallLimitArgs cenv m (returnTy: TType) limitArgs (context: PermitByRefExpr) = + let isReturnByref = isByrefTy cenv.g returnTy + let isReturnSpanLike = isSpanLikeTy cenv.g m returnTy + + // If return is a byref, and being used as a return, then a single argument cannot be a local-byref or a stack referring span-like. + let isReturnLimitedByRef = + isReturnByref && + (HasLimitFlag LimitFlags.LocalByRef limitArgs || + HasLimitFlag LimitFlags.StackReferringSpanLike limitArgs) + + // If return is a byref, and being used as a return, then a single argument cannot be a stack referring span-like or a local-byref of a stack referring span-like. + let isReturnLimitedSpanLike = + isReturnSpanLike && + (HasLimitFlag LimitFlags.StackReferringSpanLike limitArgs || + HasLimitFlag LimitFlags.LocalByRefOfStackReferringSpanLike limitArgs) + + if cenv.reportErrors then + if context.PermitOnlyReturnable && (isReturnLimitedByRef || isReturnLimitedSpanLike) then + if isReturnLimitedSpanLike then + errorR(Error(FSComp.SR.chkNoSpanLikeValueFromExpression(), m)) + else + errorR(Error(FSComp.SR.chkNoByrefAddressOfValueFromExpression(), m)) + + // You cannot call a function that takes a byref of a span-like (not stack referring) and + // either a stack referring spanlike or a local-byref of a stack referring span-like. + let isCallLimited = + HasLimitFlag LimitFlags.ByRefOfSpanLike limitArgs && + (HasLimitFlag LimitFlags.StackReferringSpanLike limitArgs || + HasLimitFlag LimitFlags.LocalByRefOfStackReferringSpanLike limitArgs) + + if isCallLimited then + errorR(Error(FSComp.SR.chkNoByrefLikeFunctionCall(), m)) + + if isReturnLimitedByRef then + if isSpanLikeTy cenv.g m (destByrefTy cenv.g returnTy) then + let isStackReferring = + HasLimitFlag LimitFlags.StackReferringSpanLike limitArgs || + HasLimitFlag LimitFlags.LocalByRefOfStackReferringSpanLike limitArgs + if isStackReferring then + LimitFlags.LocalByRefOfStackReferringSpanLike + else + LimitFlags.LocalByRefOfSpanLike + else + LimitFlags.LocalByRef + + elif isReturnLimitedSpanLike then + LimitFlags.StackReferringSpanLike + + elif isReturnByref then + if isSpanLikeTy cenv.g m (destByrefTy cenv.g returnTy) then + LimitFlags.ByRefOfSpanLike + else + LimitFlags.None + + elif isReturnSpanLike then + LimitFlags.SpanLike + + else + LimitFlags.None + +/// Check call arguments, including the return argument. +and CheckCall cenv env m returnTy args contexts context = + let limitArgs = CheckExprs cenv env args contexts + CheckCallLimitArgs cenv m returnTy limitArgs context + +/// Check call arguments, including the return argument. The receiver argument is handled differently. +and CheckCallWithReceiver cenv env m returnTy args contexts context = + match args with + | [] -> failwith "CheckCallWithReceiver: Argument list is empty." + | receiverArg :: args -> + + let receiverContext, contexts = + match contexts with + | [] -> PermitByRefExpr.No, [] + | context :: contexts -> context, contexts + + let receiverLimit = CheckExpr cenv env receiverArg receiverContext + let limitArgs = + let limitArgs = CheckExprs cenv env args contexts + // We do not include the receiver's limit in the limit args unless the receiver is a stack referring span-like. + if HasLimitFlag LimitFlags.StackReferringSpanLike receiverLimit || HasLimitFlag LimitFlags.LocalByRefOfStackReferringSpanLike receiverLimit then + limitArgs ||| receiverLimit + else + limitArgs + CheckCallLimitArgs cenv m returnTy limitArgs context + +/// Check call arguments, including the return argument. Permits returnable byref. +and CheckCallPermitReturnableByRef cenv env m returnTy args = + let limitArgs = CheckExprsPermitByRefLike cenv env args + CheckCallLimitArgs cenv m returnTy limitArgs PermitByRefExpr.YesReturnable + +/// Check call arguments, including the return argument. The receiver argument is handled differently. Permits returnable byref. +and CheckCallWithReceiverPermitReturnableByRef cenv env m returnTy args = + CheckCallWithReceiver cenv env m returnTy args (List.init args.Length (fun _ -> PermitByRefExpr.Yes)) PermitByRefExpr.YesReturnable + +/// Check call arguments, including the return argument. Permits byref. +and CheckCallPermitByRefLike cenv env m returnTy args = + let limitArgs = CheckExprsPermitByRefLike cenv env args + CheckCallLimitArgs cenv m returnTy limitArgs PermitByRefExpr.Yes + +/// Check call arguments, including the return argument. The receiver argument is handled differently. Permits byref. +and CheckCallWithReceiverPermitByRefLike cenv env m returnTy args = + CheckCallWithReceiver cenv env m returnTy args (List.init args.Length (fun _ -> PermitByRefExpr.Yes)) PermitByRefExpr.Yes + /// Check an expression, given information about the position of the expression -and CheckExpr (cenv:cenv) (env:env) origExpr (context:PermitByRefExpr) : bool = +and CheckExpr (cenv:cenv) (env:env) origExpr (context:PermitByRefExpr) : LimitFlags = let g = cenv.g let origExpr = stripExpr origExpr @@ -646,18 +812,21 @@ and CheckExpr (cenv:cenv) (env:env) origExpr (context:PermitByRefExpr) : bool = CheckExpr cenv env e2 context // carry context into _;RHS (normal sequencing only) | ThenDoSeq -> CheckExprNoByrefs cenv {env with ctorLimitedZone=false} e2 - false + LimitFlags.None - | Expr.Let (bind,body,_,_) -> + | Expr.Let ((TBind(v,_,_) as bind),body,_,_) -> let limit = CheckBinding cenv env false bind - BindVal cenv env bind.Var - if limit then - LimitVal cenv bind.Var + + BindVal cenv env v + + if limit <> LimitFlags.None then + LimitVal cenv v limit + CheckExpr cenv env body context | Expr.Const (_,m,ty) -> - CheckTypePermitOuterByRefLike cenv env m ty - false + CheckTypePermitAllByrefs cenv env m ty + LimitFlags.None | Expr.Val (vref,vFlags,m) -> CheckValUse cenv env (vref, vFlags, m) context @@ -679,7 +848,7 @@ and CheckExpr (cenv:cenv) (env:env) origExpr (context:PermitByRefExpr) : bool = errorRecovery e m CheckTypeNoByrefs cenv env m ty - false + LimitFlags.None | Expr.Obj (_,ty,basev,superInitCall,overrides,iimpls,m) -> CheckExprNoByrefs cenv env superInitCall @@ -695,7 +864,7 @@ and CheckExpr (cenv:cenv) (env:env) origExpr (context:PermitByRefExpr) : bool = |> List.filter (isInterfaceTy g) CheckMultipleInterfaceInstantiations cenv interfaces m - false + LimitFlags.None // Allow base calls to F# methods | Expr.App((InnerExprPat(ExprValWithPossibleTypeInst(v,vFlags,_,_) as f)),_fty,tyargs,(Expr.Val(baseVal,_,_) :: rest),m) @@ -705,12 +874,12 @@ and CheckExpr (cenv:cenv) (env:env) origExpr (context:PermitByRefExpr) : bool = let memberInfo = Option.get v.MemberInfo if memberInfo.MemberFlags.IsDispatchSlot then errorR(Error(FSComp.SR.tcCannotCallAbstractBaseMember(v.DisplayName),m)) - false + LimitFlags.None else CheckValRef cenv env v m PermitByRefExpr.No CheckValRef cenv env baseVal m PermitByRefExpr.No CheckTypeInstNoByrefs cenv env m tyargs - CheckExprs cenv env rest (mkArgsForAppliedExpr true false rest f) + CheckExprs cenv env rest (mkArgsForAppliedExpr true rest f) // Allow base calls to IL methods | Expr.Op (TOp.ILCall (virt,_,_,_,_,_,_,mref,enclTypeArgs,methTypeArgs,tys),tyargs,(Expr.Val(baseVal,_,_)::rest),m) @@ -742,28 +911,34 @@ and CheckExpr (cenv:cenv) (env:env) origExpr (context:PermitByRefExpr) : bool = // Allow 'typeof' calls as a special case, the only accepted use of System.Void! | TypeOfExpr g ty when isVoidTy g ty -> - false + LimitFlags.None // Allow 'typedefof' calls as a special case, the only accepted use of System.Void! | TypeDefOfExpr g ty when isVoidTy g ty -> - false + LimitFlags.None // Allow '%expr' in quotations | Expr.App(Expr.Val(vref,_,_),_,tinst,[arg],m) when isSpliceOperator g vref && env.quote -> CheckTypeInstPermitAllByrefs cenv env m tinst // it's the splice operator, a byref instantiation is allowed CheckExprNoByrefs cenv env arg - false + LimitFlags.None // Check an application | Expr.App(f,_fty,tyargs,argsl,m) -> - CheckTypeInstNoByrefs cenv env m tyargs CheckExprNoByrefs cenv env f - // If return is a byref, and being used as a return, then all arguments must be usable as byref returns - let isByRefReturnCall = context.PermitOnlyReturnable && isByrefTy g (tyOfExpr g expr) + let hasReceiver = + match f with + | Expr.Val(vref, _, _) when vref.IsInstanceMember && not argsl.IsEmpty -> true + | _ -> false - CheckExprs cenv env argsl (mkArgsForAppliedExpr false isByRefReturnCall argsl f) + let returnTy = tyOfExpr g expr + let contexts = mkArgsForAppliedExpr false argsl f + if hasReceiver then + CheckCallWithReceiver cenv env m returnTy argsl contexts context + else + CheckCall cenv env m returnTy argsl contexts context | Expr.Lambda(_,_ctorThisValOpt,_baseValOpt,argvs,_,m,rty) -> let topValInfo = ValReprInfo ([],[argvs |> List.map (fun _ -> ValReprInfo.unnamedTopArg1)],ValReprInfo.unnamedRetVal) @@ -778,7 +953,7 @@ and CheckExpr (cenv:cenv) (env:env) origExpr (context:PermitByRefExpr) : bool = | Expr.TyChoose(tps,e1,_) -> let env = BindTypars g env tps CheckExprNoByrefs cenv env e1 - false + LimitFlags.None | Expr.Match(_,_,dtree,targets,m,ty) -> CheckTypePermitAllByrefs cenv env m ty // computed byrefs allowed at each branch @@ -789,7 +964,7 @@ and CheckExpr (cenv:cenv) (env:env) origExpr (context:PermitByRefExpr) : bool = BindVals cenv env (valsOfBinds binds) CheckBindings cenv env binds CheckExprNoByrefs cenv env e - false + LimitFlags.None | Expr.StaticOptimization (constraints,e2,e3,m) -> CheckExprNoByrefs cenv env e2 @@ -800,7 +975,7 @@ and CheckExpr (cenv:cenv) (env:env) origExpr (context:PermitByRefExpr) : bool = CheckTypeNoByrefs cenv env m ty2 | TTyconIsStruct(ty1) -> CheckTypeNoByrefs cenv env m ty1) - false + LimitFlags.None | Expr.Link _ -> failwith "Unexpected reclink" @@ -816,7 +991,7 @@ and CheckMethod cenv env baseValOpt (TObjExprMethod(_,attribs,tps,vs,body,m)) = CheckNoReraise cenv None body CheckEscapes cenv true m (match baseValOpt with Some x -> x:: vs | None -> vs) body |> ignore let limit = CheckExprPermitReturnableByRef cenv env body - if limit then + if HasLimitFlag LimitFlags.StackReferringSpanLike limit then errorR(Error(FSComp.SR.chkNoReturnOfLimitedSpan(), body.Range)) and CheckInterfaceImpls cenv env baseValOpt l = @@ -854,18 +1029,30 @@ and CheckExprOp cenv env (op,tyargs,args,m) context expr = let limit1 = CheckExpr cenv env e1 context // result of a try/catch can be a byref if in a position where the overall expression is can be a byref // [(* e2; -- don't check filter body - duplicates logic in 'catch' body *) e3] let limit2 = CheckExpr cenv env e3 context // result of a try/catch can be a byref if in a position where the overall expression is can be a byref - limit1 || limit2 + limit1 ||| limit2 - | TOp.ILCall (_,_,_,_,_,_,_,_,enclTypeArgs,methTypeArgs,tys),_,_ -> + | TOp.ILCall (_,_,_,_,_,_,_,methRef,enclTypeArgs,methTypeArgs,tys),_,_ -> CheckTypeInstNoByrefs cenv env m tyargs CheckTypeInstNoByrefs cenv env m enclTypeArgs CheckTypeInstNoByrefs cenv env m methTypeArgs CheckTypeInstPermitAllByrefs cenv env m tys // permit byref returns - // if return is a byref, and being used as a return, then all arguments must be usable as byref returns - match tys with - | [ty] when context.PermitOnlyReturnable && isByrefLikeTy g m ty -> CheckExprsPermitReturnableByRef cenv env args - | _ -> CheckExprsPermitByRefLike cenv env args + let hasReceiver = + (methRef.CallingConv.IsInstance || methRef.CallingConv.IsInstanceExplicit) && + not args.IsEmpty + + let returnTy = tyOfExpr g expr + match tys with + | [ty] when context.PermitOnlyReturnable && isByrefLikeTy g m ty -> + if hasReceiver then + CheckCallWithReceiverPermitReturnableByRef cenv env m returnTy args + else + CheckCallPermitReturnableByRef cenv env m returnTy args + | _ -> + if hasReceiver then + CheckCallWithReceiverPermitByRefLike cenv env m returnTy args + else + CheckCallPermitByRefLike cenv env m returnTy args | TOp.Tuple tupInfo,_,_ when not (evalTupInfoIsStruct tupInfo) -> match context with @@ -881,6 +1068,10 @@ and CheckExprOp cenv env (op,tyargs,args,m) context expr = CheckExprsNoByRefLike cenv env args | TOp.LValueOp(LAddrOf _,vref),_,_ -> + let limit1 = GetLimitValByRef cenv env m vref.Deref + let limit2 = CheckExprsNoByRefLike cenv env args + let limit = limit1 ||| limit2 + if cenv.reportErrors then if context.Disallow then @@ -888,35 +1079,46 @@ and CheckExprOp cenv env (op,tyargs,args,m) context expr = let returningAddrOfLocal = context.PermitOnlyReturnable && - // The value is a local.... - vref.ValReprInfo.IsNone && - // The value is not an argument... - not (env.argVals.ContainsVal(vref.Deref)) + HasLimitFlag LimitFlags.LocalByRef limit if returningAddrOfLocal then - errorR(Error(FSComp.SR.chkNoByrefAddressOfLocal(vref.DisplayName), m)) + if vref.IsCompilerGenerated then + errorR(Error(FSComp.SR.chkNoByrefAddressOfValueFromExpression(), m)) + else + errorR(Error(FSComp.SR.chkNoByrefAddressOfLocal(vref.DisplayName), m)) - let limit1 = IsLimited cenv env m vref - let limit2 = CheckExprsNoByRefLike cenv env args - limit1 || limit2 + limit | TOp.LValueOp(LByrefSet,vref),_,[arg] -> - let limit1 = IsLimitedType g m (tyOfExpr g arg) && not (env.argVals.ContainsVal(vref.Deref)) - let limit2 = CheckExprPermitByRefLike cenv env arg - if not limit1 && limit2 then + let limit = GetLimitVal cenv env m vref.Deref + let isVrefLimited = not (HasLimitFlag LimitFlags.LocalByRefOfStackReferringSpanLike limit) + let isArgLimited = HasLimitFlag LimitFlags.StackReferringSpanLike (CheckExprPermitByRefLike cenv env arg) + if isVrefLimited && isArgLimited then errorR(Error(FSComp.SR.chkNoWriteToLimitedSpan(vref.DisplayName), m)) - false + LimitFlags.None | TOp.LValueOp(LByrefGet,vref),_,[] -> - let limit1 = isByrefTy g vref.Type && IsLimitedType g m (destByrefTy g vref.Type) && not (env.argVals.ContainsVal(vref.Deref)) - limit1 + let limit = GetLimitVal cenv env m vref.Deref + if HasLimitFlag LimitFlags.LocalByRefOfStackReferringSpanLike limit then + + if cenv.reportErrors && context.PermitOnlyReturnable then + if vref.IsCompilerGenerated then + errorR(Error(FSComp.SR.chkNoSpanLikeValueFromExpression(), m)) + else + errorR(Error(FSComp.SR.chkNoSpanLikeVariable(vref.DisplayName), m)) + + LimitFlags.StackReferringSpanLike + elif HasLimitFlag LimitFlags.LocalByRefOfSpanLike limit then + LimitFlags.SpanLike + else + LimitFlags.None | TOp.LValueOp(LSet _, vref),_,[arg] -> - let limit1 = IsLimited cenv env m vref - let limit2 = CheckExprPermitByRefLike cenv env arg - if not limit1 && limit2 then + let isVrefLimited = not (HasLimitFlag LimitFlags.StackReferringSpanLike (GetLimitVal cenv env m vref.Deref)) + let isArgLimited = HasLimitFlag LimitFlags.StackReferringSpanLike (CheckExprPermitByRefLike cenv env arg) + if isVrefLimited && isArgLimited then errorR(Error(FSComp.SR.chkNoWriteToLimitedSpan(vref.DisplayName), m)) - false + LimitFlags.None | TOp.TupleFieldGet _,_,[arg1] -> CheckTypeInstNoByrefs cenv env m tyargs @@ -928,11 +1130,18 @@ and CheckExprOp cenv env (op,tyargs,args,m) context expr = // Property getters on mutable structs come through here. CheckExprsPermitByRefLike cenv env [arg1] - | TOp.ValFieldSet _rf,_,[arg1;arg2] -> + | TOp.ValFieldSet rf,_,[arg1;arg2] -> CheckTypeInstNoByrefs cenv env m tyargs // See mkRecdFieldSetViaExprAddr -- byref arg1 when #args=2 // Field setters on mutable structs come through here - CheckExprsPermitByRefLike cenv env [arg1; arg2] + let limit1 = CheckExprPermitByRefLike cenv env arg1 + let limit2 = CheckExprPermitByRefLike cenv env arg2 + + let isLhsLimited = not (HasLimitFlag LimitFlags.LocalByRefOfStackReferringSpanLike limit1) + let isRhsLimited = HasLimitFlag LimitFlags.StackReferringSpanLike limit2 + if isLhsLimited && isRhsLimited then + errorR(Error(FSComp.SR.chkNoWriteToLimitedSpan(rf.FieldName), m)) + LimitFlags.None | TOp.Coerce,[tgty;srcty],[x] -> if TypeRelations.TypeDefinitelySubsumesTypeNoCoercion 0 g cenv.amap m tgty srcty then @@ -940,11 +1149,11 @@ and CheckExprOp cenv env (op,tyargs,args,m) context expr = else CheckTypeInstNoByrefs cenv env m tyargs CheckExprNoByrefs cenv env x - false + LimitFlags.None | TOp.Reraise,[_ty1],[] -> CheckTypeInstNoByrefs cenv env m tyargs - false + LimitFlags.None // Check get of static field | TOp.ValFieldGetAddr (rfref, _readonly),tyargs,[] -> @@ -953,7 +1162,7 @@ and CheckExprOp cenv env (op,tyargs,args,m) context expr = errorR(Error(FSComp.SR.chkNoAddressStaticFieldAtThisPoint(rfref.FieldName), m)) CheckTypeInstNoByrefs cenv env m tyargs - false + LimitFlags.None // Check get of instance field | TOp.ValFieldGetAddr (rfref, _readonly),tyargs,[obj] -> @@ -1021,7 +1230,7 @@ and CheckExprOp cenv env (op,tyargs,args,m) context expr = if context.Disallow && cenv.reportErrors && isByrefLikeTy g m (tyOfExpr g expr) then errorR(Error(FSComp.SR.chkNoAddressFieldAtThisPoint(fspec.Name), m)) - false + LimitFlags.None | [ I_ldflda (fspec) ], [obj] -> if context.Disallow && cenv.reportErrors && isByrefLikeTy g m (tyOfExpr g expr) then @@ -1035,7 +1244,7 @@ and CheckExprOp cenv env (op,tyargs,args,m) context expr = errorR(Error(FSComp.SR.chkNoAddressOfArrayElementAtThisPoint(), m)) // permit byref for lhs lvalue let limit = CheckExprPermitByRefLike cenv env lhsArray - CheckExprsNoByRefLike cenv env indices |> ignoreLimit + CheckExprsNoByRefLike cenv env indices |> ignore limit | [ AI_conv _ ],_ -> @@ -1048,7 +1257,11 @@ and CheckExprOp cenv env (op,tyargs,args,m) context expr = | TOp.TraitCall _,_,_ -> CheckTypeInstNoByrefs cenv env m tyargs // allow args to be byref here - CheckExprsPermitByRefLike cenv env args + CheckExprsPermitByRefLike cenv env args + + | TOp.Recd(_, _), _, _ -> + CheckTypeInstNoByrefs cenv env m tyargs + CheckExprsPermitByRefLike cenv env args | _ -> CheckTypeInstNoByrefs cenv env m tyargs @@ -1100,13 +1313,11 @@ and CheckLambdas isTop (memInfo: ValMemberInfo option) cenv env inlined topValIn CheckNoReraise cenv freesOpt body // Check the body of the lambda - let limit = - if isTop && not g.compilingFslib && isByrefLikeTy g m bodyty then - // allow byref to occur as return position for byref-typed top level function or method - CheckExprPermitReturnableByRef cenv env body - else - CheckExprNoByrefs cenv env body - false + if isTop && not g.compilingFslib && isByrefLikeTy g m bodyty then + // allow byref to occur as return position for byref-typed top level function or method + CheckExprPermitReturnableByRef cenv env body |> ignore + else + CheckExprNoByrefs cenv env body // Check byref return types if cenv.reportErrors then @@ -1119,14 +1330,11 @@ and CheckLambdas isTop (memInfo: ValMemberInfo option) cenv env inlined topValIn CheckForByrefType cenv env (destByrefTy g bodyty) (fun () -> errorR(Error(FSComp.SR.chkReturnTypeNoByref(), m))) - if limit then - errorR(Error(FSComp.SR.chkNoReturnOfLimitedSpan(), m)) - for tp in tps do if tp.Constraints |> List.sumBy (function TyparConstraint.CoercesTo(ty,_) when isClassTy g ty -> 1 | _ -> 0) > 1 then errorR(Error(FSComp.SR.chkTyparMultipleClassConstraints(), m)) - false + LimitFlags.None // This path is for expression bindings that are not actually lambdas | _ -> @@ -1138,39 +1346,43 @@ and CheckLambdas isTop (memInfo: ValMemberInfo option) cenv env inlined topValIn CheckExprPermitByRefLike cenv env e else CheckExprNoByrefs cenv env e - false + LimitFlags.None if alwaysCheckNoReraise then CheckNoReraise cenv None e limit -and CheckExprs cenv env exprs contexts : bool = +and CheckExprs cenv env exprs contexts : LimitFlags = let contexts = Array.ofList contexts let argArity i = if i < contexts.Length then contexts.[i] else PermitByRefExpr.No - let limits = exprs |> List.mapi (fun i exp -> CheckExpr cenv env exp (argArity i)) - limits |> List.existsTrue + exprs + |> List.mapi (fun i exp -> CheckExpr cenv env exp (argArity i)) + |> List.fold (|||) LimitFlags.None -and CheckExprsNoByRefLike cenv env exprs : bool = +and CheckExprsNoByRefLike cenv env exprs : LimitFlags = exprs |> List.iter (CheckExprNoByrefs cenv env) - false + LimitFlags.None and CheckExprsPermitByRefLike cenv env exprs = - let limits = exprs |> List.map (CheckExprPermitByRefLike cenv env) - limits |> List.existsTrue + exprs + |> List.map (CheckExprPermitByRefLike cenv env) + |> List.fold (|||) LimitFlags.None -and CheckExprsPermitReturnableByRef cenv env exprs : bool = - let limits = exprs |> List.map (CheckExprPermitReturnableByRef cenv env) - limits |> List.existsTrue +and CheckExprsPermitReturnableByRef cenv env exprs : LimitFlags = + exprs + |> List.map (CheckExprPermitReturnableByRef cenv env) + |> List.fold (|||) LimitFlags.None -and CheckExprPermitByRefLike cenv env expr = +and CheckExprPermitByRefLike cenv env expr : LimitFlags = CheckExpr cenv env expr PermitByRefExpr.Yes -and CheckExprPermitReturnableByRef cenv env expr : bool = +and CheckExprPermitReturnableByRef cenv env expr : LimitFlags = CheckExpr cenv env expr PermitByRefExpr.YesReturnable and CheckDecisionTreeTargets cenv env targets context = - let limits = targets |> Array.map (CheckDecisionTreeTarget cenv env context) - limits |> Array.existsTrue + targets + |> Array.map (CheckDecisionTreeTarget cenv env context) + |> Array.fold (|||) LimitFlags.None and CheckDecisionTreeTarget cenv env context (TTarget(vs,e,_)) = BindVals cenv env vs @@ -1180,15 +1392,15 @@ and CheckDecisionTreeTarget cenv env context (TTarget(vs,e,_)) = and CheckDecisionTree cenv env x = match x with | TDSuccess (es,_) -> - CheckExprsNoByRefLike cenv env es |> ignoreLimit + CheckExprsNoByRefLike cenv env es |> ignore | TDBind(bind,rest) -> - CheckBinding cenv env false bind |> ignoreLimit + CheckBinding cenv env false bind |> ignore CheckDecisionTree cenv env rest | TDSwitch (e,cases,dflt,m) -> CheckDecisionTreeSwitch cenv env (e,cases,dflt,m) and CheckDecisionTreeSwitch cenv env (e,cases,dflt,m) = - CheckExprPermitByRefLike cenv env e |> ignoreLimit // can be byref for struct union switch + CheckExprPermitByRefLike cenv env e |> ignore// can be byref for struct union switch cases |> List.iter (fun (TCase(discrim,e)) -> CheckDecisionTreeTest cenv env m discrim; CheckDecisionTree cenv env e) dflt |> Option.iter (CheckDecisionTree cenv env) @@ -1296,7 +1508,7 @@ and AdjustAccess isHidden (cpath: unit -> CompilationPath) access = else access -and CheckBinding cenv env alwaysCheckNoReraise (TBind(v,bindRhs,_) as bind) : bool = +and CheckBinding cenv env alwaysCheckNoReraise (TBind(v,bindRhs,_) as bind) : LimitFlags = let g = cenv.g let isTop = Option.isSome bind.Var.ValReprInfo //printfn "visiting %s..." v.DisplayName @@ -1397,7 +1609,7 @@ and CheckBinding cenv env alwaysCheckNoReraise (TBind(v,bindRhs,_) as bind) : bo CheckLambdas isTop v.MemberInfo cenv env v.MustInline topValInfo alwaysCheckNoReraise bindRhs v.Range v.Type and CheckBindings cenv env xs = - xs |> List.iter (CheckBinding cenv env false >> ignoreLimit) + xs |> List.iter (CheckBinding cenv env false >> ignore) // Top binds introduce expression, check they are reraise free. let CheckModuleBinding cenv env (TBind(v,e,_) as bind) = @@ -1525,7 +1737,7 @@ let CheckModuleBinding cenv env (TBind(v,e,_) as bind) = with e -> errorRecovery e v.Range end - CheckBinding cenv env true bind |> ignoreLimit + CheckBinding cenv env true bind |> ignore let CheckModuleBindings cenv env binds = binds |> List.iter (CheckModuleBinding cenv env) @@ -1547,7 +1759,7 @@ let CheckRecdField isUnion cenv env (tycon:Tycon) (rfield:RecdField) = if TyconRefHasAttribute g m g.attrib_IsByRefLikeAttribute tcref then // Permit Span fields in IsByRefLike types - CheckTypePermitOuterSpanLike cenv env m rfield.FormalType + CheckTypePermitSpanLike cenv env m rfield.FormalType if cenv.reportErrors then CheckForByrefType cenv env rfield.FormalType (fun () -> errorR(Error(FSComp.SR.chkCantStoreByrefValue(), tycon.Range))) else @@ -1787,8 +1999,8 @@ let CheckEntityDefn cenv env (tycon:Entity) = let env = BindTypars g env tps for argtys in argtysl do for (argty, _) in argtys do - CheckTypePermitOuterByRefLike cenv env m argty - CheckTypePermitOuterByRefLike cenv env m rty + CheckTypePermitAllByrefs cenv env m argty + CheckTypePermitAllByrefs cenv env m rty | None -> () @@ -1910,7 +2122,7 @@ and CheckModuleSpec cenv env x = let env = { env with reflect = env.reflect || HasFSharpAttribute cenv.g cenv.g.attrib_ReflectedDefinitionAttribute mspec.Attribs } CheckDefnInModule cenv env rhs -let CheckTopImpl (g,amap,reportErrors,infoReader,internalsVisibleToPaths,viewCcu,denv ,mexpr,extraAttribs,(isLastCompiland:bool*bool)) = +let CheckTopImpl (g,amap,reportErrors,infoReader,internalsVisibleToPaths,viewCcu,denv ,mexpr,extraAttribs,(isLastCompiland:bool*bool),isInternalTestSpanStackReferring) = let cenv = { g =g reportErrors=reportErrors @@ -1923,7 +2135,8 @@ let CheckTopImpl (g,amap,reportErrors,infoReader,internalsVisibleToPaths,viewCcu amap=amap denv=denv viewCcu= viewCcu - isLastCompiland=isLastCompiland + isLastCompiland=isLastCompiland + isInternalTestSpanStackReferring = isInternalTestSpanStackReferring entryPointGiven=false} // Certain type equality checks go faster if these TyconRefs are pre-resolved. diff --git a/src/fsharp/PostInferenceChecks.fsi b/src/fsharp/PostInferenceChecks.fsi index d918df258a..970c143155 100644 --- a/src/fsharp/PostInferenceChecks.fsi +++ b/src/fsharp/PostInferenceChecks.fsi @@ -11,4 +11,4 @@ open Microsoft.FSharp.Compiler.Tastops open Microsoft.FSharp.Compiler.TcGlobals val testFlagMemberBody : bool ref -val CheckTopImpl : TcGlobals * ImportMap * bool * InfoReader * CompilationPath list * CcuThunk * DisplayEnv * ModuleOrNamespaceExprWithSig * Attribs * (bool * bool) -> bool +val CheckTopImpl : TcGlobals * ImportMap * bool * InfoReader * CompilationPath list * CcuThunk * DisplayEnv * ModuleOrNamespaceExprWithSig * Attribs * (bool * bool) * isInternalTestSpanStackReferring: bool -> bool diff --git a/src/fsharp/TastOps.fs b/src/fsharp/TastOps.fs index 19912183b8..e78559eadd 100644 --- a/src/fsharp/TastOps.fs +++ b/src/fsharp/TastOps.fs @@ -2956,9 +2956,17 @@ let isByrefLikeTyconRef (g: TcGlobals) m (tcref: TyconRef) = tcref.SetIsByRefLike res res +let isSpanLikeTyconRef g m tcref = + isByrefLikeTyconRef g m tcref && + not (isByrefTyconRef g tcref) + let isByrefLikeTy g m ty = ty |> stripTyEqns g |> (function TType_app(tcref, _) -> isByrefLikeTyconRef g m tcref | _ -> false) +let isSpanLikeTy g m ty = + isByrefLikeTy g m ty && + not (isByrefTy g ty) + //------------------------------------------------------------------------- // List and reference types... //------------------------------------------------------------------------- diff --git a/src/fsharp/TastOps.fsi b/src/fsharp/TastOps.fsi index 6bc9a53b2e..d2a532c37a 100755 --- a/src/fsharp/TastOps.fsi +++ b/src/fsharp/TastOps.fsi @@ -1451,8 +1451,12 @@ val destNativePtrTy : TcGlobals -> TType -> TType val isByrefTyconRef : TcGlobals -> TyconRef -> bool val isByrefLikeTyconRef : TcGlobals -> range -> TyconRef -> bool +val isSpanLikeTyconRef : TcGlobals -> range -> TyconRef -> bool val isByrefLikeTy : TcGlobals -> range -> TType -> bool +/// Check if the type is a byref-like but not a byref. +val isSpanLikeTy : TcGlobals -> range -> TType -> bool + //------------------------------------------------------------------------- // Tuple constructors/destructors //------------------------------------------------------------------------- diff --git a/src/fsharp/TypeChecker.fs b/src/fsharp/TypeChecker.fs index b068a063f3..6be4d71341 100755 --- a/src/fsharp/TypeChecker.fs +++ b/src/fsharp/TypeChecker.fs @@ -507,10 +507,11 @@ type cenv = /// The set of active conditional defines conditionalDefines: string list + isInternalTestSpanStackReferring: bool } /// Create a new compilation environment - static member Create (g, isScript, niceNameGen, amap, topCcu, isSig, haveSig, conditionalDefines, tcSink, tcVal) = + static member Create (g, isScript, niceNameGen, amap, topCcu, isSig, haveSig, conditionalDefines, tcSink, tcVal, isInternalTestSpanStackReferring) = let infoReader = new InfoReader(g, amap) let instantiationGenerator m tpsorig = ConstraintSolver.FreshenTypars m tpsorig let nameResolver = new NameResolver(g, amap, infoReader, instantiationGenerator) @@ -530,7 +531,8 @@ type cenv = isSig = isSig haveSig = haveSig compilingCanonicalFslibModuleType = (isSig || not haveSig) && g.compilingFslib - conditionalDefines = conditionalDefines } + conditionalDefines = conditionalDefines + isInternalTestSpanStackReferring = isInternalTestSpanStackReferring } override __.ToString() = "cenv(...)" @@ -17222,13 +17224,13 @@ let CheckModuleSignature g cenv m denvAtEnd rootSigOpt implFileTypePriorToSig im /// Typecheck, then close the inference scope and then check the file meets its signature (if any) let TypeCheckOneImplFile // checkForErrors: A function to help us stop reporting cascading errors - (g, niceNameGen, amap, topCcu, checkForErrors, conditionalDefines, tcSink) + (g, niceNameGen, amap, topCcu, checkForErrors, conditionalDefines, tcSink, isInternalTestSpanStackReferring) env (rootSigOpt : ModuleOrNamespaceType option) (ParsedImplFileInput(_, isScript, qualNameOfFile, scopedPragmas, _, implFileFrags, isLastCompiland)) = eventually { - let cenv = cenv.Create (g, isScript, niceNameGen, amap, topCcu, false, Option.isSome rootSigOpt, conditionalDefines, tcSink, (LightweightTcValForUsingInBuildMethodCall g)) + let cenv = cenv.Create (g, isScript, niceNameGen, amap, topCcu, false, Option.isSome rootSigOpt, conditionalDefines, tcSink, (LightweightTcValForUsingInBuildMethodCall g), isInternalTestSpanStackReferring) let envinner, mtypeAcc = MakeInitialEnv env @@ -17292,7 +17294,7 @@ let TypeCheckOneImplFile conditionallySuppressErrorReporting (checkForErrors()) (fun () -> try let reportErrors = not (checkForErrors()) - PostTypeCheckSemanticChecks.CheckTopImpl (g, cenv.amap, reportErrors, cenv.infoReader, env.eInternalsVisibleCompPaths, cenv.topCcu, envAtEnd.DisplayEnv, implFileExprAfterSig, extraAttribs, isLastCompiland) + PostTypeCheckSemanticChecks.CheckTopImpl (g, cenv.amap, reportErrors, cenv.infoReader, env.eInternalsVisibleCompPaths, cenv.topCcu, envAtEnd.DisplayEnv, implFileExprAfterSig, extraAttribs, isLastCompiland, isInternalTestSpanStackReferring) with e -> errorRecovery e m false) @@ -17320,9 +17322,9 @@ let TypeCheckOneImplFile /// Check an entire signature file -let TypeCheckOneSigFile (g, niceNameGen, amap, topCcu, checkForErrors, conditionalDefines, tcSink) tcEnv (ParsedSigFileInput(_, qualNameOfFile, _, _, sigFileFrags)) = +let TypeCheckOneSigFile (g, niceNameGen, amap, topCcu, checkForErrors, conditionalDefines, tcSink, isInternalTestSpanStackReferring) tcEnv (ParsedSigFileInput(_, qualNameOfFile, _, _, sigFileFrags)) = eventually { - let cenv = cenv.Create (g, false, niceNameGen, amap, topCcu, true, false, conditionalDefines, tcSink, (LightweightTcValForUsingInBuildMethodCall g)) + let cenv = cenv.Create (g, false, niceNameGen, amap, topCcu, true, false, conditionalDefines, tcSink, (LightweightTcValForUsingInBuildMethodCall g), isInternalTestSpanStackReferring) let envinner, mtypeAcc = MakeInitialEnv tcEnv let specs = [ for x in sigFileFrags -> SynModuleSigDecl.NamespaceFragment(x) ] diff --git a/src/fsharp/TypeChecker.fsi b/src/fsharp/TypeChecker.fsi index b49d6574b7..3f84e1992f 100644 --- a/src/fsharp/TypeChecker.fsi +++ b/src/fsharp/TypeChecker.fsi @@ -39,14 +39,14 @@ val EmptyTopAttrs : TopAttribs val CombineTopAttrs : TopAttribs -> TopAttribs -> TopAttribs val TypeCheckOneImplFile : - TcGlobals * NiceNameGenerator * ImportMap * CcuThunk * (unit -> bool) * ConditionalDefines * NameResolution.TcResultsSink + TcGlobals * NiceNameGenerator * ImportMap * CcuThunk * (unit -> bool) * ConditionalDefines * NameResolution.TcResultsSink * bool -> TcEnv -> Tast.ModuleOrNamespaceType option -> ParsedImplFileInput -> Eventually val TypeCheckOneSigFile : - TcGlobals * NiceNameGenerator * ImportMap * CcuThunk * (unit -> bool) * ConditionalDefines * NameResolution.TcResultsSink + TcGlobals * NiceNameGenerator * ImportMap * CcuThunk * (unit -> bool) * ConditionalDefines * NameResolution.TcResultsSink * bool -> TcEnv -> ParsedSigFileInput -> Eventually diff --git a/src/fsharp/xlf/FSComp.txt.cs.xlf b/src/fsharp/xlf/FSComp.txt.cs.xlf index ec52dea911..20b3f7d11a 100644 --- a/src/fsharp/xlf/FSComp.txt.cs.xlf +++ b/src/fsharp/xlf/FSComp.txt.cs.xlf @@ -6517,11 +6517,6 @@ Při sestavování výrazu fixed se mezi odkazy nepovedlo najít metodu System.Runtime.CompilerServices.OffsetToStringData. - - The address of the variable '{0}' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. - Adresa proměnné {0} se na tomto místě nedá použít. Metoda nebo funkce možná nebude vracet adresu této místní hodnoty. - - {0} is an active pattern and cannot be treated as a discriminated union case with named fields. {0} je aktivní vzorek a není možné s ním zacházet jako s rozlišeným případem typu union s pojmenovanými poli. @@ -7018,8 +7013,8 @@ - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. @@ -7042,6 +7037,26 @@ Struct members cannot return the address of fields of the struct by reference + + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + + + + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.de.xlf b/src/fsharp/xlf/FSComp.txt.de.xlf index e7c78ef512..07fac137c6 100644 --- a/src/fsharp/xlf/FSComp.txt.de.xlf +++ b/src/fsharp/xlf/FSComp.txt.de.xlf @@ -6517,11 +6517,6 @@ Die Methode "System.Runtime.CompilerServices.OffsetToStringData" wurde beim Erstellen des fixed-Ausdrucks in den Verweisen nicht gefunden. - - The address of the variable '{0}' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. - Die Adresse der Variablen "{0}" kann an dieser Stelle nicht verwendet werden. Eine Methode oder Funktion gibt ggf. nicht die Adresse dieses lokalen Werts zurück. - - {0} is an active pattern and cannot be treated as a discriminated union case with named fields. {0} ist ein aktives Muster und kann nicht als ein diskriminierter Union-Fall mit benannten Feldern behandelt werden. @@ -7018,8 +7013,8 @@ - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. @@ -7042,6 +7037,26 @@ Struct members cannot return the address of fields of the struct by reference + + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + + + + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.en.xlf b/src/fsharp/xlf/FSComp.txt.en.xlf index fb84a93857..65496ff1e9 100644 --- a/src/fsharp/xlf/FSComp.txt.en.xlf +++ b/src/fsharp/xlf/FSComp.txt.en.xlf @@ -6517,11 +6517,6 @@ Could not find method System.Runtime.CompilerServices.OffsetToStringData in references when building 'fixed' expression. - - The address of the variable '{0}' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. - The address of the variable '{0}' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. - - {0} is an active pattern and cannot be treated as a discriminated union case with named fields. {0} is an active pattern and cannot be treated as a discriminated union case with named fields. @@ -7018,8 +7013,8 @@ - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. @@ -7042,6 +7037,26 @@ Struct members cannot return the address of fields of the struct by reference + + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + + + + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.es.xlf b/src/fsharp/xlf/FSComp.txt.es.xlf index 7bbd4bb17d..4b6e994191 100644 --- a/src/fsharp/xlf/FSComp.txt.es.xlf +++ b/src/fsharp/xlf/FSComp.txt.es.xlf @@ -6517,11 +6517,6 @@ No se pudo encontrar el método System.Runtime.CompilerServices.OffsetToStringData en las referencias al generar expresión 'fixed'. - - The address of the variable '{0}' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. - La dirección de la variable '{0}' no se puede usar en este punto. Puede que el método o la función no devuelvan la dirección de este valor local. - - {0} is an active pattern and cannot be treated as a discriminated union case with named fields. {0} es un modelo activo y no se puede tratar como un caso de unión discriminada con campos con nombre. @@ -7018,8 +7013,8 @@ - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. @@ -7042,6 +7037,26 @@ Struct members cannot return the address of fields of the struct by reference + + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + + + + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.fr.xlf b/src/fsharp/xlf/FSComp.txt.fr.xlf index ddae2f8794..a02e755da7 100644 --- a/src/fsharp/xlf/FSComp.txt.fr.xlf +++ b/src/fsharp/xlf/FSComp.txt.fr.xlf @@ -6517,11 +6517,6 @@ Méthode System.Runtime.CompilerServices.OffsetToStringData introuvable dans les références durant la construction d'une expression 'fixed'. - - The address of the variable '{0}' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. - Impossible d'utiliser l'adresse de la variable '{0}'. Une méthode ou une fonction ne doit pas retourner l'adresse de cette valeur locale. - - {0} is an active pattern and cannot be treated as a discriminated union case with named fields. {0} est un modèle actif. Il ne peut pas être traité comme un cas d'union discriminé avec des champs nommés. @@ -7018,8 +7013,8 @@ - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. @@ -7042,6 +7037,26 @@ Struct members cannot return the address of fields of the struct by reference + + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + + + + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.it.xlf b/src/fsharp/xlf/FSComp.txt.it.xlf index e96e4c4371..196d719798 100644 --- a/src/fsharp/xlf/FSComp.txt.it.xlf +++ b/src/fsharp/xlf/FSComp.txt.it.xlf @@ -6517,11 +6517,6 @@ Il metodo System.Runtime.CompilerServices.OffsetToStringData non è stato trovato nei riferimenti durante la compilazione dell'espressione 'fixed'. - - The address of the variable '{0}' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. - In questo punto non è possibile usare l'indirizzo della variabile '{0}'. Un metodo o una funzione potrebbero non restituire l'indirizzo di questo valore di variabile locale. - - {0} is an active pattern and cannot be treated as a discriminated union case with named fields. {0} è un criterio attivo e non può essere considerato come un case di unione discriminato con campi denominati. @@ -7018,8 +7013,8 @@ - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. @@ -7042,6 +7037,26 @@ Struct members cannot return the address of fields of the struct by reference + + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + + + + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.ja.xlf b/src/fsharp/xlf/FSComp.txt.ja.xlf index 44753c75ae..62ce505a7d 100644 --- a/src/fsharp/xlf/FSComp.txt.ja.xlf +++ b/src/fsharp/xlf/FSComp.txt.ja.xlf @@ -6517,11 +6517,6 @@ 'fixed' 式のビルド時に、参照内でメソッド System.Runtime.CompilerServices.OffsetToStringData が見つかりませんでした。 - - The address of the variable '{0}' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. - 変数 '{0}' のアドレスはこのポイントでは使用できません。メソッドまたは関数がこのローカル値のアドレスを返さない可能性があります。 - - {0} is an active pattern and cannot be treated as a discriminated union case with named fields. {0} はアクティブ パターンで、名前付きフィールドのある判別された共用体ケースとしては扱えません。 @@ -7018,8 +7013,8 @@ - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. @@ -7042,6 +7037,26 @@ Struct members cannot return the address of fields of the struct by reference + + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + + + + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.ko.xlf b/src/fsharp/xlf/FSComp.txt.ko.xlf index b965bf784a..154641f8eb 100644 --- a/src/fsharp/xlf/FSComp.txt.ko.xlf +++ b/src/fsharp/xlf/FSComp.txt.ko.xlf @@ -6517,11 +6517,6 @@ 'fixed' 식을 빌드할 때 참조에서 System.Runtime.CompilerServices.OffsetToStringData 메서드를 찾을 수 없습니다. - - The address of the variable '{0}' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. - 지금은 '{0}' 변수의 주소를 사용할 수 없습니다. 메서드 또는 함수가 이 로컬 값의 주소를 반환할 수 없습니다. - - {0} is an active pattern and cannot be treated as a discriminated union case with named fields. {0}은(는) 활성 패턴이며 명명된 필드가 있는 구분된 공용 구조체 케이스로 처리될 수 없습니다. @@ -7018,8 +7013,8 @@ - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. @@ -7042,6 +7037,26 @@ Struct members cannot return the address of fields of the struct by reference + + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + + + + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.pl.xlf b/src/fsharp/xlf/FSComp.txt.pl.xlf index 99fc7c35be..f322093935 100644 --- a/src/fsharp/xlf/FSComp.txt.pl.xlf +++ b/src/fsharp/xlf/FSComp.txt.pl.xlf @@ -6517,11 +6517,6 @@ Nie można odnaleźć metody System.Runtime.CompilerServices.OffsetToStringData w odwołaniach podczas kompilowania wyrażenia „fixed”. - - The address of the variable '{0}' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. - Adres zmiennej „{0}” nie może być użyty w tym punkcie. Metoda lub funkcja może nie zwrócić adresu tej wartości lokalnej. - - {0} is an active pattern and cannot be treated as a discriminated union case with named fields. {0} jest wzorcem aktywnym i nie można go traktować jako przypadku unii rozłącznej z nazwanymi polami. @@ -7018,8 +7013,8 @@ - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. @@ -7042,6 +7037,26 @@ Struct members cannot return the address of fields of the struct by reference + + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + + + + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf index fd1acb897e..d58b9e78cb 100644 --- a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf +++ b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf @@ -6517,11 +6517,6 @@ Não foi possível encontrar o método System.Runtime.CompilerServices.OffsetToStringData nas referências ao compilar a expressão 'fixed'. - - The address of the variable '{0}' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. - O endereço da variável '{0}' não pode ser usado neste momento. Um método ou uma função pode não retornar o endereço deste valor local. - - {0} is an active pattern and cannot be treated as a discriminated union case with named fields. {0} é um padrão ativo e não pode ser tratado como um caso de união discriminada com campos nomeados. @@ -7018,8 +7013,8 @@ - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. @@ -7042,6 +7037,26 @@ Struct members cannot return the address of fields of the struct by reference + + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + + + + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.ru.xlf b/src/fsharp/xlf/FSComp.txt.ru.xlf index 20d1926925..0572b50435 100644 --- a/src/fsharp/xlf/FSComp.txt.ru.xlf +++ b/src/fsharp/xlf/FSComp.txt.ru.xlf @@ -6517,11 +6517,6 @@ Не удалось найти в ссылках метод System.Runtime.CompilerServices.OffsetToStringData при создании выражения "fixed". - - The address of the variable '{0}' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. - Адрес переменной "{0}" сейчас невозможно использовать. Метод или функция могут не возвратить адрес этого локального значения. - - {0} is an active pattern and cannot be treated as a discriminated union case with named fields. {0} является активным шаблоном и не может обрабатываться как различаемая ветвь объединения с именованными полями. @@ -7018,8 +7013,8 @@ - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. @@ -7042,6 +7037,26 @@ Struct members cannot return the address of fields of the struct by reference + + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + + + + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.tr.xlf b/src/fsharp/xlf/FSComp.txt.tr.xlf index 4928a97395..a15e11019b 100644 --- a/src/fsharp/xlf/FSComp.txt.tr.xlf +++ b/src/fsharp/xlf/FSComp.txt.tr.xlf @@ -6517,11 +6517,6 @@ 'fixed' ifadesi derlenirken başvurularda System.Runtime.CompilerServices.OffsetToStringData metodu bulunamadı. - - The address of the variable '{0}' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. - '{0}' değişkeninin adresi bu noktada kullanılamaz. Bir metot veya işlev, bu yerel değerin adresini döndüremez. - - {0} is an active pattern and cannot be treated as a discriminated union case with named fields. {0} etkin bir desen ve adlandırılmış alanlar içeren bir ayırt edici birleşim durumu olarak değerlendirilemez. @@ -7018,8 +7013,8 @@ - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. @@ -7042,6 +7037,26 @@ Struct members cannot return the address of fields of the struct by reference + + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + + + + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf index 551a8922f6..b2865686e0 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf @@ -6517,11 +6517,6 @@ 生成 "fixed" 表达式时,在引用中找不到方法 System.Runtime.CompilerServices.OffsetToStringData。 - - The address of the variable '{0}' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. - 当前无法使用变量 {0} 的地址。方法或函数可能没有返回该本地值的地址。 - - {0} is an active pattern and cannot be treated as a discriminated union case with named fields. {0} 为活动模式,不能将其作为带命名字段的可区分联合用例。 @@ -7018,8 +7013,8 @@ - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. @@ -7042,6 +7037,26 @@ Struct members cannot return the address of fields of the struct by reference + + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + + + + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf index d78bfa8ff9..c93b23dd73 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf @@ -6517,11 +6517,6 @@ 建置 'fixed' 運算式時,在參考中找不到方法 System.Runtime.CompilerServices.OffsetToStringData。 - - The address of the variable '{0}' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. - 目前無法使用變數 '{0}' 的位址。方法或函式無法傳回此本機值的位址。 - - {0} is an active pattern and cannot be treated as a discriminated union case with named fields. {0} 是現用模式,無法視為具名欄位的差別聯集。 @@ -7018,8 +7013,8 @@ - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. @@ -7042,6 +7037,26 @@ Struct members cannot return the address of fields of the struct by reference + + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + + + + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + + \ No newline at end of file diff --git a/tests/fsharp/core/span/test.bsl b/tests/fsharp/core/span/test.bsl new file mode 100644 index 0000000000..c573f76226 --- /dev/null +++ b/tests/fsharp/core/span/test.bsl @@ -0,0 +1,16 @@ + +test.fsx(303,46,303,86): typecheck error FS3235: The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + +test.fsx(306,13,306,86): typecheck error FS3230: This value can't be assigned because the target 'param1' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + +test.fsx(309,13,309,62): typecheck error FS3230: This value can't be assigned because the target 'param1' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + +test.fsx(348,13,348,57): typecheck error FS3230: This value can't be assigned because the target 'addr' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + +test.fsx(351,13,351,38): typecheck error FS3230: This value can't be assigned because the target 'param1' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + +test.fsx(354,14,354,29): typecheck error FS3209: The address of the variable 'stackReferring3' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test.fsx(376,18,376,19): typecheck error FS3209: The address of the variable 'x' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test.fsx(380,18,380,33): typecheck error FS3228: The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. diff --git a/tests/fsharp/core/span/test.fsx b/tests/fsharp/core/span/test.fsx index b6bbf9bb9f..142847ea3f 100644 --- a/tests/fsharp/core/span/test.fsx +++ b/tests/fsharp/core/span/test.fsx @@ -1,6 +1,9 @@ #r @"..\..\..\..\packages\System.Memory.4.5.0-rc1\lib\netstandard2.0\System.Memory.dll" #r @"..\..\..\..\packages\NETStandard.Library.NETFramework.2.0.0-preview2-25405-01\build\net461\ref\netstandard.dll" +#nowarn "9" +#nowarn "51" + namespace System.Runtime.CompilerServices open System @@ -295,10 +298,10 @@ namespace Tests // this is allowed stackReferringBecauseMutable2 <- m1 &stackReferringBecauseMutable2 stackReferringBecauseMutable1 - // this is allowed +#if NEGATIVE + // this is NOT allowed stackReferringBecauseMutable2 <- m1 ¶m1 stackReferringBecauseMutable1 -#if NEGATIVE // this is NOT allowed param1 <- m1 &stackReferringBecauseMutable2 stackReferringBecauseMutable1 @@ -340,9 +343,9 @@ namespace Tests // this is allowed m2(&stackReferring3) <- stackReferringBecauseMutable2 -#if NEGATIVE2 +#if NEGATIVE // this is NOT allowed - m1(¶m1) <- stackReferringBecauseMutable2 + m2(¶m1) <- stackReferringBecauseMutable2 // this is NOT allowed param1 <- stackReferring3 @@ -380,22 +383,20 @@ namespace Tests #if NOT_YET +#if NEGATIVE + // Disallow this: [] type DisallowedIsReadOnlyStruct = [] val mutable X : int +#endif // Allow this: - [] - type ByRefLikeStructWithSpanField(count1: Span, count2: int) = + [] + type ByRefLikeStructWithSpanField(count1: Span, count2: int) = member x.Count1 = count1 member x.Count2 = count2 - [] - type ByRefLikeStructWithByrefField(count1: Span, count2: int) = - member x.Count1 = count1 - member x.Count2 = count2 #endif - diff --git a/tests/fsharp/core/span/test2.bsl b/tests/fsharp/core/span/test2.bsl new file mode 100644 index 0000000000..bac72ffc78 --- /dev/null +++ b/tests/fsharp/core/span/test2.bsl @@ -0,0 +1,52 @@ + +test2.fsx(79,21,79,35): typecheck error FS0406: The byref-typed variable 'test' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. + +test2.fsx(79,21,79,35): typecheck error FS0406: The byref-typed variable 'test' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. + +test2.fsx(79,31,79,35): typecheck error FS0418: The byref typed value 'test' cannot be used at this point + +test2.fsx(79,21,79,35): typecheck error FS0425: The type of a first-class function cannot contain byrefs + +test2.fsx(79,21,79,35): typecheck error FS0425: The type of a first-class function cannot contain byrefs + +test2.fsx(84,14,84,15): typecheck error FS3209: The address of the variable 'x' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(91,14,91,15): typecheck error FS3209: The address of the variable 'y' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(100,14,100,15): typecheck error FS3209: The address of the variable 'y' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(106,14,106,15): typecheck error FS3209: The address of the variable 'y' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(111,14,111,15): typecheck error FS3209: The address of the variable 'y' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(115,14,115,30): typecheck error FS3228: The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(119,14,119,37): typecheck error FS3228: The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(124,14,124,15): typecheck error FS3209: The address of the variable 'y' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(128,13,128,42): typecheck error FS3237: A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(132,14,132,41): typecheck error FS3228: The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(136,14,136,71): typecheck error FS3228: The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(140,13,140,52): typecheck error FS3237: A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(144,13,144,14): typecheck error FS3236: The Span or IsByRefLike variable 's' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(149,13,149,52): typecheck error FS3237: A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(153,21,153,84): typecheck error FS3235: The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(154,13,154,14): typecheck error FS3236: The Span or IsByRefLike variable 'y' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(158,13,158,83): typecheck error FS3237: A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(163,13,163,14): typecheck error FS3236: The Span or IsByRefLike variable 'y' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(167,14,167,71): typecheck error FS3228: The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(191,43,191,44): typecheck error FS3209: The address of the variable 'x' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(195,14,195,15): typecheck error FS3209: The address of the variable 'y' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. diff --git a/tests/fsharp/core/span/test2.fsx b/tests/fsharp/core/span/test2.fsx new file mode 100644 index 0000000000..aa56f5cd30 --- /dev/null +++ b/tests/fsharp/core/span/test2.fsx @@ -0,0 +1,324 @@ +#r @"..\..\..\..\packages\System.Memory.4.5.0-rc1\lib\netstandard2.0\System.Memory.dll" +#r @"..\..\..\..\packages\NETStandard.Library.NETFramework.2.0.0-preview2-25405-01\build\net461\ref\netstandard.dll" + +#nowarn "9" +#nowarn "51" + +namespace System.Runtime.CompilerServices + + open System + open System.Runtime.CompilerServices + open System.Runtime.InteropServices + [] + [] + type IsReadOnlyAttribute() = + inherit System.Attribute() + + [] + [] + type IsByRefLikeAttribute() = + inherit System.Attribute() + +namespace Tests + open System + open System.Runtime.CompilerServices + open System.Runtime.InteropServices + open FSharp.NativeInterop + + module Tests = + let mutable beef = 1 + + let returning_span (x: byref) = Span.Empty + + let returning_ref (x: byref) = &x + + let returning_ref2 (x: byref) (y: byref) = &x + + let passing_span_returning_span (x: Span) = Span.Empty + + let passing_span_returnin_ref (x: Span) = &x.[0] + + let passing_span2 (x: Span) (y: Span) = () + + let passing_byref_of_span_returning_span (x: byref>) = x + + let passing_inref_of_span_returning_span (x: inref>) = x + + let passing_byref_of_span_returning_byref_of_span (x: byref>) = &x + + let passing_byref_of_span2_returning_byref_of_span (x: byref>) (y: byref>) = &y + + let passing_byref_of_span_and_span_returning_byref_of_span (x: byref>) (y: Span) = + let y = &x + &y + +#if NOT_YET + + [] + type StructRecordRefLike = + { + mutable value: Span + } + + member this.Set(data: Span) = + this.value <- data + + [] + type StructRefLike = + + val mutable value: Span + + new (value) = { value = value } + +#endif + +#if NEGATIVE + + let should_not_work () = + let test = ReadOnlySpan.Empty + let f = fun () -> test + () + + let should_not_work1 () = + let mutable x = 1 + &x + + let should_not_work2 () = + let mutable x = 1 + let mutable x = (let mutable y = &x in &y) + + let y = &returning_ref &x + &y + + let should_not_work3 () = + let mutable x = 1 + let mutable x = + match &x with + | x -> &x + + let y = &returning_ref &x + &y + + let should_not_work4 () = + let mutable x = 1 + let mutable y = &x + y <- 1 + &y + + let should_not_work5 () = + let x = 1 + let y = &x + &y + + let should_not_work6 () = + let mutable x = 1 + &returning_ref &x + + let should_not_work7 () = + let mutable x = 1 + &returning_ref2 &beef &x + + let should_not_work8 () = + let mutable x = 1 + let y = &returning_ref2 &beef &x + &y + + let should_not_work9 () = + let mutable s = Span.Empty + passing_span_returning_span s + + let should_not_work10 () = + let mutable s = Span.Empty + &passing_span_returnin_ref s + + let should_not_work11 () = + let mutable s = Span.Empty + &passing_span_returnin_ref (passing_span_returning_span s) + + let should_not_work12 () = + let mutable s = Span.Empty + passing_byref_of_span_returning_span &s + + let should_not_work13 () = + let mutable s = Span.Empty + s + + let should_not_work14 () = + let mutable s = Span.Empty + let mutable x = &s + passing_byref_of_span_returning_span &x + + let should_not_work15 (data: byref>) = + let mutable stackData = Span.Empty + let y = passing_byref_of_span2_returning_byref_of_span &stackData &data + y + + let should_not_work16 (data: byref>) = + let mutable stackData = Span.Empty + passing_byref_of_span_and_span_returning_byref_of_span &stackData data + + let should_not_work17 (data: byref>) = + let mutable stackData = Span.Empty + let y = &passing_byref_of_span_and_span_returning_byref_of_span &stackData data + y + + let should_not_work18 () = + let mutable s = Span.Empty + &passing_span_returnin_ref (passing_span_returning_span s) + +#if NOT_YET + + let should_not_work19 (data: byref) = + let mutable stackData = Span.Empty + data.value <- stackData + + let should_not_work20 () = + let mutable data = Span.Empty + let beef = { value = data } + beef + + let should_not_work21 () = + let mutable data = Span.Empty + let beef = StructRefLike(data) + beef + + let should_not_work22 (data: byref) = + let mutable x = Span.Empty + data.Set(x) + +#endif + + let should_not_work33 (x: int) = &x + + let should_not_work34 (x: int) = + let y = &x + &y + +#endif + + let should_work1 () = + Span.Empty + + let should_work3 () = + let mutable beef = 1 + let y = &returning_ref &beef + y + + let should_work2 () = + let x = Span.Empty + x + + let should_work4 () = + &returning_ref2 &beef &beef + + let should_work5 () = + let mutable x = 1 + returning_ref2 &x &x + + let should_work6 () = + let mutable x = 1 + returning_span &x + + let should_work7 () = + let mutable x = 1 + let y = returning_span &x + y + + let should_work8 () = + let s = Span.Empty + passing_span_returning_span s + + let should_work9 () = + let mutable s = Span.Empty + passing_span_returnin_ref s + + let should_work10 () = + let mutable s = Span.Empty + passing_span_returnin_ref (passing_span_returning_span s) + + let should_work11 () = + let s = Span.Empty + &passing_span_returnin_ref (passing_span_returning_span s) + + let should_work12 () = + let s = Span.Empty + passing_inref_of_span_returning_span &s + + let should_work13 () = + let s = Span.Empty + let mutable x = &s + passing_inref_of_span_returning_span &x + + let should_work14 (s: byref>) = + passing_byref_of_span_returning_byref_of_span &s + + let should_work15 (s: byref>) = + let x = &s + let y = &passing_byref_of_span_returning_byref_of_span &x + &y + + type TestDelegate = delegate of byref> -> Span + + let should_work16 (s: byref>) = + let f = TestDelegate(fun _ -> Span.Empty) + f.Invoke(&s) + + type IBeef = + + abstract Test : byref> -> byref> + + let should_work17 () = + { new IBeef with + member __.Test s = &s + } + + let should_work18 (data: byref>) = + let y = passing_byref_of_span_and_span_returning_byref_of_span &data data + y + + let should_work19 (data: byref>) = + &passing_byref_of_span_and_span_returning_byref_of_span &data data + +#if NOT_YET + + let should_work20 () = + let data = Span.Empty + let beef = StructRefLike(data) + beef + + let should_work21 () = + let data = Span.Empty + let beef = { value = data } + beef + + let should_work22 (data: byref) = + let s = Span.Empty + data.value <- s + + let should_work23 (data: byref) = + let x = Span.Empty + data.Set(x) + + let should_work24 () = + let mutable s = Span.Empty + let mutable srl = StructRefLike() + let addr = &srl + addr.value <- s + + let should_work25 () = + let mutable s = Span.Empty + let mutable srl = StructRefLike() + srl.value <- s + + let should_work26 (data: byref) = + let mutable s = Span.Empty + let mutable srl = data + srl.value <- s + +#endif + + let should_work27 (s: Span) = &s.[0] + + let should_work28 (s: Span) = + let y = &s.[0] + &y \ No newline at end of file diff --git a/tests/fsharp/single-test.fs b/tests/fsharp/single-test.fs index a2c401d6a4..1b1fad560e 100644 --- a/tests/fsharp/single-test.fs +++ b/tests/fsharp/single-test.fs @@ -183,6 +183,8 @@ let singleTestBuildAndRun dir p = let singleNegTest (cfg: TestConfig) testname = + let cfg = { cfg with fsc_flags = sprintf "%s --define:NEGATIVE" cfg.fsc_flags } + // REM == Set baseline (fsc vs vs, in case the vs baseline exists) let VSBSLFILE = if (sprintf "%s.vsbsl" testname) |> (fileExists cfg) diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index c475280e2e..5eb2e1260d 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -208,30 +208,33 @@ module CoreTests = let cfg = testConfig "core/span" + let cfg = { cfg with fsc_flags = sprintf "%s --test:StackSpan" cfg.fsc_flags} + begin use testOkFile = fileguard cfg "test.ok" fsc cfg "%s -o:test.exe -g" cfg.fsc_flags ["test.fsx"] + singleNegTest cfg "test" + // Execution is disabled until we can be sure .NET 4.7.2 is on the machine //exec cfg ("." ++ "test.exe") "" //testOkFile.CheckExists() end - // Execution is disabled until we can be sure .NET 4.7.2 is on the machine - //begin - // use testOkFile = fileguard cfg "test.ok" - // fsi cfg "" ["test.fsx"] - // testOkFile.CheckExists() - //end - - // Execution is disabled until we can be sure .NET 4.7.2 is on the machine - //begin - // use testOkFile = fileguard cfg "test.ok" - // fsiAnyCpu cfg "" ["test.fsx"] - // testOkFile.CheckExists() - //end + begin + use testOkFile = fileguard cfg "test2.ok" + + fsc cfg "%s -o:test2.exe -g" cfg.fsc_flags ["test2.fsx"] + + singleNegTest cfg "test2" + + // Execution is disabled until we can be sure .NET 4.7.2 is on the machine + //exec cfg ("." ++ "test.exe") "" + + //testOkFile.CheckExists() + end [] let asyncStackTraces () = diff --git a/tests/fsharp/typecheck/sigs/neg63.bsl b/tests/fsharp/typecheck/sigs/neg63.bsl index b5df880f02..8898a01725 100644 --- a/tests/fsharp/typecheck/sigs/neg63.bsl +++ b/tests/fsharp/typecheck/sigs/neg63.bsl @@ -11,4 +11,4 @@ neg63.fs(14,8,14,9): typecheck error FS3155: A quotation may not involve an assi neg63.fs(18,6,18,7): typecheck error FS3209: The address of the variable 'x' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. -neg63.fs(26,6,26,10): typecheck error FS3228: The address of the variable 'addr' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. +neg63.fs(26,6,26,10): typecheck error FS3209: The address of the variable 'addr' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. diff --git a/tests/fsharp/typecheck/sigs/neg_byref_7.bsl b/tests/fsharp/typecheck/sigs/neg_byref_7.bsl index ef21f974eb..11f25ecb6d 100644 --- a/tests/fsharp/typecheck/sigs/neg_byref_7.bsl +++ b/tests/fsharp/typecheck/sigs/neg_byref_7.bsl @@ -18,5 +18,3 @@ neg_byref_7.fs(2,47,2,53): typecheck error FS0412: A type instantiation involves neg_byref_7.fs(2,47,2,53): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. neg_byref_7.fs(2,47,2,53): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. - -neg_byref_7.fs(4,41,4,42): typecheck error FS3228: The address of the variable 'y' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. From fa5cdf000da7ae51beac88c22cd3ba213c57c253 Mon Sep 17 00:00:00 2001 From: Vasily Kirichenko Date: Wed, 20 Jun 2018 23:47:02 +0300 Subject: [PATCH 052/150] fix ParseAndCheckDocument (#5175) --- .../FSharpCheckerExtensions.fs | 24 +++++++------------ 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/vsintegration/src/FSharp.Editor/LanguageService/FSharpCheckerExtensions.fs b/vsintegration/src/FSharp.Editor/LanguageService/FSharpCheckerExtensions.fs index d8b892aec5..d2d995928b 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/FSharpCheckerExtensions.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/FSharpCheckerExtensions.fs @@ -9,10 +9,6 @@ open Microsoft.FSharp.Compiler open Microsoft.FSharp.Compiler.Ast open Microsoft.FSharp.Compiler.SourceCodeServices -type CheckResults = - | Ready of (FSharpParseFileResults * FSharpCheckFileResults) option - | StillRunning of Async<(FSharpParseFileResults * FSharpCheckFileResults) option> - type FSharpChecker with member checker.ParseDocument(document: Document, parsingOptions: FSharpParsingOptions, sourceText: string, userOpName: string) = asyncMaybe { @@ -36,15 +32,13 @@ type FSharpChecker with Some (parseResults, checkFileResults) } - let! worker = Async.StartChild(parseAndCheckFile, millisecondsTimeout=Settings.LanguageServicePerformance.TimeUntilStaleCompletion) - - let tryGetFreshResultsWithTimeout() : Async = + let tryGetFreshResultsWithTimeout() = async { + let! worker = Async.StartChild(parseAndCheckFile, millisecondsTimeout=Settings.LanguageServicePerformance.TimeUntilStaleCompletion) try - let! result = worker - return Ready result + return! worker with :? TimeoutException -> - return StillRunning worker + return None // worker is cancelled at this point, we cannot return it and wait its completion anymore } let bindParsedInput(results: (FSharpParseFileResults * FSharpCheckFileResults) option) = @@ -60,19 +54,19 @@ type FSharpChecker with let! results = match freshResults with - | Ready x -> async.Return x - | StillRunning worker -> + | Some x -> async.Return (Some x) + | None -> async { match checker.TryGetRecentCheckResultsForFile(filePath, options) with | Some (parseResults, checkFileResults, _) -> return Some (parseResults, checkFileResults) | None -> - return! worker + return! parseAndCheckFile } return bindParsedInput results else - let! res = worker - return bindParsedInput res + let! results = parseAndCheckFile + return bindParsedInput results } From 8d6624901c516068e45855a2b0205145a41665b3 Mon Sep 17 00:00:00 2001 From: Will Smith Date: Wed, 20 Jun 2018 14:20:21 -0700 Subject: [PATCH 053/150] Ref/Span fixes (#5146) - dev15.8 branch (#5218) * Ref/Span fixes (#5146) * Added LimitedValFlags for PostInferenceChecks * More work * Renamed IsLimited to IsLimitedSpanLike * Don't use isByRefReturnCall in CheckExprs * Minor cleanup * Changed error message. Fixed safety rule regarding byrefs returning and passing. * Fixed an edge case with returning span. Simplified Expr.App * Cleanup * Fixed a few ref return checks. Partially handling byref of span-like types * Simplifying flags. Added CheckCall * Updated test baseline. Added several CheckCall functions * Updated baseline tests * Handling byref of span likes * Added a little bit better error msg for LByrefGet * Removed commented code * Fixed test * Fixed inability to use byref> for delegates and slots * Minor cleanup with some comments * Few more comments * Running neg tests in core/span. Fixed bug in IsByRefLike structs with span fields * Updated baseline * Fixed more issues with slots. Simplified PermitByRefType * Added a little better error messages on spans * Fixed record construction for span likes. Fixed setting fields on mutable structs not having any rules for span likes. Updated a few error msgs. Added lots of tests. * Updated error msg on function call. Added a removed comment from previous commit. Updated baselines * Added internalTestSpanStackReferring test option * Added special handling for receivers * Fixing build * Fixing build * Fixing build * More tests, updated baseline * Opening System in PostInferenceChecks --- .../FSharp.Compiler.Private/FSComp.fs | 20 +- .../FSharp.Compiler.Private/FSComp.resx | 15 +- src/fsharp/CompileOps.fs | 7 +- src/fsharp/CompileOps.fsi | 3 + src/fsharp/CompileOptions.fs | 1 + src/fsharp/FSComp.txt | 7 +- src/fsharp/PostInferenceChecks.fs | 506 +++++++++++++----- src/fsharp/PostInferenceChecks.fsi | 2 +- src/fsharp/TastOps.fs | 8 + src/fsharp/TastOps.fsi | 4 + src/fsharp/TypeChecker.fs | 16 +- src/fsharp/TypeChecker.fsi | 4 +- src/fsharp/xlf/FSComp.txt.cs.xlf | 29 +- src/fsharp/xlf/FSComp.txt.de.xlf | 29 +- src/fsharp/xlf/FSComp.txt.en.xlf | 29 +- src/fsharp/xlf/FSComp.txt.es.xlf | 29 +- src/fsharp/xlf/FSComp.txt.fr.xlf | 29 +- src/fsharp/xlf/FSComp.txt.it.xlf | 29 +- src/fsharp/xlf/FSComp.txt.ja.xlf | 29 +- src/fsharp/xlf/FSComp.txt.ko.xlf | 29 +- src/fsharp/xlf/FSComp.txt.pl.xlf | 29 +- src/fsharp/xlf/FSComp.txt.pt-BR.xlf | 29 +- src/fsharp/xlf/FSComp.txt.ru.xlf | 29 +- src/fsharp/xlf/FSComp.txt.tr.xlf | 29 +- src/fsharp/xlf/FSComp.txt.zh-Hans.xlf | 29 +- src/fsharp/xlf/FSComp.txt.zh-Hant.xlf | 29 +- tests/fsharp/core/span/test.bsl | 16 + tests/fsharp/core/span/test.fsx | 23 +- tests/fsharp/core/span/test2.bsl | 52 ++ tests/fsharp/core/span/test2.fsx | 324 +++++++++++ tests/fsharp/single-test.fs | 2 + tests/fsharp/tests.fs | 29 +- tests/fsharp/typecheck/sigs/neg63.bsl | 2 +- tests/fsharp/typecheck/sigs/neg_byref_7.bsl | 2 - 34 files changed, 1157 insertions(+), 292 deletions(-) create mode 100644 tests/fsharp/core/span/test.bsl create mode 100644 tests/fsharp/core/span/test2.bsl create mode 100644 tests/fsharp/core/span/test2.fsx diff --git a/src/buildfromsource/FSharp.Compiler.Private/FSComp.fs b/src/buildfromsource/FSharp.Compiler.Private/FSComp.fs index c3672425eb..f2b06f7598 100644 --- a/src/buildfromsource/FSharp.Compiler.Private/FSComp.fs +++ b/src/buildfromsource/FSharp.Compiler.Private/FSComp.fs @@ -4324,10 +4324,10 @@ type internal SR private() = /// A type annotated with IsByRefLike must also be a struct. Consider adding the [] attribute to the type. /// (Originally from ..\FSComp.txt:1432) static member tcByRefLikeNotStruct() = (3227, GetStringFunc("tcByRefLikeNotStruct",",,,") ) - /// The address of the variable '%s' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. + /// The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. /// (Originally from ..\FSComp.txt:1433) - static member chkNoByrefReturnOfLocal(a0 : System.String) = (3228, GetStringFunc("chkNoByrefReturnOfLocal",",,,%s,,,") a0) - /// The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + static member chkNoByrefAddressOfValueFromExpression() = (3228, GetStringFunc("chkNoByrefAddressOfValueFromExpression",",,,") ) + /// The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. /// (Originally from ..\FSComp.txt:1434) static member chkNoReturnOfLimitedSpan() = (3229, GetStringFunc("chkNoReturnOfLimitedSpan",",,,") ) /// This value can't be assigned because the target '%s' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. @@ -4342,6 +4342,15 @@ type internal SR private() = /// Struct members cannot return 'this' or fields by reference /// (Originally from ..\FSComp.txt:1438) static member chkStructsMayNotReturnAddressesOfContents() = (3234, GetStringFunc("chkStructsMayNotReturnAddressesOfContents",",,,") ) + /// The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + /// (Originally from ..\FSComp.txt:1439) + static member chkNoByrefLikeFunctionCall() = (3235, GetStringFunc("chkNoByrefLikeFunctionCall",",,,") ) + /// The Span or IsByRefLike variable '%s' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + /// (Originally from ..\FSComp.txt:1440) + static member chkNoSpanLikeVariable(a0 : System.String) = (3236, GetStringFunc("chkNoSpanLikeVariable",",,,%s,,,") a0) + /// A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + /// (Originally from ..\FSComp.txt:1441) + static member chkNoSpanLikeValueFromExpression() = (3237, GetStringFunc("chkNoSpanLikeValueFromExpression",",,,") ) /// Call this method once to validate that all known resources are valid; throws if not static member RunStartupValidation() = @@ -5748,10 +5757,13 @@ type internal SR private() = ignore(GetString("readOnlyAttributeOnStructWithMutableField")) ignore(GetString("tcByrefReturnImplicitlyDereferenced")) ignore(GetString("tcByRefLikeNotStruct")) - ignore(GetString("chkNoByrefReturnOfLocal")) + ignore(GetString("chkNoByrefAddressOfValueFromExpression")) ignore(GetString("chkNoReturnOfLimitedSpan")) ignore(GetString("chkNoWriteToLimitedSpan")) ignore(GetString("tastValueMustBeLocal")) ignore(GetString("tcIsReadOnlyNotStruct")) ignore(GetString("chkStructsMayNotReturnAddressesOfContents")) + ignore(GetString("chkNoByrefLikeFunctionCall")) + ignore(GetString("chkNoSpanLikeVariable")) + ignore(GetString("chkNoSpanLikeValueFromExpression")) () diff --git a/src/buildfromsource/FSharp.Compiler.Private/FSComp.resx b/src/buildfromsource/FSharp.Compiler.Private/FSComp.resx index 2289e761c7..93d7f69b3b 100644 --- a/src/buildfromsource/FSharp.Compiler.Private/FSComp.resx +++ b/src/buildfromsource/FSharp.Compiler.Private/FSComp.resx @@ -4327,11 +4327,11 @@ A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. - - The address of the variable '{0}' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. + + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. @@ -4345,4 +4345,13 @@ Struct members cannot return 'this' or fields by reference + + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + + + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + \ No newline at end of file diff --git a/src/fsharp/CompileOps.fs b/src/fsharp/CompileOps.fs index ac45baee98..365daac8d7 100644 --- a/src/fsharp/CompileOps.fs +++ b/src/fsharp/CompileOps.fs @@ -2346,6 +2346,7 @@ type TcConfigBuilder = /// and from which we can read the metadata. Only used when metadataOnly=true. mutable tryGetMetadataSnapshot : ILReaderTryGetMetadataSnapshot + mutable internalTestSpanStackReferring : bool } static member Initial = @@ -2482,6 +2483,7 @@ type TcConfigBuilder = copyFSharpCore = CopyFSharpCoreFlag.No shadowCopyReferences = false tryGetMetadataSnapshot = (fun _ -> None) + internalTestSpanStackReferring = false } static member CreateNew(legacyReferenceResolver, defaultFSharpBinariesDir, reduceMemoryUsage, implicitIncludeDir, @@ -2942,6 +2944,7 @@ type TcConfig private (data : TcConfigBuilder, validate:bool) = member x.copyFSharpCore = data.copyFSharpCore member x.shadowCopyReferences = data.shadowCopyReferences member x.tryGetMetadataSnapshot = data.tryGetMetadataSnapshot + member x.internalTestSpanStackReferring = data.internalTestSpanStackReferring static member Create(builder, validate) = use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Parameter TcConfig(builder, validate) @@ -5429,7 +5432,7 @@ let TypeCheckOneInputEventually (checkForErrors, tcConfig:TcConfig, tcImports:Tc // Typecheck the signature file let! (tcEnv, sigFileType, createsGeneratedProvidedTypes) = - TypeCheckOneSigFile (tcGlobals, tcState.tcsNiceNameGen, amap, tcState.tcsCcu, checkForErrors, tcConfig.conditionalCompilationDefines, tcSink) tcState.tcsTcSigEnv file + TypeCheckOneSigFile (tcGlobals, tcState.tcsNiceNameGen, amap, tcState.tcsCcu, checkForErrors, tcConfig.conditionalCompilationDefines, tcSink, tcConfig.internalTestSpanStackReferring) tcState.tcsTcSigEnv file let rootSigs = Zmap.add qualNameOfFile sigFileType tcState.tcsRootSigs @@ -5466,7 +5469,7 @@ let TypeCheckOneInputEventually (checkForErrors, tcConfig:TcConfig, tcImports:Tc // Typecheck the implementation file let! topAttrs, implFile, _implFileHiddenType, tcEnvAtEnd, createsGeneratedProvidedTypes = - TypeCheckOneImplFile (tcGlobals, tcState.tcsNiceNameGen, amap, tcState.tcsCcu, checkForErrors, tcConfig.conditionalCompilationDefines, tcSink) tcImplEnv rootSigOpt file + TypeCheckOneImplFile (tcGlobals, tcState.tcsNiceNameGen, amap, tcState.tcsCcu, checkForErrors, tcConfig.conditionalCompilationDefines, tcSink, tcConfig.internalTestSpanStackReferring) tcImplEnv rootSigOpt file let hadSig = rootSigOpt.IsSome let implFileSigType = SigTypeOfImplFile implFile diff --git a/src/fsharp/CompileOps.fsi b/src/fsharp/CompileOps.fsi index b7ceb11c41..eb371fa592 100755 --- a/src/fsharp/CompileOps.fsi +++ b/src/fsharp/CompileOps.fsi @@ -363,6 +363,9 @@ type TcConfigBuilder = /// A function to call to try to get an object that acts as a snapshot of the metadata section of a .NET binary, /// and from which we can read the metadata. Only used when metadataOnly=true. mutable tryGetMetadataSnapshot : ILReaderTryGetMetadataSnapshot + + /// if true - 'let mutable x = Span.Empty', the value 'x' is a stack referring span. Used for internal testing purposes only until we get true stack spans. + mutable internalTestSpanStackReferring : bool } static member Initial: TcConfigBuilder diff --git a/src/fsharp/CompileOptions.fs b/src/fsharp/CompileOptions.fs index 5969e38fc8..c981408032 100644 --- a/src/fsharp/CompileOptions.fs +++ b/src/fsharp/CompileOptions.fs @@ -832,6 +832,7 @@ let advancedFlagsFsc tcConfigB = let testFlag tcConfigB = CompilerOption("test", tagString, OptionString (fun s -> match s with + | "StackSpan" -> tcConfigB.internalTestSpanStackReferring <- true | "ErrorRanges" -> tcConfigB.errorStyle <- ErrorStyle.TestErrors | "MemberBodyRanges" -> PostTypeCheckSemanticChecks.testFlagMemberBody := true | "Tracking" -> Lib.tracking := true (* general purpose on/off diagnostics flag *) diff --git a/src/fsharp/FSComp.txt b/src/fsharp/FSComp.txt index 76a75e7555..b3a60ed307 100644 --- a/src/fsharp/FSComp.txt +++ b/src/fsharp/FSComp.txt @@ -1430,9 +1430,12 @@ notAFunctionButMaybeDeclaration,"This value is not a function and cannot be appl 3225,readOnlyAttributeOnStructWithMutableField,"A ReadOnly attribute has been applied to a struct type with a mutable field." 3226,tcByrefReturnImplicitlyDereferenced,"A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'." 3227,tcByRefLikeNotStruct,"A type annotated with IsByRefLike must also be a struct. Consider adding the [] attribute to the type." -3228,chkNoByrefReturnOfLocal,"The address of the variable '%s' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope." -3229,chkNoReturnOfLimitedSpan,"The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope." +3228,chkNoByrefAddressOfValueFromExpression,"The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope." +3229,chkNoReturnOfLimitedSpan,"The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope." 3230,chkNoWriteToLimitedSpan,"This value can't be assigned because the target '%s' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope." 3231,tastValueMustBeLocal,"A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...'" 3232,tcIsReadOnlyNotStruct,"A type annotated with IsReadOnly must also be a struct. Consider adding the [] attribute to the type." 3234,chkStructsMayNotReturnAddressesOfContents,"Struct members cannot return the address of fields of the struct by reference" +3235,chkNoByrefLikeFunctionCall,"The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope." +3236,chkNoSpanLikeVariable,"The Span or IsByRefLike variable '%s' cannot be used at this point. This is to ensure the address of the local value does not escape its scope." +3237,chkNoSpanLikeValueFromExpression,"A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope." \ No newline at end of file diff --git a/src/fsharp/PostInferenceChecks.fs b/src/fsharp/PostInferenceChecks.fs index f59d94502f..913ccde9ac 100644 --- a/src/fsharp/PostInferenceChecks.fs +++ b/src/fsharp/PostInferenceChecks.fs @@ -4,6 +4,7 @@ /// is complete. module internal Microsoft.FSharp.Compiler.PostTypeCheckSemanticChecks +open System open System.Collections.Generic open Microsoft.FSharp.Compiler @@ -124,9 +125,20 @@ let BindTypars g env (tps:Typar list) = let BindArgVals env (vs: Val list) = { env with argVals = ValMap.OfList (List.map (fun v -> (v,())) vs) } +/// Limit flags represent a type(s) returned from checking an expression(s) that is interesting to impose rules on. +[] +type LimitFlags = + | None = 0b000000 + | LocalByRef = 0b000001 + | LocalByRefOfSpanLike = 0b000011 + | LocalByRefOfStackReferringSpanLike = 0b000101 + | SpanLike = 0b001000 + | StackReferringSpanLike = 0b010000 + | ByRefOfSpanLike = 0b100000 + type cenv = - { boundVals: Dictionary // really a hash set - limitVals: Dictionary // really a hash set + { boundVals: Dictionary // really a hash set + limitVals: Dictionary mutable potentialUnboundUsesOfVals: StampMap g: TcGlobals amap: Import.ImportMap @@ -137,12 +149,79 @@ type cenv = viewCcu : CcuThunk reportErrors: bool isLastCompiland : bool*bool + isInternalTestSpanStackReferring: bool // outputs mutable usesQuotations : bool mutable entryPointGiven:bool } -let LimitVal cenv (v:Val) = - cenv.limitVals.[v.Stamp] <- 1 +/// Check if the value is an argument of a function +let IsValArgument env (v: Val) = + env.argVals.ContainsVal(v) + +/// Check if the value is a local, not an argument of a function. +let IsValLocal env (v: Val) = + v.ValReprInfo.IsNone && not (IsValArgument env v) + +/// Check if the limit has the target limit. +let inline HasLimitFlag targetLimit limit = + limit &&& targetLimit = targetLimit + +/// Get the limit of the val. +let GetLimitVal cenv env m (v: Val) = + let limit = + match cenv.limitVals.TryGetValue(v.Stamp) with + | true, limit -> limit + | _ -> LimitFlags.None + + if isSpanLikeTy cenv.g m v.Type then + // The value is a limited Span or might have become one through mutation + let isLocal = IsValLocal env v + let isMutableLocal = isLocal && v.IsMutable && cenv.isInternalTestSpanStackReferring + let isLimitedLocal = isLocal && HasLimitFlag LimitFlags.StackReferringSpanLike limit + if isMutableLocal || isLimitedLocal then + LimitFlags.StackReferringSpanLike + else + LimitFlags.SpanLike + + elif isByrefTy cenv.g v.Type then + let isLocal = IsValLocal env v + let isLimitedLocal = isLocal && HasLimitFlag LimitFlags.LocalByRef limit + let isByRefOfSpanLike = isSpanLikeTy cenv.g m (destByrefTy cenv.g v.Type) + + match isLimitedLocal, isByRefOfSpanLike with + | true, false -> LimitFlags.LocalByRef + | true, true -> + if HasLimitFlag LimitFlags.LocalByRefOfStackReferringSpanLike limit then + LimitFlags.LocalByRefOfStackReferringSpanLike + else + LimitFlags.LocalByRefOfSpanLike + | false, true -> LimitFlags.ByRefOfSpanLike + | _ -> LimitFlags.None + + else + LimitFlags.None + +/// Get the limit of the val by reference. +let GetLimitValByRef cenv env m v = + let limit = GetLimitVal cenv env m v + + if HasLimitFlag LimitFlags.StackReferringSpanLike limit then + LimitFlags.LocalByRefOfStackReferringSpanLike + + elif IsValLocal env v || IsValArgument env v then + if HasLimitFlag LimitFlags.SpanLike limit then + LimitFlags.LocalByRefOfSpanLike + else + LimitFlags.LocalByRef + + elif HasLimitFlag LimitFlags.SpanLike limit then + LimitFlags.ByRefOfSpanLike + + else + LimitFlags.None + +let LimitVal cenv (v:Val) limit = + cenv.limitVals.[v.Stamp] <- limit let BindVal cenv env (v:Val) = //printfn "binding %s..." v.DisplayName @@ -344,11 +423,8 @@ type PermitByRefType = /// Don't permit any byref or byref-like types | None - /// Permit only an outermost Span or IsByRefLike type - | OuterSpanLike - - /// Permit only an outermost Span, IsByRefLike, inref, outref or byref type - | OuterByRefLike + /// Permit only a Span or IsByRefLike type + | SpanLike /// Permit all byref and byref-like types | All @@ -380,35 +456,32 @@ type PermitByRefExpr = | PermitByRefExpr.YesReturnable -> true | _ -> false -let ignoreLimit (_limit: bool) = () - -let mkArgsPermit isByRefReturnCall n = - if n=1 then - if isByRefReturnCall then PermitByRefExpr.YesReturnable else PermitByRefExpr.Yes +let mkArgsPermit n = + if n=1 then PermitByRefExpr.Yes else PermitByRefExpr.YesTupleOfArgs n /// Work out what byref-values are allowed at input positions to named F# functions or members -let mkArgsForAppliedVal isBaseCall isByRefReturnCall (vref:ValRef) argsl = +let mkArgsForAppliedVal isBaseCall (vref:ValRef) argsl = match vref.ValReprInfo with | Some topValInfo -> let argArities = topValInfo.AritiesOfArgs let argArities = if isBaseCall && argArities.Length >= 1 then List.tail argArities else argArities // Check for partial applications: arguments to partial applciations don't get to use byrefs if List.length argsl >= argArities.Length then - List.map (mkArgsPermit isByRefReturnCall) argArities + List.map mkArgsPermit argArities else [] | None -> [] /// Work out what byref-values are allowed at input positions to functions -let rec mkArgsForAppliedExpr isBaseCall isByRefReturnCall argsl x = +let rec mkArgsForAppliedExpr isBaseCall argsl x = match stripExpr x with // recognise val - | Expr.Val (vref,_,_) -> mkArgsForAppliedVal isBaseCall isByRefReturnCall vref argsl + | Expr.Val (vref,_,_) -> mkArgsForAppliedVal isBaseCall vref argsl // step through instantiations - | Expr.App(f,_fty,_tyargs,[],_) -> mkArgsForAppliedExpr isBaseCall isByRefReturnCall argsl f + | Expr.App(f,_fty,_tyargs,[],_) -> mkArgsForAppliedExpr isBaseCall argsl f // step through subsumption coercions - | Expr.Op(TOp.Coerce,_,[f],_) -> mkArgsForAppliedExpr isBaseCall isByRefReturnCall argsl f + | Expr.Op(TOp.Coerce,_,[f],_) -> mkArgsForAppliedExpr isBaseCall argsl f | _ -> [] /// Check types occurring in the TAST. @@ -421,14 +494,12 @@ let CheckType permitByRefLike (cenv:cenv) env m ty = else errorR (Error(FSComp.SR.checkNotSufficientlyGenericBecauseOfScope(tp.DisplayName),m)) - let visitTyconRef isInner tcref = + let visitTyconRef _isInner tcref = match permitByRefLike with | PermitByRefType.None when isByrefLikeTyconRef cenv.g m tcref -> errorR(Error(FSComp.SR.chkErrorUseOfByref(), m)) - | PermitByRefType.OuterSpanLike when isInner && isByrefTyconRef cenv.g tcref -> - errorR(Error(FSComp.SR.chkErrorUseOfByref(), m)) - | PermitByRefType.OuterByRefLike when isInner && isByrefLikeTyconRef cenv.g m tcref -> + | PermitByRefType.SpanLike when isByrefTyconRef cenv.g tcref -> errorR(Error(FSComp.SR.chkErrorUseOfByref(), m)) | _ -> () @@ -462,11 +533,8 @@ let CheckType permitByRefLike (cenv:cenv) env m ty = /// The additional byref checks are to catch "byref instantiations" - one place were byref are not permitted. let CheckTypeNoByrefs (cenv:cenv) env m ty = CheckType PermitByRefType.None cenv env m ty -/// Check types occurring in TAST but allow an outer byref. -let CheckTypePermitOuterByRefLike (cenv:cenv) env m ty = CheckType PermitByRefType.OuterByRefLike cenv env m ty - -/// Check types occurring in TAST but allow an outer Span or similar -let CheckTypePermitOuterSpanLike (cenv:cenv) env m ty = CheckType PermitByRefType.OuterSpanLike cenv env m ty +/// Check types occurring in TAST but allow a Span or similar +let CheckTypePermitSpanLike (cenv:cenv) env m ty = CheckType PermitByRefType.SpanLike cenv env m ty /// Check types occurring in TAST but allow all byrefs. Only used on internally-generated types let CheckTypePermitAllByrefs (cenv:cenv) env m ty = CheckType PermitByRefType.All cenv env m ty @@ -513,7 +581,7 @@ let CheckMultipleInterfaceInstantiations cenv interfaces m = /// Check an expression, where the expression is in a position where byrefs can be generated let rec CheckExprNoByrefs cenv env expr = - CheckExpr cenv env expr PermitByRefExpr.No |> ignoreLimit + CheckExpr cenv env expr PermitByRefExpr.No |> ignore /// Check a value and CheckValRef (cenv:cenv) (env:env) v m (context: PermitByRefExpr) = @@ -530,25 +598,12 @@ and CheckValRef (cenv:cenv) (env:env) v m (context: PermitByRefExpr) = CheckTypePermitAllByrefs cenv env m v.Type // the byref checks are done at the actual binding of the value -and IsLimitedType g m ty = - isByrefLikeTy g m ty && - not (isByrefTy g ty) - -and IsLimited cenv env m (vref: ValRef) = - IsLimitedType cenv.g m vref.Type && - // The value is a arg/local.... - vref.ValReprInfo.IsNone && - // The value is a limited Span or might have become one through mutation - let isMutableLocal = not (env.argVals.ContainsVal(vref.Deref)) && vref.IsMutable - let isLimitedLocal = cenv.limitVals.ContainsKey(vref.Stamp) - isMutableLocal || isLimitedLocal - /// Check a use of a value and CheckValUse (cenv: cenv) (env: env) (vref: ValRef, vFlags, m) (context: PermitByRefExpr) = let g = cenv.g - // Is this a Span-typed value that is limited (i.e. can't be returned) - let limit = IsLimited cenv env m vref + + let limit = GetLimitVal cenv env m vref.Deref if cenv.reportErrors then @@ -563,16 +618,23 @@ and CheckValUse (cenv: cenv) (env: env) (vref: ValRef, vFlags, m) (context: Perm if isCallOfConstructorOfAbstractType then errorR(Error(FSComp.SR.tcAbstractTypeCannotBeInstantiated(),m)) - let isReturnExprBuiltUsingByRefLocal = + // This is used to handle this case: + // let x = 1 + // let y = &x + // &y + let isReturnExprBuiltUsingStackReferringByRefLike = context.PermitOnlyReturnable && - isByrefTy g vref.Type && - // The value is a local.... - vref.ValReprInfo.IsNone && - // The value is not an argument.... - not (env.argVals.ContainsVal(vref.Deref)) - - if isReturnExprBuiltUsingByRefLocal then - errorR(Error(FSComp.SR.chkNoByrefReturnOfLocal(vref.DisplayName), m)) + (HasLimitFlag LimitFlags.LocalByRef limit || + HasLimitFlag LimitFlags.StackReferringSpanLike limit) + + if isReturnExprBuiltUsingStackReferringByRefLike then + let isSpanLike = isSpanLikeTy g m vref.Type + let isCompGen = vref.IsCompilerGenerated + match isSpanLike, isCompGen with + | true, true -> errorR(Error(FSComp.SR.chkNoSpanLikeValueFromExpression(), m)) + | true, false -> errorR(Error(FSComp.SR.chkNoSpanLikeVariable(vref.DisplayName), m)) + | false, true -> errorR(Error(FSComp.SR.chkNoByrefAddressOfValueFromExpression(), m)) + | false, false -> errorR(Error(FSComp.SR.chkNoByrefAddressOfLocal(vref.DisplayName), m)) let isReturnOfStructThis = context.PermitOnlyReturnable && @@ -583,6 +645,7 @@ and CheckValUse (cenv: cenv) (env: env) (vref: ValRef, vFlags, m) (context: Perm errorR(Error(FSComp.SR.chkStructsMayNotReturnAddressesOfContents(), m)) CheckValRef cenv env vref m context + limit /// Check an expression, given information about the position of the expression @@ -626,8 +689,112 @@ and CheckForOverAppliedExceptionRaisingPrimitive (cenv:cenv) expr = | _ -> () | _ -> () +and CheckCallLimitArgs cenv m (returnTy: TType) limitArgs (context: PermitByRefExpr) = + let isReturnByref = isByrefTy cenv.g returnTy + let isReturnSpanLike = isSpanLikeTy cenv.g m returnTy + + // If return is a byref, and being used as a return, then a single argument cannot be a local-byref or a stack referring span-like. + let isReturnLimitedByRef = + isReturnByref && + (HasLimitFlag LimitFlags.LocalByRef limitArgs || + HasLimitFlag LimitFlags.StackReferringSpanLike limitArgs) + + // If return is a byref, and being used as a return, then a single argument cannot be a stack referring span-like or a local-byref of a stack referring span-like. + let isReturnLimitedSpanLike = + isReturnSpanLike && + (HasLimitFlag LimitFlags.StackReferringSpanLike limitArgs || + HasLimitFlag LimitFlags.LocalByRefOfStackReferringSpanLike limitArgs) + + if cenv.reportErrors then + if context.PermitOnlyReturnable && (isReturnLimitedByRef || isReturnLimitedSpanLike) then + if isReturnLimitedSpanLike then + errorR(Error(FSComp.SR.chkNoSpanLikeValueFromExpression(), m)) + else + errorR(Error(FSComp.SR.chkNoByrefAddressOfValueFromExpression(), m)) + + // You cannot call a function that takes a byref of a span-like (not stack referring) and + // either a stack referring spanlike or a local-byref of a stack referring span-like. + let isCallLimited = + HasLimitFlag LimitFlags.ByRefOfSpanLike limitArgs && + (HasLimitFlag LimitFlags.StackReferringSpanLike limitArgs || + HasLimitFlag LimitFlags.LocalByRefOfStackReferringSpanLike limitArgs) + + if isCallLimited then + errorR(Error(FSComp.SR.chkNoByrefLikeFunctionCall(), m)) + + if isReturnLimitedByRef then + if isSpanLikeTy cenv.g m (destByrefTy cenv.g returnTy) then + let isStackReferring = + HasLimitFlag LimitFlags.StackReferringSpanLike limitArgs || + HasLimitFlag LimitFlags.LocalByRefOfStackReferringSpanLike limitArgs + if isStackReferring then + LimitFlags.LocalByRefOfStackReferringSpanLike + else + LimitFlags.LocalByRefOfSpanLike + else + LimitFlags.LocalByRef + + elif isReturnLimitedSpanLike then + LimitFlags.StackReferringSpanLike + + elif isReturnByref then + if isSpanLikeTy cenv.g m (destByrefTy cenv.g returnTy) then + LimitFlags.ByRefOfSpanLike + else + LimitFlags.None + + elif isReturnSpanLike then + LimitFlags.SpanLike + + else + LimitFlags.None + +/// Check call arguments, including the return argument. +and CheckCall cenv env m returnTy args contexts context = + let limitArgs = CheckExprs cenv env args contexts + CheckCallLimitArgs cenv m returnTy limitArgs context + +/// Check call arguments, including the return argument. The receiver argument is handled differently. +and CheckCallWithReceiver cenv env m returnTy args contexts context = + match args with + | [] -> failwith "CheckCallWithReceiver: Argument list is empty." + | receiverArg :: args -> + + let receiverContext, contexts = + match contexts with + | [] -> PermitByRefExpr.No, [] + | context :: contexts -> context, contexts + + let receiverLimit = CheckExpr cenv env receiverArg receiverContext + let limitArgs = + let limitArgs = CheckExprs cenv env args contexts + // We do not include the receiver's limit in the limit args unless the receiver is a stack referring span-like. + if HasLimitFlag LimitFlags.StackReferringSpanLike receiverLimit || HasLimitFlag LimitFlags.LocalByRefOfStackReferringSpanLike receiverLimit then + limitArgs ||| receiverLimit + else + limitArgs + CheckCallLimitArgs cenv m returnTy limitArgs context + +/// Check call arguments, including the return argument. Permits returnable byref. +and CheckCallPermitReturnableByRef cenv env m returnTy args = + let limitArgs = CheckExprsPermitByRefLike cenv env args + CheckCallLimitArgs cenv m returnTy limitArgs PermitByRefExpr.YesReturnable + +/// Check call arguments, including the return argument. The receiver argument is handled differently. Permits returnable byref. +and CheckCallWithReceiverPermitReturnableByRef cenv env m returnTy args = + CheckCallWithReceiver cenv env m returnTy args (List.init args.Length (fun _ -> PermitByRefExpr.Yes)) PermitByRefExpr.YesReturnable + +/// Check call arguments, including the return argument. Permits byref. +and CheckCallPermitByRefLike cenv env m returnTy args = + let limitArgs = CheckExprsPermitByRefLike cenv env args + CheckCallLimitArgs cenv m returnTy limitArgs PermitByRefExpr.Yes + +/// Check call arguments, including the return argument. The receiver argument is handled differently. Permits byref. +and CheckCallWithReceiverPermitByRefLike cenv env m returnTy args = + CheckCallWithReceiver cenv env m returnTy args (List.init args.Length (fun _ -> PermitByRefExpr.Yes)) PermitByRefExpr.Yes + /// Check an expression, given information about the position of the expression -and CheckExpr (cenv:cenv) (env:env) origExpr (context:PermitByRefExpr) : bool = +and CheckExpr (cenv:cenv) (env:env) origExpr (context:PermitByRefExpr) : LimitFlags = let g = cenv.g let origExpr = stripExpr origExpr @@ -645,18 +812,21 @@ and CheckExpr (cenv:cenv) (env:env) origExpr (context:PermitByRefExpr) : bool = CheckExpr cenv env e2 context // carry context into _;RHS (normal sequencing only) | ThenDoSeq -> CheckExprNoByrefs cenv {env with ctorLimitedZone=false} e2 - false + LimitFlags.None - | Expr.Let (bind,body,_,_) -> + | Expr.Let ((TBind(v,_,_) as bind),body,_,_) -> let limit = CheckBinding cenv env false bind - BindVal cenv env bind.Var - if limit then - LimitVal cenv bind.Var + + BindVal cenv env v + + if limit <> LimitFlags.None then + LimitVal cenv v limit + CheckExpr cenv env body context | Expr.Const (_,m,ty) -> - CheckTypePermitOuterByRefLike cenv env m ty - false + CheckTypePermitAllByrefs cenv env m ty + LimitFlags.None | Expr.Val (vref,vFlags,m) -> CheckValUse cenv env (vref, vFlags, m) context @@ -678,7 +848,7 @@ and CheckExpr (cenv:cenv) (env:env) origExpr (context:PermitByRefExpr) : bool = errorRecovery e m CheckTypeNoByrefs cenv env m ty - false + LimitFlags.None | Expr.Obj (_,ty,basev,superInitCall,overrides,iimpls,m) -> CheckExprNoByrefs cenv env superInitCall @@ -694,7 +864,7 @@ and CheckExpr (cenv:cenv) (env:env) origExpr (context:PermitByRefExpr) : bool = |> List.filter (isInterfaceTy g) CheckMultipleInterfaceInstantiations cenv interfaces m - false + LimitFlags.None // Allow base calls to F# methods | Expr.App((InnerExprPat(ExprValWithPossibleTypeInst(v,vFlags,_,_) as f)),_fty,tyargs,(Expr.Val(baseVal,_,_) :: rest),m) @@ -704,12 +874,12 @@ and CheckExpr (cenv:cenv) (env:env) origExpr (context:PermitByRefExpr) : bool = let memberInfo = Option.get v.MemberInfo if memberInfo.MemberFlags.IsDispatchSlot then errorR(Error(FSComp.SR.tcCannotCallAbstractBaseMember(v.DisplayName),m)) - false + LimitFlags.None else CheckValRef cenv env v m PermitByRefExpr.No CheckValRef cenv env baseVal m PermitByRefExpr.No CheckTypeInstNoByrefs cenv env m tyargs - CheckExprs cenv env rest (mkArgsForAppliedExpr true false rest f) + CheckExprs cenv env rest (mkArgsForAppliedExpr true rest f) // Allow base calls to IL methods | Expr.Op (TOp.ILCall (virt,_,_,_,_,_,_,mref,enclTypeArgs,methTypeArgs,tys),tyargs,(Expr.Val(baseVal,_,_)::rest),m) @@ -741,28 +911,34 @@ and CheckExpr (cenv:cenv) (env:env) origExpr (context:PermitByRefExpr) : bool = // Allow 'typeof' calls as a special case, the only accepted use of System.Void! | TypeOfExpr g ty when isVoidTy g ty -> - false + LimitFlags.None // Allow 'typedefof' calls as a special case, the only accepted use of System.Void! | TypeDefOfExpr g ty when isVoidTy g ty -> - false + LimitFlags.None // Allow '%expr' in quotations | Expr.App(Expr.Val(vref,_,_),_,tinst,[arg],m) when isSpliceOperator g vref && env.quote -> CheckTypeInstPermitAllByrefs cenv env m tinst // it's the splice operator, a byref instantiation is allowed CheckExprNoByrefs cenv env arg - false + LimitFlags.None // Check an application | Expr.App(f,_fty,tyargs,argsl,m) -> - CheckTypeInstNoByrefs cenv env m tyargs CheckExprNoByrefs cenv env f - // If return is a byref, and being used as a return, then all arguments must be usable as byref returns - let isByRefReturnCall = context.PermitOnlyReturnable && isByrefTy g (tyOfExpr g expr) + let hasReceiver = + match f with + | Expr.Val(vref, _, _) when vref.IsInstanceMember && not argsl.IsEmpty -> true + | _ -> false - CheckExprs cenv env argsl (mkArgsForAppliedExpr false isByRefReturnCall argsl f) + let returnTy = tyOfExpr g expr + let contexts = mkArgsForAppliedExpr false argsl f + if hasReceiver then + CheckCallWithReceiver cenv env m returnTy argsl contexts context + else + CheckCall cenv env m returnTy argsl contexts context | Expr.Lambda(_,_ctorThisValOpt,_baseValOpt,argvs,_,m,rty) -> let topValInfo = ValReprInfo ([],[argvs |> List.map (fun _ -> ValReprInfo.unnamedTopArg1)],ValReprInfo.unnamedRetVal) @@ -777,7 +953,7 @@ and CheckExpr (cenv:cenv) (env:env) origExpr (context:PermitByRefExpr) : bool = | Expr.TyChoose(tps,e1,_) -> let env = BindTypars g env tps CheckExprNoByrefs cenv env e1 - false + LimitFlags.None | Expr.Match(_,_,dtree,targets,m,ty) -> CheckTypePermitAllByrefs cenv env m ty // computed byrefs allowed at each branch @@ -788,7 +964,7 @@ and CheckExpr (cenv:cenv) (env:env) origExpr (context:PermitByRefExpr) : bool = BindVals cenv env (valsOfBinds binds) CheckBindings cenv env binds CheckExprNoByrefs cenv env e - false + LimitFlags.None | Expr.StaticOptimization (constraints,e2,e3,m) -> CheckExprNoByrefs cenv env e2 @@ -799,7 +975,7 @@ and CheckExpr (cenv:cenv) (env:env) origExpr (context:PermitByRefExpr) : bool = CheckTypeNoByrefs cenv env m ty2 | TTyconIsStruct(ty1) -> CheckTypeNoByrefs cenv env m ty1) - false + LimitFlags.None | Expr.Link _ -> failwith "Unexpected reclink" @@ -815,7 +991,7 @@ and CheckMethod cenv env baseValOpt (TObjExprMethod(_,attribs,tps,vs,body,m)) = CheckNoReraise cenv None body CheckEscapes cenv true m (match baseValOpt with Some x -> x:: vs | None -> vs) body |> ignore let limit = CheckExprPermitReturnableByRef cenv env body - if limit then + if HasLimitFlag LimitFlags.StackReferringSpanLike limit then errorR(Error(FSComp.SR.chkNoReturnOfLimitedSpan(), body.Range)) and CheckInterfaceImpls cenv env baseValOpt l = @@ -853,18 +1029,30 @@ and CheckExprOp cenv env (op,tyargs,args,m) context expr = let limit1 = CheckExpr cenv env e1 context // result of a try/catch can be a byref if in a position where the overall expression is can be a byref // [(* e2; -- don't check filter body - duplicates logic in 'catch' body *) e3] let limit2 = CheckExpr cenv env e3 context // result of a try/catch can be a byref if in a position where the overall expression is can be a byref - limit1 || limit2 + limit1 ||| limit2 - | TOp.ILCall (_,_,_,_,_,_,_,_,enclTypeArgs,methTypeArgs,tys),_,_ -> + | TOp.ILCall (_,_,_,_,_,_,_,methRef,enclTypeArgs,methTypeArgs,tys),_,_ -> CheckTypeInstNoByrefs cenv env m tyargs CheckTypeInstNoByrefs cenv env m enclTypeArgs CheckTypeInstNoByrefs cenv env m methTypeArgs CheckTypeInstPermitAllByrefs cenv env m tys // permit byref returns - // if return is a byref, and being used as a return, then all arguments must be usable as byref returns - match tys with - | [ty] when context.PermitOnlyReturnable && isByrefLikeTy g m ty -> CheckExprsPermitReturnableByRef cenv env args - | _ -> CheckExprsPermitByRefLike cenv env args + let hasReceiver = + (methRef.CallingConv.IsInstance || methRef.CallingConv.IsInstanceExplicit) && + not args.IsEmpty + + let returnTy = tyOfExpr g expr + match tys with + | [ty] when context.PermitOnlyReturnable && isByrefLikeTy g m ty -> + if hasReceiver then + CheckCallWithReceiverPermitReturnableByRef cenv env m returnTy args + else + CheckCallPermitReturnableByRef cenv env m returnTy args + | _ -> + if hasReceiver then + CheckCallWithReceiverPermitByRefLike cenv env m returnTy args + else + CheckCallPermitByRefLike cenv env m returnTy args | TOp.Tuple tupInfo,_,_ when not (evalTupInfoIsStruct tupInfo) -> match context with @@ -880,6 +1068,10 @@ and CheckExprOp cenv env (op,tyargs,args,m) context expr = CheckExprsNoByRefLike cenv env args | TOp.LValueOp(LAddrOf _,vref),_,_ -> + let limit1 = GetLimitValByRef cenv env m vref.Deref + let limit2 = CheckExprsNoByRefLike cenv env args + let limit = limit1 ||| limit2 + if cenv.reportErrors then if context.Disallow then @@ -887,35 +1079,46 @@ and CheckExprOp cenv env (op,tyargs,args,m) context expr = let returningAddrOfLocal = context.PermitOnlyReturnable && - // The value is a local.... - vref.ValReprInfo.IsNone && - // The value is not an argument... - not (env.argVals.ContainsVal(vref.Deref)) + HasLimitFlag LimitFlags.LocalByRef limit if returningAddrOfLocal then - errorR(Error(FSComp.SR.chkNoByrefAddressOfLocal(vref.DisplayName), m)) + if vref.IsCompilerGenerated then + errorR(Error(FSComp.SR.chkNoByrefAddressOfValueFromExpression(), m)) + else + errorR(Error(FSComp.SR.chkNoByrefAddressOfLocal(vref.DisplayName), m)) - let limit1 = IsLimited cenv env m vref - let limit2 = CheckExprsNoByRefLike cenv env args - limit1 || limit2 + limit | TOp.LValueOp(LByrefSet,vref),_,[arg] -> - let limit1 = IsLimitedType g m (tyOfExpr g arg) && not (env.argVals.ContainsVal(vref.Deref)) - let limit2 = CheckExprPermitByRefLike cenv env arg - if not limit1 && limit2 then + let limit = GetLimitVal cenv env m vref.Deref + let isVrefLimited = not (HasLimitFlag LimitFlags.LocalByRefOfStackReferringSpanLike limit) + let isArgLimited = HasLimitFlag LimitFlags.StackReferringSpanLike (CheckExprPermitByRefLike cenv env arg) + if isVrefLimited && isArgLimited then errorR(Error(FSComp.SR.chkNoWriteToLimitedSpan(vref.DisplayName), m)) - false + LimitFlags.None | TOp.LValueOp(LByrefGet,vref),_,[] -> - let limit1 = isByrefTy g vref.Type && IsLimitedType g m (destByrefTy g vref.Type) && not (env.argVals.ContainsVal(vref.Deref)) - limit1 + let limit = GetLimitVal cenv env m vref.Deref + if HasLimitFlag LimitFlags.LocalByRefOfStackReferringSpanLike limit then + + if cenv.reportErrors && context.PermitOnlyReturnable then + if vref.IsCompilerGenerated then + errorR(Error(FSComp.SR.chkNoSpanLikeValueFromExpression(), m)) + else + errorR(Error(FSComp.SR.chkNoSpanLikeVariable(vref.DisplayName), m)) + + LimitFlags.StackReferringSpanLike + elif HasLimitFlag LimitFlags.LocalByRefOfSpanLike limit then + LimitFlags.SpanLike + else + LimitFlags.None | TOp.LValueOp(LSet _, vref),_,[arg] -> - let limit1 = IsLimited cenv env m vref - let limit2 = CheckExprPermitByRefLike cenv env arg - if not limit1 && limit2 then + let isVrefLimited = not (HasLimitFlag LimitFlags.StackReferringSpanLike (GetLimitVal cenv env m vref.Deref)) + let isArgLimited = HasLimitFlag LimitFlags.StackReferringSpanLike (CheckExprPermitByRefLike cenv env arg) + if isVrefLimited && isArgLimited then errorR(Error(FSComp.SR.chkNoWriteToLimitedSpan(vref.DisplayName), m)) - false + LimitFlags.None | TOp.TupleFieldGet _,_,[arg1] -> CheckTypeInstNoByrefs cenv env m tyargs @@ -927,11 +1130,18 @@ and CheckExprOp cenv env (op,tyargs,args,m) context expr = // Property getters on mutable structs come through here. CheckExprsPermitByRefLike cenv env [arg1] - | TOp.ValFieldSet _rf,_,[arg1;arg2] -> + | TOp.ValFieldSet rf,_,[arg1;arg2] -> CheckTypeInstNoByrefs cenv env m tyargs // See mkRecdFieldSetViaExprAddr -- byref arg1 when #args=2 // Field setters on mutable structs come through here - CheckExprsPermitByRefLike cenv env [arg1; arg2] + let limit1 = CheckExprPermitByRefLike cenv env arg1 + let limit2 = CheckExprPermitByRefLike cenv env arg2 + + let isLhsLimited = not (HasLimitFlag LimitFlags.LocalByRefOfStackReferringSpanLike limit1) + let isRhsLimited = HasLimitFlag LimitFlags.StackReferringSpanLike limit2 + if isLhsLimited && isRhsLimited then + errorR(Error(FSComp.SR.chkNoWriteToLimitedSpan(rf.FieldName), m)) + LimitFlags.None | TOp.Coerce,[tgty;srcty],[x] -> if TypeRelations.TypeDefinitelySubsumesTypeNoCoercion 0 g cenv.amap m tgty srcty then @@ -939,11 +1149,11 @@ and CheckExprOp cenv env (op,tyargs,args,m) context expr = else CheckTypeInstNoByrefs cenv env m tyargs CheckExprNoByrefs cenv env x - false + LimitFlags.None | TOp.Reraise,[_ty1],[] -> CheckTypeInstNoByrefs cenv env m tyargs - false + LimitFlags.None // Check get of static field | TOp.ValFieldGetAddr (rfref, _readonly),tyargs,[] -> @@ -952,7 +1162,7 @@ and CheckExprOp cenv env (op,tyargs,args,m) context expr = errorR(Error(FSComp.SR.chkNoAddressStaticFieldAtThisPoint(rfref.FieldName), m)) CheckTypeInstNoByrefs cenv env m tyargs - false + LimitFlags.None // Check get of instance field | TOp.ValFieldGetAddr (rfref, _readonly),tyargs,[obj] -> @@ -1020,7 +1230,7 @@ and CheckExprOp cenv env (op,tyargs,args,m) context expr = if context.Disallow && cenv.reportErrors && isByrefLikeTy g m (tyOfExpr g expr) then errorR(Error(FSComp.SR.chkNoAddressFieldAtThisPoint(fspec.Name), m)) - false + LimitFlags.None | [ I_ldflda (fspec) ], [obj] -> if context.Disallow && cenv.reportErrors && isByrefLikeTy g m (tyOfExpr g expr) then @@ -1034,7 +1244,7 @@ and CheckExprOp cenv env (op,tyargs,args,m) context expr = errorR(Error(FSComp.SR.chkNoAddressOfArrayElementAtThisPoint(), m)) // permit byref for lhs lvalue let limit = CheckExprPermitByRefLike cenv env lhsArray - CheckExprsNoByRefLike cenv env indices |> ignoreLimit + CheckExprsNoByRefLike cenv env indices |> ignore limit | [ AI_conv _ ],_ -> @@ -1047,7 +1257,11 @@ and CheckExprOp cenv env (op,tyargs,args,m) context expr = | TOp.TraitCall _,_,_ -> CheckTypeInstNoByrefs cenv env m tyargs // allow args to be byref here - CheckExprsPermitByRefLike cenv env args + CheckExprsPermitByRefLike cenv env args + + | TOp.Recd(_, _), _, _ -> + CheckTypeInstNoByrefs cenv env m tyargs + CheckExprsPermitByRefLike cenv env args | _ -> CheckTypeInstNoByrefs cenv env m tyargs @@ -1099,13 +1313,11 @@ and CheckLambdas isTop (memInfo: ValMemberInfo option) cenv env inlined topValIn CheckNoReraise cenv freesOpt body // Check the body of the lambda - let limit = - if isTop && not g.compilingFslib && isByrefLikeTy g m bodyty then - // allow byref to occur as return position for byref-typed top level function or method - CheckExprPermitReturnableByRef cenv env body - else - CheckExprNoByrefs cenv env body - false + if isTop && not g.compilingFslib && isByrefLikeTy g m bodyty then + // allow byref to occur as return position for byref-typed top level function or method + CheckExprPermitReturnableByRef cenv env body |> ignore + else + CheckExprNoByrefs cenv env body // Check byref return types if cenv.reportErrors then @@ -1118,14 +1330,11 @@ and CheckLambdas isTop (memInfo: ValMemberInfo option) cenv env inlined topValIn CheckForByrefType cenv env (destByrefTy g bodyty) (fun () -> errorR(Error(FSComp.SR.chkReturnTypeNoByref(), m))) - if limit then - errorR(Error(FSComp.SR.chkNoReturnOfLimitedSpan(), m)) - for tp in tps do if tp.Constraints |> List.sumBy (function TyparConstraint.CoercesTo(ty,_) when isClassTy g ty -> 1 | _ -> 0) > 1 then errorR(Error(FSComp.SR.chkTyparMultipleClassConstraints(), m)) - false + LimitFlags.None // This path is for expression bindings that are not actually lambdas | _ -> @@ -1137,39 +1346,43 @@ and CheckLambdas isTop (memInfo: ValMemberInfo option) cenv env inlined topValIn CheckExprPermitByRefLike cenv env e else CheckExprNoByrefs cenv env e - false + LimitFlags.None if alwaysCheckNoReraise then CheckNoReraise cenv None e limit -and CheckExprs cenv env exprs contexts : bool = +and CheckExprs cenv env exprs contexts : LimitFlags = let contexts = Array.ofList contexts let argArity i = if i < contexts.Length then contexts.[i] else PermitByRefExpr.No - let limits = exprs |> List.mapi (fun i exp -> CheckExpr cenv env exp (argArity i)) - limits |> List.existsTrue + exprs + |> List.mapi (fun i exp -> CheckExpr cenv env exp (argArity i)) + |> List.fold (|||) LimitFlags.None -and CheckExprsNoByRefLike cenv env exprs : bool = +and CheckExprsNoByRefLike cenv env exprs : LimitFlags = exprs |> List.iter (CheckExprNoByrefs cenv env) - false + LimitFlags.None and CheckExprsPermitByRefLike cenv env exprs = - let limits = exprs |> List.map (CheckExprPermitByRefLike cenv env) - limits |> List.existsTrue + exprs + |> List.map (CheckExprPermitByRefLike cenv env) + |> List.fold (|||) LimitFlags.None -and CheckExprsPermitReturnableByRef cenv env exprs : bool = - let limits = exprs |> List.map (CheckExprPermitReturnableByRef cenv env) - limits |> List.existsTrue +and CheckExprsPermitReturnableByRef cenv env exprs : LimitFlags = + exprs + |> List.map (CheckExprPermitReturnableByRef cenv env) + |> List.fold (|||) LimitFlags.None -and CheckExprPermitByRefLike cenv env expr = +and CheckExprPermitByRefLike cenv env expr : LimitFlags = CheckExpr cenv env expr PermitByRefExpr.Yes -and CheckExprPermitReturnableByRef cenv env expr : bool = +and CheckExprPermitReturnableByRef cenv env expr : LimitFlags = CheckExpr cenv env expr PermitByRefExpr.YesReturnable and CheckDecisionTreeTargets cenv env targets context = - let limits = targets |> Array.map (CheckDecisionTreeTarget cenv env context) - limits |> Array.existsTrue + targets + |> Array.map (CheckDecisionTreeTarget cenv env context) + |> Array.fold (|||) LimitFlags.None and CheckDecisionTreeTarget cenv env context (TTarget(vs,e,_)) = BindVals cenv env vs @@ -1179,15 +1392,15 @@ and CheckDecisionTreeTarget cenv env context (TTarget(vs,e,_)) = and CheckDecisionTree cenv env x = match x with | TDSuccess (es,_) -> - CheckExprsNoByRefLike cenv env es |> ignoreLimit + CheckExprsNoByRefLike cenv env es |> ignore | TDBind(bind,rest) -> - CheckBinding cenv env false bind |> ignoreLimit + CheckBinding cenv env false bind |> ignore CheckDecisionTree cenv env rest | TDSwitch (e,cases,dflt,m) -> CheckDecisionTreeSwitch cenv env (e,cases,dflt,m) and CheckDecisionTreeSwitch cenv env (e,cases,dflt,m) = - CheckExprPermitByRefLike cenv env e |> ignoreLimit // can be byref for struct union switch + CheckExprPermitByRefLike cenv env e |> ignore// can be byref for struct union switch cases |> List.iter (fun (TCase(discrim,e)) -> CheckDecisionTreeTest cenv env m discrim; CheckDecisionTree cenv env e) dflt |> Option.iter (CheckDecisionTree cenv env) @@ -1295,7 +1508,7 @@ and AdjustAccess isHidden (cpath: unit -> CompilationPath) access = else access -and CheckBinding cenv env alwaysCheckNoReraise (TBind(v,bindRhs,_) as bind) : bool = +and CheckBinding cenv env alwaysCheckNoReraise (TBind(v,bindRhs,_) as bind) : LimitFlags = let g = cenv.g let isTop = Option.isSome bind.Var.ValReprInfo //printfn "visiting %s..." v.DisplayName @@ -1396,7 +1609,7 @@ and CheckBinding cenv env alwaysCheckNoReraise (TBind(v,bindRhs,_) as bind) : bo CheckLambdas isTop v.MemberInfo cenv env v.MustInline topValInfo alwaysCheckNoReraise bindRhs v.Range v.Type and CheckBindings cenv env xs = - xs |> List.iter (CheckBinding cenv env false >> ignoreLimit) + xs |> List.iter (CheckBinding cenv env false >> ignore) // Top binds introduce expression, check they are reraise free. let CheckModuleBinding cenv env (TBind(v,e,_) as bind) = @@ -1524,7 +1737,7 @@ let CheckModuleBinding cenv env (TBind(v,e,_) as bind) = with e -> errorRecovery e v.Range end - CheckBinding cenv env true bind |> ignoreLimit + CheckBinding cenv env true bind |> ignore let CheckModuleBindings cenv env binds = binds |> List.iter (CheckModuleBinding cenv env) @@ -1546,7 +1759,7 @@ let CheckRecdField isUnion cenv env (tycon:Tycon) (rfield:RecdField) = if TyconRefHasAttribute g m g.attrib_IsByRefLikeAttribute tcref then // Permit Span fields in IsByRefLike types - CheckTypePermitOuterSpanLike cenv env m rfield.FormalType + CheckTypePermitSpanLike cenv env m rfield.FormalType if cenv.reportErrors then CheckForByrefType cenv env rfield.FormalType (fun () -> errorR(Error(FSComp.SR.chkCantStoreByrefValue(), tycon.Range))) else @@ -1786,8 +1999,8 @@ let CheckEntityDefn cenv env (tycon:Entity) = let env = BindTypars g env tps for argtys in argtysl do for (argty, _) in argtys do - CheckTypePermitOuterByRefLike cenv env m argty - CheckTypePermitOuterByRefLike cenv env m rty + CheckTypePermitAllByrefs cenv env m argty + CheckTypePermitAllByrefs cenv env m rty | None -> () @@ -1909,7 +2122,7 @@ and CheckModuleSpec cenv env x = let env = { env with reflect = env.reflect || HasFSharpAttribute cenv.g cenv.g.attrib_ReflectedDefinitionAttribute mspec.Attribs } CheckDefnInModule cenv env rhs -let CheckTopImpl (g,amap,reportErrors,infoReader,internalsVisibleToPaths,viewCcu,denv ,mexpr,extraAttribs,(isLastCompiland:bool*bool)) = +let CheckTopImpl (g,amap,reportErrors,infoReader,internalsVisibleToPaths,viewCcu,denv ,mexpr,extraAttribs,(isLastCompiland:bool*bool),isInternalTestSpanStackReferring) = let cenv = { g =g reportErrors=reportErrors @@ -1922,7 +2135,8 @@ let CheckTopImpl (g,amap,reportErrors,infoReader,internalsVisibleToPaths,viewCcu amap=amap denv=denv viewCcu= viewCcu - isLastCompiland=isLastCompiland + isLastCompiland=isLastCompiland + isInternalTestSpanStackReferring = isInternalTestSpanStackReferring entryPointGiven=false} // Certain type equality checks go faster if these TyconRefs are pre-resolved. diff --git a/src/fsharp/PostInferenceChecks.fsi b/src/fsharp/PostInferenceChecks.fsi index d918df258a..970c143155 100644 --- a/src/fsharp/PostInferenceChecks.fsi +++ b/src/fsharp/PostInferenceChecks.fsi @@ -11,4 +11,4 @@ open Microsoft.FSharp.Compiler.Tastops open Microsoft.FSharp.Compiler.TcGlobals val testFlagMemberBody : bool ref -val CheckTopImpl : TcGlobals * ImportMap * bool * InfoReader * CompilationPath list * CcuThunk * DisplayEnv * ModuleOrNamespaceExprWithSig * Attribs * (bool * bool) -> bool +val CheckTopImpl : TcGlobals * ImportMap * bool * InfoReader * CompilationPath list * CcuThunk * DisplayEnv * ModuleOrNamespaceExprWithSig * Attribs * (bool * bool) * isInternalTestSpanStackReferring: bool -> bool diff --git a/src/fsharp/TastOps.fs b/src/fsharp/TastOps.fs index 16acb26a28..d1e8705297 100644 --- a/src/fsharp/TastOps.fs +++ b/src/fsharp/TastOps.fs @@ -2956,9 +2956,17 @@ let isByrefLikeTyconRef (g: TcGlobals) m (tcref: TyconRef) = tcref.SetIsByRefLike res res +let isSpanLikeTyconRef g m tcref = + isByrefLikeTyconRef g m tcref && + not (isByrefTyconRef g tcref) + let isByrefLikeTy g m ty = ty |> stripTyEqns g |> (function TType_app(tcref, _) -> isByrefLikeTyconRef g m tcref | _ -> false) +let isSpanLikeTy g m ty = + isByrefLikeTy g m ty && + not (isByrefTy g ty) + //------------------------------------------------------------------------- // List and reference types... //------------------------------------------------------------------------- diff --git a/src/fsharp/TastOps.fsi b/src/fsharp/TastOps.fsi index 6bc9a53b2e..d2a532c37a 100755 --- a/src/fsharp/TastOps.fsi +++ b/src/fsharp/TastOps.fsi @@ -1451,8 +1451,12 @@ val destNativePtrTy : TcGlobals -> TType -> TType val isByrefTyconRef : TcGlobals -> TyconRef -> bool val isByrefLikeTyconRef : TcGlobals -> range -> TyconRef -> bool +val isSpanLikeTyconRef : TcGlobals -> range -> TyconRef -> bool val isByrefLikeTy : TcGlobals -> range -> TType -> bool +/// Check if the type is a byref-like but not a byref. +val isSpanLikeTy : TcGlobals -> range -> TType -> bool + //------------------------------------------------------------------------- // Tuple constructors/destructors //------------------------------------------------------------------------- diff --git a/src/fsharp/TypeChecker.fs b/src/fsharp/TypeChecker.fs index a8191d5683..782b2e8154 100755 --- a/src/fsharp/TypeChecker.fs +++ b/src/fsharp/TypeChecker.fs @@ -507,10 +507,11 @@ type cenv = /// The set of active conditional defines conditionalDefines: string list + isInternalTestSpanStackReferring: bool } /// Create a new compilation environment - static member Create (g, isScript, niceNameGen, amap, topCcu, isSig, haveSig, conditionalDefines, tcSink, tcVal) = + static member Create (g, isScript, niceNameGen, amap, topCcu, isSig, haveSig, conditionalDefines, tcSink, tcVal, isInternalTestSpanStackReferring) = let infoReader = new InfoReader(g, amap) let instantiationGenerator m tpsorig = ConstraintSolver.FreshenTypars m tpsorig let nameResolver = new NameResolver(g, amap, infoReader, instantiationGenerator) @@ -530,7 +531,8 @@ type cenv = isSig = isSig haveSig = haveSig compilingCanonicalFslibModuleType = (isSig || not haveSig) && g.compilingFslib - conditionalDefines = conditionalDefines } + conditionalDefines = conditionalDefines + isInternalTestSpanStackReferring = isInternalTestSpanStackReferring } override __.ToString() = "cenv(...)" @@ -17262,13 +17264,13 @@ let CheckModuleSignature g cenv m denvAtEnd rootSigOpt implFileTypePriorToSig im /// Typecheck, then close the inference scope and then check the file meets its signature (if any) let TypeCheckOneImplFile // checkForErrors: A function to help us stop reporting cascading errors - (g, niceNameGen, amap, topCcu, checkForErrors, conditionalDefines, tcSink) + (g, niceNameGen, amap, topCcu, checkForErrors, conditionalDefines, tcSink, isInternalTestSpanStackReferring) env (rootSigOpt : ModuleOrNamespaceType option) (ParsedImplFileInput(_, isScript, qualNameOfFile, scopedPragmas, _, implFileFrags, isLastCompiland)) = eventually { - let cenv = cenv.Create (g, isScript, niceNameGen, amap, topCcu, false, Option.isSome rootSigOpt, conditionalDefines, tcSink, (LightweightTcValForUsingInBuildMethodCall g)) + let cenv = cenv.Create (g, isScript, niceNameGen, amap, topCcu, false, Option.isSome rootSigOpt, conditionalDefines, tcSink, (LightweightTcValForUsingInBuildMethodCall g), isInternalTestSpanStackReferring) let envinner, mtypeAcc = MakeInitialEnv env @@ -17332,7 +17334,7 @@ let TypeCheckOneImplFile conditionallySuppressErrorReporting (checkForErrors()) (fun () -> try let reportErrors = not (checkForErrors()) - PostTypeCheckSemanticChecks.CheckTopImpl (g, cenv.amap, reportErrors, cenv.infoReader, env.eInternalsVisibleCompPaths, cenv.topCcu, envAtEnd.DisplayEnv, implFileExprAfterSig, extraAttribs, isLastCompiland) + PostTypeCheckSemanticChecks.CheckTopImpl (g, cenv.amap, reportErrors, cenv.infoReader, env.eInternalsVisibleCompPaths, cenv.topCcu, envAtEnd.DisplayEnv, implFileExprAfterSig, extraAttribs, isLastCompiland, isInternalTestSpanStackReferring) with e -> errorRecovery e m false) @@ -17360,9 +17362,9 @@ let TypeCheckOneImplFile /// Check an entire signature file -let TypeCheckOneSigFile (g, niceNameGen, amap, topCcu, checkForErrors, conditionalDefines, tcSink) tcEnv (ParsedSigFileInput(_, qualNameOfFile, _, _, sigFileFrags)) = +let TypeCheckOneSigFile (g, niceNameGen, amap, topCcu, checkForErrors, conditionalDefines, tcSink, isInternalTestSpanStackReferring) tcEnv (ParsedSigFileInput(_, qualNameOfFile, _, _, sigFileFrags)) = eventually { - let cenv = cenv.Create (g, false, niceNameGen, amap, topCcu, true, false, conditionalDefines, tcSink, (LightweightTcValForUsingInBuildMethodCall g)) + let cenv = cenv.Create (g, false, niceNameGen, amap, topCcu, true, false, conditionalDefines, tcSink, (LightweightTcValForUsingInBuildMethodCall g), isInternalTestSpanStackReferring) let envinner, mtypeAcc = MakeInitialEnv tcEnv let specs = [ for x in sigFileFrags -> SynModuleSigDecl.NamespaceFragment(x) ] diff --git a/src/fsharp/TypeChecker.fsi b/src/fsharp/TypeChecker.fsi index b49d6574b7..3f84e1992f 100644 --- a/src/fsharp/TypeChecker.fsi +++ b/src/fsharp/TypeChecker.fsi @@ -39,14 +39,14 @@ val EmptyTopAttrs : TopAttribs val CombineTopAttrs : TopAttribs -> TopAttribs -> TopAttribs val TypeCheckOneImplFile : - TcGlobals * NiceNameGenerator * ImportMap * CcuThunk * (unit -> bool) * ConditionalDefines * NameResolution.TcResultsSink + TcGlobals * NiceNameGenerator * ImportMap * CcuThunk * (unit -> bool) * ConditionalDefines * NameResolution.TcResultsSink * bool -> TcEnv -> Tast.ModuleOrNamespaceType option -> ParsedImplFileInput -> Eventually val TypeCheckOneSigFile : - TcGlobals * NiceNameGenerator * ImportMap * CcuThunk * (unit -> bool) * ConditionalDefines * NameResolution.TcResultsSink + TcGlobals * NiceNameGenerator * ImportMap * CcuThunk * (unit -> bool) * ConditionalDefines * NameResolution.TcResultsSink * bool -> TcEnv -> ParsedSigFileInput -> Eventually diff --git a/src/fsharp/xlf/FSComp.txt.cs.xlf b/src/fsharp/xlf/FSComp.txt.cs.xlf index ceb6d658d5..30bc38c9cb 100644 --- a/src/fsharp/xlf/FSComp.txt.cs.xlf +++ b/src/fsharp/xlf/FSComp.txt.cs.xlf @@ -6517,11 +6517,6 @@ Při sestavování výrazu fixed se mezi odkazy nepovedlo najít metodu System.Runtime.CompilerServices.OffsetToStringData. - - The address of the variable '{0}' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. - Adresa proměnné {0} se na tomto místě nedá použít. Metoda nebo funkce možná nebude vracet adresu této místní hodnoty. - - {0} is an active pattern and cannot be treated as a discriminated union case with named fields. {0} je aktivní vzorek a není možné s ním zacházet jako s rozlišeným případem typu union s pojmenovanými poli. @@ -7018,8 +7013,8 @@ - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. @@ -7042,6 +7037,26 @@ Struct members cannot return the address of fields of the struct by reference + + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + + + + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.de.xlf b/src/fsharp/xlf/FSComp.txt.de.xlf index 957653a606..758c786a0c 100644 --- a/src/fsharp/xlf/FSComp.txt.de.xlf +++ b/src/fsharp/xlf/FSComp.txt.de.xlf @@ -6517,11 +6517,6 @@ Die Methode "System.Runtime.CompilerServices.OffsetToStringData" wurde beim Erstellen des fixed-Ausdrucks in den Verweisen nicht gefunden. - - The address of the variable '{0}' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. - Die Adresse der Variablen "{0}" kann an dieser Stelle nicht verwendet werden. Eine Methode oder Funktion gibt ggf. nicht die Adresse dieses lokalen Werts zurück. - - {0} is an active pattern and cannot be treated as a discriminated union case with named fields. {0} ist ein aktives Muster und kann nicht als ein diskriminierter Union-Fall mit benannten Feldern behandelt werden. @@ -7018,8 +7013,8 @@ - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. @@ -7042,6 +7037,26 @@ Struct members cannot return the address of fields of the struct by reference + + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + + + + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.en.xlf b/src/fsharp/xlf/FSComp.txt.en.xlf index fb84a93857..65496ff1e9 100644 --- a/src/fsharp/xlf/FSComp.txt.en.xlf +++ b/src/fsharp/xlf/FSComp.txt.en.xlf @@ -6517,11 +6517,6 @@ Could not find method System.Runtime.CompilerServices.OffsetToStringData in references when building 'fixed' expression. - - The address of the variable '{0}' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. - The address of the variable '{0}' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. - - {0} is an active pattern and cannot be treated as a discriminated union case with named fields. {0} is an active pattern and cannot be treated as a discriminated union case with named fields. @@ -7018,8 +7013,8 @@ - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. @@ -7042,6 +7037,26 @@ Struct members cannot return the address of fields of the struct by reference + + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + + + + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.es.xlf b/src/fsharp/xlf/FSComp.txt.es.xlf index 8187e6b689..57c68e299f 100644 --- a/src/fsharp/xlf/FSComp.txt.es.xlf +++ b/src/fsharp/xlf/FSComp.txt.es.xlf @@ -6517,11 +6517,6 @@ No se pudo encontrar el método System.Runtime.CompilerServices.OffsetToStringData en las referencias al generar expresión 'fixed'. - - The address of the variable '{0}' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. - La dirección de la variable '{0}' no se puede usar en este punto. Puede que el método o la función no devuelvan la dirección de este valor local. - - {0} is an active pattern and cannot be treated as a discriminated union case with named fields. {0} es un modelo activo y no se puede tratar como un caso de unión discriminada con campos con nombre. @@ -7018,8 +7013,8 @@ - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. @@ -7042,6 +7037,26 @@ Struct members cannot return the address of fields of the struct by reference + + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + + + + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.fr.xlf b/src/fsharp/xlf/FSComp.txt.fr.xlf index 7596000991..36be3140aa 100644 --- a/src/fsharp/xlf/FSComp.txt.fr.xlf +++ b/src/fsharp/xlf/FSComp.txt.fr.xlf @@ -6517,11 +6517,6 @@ Méthode System.Runtime.CompilerServices.OffsetToStringData introuvable dans les références durant la construction d'une expression 'fixed'. - - The address of the variable '{0}' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. - Impossible d'utiliser l'adresse de la variable '{0}'. Une méthode ou une fonction ne doit pas retourner l'adresse de cette valeur locale. - - {0} is an active pattern and cannot be treated as a discriminated union case with named fields. {0} est un modèle actif. Il ne peut pas être traité comme un cas d'union discriminé avec des champs nommés. @@ -7018,8 +7013,8 @@ - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. @@ -7042,6 +7037,26 @@ Struct members cannot return the address of fields of the struct by reference + + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + + + + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.it.xlf b/src/fsharp/xlf/FSComp.txt.it.xlf index 220d7a72a9..49d952c24c 100644 --- a/src/fsharp/xlf/FSComp.txt.it.xlf +++ b/src/fsharp/xlf/FSComp.txt.it.xlf @@ -6517,11 +6517,6 @@ Il metodo System.Runtime.CompilerServices.OffsetToStringData non è stato trovato nei riferimenti durante la compilazione dell'espressione 'fixed'. - - The address of the variable '{0}' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. - In questo punto non è possibile usare l'indirizzo della variabile '{0}'. Un metodo o una funzione potrebbero non restituire l'indirizzo di questo valore di variabile locale. - - {0} is an active pattern and cannot be treated as a discriminated union case with named fields. {0} è un criterio attivo e non può essere considerato come un case di unione discriminato con campi denominati. @@ -7018,8 +7013,8 @@ - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. @@ -7042,6 +7037,26 @@ Struct members cannot return the address of fields of the struct by reference + + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + + + + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.ja.xlf b/src/fsharp/xlf/FSComp.txt.ja.xlf index 20af7a1608..953a85e3d8 100644 --- a/src/fsharp/xlf/FSComp.txt.ja.xlf +++ b/src/fsharp/xlf/FSComp.txt.ja.xlf @@ -6517,11 +6517,6 @@ 'fixed' 式のビルド時に、参照内でメソッド System.Runtime.CompilerServices.OffsetToStringData が見つかりませんでした。 - - The address of the variable '{0}' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. - 変数 '{0}' のアドレスはこのポイントでは使用できません。メソッドまたは関数がこのローカル値のアドレスを返さない可能性があります。 - - {0} is an active pattern and cannot be treated as a discriminated union case with named fields. {0} はアクティブ パターンで、名前付きフィールドのある判別された共用体ケースとしては扱えません。 @@ -7018,8 +7013,8 @@ - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. @@ -7042,6 +7037,26 @@ Struct members cannot return the address of fields of the struct by reference + + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + + + + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.ko.xlf b/src/fsharp/xlf/FSComp.txt.ko.xlf index 5b84f48e06..09d977ef3e 100644 --- a/src/fsharp/xlf/FSComp.txt.ko.xlf +++ b/src/fsharp/xlf/FSComp.txt.ko.xlf @@ -6517,11 +6517,6 @@ 'fixed' 식을 빌드할 때 참조에서 System.Runtime.CompilerServices.OffsetToStringData 메서드를 찾을 수 없습니다. - - The address of the variable '{0}' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. - 지금은 '{0}' 변수의 주소를 사용할 수 없습니다. 메서드 또는 함수가 이 로컬 값의 주소를 반환할 수 없습니다. - - {0} is an active pattern and cannot be treated as a discriminated union case with named fields. {0}은(는) 활성 패턴이며 명명된 필드가 있는 구분된 공용 구조체 케이스로 처리될 수 없습니다. @@ -7018,8 +7013,8 @@ - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. @@ -7042,6 +7037,26 @@ Struct members cannot return the address of fields of the struct by reference + + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + + + + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.pl.xlf b/src/fsharp/xlf/FSComp.txt.pl.xlf index 7b58742f3e..368b4fd562 100644 --- a/src/fsharp/xlf/FSComp.txt.pl.xlf +++ b/src/fsharp/xlf/FSComp.txt.pl.xlf @@ -6517,11 +6517,6 @@ Nie można odnaleźć metody System.Runtime.CompilerServices.OffsetToStringData w odwołaniach podczas kompilowania wyrażenia „fixed”. - - The address of the variable '{0}' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. - Adres zmiennej „{0}” nie może być użyty w tym punkcie. Metoda lub funkcja może nie zwrócić adresu tej wartości lokalnej. - - {0} is an active pattern and cannot be treated as a discriminated union case with named fields. {0} jest wzorcem aktywnym i nie można go traktować jako przypadku unii rozłącznej z nazwanymi polami. @@ -7018,8 +7013,8 @@ - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. @@ -7042,6 +7037,26 @@ Struct members cannot return the address of fields of the struct by reference + + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + + + + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf index a7f4e1c252..47deec3e2c 100644 --- a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf +++ b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf @@ -6517,11 +6517,6 @@ Não foi possível encontrar o método System.Runtime.CompilerServices.OffsetToStringData nas referências ao compilar a expressão 'fixed'. - - The address of the variable '{0}' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. - O endereço da variável '{0}' não pode ser usado neste momento. Um método ou uma função pode não retornar o endereço deste valor local. - - {0} is an active pattern and cannot be treated as a discriminated union case with named fields. {0} é um padrão ativo e não pode ser tratado como um caso de união discriminada com campos nomeados. @@ -7018,8 +7013,8 @@ - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. @@ -7042,6 +7037,26 @@ Struct members cannot return the address of fields of the struct by reference + + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + + + + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.ru.xlf b/src/fsharp/xlf/FSComp.txt.ru.xlf index d8cbe9424c..eb56a9f260 100644 --- a/src/fsharp/xlf/FSComp.txt.ru.xlf +++ b/src/fsharp/xlf/FSComp.txt.ru.xlf @@ -6517,11 +6517,6 @@ Не удалось найти в ссылках метод System.Runtime.CompilerServices.OffsetToStringData при создании выражения "fixed". - - The address of the variable '{0}' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. - Адрес переменной "{0}" сейчас невозможно использовать. Метод или функция могут не возвратить адрес этого локального значения. - - {0} is an active pattern and cannot be treated as a discriminated union case with named fields. {0} является активным шаблоном и не может обрабатываться как различаемая ветвь объединения с именованными полями. @@ -7018,8 +7013,8 @@ - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. @@ -7042,6 +7037,26 @@ Struct members cannot return the address of fields of the struct by reference + + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + + + + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.tr.xlf b/src/fsharp/xlf/FSComp.txt.tr.xlf index 211cead74d..ece602391d 100644 --- a/src/fsharp/xlf/FSComp.txt.tr.xlf +++ b/src/fsharp/xlf/FSComp.txt.tr.xlf @@ -6517,11 +6517,6 @@ 'fixed' ifadesi derlenirken başvurularda System.Runtime.CompilerServices.OffsetToStringData metodu bulunamadı. - - The address of the variable '{0}' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. - '{0}' değişkeninin adresi bu noktada kullanılamaz. Bir metot veya işlev, bu yerel değerin adresini döndüremez. - - {0} is an active pattern and cannot be treated as a discriminated union case with named fields. {0} etkin bir desen ve adlandırılmış alanlar içeren bir ayırt edici birleşim durumu olarak değerlendirilemez. @@ -7018,8 +7013,8 @@ - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. @@ -7042,6 +7037,26 @@ Struct members cannot return the address of fields of the struct by reference + + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + + + + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf index f61822ca96..682a3f8fd7 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf @@ -6517,11 +6517,6 @@ 生成 "fixed" 表达式时,在引用中找不到方法 System.Runtime.CompilerServices.OffsetToStringData。 - - The address of the variable '{0}' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. - 当前无法使用变量 {0} 的地址。方法或函数可能没有返回该本地值的地址。 - - {0} is an active pattern and cannot be treated as a discriminated union case with named fields. {0} 为活动模式,不能将其作为带命名字段的可区分联合用例。 @@ -7018,8 +7013,8 @@ - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. @@ -7042,6 +7037,26 @@ Struct members cannot return the address of fields of the struct by reference + + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + + + + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf index e6f85883d1..0942ac32f7 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf @@ -6517,11 +6517,6 @@ 建置 'fixed' 運算式時,在參考中找不到方法 System.Runtime.CompilerServices.OffsetToStringData。 - - The address of the variable '{0}' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. - 目前無法使用變數 '{0}' 的位址。方法或函式無法傳回此本機值的位址。 - - {0} is an active pattern and cannot be treated as a discriminated union case with named fields. {0} 是現用模式,無法視為具名欄位的差別聯集。 @@ -7018,8 +7013,8 @@ - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. @@ -7042,6 +7037,26 @@ Struct members cannot return the address of fields of the struct by reference + + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + + + + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + + + + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + + \ No newline at end of file diff --git a/tests/fsharp/core/span/test.bsl b/tests/fsharp/core/span/test.bsl new file mode 100644 index 0000000000..c573f76226 --- /dev/null +++ b/tests/fsharp/core/span/test.bsl @@ -0,0 +1,16 @@ + +test.fsx(303,46,303,86): typecheck error FS3235: The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + +test.fsx(306,13,306,86): typecheck error FS3230: This value can't be assigned because the target 'param1' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + +test.fsx(309,13,309,62): typecheck error FS3230: This value can't be assigned because the target 'param1' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + +test.fsx(348,13,348,57): typecheck error FS3230: This value can't be assigned because the target 'addr' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + +test.fsx(351,13,351,38): typecheck error FS3230: This value can't be assigned because the target 'param1' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + +test.fsx(354,14,354,29): typecheck error FS3209: The address of the variable 'stackReferring3' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test.fsx(376,18,376,19): typecheck error FS3209: The address of the variable 'x' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test.fsx(380,18,380,33): typecheck error FS3228: The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. diff --git a/tests/fsharp/core/span/test.fsx b/tests/fsharp/core/span/test.fsx index b6bbf9bb9f..142847ea3f 100644 --- a/tests/fsharp/core/span/test.fsx +++ b/tests/fsharp/core/span/test.fsx @@ -1,6 +1,9 @@ #r @"..\..\..\..\packages\System.Memory.4.5.0-rc1\lib\netstandard2.0\System.Memory.dll" #r @"..\..\..\..\packages\NETStandard.Library.NETFramework.2.0.0-preview2-25405-01\build\net461\ref\netstandard.dll" +#nowarn "9" +#nowarn "51" + namespace System.Runtime.CompilerServices open System @@ -295,10 +298,10 @@ namespace Tests // this is allowed stackReferringBecauseMutable2 <- m1 &stackReferringBecauseMutable2 stackReferringBecauseMutable1 - // this is allowed +#if NEGATIVE + // this is NOT allowed stackReferringBecauseMutable2 <- m1 ¶m1 stackReferringBecauseMutable1 -#if NEGATIVE // this is NOT allowed param1 <- m1 &stackReferringBecauseMutable2 stackReferringBecauseMutable1 @@ -340,9 +343,9 @@ namespace Tests // this is allowed m2(&stackReferring3) <- stackReferringBecauseMutable2 -#if NEGATIVE2 +#if NEGATIVE // this is NOT allowed - m1(¶m1) <- stackReferringBecauseMutable2 + m2(¶m1) <- stackReferringBecauseMutable2 // this is NOT allowed param1 <- stackReferring3 @@ -380,22 +383,20 @@ namespace Tests #if NOT_YET +#if NEGATIVE + // Disallow this: [] type DisallowedIsReadOnlyStruct = [] val mutable X : int +#endif // Allow this: - [] - type ByRefLikeStructWithSpanField(count1: Span, count2: int) = + [] + type ByRefLikeStructWithSpanField(count1: Span, count2: int) = member x.Count1 = count1 member x.Count2 = count2 - [] - type ByRefLikeStructWithByrefField(count1: Span, count2: int) = - member x.Count1 = count1 - member x.Count2 = count2 #endif - diff --git a/tests/fsharp/core/span/test2.bsl b/tests/fsharp/core/span/test2.bsl new file mode 100644 index 0000000000..bac72ffc78 --- /dev/null +++ b/tests/fsharp/core/span/test2.bsl @@ -0,0 +1,52 @@ + +test2.fsx(79,21,79,35): typecheck error FS0406: The byref-typed variable 'test' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. + +test2.fsx(79,21,79,35): typecheck error FS0406: The byref-typed variable 'test' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. + +test2.fsx(79,31,79,35): typecheck error FS0418: The byref typed value 'test' cannot be used at this point + +test2.fsx(79,21,79,35): typecheck error FS0425: The type of a first-class function cannot contain byrefs + +test2.fsx(79,21,79,35): typecheck error FS0425: The type of a first-class function cannot contain byrefs + +test2.fsx(84,14,84,15): typecheck error FS3209: The address of the variable 'x' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(91,14,91,15): typecheck error FS3209: The address of the variable 'y' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(100,14,100,15): typecheck error FS3209: The address of the variable 'y' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(106,14,106,15): typecheck error FS3209: The address of the variable 'y' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(111,14,111,15): typecheck error FS3209: The address of the variable 'y' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(115,14,115,30): typecheck error FS3228: The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(119,14,119,37): typecheck error FS3228: The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(124,14,124,15): typecheck error FS3209: The address of the variable 'y' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(128,13,128,42): typecheck error FS3237: A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(132,14,132,41): typecheck error FS3228: The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(136,14,136,71): typecheck error FS3228: The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(140,13,140,52): typecheck error FS3237: A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(144,13,144,14): typecheck error FS3236: The Span or IsByRefLike variable 's' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(149,13,149,52): typecheck error FS3237: A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(153,21,153,84): typecheck error FS3235: The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(154,13,154,14): typecheck error FS3236: The Span or IsByRefLike variable 'y' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(158,13,158,83): typecheck error FS3237: A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(163,13,163,14): typecheck error FS3236: The Span or IsByRefLike variable 'y' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(167,14,167,71): typecheck error FS3228: The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(191,43,191,44): typecheck error FS3209: The address of the variable 'x' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(195,14,195,15): typecheck error FS3209: The address of the variable 'y' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. diff --git a/tests/fsharp/core/span/test2.fsx b/tests/fsharp/core/span/test2.fsx new file mode 100644 index 0000000000..aa56f5cd30 --- /dev/null +++ b/tests/fsharp/core/span/test2.fsx @@ -0,0 +1,324 @@ +#r @"..\..\..\..\packages\System.Memory.4.5.0-rc1\lib\netstandard2.0\System.Memory.dll" +#r @"..\..\..\..\packages\NETStandard.Library.NETFramework.2.0.0-preview2-25405-01\build\net461\ref\netstandard.dll" + +#nowarn "9" +#nowarn "51" + +namespace System.Runtime.CompilerServices + + open System + open System.Runtime.CompilerServices + open System.Runtime.InteropServices + [] + [] + type IsReadOnlyAttribute() = + inherit System.Attribute() + + [] + [] + type IsByRefLikeAttribute() = + inherit System.Attribute() + +namespace Tests + open System + open System.Runtime.CompilerServices + open System.Runtime.InteropServices + open FSharp.NativeInterop + + module Tests = + let mutable beef = 1 + + let returning_span (x: byref) = Span.Empty + + let returning_ref (x: byref) = &x + + let returning_ref2 (x: byref) (y: byref) = &x + + let passing_span_returning_span (x: Span) = Span.Empty + + let passing_span_returnin_ref (x: Span) = &x.[0] + + let passing_span2 (x: Span) (y: Span) = () + + let passing_byref_of_span_returning_span (x: byref>) = x + + let passing_inref_of_span_returning_span (x: inref>) = x + + let passing_byref_of_span_returning_byref_of_span (x: byref>) = &x + + let passing_byref_of_span2_returning_byref_of_span (x: byref>) (y: byref>) = &y + + let passing_byref_of_span_and_span_returning_byref_of_span (x: byref>) (y: Span) = + let y = &x + &y + +#if NOT_YET + + [] + type StructRecordRefLike = + { + mutable value: Span + } + + member this.Set(data: Span) = + this.value <- data + + [] + type StructRefLike = + + val mutable value: Span + + new (value) = { value = value } + +#endif + +#if NEGATIVE + + let should_not_work () = + let test = ReadOnlySpan.Empty + let f = fun () -> test + () + + let should_not_work1 () = + let mutable x = 1 + &x + + let should_not_work2 () = + let mutable x = 1 + let mutable x = (let mutable y = &x in &y) + + let y = &returning_ref &x + &y + + let should_not_work3 () = + let mutable x = 1 + let mutable x = + match &x with + | x -> &x + + let y = &returning_ref &x + &y + + let should_not_work4 () = + let mutable x = 1 + let mutable y = &x + y <- 1 + &y + + let should_not_work5 () = + let x = 1 + let y = &x + &y + + let should_not_work6 () = + let mutable x = 1 + &returning_ref &x + + let should_not_work7 () = + let mutable x = 1 + &returning_ref2 &beef &x + + let should_not_work8 () = + let mutable x = 1 + let y = &returning_ref2 &beef &x + &y + + let should_not_work9 () = + let mutable s = Span.Empty + passing_span_returning_span s + + let should_not_work10 () = + let mutable s = Span.Empty + &passing_span_returnin_ref s + + let should_not_work11 () = + let mutable s = Span.Empty + &passing_span_returnin_ref (passing_span_returning_span s) + + let should_not_work12 () = + let mutable s = Span.Empty + passing_byref_of_span_returning_span &s + + let should_not_work13 () = + let mutable s = Span.Empty + s + + let should_not_work14 () = + let mutable s = Span.Empty + let mutable x = &s + passing_byref_of_span_returning_span &x + + let should_not_work15 (data: byref>) = + let mutable stackData = Span.Empty + let y = passing_byref_of_span2_returning_byref_of_span &stackData &data + y + + let should_not_work16 (data: byref>) = + let mutable stackData = Span.Empty + passing_byref_of_span_and_span_returning_byref_of_span &stackData data + + let should_not_work17 (data: byref>) = + let mutable stackData = Span.Empty + let y = &passing_byref_of_span_and_span_returning_byref_of_span &stackData data + y + + let should_not_work18 () = + let mutable s = Span.Empty + &passing_span_returnin_ref (passing_span_returning_span s) + +#if NOT_YET + + let should_not_work19 (data: byref) = + let mutable stackData = Span.Empty + data.value <- stackData + + let should_not_work20 () = + let mutable data = Span.Empty + let beef = { value = data } + beef + + let should_not_work21 () = + let mutable data = Span.Empty + let beef = StructRefLike(data) + beef + + let should_not_work22 (data: byref) = + let mutable x = Span.Empty + data.Set(x) + +#endif + + let should_not_work33 (x: int) = &x + + let should_not_work34 (x: int) = + let y = &x + &y + +#endif + + let should_work1 () = + Span.Empty + + let should_work3 () = + let mutable beef = 1 + let y = &returning_ref &beef + y + + let should_work2 () = + let x = Span.Empty + x + + let should_work4 () = + &returning_ref2 &beef &beef + + let should_work5 () = + let mutable x = 1 + returning_ref2 &x &x + + let should_work6 () = + let mutable x = 1 + returning_span &x + + let should_work7 () = + let mutable x = 1 + let y = returning_span &x + y + + let should_work8 () = + let s = Span.Empty + passing_span_returning_span s + + let should_work9 () = + let mutable s = Span.Empty + passing_span_returnin_ref s + + let should_work10 () = + let mutable s = Span.Empty + passing_span_returnin_ref (passing_span_returning_span s) + + let should_work11 () = + let s = Span.Empty + &passing_span_returnin_ref (passing_span_returning_span s) + + let should_work12 () = + let s = Span.Empty + passing_inref_of_span_returning_span &s + + let should_work13 () = + let s = Span.Empty + let mutable x = &s + passing_inref_of_span_returning_span &x + + let should_work14 (s: byref>) = + passing_byref_of_span_returning_byref_of_span &s + + let should_work15 (s: byref>) = + let x = &s + let y = &passing_byref_of_span_returning_byref_of_span &x + &y + + type TestDelegate = delegate of byref> -> Span + + let should_work16 (s: byref>) = + let f = TestDelegate(fun _ -> Span.Empty) + f.Invoke(&s) + + type IBeef = + + abstract Test : byref> -> byref> + + let should_work17 () = + { new IBeef with + member __.Test s = &s + } + + let should_work18 (data: byref>) = + let y = passing_byref_of_span_and_span_returning_byref_of_span &data data + y + + let should_work19 (data: byref>) = + &passing_byref_of_span_and_span_returning_byref_of_span &data data + +#if NOT_YET + + let should_work20 () = + let data = Span.Empty + let beef = StructRefLike(data) + beef + + let should_work21 () = + let data = Span.Empty + let beef = { value = data } + beef + + let should_work22 (data: byref) = + let s = Span.Empty + data.value <- s + + let should_work23 (data: byref) = + let x = Span.Empty + data.Set(x) + + let should_work24 () = + let mutable s = Span.Empty + let mutable srl = StructRefLike() + let addr = &srl + addr.value <- s + + let should_work25 () = + let mutable s = Span.Empty + let mutable srl = StructRefLike() + srl.value <- s + + let should_work26 (data: byref) = + let mutable s = Span.Empty + let mutable srl = data + srl.value <- s + +#endif + + let should_work27 (s: Span) = &s.[0] + + let should_work28 (s: Span) = + let y = &s.[0] + &y \ No newline at end of file diff --git a/tests/fsharp/single-test.fs b/tests/fsharp/single-test.fs index a2c401d6a4..1b1fad560e 100644 --- a/tests/fsharp/single-test.fs +++ b/tests/fsharp/single-test.fs @@ -183,6 +183,8 @@ let singleTestBuildAndRun dir p = let singleNegTest (cfg: TestConfig) testname = + let cfg = { cfg with fsc_flags = sprintf "%s --define:NEGATIVE" cfg.fsc_flags } + // REM == Set baseline (fsc vs vs, in case the vs baseline exists) let VSBSLFILE = if (sprintf "%s.vsbsl" testname) |> (fileExists cfg) diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index 29e276fe9d..853dc7bee1 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -208,30 +208,33 @@ module CoreTests = let cfg = testConfig "core/span" + let cfg = { cfg with fsc_flags = sprintf "%s --test:StackSpan" cfg.fsc_flags} + begin use testOkFile = fileguard cfg "test.ok" fsc cfg "%s -o:test.exe -g" cfg.fsc_flags ["test.fsx"] + singleNegTest cfg "test" + // Execution is disabled until we can be sure .NET 4.7.2 is on the machine //exec cfg ("." ++ "test.exe") "" //testOkFile.CheckExists() end - // Execution is disabled until we can be sure .NET 4.7.2 is on the machine - //begin - // use testOkFile = fileguard cfg "test.ok" - // fsi cfg "" ["test.fsx"] - // testOkFile.CheckExists() - //end - - // Execution is disabled until we can be sure .NET 4.7.2 is on the machine - //begin - // use testOkFile = fileguard cfg "test.ok" - // fsiAnyCpu cfg "" ["test.fsx"] - // testOkFile.CheckExists() - //end + begin + use testOkFile = fileguard cfg "test2.ok" + + fsc cfg "%s -o:test2.exe -g" cfg.fsc_flags ["test2.fsx"] + + singleNegTest cfg "test2" + + // Execution is disabled until we can be sure .NET 4.7.2 is on the machine + //exec cfg ("." ++ "test.exe") "" + + //testOkFile.CheckExists() + end [] let asyncStackTraces () = diff --git a/tests/fsharp/typecheck/sigs/neg63.bsl b/tests/fsharp/typecheck/sigs/neg63.bsl index b5df880f02..8898a01725 100644 --- a/tests/fsharp/typecheck/sigs/neg63.bsl +++ b/tests/fsharp/typecheck/sigs/neg63.bsl @@ -11,4 +11,4 @@ neg63.fs(14,8,14,9): typecheck error FS3155: A quotation may not involve an assi neg63.fs(18,6,18,7): typecheck error FS3209: The address of the variable 'x' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. -neg63.fs(26,6,26,10): typecheck error FS3228: The address of the variable 'addr' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. +neg63.fs(26,6,26,10): typecheck error FS3209: The address of the variable 'addr' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. diff --git a/tests/fsharp/typecheck/sigs/neg_byref_7.bsl b/tests/fsharp/typecheck/sigs/neg_byref_7.bsl index ef21f974eb..11f25ecb6d 100644 --- a/tests/fsharp/typecheck/sigs/neg_byref_7.bsl +++ b/tests/fsharp/typecheck/sigs/neg_byref_7.bsl @@ -18,5 +18,3 @@ neg_byref_7.fs(2,47,2,53): typecheck error FS0412: A type instantiation involves neg_byref_7.fs(2,47,2,53): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. neg_byref_7.fs(2,47,2,53): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. - -neg_byref_7.fs(4,41,4,42): typecheck error FS3228: The address of the variable 'y' or a related expression cannot be used at this point. The address may not be passed to a call that returns an address. This is to ensure the address of the local value does not escape its scope. From cc8b91c0017005ca93af1a72e6343671e455bf44 Mon Sep 17 00:00:00 2001 From: Phillip Carter Date: Wed, 20 Jun 2018 11:20:41 -0700 Subject: [PATCH 054/150] Clean up IntelliSense perf UI and flow options for IntelliSense (#5211) * Clean up IntelliSense perf UI and flow options for IntelliSense * Tooltips, bindings, and removing redundant code * Change tooltip to include guidance and un-bind project options --- .../CodeFix/AddOpenCodeFixProvider.fs | 2 +- .../ImplementInterfaceCodeFixProvider.fs | 2 +- .../CodeFix/RenameUnusedValue.fs | 2 +- .../Commands/HelpContextService.fs | 2 +- .../Completion/CompletionProvider.fs | 2 +- .../SimplifyNameDiagnosticAnalyzer.fs | 2 +- .../Diagnostics/UnusedDeclarationsAnalyzer.fs | 2 +- .../UnusedOpensDiagnosticAnalyzer.fs | 2 +- .../DocumentHighlightsService.fs | 2 +- .../InlineRename/InlineRenameService.fs | 2 +- .../FSharpCheckerExtensions.fs | 6 +- .../LanguageService/SymbolHelpers.fs | 4 +- .../Navigation/FindUsagesService.fs | 2 +- .../Navigation/GoToDefinition.fs | 6 +- .../FSharp.Editor/Options/EditorOptions.fs | 4 ++ .../QuickInfo/QuickInfoProvider.fs | 2 +- .../FSharp.UIResources.csproj | 13 +++++ ...nguageServicePerformanceOptionControl.xaml | 48 +++++++++++++--- .../FSharp.UIResources/Strings.Designer.cs | 56 ++++++++++++++++++- .../src/FSharp.UIResources/Strings.resx | 20 ++++++- .../src/FSharp.UIResources/xlf/Strings.cs.xlf | 34 ++++++++++- .../src/FSharp.UIResources/xlf/Strings.de.xlf | 34 ++++++++++- .../src/FSharp.UIResources/xlf/Strings.en.xlf | 34 ++++++++++- .../src/FSharp.UIResources/xlf/Strings.es.xlf | 34 ++++++++++- .../src/FSharp.UIResources/xlf/Strings.fr.xlf | 34 ++++++++++- .../src/FSharp.UIResources/xlf/Strings.it.xlf | 34 ++++++++++- .../src/FSharp.UIResources/xlf/Strings.ja.xlf | 34 ++++++++++- .../src/FSharp.UIResources/xlf/Strings.ko.xlf | 34 ++++++++++- .../src/FSharp.UIResources/xlf/Strings.pl.xlf | 34 ++++++++++- .../FSharp.UIResources/xlf/Strings.pt-BR.xlf | 34 ++++++++++- .../src/FSharp.UIResources/xlf/Strings.ru.xlf | 34 ++++++++++- .../src/FSharp.UIResources/xlf/Strings.tr.xlf | 34 ++++++++++- .../xlf/Strings.zh-Hans.xlf | 34 ++++++++++- .../xlf/Strings.zh-Hant.xlf | 34 ++++++++++- 34 files changed, 600 insertions(+), 57 deletions(-) diff --git a/vsintegration/src/FSharp.Editor/CodeFix/AddOpenCodeFixProvider.fs b/vsintegration/src/FSharp.Editor/CodeFix/AddOpenCodeFixProvider.fs index b90e44f91e..2e9381e5fb 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/AddOpenCodeFixProvider.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/AddOpenCodeFixProvider.fs @@ -98,7 +98,7 @@ type internal FSharpAddOpenCodeFixProvider let document = context.Document let! parsingOptions, projectOptions = projectInfoManager.TryGetOptionsForEditingDocumentOrProject document let! sourceText = context.Document.GetTextAsync(context.CancellationToken) - let! _, parsedInput, checkResults = checker.ParseAndCheckDocument(document, projectOptions, allowStaleResults = true, sourceText = sourceText, userOpName = userOpName) + let! _, parsedInput, checkResults = checker.ParseAndCheckDocument(document, projectOptions, allowStaleResults = Settings.LanguageServicePerformance.AllowStaleCompletionResults, sourceText = sourceText, userOpName = userOpName) let line = sourceText.Lines.GetLineFromPosition(context.Span.End) let linePos = sourceText.Lines.GetLinePosition(context.Span.End) let defines = CompilerEnvironment.GetCompilationDefinesForEditing parsingOptions diff --git a/vsintegration/src/FSharp.Editor/CodeFix/ImplementInterfaceCodeFixProvider.fs b/vsintegration/src/FSharp.Editor/CodeFix/ImplementInterfaceCodeFixProvider.fs index bdd9d0a53f..6056c8861a 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/ImplementInterfaceCodeFixProvider.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/ImplementInterfaceCodeFixProvider.fs @@ -141,7 +141,7 @@ type internal FSharpImplementInterfaceCodeFixProvider let! parsingOptions, projectOptions = projectInfoManager.TryGetOptionsForEditingDocumentOrProject context.Document let cancellationToken = context.CancellationToken let! sourceText = context.Document.GetTextAsync(cancellationToken) - let! _, parsedInput, checkFileResults = checker.ParseAndCheckDocument(context.Document, projectOptions, sourceText = sourceText, allowStaleResults = true, userOpName = userOpName) + let! _, parsedInput, checkFileResults = checker.ParseAndCheckDocument(context.Document, projectOptions, sourceText = sourceText, allowStaleResults = Settings.LanguageServicePerformance.AllowStaleCompletionResults, userOpName = userOpName) let textLine = sourceText.Lines.GetLineFromPosition context.Span.Start let defines = CompilerEnvironment.GetCompilationDefinesForEditing parsingOptions // Notice that context.Span doesn't return reliable ranges to find tokens at exact positions. diff --git a/vsintegration/src/FSharp.Editor/CodeFix/RenameUnusedValue.fs b/vsintegration/src/FSharp.Editor/CodeFix/RenameUnusedValue.fs index 949b76b657..db85e02747 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/RenameUnusedValue.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/RenameUnusedValue.fs @@ -58,7 +58,7 @@ type internal FSharpRenameUnusedValueCodeFixProvider // where backtickes are replaced with parens. if not (PrettyNaming.IsOperatorOrBacktickedName ident) && not (ident.StartsWith "``") then let! parsingOptions, projectOptions = projectInfoManager.TryGetOptionsForEditingDocumentOrProject document - let! _, _, checkResults = checker.ParseAndCheckDocument(document, projectOptions, allowStaleResults = true, sourceText = sourceText, userOpName=userOpName) + let! _, _, checkResults = checker.ParseAndCheckDocument(document, projectOptions, allowStaleResults = Settings.LanguageServicePerformance.AllowStaleCompletionResults, sourceText = sourceText, userOpName=userOpName) let m = RoslynHelpers.TextSpanToFSharpRange(document.FilePath, context.Span, sourceText) let defines = CompilerEnvironment.GetCompilationDefinesForEditing parsingOptions let! lexerSymbol = Tokenizer.getSymbolAtPosition (document.Id, sourceText, context.Span.Start, document.FilePath, defines, SymbolLookupKind.Greedy, false) diff --git a/vsintegration/src/FSharp.Editor/Commands/HelpContextService.fs b/vsintegration/src/FSharp.Editor/Commands/HelpContextService.fs index 2e56b8574e..5c8d54404d 100644 --- a/vsintegration/src/FSharp.Editor/Commands/HelpContextService.fs +++ b/vsintegration/src/FSharp.Editor/Commands/HelpContextService.fs @@ -25,7 +25,7 @@ type internal FSharpHelpContextService static let userOpName = "ImplementInterfaceCodeFix" static member GetHelpTerm(checker: FSharpChecker, sourceText : SourceText, fileName, options, span: TextSpan, tokens: List, textVersion) : Async = asyncMaybe { - let! _, _, check = checker.ParseAndCheckDocument(fileName, textVersion, sourceText.ToString(), options, allowStaleResults = true, userOpName = userOpName) + let! _, _, check = checker.ParseAndCheckDocument(fileName, textVersion, sourceText.ToString(), options, allowStaleResults = Settings.LanguageServicePerformance.AllowStaleCompletionResults, userOpName = userOpName) let textLines = sourceText.Lines let lineInfo = textLines.GetLineFromPosition(span.Start) let line = lineInfo.LineNumber diff --git a/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs b/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs index 1ec9696d55..3efa2574a1 100644 --- a/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs +++ b/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs @@ -103,7 +103,7 @@ type internal FSharpCompletionProvider static member ProvideCompletionsAsyncAux(checker: FSharpChecker, sourceText: SourceText, caretPosition: int, options: FSharpProjectOptions, filePath: string, textVersionHash: int, getAllSymbols: FSharpCheckFileResults -> AssemblySymbol list) = asyncMaybe { - let! parseResults, _, checkFileResults = checker.ParseAndCheckDocument(filePath, textVersionHash, sourceText.ToString(), options, allowStaleResults = true, userOpName = userOpName) + let! parseResults, _, checkFileResults = checker.ParseAndCheckDocument(filePath, textVersionHash, sourceText.ToString(), options, allowStaleResults = Settings.LanguageServicePerformance.AllowStaleCompletionResults, userOpName = userOpName) let textLines = sourceText.Lines let caretLinePos = textLines.GetLinePosition(caretPosition) diff --git a/vsintegration/src/FSharp.Editor/Diagnostics/SimplifyNameDiagnosticAnalyzer.fs b/vsintegration/src/FSharp.Editor/Diagnostics/SimplifyNameDiagnosticAnalyzer.fs index 2832265ae1..cfc0c1ccad 100644 --- a/vsintegration/src/FSharp.Editor/Diagnostics/SimplifyNameDiagnosticAnalyzer.fs +++ b/vsintegration/src/FSharp.Editor/Diagnostics/SimplifyNameDiagnosticAnalyzer.fs @@ -62,7 +62,7 @@ type internal SimplifyNameDiagnosticAnalyzer() = | _ -> let! sourceText = document.GetTextAsync() let checker = getChecker document - let! _, _, checkResults = checker.ParseAndCheckDocument(document, projectOptions, sourceText = sourceText, allowStaleResults = true, userOpName=userOpName) + let! _, _, checkResults = checker.ParseAndCheckDocument(document, projectOptions, sourceText = sourceText, allowStaleResults = Settings.LanguageServicePerformance.AllowStaleCompletionResults, userOpName=userOpName) let! symbolUses = checkResults.GetAllUsesOfAllSymbolsInFile() |> liftAsync let mutable result = ResizeArray() let symbolUses = diff --git a/vsintegration/src/FSharp.Editor/Diagnostics/UnusedDeclarationsAnalyzer.fs b/vsintegration/src/FSharp.Editor/Diagnostics/UnusedDeclarationsAnalyzer.fs index 7e4a819900..23cb921524 100644 --- a/vsintegration/src/FSharp.Editor/Diagnostics/UnusedDeclarationsAnalyzer.fs +++ b/vsintegration/src/FSharp.Editor/Diagnostics/UnusedDeclarationsAnalyzer.fs @@ -110,7 +110,7 @@ type internal UnusedDeclarationsAnalyzer() = | Some (_parsingOptions, projectOptions) -> let! sourceText = document.GetTextAsync() let checker = getChecker document - let! _, _, checkResults = checker.ParseAndCheckDocument(document, projectOptions, sourceText = sourceText, allowStaleResults = true, userOpName = userOpName) + let! _, _, checkResults = checker.ParseAndCheckDocument(document, projectOptions, sourceText = sourceText, allowStaleResults = Settings.LanguageServicePerformance.AllowStaleCompletionResults, userOpName = userOpName) let! allSymbolUsesInFile = checkResults.GetAllUsesOfAllSymbolsInFile() |> liftAsync let unusedRanges = getUnusedDeclarationRanges allSymbolUsesInFile (isScriptFile document.FilePath) return diff --git a/vsintegration/src/FSharp.Editor/Diagnostics/UnusedOpensDiagnosticAnalyzer.fs b/vsintegration/src/FSharp.Editor/Diagnostics/UnusedOpensDiagnosticAnalyzer.fs index b8a5b67f66..2e01e595b8 100644 --- a/vsintegration/src/FSharp.Editor/Diagnostics/UnusedOpensDiagnosticAnalyzer.fs +++ b/vsintegration/src/FSharp.Editor/Diagnostics/UnusedOpensDiagnosticAnalyzer.fs @@ -43,7 +43,7 @@ type internal UnusedOpensDiagnosticAnalyzer() = asyncMaybe { do! Option.guard Settings.CodeFixes.UnusedOpens let! sourceText = document.GetTextAsync() - let! _, _, checkResults = checker.ParseAndCheckDocument(document, options, sourceText = sourceText, allowStaleResults = true, userOpName = userOpName) + let! _, _, checkResults = checker.ParseAndCheckDocument(document, options, sourceText = sourceText, allowStaleResults = Settings.LanguageServicePerformance.AllowStaleCompletionResults, userOpName = userOpName) #if DEBUG let sw = Stopwatch.StartNew() #endif diff --git a/vsintegration/src/FSharp.Editor/DocumentHighlights/DocumentHighlightsService.fs b/vsintegration/src/FSharp.Editor/DocumentHighlights/DocumentHighlightsService.fs index b4c5bd2dc5..5579d28438 100644 --- a/vsintegration/src/FSharp.Editor/DocumentHighlights/DocumentHighlightsService.fs +++ b/vsintegration/src/FSharp.Editor/DocumentHighlights/DocumentHighlightsService.fs @@ -59,7 +59,7 @@ type internal FSharpDocumentHighlightsService [] (checkerP let textLinePos = sourceText.Lines.GetLinePosition(position) let fcsTextLineNumber = Line.fromZ textLinePos.Line let! symbol = Tokenizer.getSymbolAtPosition(documentKey, sourceText, position, filePath, defines, SymbolLookupKind.Greedy, false) - let! _, _, checkFileResults = checker.ParseAndCheckDocument(filePath, textVersionHash, sourceText.ToString(), options, allowStaleResults = true, userOpName = userOpName) + let! _, _, checkFileResults = checker.ParseAndCheckDocument(filePath, textVersionHash, sourceText.ToString(), options, allowStaleResults = Settings.LanguageServicePerformance.AllowStaleCompletionResults, userOpName = userOpName) let! symbolUse = checkFileResults.GetSymbolUseAtLocation(fcsTextLineNumber, symbol.Ident.idRange.EndColumn, textLine.ToString(), symbol.FullIsland, userOpName=userOpName) let! symbolUses = checkFileResults.GetUsesOfSymbolInFile(symbolUse.Symbol) |> liftAsync return diff --git a/vsintegration/src/FSharp.Editor/InlineRename/InlineRenameService.fs b/vsintegration/src/FSharp.Editor/InlineRename/InlineRenameService.fs index 9a03d6971f..2f6bf67d9d 100644 --- a/vsintegration/src/FSharp.Editor/InlineRename/InlineRenameService.fs +++ b/vsintegration/src/FSharp.Editor/InlineRename/InlineRenameService.fs @@ -149,7 +149,7 @@ type internal InlineRenameService let textLinePos = sourceText.Lines.GetLinePosition(position) let fcsTextLineNumber = Line.fromZ textLinePos.Line let! symbol = Tokenizer.getSymbolAtPosition(document.Id, sourceText, position, document.FilePath, defines, SymbolLookupKind.Greedy, false) - let! _, _, checkFileResults = checker.ParseAndCheckDocument(document, options, allowStaleResults = true, userOpName = userOpName) + let! _, _, checkFileResults = checker.ParseAndCheckDocument(document, options, allowStaleResults = Settings.LanguageServicePerformance.AllowStaleCompletionResults, userOpName = userOpName) let! symbolUse = checkFileResults.GetSymbolUseAtLocation(fcsTextLineNumber, symbol.Ident.idRange.EndColumn, textLine.Text.ToString(), symbol.FullIsland, userOpName=userOpName) let! declLoc = symbolUse.GetDeclarationLocation(document) diff --git a/vsintegration/src/FSharp.Editor/LanguageService/FSharpCheckerExtensions.fs b/vsintegration/src/FSharp.Editor/LanguageService/FSharpCheckerExtensions.fs index f05b13423d..d68ca216fd 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/FSharpCheckerExtensions.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/FSharpCheckerExtensions.fs @@ -62,10 +62,10 @@ type FSharpChecker with | Ready x -> async.Return x | StillRunning worker -> async { - match allowStaleResults, checker.TryGetRecentCheckResultsForFile(filePath, options) with - | true, Some (parseResults, checkFileResults, _) -> + match checker.TryGetRecentCheckResultsForFile(filePath, options) with + | Some (parseResults, checkFileResults, _) -> return Some (parseResults, checkFileResults) - | _ -> + | None -> return! worker } return bindParsedInput results diff --git a/vsintegration/src/FSharp.Editor/LanguageService/SymbolHelpers.fs b/vsintegration/src/FSharp.Editor/LanguageService/SymbolHelpers.fs index 3b47b1b55e..6cbba468dd 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/SymbolHelpers.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/SymbolHelpers.fs @@ -33,7 +33,7 @@ module internal SymbolHelpers = let! parsingOptions, projectOptions = projectInfoManager.TryGetOptionsForEditingDocumentOrProject(document) let defines = CompilerEnvironment.GetCompilationDefinesForEditing parsingOptions let! symbol = Tokenizer.getSymbolAtPosition(document.Id, sourceText, position, document.FilePath, defines, SymbolLookupKind.Greedy, false) - let! _, _, checkFileResults = checker.ParseAndCheckDocument(document.FilePath, textVersionHash, sourceText.ToString(), projectOptions, allowStaleResults = true, userOpName = userOpName) + let! _, _, checkFileResults = checker.ParseAndCheckDocument(document.FilePath, textVersionHash, sourceText.ToString(), projectOptions, allowStaleResults = Settings.LanguageServicePerformance.AllowStaleCompletionResults, userOpName = userOpName) let! symbolUse = checkFileResults.GetSymbolUseAtLocation(fcsTextLineNumber, symbol.Ident.idRange.EndColumn, textLine.ToString(), symbol.FullIsland, userOpName=userOpName) let! symbolUses = checkFileResults.GetUsesOfSymbolInFile(symbolUse.Symbol) |> liftAsync return symbolUses @@ -106,7 +106,7 @@ module internal SymbolHelpers = let! parsingOptions, projectOptions = projectInfoManager.TryGetOptionsForEditingDocumentOrProject document let defines = CompilerEnvironment.GetCompilationDefinesForEditing parsingOptions let! symbol = Tokenizer.getSymbolAtPosition(document.Id, sourceText, symbolSpan.Start, document.FilePath, defines, SymbolLookupKind.Greedy, false) - let! _, _, checkFileResults = checker.ParseAndCheckDocument(document, projectOptions, allowStaleResults = true, userOpName = userOpName) + let! _, _, checkFileResults = checker.ParseAndCheckDocument(document, projectOptions, allowStaleResults = Settings.LanguageServicePerformance.AllowStaleCompletionResults, userOpName = userOpName) let textLine = sourceText.Lines.GetLineFromPosition(symbolSpan.Start) let textLinePos = sourceText.Lines.GetLinePosition(symbolSpan.Start) let fcsTextLineNumber = Line.fromZ textLinePos.Line diff --git a/vsintegration/src/FSharp.Editor/Navigation/FindUsagesService.fs b/vsintegration/src/FSharp.Editor/Navigation/FindUsagesService.fs index 1177b18ad9..e99fab65e6 100644 --- a/vsintegration/src/FSharp.Editor/Navigation/FindUsagesService.fs +++ b/vsintegration/src/FSharp.Editor/Navigation/FindUsagesService.fs @@ -52,7 +52,7 @@ type internal FSharpFindUsagesService let! sourceText = document.GetTextAsync(context.CancellationToken) |> Async.AwaitTask |> liftAsync let checker = checkerProvider.Checker let! parsingOptions, _, projectOptions = projectInfoManager.TryGetOptionsForDocumentOrProject(document) - let! _, _, checkFileResults = checker.ParseAndCheckDocument(document, projectOptions, sourceText = sourceText, allowStaleResults = true, userOpName = userOpName) + let! _, _, checkFileResults = checker.ParseAndCheckDocument(document, projectOptions, sourceText = sourceText, allowStaleResults = Settings.LanguageServicePerformance.AllowStaleCompletionResults, userOpName = userOpName) let textLine = sourceText.Lines.GetLineFromPosition(position).ToString() let lineNumber = sourceText.Lines.GetLinePosition(position).Line + 1 let defines = CompilerEnvironment.GetCompilationDefinesForEditing parsingOptions diff --git a/vsintegration/src/FSharp.Editor/Navigation/GoToDefinition.fs b/vsintegration/src/FSharp.Editor/Navigation/GoToDefinition.fs index 2c2aef7845..a72b5355cc 100644 --- a/vsintegration/src/FSharp.Editor/Navigation/GoToDefinition.fs +++ b/vsintegration/src/FSharp.Editor/Navigation/GoToDefinition.fs @@ -181,7 +181,7 @@ type internal GoToDefinition(checker: FSharpChecker, projectInfoManager: FSharpP let fcsTextLineNumber = Line.fromZ textLinePos.Line let lineText = (sourceText.Lines.GetLineFromPosition position).ToString() - let! _, _, checkFileResults = checker.ParseAndCheckDocument (originDocument, projectOptions, allowStaleResults=true,sourceText=sourceText, userOpName=userOpName) + let! _, _, checkFileResults = checker.ParseAndCheckDocument (originDocument, projectOptions, allowStaleResults=Settings.LanguageServicePerformance.AllowStaleCompletionResults,sourceText=sourceText, userOpName=userOpName) let idRange = lexerSymbol.Ident.idRange let! fsSymbolUse = checkFileResults.GetSymbolUseAtLocation (fcsTextLineNumber, idRange.EndColumn, lineText, lexerSymbol.FullIsland, userOpName=userOpName) let symbol = fsSymbolUse.Symbol @@ -194,7 +194,7 @@ type internal GoToDefinition(checker: FSharpChecker, projectInfoManager: FSharpP let! implDoc = originDocument.Project.Solution.TryGetDocumentFromPath fsfilePath let! implSourceText = implDoc.GetTextAsync () let! _parsingOptions, projectOptions = projectInfoManager.TryGetOptionsForEditingDocumentOrProject implDoc - let! _, _, checkFileResults = checker.ParseAndCheckDocument (implDoc, projectOptions, allowStaleResults=true, sourceText=implSourceText, userOpName=userOpName) + let! _, _, checkFileResults = checker.ParseAndCheckDocument (implDoc, projectOptions, allowStaleResults=Settings.LanguageServicePerformance.AllowStaleCompletionResults, sourceText=implSourceText, userOpName=userOpName) let! symbolUses = checkFileResults.GetUsesOfSymbolInFile symbol |> liftAsync let! implSymbol = symbolUses |> Array.tryHead let! implTextSpan = RoslynHelpers.TryFSharpRangeToTextSpan (implSourceText, implSymbol.RangeAlternate) @@ -233,7 +233,7 @@ type internal GoToDefinition(checker: FSharpChecker, projectInfoManager: FSharpP let preferSignature = isSignatureFile originDocument.FilePath - let! _, _, checkFileResults = checker.ParseAndCheckDocument (originDocument, projectOptions, allowStaleResults=true, sourceText=sourceText, userOpName=userOpName) + let! _, _, checkFileResults = checker.ParseAndCheckDocument (originDocument, projectOptions, allowStaleResults=Settings.LanguageServicePerformance.AllowStaleCompletionResults, sourceText=sourceText, userOpName=userOpName) let! lexerSymbol = Tokenizer.getSymbolAtPosition (originDocument.Id, sourceText, position,originDocument.FilePath, defines, SymbolLookupKind.Greedy, false) let idRange = lexerSymbol.Ident.idRange diff --git a/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs b/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs index 9d5451e8ef..4809c0b988 100644 --- a/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs +++ b/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs @@ -43,6 +43,8 @@ type CodeFixesOptions = [] type LanguageServicePerformanceOptions = { EnableInMemoryCrossProjectReferences: bool + AllowStaleCompletionResults: bool + TimeUntilStaleCompletion: int ProjectCheckCacheSize: int } [] @@ -80,6 +82,8 @@ type internal Settings [](store: SettingsStore) = store.RegisterDefault { EnableInMemoryCrossProjectReferences = true + AllowStaleCompletionResults = true + TimeUntilStaleCompletion = 2000 // In ms, so this is 2 seconds ProjectCheckCacheSize = 200 } store.RegisterDefault diff --git a/vsintegration/src/FSharp.Editor/QuickInfo/QuickInfoProvider.fs b/vsintegration/src/FSharp.Editor/QuickInfo/QuickInfoProvider.fs index a41fa05a5d..69886526e1 100644 --- a/vsintegration/src/FSharp.Editor/QuickInfo/QuickInfoProvider.fs +++ b/vsintegration/src/FSharp.Editor/QuickInfo/QuickInfoProvider.fs @@ -169,7 +169,7 @@ type internal FSharpAsyncQuickInfoSource // test helper static member ProvideQuickInfo(checker:FSharpChecker, documentId:DocumentId, sourceText:SourceText, filePath:string, position:int, parsingOptions:FSharpParsingOptions, options:FSharpProjectOptions, textVersionHash:int) = asyncMaybe { - let! _, _, checkFileResults = checker.ParseAndCheckDocument(filePath, textVersionHash, sourceText.ToString(), options, allowStaleResults=true, userOpName=FSharpQuickInfo.userOpName) + let! _, _, checkFileResults = checker.ParseAndCheckDocument(filePath, textVersionHash, sourceText.ToString(), options, allowStaleResults=Settings.LanguageServicePerformance.AllowStaleCompletionResults, userOpName=FSharpQuickInfo.userOpName) let textLine = sourceText.Lines.GetLineFromPosition position let textLineNumber = textLine.LineNumber + 1 // Roslyn line numbers are zero-based let defines = CompilerEnvironment.GetCompilationDefinesForEditing parsingOptions diff --git a/vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj b/vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj index cbd879c999..2ddf56f77f 100644 --- a/vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj +++ b/vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj @@ -41,6 +41,19 @@ + + + True + True + Strings.resx + + + + + PublicResXFileCodeGenerator + Strings.Designer.cs + + $(VS150COMNTOOLS)\..\..\MSBuild\$(VisualStudioVersion)\Bin diff --git a/vsintegration/src/FSharp.UIResources/LanguageServicePerformanceOptionControl.xaml b/vsintegration/src/FSharp.UIResources/LanguageServicePerformanceOptionControl.xaml index eeedf0607b..e67690250d 100644 --- a/vsintegration/src/FSharp.UIResources/LanguageServicePerformanceOptionControl.xaml +++ b/vsintegration/src/FSharp.UIResources/LanguageServicePerformanceOptionControl.xaml @@ -17,19 +17,24 @@ - + - + - + - + + + + + + + + + + + diff --git a/vsintegration/src/FSharp.UIResources/Strings.Designer.cs b/vsintegration/src/FSharp.UIResources/Strings.Designer.cs index 9ca24307b1..7791ec397e 100644 --- a/vsintegration/src/FSharp.UIResources/Strings.Designer.cs +++ b/vsintegration/src/FSharp.UIResources/Strings.Designer.cs @@ -168,6 +168,24 @@ public static string Enable_in_memory_cross_project_references { } } + /// + /// Looks up a localized string similar to Enable stale data for IntelliSense features. + /// + public static string Enable_Stale_IntelliSense_Results { + get { + return ResourceManager.GetString("Enable_Stale_IntelliSense_Results", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to IntelliSense Performance Options. + /// + public static string IntelliSense_Performance { + get { + return ResourceManager.GetString("IntelliSense_Performance", resourceCulture); + } + } + /// /// Looks up a localized string similar to Performance. /// @@ -196,7 +214,7 @@ public static string Outlining { } /// - /// Looks up a localized string similar to Project check cache size. + /// Looks up a localized string similar to Number of projects whose data is cached in memory. /// public static string Project_check_cache_size { get { @@ -204,6 +222,15 @@ public static string Project_check_cache_size { } } + /// + /// Looks up a localized string similar to F# Project and Caching Performance Options. + /// + public static string Project_Performance { + get { + return ResourceManager.GetString("Project_Performance", resourceCulture); + } + } + /// /// Looks up a localized string similar to Show s_ymbols in unopened namespaces. /// @@ -276,6 +303,33 @@ public static string Solid_underline { } } + /// + /// Looks up a localized string similar to Time until stale results are used (in milliseconds). + /// + public static string Time_until_stale_completion { + get { + return ResourceManager.GetString("Time_until_stale_completion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to In-memory cross-project references store project-level data in memory to allow IDE features to work across projects.. + /// + public static string Tooltip_in_memory_cross_project_references { + get { + return ResourceManager.GetString("Tooltip_in_memory_cross_project_references", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions.. + /// + public static string Tooltip_project_check_cache_size { + get { + return ResourceManager.GetString("Tooltip_project_check_cache_size", resourceCulture); + } + } + /// /// Looks up a localized string similar to Analyze and suggest fixes for unused values. /// diff --git a/vsintegration/src/FSharp.UIResources/Strings.resx b/vsintegration/src/FSharp.UIResources/Strings.resx index d8d0660c15..6022369888 100644 --- a/vsintegration/src/FSharp.UIResources/Strings.resx +++ b/vsintegration/src/FSharp.UIResources/Strings.resx @@ -151,7 +151,7 @@ _Enable in-memory cross project references - Project check cache size + Number of projects whose data is cached in memory S_how navigation links as @@ -180,6 +180,24 @@ Show outlining and collapsable nodes for F# code + + Time until stale results are used (in milliseconds) + + + IntelliSense Performance Options + + + F# Project and Caching Performance Options + + + Enable stale data for IntelliSense features + + + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + + + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + CodeLens diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf index 64f36038e2..ae3db20b39 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf @@ -58,8 +58,8 @@ - Project check cache size - Velikost mezipaměti pro kontrolu projektů + Number of projects whose data is cached in memory + Velikost mezipaměti pro kontrolu projektů @@ -107,6 +107,36 @@ Zobrazí osnovu a sbalitelné uzly kódu F#. + + Time until stale results are used (in milliseconds) + Time until stale results are used (in milliseconds) + + + + IntelliSense Performance Options + IntelliSense Performance Options + + + + F# Project and Caching Performance Options + F# Project and Caching Performance Options + + + + Enable stale data for IntelliSense features + Enable stale data for IntelliSense features + + + + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + + + + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + + CodeLens CodeLens diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf index d02f0bcc0a..6658e9dafa 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf @@ -58,8 +58,8 @@ - Project check cache size - Überprüfung der Projektcachegröße + Number of projects whose data is cached in memory + Überprüfung der Projektcachegröße @@ -107,6 +107,36 @@ Gliederung und ausblendbare Knoten für F#-Code anzeigen + + Time until stale results are used (in milliseconds) + Time until stale results are used (in milliseconds) + + + + IntelliSense Performance Options + IntelliSense Performance Options + + + + F# Project and Caching Performance Options + F# Project and Caching Performance Options + + + + Enable stale data for IntelliSense features + Enable stale data for IntelliSense features + + + + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + + + + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + + CodeLens CodeLens diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.en.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.en.xlf index e64366da69..bf7693916f 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.en.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.en.xlf @@ -58,8 +58,8 @@ - Project check cache size - Project check cache size + Number of projects whose data is cached in memory + Number of projects whose data is cached in memory @@ -107,6 +107,36 @@ Show outlining and collapsable nodes for F# code + + Time until stale results are used (in milliseconds) + Time until stale results are used (in milliseconds) + + + + IntelliSense Performance Options + IntelliSense Performance Options + + + + F# Project and Caching Performance Options + F# Project and Caching Performance Options + + + + Enable stale data for IntelliSense features + Enable stale data for IntelliSense features + + + + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + + + + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + + CodeLens CodeLens diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf index ed976a6676..6e8557f851 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf @@ -58,8 +58,8 @@ - Project check cache size - Tamaño de caché de comprobación de proyectos + Number of projects whose data is cached in memory + Tamaño de caché de comprobación de proyectos @@ -107,6 +107,36 @@ Mostrar los nodos de esquematización y contraíbles del código F# + + Time until stale results are used (in milliseconds) + Time until stale results are used (in milliseconds) + + + + IntelliSense Performance Options + IntelliSense Performance Options + + + + F# Project and Caching Performance Options + F# Project and Caching Performance Options + + + + Enable stale data for IntelliSense features + Enable stale data for IntelliSense features + + + + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + + + + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + + CodeLens CodeLens diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf index 1d052aa1c2..5786c1b28e 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf @@ -58,8 +58,8 @@ - Project check cache size - Taille du cache de vérification du projet + Number of projects whose data is cached in memory + Taille du cache de vérification du projet @@ -107,6 +107,36 @@ Afficher le mode plan et les nœuds réductibles pour le code F# + + Time until stale results are used (in milliseconds) + Time until stale results are used (in milliseconds) + + + + IntelliSense Performance Options + IntelliSense Performance Options + + + + F# Project and Caching Performance Options + F# Project and Caching Performance Options + + + + Enable stale data for IntelliSense features + Enable stale data for IntelliSense features + + + + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + + + + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + + CodeLens CodeLens diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf index 71a7c1c705..06fc90b662 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf @@ -58,8 +58,8 @@ - Project check cache size - Dimensioni della cache di controllo del progetto + Number of projects whose data is cached in memory + Dimensioni della cache di controllo del progetto @@ -107,6 +107,36 @@ Mostra i nodi struttura e comprimibili per il codice F# + + Time until stale results are used (in milliseconds) + Time until stale results are used (in milliseconds) + + + + IntelliSense Performance Options + IntelliSense Performance Options + + + + F# Project and Caching Performance Options + F# Project and Caching Performance Options + + + + Enable stale data for IntelliSense features + Enable stale data for IntelliSense features + + + + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + + + + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + + CodeLens CodeLens diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf index 2a6a8d1cce..1a798938a8 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf @@ -58,8 +58,8 @@ - Project check cache size - プロジェクト チェックのキャッシュ サイズ + Number of projects whose data is cached in memory + プロジェクト チェックのキャッシュ サイズ @@ -107,6 +107,36 @@ F# コードのアウトラインおよび折りたたみ可能なノードを表示する + + Time until stale results are used (in milliseconds) + Time until stale results are used (in milliseconds) + + + + IntelliSense Performance Options + IntelliSense Performance Options + + + + F# Project and Caching Performance Options + F# Project and Caching Performance Options + + + + Enable stale data for IntelliSense features + Enable stale data for IntelliSense features + + + + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + + + + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + + CodeLens CodeLens diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf index 8909316936..5491509c7c 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf @@ -58,8 +58,8 @@ - Project check cache size - 프로젝트 검사 캐시 크기 + Number of projects whose data is cached in memory + 프로젝트 검사 캐시 크기 @@ -107,6 +107,36 @@ F# 코드에 대한 개요 및 축소 가능한 노드 표시 + + Time until stale results are used (in milliseconds) + Time until stale results are used (in milliseconds) + + + + IntelliSense Performance Options + IntelliSense Performance Options + + + + F# Project and Caching Performance Options + F# Project and Caching Performance Options + + + + Enable stale data for IntelliSense features + Enable stale data for IntelliSense features + + + + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + + + + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + + CodeLens CodeLens diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf index 7b440197e9..f254313b71 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf @@ -58,8 +58,8 @@ - Project check cache size - Rozmiar pamięci podręcznej sprawdzania projektu + Number of projects whose data is cached in memory + Rozmiar pamięci podręcznej sprawdzania projektu @@ -107,6 +107,36 @@ Pokaż konspekt i węzły z możliwością zwijania dla kodu języka F# + + Time until stale results are used (in milliseconds) + Time until stale results are used (in milliseconds) + + + + IntelliSense Performance Options + IntelliSense Performance Options + + + + F# Project and Caching Performance Options + F# Project and Caching Performance Options + + + + Enable stale data for IntelliSense features + Enable stale data for IntelliSense features + + + + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + + + + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + + CodeLens CodeLens diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf index 764bb31eed..3149e6a834 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf @@ -58,8 +58,8 @@ - Project check cache size - Tamanho do cache de verificação do projeto + Number of projects whose data is cached in memory + Tamanho do cache de verificação do projeto @@ -107,6 +107,36 @@ Mostrar os nós de estrutura de tópicos e recolhíveis para o código F# + + Time until stale results are used (in milliseconds) + Time until stale results are used (in milliseconds) + + + + IntelliSense Performance Options + IntelliSense Performance Options + + + + F# Project and Caching Performance Options + F# Project and Caching Performance Options + + + + Enable stale data for IntelliSense features + Enable stale data for IntelliSense features + + + + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + + + + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + + CodeLens CodeLens diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf index 176ca7882e..a8d45cfae9 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf @@ -58,8 +58,8 @@ - Project check cache size - Размер кэша проверки проекта + Number of projects whose data is cached in memory + Размер кэша проверки проекта @@ -107,6 +107,36 @@ Показать структурирование и сворачиваемые узлы для кода F# + + Time until stale results are used (in milliseconds) + Time until stale results are used (in milliseconds) + + + + IntelliSense Performance Options + IntelliSense Performance Options + + + + F# Project and Caching Performance Options + F# Project and Caching Performance Options + + + + Enable stale data for IntelliSense features + Enable stale data for IntelliSense features + + + + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + + + + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + + CodeLens CodeLens diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf index 0a8fdb6e98..f6749fa2f6 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf @@ -58,8 +58,8 @@ - Project check cache size - Proje denetimi önbelleği boyutu + Number of projects whose data is cached in memory + Proje denetimi önbelleği boyutu @@ -107,6 +107,36 @@ F# kodu için ana hattı ve daraltılabilir düğümleri göster + + Time until stale results are used (in milliseconds) + Time until stale results are used (in milliseconds) + + + + IntelliSense Performance Options + IntelliSense Performance Options + + + + F# Project and Caching Performance Options + F# Project and Caching Performance Options + + + + Enable stale data for IntelliSense features + Enable stale data for IntelliSense features + + + + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + + + + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + + CodeLens CodeLens diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf index 62d03c75ac..e166fbc315 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf @@ -58,8 +58,8 @@ - Project check cache size - 项目检查缓存大小 + Number of projects whose data is cached in memory + 项目检查缓存大小 @@ -107,6 +107,36 @@ 显示 F# 代码的大纲和可折叠节点 + + Time until stale results are used (in milliseconds) + Time until stale results are used (in milliseconds) + + + + IntelliSense Performance Options + IntelliSense Performance Options + + + + F# Project and Caching Performance Options + F# Project and Caching Performance Options + + + + Enable stale data for IntelliSense features + Enable stale data for IntelliSense features + + + + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + + + + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + + CodeLens CodeLens diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf index f1f1d69ca7..3ee0567f2e 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf @@ -58,8 +58,8 @@ - Project check cache size - 專案檢查快取大小 + Number of projects whose data is cached in memory + 專案檢查快取大小 @@ -107,6 +107,36 @@ 顯示 F# 程式碼的大綱與可折疊的節點 + + Time until stale results are used (in milliseconds) + Time until stale results are used (in milliseconds) + + + + IntelliSense Performance Options + IntelliSense Performance Options + + + + F# Project and Caching Performance Options + F# Project and Caching Performance Options + + + + Enable stale data for IntelliSense features + Enable stale data for IntelliSense features + + + + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + + + + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + + CodeLens CodeLens From 4f5e2c0834c51999c3d7874d39fdcd58b61c39ad Mon Sep 17 00:00:00 2001 From: Vasily Kirichenko Date: Wed, 20 Jun 2018 23:47:02 +0300 Subject: [PATCH 055/150] fix ParseAndCheckDocument (#5175) --- .../FSharpCheckerExtensions.fs | 33 +++++++++---------- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/vsintegration/src/FSharp.Editor/LanguageService/FSharpCheckerExtensions.fs b/vsintegration/src/FSharp.Editor/LanguageService/FSharpCheckerExtensions.fs index d68ca216fd..c5f8aa4cb7 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/FSharpCheckerExtensions.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/FSharpCheckerExtensions.fs @@ -9,10 +9,6 @@ open Microsoft.FSharp.Compiler open Microsoft.FSharp.Compiler.Ast open Microsoft.FSharp.Compiler.SourceCodeServices -type CheckResults = - | Ready of (FSharpParseFileResults * FSharpCheckFileResults) option - | StillRunning of Async<(FSharpParseFileResults * FSharpCheckFileResults) option> - type FSharpChecker with member checker.ParseDocument(document: Document, parsingOptions: FSharpParsingOptions, sourceText: string, userOpName: string) = asyncMaybe { @@ -35,15 +31,14 @@ type FSharpChecker with Some (parseResults, checkFileResults) } - let tryGetFreshResultsWithTimeout() : Async = - async { - try - let! worker = Async.StartChild(parseAndCheckFile, 2000) - let! result = worker - return Ready result - with :? TimeoutException -> - return StillRunning parseAndCheckFile - } + let tryGetFreshResultsWithTimeout() = + async { + let! worker = Async.StartChild(parseAndCheckFile, millisecondsTimeout=Settings.LanguageServicePerformance.TimeUntilStaleCompletion) + try + return! worker + with :? TimeoutException -> + return None // worker is cancelled at this point, we cannot return it and wait its completion anymore + } let bindParsedInput(results: (FSharpParseFileResults * FSharpCheckFileResults) option) = match results with @@ -59,18 +54,20 @@ type FSharpChecker with let! results = match freshResults with - | Ready x -> async.Return x - | StillRunning worker -> + | Some x -> async.Return (Some x) + | None -> async { match checker.TryGetRecentCheckResultsForFile(filePath, options) with | Some (parseResults, checkFileResults, _) -> return Some (parseResults, checkFileResults) | None -> - return! worker + return! parseAndCheckFile } return bindParsedInput results - } - else parseAndCheckFile |> Async.map bindParsedInput + else + let! results = parseAndCheckFile + return bindParsedInput results + } member checker.ParseAndCheckDocument(document: Document, options: FSharpProjectOptions, allowStaleResults: bool, userOpName: string, ?sourceText: SourceText) = From 1225c3e7cc4d8e73b39462c7d07e2d8c671ba2f4 Mon Sep 17 00:00:00 2001 From: Kevin Ransom Date: Wed, 20 Jun 2018 17:21:35 -0700 Subject: [PATCH 056/150] Address merge issues --- .../FSharpCheckerExtensions.fs | 37 +++++++++---------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/vsintegration/src/FSharp.Editor/LanguageService/FSharpCheckerExtensions.fs b/vsintegration/src/FSharp.Editor/LanguageService/FSharpCheckerExtensions.fs index c5f8aa4cb7..8860a9ceb5 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/FSharpCheckerExtensions.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/FSharpCheckerExtensions.fs @@ -20,16 +20,17 @@ type FSharpChecker with checker.ParseDocument(document, parsingOptions, sourceText=sourceText.ToString(), userOpName=userOpName) member checker.ParseAndCheckDocument(filePath: string, textVersionHash: int, sourceText: string, options: FSharpProjectOptions, allowStaleResults: bool, userOpName: string) = - let parseAndCheckFile = - async { - let! parseResults, checkFileAnswer = checker.ParseAndCheckFileInProject(filePath, textVersionHash, sourceText, options, userOpName=userOpName) - return - match checkFileAnswer with - | FSharpCheckFileAnswer.Aborted -> - None - | FSharpCheckFileAnswer.Succeeded(checkFileResults) -> - Some (parseResults, checkFileResults) - } + async { + let parseAndCheckFile = + async { + let! parseResults, checkFileAnswer = checker.ParseAndCheckFileInProject(filePath, textVersionHash, sourceText, options, userOpName=userOpName) + return + match checkFileAnswer with + | FSharpCheckFileAnswer.Aborted -> + None + | FSharpCheckFileAnswer.Succeeded(checkFileResults) -> + Some (parseResults, checkFileResults) + } let tryGetFreshResultsWithTimeout() = async { @@ -40,16 +41,15 @@ type FSharpChecker with return None // worker is cancelled at this point, we cannot return it and wait its completion anymore } - let bindParsedInput(results: (FSharpParseFileResults * FSharpCheckFileResults) option) = - match results with - | Some(parseResults, checkResults) -> - match parseResults.ParseTree with - | Some parsedInput -> Some (parseResults, parsedInput, checkResults) + let bindParsedInput(results: (FSharpParseFileResults * FSharpCheckFileResults) option) = + match results with + | Some(parseResults, checkResults) -> + match parseResults.ParseTree with + | Some parsedInput -> Some (parseResults, parsedInput, checkResults) + | None -> None | None -> None - | None -> None - if allowStaleResults then - async { + if allowStaleResults then let! freshResults = tryGetFreshResultsWithTimeout() let! results = @@ -69,7 +69,6 @@ type FSharpChecker with return bindParsedInput results } - member checker.ParseAndCheckDocument(document: Document, options: FSharpProjectOptions, allowStaleResults: bool, userOpName: string, ?sourceText: SourceText) = async { let! cancellationToken = Async.CancellationToken From 5b049f96762359d4fb5353cf9bc1ad76c135ff06 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Thu, 21 Jun 2018 12:40:15 -0700 Subject: [PATCH 057/150] version the .vsman insertion files --- setup/FSharp.Setup.props | 2 +- setup/Swix/Microsoft.FSharp.vsmanproj | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/setup/FSharp.Setup.props b/setup/FSharp.Setup.props index 7d9325d6d8..3bb96f73f2 100644 --- a/setup/FSharp.Setup.props +++ b/setup/FSharp.Setup.props @@ -19,7 +19,7 @@ $([System.DateTime]::Now.ToString(yyyyMMdd.0)) $(FSharpProductVersion).$(BUILD_BUILDNUMBER.Replace(".DRAFT", "")) - + diff --git a/setup/Swix/Microsoft.FSharp.vsmanproj b/setup/Swix/Microsoft.FSharp.vsmanproj index c3087fa3a1..f89afddafa 100644 --- a/setup/Swix/Microsoft.FSharp.vsmanproj +++ b/setup/Swix/Microsoft.FSharp.vsmanproj @@ -10,6 +10,7 @@ true $(FSharpSourcesRoot)\..\$(Configuration)\insertion $(OutputPath) + $(FSharpPackageVersion) From fead0aac540485683f694524eadad79983ec28d9 Mon Sep 17 00:00:00 2001 From: Will Smith Date: Tue, 26 Jun 2018 17:43:47 -0700 Subject: [PATCH 058/150] Enable negative byref tests (#5237) * Checking negative tests for byrefs * Added byref test baseline --- tests/fsharp/core/byrefs/test.bsl | 44 ++++++++++++ tests/fsharp/core/byrefs/test.fsx | 110 +++++++++++++----------------- tests/fsharp/tests.fs | 2 + 3 files changed, 94 insertions(+), 62 deletions(-) create mode 100644 tests/fsharp/core/byrefs/test.bsl diff --git a/tests/fsharp/core/byrefs/test.bsl b/tests/fsharp/core/byrefs/test.bsl new file mode 100644 index 0000000000..9b9fd3f6d5 --- /dev/null +++ b/tests/fsharp/core/byrefs/test.bsl @@ -0,0 +1,44 @@ + +test.fsx(31,34,31,40): typecheck error FS3224: The byref pointer is readonly, so this write is not permitted. + +test.fsx(34,32,34,40): typecheck error FS0257: Invalid mutation of a constant expression. Consider copying the expression to a mutable local, e.g. 'let mutable x = ...'. + +test.fsx(38,36,38,38): typecheck error FS0001: Type mismatch. Expecting a + 'byref<'T>' +but given a + 'inref<'T>' +The type 'ByRefKinds.InOut' does not match the type 'ByRefKinds.In' + +test.fsx(42,36,42,38): typecheck error FS0001: Type mismatch. Expecting a + 'outref<'T>' +but given a + 'inref<'T>' +The type 'ByRefKinds.Out' does not match the type 'ByRefKinds.In' + +test.fsx(47,38,47,40): typecheck error FS0001: Type mismatch. Expecting a + 'byref<'T>' +but given a + 'inref<'T>' +The type 'ByRefKinds.InOut' does not match the type 'ByRefKinds.In' + +test.fsx(52,38,52,40): typecheck error FS0001: Type mismatch. Expecting a + 'outref<'T>' +but given a + 'inref<'T>' +The type 'ByRefKinds.Out' does not match the type 'ByRefKinds.In' + +test.fsx(57,38,57,40): typecheck error FS0001: Type mismatch. Expecting a + 'byref<'T>' +but given a + 'inref<'T>' +The type 'ByRefKinds.InOut' does not match the type 'ByRefKinds.In' + +test.fsx(62,38,62,40): typecheck error FS0001: Type mismatch. Expecting a + 'outref<'T>' +but given a + 'inref<'T>' +The type 'ByRefKinds.Out' does not match the type 'ByRefKinds.In' + +test.fsx(66,34,66,47): typecheck error FS1204: This construct is for use in the FSharp.Core library and should not be used directly + +test.fsx(66,34,66,47): typecheck error FS1204: This construct is for use in the FSharp.Core library and should not be used directly diff --git a/tests/fsharp/core/byrefs/test.fsx b/tests/fsharp/core/byrefs/test.fsx index 1e0c414069..2d5e150e80 100644 --- a/tests/fsharp/core/byrefs/test.fsx +++ b/tests/fsharp/core/byrefs/test.fsx @@ -17,7 +17,54 @@ let check s actual expected = if actual = expected then printfn "%s: OK" s else report_failure (sprintf "%s: FAILED, expected %A, got %A" s expected actual) -let check2 s expected actual = check s actual expected +let check2 s expected actual = check s actual expected + +[] +type S = + [] + val mutable X : int + +#if NEGATIVE +module ByrefNegativeTests = + + module WriteToInRef = + let f1 (x: inref) = x <- 1 // not allowed + + module WriteToInRefStructInner = + let f1 (x: inref) = x.X <- 1 //not allowed + + module InRefToByRef = + let f1 (x: byref<'T>) = 1 + let f2 (x: inref<'T>) = f1 &x // not allowed + + module InRefToOutRef = + let f1 (x: outref<'T>) = 1 + let f2 (x: inref<'T>) = f1 &x // not allowed + + module InRefToByRefClassMethod = + type C() = + static member f1 (x: byref<'T>) = 1 + let f2 (x: inref<'T>) = C.f1 &x // not allowed + + module InRefToOutRefClassMethod = + type C() = + static member f1 (x: outref<'T>) = 1 // not allowed + let f2 (x: inref<'T>) = C.f1 &x + + module InRefToByRefClassMethod2 = + type C() = + static member f1 (x: byref<'T>) = 1 + let f2 (x: inref<'T>) = C.f1(&x) // not allowed + + module InRefToOutRefClassMethod2 = + type C() = + static member f1 (x: outref<'T>) = 1 // not allowed + let f2 (x: inref<'T>) = C.f1(&x) + + module UseOfLibraryOnly = + type C() = + static member f1 (x: byref<'T, 'U>) = 1 +#endif // Test a simple ref argument module CompareExchangeTests = @@ -1244,11 +1291,6 @@ module ByrefReturnMemberTests = test() module MatrixOfTests = - [] - type S = - [] - val mutable X : int - module ReturnAddressOfByRef = let f1 (x: byref) = &x @@ -1285,11 +1327,6 @@ module ByrefReturnMemberTests = module WriteToByRef = let f1 (x: byref) = x <- 1 -#if NEGATIVE - module WriteToInRef = - let f1 (x: inref) = x <- 1 // not allowed -#endif - module WriteToOutRef = let f1 (x: outref) = x <- 1 @@ -1297,11 +1334,6 @@ module ByrefReturnMemberTests = module WriteToByRefStructInner = let f1 (x: byref) = x.X <- 1 -#if NEGATIVE - module WriteToInRefStructInner = - let f1 (x: inref) = x.X <- 1 //not allowed -#endif - module WriteToOutRefStructInner = let f1 (x: outref) = x.X <- 1 @@ -1310,12 +1342,6 @@ module ByrefReturnMemberTests = let f1 (x: byref<'T>) = 1 let f2 (x: outref<'T>) = f1 &x -#if NEGATIVE - module InRefToByRef = - let f1 (x: byref<'T>) = 1 - let f2 (x: inref<'T>) = f1 &x // not allowed -#endif - module ByRefToByRef = let f1 (x: byref<'T>) = 1 let f2 (x: byref<'T>) = f1 &x @@ -1328,12 +1354,6 @@ module ByrefReturnMemberTests = let f1 (x: outref<'T>) = 1 let f2 (x: outref<'T>) = f1 &x -#if NEGATIVE - module InRefToOutRef = - let f1 (x: outref<'T>) = 1 - let f2 (x: inref<'T>) = f1 &x // not allowed -#endif - module ByRefToInRef = let f1 (x: inref<'T>) = 1 let f2 (x: byref<'T>) = f1 &x @@ -1352,13 +1372,6 @@ module ByrefReturnMemberTests = static member f1 (x: byref<'T>) = 1 let f2 (x: outref<'T>) = C.f1 &x -#if NEGATIVE - module InRefToByRefClassMethod = - type C() = - static member f1 (x: byref<'T>) = 1 - let f2 (x: inref<'T>) = C.f1 &x // not allowed -#endif - module ByRefToByRefClassMethod = type C() = static member f1 (x: byref<'T>) = 1 @@ -1374,13 +1387,6 @@ module ByrefReturnMemberTests = static member f1 (x: outref<'T>) = 1 let f2 (x: outref<'T>) = C.f1 &x -#if NEGATIVE - module InRefToOutRefClassMethod = - type C() = - static member f1 (x: outref<'T>) = 1 // not allowed - let f2 (x: inref<'T>) = C.f1 &x -#endif - module ByRefToInRefClassMethod = type C() = static member f1 (x: inref<'T>) = 1 @@ -1402,13 +1408,6 @@ module ByrefReturnMemberTests = static member f1 (x: byref<'T>) = 1 let f2 (x: outref<'T>) = C.f1(&x) -#if NEGATIVE - module InRefToByRefClassMethod2 = - type C() = - static member f1 (x: byref<'T>) = 1 - let f2 (x: inref<'T>) = C.f1(&x) // not allowed -#endif - module ByRefToByRefClassMethod2 = type C() = static member f1 (x: byref<'T>) = 1 @@ -1424,13 +1423,6 @@ module ByrefReturnMemberTests = static member f1 (x: outref<'T>) = 1 let f2 (x: outref<'T>) = C.f1(&x) -#if NEGATIVE - module InRefToOutRefClassMethod2 = - type C() = - static member f1 (x: outref<'T>) = 1 // not allowed - let f2 (x: inref<'T>) = C.f1(&x) -#endif - module ByRefToInRefClassMethod2 = type C() = static member f1 (x: inref<'T>) = 1 @@ -1445,12 +1437,6 @@ module ByrefReturnMemberTests = type C() = static member f1 (x: inref<'T>) = 1 let f2 (x: outref<'T>) = C.f1(&x) - -#if NEGATIVE - module UseOfLibraryOnly = - type C() = - static member f1 (x: byref<'T, 'U>) = 1 -#endif let aa = if !failures then (stdout.WriteLine "Test Failed"; exit 1) diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index 5eb2e1260d..411870900b 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -182,6 +182,8 @@ module CoreTests = fsc cfg "%s -o:test.exe -g" cfg.fsc_flags ["test.fsx"] + singleNegTest cfg "test" + exec cfg ("." ++ "test.exe") "" testOkFile.CheckExists() From baeaea3b0ec399ee8cd4699898d4e04527dacfa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbyn=C4=9Bk=20Sailer?= Date: Fri, 29 Jun 2018 14:21:18 +0200 Subject: [PATCH 059/150] LOC CHECKIN | Microsoft/visualfsharp master | 20180629 --- src/fsharp/xlf/FSComp.txt.cs.xlf | 30 +++++++++---------- src/fsharp/xlf/FSComp.txt.de.xlf | 30 +++++++++---------- src/fsharp/xlf/FSComp.txt.es.xlf | 30 +++++++++---------- src/fsharp/xlf/FSComp.txt.fr.xlf | 30 +++++++++---------- src/fsharp/xlf/FSComp.txt.it.xlf | 30 +++++++++---------- src/fsharp/xlf/FSComp.txt.ja.xlf | 30 +++++++++---------- src/fsharp/xlf/FSComp.txt.ko.xlf | 30 +++++++++---------- src/fsharp/xlf/FSComp.txt.pl.xlf | 30 +++++++++---------- src/fsharp/xlf/FSComp.txt.pt-BR.xlf | 30 +++++++++---------- src/fsharp/xlf/FSComp.txt.ru.xlf | 30 +++++++++---------- src/fsharp/xlf/FSComp.txt.tr.xlf | 30 +++++++++---------- src/fsharp/xlf/FSComp.txt.zh-Hans.xlf | 30 +++++++++---------- src/fsharp/xlf/FSComp.txt.zh-Hant.xlf | 30 +++++++++---------- .../src/FSharp.UIResources/xlf/Strings.cs.xlf | 14 ++++----- .../src/FSharp.UIResources/xlf/Strings.de.xlf | 14 ++++----- .../src/FSharp.UIResources/xlf/Strings.es.xlf | 14 ++++----- .../src/FSharp.UIResources/xlf/Strings.fr.xlf | 14 ++++----- .../src/FSharp.UIResources/xlf/Strings.it.xlf | 14 ++++----- .../src/FSharp.UIResources/xlf/Strings.ja.xlf | 14 ++++----- .../src/FSharp.UIResources/xlf/Strings.ko.xlf | 14 ++++----- .../src/FSharp.UIResources/xlf/Strings.pl.xlf | 14 ++++----- .../FSharp.UIResources/xlf/Strings.pt-BR.xlf | 14 ++++----- .../src/FSharp.UIResources/xlf/Strings.ru.xlf | 14 ++++----- .../src/FSharp.UIResources/xlf/Strings.tr.xlf | 14 ++++----- .../xlf/Strings.zh-Hans.xlf | 14 ++++----- .../xlf/Strings.zh-Hant.xlf | 14 ++++----- 26 files changed, 286 insertions(+), 286 deletions(-) diff --git a/src/fsharp/xlf/FSComp.txt.cs.xlf b/src/fsharp/xlf/FSComp.txt.cs.xlf index 20b3f7d11a..50fa54a350 100644 --- a/src/fsharp/xlf/FSComp.txt.cs.xlf +++ b/src/fsharp/xlf/FSComp.txt.cs.xlf @@ -6984,77 +6984,77 @@ The byref pointer is readonly, so this write is not permitted. - The byref pointer is readonly, so this write is not permitted. + Ukazatel byref je jen pro čtení, proto tento zápis není povolený. A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' - A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + Hodnota musí být proměnlivá, aby se dal změnit obsah nebo aby se dala převzít adresa typu hodnoty, třeba let mutable x = ... A ReadOnly attribute has been applied to a struct type with a mutable field. - A ReadOnly attribute has been applied to a struct type with a mutable field. + Atribut ReadOnly byl použit na typ struktury s měnitelným (proměnlivým) polem. A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. - A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + Přes ukazatel byref vrácený funkcí nebo metodou se ve výchozím nastavení přistupuje od verze F# 4.5. Pokud chcete získat vrácenou hodnotu jako ukazatel, použijte operátor address-of, např. &f(x) nebo &obj.Method(arg1, arg2). A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. - A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + Typ s přidanou poznámkou IsByRefLike musí být také struktura. Bylo by vhodné přidat do typu atribut [<Struct>]. The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + Adresa proměnné {0} nebo související výraz nejde v tomto bodě použít. Je tím zajištěno, aby adresa lokální hodnoty neunikla ze svého rozsahu. The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + Výraz Span nebo IsByRefLike nejde vrátit z této funkce nebo metody, protože se skládá pomocí elementů, které můžou uniknout ze svého rozsahu. This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. - This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + Tuto hodnotu nejde přiřadit, protože cíl {0} může odkazovat na paměť, která nepoužívá lokální zásobník (non-stack-local), zatímco přiřazovaný výraz je vyhodnocený tak, že může případně odkazovat na paměť s lokálním zásobníkem (stack-local). Díky tomu se zabraňuje, aby ukazatele na paměť svázanou se zásobníkem (stack-bound) unikly ze svého rozsahu. A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' - A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + Hodnot definovaná v modulu musí být měnitelná, aby se mohla převzít její adresa, např. let mutable x = ... A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. - A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + Typ s přidanou poznámkou IsReadOnly musí být také struktura. Bylo by vhodné přidat do typu atribut [<Struct>]. Struct members cannot return the address of fields of the struct by reference - Struct members cannot return the address of fields of the struct by reference + Členové struktury nemůžou vrátit adresu polí struktury podle odkazu. The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. - The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + Volání funkce nebo metody nejde v tomto bodě použít, protože jeden argument, který je byref typu Span nebo IsByRefLike, který nepoužívá lokální zásobník (non-stack-local), je použitý s jiným argumentem, který je typu Span nebo IsByRefLike, který používá lokální zásobník (stack-local). Je tím zajištěno, aby adresa lokální hodnoty neunikla ze svého rozsahu. The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + Adresa hodnoty vrácené z výrazu nejde v tomto bodě použít. Je tím zajištěno, aby adresa lokální hodnoty neunikla ze svého rozsahu. The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + Proměnná Span nebo IsByRefLike {0} nejde v tomto bodě použít. Je tím zajištěno, aby adresa lokální hodnoty neunikla ze svého rozsahu. A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. - A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + Hodnota Span nebo IsByRefLike vrácená z výrazu nejde v tomto bodě použít. Je tím zajištěno, aby adresa lokální hodnoty neunikla ze svého rozsahu. diff --git a/src/fsharp/xlf/FSComp.txt.de.xlf b/src/fsharp/xlf/FSComp.txt.de.xlf index 07fac137c6..5a6b0a3def 100644 --- a/src/fsharp/xlf/FSComp.txt.de.xlf +++ b/src/fsharp/xlf/FSComp.txt.de.xlf @@ -6984,77 +6984,77 @@ The byref pointer is readonly, so this write is not permitted. - The byref pointer is readonly, so this write is not permitted. + Der byref-Zeiger ist schreibgeschützt, daher ist dieser Schreibvorgang unzulässig. A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' - A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + Ein Wert muss änderbar sein, um die Inhalte eines Werttyps zu mutieren oder seine Adresse zu übernehmen, z.B. "let mutable x = ...". A ReadOnly attribute has been applied to a struct type with a mutable field. - A ReadOnly attribute has been applied to a struct type with a mutable field. + Auf einen Strukturtyp mit einem veränderbaren Feld wurde ein ReadOnly-Attribut angewendet. A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. - A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + Ein von einer Funktion oder Methode zurückgegebener byref-Zeiger wird ab F# 4.5 implizit dereferenziert. Um den Rückgabewert als Zeiger abzurufen, verwenden Sie den Operator "address-of", z. B. "&f(x)" oder "&obj.Method(arg1, arg2)". A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. - A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + Ein Typ mit der Anmerkung "IsByRefLike" muss auch eine Struktur sein. Ziehen Sie in Betracht, dem Typ das Attribut "[<Struct>]" hinzuzufügen. The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + Die Adresse der Variablen "{0}" oder ein entsprechender Ausdruck kann zu diesem Zeitpunkt nicht verwendet werden. Hierdurch wird sichergestellt, dass die Adresse des lokalen Werts den zugehörigen Bereich nicht verlässt. The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + Der Ausdruck "Span" oder "IsByRefLike" kann von dieser Funktion oder Methode nicht zurückgegeben werden, weil er anhand von Elementen zusammengestellt wurde, die möglicherweise ihren Bereich verlassen. This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. - This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + Dieser Wert kann nicht zugewiesen werden, weil das Ziel "{0}" möglicherweise auf einen lokalen Nicht-Stapel-Arbeitsspeicher verweist, während der zugewiesene Ausdruck laut Auswertung möglicherweise auf einen lokalen Stapelarbeitsspeicher verweist. So wird verhindert, dass Zeiger auf stapelgebundenen Arbeitsspeicher ihren Bereich verlassen. A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' - A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + Ein in einem Modul definierter Wert muss änderbar sein, um die Adresse anzunehmen, z. B. "let mutable x = ...". A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. - A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + Ein Typ mit der Anmerkung "IsReadOnly" muss auch eine Struktur sein. Ziehen Sie in Betracht, dem Typ das Attribut "[<Struct>]" hinzuzufügen. Struct members cannot return the address of fields of the struct by reference - Struct members cannot return the address of fields of the struct by reference + Strukturmember können die Adresse von Feldern der Struktur nicht per Referenz zurückgeben. The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. - The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + Der Funktions- oder Methodenaufruf kann zu diesem Zeitpunkt nicht verwendet werden, weil ein Argument, das ein byref-Zeiger eines lokalen Nicht-Stapel-Span- oder -IsByRefLike-Typs ist, mit einem anderen Argument verwendet wird, das ein lokaler Stapel-Span oder -IsByRefLike-Typ ist. Hierdurch wird sichergestellt, dass die Adresse des lokalen Werts den zugehörigen Bereich nicht verlässt. The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + Die Adresse eines vom Ausdruck zurückgegebenen Werts kann zu diesem Zeitpunkt nicht verwendet werden. Hierdurch wird sichergestellt, dass die Adresse des lokalen Werts den zugehörigen Bereich nicht verlässt. The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + Die Span- oder IsByRefLike-Variable "{0}" kann zu diesem Zeitpunkt nicht verwendet werden. Hierdurch wird sichergestellt, dass die Adresse des lokalen Werts den zugehörigen Bereich nicht verlässt. A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. - A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + Ein vom Ausdruck zurückgegebener Span- oder IsByRefLike-Wert kann zu diesem Zeitpunkt nicht verwendet werden. Hierdurch wird sichergestellt, dass die Adresse des lokalen Werts den zugehörigen Bereich nicht verlässt. diff --git a/src/fsharp/xlf/FSComp.txt.es.xlf b/src/fsharp/xlf/FSComp.txt.es.xlf index 4b6e994191..13a5f9fd0f 100644 --- a/src/fsharp/xlf/FSComp.txt.es.xlf +++ b/src/fsharp/xlf/FSComp.txt.es.xlf @@ -6984,77 +6984,77 @@ The byref pointer is readonly, so this write is not permitted. - The byref pointer is readonly, so this write is not permitted. + El puntero byref es de solo lectura, por lo que no se permite esta operación de escritura. A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' - A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + Un valor debe ser mutable para poder mutar el contenido o tomar la dirección de un tipo de valor; por ejemplo, 'let mutable x = ...' A ReadOnly attribute has been applied to a struct type with a mutable field. - A ReadOnly attribute has been applied to a struct type with a mutable field. + Se ha aplicado el atributo ReadOnly a un tipo de estructura con un campo mutable. A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. - A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + A partir de F# 4.5, un puntero byref devuelto por una función o un método se desreferencia de forma implícita. Para obtener el valor devuelto en forma de puntero, use el operador address-of; por ejemplo, “&f(x)” o “&obj.Method(arg1, arg2)”. A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. - A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + Un tipo anotado con IsByRefLike debe ser también una estructura. Considere la posibilidad de agregar el atributo [<Struct>] al tipo. The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + En este punto, no se puede usar la dirección de la variable “{0}” o una expresión relacionada. Esto es para asegurar que la dirección del valor local no escape de su ámbito. The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + Esta función o este método no puede devolver la expresión Span o IsByRefLike, porque está compuesta por elementos que pueden escapar de su ámbito. This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. - This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + No se puede asignar este valor porque el destino “{0}” puede hacer referencia a memoria local fuera de la pila, mientras que la expresión que se va a asignar podría hacer referencia a memoria local de la pila. Esto es para evitar que los punteros de memoria ligada a la pila escapen de su ámbito. A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' - A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + Un valor definido en un módulo debe ser mutable para tomar su dirección; por ejemplo, “let mutable x = ...” A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. - A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + Un tipo anotado con IsReadOnly debe ser también una estructura. Considere la posibilidad de agregar el atributo [<Struct>] al tipo. Struct members cannot return the address of fields of the struct by reference - Struct members cannot return the address of fields of the struct by reference + Los miembros de estructura no pueden devolver la dirección de los campos de la estructura por referencia The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. - The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + En este punto, no se puede usar la función o el método, porque un argumento que es un parámetro byref de un tipo local Span o IsByRefLike fuera de la pila se utiliza con otro argumento que es un tipo local Span o IsByRefLike de la pila. Esto es para asegurar que la dirección del valor local no escape de su ámbito. The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + En este punto, no se puede usar la dirección de un valor devuelto por la expresión. Esto es para asegurar que la dirección del valor local no escape de su ámbito. The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + En este punto, no se puede usar la variable Span o IsByRefLike “{0}”. Esto es para asegurar que la dirección del valor local no escape de su ámbito. A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. - A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + En este punto, no se puede usar un valor Span o IsByRefLike devuelto por la expresión. Esto es para asegurar que la dirección del valor local no escape de su ámbito. diff --git a/src/fsharp/xlf/FSComp.txt.fr.xlf b/src/fsharp/xlf/FSComp.txt.fr.xlf index a02e755da7..2e0c818455 100644 --- a/src/fsharp/xlf/FSComp.txt.fr.xlf +++ b/src/fsharp/xlf/FSComp.txt.fr.xlf @@ -6984,77 +6984,77 @@ The byref pointer is readonly, so this write is not permitted. - The byref pointer is readonly, so this write is not permitted. + Le pointeur byref étant en lecture seule, cette écriture n'est pas autorisée. A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' - A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + Une valeur doit être mutable pour pouvoir muter le contenu ou accepter l'adresse d'un type valeur, par exemple 'let mutable x = ...' A ReadOnly attribute has been applied to a struct type with a mutable field. - A ReadOnly attribute has been applied to a struct type with a mutable field. + Un attribut ReadOnly a été appliqué à un type struct avec un champ mutable. A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. - A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + Un pointeur byref retourné par une fonction ou une méthode est déréférencé implicitement à compter de F# 4.5. Pour acquérir la valeur de retour comme pointeur, utilisez l'opérateur &. Par exemple : '&f(x)' ou '&obj.Method(arg1, arg2)'. A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. - A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + Un type annoté avec IsByRefLike doit également être un struct. Ajoutez l'attribut [<Struct>] au type. The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + L'adresse de la variable '{0}' ou une expression associée ne peut pas être utilisée à ce stade. Cela permet de s'assurer que l'adresse de la valeur locale ne sort pas de sa portée. The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + L'expression Span ou IsByRefLike ne peut pas être retournée à partir de cette fonction ou méthode, car elle est composée d'éléments qui peuvent sortir de leur portée. This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. - This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + Impossible d’affecter cette valeur car la cible '{0}' peut faire référence à une mémoire non locale (hors de la pile), tandis que l'expression en cours d’affectation est évaluée comme faisant potentiellement référence à une mémoire locale (dans la pile). Cela permet d'éviter que les pointeurs vers la mémoire liée à la pile ne sortent de leur portée. A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' - A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + Une valeur définie dans un module doit être mutable pour prendre son adresse. Par exemple : 'let mutable x = ...'. A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. - A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + Un type annoté avec IsReadOnly doit également être un struct. Ajoutez l'attribut [<Struct>] au type. Struct members cannot return the address of fields of the struct by reference - Struct members cannot return the address of fields of the struct by reference + Les membres du struct ne peuvent pas retourner l'adresse des champs du struct par référence The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. - The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + Impossible d’utiliser l'appel de fonction ou de méthode à ce stade, car un argument qui est un byref d'un type Span ou IsByRefLike non local (hors de la pile) est utilisé avec un autre argument de type Span ou IsByRefLike local (dans la pile). Cela permet d'éviter que l'adresse de la valeur locale ne sorte de sa portée. The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + L'adresse d'une valeur retournée par l'expression ne peut pas être utilisée à ce stade. Cela permet d'éviter que l'adresse de la valeur locale ne sorte de sa portée. The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + Impossible d’utiliser la variable Span ou IsByRefLike '{0}' à ce stade. Cela permet d'éviter que l'adresse de la valeur locale ne sorte de sa portée. A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. - A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + Impossible d’utiliser une valeur Span ou IsByRefLike retournée par l'expression à ce stade. Cela permet d'éviter que l'adresse de la valeur locale ne sorte de sa portée. diff --git a/src/fsharp/xlf/FSComp.txt.it.xlf b/src/fsharp/xlf/FSComp.txt.it.xlf index 196d719798..49f6b07170 100644 --- a/src/fsharp/xlf/FSComp.txt.it.xlf +++ b/src/fsharp/xlf/FSComp.txt.it.xlf @@ -6984,77 +6984,77 @@ The byref pointer is readonly, so this write is not permitted. - The byref pointer is readonly, so this write is not permitted. + Il puntatore byref è di sola lettura, di conseguenza questa operazione di scrittura non è consentita. A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' - A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + Un valore deve essere modificabile per poter modificare i contenuti oppure utilizzare l'indirizzo di un tipo di valore, ad esempio 'let mutable x = ...' A ReadOnly attribute has been applied to a struct type with a mutable field. - A ReadOnly attribute has been applied to a struct type with a mutable field. + Un attributo ReadOnly è stato applicato a un tipo struct con campo modificabile. A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. - A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + Un puntatore byref restituito da una funzione o da un metodo è deferenziato in modo implicito a partire da F# 4.5. Per acquisire il valore restituito come puntatore, usare l'operatore address-of, ad esempio '&f(x)' o '&obj.Method(arg1, arg2)'. A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. - A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + Un tipo annotato con IsByRefLike deve essere anche uno struct. Provare ad aggiungere l'attributo [<Struct>] al tipo. The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + In questo punto non è possibile usare l'indirizzo della variabile '{0}' o un'espressione correlata. Questo serve ad assicurare che l'indirizzo del valore locale non ignori il relativo ambito. The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + Questa funzione o questo metodo non può restituire l'espressione Span o IsByRefLike perché è composta usando elementi che potrebbero ignorare il relativo ambito. This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. - This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + Non è possibile assegnare questo valore perché l'elemento '{0}' di destinazione può fare riferimento alla memoria locale non stack, mentre l'espressione da assegnare viene valutata in modo da fare potenzialmente riferimento alla memoria locale stack. Tale comportamento consente di evitare puntatori a memoria associata allo stack che ignorano il relativo ambito. A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' - A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + Un valore definito in un modulo deve essere modificabile per poterne accettare l'indirizzo, ad esempio 'let mutable x = ...' A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. - A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + Un tipo annotato con IsReadOnly deve essere anche uno struct. Provare ad aggiungere l'attributo [<Struct>] al tipo. Struct members cannot return the address of fields of the struct by reference - Struct members cannot return the address of fields of the struct by reference + I membri struct non possono restituire l'indirizzo di campi dello struct per riferimento The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. - The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + In questo punto non è possibile usare la chiamata al metodo o alla funzione perché un argomento che è un byref di un tipo Span o IsByRefLike locale non stack viene usato con un altro argomento che è un tipo Span o IsByRefLike locale stack. Questo serve ad assicurare che l'indirizzo del valore locale non ignori il relativo ambito. The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + In questo punto non è possibile usare l'indirizzo di un valore restituito dall'espressione. Questo serve ad assicurare che l'indirizzo del valore locale non ignori il relativo ambito. The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + In questo punto non è possibile usare la variabile '{0}' di Span o IsByRefLike. Questo serve ad assicurare che l'indirizzo del valore locale non ignori il relativo ambito. A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. - A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + In questo punto non è possibile usare un valore Span o IsByRefLike restituito dall'espressione. Questo serve ad assicurare che l'indirizzo del valore locale non ignori il relativo ambito. diff --git a/src/fsharp/xlf/FSComp.txt.ja.xlf b/src/fsharp/xlf/FSComp.txt.ja.xlf index 62ce505a7d..843ec0e8df 100644 --- a/src/fsharp/xlf/FSComp.txt.ja.xlf +++ b/src/fsharp/xlf/FSComp.txt.ja.xlf @@ -6984,77 +6984,77 @@ The byref pointer is readonly, so this write is not permitted. - The byref pointer is readonly, so this write is not permitted. + byref ポインターは読み取り専用であるため、この書き込みは許可されません。 A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' - A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + 値の型の内容を変更するか、値の型のアドレスを使用するために、値は変更可能にする必要があります (たとえば、'let mutable x = ...') A ReadOnly attribute has been applied to a struct type with a mutable field. - A ReadOnly attribute has been applied to a struct type with a mutable field. + 読み取り専用の属性が、変更可能なフィールドを持つ構造体型に適用されました。 A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. - A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + F# 4.5 の時点で、関数またはメソッドから返される byref ポインターは、暗黙的に逆参照されます。戻り値をポインターとして取得するには、演算子のアドレスを使用してください。例: '&f(x)' または '&obj.Method(arg1, arg2)'。 A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. - A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + IsByRefLike で注釈を付けられた型は、構造体でもある必要があります。型に [<Struct>] 属性を追加することを検討してください。 The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + 現時点で、変数 '{0}' または関連する式のアドレスは使用できません。これは、ローカル値のアドレスがスコープを回避しないようにするためです。 The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + この関数またはメソッドから Span または IsByRefLike 式を返すことはできません。スコープを回避できる要素を使用してその式が作成されているためです。 This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. - This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + この値をターゲット '{0}' に割り当てることはできません。このターゲットは非スタック ローカルのメモリを参照できるのに対して、割り当てられる式はスタック ローカルのメモリに評価される可能性があるためです。これは、スタックにバインドされたメモリへのポインターが自身のスコープを回避することを防止するために役立ちます。 A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' - A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + モジュール内で定義する値のアドレスを取得するには、その値を変更可能にする必要があります。例: 'let mutable x = ...' A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. - A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + IsReadOnly で注釈を付けられた型は、構造体でもある必要があります。型に [<Struct>] 属性を追加することを検討してください。 Struct members cannot return the address of fields of the struct by reference - Struct members cannot return the address of fields of the struct by reference + 構造体メンバーは、構造体のフィールドのアドレスを参照渡しで返すことはできません The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. - The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + 現時点で、関数またはメソッドの呼び出しは使用できません。非スタック ローカルの Span または IsByRefLike 型の byref である 1 つの引数が、スタック ローカルの Span または IsByRefLike 型である別の引数と一緒に使用されています。これは、ローカル値のアドレスがスコープを回避しないようにするためです。 The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + 現時点で、式から返される値のアドレスは使用できません。これは、ローカル値のアドレスがスコープを回避しないようにするためです。 The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + 現時点で、Span または IsByRefLike 変数 '{0}' は使用できません。これは、ローカル値のアドレスがスコープを回避しないようにするためです。 A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. - A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + 現時点で、式から返される Span または IsByRefLike 値は使用できません。これは、ローカル値のアドレスがスコープを回避しないようにするためです。 diff --git a/src/fsharp/xlf/FSComp.txt.ko.xlf b/src/fsharp/xlf/FSComp.txt.ko.xlf index 154641f8eb..98da207f58 100644 --- a/src/fsharp/xlf/FSComp.txt.ko.xlf +++ b/src/fsharp/xlf/FSComp.txt.ko.xlf @@ -6984,77 +6984,77 @@ The byref pointer is readonly, so this write is not permitted. - The byref pointer is readonly, so this write is not permitted. + byref 포인터는 읽기 전용이므로 이 쓰기가 허용되지 않습니다. A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' - A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + 내용을 변경하거나 값 형식의 주소를 사용하려면 값을 변경할 수 있어야 합니다(예: 'let mutable x = ...'). A ReadOnly attribute has been applied to a struct type with a mutable field. - A ReadOnly attribute has been applied to a struct type with a mutable field. + 변경할 수 있는 필드가 있는 구조체 형식에 ReadOnly 특성이 적용되었습니다. A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. - A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + 함수 또는 메서드에 의해 반환된 byref 포인터가 F# 4.5부터 암시적으로 역참조됩니다. 포인터로 반환 값을 가져오려면 address-of 연산자를 사용하세요(예: '&f(x)' 또는 '&obj.Method(arg1, arg2)'). A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. - A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + IsByRefLike로 주석이 추가된 형식은 구조체여야 합니다. 형식에 [<Struct>] 특성을 추가하세요. The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + 지금은 '{0}' 변수의 주소 또는 관련 식을 사용할 수 없습니다. 로컬 값의 주소가 범위를 벗어나지 않도록 하기 위한 것입니다. The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + 범위를 벗어날 수 있는 요소를 사용하여 구성되므로 이 함수 또는 메서드에서 Span 또는 IsByRefLike 식을 반환할 수 없습니다. This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. - This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + '{0}' 대상이 비스택 로컬 메모리를 참조할 수 있는데, 할당되는 식은 잠재적으로 스택 로컬 메모리를 참조하도록 평가되므로 이 값을 할당할 수 없습니다. 스택에 바인딩된 메모리에 대한 포인터가 범위를 벗어나지 않도록 하기 위한 것입니다. A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' - A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + 해당 주소를 사용하려면 모듈에 정의된 값이 변경 가능해야 합니다(예: 'let mutable x = ...'). A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. - A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + IsReadOnly로 주석이 추가된 형식은 구조체여야 합니다. 형식에 [<Struct>] 특성을 추가하세요. Struct members cannot return the address of fields of the struct by reference - Struct members cannot return the address of fields of the struct by reference + 구조체 멤버는 구조체의 필드 주소를 참조로 반환할 수 없습니다. The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. - The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + 비스택 로컬 Span 또는 IsByRefLike 형식의 byref인 한 인수가 스택 로컬 Span 또는 IsByRefLike 형식인 다른 인수와 함께 사용되므로 지금은 함수 또는 메서드 호출을 사용할 수 없습니다. 로컬 값의 주소가 범위를 벗어나지 않도록 하기 위한 것입니다. The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + 지금은 식에서 반환된 값의 주소를 사용할 수 없습니다. 로컬 값의 주소가 범위를 벗어나지 않도록 하기 위한 것입니다. The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + 지금은 Span 또는 IsByRefLike 변수 '{0}'을(를) 사용할 수 없습니다. 로컬 값의 주소가 범위를 벗어나지 않도록 하기 위한 것입니다. A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. - A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + 지금은 식에서 반환된 Span 또는 IsByRefLike 값을 사용할 수 없습니다. 로컬 값의 주소가 범위를 벗어나지 않도록 하기 위한 것입니다. diff --git a/src/fsharp/xlf/FSComp.txt.pl.xlf b/src/fsharp/xlf/FSComp.txt.pl.xlf index f322093935..425d65f5a1 100644 --- a/src/fsharp/xlf/FSComp.txt.pl.xlf +++ b/src/fsharp/xlf/FSComp.txt.pl.xlf @@ -6984,77 +6984,77 @@ The byref pointer is readonly, so this write is not permitted. - The byref pointer is readonly, so this write is not permitted. + Wskaźnik byref jest tylko do odczytu, więc ten zapis nie jest dozwolony. A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' - A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + Aby można było zmodyfikować zawartość lub pobrać adres typu wartości, wartość musi być modyfikowalna, na przykład „let mutable x = ...” A ReadOnly attribute has been applied to a struct type with a mutable field. - A ReadOnly attribute has been applied to a struct type with a mutable field. + Atrybut ReadOnly został zastosowany do typu struktury z polem modyfikowalnym. A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. - A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + Wskaźnik byref zwracany przez funkcję lub metodę jest niejawnie wyłuskiwany, począwszy od wersji 4.5 języka F#. Aby pobrać wartość zwracaną jako wskaźnik, użyj operatora address-of, np. „&f(x)” lub „&obj.Method(arg1, arg2)”. A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. - A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + Typ z adnotacją IsByRefLike musi również być strukturą. Rozważ dodanie atrybutu [<Struct>] do tego typu. The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + W tym miejscu nie można użyć adresu zmiennej „{0}” ani powiązanego wyrażenia. Ma to na celu uniemożliwienie adresowi wartości lokalnej wykroczenia poza zakres. The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + Z tej funkcji lub metody nie można zwrócić wyrażenia Span ani IsByRefLike, ponieważ jest ona złożona przy użyciu elementów, które mogą wykroczyć poza swój zakres. This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. - This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + Ta wartość nie może zostać przypisana, ponieważ element docelowy „{0}” może odwoływać się do pamięci innej niż pamięć lokalna dla stosu, natomiast przypisywane wyrażenie może potencjalnie odwoływać się do pamięci lokalnej dla stosu. Dzięki temu łatwiej uniemożliwić wskaźnikom do pamięci powiązanej ze stosem wykroczenie poza ich zakres. A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' - A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + Wartość zdefiniowana w module musi być modyfikowalna w celu uzyskania jej adresu, np. „let mutable x = ...” A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. - A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + Typ z adnotacją IsReadOnly musi również być strukturą. Rozważ dodanie atrybutu [<Struct>] do tego typu. Struct members cannot return the address of fields of the struct by reference - Struct members cannot return the address of fields of the struct by reference + Składowe struktury nie mogą zwracać adresów pól struktury przez odwołanie The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. - The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + W tym miejscu nie można użyć wywołania funkcji lub metody, ponieważ jeden argument, który jest elementem byref typu Span lub IsByRefLike innego niż lokalnego dla stosu, został użyty z innym argumentem, który jest typem Span lub IsByRefLike lokalnym dla stosu. Ma to na celu zapewnienie, że adres wartości lokalnej nie wykracza poza swój zakres. The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + W tym miejscu nie można użyć adresu wartości zwróconej z wyrażenia. Ma to na celu uniemożliwienie adresowi wartości lokalnej wykroczenia poza zakres. The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + W tym miejscu nie można użyć zmiennej Span lub IsByRefLike „{0}”. Ma to na celu uniemożliwienie adresowi wartości lokalnej wykroczenia poza zakres. A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. - A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + W tym miejscu nie można użyć wartości Span lub IsByRefLike zwróconej z wyrażenia. Ma to na celu uniemożliwienie adresowi wartości lokalnej wykroczenia poza zakres. diff --git a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf index d58b9e78cb..22e5a394c5 100644 --- a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf +++ b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf @@ -6984,77 +6984,77 @@ The byref pointer is readonly, so this write is not permitted. - The byref pointer is readonly, so this write is not permitted. + O ponteiro byref é somente leitura. Portanto, esta gravação não é permitida. A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' - A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + Um valor deve ser mutável para que seja possível mudar o conteúdo ou pegar o endereço de um tipo de valor, por exemplo: 'let mutable x = ...' A ReadOnly attribute has been applied to a struct type with a mutable field. - A ReadOnly attribute has been applied to a struct type with a mutable field. + O atributo ReadOnly foi aplicado a um tipo de struct com um campo mutável. A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. - A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + Um ponteiro byref retornado por uma função ou um método é implicitamente desreferenciado de F # 4.5. Para adquirir o valor retornado como um ponteiro, utilize o operador de endereços, por exemplo, '&f(x)' ou '&obj.Method(arg1, arg2)'. A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. - A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + Um tipo anotado com IsByRefLike também deve ser um struct. Considere adicionar o atributo [<Struct>] ao tipo. The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + O endereço da variável '{0}' ou de uma expressão relacionada não pode ser utilizado neste ponto. Isso tem como objetivo garantir que o endereço do valor local não escape de seu escopo. The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + A expressão Span ou IsByRefLike não pode ser retornada desta função ou deste método porque ela é composta utilizando elementos que podem escapar de seu escopo. This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. - This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + Este valor não pode ser atribuído porque o destino '{0}' pode se referir a uma memória local não empilhada, enquanto a expressão que está sendo atribuída é avaliada para possivelmente se referir à memória local empilhada. Isso tem como objetivo ajudar a evitar que os ponteiros da memória vinculada à pilha escapem de seu escopo. A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' - A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + O valor definido em um módulo deve ser mutável para obter seu endereço, por exemplo, 'let mutable x = ...' A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. - A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + Um tipo anotado com IsReadOnly também deve ser um struct. Considere adicionar o atributo [<Struct>] ao tipo. Struct members cannot return the address of fields of the struct by reference - Struct members cannot return the address of fields of the struct by reference + Os membros do struct não podem retornar o endereço dos campos do struct por referência The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. - The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + A função ou a chamada do método não pode ser utilizada neste ponto porque um argumento, que é um byref de um tipo Span ou IsByRefLike local não empilhado, é utilizado com outro argumento, que é um tipo Span ou IsByRefLike local empilhado. Isso tem como objetivo garantir que o endereço do valor local não escape de seu escopo. The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + O endereço de um valor retornado da expressão não pode ser utilizado neste ponto. Isso tem como objetivo garantir que o endereço do valor local não escape de seu escopo. The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + A variável '{0}' de Span ou IsByRefLike não pode ser utilizada neste ponto. Isso tem como objetivo garantir que o endereço do valor local não escape de seu escopo. A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. - A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + O valor Span ou IsByRefLike retornado da expressão não pode ser utilizado neste ponto. Isso tem como objetivo garantir que o endereço do valor local não escape de seu escopo. diff --git a/src/fsharp/xlf/FSComp.txt.ru.xlf b/src/fsharp/xlf/FSComp.txt.ru.xlf index 0572b50435..c1932c0d8c 100644 --- a/src/fsharp/xlf/FSComp.txt.ru.xlf +++ b/src/fsharp/xlf/FSComp.txt.ru.xlf @@ -6984,77 +6984,77 @@ The byref pointer is readonly, so this write is not permitted. - The byref pointer is readonly, so this write is not permitted. + Указатель byref доступен только для чтения, поэтому операция записи запрещена. A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' - A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + Чтобы изменить содержимое или получить адрес типа значения, значение должно быть изменяемым, например, "let mutable x = ..." A ReadOnly attribute has been applied to a struct type with a mutable field. - A ReadOnly attribute has been applied to a struct type with a mutable field. + Атрибут ReadOnly был применен к типу структуры с изменяемым полем. A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. - A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + Указатель byref, возвращаемый функцией или методом, неявным образом разыменовывается в F# 4.5. Для получения возвращаемого значения в виде указателя используйте оператор address-of, например &f(x) или &obj.Method(arg1, arg2). A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. - A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + Тип с аннотацией IsByRefLike также должен быть структурой. Рекомендуется добавить к типу атрибут [<Struct>]. The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + На этом этапе невозможно использовать адрес переменной "{0}" или связанного выражения. В этом случае гарантируется, что адрес локального значения не обходит свою область. The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + Выражение Span или IsByRefLike не может быть возвращено этой функцией или методом, так как оно создано с помощью элементов, которые могут обходить свою область. This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. - This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + Это значение не может быть назначено, так как целевой элемент "{0}" может ссылаться на отличную от локальной для стека память, тогда как назначаемое выражение оценивается как потенциально ссылающееся на локальную для стека память. В этом случае гарантируется, что указатели на привязанную к стеку память не обходят свою область. A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' - A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + Чтобы получить свой адрес, значение, определенное в модуле, должно быть изменяемым, например "let mutable x = ...". A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. - A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + Тип с аннотацией IsReadOnly также должен быть структурой. Рекомендуется добавить к типу атрибут [<Struct>]. Struct members cannot return the address of fields of the struct by reference - Struct members cannot return the address of fields of the struct by reference + Члены структуры не могут возвращать адрес полей структуры по ссылке The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. - The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + На этом этапе невозможно использовать вызов функции или метода, так как один аргумент, представляющий собой byref с отличным от локального для стека типом Span или IsByRefLike, используется с другим аргументом, имеющим локальный для стека тип Span или IsByRefLike. В этом случае гарантируется, что адрес локального значения не обходит свою область. The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + На этом этапе невозможно использовать адрес значения, возвращаемого выражением. В этом случае гарантируется, что адрес локального значения не обходит свою область. The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + На этом этапе невозможно использовать переменную Span или IsByRefLike "{0}". В этом случае гарантируется, что адрес локального значения не обходит свою область. A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. - A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + На этом этапе невозможно использовать значение Span или IsByRefLike, возвращаемое выражением. В этом случае гарантируется, что адрес локального значения не обходит свою область. diff --git a/src/fsharp/xlf/FSComp.txt.tr.xlf b/src/fsharp/xlf/FSComp.txt.tr.xlf index a15e11019b..3cc7ff0ba7 100644 --- a/src/fsharp/xlf/FSComp.txt.tr.xlf +++ b/src/fsharp/xlf/FSComp.txt.tr.xlf @@ -6984,77 +6984,77 @@ The byref pointer is readonly, so this write is not permitted. - The byref pointer is readonly, so this write is not permitted. + Byref işaretçisi salt okunur olduğundan bu yazma işlemine izin verilmiyor. A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' - A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + İçeriği değiştirmek veya değer türünün adresini almak için bir değerin değiştirilebilir olması gerekir, örn. 'let mutable x = ...' A ReadOnly attribute has been applied to a struct type with a mutable field. - A ReadOnly attribute has been applied to a struct type with a mutable field. + Değiştirilebilir bir alana sahip bir yapı türüne ReadOnly özniteliği uygulandı. A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. - A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + Bir işlev veya metot tarafından döndürülen bir byref işaretçisinin başvurusu F# 4.5 itibarıyla örtük olarak kaldırıldı. Dönüş değerini bir işaretçi olarak edinmek için address-of işlecini kullanın. Örn. '&f(x)' veya '&obj.Method(arg1, arg2)'. A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. - A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + IsByRefLike ek açıklaması eklenmiş bir tür aynı zamanda bir yapı olmalıdır. Türe [<Struct>] özniteliğini eklemeyi göz önünde bulundurun. The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + Bu noktada '{0}' değişkeninin veya ilgili bir değişkenin adresi kullanılamaz. Bunun amacı, yerel değerin adresinin kapsamı dışına kaçmasını engellemektir. The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + Span veya IsByRefLike ifadesi kapsamından kaçabilecek öğeler kullanılarak oluşturulduğundan, bu işlev veya metottan döndürülemez. This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. - This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + '{0}' hedefi yığında yerel olmayan belleğe başvurabileceğinden ve atanmakta olan ifadenin yığında yerel belleğe başvurma olasılığının olduğu tespit edildiğinden bu değer atanamaz. Bunun amacı, yığınla sınırlı belleğe yönelik işaretçilerin kapsamlarından kaçmasının önlenmesine yardımcı olmaktır. A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' - A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + Bir modülde tanımlanan bir değerin adresini alabilmesi için değiştirilebilir olması gerekir. Örn. 'let mutable x = ...' A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. - A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + IsReadOnly ek açıklaması eklenmiş bir tür aynı zamanda bir yapı olmalıdır. Türe [<Struct>] özniteliğini eklemeyi göz önünde bulundurun. Struct members cannot return the address of fields of the struct by reference - Struct members cannot return the address of fields of the struct by reference + Yapı üyeleri, başvuruya göre yapı alanlarının adreslerini döndüremez The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. - The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + Yığında yerel olmayan bir Span veya IsByRefLike türünün byref’i olan bir bağımsız değişken yığında yerel olan başka bir Span veya IsByRefLike türüyle birlikte kullanıldığından işlev veya metot çağrısı bu noktada kullanılamaz. Bunun amacı, yerel değerin adresinin kapsamından kaçmasının önlenmesine yardımcı olmaktır. The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + Bu noktada ifadeden döndürülen bir değerin adresi kullanılamaz. Bunun amacı, yerel değerin adresinin kapsamı dışına kaçmasını engellemektir. The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + Bu noktada Span veya IsByRefLike değişkeni '{0}' kullanılamaz. Bunun amacı, yerel değerin adresinin kapsamı dışına kaçmasını engellemektir. A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. - A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + Bu noktada ifadeden döndürülen bir Span veya IsByRefLike değeri kullanılamaz. Bunun amacı, yerel değerin adresinin kapsamı dışına kaçmasını engellemektir. diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf index b2865686e0..1cd8b170e5 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf @@ -6984,77 +6984,77 @@ The byref pointer is readonly, so this write is not permitted. - The byref pointer is readonly, so this write is not permitted. + 此 byref 指针为只读,因此,不允许此写入。 A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' - A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + 值必须是可变的,以便更改内容或采用值类型的地址,例如“let mutable x = ...” A ReadOnly attribute has been applied to a struct type with a mutable field. - A ReadOnly attribute has been applied to a struct type with a mutable field. + 已对包含可变字段的结构类型应用只读属性。 A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. - A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + 截至 F# 4.5,隐式取消引用函数或方法返回的 byref 指针。若要获取返回值作为指针,请使用 address-of 运算符,例如 “&f(x)” 或 “&obj.Method(arg1, arg2)”。 A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. - A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + 使用 IsByRefLike 注释的类型也必须为结构。考虑将 [<Struct>] 属性添加到类型中。 The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + 此时无法使用变量“{0}”或相关表达式的地址。这是为了确保本地值的地址不超出其范围。 The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + 无法从此函数或方法返回 Span 或 IsByRefLike 表达式,因为它由可能超出其范围的元素组成。 This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. - This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + 无法分配此值,因为目标“{0}”可能涉及非堆栈本地内存,而分配的表达式经评估可能涉及堆栈本地内存。这有助于防止指向堆栈绑定内存的指针超出其范围。 A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' - A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + 在模块中定义的值必须是可变的,以便获取其地址,例如 “let mutable x = ...” A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. - A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + 使用 IsReadOnly 注释的类型也必须为结构。考虑将 [<Struct>] 属性添加到类型中。 Struct members cannot return the address of fields of the struct by reference - Struct members cannot return the address of fields of the struct by reference + 结构成员无法通过引用返回此结构的字段地址 The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. - The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + 此时无法使用函数或方法调用,因为结合使用了一个非堆栈本地 Span 或 IsByRefLike 类型的 byref 参数和另一堆栈本地 Span 或 IsByRefLike 类型的参数。这是为了确保本地值的地址不超出其范围。 The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + 此时无法使用从表达式返回的值的地址。这是为了确保本地值的地址不超出其范围。 The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + 此时无法使用 Span 或 IsByRefLike 变量“{0}”。这是为了确保本地值的地址不超出其范围。 A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. - A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + 此时无法使用从表达式返回的 Span 或 IsByRefLike 值。这是为了确保本地值的地址不超出其范围。 diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf index c93b23dd73..c116661000 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf @@ -6984,77 +6984,77 @@ The byref pointer is readonly, so this write is not permitted. - The byref pointer is readonly, so this write is not permitted. + byref 指標為唯讀指標,所以不允許此寫入。 A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' - A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + 值必須是可變動的,才能變動內容或接受實值類型的位址,例如 'let mutable x = ...' A ReadOnly attribute has been applied to a struct type with a mutable field. - A ReadOnly attribute has been applied to a struct type with a mutable field. + 已將 ReadOnly 屬性套用至具備可變動欄位的結構類型。 A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. - A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + 函式或方法所傳回的 byref 指標,隱含會取值為 F# 4.5。如需將傳回值擷取為指標,請使用 address-of 運算子,例如 '&f(x)' 或 '&obj.Method(arg1, arg2)'。 A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. - A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + 標註有 IsByRefLike 的類型,必須是結構。請考慮對該類型新增 [<Struct>] 屬性。 The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + 此時不可使用變數 '{0}' 或相關運算式的位址。如此可確保本機值的位址不會逸出其範圍。 The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + 無法從此函式或方法傳回 Span 或 IsByRefLike 運算式,因為其使用可能會逸出其範圍的項目撰寫。 This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. - This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + 因為目標 '{0}' 會參考非本機堆疊的記憶體,所以無法指派此值。而目前所指派的運算式則評定為可能會參考本機堆疊的記憶體。如此可有助於避免進入受堆疊拘束記憶體的指標會逸出其範圍。 A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' - A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + 模組中定義的值必須可以變動,才可取用其位址,例如 'let mutable x = ...' A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. - A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + 標註有 IsReadOnly 的類型,必須是結構。請考慮對該類型新增 [<Struct>] 屬性。 Struct members cannot return the address of fields of the struct by reference - Struct members cannot return the address of fields of the struct by reference + 結構成員無法經由參考方式,傳回結構欄位的位址 The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. - The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + 此時不可使用函式或方法呼叫,原因是非本機堆疊 Span 或 IsByRefLike 類型的 byref 引數,目前與本機堆疊 Span 或 IsByRefLike 類型的引數一起使用。如此可確保本機值的位址不會逸出其範圍。 The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + 此時不可使用運算式傳回值的位址。如此可確保本機值的位址不會逸出其範圍。 The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + 此時不可使用 Span 或 IsByRefLike 變數 '{0}'。如此可確保本機值的位址不會逸出其範圍。 A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. - A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + 此時不可使用運算式傳回值的 Span 或 IsByRefLike。如此可確保本機值的位址不會逸出其範圍。 diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf index a433049aaa..59ff675157 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf @@ -59,7 +59,7 @@ Number of projects whose data is cached in memory - Velikost mezipaměti pro kontrolu projektů + Počet projektů, jejichž data jsou uložená v mezipaměti @@ -109,32 +109,32 @@ Time until stale results are used (in milliseconds) - Time until stale results are used (in milliseconds) + Doba, do kdy se budou používat zastaralé výsledky (v milisekundách) IntelliSense Performance Options - IntelliSense Performance Options + Možnosti výkonu pro IntelliSense F# Project and Caching Performance Options - F# Project and Caching Performance Options + Možnosti výkonu pro ukládání do mezipaměti a projekt F# Enable stale data for IntelliSense features - Enable stale data for IntelliSense features + Povolit zastaralá data pro funkce IntelliSense In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. - In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + V odkazech v paměti pro různé projekty jsou uložená data na úrovni projektů, aby mohly mezi projekty fungovat funkce IDE. Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. - Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + Projektová data jsou uložená v mezipaměti pro funkce IDE. Vyšší hodnoty znamenají využití více paměti, protože je uloženo více projektů. Vyladění této hodnoty by nemělo mít vliv na malá a středně velká řešení. diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf index 5ecab7182f..2b25f85bbc 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf @@ -59,7 +59,7 @@ Number of projects whose data is cached in memory - Überprüfung der Projektcachegröße + Anzahl von Projekten, deren Daten im Arbeitsspeicher zwischengespeichert werden @@ -109,32 +109,32 @@ Time until stale results are used (in milliseconds) - Time until stale results are used (in milliseconds) + Zeit bis zur Verwendung veralteter Ergebnisse (in Millisekunden) IntelliSense Performance Options - IntelliSense Performance Options + Optionen zur IntelliSense-Leistung F# Project and Caching Performance Options - F# Project and Caching Performance Options + Optionen zur F#-Projekt- und Cacheleistung Enable stale data for IntelliSense features - Enable stale data for IntelliSense features + Veraltete Daten für IntelliSense-Features aktivieren In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. - In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + Bei projektübergreifenden In-Memory-Verweisen werden Daten auf Projektebene im Arbeitsspeicher abgelegt, damit IDE-Features projektübergreifend verwendet werden können. Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. - Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + Für IDE-Features werden Projektdaten zwischengespeichert. Bei höheren Werten wird mehr Arbeitsspeicher beansprucht, weil mehr Projekte zwischengespeichert werden. Die Optimierung dieses Werts besitzt keine Auswirkungen auf kleine oder mittelgroße Projektmappen. diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf index 169ab6e70b..8877995d87 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf @@ -59,7 +59,7 @@ Number of projects whose data is cached in memory - Tamaño de caché de comprobación de proyectos + Número de proyectos cuyos datos se almacenan en la memoria caché @@ -109,32 +109,32 @@ Time until stale results are used (in milliseconds) - Time until stale results are used (in milliseconds) + Tiempo hasta que se utilizan los resultados obsoletos (en milisegundos) IntelliSense Performance Options - IntelliSense Performance Options + Opciones de rendimiento de IntelliSense F# Project and Caching Performance Options - F# Project and Caching Performance Options + Opciones de rendimiento de almacenamiento en caché y proyectos de F# Enable stale data for IntelliSense features - Enable stale data for IntelliSense features + Habilitar datos obsoletos para características de IntelliSense In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. - In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + Las referencias en memoria entre proyectos almacenan los datos de nivel de proyecto en memoria para permitir que las características del IDE funcionen de unos proyectos a otros. Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. - Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + Los datos de proyecto se almacenan en caché para que funcionen las características del IDE. Los valores más altos utilizan más memoria porque se almacenan en caché más proyectos. El ajuste de este valor no debería afectar a soluciones de tamaño pequeño o medio. diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf index 25775dd37e..38e65c985f 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf @@ -59,7 +59,7 @@ Number of projects whose data is cached in memory - Taille du cache de vérification du projet + Nombre de projets dont les données sont mises en cache dans la mémoire @@ -109,32 +109,32 @@ Time until stale results are used (in milliseconds) - Time until stale results are used (in milliseconds) + Délai avant l'utilisation des résultats périmés (en millisecondes) IntelliSense Performance Options - IntelliSense Performance Options + Options relatives aux performances d'IntelliSense F# Project and Caching Performance Options - F# Project and Caching Performance Options + Options relatives aux performances de la mise en cache et des projets F# Enable stale data for IntelliSense features - Enable stale data for IntelliSense features + Activer les données périmées pour les fonctionnalités IntelliSense In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. - In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + Les références inter-projets en mémoire stockent les données de niveau projet dans la mémoire pour permettre aux fonctionnalités de l'IDE de fonctionner sur plusieurs projets. Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. - Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + Les données de projet sont mises en cache pour les fonctionnalités de l'IDE. Les valeurs plus élevées utilisent plus de mémoire, car davantage de projets sont mis en cache. L'ajustement de cette valeur ne devrait pas affecter les petites ou moyennes solutions. diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf index ce04c11939..a7a6ea2160 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf @@ -59,7 +59,7 @@ Number of projects whose data is cached in memory - Dimensioni della cache di controllo del progetto + Numero di progetti i cui dati sono disponibili nella cache in memoria @@ -109,32 +109,32 @@ Time until stale results are used (in milliseconds) - Time until stale results are used (in milliseconds) + Intervallo di utilizzo dei risultati non aggiornati (in millisecondi) IntelliSense Performance Options - IntelliSense Performance Options + Opzioni per le prestazioni IntelliSense F# Project and Caching Performance Options - F# Project and Caching Performance Options + Opzioni per le prestazioni di memorizzazione nella cache e progetti F# Enable stale data for IntelliSense features - Enable stale data for IntelliSense features + Abilita dati non aggiornati per le funzionalità IntelliSense In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. - In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + I riferimenti tra progetti in memoria consentono di archiviare in memoria i dati a livello di progetto per consentire l'uso di funzionalità IDE tra progetti. Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. - Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + I dati del progetto sono memorizzati nella cache per le funzionalità IDE. Con valori più elevati viene usata una maggiore quantità di memoria perché nella cache viene memorizzato un numero maggiore di progetti. La disattivazione di questo valore non dovrebbe influire su soluzioni di piccole e medie dimensioni. diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf index 121f92eeb6..913cc622cf 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf @@ -59,7 +59,7 @@ Number of projects whose data is cached in memory - プロジェクト チェックのキャッシュ サイズ + データがメモリ内にキャッシュされているプロジェクトの数 @@ -109,32 +109,32 @@ Time until stale results are used (in milliseconds) - Time until stale results are used (in milliseconds) + 古い結果が使用されるまでの時間 (ミリ秒) IntelliSense Performance Options - IntelliSense Performance Options + IntelliSense のパフォーマンス オプション F# Project and Caching Performance Options - F# Project and Caching Performance Options + F# プロジェクトとキャッシュのパフォーマンス オプション Enable stale data for IntelliSense features - Enable stale data for IntelliSense features + IntelliSense 機能に対して古いデータを有効にする In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. - In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + メモリ内のプロジェクト間参照に、プロジェクトをまたいで IDE 機能を動作可能にするプロジェクト レベルのデータが格納されます。 Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. - Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + IDE 機能のためにプロジェクト データがキャッシュされます。値を高くすると、キャッシュされるプロジェクトが多くなるため、メモリ使用量が増えます。この値の調整は、小規模または中規模のソリューションに影響しません。 diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf index 5584ac9b35..3338668926 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf @@ -59,7 +59,7 @@ Number of projects whose data is cached in memory - 프로젝트 검사 캐시 크기 + 메모리에 데이터가 캐시된 프로젝트 수 @@ -109,32 +109,32 @@ Time until stale results are used (in milliseconds) - Time until stale results are used (in milliseconds) + 부실 결과가 사용될 때까지 시간(밀리초) IntelliSense Performance Options - IntelliSense Performance Options + IntelliSense 성능 옵션 F# Project and Caching Performance Options - F# Project and Caching Performance Options + F# 프로젝트 및 캐싱 성능 옵션 Enable stale data for IntelliSense features - Enable stale data for IntelliSense features + IntelliSense 기능에 대해 부실 데이터 사용 In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. - In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + 메모리 내 크로스 프로젝트 참조가 메모리에 프로젝트 수준 데이터를 저장하여 IDE 기능이 프로젝트에서 작동하도록 합니다. Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. - Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + 프로젝트 데이터가 IDE 기능에 대해 캐시됩니다. 값이 클수록 프로제트가 더 많이 캐시되므로 메모리를 더 많이 사용합니다. 이 값을 조정해도 중소 규모 솔루션에 영향을 미치지 않습니다. diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf index 4b6fd9bb9a..3f3b347f18 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf @@ -59,7 +59,7 @@ Number of projects whose data is cached in memory - Rozmiar pamięci podręcznej sprawdzania projektu + Liczba projektów, które mają dane buforowane w pamięci @@ -109,32 +109,32 @@ Time until stale results are used (in milliseconds) - Time until stale results are used (in milliseconds) + Czas do użycia nieodświeżonych wyników (w milisekundach) IntelliSense Performance Options - IntelliSense Performance Options + Opcje wydajności IntelliSense F# Project and Caching Performance Options - F# Project and Caching Performance Options + Opcje wydajności buforowania i projektów F# Enable stale data for IntelliSense features - Enable stale data for IntelliSense features + Włącz dane nieodświeżone na potrzeby funkcji IntelliSense In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. - In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + Odwołania między projektami w pamięci przechowują dane na poziomie projektu w pamięci, aby umożliwić funkcjom środowiska IDE działanie w wielu projektach. Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. - Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + Dane projektów są buforowane na potrzeby funkcji środowiska IDE. Wyższe wartości powodują używanie większej ilości pamięci, ponieważ buforowanych jest więcej projektów. Dostrajanie tej wartości nie powinno mieć wpływu na małe ani średnie rozwiązania. diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf index 3df31e3689..75b9b58dac 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf @@ -59,7 +59,7 @@ Number of projects whose data is cached in memory - Tamanho do cache de verificação do projeto + Número de projetos cujos dados estão em cache na memória @@ -109,32 +109,32 @@ Time until stale results are used (in milliseconds) - Time until stale results are used (in milliseconds) + Tempo até que os resultados obsoletos sejam utilizados (em milissegundos) IntelliSense Performance Options - IntelliSense Performance Options + Opções de desempenho do IntelliSense F# Project and Caching Performance Options - F# Project and Caching Performance Options + Projeto em F# e opções de desempenho em cache Enable stale data for IntelliSense features - Enable stale data for IntelliSense features + Habilitar dados obsoletos para os recursos do IntelliSense In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. - In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + As referências entre projetos na memória armazenam os dados de nível de projeto na memória para permitir que os recursos do IDE funcionem nos projetos. Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. - Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + Os dados do projeto são colocados em cache para os recursos do IDE. Os valores mais altos utilizam mais memória porque mais projetos são colocados em cache. O ajuste desses valores não deve afetar as soluções de pequeno ou médio porte. diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf index 46deaa9227..954b3c8616 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf @@ -59,7 +59,7 @@ Number of projects whose data is cached in memory - Размер кэша проверки проекта + Число проектов, данные которых кэшируются в памяти @@ -109,32 +109,32 @@ Time until stale results are used (in milliseconds) - Time until stale results are used (in milliseconds) + Используются результаты времени до устаревания (в мс) IntelliSense Performance Options - IntelliSense Performance Options + Параметры производительности IntelliSense F# Project and Caching Performance Options - F# Project and Caching Performance Options + Проект F# и параметры производительности кэширования Enable stale data for IntelliSense features - Enable stale data for IntelliSense features + Включение устаревших данных для функций IntelliSense In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. - In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + Перекрестные ссылки между проектами в памяти хранят данные уровня проекта в памяти, поэтому функции и компоненты IDE могут работать в разных проектах. Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. - Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + Для функций и компонентов IDE используются кэшированные данные проекта. Более высокие значения потребляют больший объем памяти, так как кэшируется больше проектов. Настройка этого значения не должна влиять на решения небольших или средних размеров. diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf index 018e8300a9..5b215b176a 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf @@ -59,7 +59,7 @@ Number of projects whose data is cached in memory - Proje denetimi önbelleği boyutu + Verileri bellekte önbelleğe alınan proje sayısı @@ -109,32 +109,32 @@ Time until stale results are used (in milliseconds) - Time until stale results are used (in milliseconds) + Eski sonuçların kullanılması için geçecek süre (milisaniye cinsinden) IntelliSense Performance Options - IntelliSense Performance Options + IntelliSense Performans Seçenekleri F# Project and Caching Performance Options - F# Project and Caching Performance Options + F# Proje ve Önbelleğe Alma Performansı Seçenekleri Enable stale data for IntelliSense features - Enable stale data for IntelliSense features + IntelliSense özellikleri için eski verileri etkinleştir In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. - In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + Bellek içi projeler arası başvurular, IDE özelliklerinin farklı projelerde çalışmasına imkan tanımak için bellekte proje düzeyi veriler depolar. Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. - Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + IDE özellikleri için proje verileri önbelleğe alınır. Değer yüksek olduğunda daha fazla proje önbelleğe alındığından daha fazla bellek kullanılır. Bu değerin ayarlanması küçük veya orta ölçekli çözümleri etkilememelidir. diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf index 05d5f382e6..38a725a5ff 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf @@ -59,7 +59,7 @@ Number of projects whose data is cached in memory - 项目检查缓存大小 + 内存中缓存了其数据的项目数 @@ -109,32 +109,32 @@ Time until stale results are used (in milliseconds) - Time until stale results are used (in milliseconds) + 使用过时结果前等待的时间(以毫秒计) IntelliSense Performance Options - IntelliSense Performance Options + IntelliSense 性能选项 F# Project and Caching Performance Options - F# Project and Caching Performance Options + F# 项目和缓存性能选项 Enable stale data for IntelliSense features - Enable stale data for IntelliSense features + 针对 IntelliSense 功能启用过时数据 In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. - In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + 内存中跨项目引用将项目级数据存储在内存中,让 IDE 功能能够跨项目工作。 Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. - Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + 针对 IDE 功能缓存项目数据。值越大,缓存的项目越多,因此使用的内存越多。调整此值不应影响小型或中型解决方案。 diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf index 35ba349890..9c3e4c1e68 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf @@ -59,7 +59,7 @@ Number of projects whose data is cached in memory - 專案檢查快取大小 + 資料會快取到記憶體的專案數 @@ -109,32 +109,32 @@ Time until stale results are used (in milliseconds) - Time until stale results are used (in milliseconds) + 使用過時結果前等待的時間 (毫秒) IntelliSense Performance Options - IntelliSense Performance Options + IntelliSense 效能選項 F# Project and Caching Performance Options - F# Project and Caching Performance Options + F# 專案與快取效能選項 Enable stale data for IntelliSense features - Enable stale data for IntelliSense features + 為 IntelliSense 功能啟用過時資料 In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. - In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + 記憶體內跨專案參考,會在記憶體中儲存專案等級的資料,以允許 IDE 功能在各專案中皆可運作。 Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. - Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + 專案資料會進行快取,供 IDE 功能使用。值較高時會使用較多的記憶體,這是因為會快取較多的專案數。調整此值應該不會影響中小型的解決方案。 From 6c801b2fc878229469bf98c49cf03cd9bd8c0495 Mon Sep 17 00:00:00 2001 From: Kevin Ransom Date: Fri, 29 Jun 2018 13:02:24 -0700 Subject: [PATCH 060/150] Test case for reversion --- .../regression/OverloadResolution-bug/test.fs | 30 +++++++++++++++++++ tests/fsharp/tests.fs | 8 ++++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 tests/fsharp/regression/OverloadResolution-bug/test.fs diff --git a/tests/fsharp/regression/OverloadResolution-bug/test.fs b/tests/fsharp/regression/OverloadResolution-bug/test.fs new file mode 100644 index 0000000000..c0985ac6d4 --- /dev/null +++ b/tests/fsharp/regression/OverloadResolution-bug/test.fs @@ -0,0 +1,30 @@ +(***************** Repro for issue#5246 ---- https://github.com/Microsoft/visualfsharp/issues/5246 *****************) +(* + When the bug was present we saw this error: + + Compile errors are raised: + error FS0041: A unique overload for method 'ofObject' could not be determined based on type + information prior to this program point. A type annotation may be needed. + Candidates: static member Methods.ofObject : t0:'a -> Methods option when 'a : null, + static member Methods.ofObject : t1:'a -> Methods option when 'a :> ITest1 and 'a : null + + Expected behavior + The code should compile fine (possibly with a warning on :? obj always succeeding). + +*) + +module TestOfObj = + + type [] ITest1 = interface end + + type Methods = + | Test1 of ITest1 + | Other of obj + + static member ofObject t1 = Option.ofObj t1 |> Option.map Test1 + static member ofObject t0 = Option.ofObj t0 |> Option.map Other + + static member convert (x: obj) = + match x with + | :? ITest1 as one -> Methods.ofObject one + | :? obj as one -> Methods.ofObject one diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index 853dc7bee1..f1417459b1 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -1630,11 +1630,17 @@ module RegressionTests = [] let ``literal-value-bug-2-FSI_BASIC`` () = singleTestBuildAndRun "regression/literal-value-bug-2" FSI_BASIC + [] + let ``OverloadResolution-bug-FSC_BASIC`` () = singleTestBuildAndRun "regression/OverloadResolution-bug" FSC_BASIC + + [] + let ``OverloadResolution-bug-FSI_BASIC`` () = singleTestBuildAndRun "regression/OverloadResolution-bug" FSI_BASIC + [] let ``struct-tuple-bug-1-FSC_BASIC`` () = singleTestBuildAndRun "regression/struct-tuple-bug-1" FSC_BASIC [] - let ``tuple-bug-1`` () = singleTestBuildAndRun "regression/tuple-bug-1" FSC_BASIC + let ``tuple-bug-1-FSC_BASIC`` () = singleTestBuildAndRun "regression/tuple-bug-1" FSC_BASIC [] let ``26`` () = singleTestBuildAndRun "regression/26" FSC_BASIC From 43fab184ad085b33aa19812fc76a7a7e516cdc27 Mon Sep 17 00:00:00 2001 From: Kevin Ransom Date: Fri, 29 Jun 2018 13:53:16 -0700 Subject: [PATCH 061/150] Revert "[RFCs FS-1037] allow flexible inference (subsumption) at union construction (#5030)" This reverts commit 5cac4f6bcadb5a4f18f8288b798d3d30f97d3436. --- src/fsharp/TypeChecker.fs | 55 +++++++------------ tests/fsharp/core/quotes/test.fsx | 24 -------- tests/fsharp/typecheck/sigs/neg20.bsl | 18 ++++++ tests/fsharp/typecheck/sigs/neg20.fs | 6 +- .../ConstructorFlexibleWhenPiping.fsx | 8 --- .../StructConstructorFlexibleWhenPiping.fsx | 9 --- .../UnionTypes/env.lst | 5 +- 7 files changed, 41 insertions(+), 84 deletions(-) delete mode 100644 tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/ConstructorFlexibleWhenPiping.fsx delete mode 100644 tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/StructConstructorFlexibleWhenPiping.fsx diff --git a/src/fsharp/TypeChecker.fs b/src/fsharp/TypeChecker.fs index 782b2e8154..afba0fa812 100755 --- a/src/fsharp/TypeChecker.fs +++ b/src/fsharp/TypeChecker.fs @@ -2909,7 +2909,7 @@ let MakeApplicableExprNoFlex cenv expr = /// This "special" node is immediately eliminated by the use of IteratedFlexibleAdjustArityOfLambdaBody as soon as we /// first transform the tree (currently in optimization) -let MakeApplicableExprWithFlex cenv (env: TcEnv) compat expr = +let MakeApplicableExprWithFlex cenv (env: TcEnv) expr = let exprTy = tyOfExpr cenv.g expr let m = expr.Range @@ -2917,31 +2917,19 @@ let MakeApplicableExprWithFlex cenv (env: TcEnv) compat expr = let argTys, retTy = stripFunTy cenv.g exprTy let curriedActualTypes = argTys |> List.map (tryDestRefTupleTy cenv.g) - let noFlexInserted = - (curriedActualTypes.IsEmpty || - curriedActualTypes |> List.exists (List.exists (isByrefTy cenv.g)) || - curriedActualTypes |> List.forall (List.forall isNonFlexibleType)) - - if noFlexInserted then + if (curriedActualTypes.IsEmpty || + curriedActualTypes |> List.exists (List.exists (isByrefTy cenv.g)) || + curriedActualTypes |> List.forall (List.forall isNonFlexibleType)) then + ApplicableExpr (cenv, expr, true) else let curriedFlexibleTypes = curriedActualTypes |> List.mapSquared (fun actualType -> - - if isNonFlexibleType actualType then - actualType + if isNonFlexibleType actualType + then actualType else - let flexibleType = NewInferenceType () - - // For backwards compatibility mark some extra flexibility points as IsCompatFlex, meaning that the - // type variable will not be generalized - if compat then - let tp = destTyparTy cenv.g flexibleType - tp.SetIsCompatFlex(true) - - AddCxTypeMustSubsumeType ContextInfo.NoContext env.DisplayEnv cenv.css m NoTrace actualType flexibleType - + AddCxTypeMustSubsumeType ContextInfo.NoContext env.DisplayEnv cenv.css m NoTrace actualType flexibleType; flexibleType) // Create a coercion to represent the expansion of the application @@ -5255,7 +5243,7 @@ and TcPat warnOnUpper cenv env topValInfo vFlags (tpenv, names, takenNames) ty p let args = match args with SynConstructorArgs.Pats args -> args | _ -> error(Error(FSComp.SR.tcNamedActivePattern(apinfo.ActiveTags.[idx]), m)) // TOTAL/PARTIAL ACTIVE PATTERNS let _, vexp, _, _, tinst, _ = TcVal true cenv env tpenv vref None None m - let vexp = MakeApplicableExprWithFlex cenv env false vexp + let vexp = MakeApplicableExprWithFlex cenv env vexp let vexpty = vexp.Type let activePatArgsAsSynPats, patarg = @@ -5541,13 +5529,8 @@ and TcExprOfUnknownType cenv env tpenv expr = and TcExprFlex cenv flex compat ty (env: TcEnv) tpenv (e: SynExpr) = if flex then let argty = NewInferenceType () - - // For backwards compatibility mark some extra flexibility points as IsCompatFlex, meaning that the - // type variable will not be generalized if compat then - let tp = destTyparTy cenv.g argty - tp.SetIsCompatFlex(true) - + (destTyparTy cenv.g argty).SetIsCompatFlex(true) AddCxTypeMustSubsumeType ContextInfo.NoContext env.DisplayEnv cenv.css e.Range NoTrace ty argty let e', tpenv = TcExpr cenv argty env tpenv e let e' = mkCoerceIfNeeded cenv.g ty argty e' @@ -8702,9 +8685,9 @@ and TcItemThen cenv overallTy env tpenv (item, mItem, rest, afterResolution) del let lam = mkMultiLambda mItem vs (constrApp, tyOfExpr cenv.g constrApp) lam) UnionCaseOrExnCheck env nargtys nargs mItem - let expr = MakeApplicableExprWithFlex cenv env true (mkExpr()) - let exprTy = expr.Type - PropagateThenTcDelayed cenv overallTy env tpenv mItem expr exprTy ExprAtomicFlag.Atomic delayed + let expr = mkExpr() + let exprTy = tyOfExpr cenv.g expr + PropagateThenTcDelayed cenv overallTy env tpenv mItem (MakeApplicableExprNoFlex cenv expr) exprTy ExprAtomicFlag.Atomic delayed | Item.Types(nm, (ty::_)) -> @@ -9001,7 +8984,7 @@ and TcItemThen cenv overallTy env tpenv (item, mItem, rest, afterResolution) del // - it isn't a VSlotDirectCall (uses of base values do not take type arguments let checkTys tpenv kinds = TcTypesOrMeasures (Some kinds) cenv NewTyparsOK CheckCxs ItemOccurence.UseInType env tpenv tys mItem let _, vexp, isSpecial, _, _, tpenv = TcVal true cenv env tpenv vref (Some (NormalValUse, checkTys)) (Some afterResolution) mItem - let vexpFlex = (if isSpecial then MakeApplicableExprNoFlex cenv vexp else MakeApplicableExprWithFlex cenv env false vexp) + let vexpFlex = (if isSpecial then MakeApplicableExprNoFlex cenv vexp else MakeApplicableExprWithFlex cenv env vexp) // We need to eventually record the type resolution for an expression, but this is done // inside PropagateThenTcDelayed, so we don't have to explicitly call 'CallExprHasTypeSink' here PropagateThenTcDelayed cenv overallTy env tpenv mExprAndTypeArgs vexpFlex vexpFlex.Type ExprAtomicFlag.Atomic otherDelayed @@ -9009,7 +8992,7 @@ and TcItemThen cenv overallTy env tpenv (item, mItem, rest, afterResolution) del // Value get | _ -> let _, vexp, isSpecial, _, _, tpenv = TcVal true cenv env tpenv vref None (Some afterResolution) mItem - let vexpFlex = (if isSpecial then MakeApplicableExprNoFlex cenv vexp else MakeApplicableExprWithFlex cenv env false vexp) + let vexpFlex = (if isSpecial then MakeApplicableExprNoFlex cenv vexp else MakeApplicableExprWithFlex cenv env vexp) PropagateThenTcDelayed cenv overallTy env tpenv mItem vexpFlex vexpFlex.Type ExprAtomicFlag.Atomic delayed | Item.Property (nm, pinfos) -> @@ -9080,7 +9063,7 @@ and TcItemThen cenv overallTy env tpenv (item, mItem, rest, afterResolution) del // Add an I_nop if this is an initonly field to make sure we never recognize it as an lvalue. See mkExprAddrOfExpr. mkAsmExpr ([ mkNormalLdsfld fspec ] @ (if finfo.IsInitOnly then [ AI_nop ] else []), finfo.TypeInst, [], [exprty], mItem) - PropagateThenTcDelayed cenv overallTy env tpenv mItem (MakeApplicableExprWithFlex cenv env false expr) exprty ExprAtomicFlag.Atomic delayed + PropagateThenTcDelayed cenv overallTy env tpenv mItem (MakeApplicableExprWithFlex cenv env expr) exprty ExprAtomicFlag.Atomic delayed | Item.RecdField rfinfo -> // Get static F# field or literal @@ -9109,7 +9092,7 @@ and TcItemThen cenv overallTy env tpenv (item, mItem, rest, afterResolution) del | Some lit -> Expr.Const(lit, mItem, exprty) // Get static F# field | None -> mkStaticRecdFieldGet (fref, rfinfo.TypeInst, mItem) - PropagateThenTcDelayed cenv overallTy env tpenv mItem (MakeApplicableExprWithFlex cenv env false expr) exprty ExprAtomicFlag.Atomic delayed + PropagateThenTcDelayed cenv overallTy env tpenv mItem (MakeApplicableExprWithFlex cenv env expr) exprty ExprAtomicFlag.Atomic delayed | Item.Event einfo -> // Instance IL event (fake up event-as-value) @@ -9254,7 +9237,7 @@ and TcLookupThen cenv overallTy env tpenv mObjExpr objExpr objExprTy longId dela // Instance F# Record or Class field let objExpr' = mkRecdFieldGet cenv.g (objExpr, rfinfo.RecdFieldRef, rfinfo.TypeInst, mExprAndItem) - PropagateThenTcDelayed cenv overallTy env tpenv mExprAndItem (MakeApplicableExprWithFlex cenv env false objExpr') fieldTy ExprAtomicFlag.Atomic delayed + PropagateThenTcDelayed cenv overallTy env tpenv mExprAndItem (MakeApplicableExprWithFlex cenv env objExpr') fieldTy ExprAtomicFlag.Atomic delayed | Item.ILField finfo -> // Get or set instance IL field @@ -9271,7 +9254,7 @@ and TcLookupThen cenv overallTy env tpenv mObjExpr objExpr objExprTy longId dela expr, tpenv | _ -> let expr = BuildILFieldGet cenv.g cenv.amap mExprAndItem objExpr finfo - PropagateThenTcDelayed cenv overallTy env tpenv mExprAndItem (MakeApplicableExprWithFlex cenv env false expr) exprty ExprAtomicFlag.Atomic delayed + PropagateThenTcDelayed cenv overallTy env tpenv mExprAndItem (MakeApplicableExprWithFlex cenv env expr) exprty ExprAtomicFlag.Atomic delayed | Item.Event einfo -> // Instance IL event (fake up event-as-value) diff --git a/tests/fsharp/core/quotes/test.fsx b/tests/fsharp/core/quotes/test.fsx index 9a1dbd6169..52ef066ea7 100644 --- a/tests/fsharp/core/quotes/test.fsx +++ b/tests/fsharp/core/quotes/test.fsx @@ -1744,30 +1744,6 @@ module QuotationStructUnionTests = //test "check NewUnionCase" (<@ A1(1,2) @> |> (function NewUnionCase(unionCase,[ Int32 1; Int32 2 ]) -> true | _ -> false)) -module FlexibleUnionConstructorTests = - - [] - type T = | A of seq - - type U = | B of seq - let testList = [1..3] - let testFunction caseName x = - match x with - | Call(None, _, - [PropertyGet (None,_,_) ; - Let (_, Lambda (_, NewUnionCase(unioncase, _)), - Lambda(_, Application(_, Coerce(_, ty))))]) -> - unioncase.Name = caseName && - ty.Name = "IEnumerable`1" - | _ -> false - - test "check struct flexible union constructor" - (<@ testList |> A @> |> testFunction "A") - - test "check flexible union constructor" - (<@ testList |> B @> |> testFunction "B") - - module EqualityOnExprDoesntFail = let q = <@ 1 @> check "we09ceo" (q.Equals(1)) false diff --git a/tests/fsharp/typecheck/sigs/neg20.bsl b/tests/fsharp/typecheck/sigs/neg20.bsl index 76aa1692df..ce156bee94 100644 --- a/tests/fsharp/typecheck/sigs/neg20.bsl +++ b/tests/fsharp/typecheck/sigs/neg20.bsl @@ -131,6 +131,24 @@ but here has type neg20.fs(99,26,99,33): typecheck error FS0001: All elements of a list constructor expression must have the same type. This expression was expected to have type 'B', but here has type 'A'. +neg20.fs(108,12,108,16): typecheck error FS0001: Type mismatch. Expecting a + 'B * B -> 'a' +but given a + 'A * A -> Data' +The type 'B' does not match the type 'A' + +neg20.fs(109,12,109,16): typecheck error FS0001: Type mismatch. Expecting a + 'A * B -> 'a' +but given a + 'A * A -> Data' +The type 'B' does not match the type 'A' + +neg20.fs(110,12,110,16): typecheck error FS0001: Type mismatch. Expecting a + 'B * A -> 'a' +but given a + 'A * A -> Data' +The type 'B' does not match the type 'A' + neg20.fs(128,19,128,22): typecheck error FS0001: This expression was expected to have type 'string' but here has type diff --git a/tests/fsharp/typecheck/sigs/neg20.fs b/tests/fsharp/typecheck/sigs/neg20.fs index 9d82382d7e..5d465aeea9 100644 --- a/tests/fsharp/typecheck/sigs/neg20.fs +++ b/tests/fsharp/typecheck/sigs/neg20.fs @@ -105,9 +105,9 @@ module NoSubsumptionForLists2 = let pBB = (new B(),new B()) let pAB = (new A(),new B()) let pBA = (new B(),new A()) - pBB |> Data // permitted - pAB |> Data // permitted - pBA |> Data // permitted + pBB |> Data // not permitted (questionable) + pAB |> Data // not permitted (questionable) + pBA |> Data // not permitted (questionable) pBB |> data // permitted pAB |> data // permitted pBA |> data // permitted diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/ConstructorFlexibleWhenPiping.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/ConstructorFlexibleWhenPiping.fsx deleted file mode 100644 index 52752978e0..0000000000 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/ConstructorFlexibleWhenPiping.fsx +++ /dev/null @@ -1,8 +0,0 @@ -// #Conformance #TypesAndModules #Unions -// DU constructor should be flexible when piping -// - -type Foo = Items of seq -[1;2;3] |> Items - -exit 0 \ No newline at end of file diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/StructConstructorFlexibleWhenPiping.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/StructConstructorFlexibleWhenPiping.fsx deleted file mode 100644 index 2a630ec04b..0000000000 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/StructConstructorFlexibleWhenPiping.fsx +++ /dev/null @@ -1,9 +0,0 @@ -// #Conformance #TypesAndModules #Unions -// Struct DU constructor should be flexible when piping -// - -[] -type Foo = Items of seq -[1;2;3] |> Items - -exit 0 \ No newline at end of file diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/env.lst b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/env.lst index b71c6edefd..c979c25d01 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/env.lst +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/env.lst @@ -99,7 +99,4 @@ NoMT SOURCE=Overload_ToString.fs COMPILE_ONLY=1 SCFLAGS=--warnaserror+ FSIMOD SOURCE=E_UnionFieldConflictingName.fs SCFLAGS="--test:ErrorRanges" # E_UnionFieldConflictingName.fs SOURCE=E_UnionConstructorBadFieldName.fs SCFLAGS="--test:ErrorRanges" # E_UnionConstructorBadFieldName.fs SOURCE=E_FieldNameUsedMulti.fs SCFLAGS="--test:ErrorRanges" # E_FieldNameUsedMulti.fs - SOURCE=E_FieldMemberClash.fs SCFLAGS="--test:ErrorRanges" # E_FieldMemberClash.fs - - SOURCE=ConstructorFlexibleWhenPiping.fsx # ConstructorFlexibleWhenPiping.fsx - SOURCE=StructConstructorFlexibleWhenPiping.fsx # StructConstructorFlexibleWhenPiping.fsx \ No newline at end of file + SOURCE=E_FieldMemberClash.fs SCFLAGS="--test:ErrorRanges" # E_FieldMemberClash.fs \ No newline at end of file From 41ab9b837c54086a3ef609211992698debaba35a Mon Sep 17 00:00:00 2001 From: Kevin Ransom Date: Sat, 30 Jun 2018 00:35:15 -0700 Subject: [PATCH 062/150] ok file --- .../regression/OverloadResolution-bug/{test.fs => test.fsx} | 5 +++++ 1 file changed, 5 insertions(+) rename tests/fsharp/regression/OverloadResolution-bug/{test.fs => test.fsx} (92%) diff --git a/tests/fsharp/regression/OverloadResolution-bug/test.fs b/tests/fsharp/regression/OverloadResolution-bug/test.fsx similarity index 92% rename from tests/fsharp/regression/OverloadResolution-bug/test.fs rename to tests/fsharp/regression/OverloadResolution-bug/test.fsx index c0985ac6d4..ff87afb18c 100644 --- a/tests/fsharp/regression/OverloadResolution-bug/test.fs +++ b/tests/fsharp/regression/OverloadResolution-bug/test.fsx @@ -28,3 +28,8 @@ module TestOfObj = match x with | :? ITest1 as one -> Methods.ofObject one | :? obj as one -> Methods.ofObject one + | _ -> None + + + System.IO.File.WriteAllText("test.ok","ok") + printfn "Succeeded" From e29cc675e956f98f222fb7dd949794863f5265f3 Mon Sep 17 00:00:00 2001 From: Jakub Majocha Date: Sat, 30 Jun 2018 10:36:09 +0200 Subject: [PATCH 063/150] Deadlock in QuickInfo, again. Fixes #5254 (#5257) * call GetService on UI thread * move things around a bit --- .../src/FSharp.Editor/QuickInfo/Navigation.fs | 3 +-- .../FSharp.Editor/QuickInfo/QuickInfoProvider.fs | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/vsintegration/src/FSharp.Editor/QuickInfo/Navigation.fs b/vsintegration/src/FSharp.Editor/QuickInfo/Navigation.fs index d1904b96cd..09e5d30550 100644 --- a/vsintegration/src/FSharp.Editor/QuickInfo/Navigation.fs +++ b/vsintegration/src/FSharp.Editor/QuickInfo/Navigation.fs @@ -13,7 +13,7 @@ open Microsoft.VisualStudio.Shell.Interop type internal QuickInfoNavigation ( - serviceProvider: IServiceProvider, + statusBar: StatusBar, checker: FSharpChecker, projectInfoManager: FSharpProjectOptionsManager, initialDoc: Document, @@ -22,7 +22,6 @@ type internal QuickInfoNavigation let workspace = initialDoc.Project.Solution.Workspace let solution = workspace.CurrentSolution - let statusBar = StatusBar(serviceProvider.GetService()) member __.IsTargetValid (range: range) = range <> rangeStartup && diff --git a/vsintegration/src/FSharp.Editor/QuickInfo/QuickInfoProvider.fs b/vsintegration/src/FSharp.Editor/QuickInfo/QuickInfoProvider.fs index 69886526e1..c52d1ac120 100644 --- a/vsintegration/src/FSharp.Editor/QuickInfo/QuickInfoProvider.fs +++ b/vsintegration/src/FSharp.Editor/QuickInfo/QuickInfoProvider.fs @@ -159,7 +159,7 @@ module private FSharpQuickInfo = type internal FSharpAsyncQuickInfoSource ( - serviceProvider: IServiceProvider, + statusBar: StatusBar, xmlMemberIndexService: IVsXMLMemberIndexService, checkerProvider:FSharpCheckerProvider, projectInfoManager:FSharpProjectOptionsManager, @@ -186,6 +186,9 @@ type internal FSharpAsyncQuickInfoSource interface IAsyncQuickInfoSource with override __.Dispose() = () // no cleanup necessary + + // This method can be called from the background thread. + // Do not call IServiceProvider.GetService here. override __.GetQuickInfoItemAsync(session:IAsyncQuickInfoSession, cancellationToken:CancellationToken) : Task = let triggerPoint = session.GetTriggerPoint(textBuffer.CurrentSnapshot) match triggerPoint.HasValue with @@ -211,7 +214,7 @@ type internal FSharpAsyncQuickInfoSource let mainDescription, documentation, typeParameterMap, usage, exceptions = ResizeArray(), ResizeArray(), ResizeArray(), ResizeArray(), ResizeArray() XmlDocumentation.BuildDataTipText(documentationBuilder, mainDescription.Add, documentation.Add, typeParameterMap.Add, usage.Add, exceptions.Add, quickInfo.StructuredText) let imageId = Tokenizer.GetImageIdForSymbol(quickInfo.Symbol, quickInfo.SymbolKind) - let navigation = QuickInfoNavigation(serviceProvider, checkerProvider.Checker, projectInfoManager, document, symbolUse.RangeAlternate) + let navigation = QuickInfoNavigation(statusBar, checkerProvider.Checker, projectInfoManager, document, symbolUse.RangeAlternate) let docs = joinWithLineBreaks [documentation; typeParameterMap; usage; exceptions] let content = QuickInfoViewProvider.provideContent(imageId, mainDescription, docs, navigation) let span = getTrackingSpan quickInfo.Span @@ -242,7 +245,7 @@ type internal FSharpAsyncQuickInfoSource ] |> ResizeArray let docs = joinWithLineBreaks [documentation; typeParameterMap; usage; exceptions] let imageId = Tokenizer.GetImageIdForSymbol(targetQuickInfo.Symbol, targetQuickInfo.SymbolKind) - let navigation = QuickInfoNavigation(serviceProvider, checkerProvider.Checker, projectInfoManager, document, symbolUse.RangeAlternate) + let navigation = QuickInfoNavigation(statusBar, checkerProvider.Checker, projectInfoManager, document, symbolUse.RangeAlternate) let content = QuickInfoViewProvider.provideContent(imageId, mainDescription, docs, navigation) let span = getTrackingSpan targetQuickInfo.Span return QuickInfoItem(span, content) @@ -260,6 +263,11 @@ type internal FSharpAsyncQuickInfoSourceProvider checkerProvider:FSharpCheckerProvider, projectInfoManager:FSharpProjectOptionsManager ) = + interface IAsyncQuickInfoSourceProvider with override __.TryCreateQuickInfoSource(textBuffer:ITextBuffer) : IAsyncQuickInfoSource = - new FSharpAsyncQuickInfoSource(serviceProvider, serviceProvider.XMLMemberIndexService, checkerProvider, projectInfoManager, textBuffer) :> IAsyncQuickInfoSource + // GetService calls must be made on the UI thread + // It is safe to do it here (see #4713) + let statusBar = StatusBar(serviceProvider.GetService()) + let xmlMemberIndexService = serviceProvider.XMLMemberIndexService + new FSharpAsyncQuickInfoSource(statusBar, xmlMemberIndexService, checkerProvider, projectInfoManager, textBuffer) :> IAsyncQuickInfoSource From 39e74ee4153fbc8bf669ceb97548e7d6361a1c30 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Sat, 30 Jun 2018 09:43:59 +0100 Subject: [PATCH 064/150] Fix 5233 - PrivateScope mebmer access (#5250) --- src/absil/il.fs | 7 ++++++- src/absil/il.fsi | 1 + src/absil/ilprint.fs | 1 + src/absil/ilreflect.fs | 1 + src/absil/ilwrite.fs | 2 ++ src/fsharp/symbols/Symbols.fs | 1 + 6 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/absil/il.fs b/src/absil/il.fs index 180a170f20..c2314418fe 100644 --- a/src/absil/il.fs +++ b/src/absil/il.fs @@ -1228,6 +1228,7 @@ type ILMethodBody = [] type ILMemberAccess = | Assembly + | CompilerControlled | FamilyAndAssembly | FamilyOrAssembly | Family @@ -1546,7 +1547,7 @@ let memberAccessOfFlags flags = elif f = 0x00000002 then ILMemberAccess.FamilyAndAssembly elif f = 0x00000005 then ILMemberAccess.FamilyOrAssembly elif f = 0x00000003 then ILMemberAccess.Assembly - else failwith "impossible: the flags parameter value is come from enums MethodAttributes and FieldAttributes must have access flag" + else ILMemberAccess.CompilerControlled let convertMemberAccess (ilMemberAccess:ILMemberAccess) = match ilMemberAccess with @@ -1554,6 +1555,7 @@ let convertMemberAccess (ilMemberAccess:ILMemberAccess) = | ILMemberAccess.Private -> MethodAttributes.Private | ILMemberAccess.Assembly -> MethodAttributes.Assembly | ILMemberAccess.FamilyAndAssembly -> MethodAttributes.FamANDAssem + | ILMemberAccess.CompilerControlled -> MethodAttributes.PrivateScope | ILMemberAccess.FamilyOrAssembly -> MethodAttributes.FamORAssem | ILMemberAccess.Family -> MethodAttributes.Family @@ -1805,6 +1807,7 @@ type ILPropertyDefs = let convertFieldAccess (ilMemberAccess:ILMemberAccess) = match ilMemberAccess with | ILMemberAccess.Assembly -> FieldAttributes.Assembly + | ILMemberAccess.CompilerControlled -> enum(0) | ILMemberAccess.FamilyAndAssembly -> FieldAttributes.FamANDAssem | ILMemberAccess.FamilyOrAssembly -> FieldAttributes.FamORAssem | ILMemberAccess.Family -> FieldAttributes.Family @@ -1946,6 +1949,7 @@ let convertTypeAccessFlags access = | ILTypeDefAccess.Nested ILMemberAccess.Public -> TypeAttributes.NestedPublic | ILTypeDefAccess.Nested ILMemberAccess.Private -> TypeAttributes.NestedPrivate | ILTypeDefAccess.Nested ILMemberAccess.Family -> TypeAttributes.NestedFamily + | ILTypeDefAccess.Nested ILMemberAccess.CompilerControlled -> TypeAttributes.NestedPrivate | ILTypeDefAccess.Nested ILMemberAccess.FamilyAndAssembly -> TypeAttributes.NestedFamANDAssem | ILTypeDefAccess.Nested ILMemberAccess.FamilyOrAssembly -> TypeAttributes.NestedFamORAssem | ILTypeDefAccess.Nested ILMemberAccess.Assembly -> TypeAttributes.NestedAssembly @@ -1973,6 +1977,7 @@ let convertEncoding encoding = let convertToNestedTypeAccess (ilMemberAccess:ILMemberAccess) = match ilMemberAccess with | ILMemberAccess.Assembly -> TypeAttributes.NestedAssembly + | ILMemberAccess.CompilerControlled -> failwith "Method access compiler controlled." | ILMemberAccess.FamilyAndAssembly -> TypeAttributes.NestedFamANDAssem | ILMemberAccess.FamilyOrAssembly -> TypeAttributes.NestedFamORAssem | ILMemberAccess.Family -> TypeAttributes.NestedFamily diff --git a/src/absil/il.fsi b/src/absil/il.fsi index fe0bd1bdac..6ed4d42aa3 100644 --- a/src/absil/il.fsi +++ b/src/absil/il.fsi @@ -720,6 +720,7 @@ type ILMethodBody = [] type ILMemberAccess = | Assembly + | CompilerControlled | FamilyAndAssembly | FamilyOrAssembly | Family diff --git a/src/absil/ilprint.fs b/src/absil/ilprint.fs index 6dff9315c7..f11524bc8d 100644 --- a/src/absil/ilprint.fs +++ b/src/absil/ilprint.fs @@ -397,6 +397,7 @@ let output_member_access os access = | ILMemberAccess.Public -> "public" | ILMemberAccess.Private -> "private" | ILMemberAccess.Family -> "family" + | ILMemberAccess.CompilerControlled -> "privatescope" | ILMemberAccess.FamilyAndAssembly -> "famandassem" | ILMemberAccess.FamilyOrAssembly -> "famorassem" | ILMemberAccess.Assembly -> "assembly") diff --git a/src/absil/ilreflect.fs b/src/absil/ilreflect.fs index 95194aea5a..c07408e8ab 100644 --- a/src/absil/ilreflect.fs +++ b/src/absil/ilreflect.fs @@ -1724,6 +1724,7 @@ let typeAttrbutesOfTypeAccess x = | ILTypeDefAccess.Nested macc -> match macc with | ILMemberAccess.Assembly -> TypeAttributes.NestedAssembly + | ILMemberAccess.CompilerControlled -> failwith "Nested compiler controled." | ILMemberAccess.FamilyAndAssembly -> TypeAttributes.NestedFamANDAssem | ILMemberAccess.FamilyOrAssembly -> TypeAttributes.NestedFamORAssem | ILMemberAccess.Family -> TypeAttributes.NestedFamily diff --git a/src/absil/ilwrite.fs b/src/absil/ilwrite.fs index 9ce53c29c5..37b85145a8 100644 --- a/src/absil/ilwrite.fs +++ b/src/absil/ilwrite.fs @@ -1074,6 +1074,7 @@ let GetMemberAccessFlags access = | ILMemberAccess.Public -> 0x00000006 | ILMemberAccess.Private -> 0x00000001 | ILMemberAccess.Family -> 0x00000004 + | ILMemberAccess.CompilerControlled -> 0x00000000 | ILMemberAccess.FamilyAndAssembly -> 0x00000002 | ILMemberAccess.FamilyOrAssembly -> 0x00000005 | ILMemberAccess.Assembly -> 0x00000003 @@ -1085,6 +1086,7 @@ let GetTypeAccessFlags access = | ILTypeDefAccess.Nested ILMemberAccess.Public -> 0x00000002 | ILTypeDefAccess.Nested ILMemberAccess.Private -> 0x00000003 | ILTypeDefAccess.Nested ILMemberAccess.Family -> 0x00000004 + | ILTypeDefAccess.Nested ILMemberAccess.CompilerControlled -> failwith "bad type acccess" | ILTypeDefAccess.Nested ILMemberAccess.FamilyAndAssembly -> 0x00000006 | ILTypeDefAccess.Nested ILMemberAccess.FamilyOrAssembly -> 0x00000007 | ILTypeDefAccess.Nested ILMemberAccess.Assembly -> 0x00000005 diff --git a/src/fsharp/symbols/Symbols.fs b/src/fsharp/symbols/Symbols.fs index 4ce77c11ef..68bdcae2f5 100644 --- a/src/fsharp/symbols/Symbols.fs +++ b/src/fsharp/symbols/Symbols.fs @@ -123,6 +123,7 @@ module Impl = /// Convert an IL member accessibility into an F# accessibility let getApproxFSharpAccessibilityOfMember (declaringEntity: EntityRef) (ilAccess: ILMemberAccess) = match ilAccess with + | ILMemberAccess.CompilerControlled | ILMemberAccess.FamilyAndAssembly | ILMemberAccess.Assembly -> taccessPrivate (CompPath(declaringEntity.CompilationPath.ILScopeRef, [])) From c0c1ca757ceb546c2cd6717b1683a893627715d9 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Sat, 30 Jun 2018 09:43:59 +0100 Subject: [PATCH 065/150] Fix 5233 - PrivateScope mebmer access (#5250) --- src/absil/il.fs | 7 ++++++- src/absil/il.fsi | 1 + src/absil/ilprint.fs | 1 + src/absil/ilreflect.fs | 1 + src/absil/ilwrite.fs | 2 ++ src/fsharp/symbols/Symbols.fs | 1 + 6 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/absil/il.fs b/src/absil/il.fs index 726ac14767..f672a4b6f6 100644 --- a/src/absil/il.fs +++ b/src/absil/il.fs @@ -1229,6 +1229,7 @@ type ILMethodBody = [] type ILMemberAccess = | Assembly + | CompilerControlled | FamilyAndAssembly | FamilyOrAssembly | Family @@ -1547,7 +1548,7 @@ let memberAccessOfFlags flags = elif f = 0x00000002 then ILMemberAccess.FamilyAndAssembly elif f = 0x00000005 then ILMemberAccess.FamilyOrAssembly elif f = 0x00000003 then ILMemberAccess.Assembly - else failwith "impossible: the flags parameter value is come from enums MethodAttributes and FieldAttributes must have access flag" + else ILMemberAccess.CompilerControlled let convertMemberAccess (ilMemberAccess:ILMemberAccess) = match ilMemberAccess with @@ -1555,6 +1556,7 @@ let convertMemberAccess (ilMemberAccess:ILMemberAccess) = | ILMemberAccess.Private -> MethodAttributes.Private | ILMemberAccess.Assembly -> MethodAttributes.Assembly | ILMemberAccess.FamilyAndAssembly -> MethodAttributes.FamANDAssem + | ILMemberAccess.CompilerControlled -> MethodAttributes.PrivateScope | ILMemberAccess.FamilyOrAssembly -> MethodAttributes.FamORAssem | ILMemberAccess.Family -> MethodAttributes.Family @@ -1806,6 +1808,7 @@ type ILPropertyDefs = let convertFieldAccess (ilMemberAccess:ILMemberAccess) = match ilMemberAccess with | ILMemberAccess.Assembly -> FieldAttributes.Assembly + | ILMemberAccess.CompilerControlled -> enum(0) | ILMemberAccess.FamilyAndAssembly -> FieldAttributes.FamANDAssem | ILMemberAccess.FamilyOrAssembly -> FieldAttributes.FamORAssem | ILMemberAccess.Family -> FieldAttributes.Family @@ -1947,6 +1950,7 @@ let convertTypeAccessFlags access = | ILTypeDefAccess.Nested ILMemberAccess.Public -> TypeAttributes.NestedPublic | ILTypeDefAccess.Nested ILMemberAccess.Private -> TypeAttributes.NestedPrivate | ILTypeDefAccess.Nested ILMemberAccess.Family -> TypeAttributes.NestedFamily + | ILTypeDefAccess.Nested ILMemberAccess.CompilerControlled -> TypeAttributes.NestedPrivate | ILTypeDefAccess.Nested ILMemberAccess.FamilyAndAssembly -> TypeAttributes.NestedFamANDAssem | ILTypeDefAccess.Nested ILMemberAccess.FamilyOrAssembly -> TypeAttributes.NestedFamORAssem | ILTypeDefAccess.Nested ILMemberAccess.Assembly -> TypeAttributes.NestedAssembly @@ -1974,6 +1978,7 @@ let convertEncoding encoding = let convertToNestedTypeAccess (ilMemberAccess:ILMemberAccess) = match ilMemberAccess with | ILMemberAccess.Assembly -> TypeAttributes.NestedAssembly + | ILMemberAccess.CompilerControlled -> failwith "Method access compiler controlled." | ILMemberAccess.FamilyAndAssembly -> TypeAttributes.NestedFamANDAssem | ILMemberAccess.FamilyOrAssembly -> TypeAttributes.NestedFamORAssem | ILMemberAccess.Family -> TypeAttributes.NestedFamily diff --git a/src/absil/il.fsi b/src/absil/il.fsi index fe0bd1bdac..6ed4d42aa3 100644 --- a/src/absil/il.fsi +++ b/src/absil/il.fsi @@ -720,6 +720,7 @@ type ILMethodBody = [] type ILMemberAccess = | Assembly + | CompilerControlled | FamilyAndAssembly | FamilyOrAssembly | Family diff --git a/src/absil/ilprint.fs b/src/absil/ilprint.fs index 6dff9315c7..f11524bc8d 100644 --- a/src/absil/ilprint.fs +++ b/src/absil/ilprint.fs @@ -397,6 +397,7 @@ let output_member_access os access = | ILMemberAccess.Public -> "public" | ILMemberAccess.Private -> "private" | ILMemberAccess.Family -> "family" + | ILMemberAccess.CompilerControlled -> "privatescope" | ILMemberAccess.FamilyAndAssembly -> "famandassem" | ILMemberAccess.FamilyOrAssembly -> "famorassem" | ILMemberAccess.Assembly -> "assembly") diff --git a/src/absil/ilreflect.fs b/src/absil/ilreflect.fs index 191282fe5b..0aa37fcb3b 100644 --- a/src/absil/ilreflect.fs +++ b/src/absil/ilreflect.fs @@ -1724,6 +1724,7 @@ let typeAttrbutesOfTypeAccess x = | ILTypeDefAccess.Nested macc -> match macc with | ILMemberAccess.Assembly -> TypeAttributes.NestedAssembly + | ILMemberAccess.CompilerControlled -> failwith "Nested compiler controled." | ILMemberAccess.FamilyAndAssembly -> TypeAttributes.NestedFamANDAssem | ILMemberAccess.FamilyOrAssembly -> TypeAttributes.NestedFamORAssem | ILMemberAccess.Family -> TypeAttributes.NestedFamily diff --git a/src/absil/ilwrite.fs b/src/absil/ilwrite.fs index 9ce53c29c5..37b85145a8 100644 --- a/src/absil/ilwrite.fs +++ b/src/absil/ilwrite.fs @@ -1074,6 +1074,7 @@ let GetMemberAccessFlags access = | ILMemberAccess.Public -> 0x00000006 | ILMemberAccess.Private -> 0x00000001 | ILMemberAccess.Family -> 0x00000004 + | ILMemberAccess.CompilerControlled -> 0x00000000 | ILMemberAccess.FamilyAndAssembly -> 0x00000002 | ILMemberAccess.FamilyOrAssembly -> 0x00000005 | ILMemberAccess.Assembly -> 0x00000003 @@ -1085,6 +1086,7 @@ let GetTypeAccessFlags access = | ILTypeDefAccess.Nested ILMemberAccess.Public -> 0x00000002 | ILTypeDefAccess.Nested ILMemberAccess.Private -> 0x00000003 | ILTypeDefAccess.Nested ILMemberAccess.Family -> 0x00000004 + | ILTypeDefAccess.Nested ILMemberAccess.CompilerControlled -> failwith "bad type acccess" | ILTypeDefAccess.Nested ILMemberAccess.FamilyAndAssembly -> 0x00000006 | ILTypeDefAccess.Nested ILMemberAccess.FamilyOrAssembly -> 0x00000007 | ILTypeDefAccess.Nested ILMemberAccess.Assembly -> 0x00000005 diff --git a/src/fsharp/symbols/Symbols.fs b/src/fsharp/symbols/Symbols.fs index db25d55835..0e1ffae007 100644 --- a/src/fsharp/symbols/Symbols.fs +++ b/src/fsharp/symbols/Symbols.fs @@ -123,6 +123,7 @@ module Impl = /// Convert an IL member accessibility into an F# accessibility let getApproxFSharpAccessibilityOfMember (declaringEntity: EntityRef) (ilAccess: ILMemberAccess) = match ilAccess with + | ILMemberAccess.CompilerControlled | ILMemberAccess.FamilyAndAssembly | ILMemberAccess.Assembly -> taccessPrivate (CompPath(declaringEntity.CompilationPath.ILScopeRef, [])) From a65f81da8c88b175b5ebc3f06991bdcb28164f06 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Sat, 30 Jun 2018 01:50:04 -0700 Subject: [PATCH 066/150] Update version numbers (#5243) --- src/FSharpSource.Settings.targets | 6 +++--- src/utils/CompilerLocationUtils.fs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/FSharpSource.Settings.targets b/src/FSharpSource.Settings.targets index b4b4f9f940..273d18ee76 100644 --- a/src/FSharpSource.Settings.targets +++ b/src/FSharpSource.Settings.targets @@ -21,8 +21,8 @@ 4.5.0.0 - 10.2.0.0 - 10.2.0 + 10.2.1.0 + 10.2.1 15.7.0.0 @@ -101,7 +101,7 @@ 4.1.19 4.1 - 4.5.0 + 4.5.1 4.5 diff --git a/src/utils/CompilerLocationUtils.fs b/src/utils/CompilerLocationUtils.fs index 20d6d8ce9b..00cad27bec 100644 --- a/src/utils/CompilerLocationUtils.fs +++ b/src/utils/CompilerLocationUtils.fs @@ -12,7 +12,7 @@ open System.Runtime.InteropServices module internal FSharpEnvironment = /// The F# version reported in the banner - let FSharpBannerVersion = "10.2.0 for F# 4.5" + let FSharpBannerVersion = "10.2.1 for F# 4.5" let versionOf<'t> = #if FX_RESHAPED_REFLECTION From 2716e34dea13e4016ee85f2490200cfa83271fa2 Mon Sep 17 00:00:00 2001 From: Abel Braaksma Date: Sat, 30 Jun 2018 20:00:25 +0200 Subject: [PATCH 067/150] Rename collapsable to collapsible (#5251) * Rename collapsable to collapsible * Updating resource files for rename collapsable into collapsible * Updating resource files for rename collapsable into collapsible * Removing accidentally committed *.resources files * Updating resx file for collapsable > collapsible and corresponding xlf files, fixing erroneous earlier commits --- vsintegration/src/FSharp.UIResources/Strings.resx | 2 +- vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf | 2 +- vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf | 2 +- vsintegration/src/FSharp.UIResources/xlf/Strings.en.xlf | 4 ++-- vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf | 2 +- vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf | 2 +- vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf | 2 +- vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf | 2 +- vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf | 2 +- vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf | 2 +- vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf | 2 +- vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf | 2 +- vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf | 2 +- vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf | 2 +- vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf | 2 +- 15 files changed, 16 insertions(+), 16 deletions(-) diff --git a/vsintegration/src/FSharp.UIResources/Strings.resx b/vsintegration/src/FSharp.UIResources/Strings.resx index 3490fbd916..bc25cb35d1 100644 --- a/vsintegration/src/FSharp.UIResources/Strings.resx +++ b/vsintegration/src/FSharp.UIResources/Strings.resx @@ -178,7 +178,7 @@ Outlining - Show outlining and collapsable nodes for F# code + Show outlining and collapsible nodes for F# code Time until stale results are used (in milliseconds) diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf index a433049aaa..650a28a4af 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf @@ -103,7 +103,7 @@ - Show outlining and collapsable nodes for F# code + Show outlining and collapsible nodes for F# code Zobrazí osnovu a sbalitelné uzly kódu F#. diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf index 5ecab7182f..1325216dbc 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf @@ -103,7 +103,7 @@ - Show outlining and collapsable nodes for F# code + Show outlining and collapsible nodes for F# code Gliederung und ausblendbare Knoten für F#-Code anzeigen diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.en.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.en.xlf index ac554cc370..5bf65eacdd 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.en.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.en.xlf @@ -103,8 +103,8 @@ - Show outlining and collapsable nodes for F# code - Show outlining and collapsable nodes for F# code + Show outlining and collapsible nodes for F# code + Show outlining and collapsible nodes for F# code diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf index 169ab6e70b..db4462e1c6 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf @@ -103,7 +103,7 @@ - Show outlining and collapsable nodes for F# code + Show outlining and collapsible nodes for F# code Mostrar los nodos de esquematización y contraíbles del código F# diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf index 25775dd37e..0ad7db5a1c 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf @@ -103,7 +103,7 @@ - Show outlining and collapsable nodes for F# code + Show outlining and collapsible nodes for F# code Afficher le mode plan et les nœuds réductibles pour le code F# diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf index ce04c11939..e662a8fd2a 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf @@ -103,7 +103,7 @@ - Show outlining and collapsable nodes for F# code + Show outlining and collapsible nodes for F# code Mostra i nodi struttura e comprimibili per il codice F# diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf index 121f92eeb6..93729b9ade 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf @@ -103,7 +103,7 @@ - Show outlining and collapsable nodes for F# code + Show outlining and collapsible nodes for F# code F# コードのアウトラインおよび折りたたみ可能なノードを表示する diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf index 5584ac9b35..96b87ca400 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf @@ -103,7 +103,7 @@ - Show outlining and collapsable nodes for F# code + Show outlining and collapsible nodes for F# code F# 코드에 대한 개요 및 축소 가능한 노드 표시 diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf index 4b6fd9bb9a..ced5a43e76 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf @@ -103,7 +103,7 @@ - Show outlining and collapsable nodes for F# code + Show outlining and collapsible nodes for F# code Pokaż konspekt i węzły z możliwością zwijania dla kodu języka F# diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf index 3df31e3689..c8c21525d0 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf @@ -103,7 +103,7 @@ - Show outlining and collapsable nodes for F# code + Show outlining and collapsible nodes for F# code Mostrar os nós de estrutura de tópicos e recolhíveis para o código F# diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf index 46deaa9227..ca718989d4 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf @@ -103,7 +103,7 @@ - Show outlining and collapsable nodes for F# code + Show outlining and collapsible nodes for F# code Показать структурирование и сворачиваемые узлы для кода F# diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf index 018e8300a9..0b2e996e1a 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf @@ -103,7 +103,7 @@ - Show outlining and collapsable nodes for F# code + Show outlining and collapsible nodes for F# code F# kodu için ana hattı ve daraltılabilir düğümleri göster diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf index 05d5f382e6..e7196a4fb2 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf @@ -103,7 +103,7 @@ - Show outlining and collapsable nodes for F# code + Show outlining and collapsible nodes for F# code 显示 F# 代码的大纲和可折叠节点 diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf index 35ba349890..dcea75f3ff 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf @@ -103,7 +103,7 @@ - Show outlining and collapsable nodes for F# code + Show outlining and collapsible nodes for F# code 顯示 F# 程式碼的大綱與可折疊的節點 From 9278ab2e48ce5576cb166635f5f0ff5d4c0c6f24 Mon Sep 17 00:00:00 2001 From: Abel Braaksma Date: Sat, 30 Jun 2018 20:00:25 +0200 Subject: [PATCH 068/150] Rename collapsable to collapsible (#5251) * Rename collapsable to collapsible * Updating resource files for rename collapsable into collapsible * Updating resource files for rename collapsable into collapsible * Removing accidentally committed *.resources files * Updating resx file for collapsable > collapsible and corresponding xlf files, fixing erroneous earlier commits --- vsintegration/src/FSharp.UIResources/Strings.resx | 2 +- vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf | 2 +- vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf | 2 +- vsintegration/src/FSharp.UIResources/xlf/Strings.en.xlf | 4 ++-- vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf | 2 +- vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf | 2 +- vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf | 2 +- vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf | 2 +- vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf | 2 +- vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf | 2 +- vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf | 2 +- vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf | 2 +- vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf | 2 +- vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf | 2 +- vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf | 2 +- 15 files changed, 16 insertions(+), 16 deletions(-) diff --git a/vsintegration/src/FSharp.UIResources/Strings.resx b/vsintegration/src/FSharp.UIResources/Strings.resx index 6022369888..3739c5bdd5 100644 --- a/vsintegration/src/FSharp.UIResources/Strings.resx +++ b/vsintegration/src/FSharp.UIResources/Strings.resx @@ -178,7 +178,7 @@ Outlining - Show outlining and collapsable nodes for F# code + Show outlining and collapsible nodes for F# code Time until stale results are used (in milliseconds) diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf index ae3db20b39..a77ae430c4 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf @@ -103,7 +103,7 @@ - Show outlining and collapsable nodes for F# code + Show outlining and collapsible nodes for F# code Zobrazí osnovu a sbalitelné uzly kódu F#. diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf index 6658e9dafa..f344152468 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf @@ -103,7 +103,7 @@ - Show outlining and collapsable nodes for F# code + Show outlining and collapsible nodes for F# code Gliederung und ausblendbare Knoten für F#-Code anzeigen diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.en.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.en.xlf index bf7693916f..d1092f1a1f 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.en.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.en.xlf @@ -103,8 +103,8 @@ - Show outlining and collapsable nodes for F# code - Show outlining and collapsable nodes for F# code + Show outlining and collapsible nodes for F# code + Show outlining and collapsible nodes for F# code diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf index 6e8557f851..e47998a5ae 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf @@ -103,7 +103,7 @@ - Show outlining and collapsable nodes for F# code + Show outlining and collapsible nodes for F# code Mostrar los nodos de esquematización y contraíbles del código F# diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf index 5786c1b28e..e663734d95 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf @@ -103,7 +103,7 @@ - Show outlining and collapsable nodes for F# code + Show outlining and collapsible nodes for F# code Afficher le mode plan et les nœuds réductibles pour le code F# diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf index 06fc90b662..107d6e418f 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf @@ -103,7 +103,7 @@ - Show outlining and collapsable nodes for F# code + Show outlining and collapsible nodes for F# code Mostra i nodi struttura e comprimibili per il codice F# diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf index 1a798938a8..5cc1e04063 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf @@ -103,7 +103,7 @@ - Show outlining and collapsable nodes for F# code + Show outlining and collapsible nodes for F# code F# コードのアウトラインおよび折りたたみ可能なノードを表示する diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf index 5491509c7c..c25a055850 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf @@ -103,7 +103,7 @@ - Show outlining and collapsable nodes for F# code + Show outlining and collapsible nodes for F# code F# 코드에 대한 개요 및 축소 가능한 노드 표시 diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf index f254313b71..d32e81df30 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf @@ -103,7 +103,7 @@ - Show outlining and collapsable nodes for F# code + Show outlining and collapsible nodes for F# code Pokaż konspekt i węzły z możliwością zwijania dla kodu języka F# diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf index 3149e6a834..a928d2d109 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf @@ -103,7 +103,7 @@ - Show outlining and collapsable nodes for F# code + Show outlining and collapsible nodes for F# code Mostrar os nós de estrutura de tópicos e recolhíveis para o código F# diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf index a8d45cfae9..5aa3a0d436 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf @@ -103,7 +103,7 @@ - Show outlining and collapsable nodes for F# code + Show outlining and collapsible nodes for F# code Показать структурирование и сворачиваемые узлы для кода F# diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf index f6749fa2f6..fb1d80ee99 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf @@ -103,7 +103,7 @@ - Show outlining and collapsable nodes for F# code + Show outlining and collapsible nodes for F# code F# kodu için ana hattı ve daraltılabilir düğümleri göster diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf index e166fbc315..27f9a39a25 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf @@ -103,7 +103,7 @@ - Show outlining and collapsable nodes for F# code + Show outlining and collapsible nodes for F# code 显示 F# 代码的大纲和可折叠节点 diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf index 3ee0567f2e..2f7dc68ba2 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf @@ -103,7 +103,7 @@ - Show outlining and collapsable nodes for F# code + Show outlining and collapsible nodes for F# code 顯示 F# 程式碼的大綱與可折疊的節點 From 76dd3836a9546c39bc41edd25b81bafb530393e3 Mon Sep 17 00:00:00 2001 From: Scott Hutchinson Date: Mon, 2 Jul 2018 09:22:39 -0700 Subject: [PATCH 069/150] Add instructions for cloning and debugging (#5276) Add some instructions for getting the latest source code from the master branch. Also add a link to some instructions for how to debug the compiler. --- DEVGUIDE.md | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/DEVGUIDE.md b/DEVGUIDE.md index 137df29811..22098bee1a 100644 --- a/DEVGUIDE.md +++ b/DEVGUIDE.md @@ -1,5 +1,19 @@ # Development Guide +## Get the Latest F# Compiler Source Code + +Get the latest source code from the master branch by running this git command: + + git clone https://github.com/Microsoft/visualfsharp.git + +Before running the build scripts, ensure that you have cleaned up the visualfsharp repo by running this git command: + + git clean -xfd + +This will remove any files that are not under version control. This is necessary only if you have already attempted to build the solution or have made other changes that might prevent it from building. + +## Installing Dependencies and Building + Follow the instructions below to build and develop the F# Compiler, Core Library and tools on Windows, macOS and Linux. - [Developing the F# Compiler (Windows)](#developing-the-f-compiler-windows) @@ -20,10 +34,6 @@ Install 2. The command prompt must have Administrator rights (`Run as Administrator`). -Before running the build scripts, ensure that you have cleaned up the visualfsharp repo by running this git command: - - git clean -xfd - On Windows you can build the F# compiler for .NET Framework as follows: build.cmd @@ -195,7 +205,11 @@ For **Release**: vsintegration\update-vsintegration.cmd release -# Notes +## Debugging the F# Compiler + +See the "Debugging The Compiler" section of this [article](https://medium.com/@willie.tetlow/f-mentorship-week-1-36f51d3812d4) + +## Notes #### Windows: Links to Additional frameworks From 32a93aa9da192ddd622d6a416748a4c00bd4f528 Mon Sep 17 00:00:00 2001 From: Will Smith Date: Mon, 2 Jul 2018 10:00:36 -0700 Subject: [PATCH 070/150] Ref scoping (#5240) * Added Limit * Trying to get basic scopes * Basic scope checks * Some more checks * Handling another ref scope case * Using env instead of cenv * Partially scoped * Almost figuring out scoping * Scopes are working * Check returnable * Current tests passing * Removed compiler generated rhs * Minor cleanup * Added scoping tests * Adding tests again * Scoping now determines what is local * Updated tests/baseline for byrefs. Simplified compiler generated check * Trivial change for scope check * Fixed bug with stack referring span-likes returning by-refs in scopes other than the method/function level * Quick fix * Preventing taking address of expression that isn't a let-bound value * Updated baseline * Updated baseline * Added better way to disable address of * Finishing up. Updating baselines * Updating neg106 baseline * Updated baselines again * Removing compiler generated check by fixing GetLimitVal --- .../FSharp.Compiler.Private/FSComp.fs | 4 + .../FSharp.Compiler.Private/FSComp.resx | 3 + src/fsharp/FSComp.txt | 3 +- src/fsharp/MethodCalls.fs | 4 + src/fsharp/PostInferenceChecks.fs | 304 +++++++++++------- src/fsharp/TastOps.fs | 4 +- src/fsharp/TypeChecker.fs | 2 + src/fsharp/xlf/FSComp.txt.cs.xlf | 5 + src/fsharp/xlf/FSComp.txt.de.xlf | 5 + src/fsharp/xlf/FSComp.txt.en.xlf | 5 + src/fsharp/xlf/FSComp.txt.es.xlf | 5 + src/fsharp/xlf/FSComp.txt.fr.xlf | 5 + src/fsharp/xlf/FSComp.txt.it.xlf | 5 + src/fsharp/xlf/FSComp.txt.ja.xlf | 5 + src/fsharp/xlf/FSComp.txt.ko.xlf | 5 + src/fsharp/xlf/FSComp.txt.pl.xlf | 5 + src/fsharp/xlf/FSComp.txt.pt-BR.xlf | 5 + src/fsharp/xlf/FSComp.txt.ru.xlf | 5 + src/fsharp/xlf/FSComp.txt.tr.xlf | 5 + src/fsharp/xlf/FSComp.txt.zh-Hans.xlf | 5 + src/fsharp/xlf/FSComp.txt.zh-Hant.xlf | 5 + tests/fsharp/core/byrefs/test.bsl | 11 + tests/fsharp/core/byrefs/test.fsx | 34 +- tests/fsharp/core/byrefs/test2.bsl | 26 ++ tests/fsharp/core/byrefs/test2.fsx | 145 +++++++++ tests/fsharp/core/span/test.fsx | 8 +- tests/fsharp/core/span/test2.bsl | 2 + tests/fsharp/core/span/test2.fsx | 20 +- tests/fsharp/tests.fs | 12 + tests/fsharp/typecheck/sigs/neg106.bsl | 2 + tests/fsharp/typecheck/sigs/neg106.vsbsl | 2 + 31 files changed, 521 insertions(+), 135 deletions(-) create mode 100644 tests/fsharp/core/byrefs/test2.bsl create mode 100644 tests/fsharp/core/byrefs/test2.fsx diff --git a/src/buildfromsource/FSharp.Compiler.Private/FSComp.fs b/src/buildfromsource/FSharp.Compiler.Private/FSComp.fs index 32f0d89eb7..894d6051fe 100644 --- a/src/buildfromsource/FSharp.Compiler.Private/FSComp.fs +++ b/src/buildfromsource/FSharp.Compiler.Private/FSComp.fs @@ -4351,6 +4351,9 @@ type internal SR private() = /// A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. /// (Originally from ..\FSComp.txt:1441) static member chkNoSpanLikeValueFromExpression() = (3237, GetStringFunc("chkNoSpanLikeValueFromExpression",",,,") ) + /// Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + /// (Originally from ..\FSComp.txt:1442) + static member tastCantTakeAddressOfExpression() = (3238, GetStringFunc("tastCantTakeAddressOfExpression",",,,") ) /// Call this method once to validate that all known resources are valid; throws if not static member RunStartupValidation() = @@ -5766,4 +5769,5 @@ type internal SR private() = ignore(GetString("chkNoByrefLikeFunctionCall")) ignore(GetString("chkNoSpanLikeVariable")) ignore(GetString("chkNoSpanLikeValueFromExpression")) + ignore(GetString("tastCantTakeAddressOfExpression")) () diff --git a/src/buildfromsource/FSharp.Compiler.Private/FSComp.resx b/src/buildfromsource/FSharp.Compiler.Private/FSComp.resx index c24e17e1f2..535542cd9f 100644 --- a/src/buildfromsource/FSharp.Compiler.Private/FSComp.resx +++ b/src/buildfromsource/FSharp.Compiler.Private/FSComp.resx @@ -4354,4 +4354,7 @@ A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + \ No newline at end of file diff --git a/src/fsharp/FSComp.txt b/src/fsharp/FSComp.txt index b3a60ed307..3b058f3a8f 100644 --- a/src/fsharp/FSComp.txt +++ b/src/fsharp/FSComp.txt @@ -1438,4 +1438,5 @@ notAFunctionButMaybeDeclaration,"This value is not a function and cannot be appl 3234,chkStructsMayNotReturnAddressesOfContents,"Struct members cannot return the address of fields of the struct by reference" 3235,chkNoByrefLikeFunctionCall,"The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope." 3236,chkNoSpanLikeVariable,"The Span or IsByRefLike variable '%s' cannot be used at this point. This is to ensure the address of the local value does not escape its scope." -3237,chkNoSpanLikeValueFromExpression,"A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope." \ No newline at end of file +3237,chkNoSpanLikeValueFromExpression,"A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope." +3238,tastCantTakeAddressOfExpression,"Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address." \ No newline at end of file diff --git a/src/fsharp/MethodCalls.fs b/src/fsharp/MethodCalls.fs index 085936494a..d51bbe953c 100644 --- a/src/fsharp/MethodCalls.fs +++ b/src/fsharp/MethodCalls.fs @@ -134,10 +134,14 @@ let AdjustCalledArgType (infoReader:InfoReader) isConstraint (calledArg: CalledA // If the called method argument is an inref type, then the caller may provide a byref or value if isInByrefTy g calledArgTy then +#if IMPLICIT_ADDRESS_OF if isByrefTy g callerArgTy then calledArgTy else destByrefTy g calledArgTy +#else + calledArgTy +#endif // If the called method argument is a (non inref) byref type, then the caller may provide a byref or ref. elif isByrefTy g calledArgTy then diff --git a/src/fsharp/PostInferenceChecks.fs b/src/fsharp/PostInferenceChecks.fs index a04ad30459..55fca9c210 100644 --- a/src/fsharp/PostInferenceChecks.fs +++ b/src/fsharp/PostInferenceChecks.fs @@ -103,7 +103,10 @@ type env = reflect : bool /// Are we in an extern declaration? - external : bool } + external : bool + + /// Current return scope of the expr. + returnScope : int } let BindTypar env (tp:Typar) = { env with @@ -128,17 +131,72 @@ let BindArgVals env (vs: Val list) = /// Limit flags represent a type(s) returned from checking an expression(s) that is interesting to impose rules on. [] type LimitFlags = - | None = 0b000000 - | LocalByRef = 0b000001 - | LocalByRefOfSpanLike = 0b000011 - | LocalByRefOfStackReferringSpanLike = 0b000101 - | SpanLike = 0b001000 - | StackReferringSpanLike = 0b010000 - | ByRefOfSpanLike = 0b100000 + | None = 0b00000 + | ByRef = 0b00001 + | ByRefOfSpanLike = 0b00011 + | ByRefOfStackReferringSpanLike = 0b00101 + | SpanLike = 0b01000 + | StackReferringSpanLike = 0b10000 + +[] +type Limit = + { + scope: int + flags: LimitFlags + } + + member this.IsLocal = this.scope >= 1 + +/// Check if the limit has the target limit. +let inline HasLimitFlag targetLimit (limit: Limit) = + limit.flags &&& targetLimit = targetLimit + +let NoLimit = { scope = 0; flags = LimitFlags.None } + +// Combining two limits will result in both limit flags merged. +// If none of the limits are limited by a by-ref or a stack referring span-like +// the scope will be 0. +let CombineTwoLimits limit1 limit2 = + let isByRef1 = HasLimitFlag LimitFlags.ByRef limit1 + let isByRef2 = HasLimitFlag LimitFlags.ByRef limit2 + let isStackSpan1 = HasLimitFlag LimitFlags.StackReferringSpanLike limit1 + let isStackSpan2 = HasLimitFlag LimitFlags.StackReferringSpanLike limit2 + let isLimited1 = isByRef1 || isStackSpan1 + let isLimited2 = isByRef2 || isStackSpan2 + + // A limit that has a stack referring span-like but not a by-ref, + // we force the scope to 1. This is to handle call sites + // that return a by-ref and have stack referring span-likes as arguments. + // This is to ensure we can only prevent out of scope at the method level rather than visibility. + let limit1 = + if isStackSpan1 && not isByRef1 then + { limit1 with scope = 1 } + else + limit1 + + let limit2 = + if isStackSpan2 && not isByRef2 then + { limit2 with scope = 1 } + else + limit2 + + match isLimited1, isLimited2 with + | false, false -> + { scope = 0; flags = limit1.flags ||| limit2.flags } + | true, true -> + { scope = Math.Max(limit1.scope, limit2.scope); flags = limit1.flags ||| limit2.flags } + | true, false -> + { limit1 with flags = limit1.flags ||| limit2.flags } + | false, true -> + { limit2 with flags = limit1.flags ||| limit2.flags } + +let CombineLimits limits = + (NoLimit, limits) + ||> List.fold CombineTwoLimits type cenv = { boundVals: Dictionary // really a hash set - limitVals: Dictionary + limitVals: Dictionary mutable potentialUnboundUsesOfVals: StampMap g: TcGlobals amap: Import.ImportMap @@ -162,63 +220,59 @@ let IsValArgument env (v: Val) = let IsValLocal env (v: Val) = v.ValReprInfo.IsNone && not (IsValArgument env v) -/// Check if the limit has the target limit. -let inline HasLimitFlag targetLimit limit = - limit &&& targetLimit = targetLimit - /// Get the limit of the val. let GetLimitVal cenv env m (v: Val) = let limit = match cenv.limitVals.TryGetValue(v.Stamp) with | true, limit -> limit - | _ -> LimitFlags.None + | _ -> + if IsValLocal env v then + { scope = 1; flags = LimitFlags.None } + else + NoLimit if isSpanLikeTy cenv.g m v.Type then // The value is a limited Span or might have become one through mutation - let isLocal = IsValLocal env v - let isMutableLocal = isLocal && v.IsMutable && cenv.isInternalTestSpanStackReferring - let isLimitedLocal = isLocal && HasLimitFlag LimitFlags.StackReferringSpanLike limit - if isMutableLocal || isLimitedLocal then - LimitFlags.StackReferringSpanLike + let isMutable = v.IsMutable && cenv.isInternalTestSpanStackReferring + let isLimited = HasLimitFlag LimitFlags.StackReferringSpanLike limit + + if isMutable || isLimited then + { limit with flags = LimitFlags.StackReferringSpanLike } else - LimitFlags.SpanLike + { limit with flags = LimitFlags.SpanLike } elif isByrefTy cenv.g v.Type then - let isLocal = IsValLocal env v - let isLimitedLocal = isLocal && HasLimitFlag LimitFlags.LocalByRef limit let isByRefOfSpanLike = isSpanLikeTy cenv.g m (destByrefTy cenv.g v.Type) - match isLimitedLocal, isByRefOfSpanLike with - | true, false -> LimitFlags.LocalByRef - | true, true -> - if HasLimitFlag LimitFlags.LocalByRefOfStackReferringSpanLike limit then - LimitFlags.LocalByRefOfStackReferringSpanLike + if isByRefOfSpanLike then + if HasLimitFlag LimitFlags.ByRefOfStackReferringSpanLike limit then + { limit with flags = LimitFlags.ByRefOfStackReferringSpanLike } else - LimitFlags.LocalByRefOfSpanLike - | false, true -> LimitFlags.ByRefOfSpanLike - | _ -> LimitFlags.None + { limit with flags = LimitFlags.ByRefOfSpanLike } + else + { limit with flags = LimitFlags.ByRef } else - LimitFlags.None + { limit with flags = LimitFlags.None } /// Get the limit of the val by reference. let GetLimitValByRef cenv env m v = let limit = GetLimitVal cenv env m v - if HasLimitFlag LimitFlags.StackReferringSpanLike limit then - LimitFlags.LocalByRefOfStackReferringSpanLike + let scope = + // Getting the address of an argument will always be a scope of 1. + if IsValArgument env v then 1 + else limit.scope - elif IsValLocal env v || IsValArgument env v then - if HasLimitFlag LimitFlags.SpanLike limit then - LimitFlags.LocalByRefOfSpanLike + let flags = + if HasLimitFlag LimitFlags.StackReferringSpanLike limit then + LimitFlags.ByRefOfStackReferringSpanLike + elif HasLimitFlag LimitFlags.SpanLike limit then + LimitFlags.ByRefOfSpanLike else - LimitFlags.LocalByRef + LimitFlags.ByRef - elif HasLimitFlag LimitFlags.SpanLike limit then - LimitFlags.ByRefOfSpanLike - - else - LimitFlags.None + { scope = scope; flags = flags } let LimitVal cenv (v:Val) limit = cenv.limitVals.[v.Stamp] <- limit @@ -624,7 +678,7 @@ and CheckValUse (cenv: cenv) (env: env) (vref: ValRef, vFlags, m) (context: Perm // &y let isReturnExprBuiltUsingStackReferringByRefLike = context.PermitOnlyReturnable && - (HasLimitFlag LimitFlags.LocalByRef limit || + ((HasLimitFlag LimitFlags.ByRef limit && limit.scope >= env.returnScope) || HasLimitFlag LimitFlags.StackReferringSpanLike limit) if isReturnExprBuiltUsingStackReferringByRefLike then @@ -689,24 +743,24 @@ and CheckForOverAppliedExceptionRaisingPrimitive (cenv:cenv) expr = | _ -> () | _ -> () -and CheckCallLimitArgs cenv m (returnTy: TType) limitArgs (context: PermitByRefExpr) = +and CheckCallLimitArgs cenv env m returnTy limitArgs (context: PermitByRefExpr) = let isReturnByref = isByrefTy cenv.g returnTy let isReturnSpanLike = isSpanLikeTy cenv.g m returnTy // If return is a byref, and being used as a return, then a single argument cannot be a local-byref or a stack referring span-like. let isReturnLimitedByRef = isReturnByref && - (HasLimitFlag LimitFlags.LocalByRef limitArgs || + (HasLimitFlag LimitFlags.ByRef limitArgs || HasLimitFlag LimitFlags.StackReferringSpanLike limitArgs) // If return is a byref, and being used as a return, then a single argument cannot be a stack referring span-like or a local-byref of a stack referring span-like. let isReturnLimitedSpanLike = isReturnSpanLike && (HasLimitFlag LimitFlags.StackReferringSpanLike limitArgs || - HasLimitFlag LimitFlags.LocalByRefOfStackReferringSpanLike limitArgs) + HasLimitFlag LimitFlags.ByRefOfStackReferringSpanLike limitArgs) if cenv.reportErrors then - if context.PermitOnlyReturnable && (isReturnLimitedByRef || isReturnLimitedSpanLike) then + if context.PermitOnlyReturnable && ((isReturnLimitedByRef && limitArgs.scope >= env.returnScope) || isReturnLimitedSpanLike) then if isReturnLimitedSpanLike then errorR(Error(FSComp.SR.chkNoSpanLikeValueFromExpression(), m)) else @@ -717,7 +771,7 @@ and CheckCallLimitArgs cenv m (returnTy: TType) limitArgs (context: PermitByRefE let isCallLimited = HasLimitFlag LimitFlags.ByRefOfSpanLike limitArgs && (HasLimitFlag LimitFlags.StackReferringSpanLike limitArgs || - HasLimitFlag LimitFlags.LocalByRefOfStackReferringSpanLike limitArgs) + HasLimitFlag LimitFlags.ByRefOfStackReferringSpanLike limitArgs) if isCallLimited then errorR(Error(FSComp.SR.chkNoByrefLikeFunctionCall(), m)) @@ -726,33 +780,33 @@ and CheckCallLimitArgs cenv m (returnTy: TType) limitArgs (context: PermitByRefE if isSpanLikeTy cenv.g m (destByrefTy cenv.g returnTy) then let isStackReferring = HasLimitFlag LimitFlags.StackReferringSpanLike limitArgs || - HasLimitFlag LimitFlags.LocalByRefOfStackReferringSpanLike limitArgs + HasLimitFlag LimitFlags.ByRefOfStackReferringSpanLike limitArgs if isStackReferring then - LimitFlags.LocalByRefOfStackReferringSpanLike + { limitArgs with flags = LimitFlags.ByRefOfStackReferringSpanLike } else - LimitFlags.LocalByRefOfSpanLike + { limitArgs with flags = LimitFlags.ByRefOfSpanLike } else - LimitFlags.LocalByRef + { limitArgs with flags = LimitFlags.ByRef } elif isReturnLimitedSpanLike then - LimitFlags.StackReferringSpanLike + { scope = 1; flags = LimitFlags.StackReferringSpanLike } elif isReturnByref then if isSpanLikeTy cenv.g m (destByrefTy cenv.g returnTy) then - LimitFlags.ByRefOfSpanLike + { limitArgs with flags = LimitFlags.ByRefOfSpanLike } else - LimitFlags.None + { limitArgs with flags = LimitFlags.ByRef } elif isReturnSpanLike then - LimitFlags.SpanLike + { scope = 1; flags = LimitFlags.SpanLike } else - LimitFlags.None + { scope = 1; flags = LimitFlags.None } /// Check call arguments, including the return argument. and CheckCall cenv env m returnTy args contexts context = let limitArgs = CheckExprs cenv env args contexts - CheckCallLimitArgs cenv m returnTy limitArgs context + CheckCallLimitArgs cenv env m returnTy limitArgs context /// Check call arguments, including the return argument. The receiver argument is handled differently. and CheckCallWithReceiver cenv env m returnTy args contexts context = @@ -769,16 +823,17 @@ and CheckCallWithReceiver cenv env m returnTy args contexts context = let limitArgs = let limitArgs = CheckExprs cenv env args contexts // We do not include the receiver's limit in the limit args unless the receiver is a stack referring span-like. - if HasLimitFlag LimitFlags.StackReferringSpanLike receiverLimit || HasLimitFlag LimitFlags.LocalByRefOfStackReferringSpanLike receiverLimit then - limitArgs ||| receiverLimit + if HasLimitFlag LimitFlags.ByRefOfStackReferringSpanLike receiverLimit then + // Scope is 1 to ensure any by-refs returned can only be prevented for out of scope of the function/method, not visibility. + CombineTwoLimits limitArgs { receiverLimit with scope = 1 } else limitArgs - CheckCallLimitArgs cenv m returnTy limitArgs context + CheckCallLimitArgs cenv env m returnTy limitArgs context /// Check call arguments, including the return argument. Permits returnable byref. and CheckCallPermitReturnableByRef cenv env m returnTy args = let limitArgs = CheckExprsPermitByRefLike cenv env args - CheckCallLimitArgs cenv m returnTy limitArgs PermitByRefExpr.YesReturnable + CheckCallLimitArgs cenv env m returnTy limitArgs PermitByRefExpr.YesReturnable /// Check call arguments, including the return argument. The receiver argument is handled differently. Permits returnable byref. and CheckCallWithReceiverPermitReturnableByRef cenv env m returnTy args = @@ -787,14 +842,14 @@ and CheckCallWithReceiverPermitReturnableByRef cenv env m returnTy args = /// Check call arguments, including the return argument. Permits byref. and CheckCallPermitByRefLike cenv env m returnTy args = let limitArgs = CheckExprsPermitByRefLike cenv env args - CheckCallLimitArgs cenv m returnTy limitArgs PermitByRefExpr.Yes + CheckCallLimitArgs cenv env m returnTy limitArgs PermitByRefExpr.Yes /// Check call arguments, including the return argument. The receiver argument is handled differently. Permits byref. and CheckCallWithReceiverPermitByRefLike cenv env m returnTy args = CheckCallWithReceiver cenv env m returnTy args (List.init args.Length (fun _ -> PermitByRefExpr.Yes)) PermitByRefExpr.Yes /// Check an expression, given information about the position of the expression -and CheckExpr (cenv:cenv) (env:env) origExpr (context:PermitByRefExpr) : LimitFlags = +and CheckExpr (cenv:cenv) (env:env) origExpr (context:PermitByRefExpr) : Limit = let g = cenv.g let origExpr = stripExpr origExpr @@ -812,21 +867,25 @@ and CheckExpr (cenv:cenv) (env:env) origExpr (context:PermitByRefExpr) : LimitFl CheckExpr cenv env e2 context // carry context into _;RHS (normal sequencing only) | ThenDoSeq -> CheckExprNoByrefs cenv {env with ctorLimitedZone=false} e2 - LimitFlags.None + NoLimit - | Expr.Let ((TBind(v,_,_) as bind),body,_,_) -> - let limit = CheckBinding cenv env false bind + | Expr.Let ((TBind(v,_bindRhs,_) as bind),body,_,_) -> + let isByRef = isByrefTy cenv.g v.Type - BindVal cenv env v - - if limit <> LimitFlags.None then - LimitVal cenv v limit + let bindingContext = + if isByRef then + PermitByRefExpr.YesReturnable + else + PermitByRefExpr.Yes + let limit = CheckBinding cenv { env with returnScope = env.returnScope + 1 } false bindingContext bind + BindVal cenv env v + LimitVal cenv v { limit with scope = if isByRef then limit.scope else env.returnScope } CheckExpr cenv env body context | Expr.Const (_,m,ty) -> CheckTypePermitAllByrefs cenv env m ty - LimitFlags.None + NoLimit | Expr.Val (vref,vFlags,m) -> CheckValUse cenv env (vref, vFlags, m) context @@ -848,7 +907,7 @@ and CheckExpr (cenv:cenv) (env:env) origExpr (context:PermitByRefExpr) : LimitFl errorRecovery e m CheckTypeNoByrefs cenv env m ty - LimitFlags.None + NoLimit | Expr.Obj (_,ty,basev,superInitCall,overrides,iimpls,m) -> CheckExprNoByrefs cenv env superInitCall @@ -864,7 +923,7 @@ and CheckExpr (cenv:cenv) (env:env) origExpr (context:PermitByRefExpr) : LimitFl |> List.filter (isInterfaceTy g) CheckMultipleInterfaceInstantiations cenv interfaces m - LimitFlags.None + NoLimit // Allow base calls to F# methods | Expr.App((InnerExprPat(ExprValWithPossibleTypeInst(v,vFlags,_,_) as f)),_fty,tyargs,(Expr.Val(baseVal,_,_) :: rest),m) @@ -874,7 +933,7 @@ and CheckExpr (cenv:cenv) (env:env) origExpr (context:PermitByRefExpr) : LimitFl let memberInfo = Option.get v.MemberInfo if memberInfo.MemberFlags.IsDispatchSlot then errorR(Error(FSComp.SR.tcCannotCallAbstractBaseMember(v.DisplayName),m)) - LimitFlags.None + NoLimit else CheckValRef cenv env v m PermitByRefExpr.No CheckValRef cenv env baseVal m PermitByRefExpr.No @@ -911,17 +970,17 @@ and CheckExpr (cenv:cenv) (env:env) origExpr (context:PermitByRefExpr) : LimitFl // Allow 'typeof' calls as a special case, the only accepted use of System.Void! | TypeOfExpr g ty when isVoidTy g ty -> - LimitFlags.None + NoLimit // Allow 'typedefof' calls as a special case, the only accepted use of System.Void! | TypeDefOfExpr g ty when isVoidTy g ty -> - LimitFlags.None + NoLimit // Allow '%expr' in quotations | Expr.App(Expr.Val(vref,_,_),_,tinst,[arg],m) when isSpliceOperator g vref && env.quote -> CheckTypeInstPermitAllByrefs cenv env m tinst // it's the splice operator, a byref instantiation is allowed CheckExprNoByrefs cenv env arg - LimitFlags.None + NoLimit // Check an application | Expr.App(f,_fty,tyargs,argsl,m) -> @@ -943,17 +1002,17 @@ and CheckExpr (cenv:cenv) (env:env) origExpr (context:PermitByRefExpr) : LimitFl | Expr.Lambda(_,_ctorThisValOpt,_baseValOpt,argvs,_,m,rty) -> let topValInfo = ValReprInfo ([],[argvs |> List.map (fun _ -> ValReprInfo.unnamedTopArg1)],ValReprInfo.unnamedRetVal) let ty = mkMultiLambdaTy m argvs rty in - CheckLambdas false None cenv env false topValInfo false expr m ty + CheckLambdas false None cenv env false topValInfo false expr m ty PermitByRefExpr.Yes | Expr.TyLambda(_,tps,_,m,rty) -> let topValInfo = ValReprInfo (ValReprInfo.InferTyparInfo tps,[],ValReprInfo.unnamedRetVal) let ty = mkForallTyIfNeeded tps rty in - CheckLambdas false None cenv env false topValInfo false expr m ty + CheckLambdas false None cenv env false topValInfo false expr m ty PermitByRefExpr.Yes | Expr.TyChoose(tps,e1,_) -> let env = BindTypars g env tps CheckExprNoByrefs cenv env e1 - LimitFlags.None + NoLimit | Expr.Match(_,_,dtree,targets,m,ty) -> CheckTypePermitAllByrefs cenv env m ty // computed byrefs allowed at each branch @@ -964,7 +1023,7 @@ and CheckExpr (cenv:cenv) (env:env) origExpr (context:PermitByRefExpr) : LimitFl BindVals cenv env (valsOfBinds binds) CheckBindings cenv env binds CheckExprNoByrefs cenv env e - LimitFlags.None + NoLimit | Expr.StaticOptimization (constraints,e2,e3,m) -> CheckExprNoByrefs cenv env e2 @@ -975,7 +1034,7 @@ and CheckExpr (cenv:cenv) (env:env) origExpr (context:PermitByRefExpr) : LimitFl CheckTypeNoByrefs cenv env m ty2 | TTyconIsStruct(ty1) -> CheckTypeNoByrefs cenv env m ty1) - LimitFlags.None + NoLimit | Expr.Link _ -> failwith "Unexpected reclink" @@ -1029,7 +1088,7 @@ and CheckExprOp cenv env (op,tyargs,args,m) context expr = let limit1 = CheckExpr cenv env e1 context // result of a try/catch can be a byref if in a position where the overall expression is can be a byref // [(* e2; -- don't check filter body - duplicates logic in 'catch' body *) e3] let limit2 = CheckExpr cenv env e3 context // result of a try/catch can be a byref if in a position where the overall expression is can be a byref - limit1 ||| limit2 + CombineTwoLimits limit1 limit2 | TOp.ILCall (_,_,_,_,_,_,_,methRef,enclTypeArgs,methTypeArgs,tys),_,_ -> CheckTypeInstNoByrefs cenv env m tyargs @@ -1070,7 +1129,7 @@ and CheckExprOp cenv env (op,tyargs,args,m) context expr = | TOp.LValueOp(LAddrOf _,vref),_,_ -> let limit1 = GetLimitValByRef cenv env m vref.Deref let limit2 = CheckExprsNoByRefLike cenv env args - let limit = limit1 ||| limit2 + let limit = CombineTwoLimits limit1 limit2 if cenv.reportErrors then @@ -1079,7 +1138,8 @@ and CheckExprOp cenv env (op,tyargs,args,m) context expr = let returningAddrOfLocal = context.PermitOnlyReturnable && - HasLimitFlag LimitFlags.LocalByRef limit + HasLimitFlag LimitFlags.ByRef limit && + limit.scope >= env.returnScope if returningAddrOfLocal then if vref.IsCompilerGenerated then @@ -1091,15 +1151,15 @@ and CheckExprOp cenv env (op,tyargs,args,m) context expr = | TOp.LValueOp(LByrefSet,vref),_,[arg] -> let limit = GetLimitVal cenv env m vref.Deref - let isVrefLimited = not (HasLimitFlag LimitFlags.LocalByRefOfStackReferringSpanLike limit) + let isVrefLimited = not (HasLimitFlag LimitFlags.ByRefOfStackReferringSpanLike limit) let isArgLimited = HasLimitFlag LimitFlags.StackReferringSpanLike (CheckExprPermitByRefLike cenv env arg) if isVrefLimited && isArgLimited then errorR(Error(FSComp.SR.chkNoWriteToLimitedSpan(vref.DisplayName), m)) - LimitFlags.None + NoLimit | TOp.LValueOp(LByrefGet,vref),_,[] -> let limit = GetLimitVal cenv env m vref.Deref - if HasLimitFlag LimitFlags.LocalByRefOfStackReferringSpanLike limit then + if HasLimitFlag LimitFlags.ByRefOfStackReferringSpanLike limit then if cenv.reportErrors && context.PermitOnlyReturnable then if vref.IsCompilerGenerated then @@ -1107,18 +1167,18 @@ and CheckExprOp cenv env (op,tyargs,args,m) context expr = else errorR(Error(FSComp.SR.chkNoSpanLikeVariable(vref.DisplayName), m)) - LimitFlags.StackReferringSpanLike - elif HasLimitFlag LimitFlags.LocalByRefOfSpanLike limit then - LimitFlags.SpanLike + { scope = 1; flags = LimitFlags.StackReferringSpanLike } + elif HasLimitFlag LimitFlags.ByRefOfSpanLike limit then + { scope = 1; flags = LimitFlags.SpanLike } else - LimitFlags.None + { scope = 1; flags = LimitFlags.None } | TOp.LValueOp(LSet _, vref),_,[arg] -> let isVrefLimited = not (HasLimitFlag LimitFlags.StackReferringSpanLike (GetLimitVal cenv env m vref.Deref)) let isArgLimited = HasLimitFlag LimitFlags.StackReferringSpanLike (CheckExprPermitByRefLike cenv env arg) if isVrefLimited && isArgLimited then errorR(Error(FSComp.SR.chkNoWriteToLimitedSpan(vref.DisplayName), m)) - LimitFlags.None + NoLimit | TOp.TupleFieldGet _,_,[arg1] -> CheckTypeInstNoByrefs cenv env m tyargs @@ -1137,11 +1197,11 @@ and CheckExprOp cenv env (op,tyargs,args,m) context expr = let limit1 = CheckExprPermitByRefLike cenv env arg1 let limit2 = CheckExprPermitByRefLike cenv env arg2 - let isLhsLimited = not (HasLimitFlag LimitFlags.LocalByRefOfStackReferringSpanLike limit1) + let isLhsLimited = not (HasLimitFlag LimitFlags.ByRefOfStackReferringSpanLike limit1) let isRhsLimited = HasLimitFlag LimitFlags.StackReferringSpanLike limit2 if isLhsLimited && isRhsLimited then errorR(Error(FSComp.SR.chkNoWriteToLimitedSpan(rf.FieldName), m)) - LimitFlags.None + NoLimit | TOp.Coerce,[tgty;srcty],[x] -> if TypeRelations.TypeDefinitelySubsumesTypeNoCoercion 0 g cenv.amap m tgty srcty then @@ -1149,11 +1209,11 @@ and CheckExprOp cenv env (op,tyargs,args,m) context expr = else CheckTypeInstNoByrefs cenv env m tyargs CheckExprNoByrefs cenv env x - LimitFlags.None + NoLimit | TOp.Reraise,[_ty1],[] -> CheckTypeInstNoByrefs cenv env m tyargs - LimitFlags.None + NoLimit // Check get of static field | TOp.ValFieldGetAddr (rfref, _readonly),tyargs,[] -> @@ -1162,7 +1222,7 @@ and CheckExprOp cenv env (op,tyargs,args,m) context expr = errorR(Error(FSComp.SR.chkNoAddressStaticFieldAtThisPoint(rfref.FieldName), m)) CheckTypeInstNoByrefs cenv env m tyargs - LimitFlags.None + NoLimit // Check get of instance field | TOp.ValFieldGetAddr (rfref, _readonly),tyargs,[obj] -> @@ -1230,7 +1290,7 @@ and CheckExprOp cenv env (op,tyargs,args,m) context expr = if context.Disallow && cenv.reportErrors && isByrefLikeTy g m (tyOfExpr g expr) then errorR(Error(FSComp.SR.chkNoAddressFieldAtThisPoint(fspec.Name), m)) - LimitFlags.None + NoLimit | [ I_ldflda (fspec) ], [obj] -> if context.Disallow && cenv.reportErrors && isByrefLikeTy g m (tyOfExpr g expr) then @@ -1267,18 +1327,17 @@ and CheckExprOp cenv env (op,tyargs,args,m) context expr = CheckTypeInstNoByrefs cenv env m tyargs CheckExprsNoByRefLike cenv env args -and CheckLambdas isTop (memInfo: ValMemberInfo option) cenv env inlined topValInfo alwaysCheckNoReraise e m ety = +and CheckLambdas isTop (memInfo: ValMemberInfo option) cenv env inlined topValInfo alwaysCheckNoReraise e m ety context = let g = cenv.g // The topValInfo here says we are _guaranteeing_ to compile a function value // as a .NET method with precisely the corresponding argument counts. match e with | Expr.TyChoose(tps,e1,m) -> let env = BindTypars g env tps - CheckLambdas isTop memInfo cenv env inlined topValInfo alwaysCheckNoReraise e1 m ety + CheckLambdas isTop memInfo cenv env inlined topValInfo alwaysCheckNoReraise e1 m ety context | Expr.Lambda (_,_,_,_,_,m,_) | Expr.TyLambda(_,_,_,m,_) -> - let tps,ctorThisValOpt,baseValOpt,vsl,body,bodyty = destTopLambda g cenv.amap topValInfo (e, ety) in let env = BindTypars g env tps let thisAndBase = Option.toList ctorThisValOpt @ Option.toList baseValOpt @@ -1334,7 +1393,7 @@ and CheckLambdas isTop (memInfo: ValMemberInfo option) cenv env inlined topValIn if tp.Constraints |> List.sumBy (function TyparConstraint.CoercesTo(ty,_) when isClassTy g ty -> 1 | _ -> 0) > 1 then errorR(Error(FSComp.SR.chkTyparMultipleClassConstraints(), m)) - LimitFlags.None + NoLimit // This path is for expression bindings that are not actually lambdas | _ -> @@ -1343,46 +1402,46 @@ and CheckLambdas isTop (memInfo: ValMemberInfo option) cenv env inlined topValIn let limit = if not inlined && (isByrefLikeTy g m ety || isNativePtrTy g ety) then // allow byref to occur as RHS of byref binding. - CheckExprPermitByRefLike cenv env e + CheckExpr cenv env e context else CheckExprNoByrefs cenv env e - LimitFlags.None + NoLimit if alwaysCheckNoReraise then CheckNoReraise cenv None e limit -and CheckExprs cenv env exprs contexts : LimitFlags = +and CheckExprs cenv env exprs contexts : Limit = let contexts = Array.ofList contexts let argArity i = if i < contexts.Length then contexts.[i] else PermitByRefExpr.No exprs |> List.mapi (fun i exp -> CheckExpr cenv env exp (argArity i)) - |> List.fold (|||) LimitFlags.None + |> CombineLimits -and CheckExprsNoByRefLike cenv env exprs : LimitFlags = +and CheckExprsNoByRefLike cenv env exprs : Limit = exprs |> List.iter (CheckExprNoByrefs cenv env) - LimitFlags.None + NoLimit and CheckExprsPermitByRefLike cenv env exprs = exprs |> List.map (CheckExprPermitByRefLike cenv env) - |> List.fold (|||) LimitFlags.None + |> CombineLimits -and CheckExprsPermitReturnableByRef cenv env exprs : LimitFlags = +and CheckExprsPermitReturnableByRef cenv env exprs : Limit = exprs |> List.map (CheckExprPermitReturnableByRef cenv env) - |> List.fold (|||) LimitFlags.None + |> CombineLimits -and CheckExprPermitByRefLike cenv env expr : LimitFlags = +and CheckExprPermitByRefLike cenv env expr : Limit = CheckExpr cenv env expr PermitByRefExpr.Yes -and CheckExprPermitReturnableByRef cenv env expr : LimitFlags = +and CheckExprPermitReturnableByRef cenv env expr : Limit = CheckExpr cenv env expr PermitByRefExpr.YesReturnable and CheckDecisionTreeTargets cenv env targets context = targets |> Array.map (CheckDecisionTreeTarget cenv env context) - |> Array.fold (|||) LimitFlags.None + |> (CombineLimits << List.ofArray) and CheckDecisionTreeTarget cenv env context (TTarget(vs,e,_)) = BindVals cenv env vs @@ -1394,7 +1453,7 @@ and CheckDecisionTree cenv env x = | TDSuccess (es,_) -> CheckExprsNoByRefLike cenv env es |> ignore | TDBind(bind,rest) -> - CheckBinding cenv env false bind |> ignore + CheckBinding cenv env false PermitByRefExpr.Yes bind |> ignore CheckDecisionTree cenv env rest | TDSwitch (e,cases,dflt,m) -> CheckDecisionTreeSwitch cenv env (e,cases,dflt,m) @@ -1508,7 +1567,7 @@ and AdjustAccess isHidden (cpath: unit -> CompilationPath) access = else access -and CheckBinding cenv env alwaysCheckNoReraise (TBind(v,bindRhs,_) as bind) : LimitFlags = +and CheckBinding cenv env alwaysCheckNoReraise context (TBind(v,bindRhs,_) as bind) : Limit = let g = cenv.g let isTop = Option.isSome bind.Var.ValReprInfo //printfn "visiting %s..." v.DisplayName @@ -1606,10 +1665,10 @@ and CheckBinding cenv env alwaysCheckNoReraise (TBind(v,bindRhs,_) as bind) : Li let topValInfo = match bind.Var.ValReprInfo with Some info -> info | _ -> ValReprInfo.emptyValData - CheckLambdas isTop v.MemberInfo cenv env v.MustInline topValInfo alwaysCheckNoReraise bindRhs v.Range v.Type + CheckLambdas isTop v.MemberInfo cenv env v.MustInline topValInfo alwaysCheckNoReraise bindRhs v.Range v.Type context and CheckBindings cenv env xs = - xs |> List.iter (CheckBinding cenv env false >> ignore) + xs |> List.iter (CheckBinding cenv env false PermitByRefExpr.Yes >> ignore) // Top binds introduce expression, check they are reraise free. let CheckModuleBinding cenv env (TBind(v,e,_) as bind) = @@ -1737,7 +1796,7 @@ let CheckModuleBinding cenv env (TBind(v,e,_) as bind) = with e -> errorRecovery e v.Range end - CheckBinding cenv env true bind |> ignore + CheckBinding cenv { env with returnScope = 1 } true PermitByRefExpr.Yes bind |> ignore let CheckModuleBindings cenv env binds = binds |> List.iter (CheckModuleBinding cenv env) @@ -2158,7 +2217,8 @@ let CheckTopImpl (g,amap,reportErrors,infoReader,internalsVisibleToPaths,viewCcu argVals = ValMap.Empty boundTypars= TyparMap.Empty reflect=false - external=false } + external=false + returnScope = 0 } CheckModuleExpr cenv env mexpr CheckAttribs cenv env extraAttribs diff --git a/src/fsharp/TastOps.fs b/src/fsharp/TastOps.fs index e78559eadd..db888dd8f9 100644 --- a/src/fsharp/TastOps.fs +++ b/src/fsharp/TastOps.fs @@ -5864,7 +5864,9 @@ let rec mkExprAddrOfExprAux g mustTakeAddress useReadonlyForGenericArrayAddress if isStructTy g ty then match mut with | NeverMutates -> () - | AddressOfOp -> () // we get an inref + | AddressOfOp -> + // we get an inref + errorR(Error(FSComp.SR.tastCantTakeAddressOfExpression(), m)) | DefinitelyMutates -> // Give a nice error message for mutating something we can't take the address of errorR(Error(FSComp.SR.tastInvalidMutationOfConstant(), m)) diff --git a/src/fsharp/TypeChecker.fs b/src/fsharp/TypeChecker.fs index 6be4d71341..99af25b15f 100755 --- a/src/fsharp/TypeChecker.fs +++ b/src/fsharp/TypeChecker.fs @@ -9790,9 +9790,11 @@ and TcMethodApplication if isByrefTy g calledArgTy && isRefCellTy g callerArgTy then None, Expr.Op(TOp.RefAddrGet false, [destRefCellTy g callerArgTy], [callerArgExpr], m) +#if IMPLICIT_ADDRESS_OF elif isInByrefTy g calledArgTy && not (isByrefTy cenv.g callerArgTy) then let wrap, callerArgExprAddress, _readonly, _writeonly = mkExprAddrOfExpr g true false NeverMutates callerArgExpr None m Some wrap, callerArgExprAddress +#endif elif isDelegateTy cenv.g calledArgTy && isFunTy cenv.g callerArgTy then None, CoerceFromFSharpFuncToDelegate cenv.g cenv.amap cenv.infoReader ad callerArgTy m callerArgExpr calledArgTy diff --git a/src/fsharp/xlf/FSComp.txt.cs.xlf b/src/fsharp/xlf/FSComp.txt.cs.xlf index 50fa54a350..d86b89f176 100644 --- a/src/fsharp/xlf/FSComp.txt.cs.xlf +++ b/src/fsharp/xlf/FSComp.txt.cs.xlf @@ -7057,6 +7057,11 @@ Hodnota Span nebo IsByRefLike vrácená z výrazu nejde v tomto bodě použít. Je tím zajištěno, aby adresa lokální hodnoty neunikla ze svého rozsahu. + + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.de.xlf b/src/fsharp/xlf/FSComp.txt.de.xlf index 5a6b0a3def..b77b2924ff 100644 --- a/src/fsharp/xlf/FSComp.txt.de.xlf +++ b/src/fsharp/xlf/FSComp.txt.de.xlf @@ -7057,6 +7057,11 @@ Ein vom Ausdruck zurückgegebener Span- oder IsByRefLike-Wert kann zu diesem Zeitpunkt nicht verwendet werden. Hierdurch wird sichergestellt, dass die Adresse des lokalen Werts den zugehörigen Bereich nicht verlässt. + + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.en.xlf b/src/fsharp/xlf/FSComp.txt.en.xlf index 65496ff1e9..3d980b3618 100644 --- a/src/fsharp/xlf/FSComp.txt.en.xlf +++ b/src/fsharp/xlf/FSComp.txt.en.xlf @@ -7057,6 +7057,11 @@ A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.es.xlf b/src/fsharp/xlf/FSComp.txt.es.xlf index 13a5f9fd0f..e57dc1ec93 100644 --- a/src/fsharp/xlf/FSComp.txt.es.xlf +++ b/src/fsharp/xlf/FSComp.txt.es.xlf @@ -7057,6 +7057,11 @@ En este punto, no se puede usar un valor Span o IsByRefLike devuelto por la expresión. Esto es para asegurar que la dirección del valor local no escape de su ámbito. + + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.fr.xlf b/src/fsharp/xlf/FSComp.txt.fr.xlf index 2e0c818455..65707d9801 100644 --- a/src/fsharp/xlf/FSComp.txt.fr.xlf +++ b/src/fsharp/xlf/FSComp.txt.fr.xlf @@ -7057,6 +7057,11 @@ Impossible d’utiliser une valeur Span ou IsByRefLike retournée par l'expression à ce stade. Cela permet d'éviter que l'adresse de la valeur locale ne sorte de sa portée. + + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.it.xlf b/src/fsharp/xlf/FSComp.txt.it.xlf index 49f6b07170..42ed6fe71a 100644 --- a/src/fsharp/xlf/FSComp.txt.it.xlf +++ b/src/fsharp/xlf/FSComp.txt.it.xlf @@ -7057,6 +7057,11 @@ In questo punto non è possibile usare un valore Span o IsByRefLike restituito dall'espressione. Questo serve ad assicurare che l'indirizzo del valore locale non ignori il relativo ambito. + + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.ja.xlf b/src/fsharp/xlf/FSComp.txt.ja.xlf index 843ec0e8df..b5fcee295b 100644 --- a/src/fsharp/xlf/FSComp.txt.ja.xlf +++ b/src/fsharp/xlf/FSComp.txt.ja.xlf @@ -7057,6 +7057,11 @@ 現時点で、式から返される Span または IsByRefLike 値は使用できません。これは、ローカル値のアドレスがスコープを回避しないようにするためです。 + + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.ko.xlf b/src/fsharp/xlf/FSComp.txt.ko.xlf index 98da207f58..f052e23210 100644 --- a/src/fsharp/xlf/FSComp.txt.ko.xlf +++ b/src/fsharp/xlf/FSComp.txt.ko.xlf @@ -7057,6 +7057,11 @@ 지금은 식에서 반환된 Span 또는 IsByRefLike 값을 사용할 수 없습니다. 로컬 값의 주소가 범위를 벗어나지 않도록 하기 위한 것입니다. + + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.pl.xlf b/src/fsharp/xlf/FSComp.txt.pl.xlf index 425d65f5a1..47846ad6a0 100644 --- a/src/fsharp/xlf/FSComp.txt.pl.xlf +++ b/src/fsharp/xlf/FSComp.txt.pl.xlf @@ -7057,6 +7057,11 @@ W tym miejscu nie można użyć wartości Span lub IsByRefLike zwróconej z wyrażenia. Ma to na celu uniemożliwienie adresowi wartości lokalnej wykroczenia poza zakres. + + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf index 22e5a394c5..45ba078c79 100644 --- a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf +++ b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf @@ -7057,6 +7057,11 @@ O valor Span ou IsByRefLike retornado da expressão não pode ser utilizado neste ponto. Isso tem como objetivo garantir que o endereço do valor local não escape de seu escopo. + + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.ru.xlf b/src/fsharp/xlf/FSComp.txt.ru.xlf index c1932c0d8c..f030129d31 100644 --- a/src/fsharp/xlf/FSComp.txt.ru.xlf +++ b/src/fsharp/xlf/FSComp.txt.ru.xlf @@ -7057,6 +7057,11 @@ На этом этапе невозможно использовать значение Span или IsByRefLike, возвращаемое выражением. В этом случае гарантируется, что адрес локального значения не обходит свою область. + + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.tr.xlf b/src/fsharp/xlf/FSComp.txt.tr.xlf index 3cc7ff0ba7..0dd1d5677d 100644 --- a/src/fsharp/xlf/FSComp.txt.tr.xlf +++ b/src/fsharp/xlf/FSComp.txt.tr.xlf @@ -7057,6 +7057,11 @@ Bu noktada ifadeden döndürülen bir Span veya IsByRefLike değeri kullanılamaz. Bunun amacı, yerel değerin adresinin kapsamı dışına kaçmasını engellemektir. + + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf index 1cd8b170e5..940577a783 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf @@ -7057,6 +7057,11 @@ 此时无法使用从表达式返回的 Span 或 IsByRefLike 值。这是为了确保本地值的地址不超出其范围。 + + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf index c116661000..2d8636ea59 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf @@ -7057,6 +7057,11 @@ 此時不可使用運算式傳回值的 Span 或 IsByRefLike。如此可確保本機值的位址不會逸出其範圍。 + + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + + \ No newline at end of file diff --git a/tests/fsharp/core/byrefs/test.bsl b/tests/fsharp/core/byrefs/test.bsl index 9b9fd3f6d5..b1602e42b2 100644 --- a/tests/fsharp/core/byrefs/test.bsl +++ b/tests/fsharp/core/byrefs/test.bsl @@ -42,3 +42,14 @@ The type 'ByRefKinds.Out' does not match the type 'ByRefKinds.In' test.fsx(66,34,66,47): typecheck error FS1204: This construct is for use in the FSharp.Core library and should not be used directly test.fsx(66,34,66,47): typecheck error FS1204: This construct is for use in the FSharp.Core library and should not be used directly + +test.fsx(71,21,71,23): typecheck error FS3238: Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + +test.fsx(72,21,72,23): typecheck error FS3238: Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + +test.fsx(78,21,78,37): typecheck error FS3238: Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + +test.fsx(85,22,85,23): typecheck error FS0001: This expression was expected to have type + 'inref' +but here has type + 'System.DateTime' diff --git a/tests/fsharp/core/byrefs/test.fsx b/tests/fsharp/core/byrefs/test.fsx index 2d5e150e80..e2a85f718f 100644 --- a/tests/fsharp/core/byrefs/test.fsx +++ b/tests/fsharp/core/byrefs/test.fsx @@ -48,8 +48,8 @@ module ByrefNegativeTests = module InRefToOutRefClassMethod = type C() = - static member f1 (x: outref<'T>) = 1 // not allowed - let f2 (x: inref<'T>) = C.f1 &x + static member f1 (x: outref<'T>) = 1 // not allowed (not yet) + let f2 (x: inref<'T>) = C.f1 &x // not allowed module InRefToByRefClassMethod2 = type C() = @@ -58,12 +58,33 @@ module ByrefNegativeTests = module InRefToOutRefClassMethod2 = type C() = - static member f1 (x: outref<'T>) = 1 // not allowed - let f2 (x: inref<'T>) = C.f1(&x) + static member f1 (x: outref<'T>) = 1 // not allowed (not yet) + let f2 (x: inref<'T>) = C.f1(&x) // not allowed module UseOfLibraryOnly = type C() = - static member f1 (x: byref<'T, 'U>) = 1 + static member f1 (x: byref<'T, 'U>) = 1 + + module CantTakeAddress = + + let test1 () = + let x = &1 // not allowed + let y = &2 // not allowed + x + y + + let test2_helper (x: byref) = x + let test2 () = + let mutable x = 1 + let y = &test2_helper &x // not allowed + () + + module InRefParam_DateTime = + type C() = + static member M(x: inref) = x + let w = System.DateTime.Now + let v = C.M(w) // not allowed + check "cweweoiwe51btw" v w + #endif // Test a simple ref argument @@ -322,7 +343,7 @@ module InRefParamOverload_ImplicitAddressOfAtCallSite2 = check "cweweoiwe51btw2" v2 (res.AddDays(1.0)) Test() - +#if IMPLICIT_ADDRESS_OF module InRefParam_DateTime = type C() = static member M(x: inref) = x @@ -356,6 +377,7 @@ module InRefParam_DateTime_ImplicitAddressOfAtCallSite4 = let w = [| date |] let v = C.M(w.[0]) check "lmvjvwo1" v date +#endif module InRefParam_Generic_ExplicitAddressOfAttCallSite1 = type C() = diff --git a/tests/fsharp/core/byrefs/test2.bsl b/tests/fsharp/core/byrefs/test2.bsl new file mode 100644 index 0000000000..232cc82edb --- /dev/null +++ b/tests/fsharp/core/byrefs/test2.bsl @@ -0,0 +1,26 @@ + +test2.fsx(29,18,29,19): typecheck error FS3209: The address of the variable 'y' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(36,18,36,19): typecheck error FS3209: The address of the variable 'z' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(45,14,45,15): typecheck error FS3209: The address of the variable 'x' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(49,14,49,15): typecheck error FS3209: The address of the variable 'y' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(56,14,56,15): typecheck error FS3209: The address of the variable 'x' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(59,14,59,15): typecheck error FS3209: The address of the variable 'y' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(68,18,68,19): typecheck error FS3209: The address of the variable 'z' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(69,10,69,11): typecheck error FS3209: The address of the variable 'y' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(79,14,79,29): typecheck error FS3228: The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(87,14,87,29): typecheck error FS3228: The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(93,28,93,29): typecheck error FS0421: The address of the variable 'x' cannot be used at this point + +test2.fsx(93,17,93,29): typecheck error FS0425: The type of a first-class function cannot contain byrefs + +test2.fsx(93,17,93,29): typecheck error FS0425: The type of a first-class function cannot contain byrefs diff --git a/tests/fsharp/core/byrefs/test2.fsx b/tests/fsharp/core/byrefs/test2.fsx new file mode 100644 index 0000000000..54bbe2b082 --- /dev/null +++ b/tests/fsharp/core/byrefs/test2.fsx @@ -0,0 +1,145 @@ +#if TESTS_AS_APP +module Core_byrefs +#endif + +let failures = ref false +let report_failure (s) = + stderr.WriteLine ("NO: " + s); failures := true +let test s b = if b then () else report_failure(s) + +(* TEST SUITE FOR Int32 *) + +let out r (s:string) = r := !r @ [s] + +let check s actual expected = + if actual = expected then printfn "%s: OK" s + else report_failure (sprintf "%s: FAILED, expected %A, got %A" s expected actual) + +let check2 s expected actual = check s actual expected + +// POST INFERENCE CHECKS +#if NEGATIVE +module NegativeTests = + + let test1 doIt = + let mutable x = 42 + let r = + if doIt then + let mutable y = 1 + &y // not allowed + else + &x + + let c = + if doIt then + let mutable z = 2 + &z // not allowed + else + &x + + x + r + c + + let test2 () = + let x = + let mutable x = 1 + &x // not allowed + + let y = + let mutable y = 2 + &y // not allowed + + x + y + + let test3 doIt = + let mutable x = 1 + if doIt then + &x // not allowed + else + let mutable y = 1 + &y // not allowed + + let test4 doIt = + let mutable x = 1 + let y = + if doIt then + &x + else + let mutable z = 1 + &z // not allowed + &y // not allowed + + type Coolio() = + + static member Cool(x: inref) = &x + + let test5 () = + + let y = + let x = 1 + &Coolio.Cool(&x) // not allowed + + () + + let test6 () = + + let y = + let mutable x = 1 + &Coolio.Cool(&x) // not allowed + + () + + let test7 () = + let mutable x = 1 + let f = fun () -> &x // not allowed + + () +#endif + +module Tests = + + type ByRefInterface = + + abstract Test : byref * byref -> byref + + type Test() = + + member __.Beef() = + let mutable a = Unchecked.defaultof + let obj = { new ByRefInterface with + + member __.Test(x,y) = + let mutable x = 1 + let obj2 = + { new ByRefInterface with + + member __.Test(_x,y) = &x } // is allowed + a <- obj2 + &y + } + let mutable x = 500 + let mutable y = 500 + obj.Test(&x, &y) |> ignore + a + + let test1 () = + let x = 1 + let f = fun () -> + let y = &x // is allowed + () + + let g = fun () -> + let y = &x // is allowed + () + () + + type Beef = delegate of unit-> byref + let test2 () = + let mutable x = 1 + let f = Beef(fun () -> &x) // is allowed + () + +let aa = + if !failures then (stdout.WriteLine "Test Failed"; exit 1) + else (stdout.WriteLine "Test Passed"; + System.IO.File.WriteAllText("test2.ok","ok"); + exit 0) \ No newline at end of file diff --git a/tests/fsharp/core/span/test.fsx b/tests/fsharp/core/span/test.fsx index 142847ea3f..81ac6b3c7a 100644 --- a/tests/fsharp/core/span/test.fsx +++ b/tests/fsharp/core/span/test.fsx @@ -105,16 +105,16 @@ namespace Tests let SafeSum6(bytes: ReadOnlySpan) = let mutable sum = 0 for i in 0 .. bytes.Length - 1 do - let byteAddr = &bytes.[i] - sum <- sum + int byteAddr + let byte = bytes.[i] + sum <- sum + int byte sum let SafeSum7(bytes: ReadOnlyMemory) = let bytes = bytes.Span let mutable sum = 0 for i in 0 .. bytes.Length - 1 do - let byteAddr = &bytes.[i] - sum <- sum + int byteAddr + let byte = bytes.[i] + sum <- sum + int byte sum let SafeSum8(bytes: ReadOnlyMemory) = diff --git a/tests/fsharp/core/span/test2.bsl b/tests/fsharp/core/span/test2.bsl index bac72ffc78..8cec28adac 100644 --- a/tests/fsharp/core/span/test2.bsl +++ b/tests/fsharp/core/span/test2.bsl @@ -50,3 +50,5 @@ test2.fsx(167,14,167,71): typecheck error FS3228: The address of a value returne test2.fsx(191,43,191,44): typecheck error FS3209: The address of the variable 'x' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. test2.fsx(195,14,195,15): typecheck error FS3209: The address of the variable 'y' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(199,13,199,19): typecheck error FS3230: This value can't be assigned because the target 'x' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. diff --git a/tests/fsharp/core/span/test2.fsx b/tests/fsharp/core/span/test2.fsx index aa56f5cd30..b867c5a0d7 100644 --- a/tests/fsharp/core/span/test2.fsx +++ b/tests/fsharp/core/span/test2.fsx @@ -194,6 +194,10 @@ namespace Tests let y = &x &y + let should_not_work35 (x: byref>) = + let mutable y = Span.Empty + x <- y + #endif let should_work1 () = @@ -321,4 +325,18 @@ namespace Tests let should_work28 (s: Span) = let y = &s.[0] - &y \ No newline at end of file + &y + + let should_work29_helper (x: Span) (y: byref) = &y + + let should_work29 () = + let yopac = + let mutable s = Span.Empty + &should_work29_helper s &beef // this looks like it's out of scope, but this is coming from a stack referring span-like type. + () + + let should_work30 () = + let yopac = + let mutable s = Span.Empty + &s.[0] // this looks like it's out of scope, but this is coming from a stack referring span-like type. + () \ No newline at end of file diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index 411870900b..dae27d838e 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -205,6 +205,18 @@ module CoreTests = testOkFile.CheckExists() end + begin + use testOkFile = fileguard cfg "test2.ok" + + fsc cfg "%s -o:test2.exe -g" cfg.fsc_flags ["test2.fsx"] + + singleNegTest cfg "test2" + + exec cfg ("." ++ "test2.exe") "" + + testOkFile.CheckExists() + end + [] let span () = diff --git a/tests/fsharp/typecheck/sigs/neg106.bsl b/tests/fsharp/typecheck/sigs/neg106.bsl index 152960f5ce..bfa1ff5e6b 100644 --- a/tests/fsharp/typecheck/sigs/neg106.bsl +++ b/tests/fsharp/typecheck/sigs/neg106.bsl @@ -38,6 +38,8 @@ is not compatible with type 'byref<'a>' . +neg106.fs(17,59,17,61): typecheck error FS3238: Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + neg106.fs(17,14,17,68): typecheck error FS0041: No overloads match for method 'CompareExchange'. The available overloads are shown below. neg106.fs(17,14,17,68): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: int, comparand: int) : int'. Type constraint mismatch. The type 'inref' diff --git a/tests/fsharp/typecheck/sigs/neg106.vsbsl b/tests/fsharp/typecheck/sigs/neg106.vsbsl index 152960f5ce..bfa1ff5e6b 100644 --- a/tests/fsharp/typecheck/sigs/neg106.vsbsl +++ b/tests/fsharp/typecheck/sigs/neg106.vsbsl @@ -38,6 +38,8 @@ is not compatible with type 'byref<'a>' . +neg106.fs(17,59,17,61): typecheck error FS3238: Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + neg106.fs(17,14,17,68): typecheck error FS0041: No overloads match for method 'CompareExchange'. The available overloads are shown below. neg106.fs(17,14,17,68): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: int, comparand: int) : int'. Type constraint mismatch. The type 'inref' From 9880cc7bc6705d5db16906c96974653a3c274671 Mon Sep 17 00:00:00 2001 From: Will Smith Date: Mon, 2 Jul 2018 11:38:00 -0700 Subject: [PATCH 071/150] cherry-pick - Ref scopes dev15.8 (#5282) * Enable negative byref tests (#5237) * Checking negative tests for byrefs * Added byref test baseline * Ref scoping (#5240) * Added Limit * Trying to get basic scopes * Basic scope checks * Some more checks * Handling another ref scope case * Using env instead of cenv * Partially scoped * Almost figuring out scoping * Scopes are working * Check returnable * Current tests passing * Removed compiler generated rhs * Minor cleanup * Added scoping tests * Adding tests again * Scoping now determines what is local * Updated tests/baseline for byrefs. Simplified compiler generated check * Trivial change for scope check * Fixed bug with stack referring span-likes returning by-refs in scopes other than the method/function level * Quick fix * Preventing taking address of expression that isn't a let-bound value * Updated baseline * Updated baseline * Added better way to disable address of * Finishing up. Updating baselines * Updating neg106 baseline * Updated baselines again * Removing compiler generated check by fixing GetLimitVal --- .../FSharp.Compiler.Private/FSComp.fs | 4 + .../FSharp.Compiler.Private/FSComp.resx | 3 + src/fsharp/FSComp.txt | 3 +- src/fsharp/MethodCalls.fs | 4 + src/fsharp/PostInferenceChecks.fs | 304 +++++++++++------- src/fsharp/TastOps.fs | 4 +- src/fsharp/TypeChecker.fs | 2 + src/fsharp/xlf/FSComp.txt.cs.xlf | 5 + src/fsharp/xlf/FSComp.txt.de.xlf | 5 + src/fsharp/xlf/FSComp.txt.en.xlf | 5 + src/fsharp/xlf/FSComp.txt.es.xlf | 5 + src/fsharp/xlf/FSComp.txt.fr.xlf | 5 + src/fsharp/xlf/FSComp.txt.it.xlf | 5 + src/fsharp/xlf/FSComp.txt.ja.xlf | 5 + src/fsharp/xlf/FSComp.txt.ko.xlf | 5 + src/fsharp/xlf/FSComp.txt.pl.xlf | 5 + src/fsharp/xlf/FSComp.txt.pt-BR.xlf | 5 + src/fsharp/xlf/FSComp.txt.ru.xlf | 5 + src/fsharp/xlf/FSComp.txt.tr.xlf | 5 + src/fsharp/xlf/FSComp.txt.zh-Hans.xlf | 5 + src/fsharp/xlf/FSComp.txt.zh-Hant.xlf | 5 + tests/fsharp/core/byrefs/test.bsl | 55 ++++ tests/fsharp/core/byrefs/test.fsx | 134 ++++---- tests/fsharp/core/byrefs/test2.bsl | 26 ++ tests/fsharp/core/byrefs/test2.fsx | 145 +++++++++ tests/fsharp/core/span/test.fsx | 8 +- tests/fsharp/core/span/test2.bsl | 2 + tests/fsharp/core/span/test2.fsx | 20 +- tests/fsharp/tests.fs | 14 + tests/fsharp/typecheck/sigs/neg106.bsl | 2 + tests/fsharp/typecheck/sigs/neg106.vsbsl | 2 + 31 files changed, 610 insertions(+), 192 deletions(-) create mode 100644 tests/fsharp/core/byrefs/test.bsl create mode 100644 tests/fsharp/core/byrefs/test2.bsl create mode 100644 tests/fsharp/core/byrefs/test2.fsx diff --git a/src/buildfromsource/FSharp.Compiler.Private/FSComp.fs b/src/buildfromsource/FSharp.Compiler.Private/FSComp.fs index f2b06f7598..7ed2ec0d0a 100644 --- a/src/buildfromsource/FSharp.Compiler.Private/FSComp.fs +++ b/src/buildfromsource/FSharp.Compiler.Private/FSComp.fs @@ -4351,6 +4351,9 @@ type internal SR private() = /// A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. /// (Originally from ..\FSComp.txt:1441) static member chkNoSpanLikeValueFromExpression() = (3237, GetStringFunc("chkNoSpanLikeValueFromExpression",",,,") ) + /// Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + /// (Originally from ..\FSComp.txt:1442) + static member tastCantTakeAddressOfExpression() = (3238, GetStringFunc("tastCantTakeAddressOfExpression",",,,") ) /// Call this method once to validate that all known resources are valid; throws if not static member RunStartupValidation() = @@ -5766,4 +5769,5 @@ type internal SR private() = ignore(GetString("chkNoByrefLikeFunctionCall")) ignore(GetString("chkNoSpanLikeVariable")) ignore(GetString("chkNoSpanLikeValueFromExpression")) + ignore(GetString("tastCantTakeAddressOfExpression")) () diff --git a/src/buildfromsource/FSharp.Compiler.Private/FSComp.resx b/src/buildfromsource/FSharp.Compiler.Private/FSComp.resx index 93d7f69b3b..9e1820ee5c 100644 --- a/src/buildfromsource/FSharp.Compiler.Private/FSComp.resx +++ b/src/buildfromsource/FSharp.Compiler.Private/FSComp.resx @@ -4354,4 +4354,7 @@ A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + \ No newline at end of file diff --git a/src/fsharp/FSComp.txt b/src/fsharp/FSComp.txt index b3a60ed307..3b058f3a8f 100644 --- a/src/fsharp/FSComp.txt +++ b/src/fsharp/FSComp.txt @@ -1438,4 +1438,5 @@ notAFunctionButMaybeDeclaration,"This value is not a function and cannot be appl 3234,chkStructsMayNotReturnAddressesOfContents,"Struct members cannot return the address of fields of the struct by reference" 3235,chkNoByrefLikeFunctionCall,"The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope." 3236,chkNoSpanLikeVariable,"The Span or IsByRefLike variable '%s' cannot be used at this point. This is to ensure the address of the local value does not escape its scope." -3237,chkNoSpanLikeValueFromExpression,"A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope." \ No newline at end of file +3237,chkNoSpanLikeValueFromExpression,"A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope." +3238,tastCantTakeAddressOfExpression,"Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address." \ No newline at end of file diff --git a/src/fsharp/MethodCalls.fs b/src/fsharp/MethodCalls.fs index ac8709abdf..2aa8b964aa 100644 --- a/src/fsharp/MethodCalls.fs +++ b/src/fsharp/MethodCalls.fs @@ -134,10 +134,14 @@ let AdjustCalledArgType (infoReader:InfoReader) isConstraint (calledArg: CalledA // If the called method argument is an inref type, then the caller may provide a byref or value if isInByrefTy g calledArgTy then +#if IMPLICIT_ADDRESS_OF if isByrefTy g callerArgTy then calledArgTy else destByrefTy g calledArgTy +#else + calledArgTy +#endif // If the called method argument is a (non inref) byref type, then the caller may provide a byref or ref. elif isByrefTy g calledArgTy then diff --git a/src/fsharp/PostInferenceChecks.fs b/src/fsharp/PostInferenceChecks.fs index 913ccde9ac..47c958aaa4 100644 --- a/src/fsharp/PostInferenceChecks.fs +++ b/src/fsharp/PostInferenceChecks.fs @@ -103,7 +103,10 @@ type env = reflect : bool /// Are we in an extern declaration? - external : bool } + external : bool + + /// Current return scope of the expr. + returnScope : int } let BindTypar env (tp:Typar) = { env with @@ -128,17 +131,72 @@ let BindArgVals env (vs: Val list) = /// Limit flags represent a type(s) returned from checking an expression(s) that is interesting to impose rules on. [] type LimitFlags = - | None = 0b000000 - | LocalByRef = 0b000001 - | LocalByRefOfSpanLike = 0b000011 - | LocalByRefOfStackReferringSpanLike = 0b000101 - | SpanLike = 0b001000 - | StackReferringSpanLike = 0b010000 - | ByRefOfSpanLike = 0b100000 + | None = 0b00000 + | ByRef = 0b00001 + | ByRefOfSpanLike = 0b00011 + | ByRefOfStackReferringSpanLike = 0b00101 + | SpanLike = 0b01000 + | StackReferringSpanLike = 0b10000 + +[] +type Limit = + { + scope: int + flags: LimitFlags + } + + member this.IsLocal = this.scope >= 1 + +/// Check if the limit has the target limit. +let inline HasLimitFlag targetLimit (limit: Limit) = + limit.flags &&& targetLimit = targetLimit + +let NoLimit = { scope = 0; flags = LimitFlags.None } + +// Combining two limits will result in both limit flags merged. +// If none of the limits are limited by a by-ref or a stack referring span-like +// the scope will be 0. +let CombineTwoLimits limit1 limit2 = + let isByRef1 = HasLimitFlag LimitFlags.ByRef limit1 + let isByRef2 = HasLimitFlag LimitFlags.ByRef limit2 + let isStackSpan1 = HasLimitFlag LimitFlags.StackReferringSpanLike limit1 + let isStackSpan2 = HasLimitFlag LimitFlags.StackReferringSpanLike limit2 + let isLimited1 = isByRef1 || isStackSpan1 + let isLimited2 = isByRef2 || isStackSpan2 + + // A limit that has a stack referring span-like but not a by-ref, + // we force the scope to 1. This is to handle call sites + // that return a by-ref and have stack referring span-likes as arguments. + // This is to ensure we can only prevent out of scope at the method level rather than visibility. + let limit1 = + if isStackSpan1 && not isByRef1 then + { limit1 with scope = 1 } + else + limit1 + + let limit2 = + if isStackSpan2 && not isByRef2 then + { limit2 with scope = 1 } + else + limit2 + + match isLimited1, isLimited2 with + | false, false -> + { scope = 0; flags = limit1.flags ||| limit2.flags } + | true, true -> + { scope = Math.Max(limit1.scope, limit2.scope); flags = limit1.flags ||| limit2.flags } + | true, false -> + { limit1 with flags = limit1.flags ||| limit2.flags } + | false, true -> + { limit2 with flags = limit1.flags ||| limit2.flags } + +let CombineLimits limits = + (NoLimit, limits) + ||> List.fold CombineTwoLimits type cenv = { boundVals: Dictionary // really a hash set - limitVals: Dictionary + limitVals: Dictionary mutable potentialUnboundUsesOfVals: StampMap g: TcGlobals amap: Import.ImportMap @@ -162,63 +220,59 @@ let IsValArgument env (v: Val) = let IsValLocal env (v: Val) = v.ValReprInfo.IsNone && not (IsValArgument env v) -/// Check if the limit has the target limit. -let inline HasLimitFlag targetLimit limit = - limit &&& targetLimit = targetLimit - /// Get the limit of the val. let GetLimitVal cenv env m (v: Val) = let limit = match cenv.limitVals.TryGetValue(v.Stamp) with | true, limit -> limit - | _ -> LimitFlags.None + | _ -> + if IsValLocal env v then + { scope = 1; flags = LimitFlags.None } + else + NoLimit if isSpanLikeTy cenv.g m v.Type then // The value is a limited Span or might have become one through mutation - let isLocal = IsValLocal env v - let isMutableLocal = isLocal && v.IsMutable && cenv.isInternalTestSpanStackReferring - let isLimitedLocal = isLocal && HasLimitFlag LimitFlags.StackReferringSpanLike limit - if isMutableLocal || isLimitedLocal then - LimitFlags.StackReferringSpanLike + let isMutable = v.IsMutable && cenv.isInternalTestSpanStackReferring + let isLimited = HasLimitFlag LimitFlags.StackReferringSpanLike limit + + if isMutable || isLimited then + { limit with flags = LimitFlags.StackReferringSpanLike } else - LimitFlags.SpanLike + { limit with flags = LimitFlags.SpanLike } elif isByrefTy cenv.g v.Type then - let isLocal = IsValLocal env v - let isLimitedLocal = isLocal && HasLimitFlag LimitFlags.LocalByRef limit let isByRefOfSpanLike = isSpanLikeTy cenv.g m (destByrefTy cenv.g v.Type) - match isLimitedLocal, isByRefOfSpanLike with - | true, false -> LimitFlags.LocalByRef - | true, true -> - if HasLimitFlag LimitFlags.LocalByRefOfStackReferringSpanLike limit then - LimitFlags.LocalByRefOfStackReferringSpanLike + if isByRefOfSpanLike then + if HasLimitFlag LimitFlags.ByRefOfStackReferringSpanLike limit then + { limit with flags = LimitFlags.ByRefOfStackReferringSpanLike } else - LimitFlags.LocalByRefOfSpanLike - | false, true -> LimitFlags.ByRefOfSpanLike - | _ -> LimitFlags.None + { limit with flags = LimitFlags.ByRefOfSpanLike } + else + { limit with flags = LimitFlags.ByRef } else - LimitFlags.None + { limit with flags = LimitFlags.None } /// Get the limit of the val by reference. let GetLimitValByRef cenv env m v = let limit = GetLimitVal cenv env m v - if HasLimitFlag LimitFlags.StackReferringSpanLike limit then - LimitFlags.LocalByRefOfStackReferringSpanLike + let scope = + // Getting the address of an argument will always be a scope of 1. + if IsValArgument env v then 1 + else limit.scope - elif IsValLocal env v || IsValArgument env v then - if HasLimitFlag LimitFlags.SpanLike limit then - LimitFlags.LocalByRefOfSpanLike + let flags = + if HasLimitFlag LimitFlags.StackReferringSpanLike limit then + LimitFlags.ByRefOfStackReferringSpanLike + elif HasLimitFlag LimitFlags.SpanLike limit then + LimitFlags.ByRefOfSpanLike else - LimitFlags.LocalByRef + LimitFlags.ByRef - elif HasLimitFlag LimitFlags.SpanLike limit then - LimitFlags.ByRefOfSpanLike - - else - LimitFlags.None + { scope = scope; flags = flags } let LimitVal cenv (v:Val) limit = cenv.limitVals.[v.Stamp] <- limit @@ -624,7 +678,7 @@ and CheckValUse (cenv: cenv) (env: env) (vref: ValRef, vFlags, m) (context: Perm // &y let isReturnExprBuiltUsingStackReferringByRefLike = context.PermitOnlyReturnable && - (HasLimitFlag LimitFlags.LocalByRef limit || + ((HasLimitFlag LimitFlags.ByRef limit && limit.scope >= env.returnScope) || HasLimitFlag LimitFlags.StackReferringSpanLike limit) if isReturnExprBuiltUsingStackReferringByRefLike then @@ -689,24 +743,24 @@ and CheckForOverAppliedExceptionRaisingPrimitive (cenv:cenv) expr = | _ -> () | _ -> () -and CheckCallLimitArgs cenv m (returnTy: TType) limitArgs (context: PermitByRefExpr) = +and CheckCallLimitArgs cenv env m returnTy limitArgs (context: PermitByRefExpr) = let isReturnByref = isByrefTy cenv.g returnTy let isReturnSpanLike = isSpanLikeTy cenv.g m returnTy // If return is a byref, and being used as a return, then a single argument cannot be a local-byref or a stack referring span-like. let isReturnLimitedByRef = isReturnByref && - (HasLimitFlag LimitFlags.LocalByRef limitArgs || + (HasLimitFlag LimitFlags.ByRef limitArgs || HasLimitFlag LimitFlags.StackReferringSpanLike limitArgs) // If return is a byref, and being used as a return, then a single argument cannot be a stack referring span-like or a local-byref of a stack referring span-like. let isReturnLimitedSpanLike = isReturnSpanLike && (HasLimitFlag LimitFlags.StackReferringSpanLike limitArgs || - HasLimitFlag LimitFlags.LocalByRefOfStackReferringSpanLike limitArgs) + HasLimitFlag LimitFlags.ByRefOfStackReferringSpanLike limitArgs) if cenv.reportErrors then - if context.PermitOnlyReturnable && (isReturnLimitedByRef || isReturnLimitedSpanLike) then + if context.PermitOnlyReturnable && ((isReturnLimitedByRef && limitArgs.scope >= env.returnScope) || isReturnLimitedSpanLike) then if isReturnLimitedSpanLike then errorR(Error(FSComp.SR.chkNoSpanLikeValueFromExpression(), m)) else @@ -717,7 +771,7 @@ and CheckCallLimitArgs cenv m (returnTy: TType) limitArgs (context: PermitByRefE let isCallLimited = HasLimitFlag LimitFlags.ByRefOfSpanLike limitArgs && (HasLimitFlag LimitFlags.StackReferringSpanLike limitArgs || - HasLimitFlag LimitFlags.LocalByRefOfStackReferringSpanLike limitArgs) + HasLimitFlag LimitFlags.ByRefOfStackReferringSpanLike limitArgs) if isCallLimited then errorR(Error(FSComp.SR.chkNoByrefLikeFunctionCall(), m)) @@ -726,33 +780,33 @@ and CheckCallLimitArgs cenv m (returnTy: TType) limitArgs (context: PermitByRefE if isSpanLikeTy cenv.g m (destByrefTy cenv.g returnTy) then let isStackReferring = HasLimitFlag LimitFlags.StackReferringSpanLike limitArgs || - HasLimitFlag LimitFlags.LocalByRefOfStackReferringSpanLike limitArgs + HasLimitFlag LimitFlags.ByRefOfStackReferringSpanLike limitArgs if isStackReferring then - LimitFlags.LocalByRefOfStackReferringSpanLike + { limitArgs with flags = LimitFlags.ByRefOfStackReferringSpanLike } else - LimitFlags.LocalByRefOfSpanLike + { limitArgs with flags = LimitFlags.ByRefOfSpanLike } else - LimitFlags.LocalByRef + { limitArgs with flags = LimitFlags.ByRef } elif isReturnLimitedSpanLike then - LimitFlags.StackReferringSpanLike + { scope = 1; flags = LimitFlags.StackReferringSpanLike } elif isReturnByref then if isSpanLikeTy cenv.g m (destByrefTy cenv.g returnTy) then - LimitFlags.ByRefOfSpanLike + { limitArgs with flags = LimitFlags.ByRefOfSpanLike } else - LimitFlags.None + { limitArgs with flags = LimitFlags.ByRef } elif isReturnSpanLike then - LimitFlags.SpanLike + { scope = 1; flags = LimitFlags.SpanLike } else - LimitFlags.None + { scope = 1; flags = LimitFlags.None } /// Check call arguments, including the return argument. and CheckCall cenv env m returnTy args contexts context = let limitArgs = CheckExprs cenv env args contexts - CheckCallLimitArgs cenv m returnTy limitArgs context + CheckCallLimitArgs cenv env m returnTy limitArgs context /// Check call arguments, including the return argument. The receiver argument is handled differently. and CheckCallWithReceiver cenv env m returnTy args contexts context = @@ -769,16 +823,17 @@ and CheckCallWithReceiver cenv env m returnTy args contexts context = let limitArgs = let limitArgs = CheckExprs cenv env args contexts // We do not include the receiver's limit in the limit args unless the receiver is a stack referring span-like. - if HasLimitFlag LimitFlags.StackReferringSpanLike receiverLimit || HasLimitFlag LimitFlags.LocalByRefOfStackReferringSpanLike receiverLimit then - limitArgs ||| receiverLimit + if HasLimitFlag LimitFlags.ByRefOfStackReferringSpanLike receiverLimit then + // Scope is 1 to ensure any by-refs returned can only be prevented for out of scope of the function/method, not visibility. + CombineTwoLimits limitArgs { receiverLimit with scope = 1 } else limitArgs - CheckCallLimitArgs cenv m returnTy limitArgs context + CheckCallLimitArgs cenv env m returnTy limitArgs context /// Check call arguments, including the return argument. Permits returnable byref. and CheckCallPermitReturnableByRef cenv env m returnTy args = let limitArgs = CheckExprsPermitByRefLike cenv env args - CheckCallLimitArgs cenv m returnTy limitArgs PermitByRefExpr.YesReturnable + CheckCallLimitArgs cenv env m returnTy limitArgs PermitByRefExpr.YesReturnable /// Check call arguments, including the return argument. The receiver argument is handled differently. Permits returnable byref. and CheckCallWithReceiverPermitReturnableByRef cenv env m returnTy args = @@ -787,14 +842,14 @@ and CheckCallWithReceiverPermitReturnableByRef cenv env m returnTy args = /// Check call arguments, including the return argument. Permits byref. and CheckCallPermitByRefLike cenv env m returnTy args = let limitArgs = CheckExprsPermitByRefLike cenv env args - CheckCallLimitArgs cenv m returnTy limitArgs PermitByRefExpr.Yes + CheckCallLimitArgs cenv env m returnTy limitArgs PermitByRefExpr.Yes /// Check call arguments, including the return argument. The receiver argument is handled differently. Permits byref. and CheckCallWithReceiverPermitByRefLike cenv env m returnTy args = CheckCallWithReceiver cenv env m returnTy args (List.init args.Length (fun _ -> PermitByRefExpr.Yes)) PermitByRefExpr.Yes /// Check an expression, given information about the position of the expression -and CheckExpr (cenv:cenv) (env:env) origExpr (context:PermitByRefExpr) : LimitFlags = +and CheckExpr (cenv:cenv) (env:env) origExpr (context:PermitByRefExpr) : Limit = let g = cenv.g let origExpr = stripExpr origExpr @@ -812,21 +867,25 @@ and CheckExpr (cenv:cenv) (env:env) origExpr (context:PermitByRefExpr) : LimitFl CheckExpr cenv env e2 context // carry context into _;RHS (normal sequencing only) | ThenDoSeq -> CheckExprNoByrefs cenv {env with ctorLimitedZone=false} e2 - LimitFlags.None + NoLimit - | Expr.Let ((TBind(v,_,_) as bind),body,_,_) -> - let limit = CheckBinding cenv env false bind + | Expr.Let ((TBind(v,_bindRhs,_) as bind),body,_,_) -> + let isByRef = isByrefTy cenv.g v.Type - BindVal cenv env v - - if limit <> LimitFlags.None then - LimitVal cenv v limit + let bindingContext = + if isByRef then + PermitByRefExpr.YesReturnable + else + PermitByRefExpr.Yes + let limit = CheckBinding cenv { env with returnScope = env.returnScope + 1 } false bindingContext bind + BindVal cenv env v + LimitVal cenv v { limit with scope = if isByRef then limit.scope else env.returnScope } CheckExpr cenv env body context | Expr.Const (_,m,ty) -> CheckTypePermitAllByrefs cenv env m ty - LimitFlags.None + NoLimit | Expr.Val (vref,vFlags,m) -> CheckValUse cenv env (vref, vFlags, m) context @@ -848,7 +907,7 @@ and CheckExpr (cenv:cenv) (env:env) origExpr (context:PermitByRefExpr) : LimitFl errorRecovery e m CheckTypeNoByrefs cenv env m ty - LimitFlags.None + NoLimit | Expr.Obj (_,ty,basev,superInitCall,overrides,iimpls,m) -> CheckExprNoByrefs cenv env superInitCall @@ -864,7 +923,7 @@ and CheckExpr (cenv:cenv) (env:env) origExpr (context:PermitByRefExpr) : LimitFl |> List.filter (isInterfaceTy g) CheckMultipleInterfaceInstantiations cenv interfaces m - LimitFlags.None + NoLimit // Allow base calls to F# methods | Expr.App((InnerExprPat(ExprValWithPossibleTypeInst(v,vFlags,_,_) as f)),_fty,tyargs,(Expr.Val(baseVal,_,_) :: rest),m) @@ -874,7 +933,7 @@ and CheckExpr (cenv:cenv) (env:env) origExpr (context:PermitByRefExpr) : LimitFl let memberInfo = Option.get v.MemberInfo if memberInfo.MemberFlags.IsDispatchSlot then errorR(Error(FSComp.SR.tcCannotCallAbstractBaseMember(v.DisplayName),m)) - LimitFlags.None + NoLimit else CheckValRef cenv env v m PermitByRefExpr.No CheckValRef cenv env baseVal m PermitByRefExpr.No @@ -911,17 +970,17 @@ and CheckExpr (cenv:cenv) (env:env) origExpr (context:PermitByRefExpr) : LimitFl // Allow 'typeof' calls as a special case, the only accepted use of System.Void! | TypeOfExpr g ty when isVoidTy g ty -> - LimitFlags.None + NoLimit // Allow 'typedefof' calls as a special case, the only accepted use of System.Void! | TypeDefOfExpr g ty when isVoidTy g ty -> - LimitFlags.None + NoLimit // Allow '%expr' in quotations | Expr.App(Expr.Val(vref,_,_),_,tinst,[arg],m) when isSpliceOperator g vref && env.quote -> CheckTypeInstPermitAllByrefs cenv env m tinst // it's the splice operator, a byref instantiation is allowed CheckExprNoByrefs cenv env arg - LimitFlags.None + NoLimit // Check an application | Expr.App(f,_fty,tyargs,argsl,m) -> @@ -943,17 +1002,17 @@ and CheckExpr (cenv:cenv) (env:env) origExpr (context:PermitByRefExpr) : LimitFl | Expr.Lambda(_,_ctorThisValOpt,_baseValOpt,argvs,_,m,rty) -> let topValInfo = ValReprInfo ([],[argvs |> List.map (fun _ -> ValReprInfo.unnamedTopArg1)],ValReprInfo.unnamedRetVal) let ty = mkMultiLambdaTy m argvs rty in - CheckLambdas false None cenv env false topValInfo false expr m ty + CheckLambdas false None cenv env false topValInfo false expr m ty PermitByRefExpr.Yes | Expr.TyLambda(_,tps,_,m,rty) -> let topValInfo = ValReprInfo (ValReprInfo.InferTyparInfo tps,[],ValReprInfo.unnamedRetVal) let ty = mkForallTyIfNeeded tps rty in - CheckLambdas false None cenv env false topValInfo false expr m ty + CheckLambdas false None cenv env false topValInfo false expr m ty PermitByRefExpr.Yes | Expr.TyChoose(tps,e1,_) -> let env = BindTypars g env tps CheckExprNoByrefs cenv env e1 - LimitFlags.None + NoLimit | Expr.Match(_,_,dtree,targets,m,ty) -> CheckTypePermitAllByrefs cenv env m ty // computed byrefs allowed at each branch @@ -964,7 +1023,7 @@ and CheckExpr (cenv:cenv) (env:env) origExpr (context:PermitByRefExpr) : LimitFl BindVals cenv env (valsOfBinds binds) CheckBindings cenv env binds CheckExprNoByrefs cenv env e - LimitFlags.None + NoLimit | Expr.StaticOptimization (constraints,e2,e3,m) -> CheckExprNoByrefs cenv env e2 @@ -975,7 +1034,7 @@ and CheckExpr (cenv:cenv) (env:env) origExpr (context:PermitByRefExpr) : LimitFl CheckTypeNoByrefs cenv env m ty2 | TTyconIsStruct(ty1) -> CheckTypeNoByrefs cenv env m ty1) - LimitFlags.None + NoLimit | Expr.Link _ -> failwith "Unexpected reclink" @@ -1029,7 +1088,7 @@ and CheckExprOp cenv env (op,tyargs,args,m) context expr = let limit1 = CheckExpr cenv env e1 context // result of a try/catch can be a byref if in a position where the overall expression is can be a byref // [(* e2; -- don't check filter body - duplicates logic in 'catch' body *) e3] let limit2 = CheckExpr cenv env e3 context // result of a try/catch can be a byref if in a position where the overall expression is can be a byref - limit1 ||| limit2 + CombineTwoLimits limit1 limit2 | TOp.ILCall (_,_,_,_,_,_,_,methRef,enclTypeArgs,methTypeArgs,tys),_,_ -> CheckTypeInstNoByrefs cenv env m tyargs @@ -1070,7 +1129,7 @@ and CheckExprOp cenv env (op,tyargs,args,m) context expr = | TOp.LValueOp(LAddrOf _,vref),_,_ -> let limit1 = GetLimitValByRef cenv env m vref.Deref let limit2 = CheckExprsNoByRefLike cenv env args - let limit = limit1 ||| limit2 + let limit = CombineTwoLimits limit1 limit2 if cenv.reportErrors then @@ -1079,7 +1138,8 @@ and CheckExprOp cenv env (op,tyargs,args,m) context expr = let returningAddrOfLocal = context.PermitOnlyReturnable && - HasLimitFlag LimitFlags.LocalByRef limit + HasLimitFlag LimitFlags.ByRef limit && + limit.scope >= env.returnScope if returningAddrOfLocal then if vref.IsCompilerGenerated then @@ -1091,15 +1151,15 @@ and CheckExprOp cenv env (op,tyargs,args,m) context expr = | TOp.LValueOp(LByrefSet,vref),_,[arg] -> let limit = GetLimitVal cenv env m vref.Deref - let isVrefLimited = not (HasLimitFlag LimitFlags.LocalByRefOfStackReferringSpanLike limit) + let isVrefLimited = not (HasLimitFlag LimitFlags.ByRefOfStackReferringSpanLike limit) let isArgLimited = HasLimitFlag LimitFlags.StackReferringSpanLike (CheckExprPermitByRefLike cenv env arg) if isVrefLimited && isArgLimited then errorR(Error(FSComp.SR.chkNoWriteToLimitedSpan(vref.DisplayName), m)) - LimitFlags.None + NoLimit | TOp.LValueOp(LByrefGet,vref),_,[] -> let limit = GetLimitVal cenv env m vref.Deref - if HasLimitFlag LimitFlags.LocalByRefOfStackReferringSpanLike limit then + if HasLimitFlag LimitFlags.ByRefOfStackReferringSpanLike limit then if cenv.reportErrors && context.PermitOnlyReturnable then if vref.IsCompilerGenerated then @@ -1107,18 +1167,18 @@ and CheckExprOp cenv env (op,tyargs,args,m) context expr = else errorR(Error(FSComp.SR.chkNoSpanLikeVariable(vref.DisplayName), m)) - LimitFlags.StackReferringSpanLike - elif HasLimitFlag LimitFlags.LocalByRefOfSpanLike limit then - LimitFlags.SpanLike + { scope = 1; flags = LimitFlags.StackReferringSpanLike } + elif HasLimitFlag LimitFlags.ByRefOfSpanLike limit then + { scope = 1; flags = LimitFlags.SpanLike } else - LimitFlags.None + { scope = 1; flags = LimitFlags.None } | TOp.LValueOp(LSet _, vref),_,[arg] -> let isVrefLimited = not (HasLimitFlag LimitFlags.StackReferringSpanLike (GetLimitVal cenv env m vref.Deref)) let isArgLimited = HasLimitFlag LimitFlags.StackReferringSpanLike (CheckExprPermitByRefLike cenv env arg) if isVrefLimited && isArgLimited then errorR(Error(FSComp.SR.chkNoWriteToLimitedSpan(vref.DisplayName), m)) - LimitFlags.None + NoLimit | TOp.TupleFieldGet _,_,[arg1] -> CheckTypeInstNoByrefs cenv env m tyargs @@ -1137,11 +1197,11 @@ and CheckExprOp cenv env (op,tyargs,args,m) context expr = let limit1 = CheckExprPermitByRefLike cenv env arg1 let limit2 = CheckExprPermitByRefLike cenv env arg2 - let isLhsLimited = not (HasLimitFlag LimitFlags.LocalByRefOfStackReferringSpanLike limit1) + let isLhsLimited = not (HasLimitFlag LimitFlags.ByRefOfStackReferringSpanLike limit1) let isRhsLimited = HasLimitFlag LimitFlags.StackReferringSpanLike limit2 if isLhsLimited && isRhsLimited then errorR(Error(FSComp.SR.chkNoWriteToLimitedSpan(rf.FieldName), m)) - LimitFlags.None + NoLimit | TOp.Coerce,[tgty;srcty],[x] -> if TypeRelations.TypeDefinitelySubsumesTypeNoCoercion 0 g cenv.amap m tgty srcty then @@ -1149,11 +1209,11 @@ and CheckExprOp cenv env (op,tyargs,args,m) context expr = else CheckTypeInstNoByrefs cenv env m tyargs CheckExprNoByrefs cenv env x - LimitFlags.None + NoLimit | TOp.Reraise,[_ty1],[] -> CheckTypeInstNoByrefs cenv env m tyargs - LimitFlags.None + NoLimit // Check get of static field | TOp.ValFieldGetAddr (rfref, _readonly),tyargs,[] -> @@ -1162,7 +1222,7 @@ and CheckExprOp cenv env (op,tyargs,args,m) context expr = errorR(Error(FSComp.SR.chkNoAddressStaticFieldAtThisPoint(rfref.FieldName), m)) CheckTypeInstNoByrefs cenv env m tyargs - LimitFlags.None + NoLimit // Check get of instance field | TOp.ValFieldGetAddr (rfref, _readonly),tyargs,[obj] -> @@ -1230,7 +1290,7 @@ and CheckExprOp cenv env (op,tyargs,args,m) context expr = if context.Disallow && cenv.reportErrors && isByrefLikeTy g m (tyOfExpr g expr) then errorR(Error(FSComp.SR.chkNoAddressFieldAtThisPoint(fspec.Name), m)) - LimitFlags.None + NoLimit | [ I_ldflda (fspec) ], [obj] -> if context.Disallow && cenv.reportErrors && isByrefLikeTy g m (tyOfExpr g expr) then @@ -1267,18 +1327,17 @@ and CheckExprOp cenv env (op,tyargs,args,m) context expr = CheckTypeInstNoByrefs cenv env m tyargs CheckExprsNoByRefLike cenv env args -and CheckLambdas isTop (memInfo: ValMemberInfo option) cenv env inlined topValInfo alwaysCheckNoReraise e m ety = +and CheckLambdas isTop (memInfo: ValMemberInfo option) cenv env inlined topValInfo alwaysCheckNoReraise e m ety context = let g = cenv.g // The topValInfo here says we are _guaranteeing_ to compile a function value // as a .NET method with precisely the corresponding argument counts. match e with | Expr.TyChoose(tps,e1,m) -> let env = BindTypars g env tps - CheckLambdas isTop memInfo cenv env inlined topValInfo alwaysCheckNoReraise e1 m ety + CheckLambdas isTop memInfo cenv env inlined topValInfo alwaysCheckNoReraise e1 m ety context | Expr.Lambda (_,_,_,_,_,m,_) | Expr.TyLambda(_,_,_,m,_) -> - let tps,ctorThisValOpt,baseValOpt,vsl,body,bodyty = destTopLambda g cenv.amap topValInfo (e, ety) in let env = BindTypars g env tps let thisAndBase = Option.toList ctorThisValOpt @ Option.toList baseValOpt @@ -1334,7 +1393,7 @@ and CheckLambdas isTop (memInfo: ValMemberInfo option) cenv env inlined topValIn if tp.Constraints |> List.sumBy (function TyparConstraint.CoercesTo(ty,_) when isClassTy g ty -> 1 | _ -> 0) > 1 then errorR(Error(FSComp.SR.chkTyparMultipleClassConstraints(), m)) - LimitFlags.None + NoLimit // This path is for expression bindings that are not actually lambdas | _ -> @@ -1343,46 +1402,46 @@ and CheckLambdas isTop (memInfo: ValMemberInfo option) cenv env inlined topValIn let limit = if not inlined && (isByrefLikeTy g m ety || isNativePtrTy g ety) then // allow byref to occur as RHS of byref binding. - CheckExprPermitByRefLike cenv env e + CheckExpr cenv env e context else CheckExprNoByrefs cenv env e - LimitFlags.None + NoLimit if alwaysCheckNoReraise then CheckNoReraise cenv None e limit -and CheckExprs cenv env exprs contexts : LimitFlags = +and CheckExprs cenv env exprs contexts : Limit = let contexts = Array.ofList contexts let argArity i = if i < contexts.Length then contexts.[i] else PermitByRefExpr.No exprs |> List.mapi (fun i exp -> CheckExpr cenv env exp (argArity i)) - |> List.fold (|||) LimitFlags.None + |> CombineLimits -and CheckExprsNoByRefLike cenv env exprs : LimitFlags = +and CheckExprsNoByRefLike cenv env exprs : Limit = exprs |> List.iter (CheckExprNoByrefs cenv env) - LimitFlags.None + NoLimit and CheckExprsPermitByRefLike cenv env exprs = exprs |> List.map (CheckExprPermitByRefLike cenv env) - |> List.fold (|||) LimitFlags.None + |> CombineLimits -and CheckExprsPermitReturnableByRef cenv env exprs : LimitFlags = +and CheckExprsPermitReturnableByRef cenv env exprs : Limit = exprs |> List.map (CheckExprPermitReturnableByRef cenv env) - |> List.fold (|||) LimitFlags.None + |> CombineLimits -and CheckExprPermitByRefLike cenv env expr : LimitFlags = +and CheckExprPermitByRefLike cenv env expr : Limit = CheckExpr cenv env expr PermitByRefExpr.Yes -and CheckExprPermitReturnableByRef cenv env expr : LimitFlags = +and CheckExprPermitReturnableByRef cenv env expr : Limit = CheckExpr cenv env expr PermitByRefExpr.YesReturnable and CheckDecisionTreeTargets cenv env targets context = targets |> Array.map (CheckDecisionTreeTarget cenv env context) - |> Array.fold (|||) LimitFlags.None + |> (CombineLimits << List.ofArray) and CheckDecisionTreeTarget cenv env context (TTarget(vs,e,_)) = BindVals cenv env vs @@ -1394,7 +1453,7 @@ and CheckDecisionTree cenv env x = | TDSuccess (es,_) -> CheckExprsNoByRefLike cenv env es |> ignore | TDBind(bind,rest) -> - CheckBinding cenv env false bind |> ignore + CheckBinding cenv env false PermitByRefExpr.Yes bind |> ignore CheckDecisionTree cenv env rest | TDSwitch (e,cases,dflt,m) -> CheckDecisionTreeSwitch cenv env (e,cases,dflt,m) @@ -1508,7 +1567,7 @@ and AdjustAccess isHidden (cpath: unit -> CompilationPath) access = else access -and CheckBinding cenv env alwaysCheckNoReraise (TBind(v,bindRhs,_) as bind) : LimitFlags = +and CheckBinding cenv env alwaysCheckNoReraise context (TBind(v,bindRhs,_) as bind) : Limit = let g = cenv.g let isTop = Option.isSome bind.Var.ValReprInfo //printfn "visiting %s..." v.DisplayName @@ -1606,10 +1665,10 @@ and CheckBinding cenv env alwaysCheckNoReraise (TBind(v,bindRhs,_) as bind) : Li let topValInfo = match bind.Var.ValReprInfo with Some info -> info | _ -> ValReprInfo.emptyValData - CheckLambdas isTop v.MemberInfo cenv env v.MustInline topValInfo alwaysCheckNoReraise bindRhs v.Range v.Type + CheckLambdas isTop v.MemberInfo cenv env v.MustInline topValInfo alwaysCheckNoReraise bindRhs v.Range v.Type context and CheckBindings cenv env xs = - xs |> List.iter (CheckBinding cenv env false >> ignore) + xs |> List.iter (CheckBinding cenv env false PermitByRefExpr.Yes >> ignore) // Top binds introduce expression, check they are reraise free. let CheckModuleBinding cenv env (TBind(v,e,_) as bind) = @@ -1737,7 +1796,7 @@ let CheckModuleBinding cenv env (TBind(v,e,_) as bind) = with e -> errorRecovery e v.Range end - CheckBinding cenv env true bind |> ignore + CheckBinding cenv { env with returnScope = 1 } true PermitByRefExpr.Yes bind |> ignore let CheckModuleBindings cenv env binds = binds |> List.iter (CheckModuleBinding cenv env) @@ -2158,7 +2217,8 @@ let CheckTopImpl (g,amap,reportErrors,infoReader,internalsVisibleToPaths,viewCcu argVals = ValMap.Empty boundTypars= TyparMap.Empty reflect=false - external=false } + external=false + returnScope = 0 } CheckModuleExpr cenv env mexpr CheckAttribs cenv env extraAttribs diff --git a/src/fsharp/TastOps.fs b/src/fsharp/TastOps.fs index d1e8705297..7212334f04 100644 --- a/src/fsharp/TastOps.fs +++ b/src/fsharp/TastOps.fs @@ -5864,7 +5864,9 @@ let rec mkExprAddrOfExprAux g mustTakeAddress useReadonlyForGenericArrayAddress if isStructTy g ty then match mut with | NeverMutates -> () - | AddressOfOp -> () // we get an inref + | AddressOfOp -> + // we get an inref + errorR(Error(FSComp.SR.tastCantTakeAddressOfExpression(), m)) | DefinitelyMutates -> // Give a nice error message for mutating something we can't take the address of errorR(Error(FSComp.SR.tastInvalidMutationOfConstant(), m)) diff --git a/src/fsharp/TypeChecker.fs b/src/fsharp/TypeChecker.fs index afba0fa812..330180dfbe 100755 --- a/src/fsharp/TypeChecker.fs +++ b/src/fsharp/TypeChecker.fs @@ -9813,9 +9813,11 @@ and TcMethodApplication if isByrefTy g calledArgTy && isRefCellTy g callerArgTy then None, Expr.Op(TOp.RefAddrGet false, [destRefCellTy g callerArgTy], [callerArgExpr], m) +#if IMPLICIT_ADDRESS_OF elif isInByrefTy g calledArgTy && not (isByrefTy cenv.g callerArgTy) then let wrap, callerArgExprAddress, _readonly, _writeonly = mkExprAddrOfExpr g true false NeverMutates callerArgExpr None m Some wrap, callerArgExprAddress +#endif elif isDelegateTy cenv.g calledArgTy && isFunTy cenv.g callerArgTy then None, CoerceFromFSharpFuncToDelegate cenv.g cenv.amap cenv.infoReader ad callerArgTy m callerArgExpr calledArgTy diff --git a/src/fsharp/xlf/FSComp.txt.cs.xlf b/src/fsharp/xlf/FSComp.txt.cs.xlf index 30bc38c9cb..5995b43cd9 100644 --- a/src/fsharp/xlf/FSComp.txt.cs.xlf +++ b/src/fsharp/xlf/FSComp.txt.cs.xlf @@ -7057,6 +7057,11 @@ A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.de.xlf b/src/fsharp/xlf/FSComp.txt.de.xlf index 758c786a0c..af1afbbe44 100644 --- a/src/fsharp/xlf/FSComp.txt.de.xlf +++ b/src/fsharp/xlf/FSComp.txt.de.xlf @@ -7057,6 +7057,11 @@ A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.en.xlf b/src/fsharp/xlf/FSComp.txt.en.xlf index 65496ff1e9..3d980b3618 100644 --- a/src/fsharp/xlf/FSComp.txt.en.xlf +++ b/src/fsharp/xlf/FSComp.txt.en.xlf @@ -7057,6 +7057,11 @@ A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.es.xlf b/src/fsharp/xlf/FSComp.txt.es.xlf index 57c68e299f..c567986449 100644 --- a/src/fsharp/xlf/FSComp.txt.es.xlf +++ b/src/fsharp/xlf/FSComp.txt.es.xlf @@ -7057,6 +7057,11 @@ A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.fr.xlf b/src/fsharp/xlf/FSComp.txt.fr.xlf index 36be3140aa..d83b9d47e6 100644 --- a/src/fsharp/xlf/FSComp.txt.fr.xlf +++ b/src/fsharp/xlf/FSComp.txt.fr.xlf @@ -7057,6 +7057,11 @@ A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.it.xlf b/src/fsharp/xlf/FSComp.txt.it.xlf index 49d952c24c..f75360e700 100644 --- a/src/fsharp/xlf/FSComp.txt.it.xlf +++ b/src/fsharp/xlf/FSComp.txt.it.xlf @@ -7057,6 +7057,11 @@ A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.ja.xlf b/src/fsharp/xlf/FSComp.txt.ja.xlf index 953a85e3d8..a4ae3db8a1 100644 --- a/src/fsharp/xlf/FSComp.txt.ja.xlf +++ b/src/fsharp/xlf/FSComp.txt.ja.xlf @@ -7057,6 +7057,11 @@ A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.ko.xlf b/src/fsharp/xlf/FSComp.txt.ko.xlf index 09d977ef3e..c953381b20 100644 --- a/src/fsharp/xlf/FSComp.txt.ko.xlf +++ b/src/fsharp/xlf/FSComp.txt.ko.xlf @@ -7057,6 +7057,11 @@ A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.pl.xlf b/src/fsharp/xlf/FSComp.txt.pl.xlf index 368b4fd562..3be3a2b000 100644 --- a/src/fsharp/xlf/FSComp.txt.pl.xlf +++ b/src/fsharp/xlf/FSComp.txt.pl.xlf @@ -7057,6 +7057,11 @@ A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf index 47deec3e2c..4e0963e2fa 100644 --- a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf +++ b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf @@ -7057,6 +7057,11 @@ A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.ru.xlf b/src/fsharp/xlf/FSComp.txt.ru.xlf index eb56a9f260..cf15071f17 100644 --- a/src/fsharp/xlf/FSComp.txt.ru.xlf +++ b/src/fsharp/xlf/FSComp.txt.ru.xlf @@ -7057,6 +7057,11 @@ A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.tr.xlf b/src/fsharp/xlf/FSComp.txt.tr.xlf index ece602391d..2fc70b0912 100644 --- a/src/fsharp/xlf/FSComp.txt.tr.xlf +++ b/src/fsharp/xlf/FSComp.txt.tr.xlf @@ -7057,6 +7057,11 @@ A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf index 682a3f8fd7..eb6b470b4f 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf @@ -7057,6 +7057,11 @@ A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf index 0942ac32f7..342da40e1b 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf @@ -7057,6 +7057,11 @@ A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + + \ No newline at end of file diff --git a/tests/fsharp/core/byrefs/test.bsl b/tests/fsharp/core/byrefs/test.bsl new file mode 100644 index 0000000000..b1602e42b2 --- /dev/null +++ b/tests/fsharp/core/byrefs/test.bsl @@ -0,0 +1,55 @@ + +test.fsx(31,34,31,40): typecheck error FS3224: The byref pointer is readonly, so this write is not permitted. + +test.fsx(34,32,34,40): typecheck error FS0257: Invalid mutation of a constant expression. Consider copying the expression to a mutable local, e.g. 'let mutable x = ...'. + +test.fsx(38,36,38,38): typecheck error FS0001: Type mismatch. Expecting a + 'byref<'T>' +but given a + 'inref<'T>' +The type 'ByRefKinds.InOut' does not match the type 'ByRefKinds.In' + +test.fsx(42,36,42,38): typecheck error FS0001: Type mismatch. Expecting a + 'outref<'T>' +but given a + 'inref<'T>' +The type 'ByRefKinds.Out' does not match the type 'ByRefKinds.In' + +test.fsx(47,38,47,40): typecheck error FS0001: Type mismatch. Expecting a + 'byref<'T>' +but given a + 'inref<'T>' +The type 'ByRefKinds.InOut' does not match the type 'ByRefKinds.In' + +test.fsx(52,38,52,40): typecheck error FS0001: Type mismatch. Expecting a + 'outref<'T>' +but given a + 'inref<'T>' +The type 'ByRefKinds.Out' does not match the type 'ByRefKinds.In' + +test.fsx(57,38,57,40): typecheck error FS0001: Type mismatch. Expecting a + 'byref<'T>' +but given a + 'inref<'T>' +The type 'ByRefKinds.InOut' does not match the type 'ByRefKinds.In' + +test.fsx(62,38,62,40): typecheck error FS0001: Type mismatch. Expecting a + 'outref<'T>' +but given a + 'inref<'T>' +The type 'ByRefKinds.Out' does not match the type 'ByRefKinds.In' + +test.fsx(66,34,66,47): typecheck error FS1204: This construct is for use in the FSharp.Core library and should not be used directly + +test.fsx(66,34,66,47): typecheck error FS1204: This construct is for use in the FSharp.Core library and should not be used directly + +test.fsx(71,21,71,23): typecheck error FS3238: Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + +test.fsx(72,21,72,23): typecheck error FS3238: Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + +test.fsx(78,21,78,37): typecheck error FS3238: Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + +test.fsx(85,22,85,23): typecheck error FS0001: This expression was expected to have type + 'inref' +but here has type + 'System.DateTime' diff --git a/tests/fsharp/core/byrefs/test.fsx b/tests/fsharp/core/byrefs/test.fsx index 1e0c414069..e2a85f718f 100644 --- a/tests/fsharp/core/byrefs/test.fsx +++ b/tests/fsharp/core/byrefs/test.fsx @@ -17,7 +17,75 @@ let check s actual expected = if actual = expected then printfn "%s: OK" s else report_failure (sprintf "%s: FAILED, expected %A, got %A" s expected actual) -let check2 s expected actual = check s actual expected +let check2 s expected actual = check s actual expected + +[] +type S = + [] + val mutable X : int + +#if NEGATIVE +module ByrefNegativeTests = + + module WriteToInRef = + let f1 (x: inref) = x <- 1 // not allowed + + module WriteToInRefStructInner = + let f1 (x: inref) = x.X <- 1 //not allowed + + module InRefToByRef = + let f1 (x: byref<'T>) = 1 + let f2 (x: inref<'T>) = f1 &x // not allowed + + module InRefToOutRef = + let f1 (x: outref<'T>) = 1 + let f2 (x: inref<'T>) = f1 &x // not allowed + + module InRefToByRefClassMethod = + type C() = + static member f1 (x: byref<'T>) = 1 + let f2 (x: inref<'T>) = C.f1 &x // not allowed + + module InRefToOutRefClassMethod = + type C() = + static member f1 (x: outref<'T>) = 1 // not allowed (not yet) + let f2 (x: inref<'T>) = C.f1 &x // not allowed + + module InRefToByRefClassMethod2 = + type C() = + static member f1 (x: byref<'T>) = 1 + let f2 (x: inref<'T>) = C.f1(&x) // not allowed + + module InRefToOutRefClassMethod2 = + type C() = + static member f1 (x: outref<'T>) = 1 // not allowed (not yet) + let f2 (x: inref<'T>) = C.f1(&x) // not allowed + + module UseOfLibraryOnly = + type C() = + static member f1 (x: byref<'T, 'U>) = 1 + + module CantTakeAddress = + + let test1 () = + let x = &1 // not allowed + let y = &2 // not allowed + x + y + + let test2_helper (x: byref) = x + let test2 () = + let mutable x = 1 + let y = &test2_helper &x // not allowed + () + + module InRefParam_DateTime = + type C() = + static member M(x: inref) = x + let w = System.DateTime.Now + let v = C.M(w) // not allowed + check "cweweoiwe51btw" v w + +#endif // Test a simple ref argument module CompareExchangeTests = @@ -275,7 +343,7 @@ module InRefParamOverload_ImplicitAddressOfAtCallSite2 = check "cweweoiwe51btw2" v2 (res.AddDays(1.0)) Test() - +#if IMPLICIT_ADDRESS_OF module InRefParam_DateTime = type C() = static member M(x: inref) = x @@ -309,6 +377,7 @@ module InRefParam_DateTime_ImplicitAddressOfAtCallSite4 = let w = [| date |] let v = C.M(w.[0]) check "lmvjvwo1" v date +#endif module InRefParam_Generic_ExplicitAddressOfAttCallSite1 = type C() = @@ -1244,11 +1313,6 @@ module ByrefReturnMemberTests = test() module MatrixOfTests = - [] - type S = - [] - val mutable X : int - module ReturnAddressOfByRef = let f1 (x: byref) = &x @@ -1285,11 +1349,6 @@ module ByrefReturnMemberTests = module WriteToByRef = let f1 (x: byref) = x <- 1 -#if NEGATIVE - module WriteToInRef = - let f1 (x: inref) = x <- 1 // not allowed -#endif - module WriteToOutRef = let f1 (x: outref) = x <- 1 @@ -1297,11 +1356,6 @@ module ByrefReturnMemberTests = module WriteToByRefStructInner = let f1 (x: byref) = x.X <- 1 -#if NEGATIVE - module WriteToInRefStructInner = - let f1 (x: inref) = x.X <- 1 //not allowed -#endif - module WriteToOutRefStructInner = let f1 (x: outref) = x.X <- 1 @@ -1310,12 +1364,6 @@ module ByrefReturnMemberTests = let f1 (x: byref<'T>) = 1 let f2 (x: outref<'T>) = f1 &x -#if NEGATIVE - module InRefToByRef = - let f1 (x: byref<'T>) = 1 - let f2 (x: inref<'T>) = f1 &x // not allowed -#endif - module ByRefToByRef = let f1 (x: byref<'T>) = 1 let f2 (x: byref<'T>) = f1 &x @@ -1328,12 +1376,6 @@ module ByrefReturnMemberTests = let f1 (x: outref<'T>) = 1 let f2 (x: outref<'T>) = f1 &x -#if NEGATIVE - module InRefToOutRef = - let f1 (x: outref<'T>) = 1 - let f2 (x: inref<'T>) = f1 &x // not allowed -#endif - module ByRefToInRef = let f1 (x: inref<'T>) = 1 let f2 (x: byref<'T>) = f1 &x @@ -1352,13 +1394,6 @@ module ByrefReturnMemberTests = static member f1 (x: byref<'T>) = 1 let f2 (x: outref<'T>) = C.f1 &x -#if NEGATIVE - module InRefToByRefClassMethod = - type C() = - static member f1 (x: byref<'T>) = 1 - let f2 (x: inref<'T>) = C.f1 &x // not allowed -#endif - module ByRefToByRefClassMethod = type C() = static member f1 (x: byref<'T>) = 1 @@ -1374,13 +1409,6 @@ module ByrefReturnMemberTests = static member f1 (x: outref<'T>) = 1 let f2 (x: outref<'T>) = C.f1 &x -#if NEGATIVE - module InRefToOutRefClassMethod = - type C() = - static member f1 (x: outref<'T>) = 1 // not allowed - let f2 (x: inref<'T>) = C.f1 &x -#endif - module ByRefToInRefClassMethod = type C() = static member f1 (x: inref<'T>) = 1 @@ -1402,13 +1430,6 @@ module ByrefReturnMemberTests = static member f1 (x: byref<'T>) = 1 let f2 (x: outref<'T>) = C.f1(&x) -#if NEGATIVE - module InRefToByRefClassMethod2 = - type C() = - static member f1 (x: byref<'T>) = 1 - let f2 (x: inref<'T>) = C.f1(&x) // not allowed -#endif - module ByRefToByRefClassMethod2 = type C() = static member f1 (x: byref<'T>) = 1 @@ -1424,13 +1445,6 @@ module ByrefReturnMemberTests = static member f1 (x: outref<'T>) = 1 let f2 (x: outref<'T>) = C.f1(&x) -#if NEGATIVE - module InRefToOutRefClassMethod2 = - type C() = - static member f1 (x: outref<'T>) = 1 // not allowed - let f2 (x: inref<'T>) = C.f1(&x) -#endif - module ByRefToInRefClassMethod2 = type C() = static member f1 (x: inref<'T>) = 1 @@ -1445,12 +1459,6 @@ module ByrefReturnMemberTests = type C() = static member f1 (x: inref<'T>) = 1 let f2 (x: outref<'T>) = C.f1(&x) - -#if NEGATIVE - module UseOfLibraryOnly = - type C() = - static member f1 (x: byref<'T, 'U>) = 1 -#endif let aa = if !failures then (stdout.WriteLine "Test Failed"; exit 1) diff --git a/tests/fsharp/core/byrefs/test2.bsl b/tests/fsharp/core/byrefs/test2.bsl new file mode 100644 index 0000000000..232cc82edb --- /dev/null +++ b/tests/fsharp/core/byrefs/test2.bsl @@ -0,0 +1,26 @@ + +test2.fsx(29,18,29,19): typecheck error FS3209: The address of the variable 'y' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(36,18,36,19): typecheck error FS3209: The address of the variable 'z' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(45,14,45,15): typecheck error FS3209: The address of the variable 'x' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(49,14,49,15): typecheck error FS3209: The address of the variable 'y' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(56,14,56,15): typecheck error FS3209: The address of the variable 'x' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(59,14,59,15): typecheck error FS3209: The address of the variable 'y' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(68,18,68,19): typecheck error FS3209: The address of the variable 'z' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(69,10,69,11): typecheck error FS3209: The address of the variable 'y' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(79,14,79,29): typecheck error FS3228: The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(87,14,87,29): typecheck error FS3228: The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(93,28,93,29): typecheck error FS0421: The address of the variable 'x' cannot be used at this point + +test2.fsx(93,17,93,29): typecheck error FS0425: The type of a first-class function cannot contain byrefs + +test2.fsx(93,17,93,29): typecheck error FS0425: The type of a first-class function cannot contain byrefs diff --git a/tests/fsharp/core/byrefs/test2.fsx b/tests/fsharp/core/byrefs/test2.fsx new file mode 100644 index 0000000000..54bbe2b082 --- /dev/null +++ b/tests/fsharp/core/byrefs/test2.fsx @@ -0,0 +1,145 @@ +#if TESTS_AS_APP +module Core_byrefs +#endif + +let failures = ref false +let report_failure (s) = + stderr.WriteLine ("NO: " + s); failures := true +let test s b = if b then () else report_failure(s) + +(* TEST SUITE FOR Int32 *) + +let out r (s:string) = r := !r @ [s] + +let check s actual expected = + if actual = expected then printfn "%s: OK" s + else report_failure (sprintf "%s: FAILED, expected %A, got %A" s expected actual) + +let check2 s expected actual = check s actual expected + +// POST INFERENCE CHECKS +#if NEGATIVE +module NegativeTests = + + let test1 doIt = + let mutable x = 42 + let r = + if doIt then + let mutable y = 1 + &y // not allowed + else + &x + + let c = + if doIt then + let mutable z = 2 + &z // not allowed + else + &x + + x + r + c + + let test2 () = + let x = + let mutable x = 1 + &x // not allowed + + let y = + let mutable y = 2 + &y // not allowed + + x + y + + let test3 doIt = + let mutable x = 1 + if doIt then + &x // not allowed + else + let mutable y = 1 + &y // not allowed + + let test4 doIt = + let mutable x = 1 + let y = + if doIt then + &x + else + let mutable z = 1 + &z // not allowed + &y // not allowed + + type Coolio() = + + static member Cool(x: inref) = &x + + let test5 () = + + let y = + let x = 1 + &Coolio.Cool(&x) // not allowed + + () + + let test6 () = + + let y = + let mutable x = 1 + &Coolio.Cool(&x) // not allowed + + () + + let test7 () = + let mutable x = 1 + let f = fun () -> &x // not allowed + + () +#endif + +module Tests = + + type ByRefInterface = + + abstract Test : byref * byref -> byref + + type Test() = + + member __.Beef() = + let mutable a = Unchecked.defaultof + let obj = { new ByRefInterface with + + member __.Test(x,y) = + let mutable x = 1 + let obj2 = + { new ByRefInterface with + + member __.Test(_x,y) = &x } // is allowed + a <- obj2 + &y + } + let mutable x = 500 + let mutable y = 500 + obj.Test(&x, &y) |> ignore + a + + let test1 () = + let x = 1 + let f = fun () -> + let y = &x // is allowed + () + + let g = fun () -> + let y = &x // is allowed + () + () + + type Beef = delegate of unit-> byref + let test2 () = + let mutable x = 1 + let f = Beef(fun () -> &x) // is allowed + () + +let aa = + if !failures then (stdout.WriteLine "Test Failed"; exit 1) + else (stdout.WriteLine "Test Passed"; + System.IO.File.WriteAllText("test2.ok","ok"); + exit 0) \ No newline at end of file diff --git a/tests/fsharp/core/span/test.fsx b/tests/fsharp/core/span/test.fsx index 142847ea3f..81ac6b3c7a 100644 --- a/tests/fsharp/core/span/test.fsx +++ b/tests/fsharp/core/span/test.fsx @@ -105,16 +105,16 @@ namespace Tests let SafeSum6(bytes: ReadOnlySpan) = let mutable sum = 0 for i in 0 .. bytes.Length - 1 do - let byteAddr = &bytes.[i] - sum <- sum + int byteAddr + let byte = bytes.[i] + sum <- sum + int byte sum let SafeSum7(bytes: ReadOnlyMemory) = let bytes = bytes.Span let mutable sum = 0 for i in 0 .. bytes.Length - 1 do - let byteAddr = &bytes.[i] - sum <- sum + int byteAddr + let byte = bytes.[i] + sum <- sum + int byte sum let SafeSum8(bytes: ReadOnlyMemory) = diff --git a/tests/fsharp/core/span/test2.bsl b/tests/fsharp/core/span/test2.bsl index bac72ffc78..8cec28adac 100644 --- a/tests/fsharp/core/span/test2.bsl +++ b/tests/fsharp/core/span/test2.bsl @@ -50,3 +50,5 @@ test2.fsx(167,14,167,71): typecheck error FS3228: The address of a value returne test2.fsx(191,43,191,44): typecheck error FS3209: The address of the variable 'x' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. test2.fsx(195,14,195,15): typecheck error FS3209: The address of the variable 'y' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(199,13,199,19): typecheck error FS3230: This value can't be assigned because the target 'x' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. diff --git a/tests/fsharp/core/span/test2.fsx b/tests/fsharp/core/span/test2.fsx index aa56f5cd30..b867c5a0d7 100644 --- a/tests/fsharp/core/span/test2.fsx +++ b/tests/fsharp/core/span/test2.fsx @@ -194,6 +194,10 @@ namespace Tests let y = &x &y + let should_not_work35 (x: byref>) = + let mutable y = Span.Empty + x <- y + #endif let should_work1 () = @@ -321,4 +325,18 @@ namespace Tests let should_work28 (s: Span) = let y = &s.[0] - &y \ No newline at end of file + &y + + let should_work29_helper (x: Span) (y: byref) = &y + + let should_work29 () = + let yopac = + let mutable s = Span.Empty + &should_work29_helper s &beef // this looks like it's out of scope, but this is coming from a stack referring span-like type. + () + + let should_work30 () = + let yopac = + let mutable s = Span.Empty + &s.[0] // this looks like it's out of scope, but this is coming from a stack referring span-like type. + () \ No newline at end of file diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index f1417459b1..da25595737 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -182,6 +182,8 @@ module CoreTests = fsc cfg "%s -o:test.exe -g" cfg.fsc_flags ["test.fsx"] + singleNegTest cfg "test" + exec cfg ("." ++ "test.exe") "" testOkFile.CheckExists() @@ -203,6 +205,18 @@ module CoreTests = testOkFile.CheckExists() end + begin + use testOkFile = fileguard cfg "test2.ok" + + fsc cfg "%s -o:test2.exe -g" cfg.fsc_flags ["test2.fsx"] + + singleNegTest cfg "test2" + + exec cfg ("." ++ "test2.exe") "" + + testOkFile.CheckExists() + end + [] let span () = diff --git a/tests/fsharp/typecheck/sigs/neg106.bsl b/tests/fsharp/typecheck/sigs/neg106.bsl index 152960f5ce..bfa1ff5e6b 100644 --- a/tests/fsharp/typecheck/sigs/neg106.bsl +++ b/tests/fsharp/typecheck/sigs/neg106.bsl @@ -38,6 +38,8 @@ is not compatible with type 'byref<'a>' . +neg106.fs(17,59,17,61): typecheck error FS3238: Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + neg106.fs(17,14,17,68): typecheck error FS0041: No overloads match for method 'CompareExchange'. The available overloads are shown below. neg106.fs(17,14,17,68): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: int, comparand: int) : int'. Type constraint mismatch. The type 'inref' diff --git a/tests/fsharp/typecheck/sigs/neg106.vsbsl b/tests/fsharp/typecheck/sigs/neg106.vsbsl index 152960f5ce..bfa1ff5e6b 100644 --- a/tests/fsharp/typecheck/sigs/neg106.vsbsl +++ b/tests/fsharp/typecheck/sigs/neg106.vsbsl @@ -38,6 +38,8 @@ is not compatible with type 'byref<'a>' . +neg106.fs(17,59,17,61): typecheck error FS3238: Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + neg106.fs(17,14,17,68): typecheck error FS0041: No overloads match for method 'CompareExchange'. The available overloads are shown below. neg106.fs(17,14,17,68): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: int, comparand: int) : int'. Type constraint mismatch. The type 'inref' From 6d40f35f260b0740a2a4422de869c609fa35453f Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Tue, 3 Jul 2018 00:25:07 -0700 Subject: [PATCH 072/150] Enable more VS IDE unit tests (#5242) * Add more vs unit tests * More interop assemblies * Use FSHARP_COMPILER_BIN * nope * update script * A few more * A few more --- VisualFSharp.sln | 11 ++++ build-everything.proj | 2 +- build.cmd | 10 +++ build/targets/PackageVersions.props | 10 +++ tests/service/MultiProjectAnalysisTests.fs | 2 + vsintegration/Directory.Build.targets | 8 +++ .../fsharp-vsintegration-src-build.proj | 6 +- .../fsharp-vsintegration-unittests-build.proj | 2 + .../src/FSharp.Editor/FSharp.Editor.fsproj | 59 +++++++++--------- .../FSharp.LanguageService.Base.csproj | 34 ++++++---- .../FSharp.LanguageService.fsproj | 36 +++++------ .../Project/Automation/OAFileItem.cs | 1 - .../Project/Automation/OAFolderItem.cs | 1 - .../Automation/OANavigableProjectItems.cs | 1 - .../Project/Automation/OAProject.cs | 1 - .../Project/Automation/OAProjectItem.cs | 1 - .../Project/Automation/OAProjectItems.cs | 1 - .../Project/Automation/OAProperties.cs | 1 - .../Automation/VSProject/OAReferenceBase.cs | 1 - .../Automation/VSProject/OAReferences.cs | 1 - .../Project/ConfigurationProperties.cs | 1 - .../Project/HierarchyNode.cs | 4 +- .../Project/IDEBuildLogger.cs | 1 - .../Project/NodeProperties.cs | 1 - .../Project/ProjectConfig.cs | 1 - .../Project/ProjectNode.cs | 1 - .../Project/ProjectReferenceNode.cs | 6 +- .../Project/ProjectSystem.Base.csproj | 29 +++++---- .../Project/UIThread.cs | 2 +- .../ProjectSystem.fsproj | 36 ++++++----- .../FSharp.PropertiesPages.vbproj | 21 ++++--- .../src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj | 32 +++++----- .../GetTypesVSUnitTests.fs | 17 +++++ .../GetTypesVSUnitTests.fsproj | 26 ++++++++ .../tests/Salsa/VisualFSharp.Salsa.fsproj | 27 ++++---- vsintegration/tests/Salsa/VsMocks.fs | 57 ++++++++++------- vsintegration/tests/Salsa/salsa.fs | 2 +- vsintegration/tests/UnitTests/App.config | 38 ++++++++++++ .../tests/UnitTests/AssemblyResolver.fs | 52 ++++++++++++++++ .../UnitTests/CompletionProviderTests.fs | 3 +- .../Tests.LanguageService.Completion.fs | 3 + .../Tests.LanguageService.General.fs | 2 +- .../Tests.LanguageService.ParameterInfo.fs | 1 + .../Tests.LanguageService.Script.fs | 25 ++++---- .../Tests.LanguageService.TimeStamp.fs | 36 ++++++----- .../UnitTests/TestLib.LanguageService.fs | 2 + .../tests/UnitTests/TestLib.ProjectSystem.fs | 1 - .../tests/UnitTests/TestLib.Utils.fs | 2 +- .../VisualFSharp.UnitTests.dll.config | 48 -------------- .../UnitTests/VisualFSharp.UnitTests.fsproj | 62 ++++++++++--------- 50 files changed, 439 insertions(+), 289 deletions(-) create mode 100644 vsintegration/tests/GetTypesVSUnitTests/GetTypesVSUnitTests.fs create mode 100644 vsintegration/tests/GetTypesVSUnitTests/GetTypesVSUnitTests.fsproj create mode 100644 vsintegration/tests/UnitTests/App.config create mode 100644 vsintegration/tests/UnitTests/AssemblyResolver.fs delete mode 100644 vsintegration/tests/UnitTests/VisualFSharp.UnitTests.dll.config diff --git a/VisualFSharp.sln b/VisualFSharp.sln index ceed166a60..e6bcc50bbd 100644 --- a/VisualFSharp.sln +++ b/VisualFSharp.sln @@ -145,6 +145,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FSharp.PatternMatcher", "vs EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Legacy", "Legacy", "{CCAB6E50-34C6-42AF-A6B0-567C29FCD91B}" EndProject +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "GetTypesVSUnitTests", "vsintegration\tests\GetTypesVSUnitTests\GetTypesVSUnitTests.fsproj", "{6D93CEBD-4540-4D96-A153-B440A661FD09}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -569,6 +571,14 @@ Global {18227628-DF90-4C47-AF3D-CC72D2EDD986}.Release|Any CPU.Build.0 = Release|Any CPU {18227628-DF90-4C47-AF3D-CC72D2EDD986}.Release|x86.ActiveCfg = Release|Any CPU {18227628-DF90-4C47-AF3D-CC72D2EDD986}.Release|x86.Build.0 = Release|Any CPU + {6D93CEBD-4540-4D96-A153-B440A661FD09}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6D93CEBD-4540-4D96-A153-B440A661FD09}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6D93CEBD-4540-4D96-A153-B440A661FD09}.Debug|x86.ActiveCfg = Debug|Any CPU + {6D93CEBD-4540-4D96-A153-B440A661FD09}.Debug|x86.Build.0 = Debug|Any CPU + {6D93CEBD-4540-4D96-A153-B440A661FD09}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6D93CEBD-4540-4D96-A153-B440A661FD09}.Release|Any CPU.Build.0 = Release|Any CPU + {6D93CEBD-4540-4D96-A153-B440A661FD09}.Release|x86.ActiveCfg = Release|Any CPU + {6D93CEBD-4540-4D96-A153-B440A661FD09}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -634,6 +644,7 @@ Global {B0689A4E-07D8-494D-A0C8-791CB1D74E54} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449} {18227628-DF90-4C47-AF3D-CC72D2EDD986} = {4C7B48D7-19AF-4AE7-9D1D-3BB289D5480D} {CCAB6E50-34C6-42AF-A6B0-567C29FCD91B} = {4C7B48D7-19AF-4AE7-9D1D-3BB289D5480D} + {6D93CEBD-4540-4D96-A153-B440A661FD09} = {F7876C9B-FB6A-4EFB-B058-D6967DB75FB2} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {48EDBBBE-C8EE-4E3C-8B19-97184A487B37} diff --git a/build-everything.proj b/build-everything.proj index afdd0655a1..43e9b47afe 100644 --- a/build-everything.proj +++ b/build-everything.proj @@ -30,8 +30,8 @@ - + diff --git a/build.cmd b/build.cmd index 285717d727..7c7cfd6e96 100644 --- a/build.cmd +++ b/build.cmd @@ -1160,6 +1160,16 @@ if "%TEST_VS_IDEUNIT_SUITE%" == "1" ( set OUTPUTARG=--output:"!OUTPUTFILE!" ) + rem Verify that VisualFSharp.UnitTests.dll can be loaded by nunit. Report load errors. + pushd !FSCBINPATH! + echo "!NUNIT3_CONSOLE!" --verbose --x86 --framework:V4.0 --work:"!FSCBINPATH!" --workers=1 --agents=1 --full "!FSCBINPATH!\GetTypesVSUnitTests.dll" !WHERE_ARG_NUNIT! + "!NUNIT3_CONSOLE!" --verbose --x86 --framework:V4.0 --work:"!FSCBINPATH!" --workers=1 --agents=1 --full "!FSCBINPATH!\GetTypesVSUnitTests.dll" !WHERE_ARG_NUNIT! + popd + + if errorlevel 1 ( + goto :failure + ) + pushd !FSCBINPATH! echo "!NUNIT3_CONSOLE!" --verbose --x86 --framework:V4.0 --result:"!XMLFILE!;format=nunit3" !OUTPUTARG! !ERRORARG! --work:"!FSCBINPATH!" --workers=1 --agents=1 --full "!FSCBINPATH!\VisualFSharp.UnitTests.dll" !WHERE_ARG_NUNIT! "!NUNIT3_CONSOLE!" --verbose --x86 --framework:V4.0 --result:"!XMLFILE!;format=nunit3" !OUTPUTARG! !ERRORARG! --work:"!FSCBINPATH!" --workers=1 --agents=1 --full "!FSCBINPATH!\VisualFSharp.UnitTests.dll" !WHERE_ARG_NUNIT! diff --git a/build/targets/PackageVersions.props b/build/targets/PackageVersions.props index 8af4029ee9..63137a9172 100644 --- a/build/targets/PackageVersions.props +++ b/build/targets/PackageVersions.props @@ -27,31 +27,41 @@ 8.0.1 14.0.25420 + 15.6.27740 15.0.26201-alpha 1.1.4322 15.0.26201 + 15.0.26201 15.6.27740 15.6.27740 15.6.27740 8.0.50727 + 7.10.6071 15.0.26201 8.0.50727 2.3.6152103 14.3.25407 15.0.26201 15.0.26201 + 15.0.26201 10.0.30319 11.0.50727 15.0.25123-Dev15Preview + 7.10.6072 + 8.0.50727 + 9.0.30729 10.0.30319 11.0.61030 12.0.30110 + 15.6.27740 7.10.6071 8.0.50727 10.0.30319 12.0.30112 15.6.27740 15.6.27740 + 15.0.26201 + 15.3.15 9.0.30729 15.1.192 12.0.4 diff --git a/tests/service/MultiProjectAnalysisTests.fs b/tests/service/MultiProjectAnalysisTests.fs index 43867d7388..f5049122b0 100644 --- a/tests/service/MultiProjectAnalysisTests.fs +++ b/tests/service/MultiProjectAnalysisTests.fs @@ -931,6 +931,8 @@ let ``Type provider project references should not throw exceptions`` () = [] #if NETCOREAPP2_0 [] +#else +[] #endif let ``Projects creating generated types should not utilize cross-project-references but should still analyze oK once project is built`` () = //let options = ProjectCracker.GetProjectOptionsFromProjectFile(projectFile, [("Configuration", "Debug")]) diff --git a/vsintegration/Directory.Build.targets b/vsintegration/Directory.Build.targets index 161dfe3bab..366cce05ba 100644 --- a/vsintegration/Directory.Build.targets +++ b/vsintegration/Directory.Build.targets @@ -18,4 +18,12 @@ + + + + + + + + diff --git a/vsintegration/fsharp-vsintegration-src-build.proj b/vsintegration/fsharp-vsintegration-src-build.proj index 77dc3b617b..0b32bade2c 100644 --- a/vsintegration/fsharp-vsintegration-src-build.proj +++ b/vsintegration/fsharp-vsintegration-src-build.proj @@ -6,14 +6,14 @@ + + - - - + diff --git a/vsintegration/fsharp-vsintegration-unittests-build.proj b/vsintegration/fsharp-vsintegration-unittests-build.proj index f461ddc9e9..3ec0e0c136 100644 --- a/vsintegration/fsharp-vsintegration-unittests-build.proj +++ b/vsintegration/fsharp-vsintegration-unittests-build.proj @@ -5,6 +5,7 @@ + @@ -24,6 +25,7 @@ + diff --git a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj index 341034e6ea..806fed2a6a 100644 --- a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj +++ b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj @@ -114,39 +114,42 @@ + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vsintegration/src/FSharp.LanguageService.Base/FSharp.LanguageService.Base.csproj b/vsintegration/src/FSharp.LanguageService.Base/FSharp.LanguageService.Base.csproj index 20927e0060..ffb8ab07e6 100644 --- a/vsintegration/src/FSharp.LanguageService.Base/FSharp.LanguageService.Base.csproj +++ b/vsintegration/src/FSharp.LanguageService.Base/FSharp.LanguageService.Base.csproj @@ -35,6 +35,14 @@ + + + + + + + + @@ -42,19 +50,19 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj b/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj index 9551eb4c87..a6451981d9 100644 --- a/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj +++ b/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj @@ -61,25 +61,25 @@ - - - - - + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OAFileItem.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OAFileItem.cs index 1d78317e97..02480c0972 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OAFileItem.cs +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OAFileItem.cs @@ -15,7 +15,6 @@ using System.Diagnostics.CodeAnalysis; using System.Globalization; using Microsoft.VisualStudio.FSharp.ProjectSystem; -using Microsoft.VisualStudio.FSharp.LanguageService; namespace Microsoft.VisualStudio.FSharp.ProjectSystem.Automation { diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OAFolderItem.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OAFolderItem.cs index d3c6b2edc2..af1fadcee6 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OAFolderItem.cs +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OAFolderItem.cs @@ -13,7 +13,6 @@ using EnvDTE; using System.Diagnostics.CodeAnalysis; using Microsoft.VisualStudio.FSharp.ProjectSystem; -using Microsoft.VisualStudio.FSharp.LanguageService; namespace Microsoft.VisualStudio.FSharp.ProjectSystem.Automation { diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OANavigableProjectItems.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OANavigableProjectItems.cs index 00856b2e54..6c2ae1e591 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OANavigableProjectItems.cs +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OANavigableProjectItems.cs @@ -13,7 +13,6 @@ using Microsoft.VisualStudio.OLE.Interop; using System.Diagnostics.CodeAnalysis; using Microsoft.VisualStudio.FSharp.ProjectSystem; -using Microsoft.VisualStudio.FSharp.LanguageService; namespace Microsoft.VisualStudio.FSharp.ProjectSystem.Automation { diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OAProject.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OAProject.cs index 985f641888..412c70e0c9 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OAProject.cs +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OAProject.cs @@ -15,7 +15,6 @@ using EnvDTE; using System.Globalization; using Microsoft.VisualStudio.FSharp.ProjectSystem; -using Microsoft.VisualStudio.FSharp.LanguageService; namespace Microsoft.VisualStudio.FSharp.ProjectSystem.Automation { diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OAProjectItem.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OAProjectItem.cs index 30f5ba319f..90dc6bfec7 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OAProjectItem.cs +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OAProjectItem.cs @@ -12,7 +12,6 @@ using Microsoft.VisualStudio.OLE.Interop; using EnvDTE; using Microsoft.VisualStudio.FSharp.ProjectSystem; -using Microsoft.VisualStudio.FSharp.LanguageService; namespace Microsoft.VisualStudio.FSharp.ProjectSystem.Automation diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OAProjectItems.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OAProjectItems.cs index 7b03444742..52582948d9 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OAProjectItems.cs +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OAProjectItems.cs @@ -16,7 +16,6 @@ using System.Diagnostics.CodeAnalysis; using System.Globalization; using Microsoft.VisualStudio.FSharp.ProjectSystem; -using Microsoft.VisualStudio.FSharp.LanguageService; namespace Microsoft.VisualStudio.FSharp.ProjectSystem.Automation diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OAProperties.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OAProperties.cs index 86b2369a6c..f8079efb6b 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OAProperties.cs +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/OAProperties.cs @@ -14,7 +14,6 @@ using System.Diagnostics.CodeAnalysis; using System.Globalization; using Microsoft.VisualStudio.FSharp.ProjectSystem; -using Microsoft.VisualStudio.FSharp.LanguageService; namespace Microsoft.VisualStudio.FSharp.ProjectSystem.Automation { diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/VSProject/OAReferenceBase.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/VSProject/OAReferenceBase.cs index 6b819efea6..47190a2b7f 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/VSProject/OAReferenceBase.cs +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/VSProject/OAReferenceBase.cs @@ -6,7 +6,6 @@ using Microsoft.VisualStudio.FSharp.ProjectSystem; using VSLangProj; using System.Diagnostics.CodeAnalysis; -using Microsoft.VisualStudio.FSharp.LanguageService; namespace Microsoft.VisualStudio.FSharp.ProjectSystem.Automation { diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/VSProject/OAReferences.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/VSProject/OAReferences.cs index 474acd48c3..bd6be170d2 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/VSProject/OAReferences.cs +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Automation/VSProject/OAReferences.cs @@ -11,7 +11,6 @@ using VSLangProj; using System.Collections; using System.Diagnostics.CodeAnalysis; -using Microsoft.VisualStudio.FSharp.LanguageService; namespace Microsoft.VisualStudio.FSharp.ProjectSystem.Automation { diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ConfigurationProperties.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ConfigurationProperties.cs index b553ef663d..ce799dbfe2 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ConfigurationProperties.cs +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ConfigurationProperties.cs @@ -11,7 +11,6 @@ using System.IO; using System.Linq; using System.Collections.Generic; -using Microsoft.VisualStudio.FSharp.LanguageService; namespace Microsoft.VisualStudio.FSharp.ProjectSystem { diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/HierarchyNode.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/HierarchyNode.cs index 7d8bcaa1be..f26be0429f 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/HierarchyNode.cs +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/HierarchyNode.cs @@ -3172,7 +3172,7 @@ string newTargetFrameworkMoniker // replace existing fscore with one that has matching version with current target framework var existingFsCore = - Microsoft.VisualStudio.FSharp.LanguageService.UIThread.DoOnUIThread( + UIThread.DoOnUIThread( () => references .OfType() .FirstOrDefault(r => r.Name == fsCoreName.Name && r.PublicKeyToken == Utilities.FsCorePublicKeyToken && r.Culture == fsCoreName.CultureName) @@ -3180,7 +3180,7 @@ string newTargetFrameworkMoniker if (existingFsCore != null) { - Microsoft.VisualStudio.FSharp.LanguageService.UIThread.DoOnUIThread(() => + UIThread.DoOnUIThread(() => { // save copyLocal value - after calling existingFsCore.Remove() becomes invalid and can raise exceptions var copyLocal = existingFsCore.CopyLocal; diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/IDEBuildLogger.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/IDEBuildLogger.cs index 9c14f377ca..927c2c6f9d 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/IDEBuildLogger.cs +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/IDEBuildLogger.cs @@ -14,7 +14,6 @@ using Microsoft.VisualStudio.TextManager.Interop; using Microsoft.Win32; using IOleServiceProvider = Microsoft.VisualStudio.OLE.Interop.IServiceProvider; -using Microsoft.VisualStudio.FSharp.LanguageService; namespace Microsoft.VisualStudio.FSharp.ProjectSystem { diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/NodeProperties.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/NodeProperties.cs index 13ca5d368d..bf72d2f473 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/NodeProperties.cs +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/NodeProperties.cs @@ -20,7 +20,6 @@ using IOleServiceProvider = Microsoft.VisualStudio.OLE.Interop.IServiceProvider; using IServiceProvider = System.IServiceProvider; using System.Diagnostics.CodeAnalysis; -using Microsoft.VisualStudio.FSharp.LanguageService; using System.Runtime.Versioning; namespace Microsoft.VisualStudio.FSharp.ProjectSystem diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectConfig.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectConfig.cs index 44a3bfa5dd..41832e24b2 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectConfig.cs +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectConfig.cs @@ -12,7 +12,6 @@ using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Linq; -using Microsoft.VisualStudio.FSharp.LanguageService; using Microsoft.Win32; namespace Microsoft.VisualStudio.FSharp.ProjectSystem diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectNode.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectNode.cs index fae3278f5d..42b44da990 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectNode.cs +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectNode.cs @@ -36,7 +36,6 @@ using System.Linq; using Microsoft.Build.Execution; -using Microsoft.VisualStudio.FSharp.LanguageService; using Microsoft.VisualStudio.TextManager.Interop; namespace Microsoft.VisualStudio.FSharp.ProjectSystem diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectReferenceNode.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectReferenceNode.cs index 850f0ea2ed..e843985a16 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectReferenceNode.cs +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectReferenceNode.cs @@ -244,7 +244,7 @@ public void DropReferencedProjectCache() /// public void CleanProjectReferenceErrorState() { - Microsoft.VisualStudio.FSharp.LanguageService.UIThread.DoOnUIThread(() => + UIThread.DoOnUIThread(() => { if (projectRefError != null) { @@ -262,7 +262,7 @@ public void CleanProjectReferenceErrorState() /// private void SetError(string text) { - Microsoft.VisualStudio.FSharp.LanguageService.UIThread.DoOnUIThread(() => + UIThread.DoOnUIThread(() => { // delete existing error if exists CleanProjectReferenceErrorState(); @@ -295,7 +295,7 @@ private void SetProjectReferencesHigherVersionWarningMessage() /// public void RefreshProjectReferenceErrorState() { - Microsoft.VisualStudio.FSharp.LanguageService.UIThread.DoOnUIThread(() => + UIThread.DoOnUIThread(() => { CleanProjectReferenceErrorState(); diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj index a160071976..4568dc27d6 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj @@ -47,21 +47,20 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/UIThread.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/UIThread.cs index 1a0bb06e4e..e35eccd131 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/UIThread.cs +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/UIThread.cs @@ -21,7 +21,7 @@ using VsShell = Microsoft.VisualStudio.Shell.VsShellUtilities; using System.Diagnostics.CodeAnalysis; -namespace Microsoft.VisualStudio.FSharp.LanguageService +namespace Microsoft.VisualStudio.FSharp.ProjectSystem { internal static class UIThread { diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj b/vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj index 5dd702831e..1c7dc28132 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj @@ -62,6 +62,13 @@ + + + + + + + @@ -73,21 +80,20 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj index 5811cfa232..543bb41c6f 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj @@ -61,15 +61,18 @@ - - - - - - - - - + + + + + + + + + + + + diff --git a/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj b/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj index 8376fc66a7..7093b123e5 100644 --- a/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj +++ b/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj @@ -52,7 +52,6 @@ - @@ -63,22 +62,21 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + diff --git a/vsintegration/tests/GetTypesVSUnitTests/GetTypesVSUnitTests.fs b/vsintegration/tests/GetTypesVSUnitTests/GetTypesVSUnitTests.fs new file mode 100644 index 0000000000..d92edecabe --- /dev/null +++ b/vsintegration/tests/GetTypesVSUnitTests/GetTypesVSUnitTests.fs @@ -0,0 +1,17 @@ +namespace GetTypesVSUnitTests + +open NUnit.Framework +open System.IO +open System.Reflection + +[] +type VerifyUnitTests() = + + [] + member this.GetTypesForVSUnitTests () = + try + let location = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + Assembly.LoadFrom(Path.Combine(location, "VisualFSharp.UnitTests.dll")).GetTypes() |> ignore + with | :? ReflectionTypeLoadException as e -> + let message = e.LoaderExceptions |> Seq.fold (fun (acc:string) e -> acc + (sprintf "TypeLoad failure: %s\n" ) (e.Message) ) "" + Assert.Fail(message) diff --git a/vsintegration/tests/GetTypesVSUnitTests/GetTypesVSUnitTests.fsproj b/vsintegration/tests/GetTypesVSUnitTests/GetTypesVSUnitTests.fsproj new file mode 100644 index 0000000000..275d1a0775 --- /dev/null +++ b/vsintegration/tests/GetTypesVSUnitTests/GetTypesVSUnitTests.fsproj @@ -0,0 +1,26 @@ + + + + + + net46 + Library + true + true + false + true + + + + + + + + + + + + + + + diff --git a/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj b/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj index 9b938e3b8c..c3e8d228ee 100644 --- a/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj +++ b/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj @@ -48,20 +48,21 @@ - - - - - - - - - - - + + + + + + + + + + + + - - + + diff --git a/vsintegration/tests/Salsa/VsMocks.fs b/vsintegration/tests/Salsa/VsMocks.fs index 270c41cfc8..2d8e730490 100644 --- a/vsintegration/tests/Salsa/VsMocks.fs +++ b/vsintegration/tests/Salsa/VsMocks.fs @@ -1630,45 +1630,54 @@ module internal VsActual = // Since the editor exports MEF components, we can use those components directly from unit tests without having to load too many heavy // VS assemblies. Use editor MEF components directly from the VS product. + open System.Reflection open System.IO open System.ComponentModel.Composition.Hosting open System.ComponentModel.Composition.Primitives open Microsoft.VisualStudio.Text + open Microsoft.VisualStudio.Threading + + type TestExportJoinableTaskContext () = + + static let jtc = new JoinableTaskContext() + + [)>] + member public __.JoinableTaskContext : JoinableTaskContext = jtc let vsInstallDir = // use the environment variable to find the VS installdir - let vsvar = System.Environment.GetEnvironmentVariable("VS150COMNTOOLS") - if String.IsNullOrEmpty vsvar then failwith "VS150COMNTOOLS environment variable was not found." + let vsvar = + let var = Environment.GetEnvironmentVariable("VS150COMNTOOLS") + if String.IsNullOrEmpty var then Environment.GetEnvironmentVariable("VSAPPIDDIR") + else var + if String.IsNullOrEmpty vsvar then failwith "VS150COMNTOOLS and VSAPPIDDIR environment variables not found." Path.Combine(vsvar, "..") let CreateEditorCatalog() = - let root = Path.Combine(vsInstallDir, @"IDE\CommonExtensions\Microsoft\Editor") - let CreateAssemblyCatalog(root, file) = - let fullPath = System.IO.Path.Combine(root, file) - if System.IO.File.Exists(fullPath) then + let thisAssembly = Assembly.GetExecutingAssembly().Location + let editorAssemblyDir = Path.Combine(vsInstallDir, @"IDE\CommonExtensions\Microsoft\Editor") + let privateAssemblyDir = Path.Combine(vsInstallDir, @"IDE\PrivateAssemblies") + let publicAssemblyDir = Path.Combine(vsInstallDir, @"IDE\PublicAssemblies") + + let CreateAssemblyCatalog(path, file) = + let fullPath = Path.GetFullPath(Path.Combine(path, file)) + if File.Exists(fullPath) then new AssemblyCatalog(fullPath) else failwith("could not find " + fullPath) let list = new ResizeArray() - list.Add(CreateAssemblyCatalog(root, "Microsoft.VisualStudio.Platform.VSEditor.dll")) - - // Must include this because several editor options are actually stored as exported information - // on this DLL. Including most importantly, the tab size information - list.Add(CreateAssemblyCatalog(root, "Microsoft.VisualStudio.Text.Logic.dll")) - - // Include this DLL to get several more EditorOptions including WordWrapStyle - list.Add(CreateAssemblyCatalog(root, "Microsoft.VisualStudio.Text.UI.dll")) - - // Include this DLL to get more EditorOptions values - list.Add(CreateAssemblyCatalog(root, "Microsoft.VisualStudio.Text.UI.Wpf.dll")) - - // Include this DLL to get more undo operations - //list.Add(CreateAssemblyCatalog(root, "StandaloneUndo.dll")) - //list.Add(CreateAssemblyCatalog(root, "Microsoft.VisualStudio.Language.StandardClassification.dll")) - - // list.Add(CreateAssemblyCatalog(root, "Microsoft.VisualStudio.Text.Internal.dll")) - + list.Add(new AssemblyCatalog(thisAssembly)) + list.Add(CreateAssemblyCatalog(editorAssemblyDir, "Microsoft.VisualStudio.Text.Data.dll")) + list.Add(CreateAssemblyCatalog(editorAssemblyDir, "Microsoft.VisualStudio.Text.Logic.dll")) + list.Add(CreateAssemblyCatalog(privateAssemblyDir, "Microsoft.VisualStudio.Text.Internal.dll")) + list.Add(CreateAssemblyCatalog(editorAssemblyDir, "Microsoft.VisualStudio.Text.UI.dll")) + list.Add(CreateAssemblyCatalog(editorAssemblyDir, "Microsoft.VisualStudio.Text.UI.Wpf.dll")) + list.Add(CreateAssemblyCatalog(privateAssemblyDir, "Microsoft.VisualStudio.Threading.dll")) + list.Add(CreateAssemblyCatalog(editorAssemblyDir, "Microsoft.VisualStudio.Platform.VSEditor.dll")) + list.Add(CreateAssemblyCatalog(editorAssemblyDir, "Microsoft.VisualStudio.Editor.Implementation.dll")) + list.Add(CreateAssemblyCatalog(publicAssemblyDir, "Microsoft.VisualStudio.ComponentModelHost.dll")) + list.Add(CreateAssemblyCatalog(publicAssemblyDir, "Microsoft.VisualStudio.Shell.15.0.dll")) new AggregateCatalog(list) let exportProvider = new CompositionContainer(new AggregateCatalog(CreateEditorCatalog()), true, null) diff --git a/vsintegration/tests/Salsa/salsa.fs b/vsintegration/tests/Salsa/salsa.fs index e2f0c17ab9..1dc4762910 100644 --- a/vsintegration/tests/Salsa/salsa.fs +++ b/vsintegration/tests/Salsa/salsa.fs @@ -147,7 +147,7 @@ module internal Salsa = printfn "build succeeded? %A" buildResult let mainassembly = try - (projectInstance.GetItems("MainAssembly") |> Seq.head).EvaluatedInclude + (projectInstance.GetItems("TargetFileName") |> Seq.head).EvaluatedInclude with e -> "" // TODO it seems like Dev10 "Clean" target does not produce this output, but this result is not consumed by those tests in an interesting way anyway printfn "mainAssembly: %A" mainassembly diff --git a/vsintegration/tests/UnitTests/App.config b/vsintegration/tests/UnitTests/App.config new file mode 100644 index 0000000000..52c9692323 --- /dev/null +++ b/vsintegration/tests/UnitTests/App.config @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vsintegration/tests/UnitTests/AssemblyResolver.fs b/vsintegration/tests/UnitTests/AssemblyResolver.fs new file mode 100644 index 0000000000..e213596b5f --- /dev/null +++ b/vsintegration/tests/UnitTests/AssemblyResolver.fs @@ -0,0 +1,52 @@ +namespace Microsoft.VisualStudio.FSharp + +open NUnit.Framework +open System +open System.IO +open System.Reflection + +module AssemblyResolver = + open System.Globalization + + let vsInstallDir = + // use the environment variable to find the VS installdir + let vsvar = + let var = Environment.GetEnvironmentVariable("VS150COMNTOOLS") + if String.IsNullOrEmpty var then Environment.GetEnvironmentVariable("VSAPPIDDIR") + else var + if String.IsNullOrEmpty vsvar then failwith "VS150COMNTOOLS and VSAPPIDDIR environment variables not found." + Path.Combine(vsvar, "..") + + let probingPaths = [| + Path.Combine(vsInstallDir, @"IDE\CommonExtensions\Microsoft\Editor") + Path.Combine(vsInstallDir, @"IDE\PublicAssemblies") + Path.Combine(vsInstallDir, @"IDE\PrivateAssemblies") + Path.Combine(vsInstallDir, @"IDE\CommonExtensions\Microsoft\ManagedLanguages\VBCSharp\LanguageServices") + Path.Combine(vsInstallDir, @"IDE\Extensions\Microsoft\CodeSense\Framework") + Path.Combine(vsInstallDir, @"IDE") + |] + + let addResolver () = + AppDomain.CurrentDomain.add_AssemblyResolve(fun h args -> + let found () = + (probingPaths ) |> Seq.tryPick(fun p -> + try + let name = AssemblyName(args.Name) + let codebase = Path.GetFullPath(Path.Combine(p, name.Name) + ".dll") + if File.Exists(codebase) then + name.CodeBase <- codebase + name.CultureInfo <- Unchecked.defaultof + name.Version <- Unchecked.defaultof + Some (name) + else None + with | _ -> None + ) + match found() with + | None -> Unchecked.defaultof + | Some name -> Assembly.Load(name) ) + +[] +type public AssemblyResolverTestFixture () = + + [] + member public __.Init () = AssemblyResolver.addResolver () diff --git a/vsintegration/tests/UnitTests/CompletionProviderTests.fs b/vsintegration/tests/UnitTests/CompletionProviderTests.fs index ac9502edc6..5accd920ef 100644 --- a/vsintegration/tests/UnitTests/CompletionProviderTests.fs +++ b/vsintegration/tests/UnitTests/CompletionProviderTests.fs @@ -125,7 +125,8 @@ let VerifyNoCompletionList(fileContents: string, marker: string) = [] let usingDefaultSettings() = SettingsPersistence.setSettings { ShowAfterCharIsTyped = true; ShowAfterCharIsDeleted = false; ShowAllSymbols = true } - + SettingsPersistence.setSettings { EnableInMemoryCrossProjectReferences = true; AllowStaleCompletionResults = true; TimeUntilStaleCompletion = 2000; ProjectCheckCacheSize = 200 } + [] let ShouldTriggerCompletionAtCorrectMarkers() = let testCases = diff --git a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Completion.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Completion.fs index 8135302bcb..a16adb7450 100644 --- a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Completion.fs +++ b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Completion.fs @@ -1268,6 +1268,7 @@ for i in 0..a."] AssertCtrlSpaceCompleteContains code "? y." ["Chars"; "Length"] ["abs"] [] + [] member public this.``Query.ForKeywordCanCompleteIntoIdentifier``() = let code = [ @@ -2069,6 +2070,7 @@ let x = new MyClass2(0) [] [] + [] member public this.``CurriedArguments.Regression1``() = AssertCtrlSpaceCompleteContainsNoCoffeeBreak ["let fffff x y = 1" @@ -6904,6 +6906,7 @@ let rec f l = //Regression test for bug 65740 Fsharp: dot completion is mission after a '#' statement [] + [] member this.``Identifier.In#Statement``() = this.VerifyDotCompListContainAllAtStartOfMarker( fileContents = """ diff --git a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.General.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.General.fs index 7b1abf3f82..ee05cc3bb0 100644 --- a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.General.fs +++ b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.General.fs @@ -115,7 +115,7 @@ type UsingMSBuild() = let lsbase = publicTypesInAsm @"FSharp.LanguageService.Base.dll" Assert.AreEqual(0, lsbase) let psbase = publicTypesInAsm @"FSharp.ProjectSystem.Base.dll" - Assert.AreEqual(19, psbase) + Assert.AreEqual(17, psbase) let fsi = publicTypesInAsm @"FSharp.VS.FSI.dll" Assert.AreEqual(1, fsi) diff --git a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ParameterInfo.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ParameterInfo.fs index 7e3b38e74b..8fe4486f16 100644 --- a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ParameterInfo.fs +++ b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ParameterInfo.fs @@ -1632,6 +1632,7 @@ We really need to rewrite some code paths here to use the real parse tree rather additionalReferenceAssemblies = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")]) [] + [] member public this.``LocationOfParams.TypeProviders.StaticParametersAtConstructorCallSite``() = this.TestParameterInfoLocationOfParamsWithVariousSurroundingContexts(""" let x = new ^N1.T^<^ "fo$o",^ 42 ^>()""", diff --git a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Script.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Script.fs index 5667becef1..57731d6b2e 100644 --- a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Script.fs +++ b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Script.fs @@ -4,6 +4,7 @@ namespace Tests.LanguageService.Script open System open System.IO +open System.Reflection open NUnit.Framework open Salsa.Salsa open Salsa.VsOpsUtils @@ -573,7 +574,7 @@ type UsingMSBuild() as this = [] [] - member public this.``Fsx.NoError.HashR.ResolveFromFullyQualifiedPath``() = + member public this.``Fsx.NoError.HashR.ResolveFromFullyQualifiedPath``() = let fullyqualifiepathtoddll = System.IO.Path.Combine( System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory(), "System.configuration.dll" ) let code = ["#light";"#r @\"" + fullyqualifiepathtoddll + "\""] let (project, _) = createSingleFileFsxFromLines code @@ -581,10 +582,11 @@ type UsingMSBuild() as this = [] [] - member public this.``Fsx.NoError.HashR.RelativePath1``() = - use _guard = this.UsingNewVS() + [] + member public this.``Fsx.NoError.HashR.RelativePath1``() = + use _guard = this.UsingNewVS() let solution = this.CreateSolution() - let project = CreateProject(solution,"testproject") + let project = CreateProject(solution,"testproject") let file1 = AddFileFromText(project,"lib.fs", ["module Lib" "let X = 42" @@ -608,7 +610,7 @@ type UsingMSBuild() as this = let script2 = File.WriteAllLines(script2Path, ["#r \"../lib.exe\"" ]) - + let script1 = OpenFile(project, script1Path) TakeCoffeeBreak(this.VS) @@ -616,17 +618,17 @@ type UsingMSBuild() as this = let ans = GetSquiggleAtCursor(script1) AssertNoSquiggle(ans) - [] - [] + [] + [] member public this.``Fsx.NoError.HashR.RelativePath2``() = use _guard = this.UsingNewVS() let solution = this.CreateSolution() - let project = CreateProject(solution,"testproject") + let project = CreateProject(solution,"testproject") let file1 = AddFileFromText(project,"lib.fs", ["module Lib" "let X = 42" ]) - + let bld = Build(project) let script1Dir = Path.Combine(ProjectDirectory(project), "ccc") @@ -1336,10 +1338,7 @@ type UsingMSBuild() as this = let solution = this.CreateSolution() let project = CreateProject(solution,"testproject") let fsVersion = "10.1.1.0" - let binariesFolder = match Internal.Utilities.FSharpEnvironment.BinFolderOfDefaultFSharpCompiler(None) with - | Some(x) -> x - | None -> failwith "Location of binaries folder cannot be found" - + let binariesFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) PlaceIntoProjectFileBeforeImport (project, sprintf @" diff --git a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.TimeStamp.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.TimeStamp.fs index 4b2be043be..4fdf86bca8 100644 --- a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.TimeStamp.fs +++ b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.TimeStamp.fs @@ -88,6 +88,7 @@ type UsingMSBuild() = // In this bug, the referenced project output didn't exist yet. Building dependee should cause update in dependant [] + [] member public this.``Regression.NoContainedString.Timestamps.Bug3368a``() = use _guard = this.UsingNewVS() let solution = this.CreateSolution() @@ -164,6 +165,7 @@ type UsingMSBuild() = // FEATURE: When a referenced assembly's timestamp changes the reference is reread. [] + [] member public this.``Timestamps.ReferenceAssemblyChangeAbsolute``() = use _guard = this.UsingNewVS() let solution = this.CreateSolution() @@ -198,29 +200,30 @@ type UsingMSBuild() = ["#light" "module File1 = " " let Mary x = \"\""] - SaveFileToDisk file1 - time1 Build project1 "Time to build project1 second time" |> ignore - TakeCoffeeBreak(this.VS) // Give enough time to catch up + SaveFileToDisk file1 + time1 Build project1 "Time to build project1 second time" |> ignore + TakeCoffeeBreak(this.VS) // Give enough time to catch up SwitchToFile this.VS file2 MoveCursorToEndOfMarker(file2,"File1.File1.") - TakeCoffeeBreak(this.VS) // Give enough time to catch up + TakeCoffeeBreak(this.VS) // Give enough time to catch up let completions = AutoCompleteAtCursor(file2) Assert.AreNotEqual(0, completions.Length) printfn "Completions=%A\n" completions - + // In this bug, relative paths to referenced assemblies weren't seen. [] + [] member public this.``Timestamps.ReferenceAssemblyChangeRelative``() = use _guard = this.UsingNewVS() let solution = this.CreateSolution() let project1 = CreateProject(solution,"testproject1") - + let MakeRelativePath(path1:string, path2) = // Pretend to return a path to path1 relative to path2. let temp = (System.IO.Path.GetTempPath()) let tempLen = temp.Length ".."+(path1.Substring(tempLen-1)) - + let file1 = AddFileFromText(project1,"File1.fs", ["#light"] ) @@ -231,14 +234,14 @@ type UsingMSBuild() = "File1.File1." "()"]) let file2 = OpenFile(project2,"File2.fs") - + // Build project1 which will later have the type being referenced by project2 let project1Dll = time1 Build project1 "Time to build project1" printfn "Output of building project1 was %s" project1Dll.ExecutableOutput printfn "Project2 directory is %s" (ProjectDirectory project2) let project1DllRelative = MakeRelativePath(project1Dll.ExecutableOutput, (ProjectDirectory project2)) printfn "Relative output of building project1 was %s" project1DllRelative - + // Add a new reference project2->project1. There should be no completions because Mary doesn't exist yet. this.AddAssemblyReference(project2,project1DllRelative) TakeCoffeeBreak(this.VS) // Dependencies between projects get registered for file-watching during OnIdle processing @@ -246,26 +249,25 @@ type UsingMSBuild() = MoveCursorToEndOfMarker(file2,"File1.File1.") let completions = AutoCompleteAtCursor(file2) Assert.AreEqual(0, completions.Length) - + // Now modify project1's file and rebuild. ReplaceFileInMemory file1 ["#light" "module File1 = " " let Mary x = \"\""] SaveFileToDisk file1 - time1 Build project1 "Time to build project1 second time" |> ignore - TakeCoffeeBreak(this.VS) // Give enough time to catch up + time1 Build project1 "Time to build project1 second time" |> ignore + TakeCoffeeBreak(this.VS) // Give enough time to catch up SwitchToFile this.VS file2 MoveCursorToEndOfMarker(file2,"File1.File1.") - TakeCoffeeBreak(this.VS) // Give enough time to catch up + TakeCoffeeBreak(this.VS) // Give enough time to catch up let completions = AutoCompleteAtCursor(file2) Assert.AreNotEqual(0, completions.Length) - printfn "Completions=%A\n" completions - + printfn "Completions=%A\n" completions // FEATURE: When a referenced project's assembly timestamp changes the reference is reread. - [] - [] + [] + [] member public this.``Timestamps.ProjectReferenceAssemblyChange``() = use _guard = this.UsingNewVS() let solution = this.CreateSolution() diff --git a/vsintegration/tests/UnitTests/TestLib.LanguageService.fs b/vsintegration/tests/UnitTests/TestLib.LanguageService.fs index 9e90d65ae2..35425ae98d 100644 --- a/vsintegration/tests/UnitTests/TestLib.LanguageService.fs +++ b/vsintegration/tests/UnitTests/TestLib.LanguageService.fs @@ -3,6 +3,7 @@ namespace UnitTests.TestLib.LanguageService open System +open System.Reflection open NUnit.Framework open System.Diagnostics open System.IO @@ -247,6 +248,7 @@ type LanguageServiceBaseTests() = let mutable defaultVS : VisualStudio = Unchecked.defaultof<_> let mutable currentVS : VisualStudio = Unchecked.defaultof<_> + (* VsOps is internal, but this type needs to be public *) let mutable ops = BuiltMSBuildTestFlavour() let testStopwatch = new Stopwatch() diff --git a/vsintegration/tests/UnitTests/TestLib.ProjectSystem.fs b/vsintegration/tests/UnitTests/TestLib.ProjectSystem.fs index d8f31256b8..5a3a3f7df0 100644 --- a/vsintegration/tests/UnitTests/TestLib.ProjectSystem.fs +++ b/vsintegration/tests/UnitTests/TestLib.ProjectSystem.fs @@ -26,7 +26,6 @@ open Microsoft.Build.Framework #nowarn "52" // The value has been copied to ensure the original is not mutated open NUnit.Framework - open UnitTests.TestLib.Utils open UnitTests.TestLib.Utils.Asserts open UnitTests.TestLib.Utils.FilesystemHelpers diff --git a/vsintegration/tests/UnitTests/TestLib.Utils.fs b/vsintegration/tests/UnitTests/TestLib.Utils.fs index 378e0ee25b..d4c44696b7 100644 --- a/vsintegration/tests/UnitTests/TestLib.Utils.fs +++ b/vsintegration/tests/UnitTests/TestLib.Utils.fs @@ -5,7 +5,6 @@ namespace UnitTests.TestLib.Utils open System open System.IO open NUnit.Framework - open Microsoft.VisualStudio module Asserts = @@ -53,6 +52,7 @@ module Asserts = module UIStuff = let SetupSynchronizationContext() = Microsoft.VisualStudio.FSharp.LanguageService.UIThread.InitUnitTestingMode() + Microsoft.VisualStudio.FSharp.ProjectSystem.UIThread.InitUnitTestingMode() module FilesystemHelpers = let pid = System.Diagnostics.Process.GetCurrentProcess().Id diff --git a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.dll.config b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.dll.config deleted file mode 100644 index 9215b5d965..0000000000 --- a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.dll.config +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj index 6d6690906a..f788320e82 100644 --- a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj +++ b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj @@ -13,6 +13,7 @@ + Internal.Utilities.Collections.fsi @@ -30,8 +31,8 @@ - CompilerService\FsUnit.fs @@ -104,11 +104,9 @@ Roslyn\SyntacticColorizationServiceTests.fs - Roslyn\BraceMatchingServiceTests.fs @@ -135,11 +133,9 @@ Roslyn\ProjectDiagnosticAnalyzerTests.fs - Roslyn\SignatureHelpProviderTests.fs @@ -154,10 +150,9 @@ Roslyn\DocumentHighlightsServiceTests.fs --> - + - @@ -188,29 +183,36 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + From 21f9ee4662d78da9b853f7a39fe641d02cb1fead Mon Sep 17 00:00:00 2001 From: Will Smith Date: Tue, 3 Jul 2018 13:29:21 -0700 Subject: [PATCH 073/150] Stopped querying for projectId based on path; instead, passing projectId itself. This isolates us from roslyn stuff (#5284) --- .../LanguageService/LanguageService.fs | 10 ++- .../LanguageService/ProjectSitesAndFiles.fs | 67 +++++++++++-------- 2 files changed, 42 insertions(+), 35 deletions(-) diff --git a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs index 8cf6d94af9..8a9ad0170c 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs @@ -149,7 +149,6 @@ type internal FSharpProjectOptionsManager member this.ComputeSingleFileOptions (tryGetOrCreateProjectId, fileName, loadTime, fileContents) = async { let extraProjectInfo = Some(box workspace) - let tryGetOptionsForReferencedProject f = f |> tryGetOrCreateProjectId |> Option.bind this.TryGetOptionsForProject |> Option.map(fun (_, _, projectOptions) -> projectOptions) if SourceFile.MustBeSingleFileProject(fileName) then // NOTE: we don't use a unique stamp for single files, instead comparing options structurally. // This is because we repeatedly recompute the options. @@ -159,12 +158,12 @@ type internal FSharpProjectOptionsManager // compiled and #r will refer to files on disk let referencedProjectFileNames = [| |] let site = ProjectSitesAndFiles.CreateProjectSiteForScript(fileName, referencedProjectFileNames, options) - let deps, projectOptions = ProjectSitesAndFiles.GetProjectOptionsForProjectSite(Settings.LanguageServicePerformance.EnableInMemoryCrossProjectReferences, tryGetOptionsForReferencedProject, site, serviceProvider, (tryGetOrCreateProjectId fileName), fileName, options.ExtraProjectInfo, Some projectOptionsTable) + let deps, projectOptions = ProjectSitesAndFiles.GetProjectOptionsForProjectSite(Settings.LanguageServicePerformance.EnableInMemoryCrossProjectReferences, site, serviceProvider, (tryGetOrCreateProjectId fileName), fileName, options.ExtraProjectInfo, Some projectOptionsTable) let parsingOptions, _ = checkerProvider.Checker.GetParsingOptionsFromProjectOptions(projectOptions) return (deps, parsingOptions, projectOptions) else let site = ProjectSitesAndFiles.ProjectSiteOfSingleFile(fileName) - let deps, projectOptions = ProjectSitesAndFiles.GetProjectOptionsForProjectSite(Settings.LanguageServicePerformance.EnableInMemoryCrossProjectReferences, tryGetOptionsForReferencedProject, site, serviceProvider, (tryGetOrCreateProjectId fileName), fileName, extraProjectInfo, Some projectOptionsTable) + let deps, projectOptions = ProjectSitesAndFiles.GetProjectOptionsForProjectSite(Settings.LanguageServicePerformance.EnableInMemoryCrossProjectReferences, site, serviceProvider, (tryGetOrCreateProjectId fileName), fileName, extraProjectInfo, Some projectOptionsTable) let parsingOptions, _ = checkerProvider.Checker.GetParsingOptionsFromProjectOptions(projectOptions) return (deps, parsingOptions, projectOptions) } @@ -174,8 +173,7 @@ type internal FSharpProjectOptionsManager Logger.Log LogEditorFunctionId.LanguageService_UpdateProjectInfo projectOptionsTable.AddOrUpdateProject(projectId, (fun isRefresh -> let extraProjectInfo = Some(box workspace) - let tryGetOptionsForReferencedProject f = f |> tryGetOrCreateProjectId |> Option.bind this.TryGetOptionsForProject |> Option.map(fun (_, _, projectOptions) -> projectOptions) - let referencedProjects, projectOptions = ProjectSitesAndFiles.GetProjectOptionsForProjectSite(Settings.LanguageServicePerformance.EnableInMemoryCrossProjectReferences, tryGetOptionsForReferencedProject, site, serviceProvider, Some(projectId), site.ProjectFileName, extraProjectInfo, Some projectOptionsTable) + let referencedProjects, projectOptions = ProjectSitesAndFiles.GetProjectOptionsForProjectSite(Settings.LanguageServicePerformance.EnableInMemoryCrossProjectReferences, site, serviceProvider, Some(projectId), site.ProjectFileName, extraProjectInfo, Some projectOptionsTable) if invalidateConfig then checkerProvider.Checker.InvalidateConfiguration(projectOptions, startBackgroundCompileIfAlreadySeen = not isRefresh, userOpName = userOpName + ".UpdateProjectInfo") let referencedProjectIds = referencedProjects |> Array.choose tryGetOrCreateProjectId let parsingOptions, _ = checkerProvider.Checker.GetParsingOptionsFromProjectOptions(projectOptions) @@ -610,7 +608,7 @@ type internal FSharpLanguageService(package : FSharpPackage) = optionsAssociation.Remove(projectContext) |> ignore project.Disconnect())) - for referencedSite in ProjectSitesAndFiles.GetReferencedProjectSites(site, this.SystemServiceProvider, Some (this.Workspace :>obj), Some projectInfoManager.FSharpOptions ) do + for referencedSite in ProjectSitesAndFiles.GetReferencedProjectSites(Some projectId, site, this.SystemServiceProvider, Some (this.Workspace :>obj), Some projectInfoManager.FSharpOptions ) do setup referencedSite setup (siteProvider.GetProjectSite()) diff --git a/vsintegration/src/FSharp.Editor/LanguageService/ProjectSitesAndFiles.fs b/vsintegration/src/FSharp.Editor/LanguageService/ProjectSitesAndFiles.fs index 7697de1890..1bea848dae 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/ProjectSitesAndFiles.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/ProjectSitesAndFiles.fs @@ -221,23 +221,25 @@ type internal ProjectSitesAndFiles() = | _ -> None | Some _ -> None - static let rec referencedProvideProjectSites(projectSite:IProjectSite, serviceProvider:System.IServiceProvider, extraProjectInfo:obj option, projectOptionsTable:FSharpProjectOptionsTable option) = + static let rec referencedProvideProjectSites(projectIdOpt: ProjectId option, projectSite:IProjectSite, serviceProvider:System.IServiceProvider, extraProjectInfo:obj option, projectOptionsTable:FSharpProjectOptionsTable option) = let getReferencesForSolutionService (solutionService:IVsSolution) = [| match referencedProjects projectSite, extraProjectInfo with | None, Some (:? VisualStudioWorkspaceImpl as workspace) when not (isNull workspace.CurrentSolution)-> let path = projectSite.ProjectFileName if not (String.IsNullOrWhiteSpace(path)) then - let projectId = workspace.ProjectTracker.GetOrCreateProjectIdForPath(path, projectDisplayNameOf path) - let project = workspace.CurrentSolution.GetProject(projectId) - if not (isNull project) then - for reference in project.ProjectReferences do - let project = workspace.CurrentSolution.GetProject(reference.ProjectId) - if not (isNull project) && project.Language = FSharpConstants.FSharpLanguageName then - let siteProvider = provideProjectSiteProvider (workspace, project, serviceProvider, projectOptionsTable) - let referenceProject = workspace.ProjectTracker.GetProject(reference.ProjectId) - let outputPath = referenceProject.BinOutputPath - yield Some projectId, project.FilePath, outputPath, siteProvider + match projectIdOpt with + | Some(projectId) -> + let project = workspace.CurrentSolution.GetProject(projectId) + if not (isNull project) then + for reference in project.ProjectReferences do + let project = workspace.CurrentSolution.GetProject(reference.ProjectId) + if not (isNull project) && project.Language = FSharpConstants.FSharpLanguageName then + let siteProvider = provideProjectSiteProvider (workspace, project, serviceProvider, projectOptionsTable) + let referenceProject = workspace.ProjectTracker.GetProject(reference.ProjectId) + let outputPath = referenceProject.BinOutputPath + yield Some project.Id, project.FilePath, outputPath, siteProvider + | _ -> () | (Some references), _ -> for p in references do @@ -255,26 +257,33 @@ type internal ProjectSitesAndFiles() = | None -> () } - static let rec referencedProjectsOf(enableInMemoryCrossProjectReferences, tryGetOptionsForReferencedProject, projectSite, serviceProvider, extraProjectInfo, projectOptionsTable) = - [| for (projectId, projectFileName, outputPath, projectSiteProvider) in referencedProvideProjectSites (projectSite, serviceProvider, extraProjectInfo, projectOptionsTable) do - let referencedProjectOptions = - // Lookup may not succeed if the project has not been established yet - // In this case we go and compute the options recursively. - match tryGetOptionsForReferencedProject projectFileName with - | None -> getProjectOptionsForProjectSite (enableInMemoryCrossProjectReferences, tryGetOptionsForReferencedProject, projectSiteProvider.GetProjectSite(), serviceProvider, projectId, projectFileName, extraProjectInfo, projectOptionsTable) |> snd - | Some options -> options - yield projectFileName, (outputPath, referencedProjectOptions) |] - - and getProjectOptionsForProjectSite(enableInMemoryCrossProjectReferences, tryGetOptionsForReferencedProject, projectSite, serviceProvider, projectId, fileName, extraProjectInfo, projectOptionsTable) = + static let rec referencedProjectsOf(projectIdOpt, projectSite, serviceProvider, extraProjectInfo, projectOptionsTable) = + [| for (projectIdOpt, projectFileName, outputPath, _projectSiteProvider) in referencedProvideProjectSites (projectIdOpt, projectSite, serviceProvider, extraProjectInfo, projectOptionsTable) do + let referencedProjectOptionsOpt = + projectOptionsTable + |> Option.bind (fun x -> + match projectIdOpt with + | Some(projectId) -> x.TryGetOptionsForProject(projectId) + | _ -> None + ) + |> Option.map (fun (_, _, options) -> options) + + match referencedProjectOptionsOpt with + | Some(referencedProjectOptions) -> + yield projectFileName, (outputPath, referencedProjectOptions) + | _ -> () + |] + + and getProjectOptionsForProjectSite(enableInMemoryCrossProjectReferences, projectSite, serviceProvider, projectIdOpt, fileName, extraProjectInfo, projectOptionsTable) = let referencedProjectFileNames, referencedProjectOptions = if enableInMemoryCrossProjectReferences then - referencedProjectsOf(enableInMemoryCrossProjectReferences, tryGetOptionsForReferencedProject, projectSite, serviceProvider, extraProjectInfo, projectOptionsTable) + referencedProjectsOf(projectIdOpt, projectSite, serviceProvider, extraProjectInfo, projectOptionsTable) |> Array.unzip else [| |], [| |] let option = let newOption () = { ProjectFileName = projectSite.ProjectFileName - ProjectId = projectId |> Option.map (fun x -> x.ToFSharpProjectIdString()) + ProjectId = projectIdOpt |> Option.map (fun x -> x.ToFSharpProjectIdString()) SourceFiles = projectSite.CompilationSourceFiles OtherOptions = projectSite.CompilationOptions ReferencedProjects = referencedProjectOptions @@ -286,7 +295,7 @@ type internal ProjectSitesAndFiles() = ExtraProjectInfo=extraProjectInfo Stamp = (stamp <- stamp + 1L; Some stamp) } - match projectId, projectOptionsTable with + match projectIdOpt, projectOptionsTable with | Some id, Some optionsTable -> // Get options from cache match optionsTable.TryGetOptionsForProject(id) with @@ -308,16 +317,16 @@ type internal ProjectSitesAndFiles() = failwith ".fsx or .fsscript should have been treated as implicit project" new ProjectSiteOfSingleFile(filename) :> IProjectSite - static member GetReferencedProjectSites(projectSite:IProjectSite, serviceProvider:System.IServiceProvider, extraProjectInfo, projectOptions) = - referencedProvideProjectSites (projectSite, serviceProvider, extraProjectInfo, projectOptions) + static member GetReferencedProjectSites(projectIdOpt, projectSite:IProjectSite, serviceProvider:System.IServiceProvider, extraProjectInfo, projectOptions) = + referencedProvideProjectSites (projectIdOpt, projectSite, serviceProvider, extraProjectInfo, projectOptions) |> Seq.map (fun (_, _, _, ps) -> ps.GetProjectSite()) |> Seq.toArray /// Create project options for this project site. - static member GetProjectOptionsForProjectSite(enableInMemoryCrossProjectReferences, tryGetOptionsForReferencedProject, projectSite:IProjectSite, serviceProvider, projectId, filename, extraProjectInfo, projectOptionsTable) = + static member GetProjectOptionsForProjectSite(enableInMemoryCrossProjectReferences, projectSite:IProjectSite, serviceProvider, projectId, filename, extraProjectInfo, projectOptionsTable) = match projectSite with | :? IHaveCheckOptions as hco -> hco.OriginalCheckOptions() - | _ -> getProjectOptionsForProjectSite(enableInMemoryCrossProjectReferences, tryGetOptionsForReferencedProject, projectSite, serviceProvider, projectId, filename, extraProjectInfo, projectOptionsTable) + | _ -> getProjectOptionsForProjectSite(enableInMemoryCrossProjectReferences, projectSite, serviceProvider, projectId, filename, extraProjectInfo, projectOptionsTable) /// Create project site for these project options static member CreateProjectSiteForScript (filename, referencedProjectFileNames, checkOptions) = From c10a3deba65a34971b6f9000e02b4d5033a0af24 Mon Sep 17 00:00:00 2001 From: Will Smith Date: Tue, 3 Jul 2018 16:16:49 -0700 Subject: [PATCH 074/150] For..in expr now dereferences byref items (#5285) * For..in expr now dereferences byref items * Fixed misspelling. Return enumElemTy if not a byref * Make it known that this is implicit * Added more tests --- src/fsharp/TypeChecker.fs | 17 ++++++++--- tests/fsharp/core/span/test2.bsl | 12 ++++++++ tests/fsharp/core/span/test2.fsx | 12 ++++++-- tests/fsharp/core/span/test3.bsl | 14 +++++++++ tests/fsharp/core/span/test3.fsx | 51 ++++++++++++++++++++++++++++++++ tests/fsharp/tests.fs | 13 ++++++++ 6 files changed, 112 insertions(+), 7 deletions(-) create mode 100644 tests/fsharp/core/span/test3.bsl create mode 100644 tests/fsharp/core/span/test3.fsx diff --git a/src/fsharp/TypeChecker.fs b/src/fsharp/TypeChecker.fs index 330180dfbe..1f6e64e506 100755 --- a/src/fsharp/TypeChecker.fs +++ b/src/fsharp/TypeChecker.fs @@ -3334,10 +3334,19 @@ let AnalyzeArbitraryExprAsEnumerable cenv (env: TcEnv) localAlloc m exprty expr let getEnumTy = mkRefCellTy cenv.g getEnumTy getEnumExpr, getEnumTy - let guardExpr , guardTy = BuildPossiblyConditionalMethodCall cenv env DefinitelyMutates m false moveNext_minfo NormalValUse moveNext_minst [enumeratorExpr] [] - let currentExpr, currentTy = BuildPossiblyConditionalMethodCall cenv env DefinitelyMutates m true get_Current_minfo NormalValUse get_Current_minst [enumeratorExpr] [] - let betterCurrentExpr = mkCoerceExpr(currentExpr, enumElemTy, currentExpr.Range, currentTy) - Result(enumeratorVar, enumeratorExpr, retTypeOfGetEnumerator, enumElemTy, getEnumExpr, getEnumTy, guardExpr, guardTy, betterCurrentExpr) + let guardExpr , guardTy = BuildPossiblyConditionalMethodCall cenv env DefinitelyMutates m false moveNext_minfo NormalValUse moveNext_minst [enumeratorExpr] [] + let currentExpr, currentTy = BuildPossiblyConditionalMethodCall cenv env DefinitelyMutates m true get_Current_minfo NormalValUse get_Current_minst [enumeratorExpr] [] + let currentExpr = mkCoerceExpr(currentExpr, enumElemTy, currentExpr.Range, currentTy) + let currentExpr, enumElemTy = + // Implicitly dereference byref for expr 'for x in ...' + if isByrefTy cenv.g enumElemTy then + let v, _ = mkCompGenLocal m "byrefReturn" enumElemTy + let expr = mkCompGenLet currentExpr.Range v currentExpr (mkAddrGet m (mkLocalValRef v)) + expr, destByrefTy cenv.g enumElemTy + else + currentExpr, enumElemTy + + Result(enumeratorVar, enumeratorExpr, retTypeOfGetEnumerator, enumElemTy, getEnumExpr, getEnumTy, guardExpr, guardTy, currentExpr) // First try the original known static type match (if isArray1DTy cenv.g exprty then Exception (Failure "") else tryType (expr, exprty)) with diff --git a/tests/fsharp/core/span/test2.bsl b/tests/fsharp/core/span/test2.bsl index 8cec28adac..9fb3e581e9 100644 --- a/tests/fsharp/core/span/test2.bsl +++ b/tests/fsharp/core/span/test2.bsl @@ -52,3 +52,15 @@ test2.fsx(191,43,191,44): typecheck error FS3209: The address of the variable 'x test2.fsx(195,14,195,15): typecheck error FS3209: The address of the variable 'y' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. test2.fsx(199,13,199,19): typecheck error FS3230: This value can't be assigned because the target 'x' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + +test2.fsx(204,26,204,27): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +test2.fsx(204,26,204,27): typecheck error FS0406: The byref-typed variable 'inputSequence' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. + +test2.fsx(204,26,204,27): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +test2.fsx(204,26,204,27): typecheck error FS0425: The type of a first-class function cannot contain byrefs + +test2.fsx(204,26,204,27): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +test2.fsx(204,26,204,27): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. diff --git a/tests/fsharp/core/span/test2.fsx b/tests/fsharp/core/span/test2.fsx index b867c5a0d7..6c3c6c02fc 100644 --- a/tests/fsharp/core/span/test2.fsx +++ b/tests/fsharp/core/span/test2.fsx @@ -188,16 +188,22 @@ namespace Tests #endif - let should_not_work33 (x: int) = &x + let should_not_work23 (x: int) = &x - let should_not_work34 (x: int) = + let should_not_work24 (x: int) = let y = &x &y - let should_not_work35 (x: byref>) = + let should_not_work25 (x: byref>) = let mutable y = Span.Empty x <- y + let should_not_work26 () = + seq { + let s = Span.Empty + for x in s do + yield x + } #endif let should_work1 () = diff --git a/tests/fsharp/core/span/test3.bsl b/tests/fsharp/core/span/test3.bsl new file mode 100644 index 0000000000..da0e0fa6f8 --- /dev/null +++ b/tests/fsharp/core/span/test3.bsl @@ -0,0 +1,14 @@ + +test3.fsx(31,17,31,23): typecheck error FS0027: This value is not mutable. Consider using the mutable keyword, e.g. 'let mutable x = expression'. + +test3.fsx(39,21,39,27): typecheck error FS0027: This value is not mutable. Consider using the mutable keyword, e.g. 'let mutable x = expression'. + +test3.fsx(47,26,47,27): typecheck error FS0001: The type 'Span' is not compatible with the type 'seq<'a>' + +test3.fsx(48,21,48,27): typecheck error FS0027: This value is not mutable. Consider using the mutable keyword, e.g. 'let mutable x = expression'. + +test3.fsx(47,26,47,27): typecheck error FS0193: Type constraint mismatch. The type + 'Span' +is not compatible with type + 'seq<'a>' + diff --git a/tests/fsharp/core/span/test3.fsx b/tests/fsharp/core/span/test3.fsx new file mode 100644 index 0000000000..dc9ff0b299 --- /dev/null +++ b/tests/fsharp/core/span/test3.fsx @@ -0,0 +1,51 @@ +#r @"..\..\..\..\packages\System.Memory.4.5.0-rc1\lib\netstandard2.0\System.Memory.dll" +#r @"..\..\..\..\packages\NETStandard.Library.NETFramework.2.0.0-preview2-25405-01\build\net461\ref\netstandard.dll" + +#nowarn "9" +#nowarn "51" + +namespace System.Runtime.CompilerServices + + open System + open System.Runtime.CompilerServices + open System.Runtime.InteropServices + [] + [] + type IsReadOnlyAttribute() = + inherit System.Attribute() + + [] + [] + type IsByRefLikeAttribute() = + inherit System.Attribute() + +namespace Tests + +open System + +// NOT POST INFERENCE CHECKS +#if NEGATIVE + module ForEachDeferenceSpanElementCheck = + let doSomething (s: Span) = + for x in s do + x <- 5 + () + + module ForEachDereferenceSpanElementSeqCheck = + let doSomething () = + seq { + let s = Span.Empty + for x in s do + x <- 5 + yield x + } + + module ForEachDereferenceSpanElementAsyncCheck = + let doSomething () = + async { + let s = Span.Empty + for x in s do + x <- 5 + () + } +#endif \ No newline at end of file diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index da25595737..824b244aaf 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -250,6 +250,19 @@ module CoreTests = //testOkFile.CheckExists() end + begin + use testOkFile = fileguard cfg "test3.ok" + + fsc cfg "%s -o:test3.exe -g" cfg.fsc_flags ["test3.fsx"] + + singleNegTest cfg "test3" + + // Execution is disabled until we can be sure .NET 4.7.2 is on the machine + //exec cfg ("." ++ "test.exe") "" + + //testOkFile.CheckExists() + end + [] let asyncStackTraces () = let cfg = testConfig "core/asyncStackTraces" From eb57ff50f4f7694d95d466105fdefc0ae63e846d Mon Sep 17 00:00:00 2001 From: Will Smith Date: Sun, 8 Jul 2018 00:19:01 -0700 Subject: [PATCH 075/150] Strip type equations when checking record field types (#5290) * Cherrypicked strip byref * Don't need to do that * Updating baseline --- src/fsharp/PostInferenceChecks.fs | 11 ++++++----- tests/fsharp/core/span/test2.bsl | 8 ++++++++ tests/fsharp/core/span/test2.fsx | 10 ++++++++++ 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/src/fsharp/PostInferenceChecks.fs b/src/fsharp/PostInferenceChecks.fs index 47c958aaa4..8df140f1c7 100644 --- a/src/fsharp/PostInferenceChecks.fs +++ b/src/fsharp/PostInferenceChecks.fs @@ -1809,22 +1809,23 @@ let CheckRecdField isUnion cenv env (tycon:Tycon) (rfield:RecdField) = let g = cenv.g let tcref = mkLocalTyconRef tycon let m = rfield.Range + let fieldTy = stripTyEqns cenv.g rfield.FormalType let isHidden = IsHiddenTycon env.sigToImplRemapInfo tycon || IsHiddenTyconRepr env.sigToImplRemapInfo tycon || (not isUnion && IsHiddenRecdField env.sigToImplRemapInfo (tcref.MakeNestedRecdFieldRef rfield)) let access = AdjustAccess isHidden (fun () -> tycon.CompilationPath) rfield.Accessibility - CheckTypeForAccess cenv env (fun () -> rfield.Name) access m rfield.FormalType + CheckTypeForAccess cenv env (fun () -> rfield.Name) access m fieldTy if TyconRefHasAttribute g m g.attrib_IsByRefLikeAttribute tcref then // Permit Span fields in IsByRefLike types - CheckTypePermitSpanLike cenv env m rfield.FormalType + CheckTypePermitSpanLike cenv env m fieldTy if cenv.reportErrors then - CheckForByrefType cenv env rfield.FormalType (fun () -> errorR(Error(FSComp.SR.chkCantStoreByrefValue(), tycon.Range))) + CheckForByrefType cenv env fieldTy (fun () -> errorR(Error(FSComp.SR.chkCantStoreByrefValue(), tycon.Range))) else - CheckTypeNoByrefs cenv env m rfield.FormalType + CheckTypeNoByrefs cenv env m fieldTy if cenv.reportErrors then - CheckForByrefLikeType cenv env m rfield.FormalType (fun () -> errorR(Error(FSComp.SR.chkCantStoreByrefValue(), tycon.Range))) + CheckForByrefLikeType cenv env m fieldTy (fun () -> errorR(Error(FSComp.SR.chkCantStoreByrefValue(), tycon.Range))) CheckAttribs cenv env rfield.PropertyAttribs CheckAttribs cenv env rfield.FieldAttribs diff --git a/tests/fsharp/core/span/test2.bsl b/tests/fsharp/core/span/test2.bsl index 9fb3e581e9..006788c004 100644 --- a/tests/fsharp/core/span/test2.bsl +++ b/tests/fsharp/core/span/test2.bsl @@ -64,3 +64,11 @@ test2.fsx(204,26,204,27): typecheck error FS0425: The type of a first-class func test2.fsx(204,26,204,27): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. test2.fsx(204,26,204,27): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +test2.fsx(209,13,209,18): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +test2.fsx(208,14,208,18): typecheck error FS0437: A type would store a byref typed value. This is not permitted by Common IL. + +test2.fsx(214,13,214,18): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +test2.fsx(213,14,213,19): typecheck error FS0437: A type would store a byref typed value. This is not permitted by Common IL. diff --git a/tests/fsharp/core/span/test2.fsx b/tests/fsharp/core/span/test2.fsx index 6c3c6c02fc..2cdb4f4c7f 100644 --- a/tests/fsharp/core/span/test2.fsx +++ b/tests/fsharp/core/span/test2.fsx @@ -204,6 +204,16 @@ namespace Tests for x in s do yield x } + + type Nope = { + Funcn : ReadOnlySpan -> int + } + + type FuncType = ReadOnlySpan -> int + type Nope2 = { + Funcn : FuncType + } + #endif let should_work1 () = From fed9b48be2beee420447ef218cf4d4cdc8dba179 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Mon, 9 Jul 2018 00:18:49 -0700 Subject: [PATCH 076/150] Deadlock in QuickInfo, again. Fixes #5254 (#5257) (#5288) * Deadlock in QuickInfo, again. Fixes #5254 (#5257) * call GetService on UI thread * move things around a bit * fix servidceprovider/statusbar --- .../CodeLens/FSharpCodeLensService.fs | 31 ++++++++++++------- .../src/FSharp.Editor/QuickInfo/Navigation.fs | 3 +- .../QuickInfo/QuickInfoProvider.fs | 16 +++++++--- 3 files changed, 32 insertions(+), 18 deletions(-) diff --git a/vsintegration/src/FSharp.Editor/CodeLens/FSharpCodeLensService.fs b/vsintegration/src/FSharp.Editor/CodeLens/FSharpCodeLensService.fs index 26fdbdf360..3dc39e5372 100644 --- a/vsintegration/src/FSharp.Editor/CodeLens/FSharpCodeLensService.fs +++ b/vsintegration/src/FSharp.Editor/CodeLens/FSharpCodeLensService.fs @@ -4,26 +4,32 @@ namespace rec Microsoft.VisualStudio.FSharp.Editor open System +open System.Collections.Generic +open System.Threading +open System.Windows open System.Windows.Controls open System.Windows.Media -open Microsoft.VisualStudio.Text -open Microsoft.VisualStudio.Text.Formatting +open System.Windows.Media.Animation + open Microsoft.CodeAnalysis -open System.Threading -open Microsoft.FSharp.Compiler.SourceCodeServices -open System.Windows -open System.Collections.Generic -open Microsoft.FSharp.Compiler.Range -open Microsoft.FSharp.Compiler -open Microsoft.FSharp.Compiler.Ast open Microsoft.CodeAnalysis.Editor.Shared.Extensions open Microsoft.CodeAnalysis.Editor.Shared.Utilities open Microsoft.CodeAnalysis.Classification -open Internal.Utilities.StructuredFormat -open System.Windows.Media.Animation + +open Microsoft.FSharp.Compiler +open Microsoft.FSharp.Compiler.Ast +open Microsoft.FSharp.Compiler.SourceCodeServices +open Microsoft.FSharp.Compiler.Range open Microsoft.VisualStudio.FSharp.Editor.Logging + +open Microsoft.VisualStudio.Shell.Interop + +open Microsoft.VisualStudio.Text open Microsoft.VisualStudio.Text.Classification +open Microsoft.VisualStudio.Text.Formatting + +open Internal.Utilities.StructuredFormat type internal CodeLens(taggedText, computed, fullTypeSignature, uiElement) = member val TaggedText: Async<(ResizeArray * QuickInfoNavigation) option> = taggedText @@ -172,7 +178,8 @@ type internal FSharpCodeLensService let taggedText = ResizeArray() Layout.renderL (Layout.taggedTextListR taggedText.Add) typeLayout |> ignore - let navigation = QuickInfoNavigation(serviceProvider, checker, projectInfoManager, document, realPosition) + let statusBar = StatusBar(serviceProvider.GetService()) + let navigation = QuickInfoNavigation(statusBar, checker, projectInfoManager, document, realPosition) // Because the data is available notify that this line should be updated, displaying the results return Some (taggedText, navigation) | None -> diff --git a/vsintegration/src/FSharp.Editor/QuickInfo/Navigation.fs b/vsintegration/src/FSharp.Editor/QuickInfo/Navigation.fs index d1904b96cd..09e5d30550 100644 --- a/vsintegration/src/FSharp.Editor/QuickInfo/Navigation.fs +++ b/vsintegration/src/FSharp.Editor/QuickInfo/Navigation.fs @@ -13,7 +13,7 @@ open Microsoft.VisualStudio.Shell.Interop type internal QuickInfoNavigation ( - serviceProvider: IServiceProvider, + statusBar: StatusBar, checker: FSharpChecker, projectInfoManager: FSharpProjectOptionsManager, initialDoc: Document, @@ -22,7 +22,6 @@ type internal QuickInfoNavigation let workspace = initialDoc.Project.Solution.Workspace let solution = workspace.CurrentSolution - let statusBar = StatusBar(serviceProvider.GetService()) member __.IsTargetValid (range: range) = range <> rangeStartup && diff --git a/vsintegration/src/FSharp.Editor/QuickInfo/QuickInfoProvider.fs b/vsintegration/src/FSharp.Editor/QuickInfo/QuickInfoProvider.fs index 69886526e1..c52d1ac120 100644 --- a/vsintegration/src/FSharp.Editor/QuickInfo/QuickInfoProvider.fs +++ b/vsintegration/src/FSharp.Editor/QuickInfo/QuickInfoProvider.fs @@ -159,7 +159,7 @@ module private FSharpQuickInfo = type internal FSharpAsyncQuickInfoSource ( - serviceProvider: IServiceProvider, + statusBar: StatusBar, xmlMemberIndexService: IVsXMLMemberIndexService, checkerProvider:FSharpCheckerProvider, projectInfoManager:FSharpProjectOptionsManager, @@ -186,6 +186,9 @@ type internal FSharpAsyncQuickInfoSource interface IAsyncQuickInfoSource with override __.Dispose() = () // no cleanup necessary + + // This method can be called from the background thread. + // Do not call IServiceProvider.GetService here. override __.GetQuickInfoItemAsync(session:IAsyncQuickInfoSession, cancellationToken:CancellationToken) : Task = let triggerPoint = session.GetTriggerPoint(textBuffer.CurrentSnapshot) match triggerPoint.HasValue with @@ -211,7 +214,7 @@ type internal FSharpAsyncQuickInfoSource let mainDescription, documentation, typeParameterMap, usage, exceptions = ResizeArray(), ResizeArray(), ResizeArray(), ResizeArray(), ResizeArray() XmlDocumentation.BuildDataTipText(documentationBuilder, mainDescription.Add, documentation.Add, typeParameterMap.Add, usage.Add, exceptions.Add, quickInfo.StructuredText) let imageId = Tokenizer.GetImageIdForSymbol(quickInfo.Symbol, quickInfo.SymbolKind) - let navigation = QuickInfoNavigation(serviceProvider, checkerProvider.Checker, projectInfoManager, document, symbolUse.RangeAlternate) + let navigation = QuickInfoNavigation(statusBar, checkerProvider.Checker, projectInfoManager, document, symbolUse.RangeAlternate) let docs = joinWithLineBreaks [documentation; typeParameterMap; usage; exceptions] let content = QuickInfoViewProvider.provideContent(imageId, mainDescription, docs, navigation) let span = getTrackingSpan quickInfo.Span @@ -242,7 +245,7 @@ type internal FSharpAsyncQuickInfoSource ] |> ResizeArray let docs = joinWithLineBreaks [documentation; typeParameterMap; usage; exceptions] let imageId = Tokenizer.GetImageIdForSymbol(targetQuickInfo.Symbol, targetQuickInfo.SymbolKind) - let navigation = QuickInfoNavigation(serviceProvider, checkerProvider.Checker, projectInfoManager, document, symbolUse.RangeAlternate) + let navigation = QuickInfoNavigation(statusBar, checkerProvider.Checker, projectInfoManager, document, symbolUse.RangeAlternate) let content = QuickInfoViewProvider.provideContent(imageId, mainDescription, docs, navigation) let span = getTrackingSpan targetQuickInfo.Span return QuickInfoItem(span, content) @@ -260,6 +263,11 @@ type internal FSharpAsyncQuickInfoSourceProvider checkerProvider:FSharpCheckerProvider, projectInfoManager:FSharpProjectOptionsManager ) = + interface IAsyncQuickInfoSourceProvider with override __.TryCreateQuickInfoSource(textBuffer:ITextBuffer) : IAsyncQuickInfoSource = - new FSharpAsyncQuickInfoSource(serviceProvider, serviceProvider.XMLMemberIndexService, checkerProvider, projectInfoManager, textBuffer) :> IAsyncQuickInfoSource + // GetService calls must be made on the UI thread + // It is safe to do it here (see #4713) + let statusBar = StatusBar(serviceProvider.GetService()) + let xmlMemberIndexService = serviceProvider.XMLMemberIndexService + new FSharpAsyncQuickInfoSource(statusBar, xmlMemberIndexService, checkerProvider, projectInfoManager, textBuffer) :> IAsyncQuickInfoSource From 2a268a50cf86c80e5016c82acbed8080d9e64319 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Mon, 9 Jul 2018 21:47:22 -0700 Subject: [PATCH 077/150] More vside unit tests (#5289) * More vside unit tests * re-enable this one too * Update VisualFSharp.UnitTests.fsproj * saved * Revert "re-enable this one too" This reverts commit b300a941390808978376ee69055f923ab21c9a44. * AssemblyResolution * TestFixture * more ide tests * QuickInfoProviderTests.fs --- RoslynPackageVersion.txt | 2 +- build/targets/PackageVersions.props | 1 - tests/service/MultiProjectAnalysisTests.fs | 3 --- .../bin/Debug/TypeProvidersBug.dll | Bin 7168 -> 7168 bytes .../src/FSharp.Editor/FSharp.Editor.fsproj | 1 - .../tests/UnitTests/QuickInfoProviderTests.fs | 22 ++++++++++++++---- .../UnitTests/VisualFSharp.UnitTests.fsproj | 7 +++--- 7 files changed, 21 insertions(+), 15 deletions(-) diff --git a/RoslynPackageVersion.txt b/RoslynPackageVersion.txt index 834f262953..1817afea41 100644 --- a/RoslynPackageVersion.txt +++ b/RoslynPackageVersion.txt @@ -1 +1 @@ -2.8.0 +2.8.2 diff --git a/build/targets/PackageVersions.props b/build/targets/PackageVersions.props index 63137a9172..ff243657ac 100644 --- a/build/targets/PackageVersions.props +++ b/build/targets/PackageVersions.props @@ -12,7 +12,6 @@ $(RoslynPackageVersion) $(RoslynPackageVersion) - $(RoslynPackageVersion) $(RoslynPackageVersion) $(RoslynPackageVersion) diff --git a/tests/service/MultiProjectAnalysisTests.fs b/tests/service/MultiProjectAnalysisTests.fs index f5049122b0..0e4d38a332 100644 --- a/tests/service/MultiProjectAnalysisTests.fs +++ b/tests/service/MultiProjectAnalysisTests.fs @@ -1020,7 +1020,4 @@ let ``Projects creating generated types should not utilize cross-project-referen printfn "Errors: %A" fileCheckResults.Errors fileCheckResults.Errors |> Array.exists (fun error -> error.Severity = FSharpErrorSeverity.Error) |> shouldEqual false - - - //------------------------------------------------------------------------------------ diff --git a/tests/service/data/TypeProvidersBug/TypeProvidersBug/bin/Debug/TypeProvidersBug.dll b/tests/service/data/TypeProvidersBug/TypeProvidersBug/bin/Debug/TypeProvidersBug.dll index 8e73750a869b0d40371e5942c91d606235bdef78..1ef8b4ae875d80ea5f0b4cb5b0d3a4665357c5ba 100644 GIT binary patch delta 255 zcmZp$Xt0>j!BVK;5WTTy4U-rz0|NsS1A|~OkYH17U}j)o;nHH*?8jWjDF9OBm$}w& zxhr!sh`sp=PXQyN_+(c;ZGm8CtC-N@)S}{;?9{T%yrRkVe6jp7KtTvMF|Rm3cQT`Z z(_}sVME(R!arqd>;^NfYq?}66ytI71wBi6%HJcd)l9@Iq2~A_P16d7pCCHf!9Y8E# w1jHf?3_-yz!7npE^Ly?6j!SW~AD{^Dc8YVG51_lNu1_nWfVj#(;+Q7`fz`~`q*^jx5QvjsMFLSNm za#!YN5PS0#o&rWj$;qyK+WbMzRxzQ)sYS&xDaDn!sgoP{Vg+J>V(ytG9;Hc8!T*Fu6h?cHg+RA~9LLZJ!~#Y@EW*GL6zmeb-|INb ki5LGJyAHpYqI+)dEJmO_nn{y^c5ki_naa4CPwW#b06Ak&<^TWy diff --git a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj index 806fed2a6a..333077ce01 100644 --- a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj +++ b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj @@ -126,7 +126,6 @@ - diff --git a/vsintegration/tests/UnitTests/QuickInfoProviderTests.fs b/vsintegration/tests/UnitTests/QuickInfoProviderTests.fs index 8e54e1ea02..d14747fffa 100644 --- a/vsintegration/tests/UnitTests/QuickInfoProviderTests.fs +++ b/vsintegration/tests/UnitTests/QuickInfoProviderTests.fs @@ -1,4 +1,7 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. +// ------------------------------------------------------------------------------------------------------------------------ +// // To run the tests in this file: // // Technique 1: Compile VisualFSharp.UnitTests.dll and run it as a set of unit tests @@ -17,21 +20,30 @@ // Technique 3: // // Use F# Interactive. This only works for FSharp.Compiler.Private.dll which has a public API +// +// ------------------------------------------------------------------------------------------------------------------------ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -[] -module Microsoft.VisualStudio.FSharp.Editor.Tests.Roslyn.QuickInfoProviderTests -open System +namespace Microsoft.VisualStudio.FSharp.Editor.Tests.Roslyn +open System open NUnit.Framework +open Microsoft.VisualStudio.FSharp + +[] +type public AssemblyResolverTestFixture () = + + [] + member public __.Init () = AssemblyResolver.addResolver () + +[] +module QuickInfoProviderTests = open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Text open Microsoft.VisualStudio.FSharp.Editor open Microsoft.FSharp.Compiler.SourceCodeServices open UnitTests.TestLib.LanguageService - let filePath = "C:\\test.fs" let internal projectOptions = { diff --git a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj index f788320e82..c6f3b3b912 100644 --- a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj +++ b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj @@ -32,7 +32,6 @@ - @@ -110,7 +109,7 @@ Roslyn\BraceMatchingServiceTests.fs - Roslyn\DocumentHighlightsServiceTests.fs ---> From 2d69a90a05b22a9b5f932c031ac49423a7ddb1f1 Mon Sep 17 00:00:00 2001 From: John Wostenberg Date: Tue, 10 Jul 2018 15:08:58 -0600 Subject: [PATCH 078/150] Remove a duplicated sentence (#5320) --- CONTRIBUTING.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a124c86e51..5299179bd0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -68,8 +68,6 @@ Contributions to this repository will be rigorously policed for quality. All code submissions should be submitted with regression test cases, and will be subject to peer review by the community and Microsoft. The bar for contributions will be high. This will result in a higher-quality, more stable product. -- We expect contributors to be actively involved in quality assurance. -- We expect contributors to be actively involved in quality assurance. - We expect contributors to be actively involved in quality assurance. - Partial, incomplete, or poorly-tested contributions will not be accepted. - Contributions may be put on hold according to stability, testing, and design-coherence requirements. From 6329b764480b1a7ddb5cb90a572415411cd94792 Mon Sep 17 00:00:00 2001 From: John Wostenberg Date: Tue, 10 Jul 2018 15:10:41 -0600 Subject: [PATCH 079/150] Delete duplicate CoC (#5322) The correct one is [here](https://github.com/Microsoft/visualfsharp/blob/6c6de72d154a550732dd1ce818f64ad75fee843c/CODE_OF_CONDUCT.md) --- code | 46 ---------------------------------------------- 1 file changed, 46 deletions(-) delete mode 100644 code diff --git a/code b/code deleted file mode 100644 index a22238d717..0000000000 --- a/code +++ /dev/null @@ -1,46 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at opensource@microsoft.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] - -[homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ From 5fa399e5979d7a3eaa91e3b1e9715b20a84151bf Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Wed, 11 Jul 2018 00:07:56 -0700 Subject: [PATCH 080/150] Fixes #1559 --- Ensure that Legacy Project System Consistently sets SolutionDir etc .... (#4419) * issue 1559 * passes * feedback * RoslynPackageVersion.txt --- RoslynPackageVersion.txt | 2 +- .../Project/ProjectFactory.cs | 112 +++++++++++++++++- .../Project/ProjectNode.cs | 67 +++++++---- .../Project/Utilities.cs | 10 +- .../Tests.ProjectSystem.Miscellaneous.fs | 22 +++- .../tests/UnitTests/TestLib.ProjectSystem.fs | 2 +- 6 files changed, 176 insertions(+), 39 deletions(-) diff --git a/RoslynPackageVersion.txt b/RoslynPackageVersion.txt index 1817afea41..834f262953 100644 --- a/RoslynPackageVersion.txt +++ b/RoslynPackageVersion.txt @@ -1 +1 @@ -2.8.2 +2.8.0 diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectFactory.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectFactory.cs index c251312af8..e254b442ad 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectFactory.cs +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectFactory.cs @@ -22,9 +22,9 @@ namespace Microsoft.VisualStudio.FSharp.ProjectSystem internal abstract class ProjectFactory : Microsoft.VisualStudio.Shell.Flavor.FlavoredProjectFactoryBase , IVsProjectUpgradeViaFactory, IVsProjectUpgradeViaFactory4 - { - private Microsoft.VisualStudio.Shell.Package package; - private System.IServiceProvider site; + { + private Microsoft.VisualStudio.Shell.Package package; + private System.IServiceProvider site; private Microsoft.Build.Evaluation.ProjectCollection buildEngine; private Microsoft.Build.Evaluation.Project buildProject; @@ -112,6 +112,46 @@ protected override void CreateProject(string fileName, string location, string n } } + // Solution properties + IVsSolution solution = this.Site.GetService(typeof(SVsSolution)) as IVsSolution; + Debug.Assert(solution != null, "Could not retrieve the solution service from the global service provider"); + + // We do not want to throw. If we cannot set the solution related constants we set them to empty string. + string solutionDirectory, solutionPath, userOptionsFile; + solution.GetSolutionInfo(out solutionDirectory, out solutionPath, out userOptionsFile); + if (solutionDirectory == null) + { + solutionDirectory = String.Empty; + } + if (solutionPath == null) + { + solutionPath = String.Empty; + } + string solutionFileName = (solutionPath.Length == 0) ? String.Empty : Path.GetFileName(solutionPath); + string solutionName = (solutionPath.Length == 0) ? String.Empty : Path.GetFileNameWithoutExtension(solutionPath); + var solutionExtension = Path.GetExtension(solutionPath); + + // DevEnvDir property + IVsShell shell = this.Site.GetService(typeof(SVsShell)) as IVsShell; + Debug.Assert(shell != null, "Could not retrieve the IVsShell service from the global service provider"); + object installDirAsObject; + + // We do not want to throw. If we cannot set the solution related constants we set them to empty string. + shell.GetProperty((int)__VSSPROPID.VSSPROPID_InstallDirectory, out installDirAsObject); + string installDir = ((string)installDirAsObject); + if (String.IsNullOrEmpty(installDir)) + { + installDir = String.Empty; + } + else + { + // Ensure that we have trailing backslash as this is done for the langproj macros too. + if (installDir[installDir.Length - 1] != Path.DirectorySeparatorChar) + { + installDir += Path.DirectorySeparatorChar; + } + } + // Get the list of GUIDs from the project/template string guidsList = this.ProjectTypeGuids(fileName); @@ -119,7 +159,9 @@ protected override void CreateProject(string fileName, string location, string n IVsCreateAggregateProject aggregateProjectFactory = (IVsCreateAggregateProject)this.Site.GetService(typeof(SVsCreateAggregateProject)); int hr = aggregateProjectFactory.CreateAggregateProject(guidsList, fileName, location, name, flags, ref projectGuid, out project); if (hr == VSConstants.E_ABORT) + { canceled = 1; + } ErrorHandler.ThrowOnFailure(hr); this.buildProject = null; @@ -146,6 +188,67 @@ protected override object PreCreateForOuter(IntPtr outerProjectIUnknown) return node; } + internal Microsoft.Build.Evaluation.Project ReinitializeMsBuildProject(string filename) + { + // Solution properties + IVsSolution solution = this.Site.GetService(typeof(SVsSolution)) as IVsSolution; + Debug.Assert(solution != null, "Could not retrieve the solution service from the global service provider"); + + // We do not want to throw.If we cannot set the solution related constants we set them to empty string. + string solutionDirectory, solutionPath, userOptionsFile; + solution.GetSolutionInfo(out solutionDirectory, out solutionPath, out userOptionsFile); + if (solutionDirectory == null) + { + solutionDirectory = String.Empty; + } + if (solutionPath == null) + { + solutionPath = String.Empty; + } + string solutionFileName = (solutionPath.Length == 0) ? String.Empty : Path.GetFileName(solutionPath); + string solutionName = (solutionPath.Length == 0) ? String.Empty : Path.GetFileNameWithoutExtension(solutionPath); + string solutionExtension = String.Empty; + if (solutionPath.Length > 0 && Path.HasExtension(solutionPath)) + { + solutionExtension = Path.GetExtension(solutionPath); + } + + //DevEnvDir property + IVsShell shell = this.Site.GetService(typeof(SVsShell)) as IVsShell; + Debug.Assert(shell != null, "Could not retrieve the IVsShell service from the global service provider"); + object installDirAsObject; + + //We do not want to throw.If we cannot set the solution related constants we set them to empty string. + shell.GetProperty((int)__VSSPROPID.VSSPROPID_InstallDirectory, out installDirAsObject); + string installDir = ((string)installDirAsObject); + if (String.IsNullOrEmpty(installDir)) + { + installDir = String.Empty; + } + else + { + //Ensure that we have trailing backslash as this is done for the langproj macros too. + if (installDir[installDir.Length - 1] != Path.DirectorySeparatorChar) + { + installDir += Path.DirectorySeparatorChar; + } + } + + var projectGlobalPropertiesThatAllProjectSystemsMustSet = new Dictionary() + { + { GlobalProperty.SolutionDir.ToString(), solutionDirectory }, + { GlobalProperty.SolutionPath.ToString(), solutionPath }, + { GlobalProperty.SolutionFileName.ToString(), solutionFileName }, + { GlobalProperty.SolutionName.ToString(), solutionName }, + { GlobalProperty.SolutionExt.ToString(), solutionExtension }, + { GlobalProperty.BuildingInsideVisualStudio.ToString(), "true" }, + { GlobalProperty.Configuration.ToString(), "" }, + { GlobalProperty.Platform.ToString(), "" }, + { GlobalProperty.DevEnvDir.ToString(), installDir } + }; + return Utilities.ReinitializeMsBuildProject(this.buildEngine, filename, projectGlobalPropertiesThatAllProjectSystemsMustSet, this.buildProject); + } + /// /// Retrives the list of project guids from the project file. /// If you don't want your project to be flavorable, override @@ -158,7 +261,7 @@ protected override string ProjectTypeGuids(string file) { // Load the project so we can extract the list of GUIDs - this.buildProject = Utilities.ReinitializeMsBuildProject(this.buildEngine, file, this.buildProject); + this.buildProject = this.ReinitializeMsBuildProject(file); // Retrieve the list of GUIDs, if it is not specify, make it our GUID string guids = buildProject.GetPropertyValue(ProjectFileConstants.ProjectTypeGuids); @@ -168,7 +271,6 @@ protected override string ProjectTypeGuids(string file) return guids; } - private class ProjectInspector { private Microsoft.Build.Construction.ProjectRootElement xmlProj; diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectNode.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectNode.cs index 42b44da990..98de635963 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectNode.cs +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectNode.cs @@ -589,10 +589,10 @@ public enum EventTriggering /// private Dictionary catidMapping = new Dictionary(); - /// - /// The public package implementation. - /// - private ProjectPackage package; + /// + /// The public package implementation. + /// + private ProjectPackage package; private bool isDisposed; @@ -1945,17 +1945,17 @@ public virtual void Load(string fileName, string location, string name, uint fla this.ProjectMgr = this; this.isNewProject = false; - if ((flags & (uint)__VSCREATEPROJFLAGS.CPF_CLONEFILE) == (uint)__VSCREATEPROJFLAGS.CPF_CLONEFILE) - { - // we need to generate a new guid for the project - this.projectIdGuid = Guid.NewGuid(); - } - else - { - this.SetProjectGuidFromProjectFile(false); - } + if ((flags & (uint)__VSCREATEPROJFLAGS.CPF_CLONEFILE) == (uint)__VSCREATEPROJFLAGS.CPF_CLONEFILE) + { + // we need to generate a new guid for the project + this.projectIdGuid = Guid.NewGuid(); + } + else + { + this.SetProjectGuidFromProjectFile(false); + } - this.buildEngine = Utilities.InitializeMsBuildEngine(this.buildEngine); + this.buildEngine = Utilities.InitializeMsBuildEngine(this.buildEngine); // based on the passed in flags, this either reloads/loads a project, or tries to create a new one // now we create a new project... we do that by loading the template and then saving under a new name @@ -1967,7 +1967,7 @@ public virtual void Load(string fileName, string location, string name, uint fla this.isNewProject = true; // This should be a very fast operation if the build project is already initialized by the Factory. - SetBuildProject(Utilities.ReinitializeMsBuildProject(this.buildEngine, fileName, this.buildProject)); + SetBuildProject(Utilities.ReinitializeMsBuildProject(this.buildEngine, fileName, this.ProjectGlobalPropertiesThatAllProjectSystemsMustSet, this.buildProject)); // Compute the file name @@ -2876,7 +2876,7 @@ public virtual void Reload() this.isClosed = false; this.eventTriggeringFlag = ProjectNode.EventTriggering.DoNotTriggerHierarchyEvents | ProjectNode.EventTriggering.DoNotTriggerTrackerEvents; - SetBuildProject(Utilities.ReinitializeMsBuildProject(this.buildEngine, this.filename, this.buildProject)); + SetBuildProject(Utilities.ReinitializeMsBuildProject(this.buildEngine, this.filename, this.ProjectGlobalPropertiesThatAllProjectSystemsMustSet, this.buildProject)); // Load the guid this.SetProjectGuidFromProjectFile(true); @@ -3099,20 +3099,22 @@ internal virtual BuildResult InvokeMsBuild(string target, IEnumerable ProjectGlobalPropertiesThatAllProjectSystemsMustSet { get; set; } + void SetupProjectGlobalPropertiesThatAllProjectSystemsMustSet() { // Much of the code for this method is stolen from GlobalPropertyHandler.cs. That file is dev-9 only; // whereas this code is for dev10 and specific to the actual contract for project systems in dev10. UIThread.MustBeCalledFromUIThread(); - + // Solution properties IVsSolution solution = this.Site.GetService(typeof(SVsSolution)) as IVsSolution; Debug.Assert(solution != null, "Could not retrieve the solution service from the global service provider"); - string solutionDirectory, solutionFile, userOptionsFile; + string solutionDirectory, solutionPath, userOptionsFile; // We do not want to throw. If we cannot set the solution related constants we set them to empty string. - solution.GetSolutionInfo(out solutionDirectory, out solutionFile, out userOptionsFile); + solution.GetSolutionInfo(out solutionDirectory, out solutionPath, out userOptionsFile); if (solutionDirectory == null) { @@ -3120,24 +3122,24 @@ void SetupProjectGlobalPropertiesThatAllProjectSystemsMustSet() } - if (solutionFile == null) + if (solutionPath == null) { - solutionFile = String.Empty; + solutionPath = String.Empty; } - string solutionFileName = (solutionFile.Length == 0) ? String.Empty : Path.GetFileName(solutionFile); + string solutionFileName = (solutionPath.Length == 0) ? String.Empty : Path.GetFileName(solutionPath); - string solutionName = (solutionFile.Length == 0) ? String.Empty : Path.GetFileNameWithoutExtension(solutionFile); + string solutionName = (solutionPath.Length == 0) ? String.Empty : Path.GetFileNameWithoutExtension(solutionPath); string solutionExtension = String.Empty; - if (solutionFile.Length > 0 && Path.HasExtension(solutionFile)) + if (solutionPath.Length > 0 && Path.HasExtension(solutionPath)) { - solutionExtension = Path.GetExtension(solutionFile); + solutionExtension = Path.GetExtension(solutionPath); } this.buildProject.SetGlobalProperty(GlobalProperty.SolutionDir.ToString(), solutionDirectory); - this.buildProject.SetGlobalProperty(GlobalProperty.SolutionPath.ToString(), solutionFile); + this.buildProject.SetGlobalProperty(GlobalProperty.SolutionPath.ToString(), solutionPath); this.buildProject.SetGlobalProperty(GlobalProperty.SolutionFileName.ToString(), solutionFileName); this.buildProject.SetGlobalProperty(GlobalProperty.SolutionName.ToString(), solutionName); this.buildProject.SetGlobalProperty(GlobalProperty.SolutionExt.ToString(), solutionExtension); @@ -3172,6 +3174,19 @@ void SetupProjectGlobalPropertiesThatAllProjectSystemsMustSet() } this.buildProject.SetGlobalProperty(GlobalProperty.DevEnvDir.ToString(), installDir); + + this.ProjectGlobalPropertiesThatAllProjectSystemsMustSet = new Dictionary() + { + { GlobalProperty.SolutionDir.ToString(), solutionDirectory }, + { GlobalProperty.SolutionPath.ToString(), solutionPath }, + { GlobalProperty.SolutionFileName.ToString(), solutionFileName }, + { GlobalProperty.SolutionName.ToString(), solutionName }, + { GlobalProperty.SolutionExt.ToString(), solutionExtension }, + { GlobalProperty.BuildingInsideVisualStudio.ToString(), "true" }, + { GlobalProperty.Configuration.ToString(), "" }, + { GlobalProperty.Platform.ToString(), "" }, + { GlobalProperty.DevEnvDir.ToString(), installDir } + }; } private class BuildAccessorAccess diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Utilities.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Utilities.cs index 09ab592784..b638c4c69f 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Utilities.cs +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Utilities.cs @@ -719,7 +719,7 @@ public static string SetStringValueFromConvertedEnum(T enumValue, CultureInfo /// The build engine to use to create a build project. /// The full path of the project. /// A loaded msbuild project. - public static Microsoft.Build.Evaluation.Project InitializeMsBuildProject(Microsoft.Build.Evaluation.ProjectCollection buildEngine, string fullProjectPath) + public static Microsoft.Build.Evaluation.Project InitializeMsBuildProject(Microsoft.Build.Evaluation.ProjectCollection buildEngine, string fullProjectPath, IDictionary globalProperties) { if (buildEngine == null) { @@ -738,11 +738,11 @@ public static Microsoft.Build.Evaluation.Project InitializeMsBuildProject(Micros if (buildProject == null) { - var globalProperties = new Dictionary() + var lclGlobalProperties = (null == globalProperties) ? new Dictionary() : new Dictionary(globalProperties) { { "FSharpCompilerPath", Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) } }; - buildProject = buildEngine.LoadProject(fullProjectPath, globalProperties, null); + buildProject = buildEngine.LoadProject(fullProjectPath, lclGlobalProperties, null); buildProject.IsBuildEnabled = true; } @@ -756,7 +756,7 @@ public static Microsoft.Build.Evaluation.Project InitializeMsBuildProject(Micros /// The full path of the project. /// An Existing build project that will be reloaded. /// A loaded msbuild project. - public static Microsoft.Build.Evaluation.Project ReinitializeMsBuildProject(Microsoft.Build.Evaluation.ProjectCollection buildEngine, string fullProjectPath, Microsoft.Build.Evaluation.Project exitingBuildProject) + public static Microsoft.Build.Evaluation.Project ReinitializeMsBuildProject(Microsoft.Build.Evaluation.ProjectCollection buildEngine, string fullProjectPath, IDictionary globalProperties, Microsoft.Build.Evaluation.Project exitingBuildProject) { // If we have a build project that has been loaded with another file unload it. try @@ -772,7 +772,7 @@ public static Microsoft.Build.Evaluation.Project ReinitializeMsBuildProject(Micr { } - return Utilities.InitializeMsBuildProject(buildEngine, fullProjectPath); + return Utilities.InitializeMsBuildProject(buildEngine, fullProjectPath, globalProperties); } public static Microsoft.Build.Evaluation.ProjectCollection InitializeMsBuildEngine(Microsoft.Build.Evaluation.ProjectCollection existingEngine) diff --git a/vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.Miscellaneous.fs b/vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.Miscellaneous.fs index d8fbe01d50..1f5dfff205 100644 --- a/vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.Miscellaneous.fs +++ b/vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.Miscellaneous.fs @@ -122,7 +122,7 @@ type Miscellaneous() = printfn "here1" let buildEngine = Utilities.InitializeMsBuildEngine(null) printfn "here2" - let buildProject = Utilities.InitializeMsBuildProject(buildEngine, fsproj) + let buildProject = Utilities.InitializeMsBuildProject(buildEngine, fsproj, null) printfn "here3" let package = new FSharpProjectPackage() let project = new UnitTestingFSharpProjectNode(package) @@ -428,7 +428,10 @@ type Miscellaneous() = [] member public this.``BuildMacroValues`` () = + let logger (message:string) = System.IO.File.AppendAllText(@"c:\temp\logfile.txt", (message + Environment.NewLine)) + DoWithTempFile "MyAssembly.fsproj" (fun file -> + File.AppendAllText(file, TheTests.FsprojTextWithProjectReferences([],[],[],"")) let sp, cnn = VsMocks.MakeMockServiceProviderAndConfigChangeNotifier() use project = TheTests.CreateProject(file, "false", cnn, sp) @@ -438,6 +441,23 @@ type Miscellaneous() = let targetDir = project.GetBuildMacroValue("TargetDir") let expectedTargetDir = Path.Combine(Path.GetDirectoryName(file), @"bin\Debug\") AssertEqual expectedTargetDir targetDir + + // Verify Solution values + let solutionDir = project.GetBuildMacroValue("SolutionDir") + Assert.IsNotNull (solutionDir, "SolutionDir is NULL") + Assert.IsFalse ( (solutionDir = "*Undefined*"), "SolutionDir not defined") + + let solutionFileName = project.GetBuildMacroValue("SolutionFileName") + Assert.IsNotNull (solutionFileName, "SolutionFileName is null") + Assert.IsFalse ( (solutionFileName = "*Undefined*"), "SolutionFileName not defined") + + let solutionName = project.GetBuildMacroValue("SolutionName") + Assert.IsNotNull (solutionName, "SolutionName is null") + Assert.IsFalse ( (solutionName = "*Undefined*"), "SolutionName not defined") + + let solutionExt = project.GetBuildMacroValue("SolutionExt") + Assert.IsNotNull (solutionExt, "SolutionExt is null") + Assert.IsFalse ( (solutionExt = "*Undefined*"), "SolutionExt not defined") ) [] diff --git a/vsintegration/tests/UnitTests/TestLib.ProjectSystem.fs b/vsintegration/tests/UnitTests/TestLib.ProjectSystem.fs index 5a3a3f7df0..0cd346e131 100644 --- a/vsintegration/tests/UnitTests/TestLib.ProjectSystem.fs +++ b/vsintegration/tests/UnitTests/TestLib.ProjectSystem.fs @@ -122,7 +122,7 @@ type TheTests() = static member internal CreateProject(filename : string, forceUTF8 : string, configChangeNotifier, serviceProvider) = UIStuff.SetupSynchronizationContext() let buildEngine = Utilities.InitializeMsBuildEngine(null) - let buildProject = Utilities.InitializeMsBuildProject(buildEngine, filename) + let buildProject = Utilities.InitializeMsBuildProject(buildEngine, filename, null) let package = new FSharpProjectPackage() let project = new UnitTestingFSharpProjectNode(package) try From 27e137e0d37d91e9198866978f95eed63e08fa21 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Wed, 11 Jul 2018 00:31:35 -0700 Subject: [PATCH 081/150] RoslynPackageVersion.txt (#5324) From f7f7eb04be87d724e773651bc2bcd4794e3fb4bf Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Wed, 11 Jul 2018 19:42:38 -0700 Subject: [PATCH 082/150] A few more ignores (#5328) --- fcs/.gitignore | 1 + tests/fsharp/core/.gitignore | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/fcs/.gitignore b/fcs/.gitignore index 176f453284..51023f1bf5 100644 --- a/fcs/.gitignore +++ b/fcs/.gitignore @@ -1,3 +1,4 @@ +FSharp.Compiler.Service.Tests/TestResults/* FSharp.Compiler.Service.netstandard/illex.fs FSharp.Compiler.Service.netstandard/ilpars.fs FSharp.Compiler.Service.netstandard/ilpars.fsi diff --git a/tests/fsharp/core/.gitignore b/tests/fsharp/core/.gitignore index ef1245a3e0..49d72838fd 100644 --- a/tests/fsharp/core/.gitignore +++ b/tests/fsharp/core/.gitignore @@ -9,6 +9,9 @@ tmptest1.exe access/fsc.cmd.args +byrefs/*.err +byrefs/*.vserr + fsi-reference/ImplementationAssembly/ReferenceAssemblyExample.dll fsi-reference/ReferenceAssembly/ReferenceAssemblyExample.dll @@ -49,6 +52,9 @@ quotesInMultipleModules/module2-opt.exe resources/Resources.resources +span/*.err +span/*.vserr + topinit/app69514.exe topinit/app69514.pdb topinit/app69514-noopt.exe From 247ea87234aa76043459ab0422f75f96fed00664 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Wed, 11 Jul 2018 21:24:28 -0700 Subject: [PATCH 083/150] Add ms.ca.ef.wpf (#5331) --- build/targets/PackageVersions.props | 1 + vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj | 1 + 2 files changed, 2 insertions(+) diff --git a/build/targets/PackageVersions.props b/build/targets/PackageVersions.props index ff243657ac..63137a9172 100644 --- a/build/targets/PackageVersions.props +++ b/build/targets/PackageVersions.props @@ -12,6 +12,7 @@ $(RoslynPackageVersion) $(RoslynPackageVersion) + $(RoslynPackageVersion) $(RoslynPackageVersion) $(RoslynPackageVersion) diff --git a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj index 333077ce01..806fed2a6a 100644 --- a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj +++ b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj @@ -126,6 +126,7 @@ + From c2da5fc972f85da83b8a431063837a89fa660456 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbyn=C4=9Bk=20Sailer?= Date: Thu, 12 Jul 2018 16:44:45 +0200 Subject: [PATCH 084/150] LOC CHECKIN | Microsoft/visualfsharp dev15.8 | 20180712 --- src/fsharp/xlf/FSComp.txt.cs.xlf | 38 +++++----- src/fsharp/xlf/FSComp.txt.de.xlf | 38 +++++----- src/fsharp/xlf/FSComp.txt.es.xlf | 38 +++++----- src/fsharp/xlf/FSComp.txt.fr.xlf | 38 +++++----- src/fsharp/xlf/FSComp.txt.it.xlf | 38 +++++----- src/fsharp/xlf/FSComp.txt.ja.xlf | 76 +++++++++---------- src/fsharp/xlf/FSComp.txt.ko.xlf | 38 +++++----- src/fsharp/xlf/FSComp.txt.pl.xlf | 38 +++++----- src/fsharp/xlf/FSComp.txt.pt-BR.xlf | 38 +++++----- src/fsharp/xlf/FSComp.txt.ru.xlf | 38 +++++----- src/fsharp/xlf/FSComp.txt.tr.xlf | 38 +++++----- src/fsharp/xlf/FSComp.txt.zh-Hans.xlf | 38 +++++----- src/fsharp/xlf/FSComp.txt.zh-Hant.xlf | 38 +++++----- .../FSharp.Editor/xlf/FSharp.Editor.cs.xlf | 2 +- .../FSharp.Editor/xlf/FSharp.Editor.de.xlf | 2 +- .../FSharp.Editor/xlf/FSharp.Editor.es.xlf | 2 +- .../FSharp.Editor/xlf/FSharp.Editor.fr.xlf | 2 +- .../FSharp.Editor/xlf/FSharp.Editor.it.xlf | 2 +- .../FSharp.Editor/xlf/FSharp.Editor.ja.xlf | 2 +- .../FSharp.Editor/xlf/FSharp.Editor.ko.xlf | 2 +- .../FSharp.Editor/xlf/FSharp.Editor.pl.xlf | 2 +- .../FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf | 2 +- .../FSharp.Editor/xlf/FSharp.Editor.ru.xlf | 2 +- .../FSharp.Editor/xlf/FSharp.Editor.tr.xlf | 2 +- .../xlf/FSharp.Editor.zh-Hans.xlf | 2 +- .../xlf/FSharp.Editor.zh-Hant.xlf | 2 +- .../xlf/VSPackage.cs.xlf | 12 +-- .../xlf/VSPackage.de.xlf | 14 ++-- .../xlf/VSPackage.es.xlf | 12 +-- .../xlf/VSPackage.fr.xlf | 12 +-- .../xlf/VSPackage.it.xlf | 24 +++--- .../xlf/VSPackage.ja.xlf | 20 ++--- .../xlf/VSPackage.ko.xlf | 18 ++--- .../xlf/VSPackage.pl.xlf | 16 ++-- .../xlf/VSPackage.pt-BR.xlf | 12 +-- .../xlf/VSPackage.ru.xlf | 12 +-- .../xlf/VSPackage.tr.xlf | 18 ++--- .../xlf/VSPackage.zh-Hans.xlf | 18 ++--- .../xlf/VSPackage.zh-Hant.xlf | 18 ++--- .../src/FSharp.UIResources/xlf/Strings.cs.xlf | 24 +++--- .../src/FSharp.UIResources/xlf/Strings.de.xlf | 24 +++--- .../src/FSharp.UIResources/xlf/Strings.es.xlf | 26 +++---- .../src/FSharp.UIResources/xlf/Strings.fr.xlf | 26 +++---- .../src/FSharp.UIResources/xlf/Strings.it.xlf | 24 +++--- .../src/FSharp.UIResources/xlf/Strings.ja.xlf | 24 +++--- .../src/FSharp.UIResources/xlf/Strings.ko.xlf | 24 +++--- .../src/FSharp.UIResources/xlf/Strings.pl.xlf | 24 +++--- .../FSharp.UIResources/xlf/Strings.pt-BR.xlf | 24 +++--- .../src/FSharp.UIResources/xlf/Strings.ru.xlf | 26 +++---- .../src/FSharp.UIResources/xlf/Strings.tr.xlf | 24 +++--- .../xlf/Strings.zh-Hans.xlf | 26 +++---- .../xlf/Strings.zh-Hant.xlf | 24 +++--- 52 files changed, 542 insertions(+), 542 deletions(-) diff --git a/src/fsharp/xlf/FSComp.txt.cs.xlf b/src/fsharp/xlf/FSComp.txt.cs.xlf index 5995b43cd9..2790a73ff0 100644 --- a/src/fsharp/xlf/FSComp.txt.cs.xlf +++ b/src/fsharp/xlf/FSComp.txt.cs.xlf @@ -109,7 +109,7 @@ All branches of a pattern match expression must return values of the same type. The first branch returned a value of type '{0}', but this branch returned a value of type '{1}'. - Všechny větve výrazu porovnání vzorů musí mít stejný typ. Očekávalo se, že tento výraz bude mít typ {0}, ale tady je typu {1}. + Všechny větve výrazu porovnání vzorů musí vracet hodnoty stejného typu. První větev vrátila hodnotu typu {0}, ale tato větev vrátila hodnotu typu {1}. @@ -5434,7 +5434,7 @@ The attribute {0} specified version '{1}', but this value is invalid and has been ignored - Třída {0} definovala verzi {1}, ale tato hodnota není platná a ignoruje se. + Atribut {0} určoval verzi {1}, ale tato hodnota není platná a ignoruje se. @@ -6974,7 +6974,7 @@ Used in computation expressions to pattern match directly over the result of another computation expression. - Used in computation expressions to pattern match directly over the result of another computation expression. + Používá se ve výrazech výpočtu k přímému porovnání vzorů s výsledkem jiného výrazu výpočtu. @@ -6984,82 +6984,82 @@ The byref pointer is readonly, so this write is not permitted. - The byref pointer is readonly, so this write is not permitted. + Ukazatel byref je jen pro čtení, proto tento zápis není povolený. A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' - A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + Hodnota musí být proměnlivá, aby se dal změnit obsah nebo aby se dala převzít adresa typu hodnoty, třeba let mutable x = ... A ReadOnly attribute has been applied to a struct type with a mutable field. - A ReadOnly attribute has been applied to a struct type with a mutable field. + Atribut ReadOnly byl použit na typ struktury s měnitelným (proměnlivým) polem. A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. - A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + Přes ukazatel byref vrácený funkcí nebo metodou se ve výchozím nastavení přistupuje od verze F# 4.5. Pokud chcete získat vrácenou hodnotu jako ukazatel, použijte operátor address-of, např. &f(x) nebo &obj.Method(arg1, arg2). A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. - A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + Typ s přidanou poznámkou IsByRefLike musí být také struktura. Bylo by vhodné přidat do typu atribut [<Struct>]. The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + Adresa proměnné {0} nebo související výraz nejde v tomto bodě použít. Je tím zajištěno, aby adresa lokální hodnoty neunikla ze svého rozsahu. The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + Výraz Span nebo IsByRefLike nejde vrátit z této funkce nebo metody, protože se skládá pomocí elementů, které můžou uniknout ze svého rozsahu. This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. - This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + Tuto hodnotu nejde přiřadit, protože cíl {0} může odkazovat na paměť, která nepoužívá lokální zásobník (non-stack-local), zatímco přiřazovaný výraz je vyhodnocený tak, že může případně odkazovat na paměť s lokálním zásobníkem (stack-local). Díky tomu se zabraňuje, aby ukazatele na paměť svázanou se zásobníkem (stack-bound) unikly ze svého rozsahu. A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' - A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + Hodnot definovaná v modulu musí být měnitelná, aby se mohla převzít její adresa, např. let mutable x = ... A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. - A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + Typ s přidanou poznámkou IsReadOnly musí být také struktura. Bylo by vhodné přidat do typu atribut [<Struct>]. Struct members cannot return the address of fields of the struct by reference - Struct members cannot return the address of fields of the struct by reference + Členové struktury nemůžou vrátit adresu polí struktury podle odkazu. The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. - The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + Volání funkce nebo metody nejde v tomto bodě použít, protože jeden argument, který je byref typu Span nebo IsByRefLike, který nepoužívá lokální zásobník (non-stack-local), je použitý s jiným argumentem, který je typu Span nebo IsByRefLike, který používá lokální zásobník (stack-local). Je tím zajištěno, aby adresa lokální hodnoty neunikla ze svého rozsahu. The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + Adresa hodnoty vrácené z výrazu nejde v tomto bodě použít. Je tím zajištěno, aby adresa lokální hodnoty neunikla ze svého rozsahu. The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + Proměnná Span nebo IsByRefLike {0} nejde v tomto bodě použít. Je tím zajištěno, aby adresa lokální hodnoty neunikla ze svého rozsahu. A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. - A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + Hodnota Span nebo IsByRefLike vrácená z výrazu nejde v tomto bodě použít. Je tím zajištěno, aby adresa lokální hodnoty neunikla ze svého rozsahu. Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. - Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + Adresa hodnoty vrácená výrazem nejde převzít. Před převzetím adresy přiřaďte vrácenou hodnotu hodnotě s vazbou na klauzuli Let. diff --git a/src/fsharp/xlf/FSComp.txt.de.xlf b/src/fsharp/xlf/FSComp.txt.de.xlf index af1afbbe44..330b8a9c15 100644 --- a/src/fsharp/xlf/FSComp.txt.de.xlf +++ b/src/fsharp/xlf/FSComp.txt.de.xlf @@ -109,7 +109,7 @@ All branches of a pattern match expression must return values of the same type. The first branch returned a value of type '{0}', but this branch returned a value of type '{1}'. - Alle Branches eines Musterabgleichsausdrucks müssen den gleichen Typ aufweisen. Es wurde erwartet, dass dieser Ausdruck den Typ "{0}" aufweist, hier liegt aber der Typ "{1}" vor. + Alle Branches eines Musterübereinstimmungsausdrucks müssen Werte des gleichen Typs zurückgeben. Der erste Branch hat einen Wert vom Typ "{0}" zurückgegeben, aber dieser Branch gab einen Wert vom Typ "{1}" zurück. @@ -5434,7 +5434,7 @@ The attribute {0} specified version '{1}', but this value is invalid and has been ignored - Ein {0} gab Version '{1}' an, dieser Wert ist jedoch ungültig und wurde ignoriert. + Das Attribut "{0}" hat Version "{1}" angegeben, dieser Wert ist jedoch ungültig und wurde ignoriert. @@ -6974,7 +6974,7 @@ Used in computation expressions to pattern match directly over the result of another computation expression. - Used in computation expressions to pattern match directly over the result of another computation expression. + Wird in Berechnungsausdrücken zur Musterübereinstimmung direkt über dem Ergebnis eines anderen Berechnungsausdrucks verwendet. @@ -6984,82 +6984,82 @@ The byref pointer is readonly, so this write is not permitted. - The byref pointer is readonly, so this write is not permitted. + Der byref-Zeiger ist schreibgeschützt, daher ist dieser Schreibvorgang unzulässig. A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' - A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + Ein Wert muss änderbar sein, um die Inhalte eines Werttyps zu mutieren oder seine Adresse zu übernehmen, z.B. "let mutable x = ...". A ReadOnly attribute has been applied to a struct type with a mutable field. - A ReadOnly attribute has been applied to a struct type with a mutable field. + Auf einen Strukturtyp mit einem veränderbaren Feld wurde ein ReadOnly-Attribut angewendet. A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. - A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + Ein von einer Funktion oder Methode zurückgegebener byref-Zeiger wird ab F# 4.5 implizit dereferenziert. Um den Rückgabewert als Zeiger abzurufen, verwenden Sie den Operator "address-of", z. B. "&f(x)" oder "&obj.Method(arg1, arg2)". A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. - A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + Ein Typ mit der Anmerkung "IsByRefLike" muss auch eine Struktur sein. Ziehen Sie in Betracht, dem Typ das Attribut "[<Struct>]" hinzuzufügen. The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + Die Adresse der Variablen "{0}" oder ein entsprechender Ausdruck kann zu diesem Zeitpunkt nicht verwendet werden. Hierdurch wird sichergestellt, dass die Adresse des lokalen Werts den zugehörigen Bereich nicht verlässt. The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + Der Ausdruck "Span" oder "IsByRefLike" kann von dieser Funktion oder Methode nicht zurückgegeben werden, weil er anhand von Elementen zusammengestellt wurde, die möglicherweise ihren Bereich verlassen. This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. - This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + Dieser Wert kann nicht zugewiesen werden, weil das Ziel "{0}" möglicherweise auf einen lokalen Nicht-Stapel-Arbeitsspeicher verweist, während der zugewiesene Ausdruck laut Auswertung möglicherweise auf einen lokalen Stapelarbeitsspeicher verweist. So wird verhindert, dass Zeiger auf stapelgebundenen Arbeitsspeicher ihren Bereich verlassen. A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' - A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + Ein in einem Modul definierter Wert muss änderbar sein, um die Adresse anzunehmen, z. B. "let mutable x = ...". A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. - A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + Ein Typ mit der Anmerkung "IsReadOnly" muss auch eine Struktur sein. Ziehen Sie in Betracht, dem Typ das Attribut "[<Struct>]" hinzuzufügen. Struct members cannot return the address of fields of the struct by reference - Struct members cannot return the address of fields of the struct by reference + Strukturmember können die Adresse von Feldern der Struktur nicht per Referenz zurückgeben. The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. - The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + Der Funktions- oder Methodenaufruf kann zu diesem Zeitpunkt nicht verwendet werden, weil ein Argument, das ein byref-Zeiger eines lokalen Nicht-Stapel-Span- oder -IsByRefLike-Typs ist, mit einem anderen Argument verwendet wird, das ein lokaler Stapel-Span oder -IsByRefLike-Typ ist. Hierdurch wird sichergestellt, dass die Adresse des lokalen Werts den zugehörigen Bereich nicht verlässt. The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + Die Adresse eines vom Ausdruck zurückgegebenen Werts kann zu diesem Zeitpunkt nicht verwendet werden. Hierdurch wird sichergestellt, dass die Adresse des lokalen Werts den zugehörigen Bereich nicht verlässt. The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + Die Span- oder IsByRefLike-Variable "{0}" kann zu diesem Zeitpunkt nicht verwendet werden. Hierdurch wird sichergestellt, dass die Adresse des lokalen Werts den zugehörigen Bereich nicht verlässt. A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. - A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + Ein vom Ausdruck zurückgegebener Span- oder IsByRefLike-Wert kann zu diesem Zeitpunkt nicht verwendet werden. Hierdurch wird sichergestellt, dass die Adresse des lokalen Werts den zugehörigen Bereich nicht verlässt. Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. - Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + Die Adresse des über den Ausdruck zurückgegebenen Werts kann nicht abgerufen werden. Weisen Sie den zurückgegebenen Wert einem let-bound-Wert zu, bevor Sie die Adresse abrufen. diff --git a/src/fsharp/xlf/FSComp.txt.es.xlf b/src/fsharp/xlf/FSComp.txt.es.xlf index c567986449..b5b5847fcf 100644 --- a/src/fsharp/xlf/FSComp.txt.es.xlf +++ b/src/fsharp/xlf/FSComp.txt.es.xlf @@ -109,7 +109,7 @@ All branches of a pattern match expression must return values of the same type. The first branch returned a value of type '{0}', but this branch returned a value of type '{1}'. - Todas las ramas de una expresión de coincidencia de patrones deben tener el mismo tipo. Se esperaba que esta expresión tuviera el tipo "{0}", pero aquí tiene el tipo "{1}". + Todas las ramas de una expresión de coincidencia de patrón deben devolver valores del mismo tipo. La primera rama devolvió un valor de tipo "{0}", pero esta rama devolvió un valor de tipo "\{1 \}". @@ -5434,7 +5434,7 @@ The attribute {0} specified version '{1}', but this value is invalid and has been ignored - Un {0} ha especificado la versión "{1}", pero este valor no es válido y se ha omitido + El atributo {0} ha especificado la versión "{1}", pero este valor no es válido y se ha omitido @@ -6974,7 +6974,7 @@ Used in computation expressions to pattern match directly over the result of another computation expression. - Used in computation expressions to pattern match directly over the result of another computation expression. + Se utiliza en expresiones de cálculo para hacer coincidir patrones directamente sobre el resultado de otra expresión de cálculo. @@ -6984,82 +6984,82 @@ The byref pointer is readonly, so this write is not permitted. - The byref pointer is readonly, so this write is not permitted. + El puntero byref es de solo lectura, por lo que no se permite esta operación de escritura. A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' - A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + Un valor debe ser mutable para poder mutar el contenido o tomar la dirección de un tipo de valor; por ejemplo, 'let mutable x = ...' A ReadOnly attribute has been applied to a struct type with a mutable field. - A ReadOnly attribute has been applied to a struct type with a mutable field. + Se ha aplicado el atributo ReadOnly a un tipo de estructura con un campo mutable. A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. - A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + A partir de F# 4.5, un puntero byref devuelto por una función o un método se desreferencia de forma implícita. Para obtener el valor devuelto en forma de puntero, use el operador address-of; por ejemplo, “&f(x)” o “&obj.Method(arg1, arg2)”. A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. - A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + Un tipo anotado con IsByRefLike debe ser también una estructura. Considere la posibilidad de agregar el atributo [<Struct>] al tipo. The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + En este punto, no se puede usar la dirección de la variable “{0}” o una expresión relacionada. Esto es para asegurar que la dirección del valor local no escape de su ámbito. The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + Esta función o este método no puede devolver la expresión Span o IsByRefLike, porque está compuesta por elementos que pueden escapar de su ámbito. This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. - This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + No se puede asignar este valor porque el destino “{0}” puede hacer referencia a memoria local fuera de la pila, mientras que la expresión que se va a asignar podría hacer referencia a memoria local de la pila. Esto es para evitar que los punteros de memoria ligada a la pila escapen de su ámbito. A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' - A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + Un valor definido en un módulo debe ser mutable para tomar su dirección; por ejemplo, “let mutable x = ...” A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. - A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + Un tipo anotado con IsReadOnly debe ser también una estructura. Considere la posibilidad de agregar el atributo [<Struct>] al tipo. Struct members cannot return the address of fields of the struct by reference - Struct members cannot return the address of fields of the struct by reference + Los miembros de estructura no pueden devolver la dirección de los campos de la estructura por referencia The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. - The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + En este punto, no se puede usar la función o el método, porque un argumento que es un parámetro byref de un tipo local Span o IsByRefLike fuera de la pila se utiliza con otro argumento que es un tipo local Span o IsByRefLike de la pila. Esto es para asegurar que la dirección del valor local no escape de su ámbito. The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + En este punto, no se puede usar la dirección de un valor devuelto por la expresión. Esto es para asegurar que la dirección del valor local no escape de su ámbito. The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + En este punto, no se puede usar la variable Span o IsByRefLike “{0}”. Esto es para asegurar que la dirección del valor local no escape de su ámbito. A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. - A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + En este punto, no se puede usar un valor Span o IsByRefLike devuelto por la expresión. Esto es para asegurar que la dirección del valor local no escape de su ámbito. Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. - Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + No se puede tomar la dirección del valor devuelto de la expresión. Asigne el valor devuelto a un valor enlazado con let antes de tomar la dirección. diff --git a/src/fsharp/xlf/FSComp.txt.fr.xlf b/src/fsharp/xlf/FSComp.txt.fr.xlf index d83b9d47e6..5e170980a8 100644 --- a/src/fsharp/xlf/FSComp.txt.fr.xlf +++ b/src/fsharp/xlf/FSComp.txt.fr.xlf @@ -109,7 +109,7 @@ All branches of a pattern match expression must return values of the same type. The first branch returned a value of type '{0}', but this branch returned a value of type '{1}'. - Toutes les branches d'une expression comportant des critères spéciaux doivent avoir le même type. Cette expression était censée avoir le type '{0}', mais elle a ici le type '{1}'. + Toutes les branches d'une expression comportant des critères spéciaux doivent retourner des valeurs du même type. La première branche a retourné une valeur de type '{0}', mais cette branche a retourné une valeur de type '{1}'. @@ -5434,7 +5434,7 @@ The attribute {0} specified version '{1}', but this value is invalid and has been ignored - Un {0} a spécifié la version '{1}', mais cette valeur n'est pas valide et a été ignorée + L'attribut {0} a spécifié la version '{1}', mais cette valeur est non valide et a été ignorée @@ -6974,7 +6974,7 @@ Used in computation expressions to pattern match directly over the result of another computation expression. - Used in computation expressions to pattern match directly over the result of another computation expression. + Permet dans les expressions de calcul d'appliquer directement des critères spéciaux au résultat d'une autre expression de calcul. @@ -6984,82 +6984,82 @@ The byref pointer is readonly, so this write is not permitted. - The byref pointer is readonly, so this write is not permitted. + Le pointeur byref étant en lecture seule, cette écriture n'est pas autorisée. A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' - A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + Une valeur doit être mutable pour pouvoir muter le contenu ou accepter l'adresse d'un type valeur, par exemple 'let mutable x = ...' A ReadOnly attribute has been applied to a struct type with a mutable field. - A ReadOnly attribute has been applied to a struct type with a mutable field. + Un attribut ReadOnly a été appliqué à un type struct avec un champ mutable. A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. - A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + Un pointeur byref retourné par une fonction ou une méthode est déréférencé implicitement à compter de F# 4.5. Pour acquérir la valeur de retour comme pointeur, utilisez l'opérateur &. Par exemple : '&f(x)' ou '&obj.Method(arg1, arg2)'. A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. - A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + Un type annoté avec IsByRefLike doit également être un struct. Ajoutez l'attribut [<Struct>] au type. The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + L'adresse de la variable '{0}' ou une expression associée ne peut pas être utilisée à ce stade. Cela permet de s'assurer que l'adresse de la valeur locale ne sort pas de sa portée. The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + L'expression Span ou IsByRefLike ne peut pas être retournée à partir de cette fonction ou méthode, car elle est composée d'éléments qui peuvent sortir de leur portée. This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. - This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + Impossible d’affecter cette valeur car la cible '{0}' peut faire référence à une mémoire non locale (hors de la pile), tandis que l'expression en cours d’affectation est évaluée comme faisant potentiellement référence à une mémoire locale (dans la pile). Cela permet d'éviter que les pointeurs vers la mémoire liée à la pile ne sortent de leur portée. A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' - A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + Une valeur définie dans un module doit être mutable pour prendre son adresse. Par exemple : 'let mutable x = ...'. A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. - A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + Un type annoté avec IsReadOnly doit également être un struct. Ajoutez l'attribut [<Struct>] au type. Struct members cannot return the address of fields of the struct by reference - Struct members cannot return the address of fields of the struct by reference + Les membres du struct ne peuvent pas retourner l'adresse des champs du struct par référence The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. - The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + Impossible d’utiliser l'appel de fonction ou de méthode à ce stade, car un argument qui est un byref d'un type Span ou IsByRefLike non local (hors de la pile) est utilisé avec un autre argument de type Span ou IsByRefLike local (dans la pile). Cela permet d'éviter que l'adresse de la valeur locale ne sorte de sa portée. The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + L'adresse d'une valeur retournée par l'expression ne peut pas être utilisée à ce stade. Cela permet d'éviter que l'adresse de la valeur locale ne sorte de sa portée. The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + Impossible d’utiliser la variable Span ou IsByRefLike '{0}' à ce stade. Cela permet d'éviter que l'adresse de la valeur locale ne sorte de sa portée. A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. - A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + Impossible d’utiliser une valeur Span ou IsByRefLike retournée par l'expression à ce stade. Cela permet d'éviter que l'adresse de la valeur locale ne sorte de sa portée. Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. - Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + Impossible de prendre l'adresse de la valeur retournée par l'expression. Assignez la valeur retournée à une valeur liée à let avant de prendre l'adresse. diff --git a/src/fsharp/xlf/FSComp.txt.it.xlf b/src/fsharp/xlf/FSComp.txt.it.xlf index f75360e700..27fe33fcc3 100644 --- a/src/fsharp/xlf/FSComp.txt.it.xlf +++ b/src/fsharp/xlf/FSComp.txt.it.xlf @@ -109,7 +109,7 @@ All branches of a pattern match expression must return values of the same type. The first branch returned a value of type '{0}', but this branch returned a value of type '{1}'. - Il tipo di tutti i rami di un'espressione di criteri di ricerca deve essere lo stesso. Il tipo previsto di questa espressione è '{0}', ma quello effettivo è '{1}'. + Tutti i rami di un'espressione di criteri di ricerca devono restituire valori dello stesso tipo. Il primo ramo ha restituito un valore di tipo '{0}', ma questo ramo ha restituito un valore di tipo '{1}'. @@ -5434,7 +5434,7 @@ The attribute {0} specified version '{1}', but this value is invalid and has been ignored - Un oggetto {0} ha specificato la versione '{1}', ma questo valore non è valido ed è stato ignorato + L'attributo {0} ha specificato la versione '{1}', ma questo valore non è valido ed è stato ignorato @@ -6974,7 +6974,7 @@ Used in computation expressions to pattern match directly over the result of another computation expression. - Used in computation expressions to pattern match directly over the result of another computation expression. + Usata nelle espressioni di calcolo per includere direttamente nei criteri di ricerca il risultato di un'altra espressione di calcolo. @@ -6984,82 +6984,82 @@ The byref pointer is readonly, so this write is not permitted. - The byref pointer is readonly, so this write is not permitted. + Il puntatore byref è di sola lettura, di conseguenza questa operazione di scrittura non è consentita. A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' - A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + Un valore deve essere modificabile per poter modificare i contenuti oppure utilizzare l'indirizzo di un tipo di valore, ad esempio 'let mutable x = ...' A ReadOnly attribute has been applied to a struct type with a mutable field. - A ReadOnly attribute has been applied to a struct type with a mutable field. + Un attributo ReadOnly è stato applicato a un tipo struct con campo modificabile. A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. - A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + Un puntatore byref restituito da una funzione o da un metodo è deferenziato in modo implicito a partire da F# 4.5. Per acquisire il valore restituito come puntatore, usare l'operatore address-of, ad esempio '&f(x)' o '&obj.Method(arg1, arg2)'. A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. - A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + Un tipo annotato con IsByRefLike deve essere anche uno struct. Provare ad aggiungere l'attributo [<Struct>] al tipo. The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + In questo punto non è possibile usare l'indirizzo della variabile '{0}' o un'espressione correlata. Questo serve ad assicurare che l'indirizzo del valore locale non ignori il relativo ambito. The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + Questa funzione o questo metodo non può restituire l'espressione Span o IsByRefLike perché è composta usando elementi che potrebbero ignorare il relativo ambito. This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. - This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + Non è possibile assegnare questo valore perché l'elemento '{0}' di destinazione può fare riferimento alla memoria locale non stack, mentre l'espressione da assegnare viene valutata in modo da fare potenzialmente riferimento alla memoria locale stack. Tale comportamento consente di evitare puntatori a memoria associata allo stack che ignorano il relativo ambito. A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' - A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + Un valore definito in un modulo deve essere modificabile per poterne accettare l'indirizzo, ad esempio 'let mutable x = ...' A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. - A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + Un tipo annotato con IsReadOnly deve essere anche uno struct. Provare ad aggiungere l'attributo [<Struct>] al tipo. Struct members cannot return the address of fields of the struct by reference - Struct members cannot return the address of fields of the struct by reference + I membri struct non possono restituire l'indirizzo di campi dello struct per riferimento The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. - The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + In questo punto non è possibile usare la chiamata al metodo o alla funzione perché un argomento che è un byref di un tipo Span o IsByRefLike locale non stack viene usato con un altro argomento che è un tipo Span o IsByRefLike locale stack. Questo serve ad assicurare che l'indirizzo del valore locale non ignori il relativo ambito. The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + In questo punto non è possibile usare l'indirizzo di un valore restituito dall'espressione. Questo serve ad assicurare che l'indirizzo del valore locale non ignori il relativo ambito. The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + In questo punto non è possibile usare la variabile '{0}' di Span o IsByRefLike. Questo serve ad assicurare che l'indirizzo del valore locale non ignori il relativo ambito. A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. - A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + In questo punto non è possibile usare un valore Span o IsByRefLike restituito dall'espressione. Questo serve ad assicurare che l'indirizzo del valore locale non ignori il relativo ambito. Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. - Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + Non è possibile accettare l'indirizzo del valore restituito dall'espressione. Assegnare il valore restituito a un valore associato a let prima di accettare l'indirizzo. diff --git a/src/fsharp/xlf/FSComp.txt.ja.xlf b/src/fsharp/xlf/FSComp.txt.ja.xlf index a4ae3db8a1..41a9631d63 100644 --- a/src/fsharp/xlf/FSComp.txt.ja.xlf +++ b/src/fsharp/xlf/FSComp.txt.ja.xlf @@ -109,7 +109,7 @@ All branches of a pattern match expression must return values of the same type. The first branch returned a value of type '{0}', but this branch returned a value of type '{1}'. - パターン マッチ式のすべてのブランチは同じ型である必要があります。この式に必要な型は '{0}' ですが、ここでは型 '{1}' になっています。 + パターン マッチ式のすべてのブランチは、同じ型の値を返す必要があります。最初のブランチが返した値の型は '{0}' ですが、このブランチが返した値の型は '{1}' です。 @@ -209,7 +209,7 @@ Unrecognized privacy setting '{0}' for managed resource, valid options are 'public' and 'private' - マネージ リソースの認識されないプライバシー設定 '{0}'。有効なオプションは 'public' および 'private' です。 + マネージド リソースの認識されないプライバシー設定 '{0}'。有効なオプションは 'public' および 'private' です。 @@ -354,7 +354,7 @@ Error reading/writing metadata for the F# compiled DLL '{0}'. Was the DLL compiled with an earlier version of the F# compiler? (error: '{1}'). - F# でコンパイルした DLL '{0}' のメタデータの読み取り/書き込み中にエラーが発生しました。旧バージョンの F# コンパイラーでコンパイルした DLL ですか? (エラー: '{1}') + F# でコンパイルした DLL '{0}' のメタデータの読み取り/書き込み中にエラーが発生しました。旧バージョンの F# コンパイラでコンパイルした DLL ですか? (エラー: '{1}') @@ -1149,7 +1149,7 @@ The treatment of this operator is now handled directly by the F# compiler and its meaning cannot be redefined - この演算子は F# コンパイラーが直接処理するようになったため、演算子の意味を再定義することはできません + この演算子は F# コンパイラが直接処理するようになったため、演算子の意味を再定義することはできません @@ -2969,12 +2969,12 @@ The member '{0}' does not correspond to any abstract or virtual method available to override or implement. - メンバー '{0}' は、無視または実装に使用できるどの抽象メソッドまたは仮想メソッドにも対応していません。 + メンバー '{0}' は、オーバーライドまたは実装に使用できるどの抽象メソッドまたは仮想メソッドにも対応していません。 The type {0} contains the member '{1}' but it is not a virtual or abstract method that is available to override or implement. - 型 {0} にメンバー '{1}' が含まれていますが、このメンバーは無視または実装に使用できる仮想メソッドでも抽象メソッドでもありません。 + 型 {0} にメンバー '{1}' が含まれていますが、このメンバーはオーバーライドまたは実装に使用できる仮想メソッドでも抽象メソッドでもありません。 @@ -3404,7 +3404,7 @@ This override takes a different number of arguments to the corresponding abstract member. The following abstract members were found:{0} - この無視では、対応する抽象メンバーに対して異なる数の引数を使用しています。次の抽象メンバーが見つかりました: {0} + このオーバーライドでは、対応する抽象メンバーに対して異なる数の引数を使用しています。次の抽象メンバーが見つかりました: {0} @@ -3434,7 +3434,7 @@ This new member hides the abstract member '{0}'. Rename the member or use 'override' instead. - この新しいメンバーは抽象メンバー '{0}' を隠ぺいしています。メンバーの名前を変更するか、代わりに 'override' を使用してください。 + この新しいメンバーは抽象メンバー '{0}' を隠ぺいします。メンバーの名前を変更するか、代わりに 'override' を使用してください。 @@ -4024,7 +4024,7 @@ Compiler error: unexpected unrealized value - コンパイラー エラー: 予期しない認識されない値 + コンパイラ エラー: 予期しない認識されない値 @@ -4199,7 +4199,7 @@ Embed the specified managed resource - 指定したマネージ リソースを埋め込みます + 指定したマネージド リソースを埋め込みます @@ -4279,7 +4279,7 @@ @@ -4369,12 +4369,12 @@ The command-line option '--cliroot' has been deprecated. Use an explicit reference to a specific copy of mscorlib.dll instead. - コマンド ライン オプション '--cliroot' は使用されなくなりました。代わりに mscorlib.dll の特定のコピーに対する明示的な参照を使用してください。 + コマンド ライン オプション '--cliroot' は非推奨になりました。代わりに mscorlib.dll の特定のコピーに対する明示的な参照を使用してください。 Use to override where the compiler looks for mscorlib.dll and framework components - コンパイラーが mscorlib.dll およびフレームワーク コンポーネントを検索する場所をオーバーライドするために使用します + コンパイラが mscorlib.dll およびフレームワーク コンポーネントを検索する場所をオーバーライドするために使用します @@ -4434,17 +4434,17 @@ The command-line option '{0}' has been deprecated - コマンド ライン オプション '{0}' は使用されなくなりました + コマンド ライン オプション '{0}' は非推奨になりました The command-line option '{0}' has been deprecated. Use '{1}' instead. - コマンド ライン オプション '{0}' は使用されなくなりました。代わりに '{1}' を使用してください。 + コマンド ライン オプション '{0}' は非推奨になりました。代わりに '{1}' を使用してください。 The command-line option '{0}' has been deprecated. HTML document generation is now part of the F# Power Pack, via the tool FsHtmlDoc.exe. - コマンド ライン オプション '{0}' は使用されなくなりました。HTML ドキュメントの生成は、F# Power Pack のツール FsHtmlDoc.exe で実行できるようになりました。 + コマンド ライン オプション '{0}' は非推奨になりました。HTML ドキュメントの生成は、F# Power Pack のツール FsHtmlDoc.exe で実行できるようになりました。 @@ -5434,7 +5434,7 @@ The attribute {0} specified version '{1}', but this value is invalid and has been ignored - {0} がバージョン '{1}' を指定しましたが、この値は無効なため無視されました + 属性 {0} にバージョン '{1}' を指定しましたが、この値は無効なため無視されました @@ -5459,12 +5459,12 @@ Static linking may not include a mixed managed/unmanaged DLL - 静的リンクでは、混合マネージ/アンマネージ DLL がインクルードされない可能性があります + 静的リンクでは、混合マネージド/アンマネージド DLL がインクルードされない可能性があります Ignoring mixed managed/unmanaged assembly '{0}' during static linking - 静的リンク中に混合マネージ/アンマネージ アセンブリ '{0}' を無視しています + 静的リンク中に混合マネージド/アンマネージド アセンブリ '{0}' を無視しています @@ -5529,7 +5529,7 @@ Passing a .resx file ({0}) as a source file to the compiler is deprecated. Use resgen.exe to transform the .resx file into a .resources file to pass as a --resource option. If you are using MSBuild, this can be done via an <EmbeddedResource> item in the .fsproj project file. - .resx ファイル ({0}) をソース ファイルとしてコンパイラに渡す処理は使用できなくなりました。resgen.exe を使用して、.resx ファイルを .resources ファイルに変換し、--resource オプションで渡してください。MSBuild を使用する場合は、.fsproj プロジェクト ファイル内の <EmbeddedResource> 項目を使用して、この変換を実行できます。 + .resx ファイル ({0}) をソース ファイルとしてコンパイラに渡す処理は非推奨です。resgen.exe を使用して、.resx ファイルを .resources ファイルに変換し、--resource オプションで渡してください。MSBuild を使用する場合は、.fsproj プロジェクト ファイル内の <EmbeddedResource> 項目を使用して、この変換を実行できます。 @@ -5809,7 +5809,7 @@ Cannot override inherited member '{0}' because it is sealed - 継承されたメンバー '{0}' はシールドであるため、オーバーライドできません + 継承されたメンバー '{0}' はシールされているため、オーバーライドできません @@ -6974,7 +6974,7 @@ Used in computation expressions to pattern match directly over the result of another computation expression. - Used in computation expressions to pattern match directly over the result of another computation expression. + 別のコンピュテーション式の結果に対して直接パターン マッチを適用するコンピュテーション式の中で使用します。 @@ -6984,82 +6984,82 @@ The byref pointer is readonly, so this write is not permitted. - The byref pointer is readonly, so this write is not permitted. + byref ポインターは読み取り専用であるため、この書き込みは許可されません。 A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' - A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + 値の型の内容を変更するか、値の型のアドレスを使用するために、値は変更可能にする必要があります (たとえば、'let mutable x = ...') A ReadOnly attribute has been applied to a struct type with a mutable field. - A ReadOnly attribute has been applied to a struct type with a mutable field. + 読み取り専用の属性が、変更可能なフィールドを持つ構造体型に適用されました。 A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. - A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + F# 4.5 の時点で、関数またはメソッドから返される byref ポインターは、暗黙的に逆参照されます。戻り値をポインターとして取得するには、演算子のアドレスを使用してください。例: '&f(x)' または '&obj.Method(arg1, arg2)'。 A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. - A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + IsByRefLike で注釈を付けられた型は、構造体でもある必要があります。型に [<Struct>] 属性を追加することを検討してください。 The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + 現時点で、変数 '{0}' または関連する式のアドレスは使用できません。これは、ローカル値のアドレスがスコープを回避しないようにするためです。 The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + この関数またはメソッドから Span または IsByRefLike 式を返すことはできません。スコープを回避できる要素を使用してその式が作成されているためです。 This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. - This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + この値をターゲット '{0}' に割り当てることはできません。このターゲットは非スタック ローカルのメモリを参照できるのに対して、割り当てられる式はスタック ローカルのメモリに評価される可能性があるためです。これは、スタックにバインドされたメモリへのポインターが自身のスコープを回避することを防止するために役立ちます。 A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' - A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + モジュール内で定義する値のアドレスを取得するには、その値を変更可能にする必要があります。例: 'let mutable x = ...' A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. - A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + IsReadOnly で注釈を付けられた型は、構造体でもある必要があります。型に [<Struct>] 属性を追加することを検討してください。 Struct members cannot return the address of fields of the struct by reference - Struct members cannot return the address of fields of the struct by reference + 構造体メンバーは、構造体のフィールドのアドレスを参照渡しで返すことはできません The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. - The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + 現時点で、関数またはメソッドの呼び出しは使用できません。非スタック ローカルの Span または IsByRefLike 型の byref である 1 つの引数が、スタック ローカルの Span または IsByRefLike 型である別の引数と一緒に使用されています。これは、ローカル値のアドレスがスコープを回避しないようにするためです。 The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + 現時点で、式から返される値のアドレスは使用できません。これは、ローカル値のアドレスがスコープを回避しないようにするためです。 The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + 現時点で、Span または IsByRefLike 変数 '{0}' は使用できません。これは、ローカル値のアドレスがスコープを回避しないようにするためです。 A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. - A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + 現時点で、式から返される Span または IsByRefLike 値は使用できません。これは、ローカル値のアドレスがスコープを回避しないようにするためです。 Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. - Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + 式から返された値のアドレスを取得できません。アドレスを取得する前に、let でバインドされた値に戻り値を割り当ててください。 diff --git a/src/fsharp/xlf/FSComp.txt.ko.xlf b/src/fsharp/xlf/FSComp.txt.ko.xlf index c953381b20..6fee6c0f91 100644 --- a/src/fsharp/xlf/FSComp.txt.ko.xlf +++ b/src/fsharp/xlf/FSComp.txt.ko.xlf @@ -109,7 +109,7 @@ All branches of a pattern match expression must return values of the same type. The first branch returned a value of type '{0}', but this branch returned a value of type '{1}'. - 패턴 일치 식의 모든 분기는 동일한 형식이어야 합니다. 이 식에는 '{0}' 형식이 필요하지만 여기에서는 '{1}' 형식이 지정되었습니다. + 패턴 일치 식의 모든 분기는 동일한 형식의 값을 반환해야 합니다. 첫 번째 분기는 '{0}' 형식의 값을 반환했지만 이 분기는 '{1}' 형식의 값을 반환했습니다. @@ -5434,7 +5434,7 @@ The attribute {0} specified version '{1}', but this value is invalid and has been ignored - AssemblyVersionAttribute에 {0} 버전 '{1}'이(가) 지정되었지만 이 값이 잘못되어 무시되었습니다. + 특성 {0}이(가) 버전 '{1}'을(를) 지정했지만, 이 값이 잘못되어 무시되었습니다. @@ -6974,7 +6974,7 @@ Used in computation expressions to pattern match directly over the result of another computation expression. - Used in computation expressions to pattern match directly over the result of another computation expression. + 다른 계산 식의 결과에 대해 직접적으로 패턴 일치에 대한 계산 식에 사용됩니다. @@ -6984,82 +6984,82 @@ The byref pointer is readonly, so this write is not permitted. - The byref pointer is readonly, so this write is not permitted. + byref 포인터는 읽기 전용이므로 이 쓰기가 허용되지 않습니다. A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' - A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + 내용을 변경하거나 값 형식의 주소를 사용하려면 값을 변경할 수 있어야 합니다(예: 'let mutable x = ...'). A ReadOnly attribute has been applied to a struct type with a mutable field. - A ReadOnly attribute has been applied to a struct type with a mutable field. + 변경할 수 있는 필드가 있는 구조체 형식에 ReadOnly 특성이 적용되었습니다. A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. - A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + 함수 또는 메서드에 의해 반환된 byref 포인터가 F# 4.5부터 암시적으로 역참조됩니다. 포인터로 반환 값을 가져오려면 address-of 연산자를 사용하세요(예: '&f(x)' 또는 '&obj.Method(arg1, arg2)'). A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. - A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + IsByRefLike로 주석이 추가된 형식은 구조체여야 합니다. 형식에 [<Struct>] 특성을 추가하세요. The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + 지금은 '{0}' 변수의 주소 또는 관련 식을 사용할 수 없습니다. 로컬 값의 주소가 범위를 벗어나지 않도록 하기 위한 것입니다. The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + 범위를 벗어날 수 있는 요소를 사용하여 구성되므로 이 함수 또는 메서드에서 Span 또는 IsByRefLike 식을 반환할 수 없습니다. This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. - This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + '{0}' 대상이 비스택 로컬 메모리를 참조할 수 있는데, 할당되는 식은 잠재적으로 스택 로컬 메모리를 참조하도록 평가되므로 이 값을 할당할 수 없습니다. 스택에 바인딩된 메모리에 대한 포인터가 범위를 벗어나지 않도록 하기 위한 것입니다. A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' - A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + 해당 주소를 사용하려면 모듈에 정의된 값이 변경 가능해야 합니다(예: 'let mutable x = ...'). A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. - A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + IsReadOnly로 주석이 추가된 형식은 구조체여야 합니다. 형식에 [<Struct>] 특성을 추가하세요. Struct members cannot return the address of fields of the struct by reference - Struct members cannot return the address of fields of the struct by reference + 구조체 멤버는 구조체의 필드 주소를 참조로 반환할 수 없습니다. The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. - The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + 비스택 로컬 Span 또는 IsByRefLike 형식의 byref인 한 인수가 스택 로컬 Span 또는 IsByRefLike 형식인 다른 인수와 함께 사용되므로 지금은 함수 또는 메서드 호출을 사용할 수 없습니다. 로컬 값의 주소가 범위를 벗어나지 않도록 하기 위한 것입니다. The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + 지금은 식에서 반환된 값의 주소를 사용할 수 없습니다. 로컬 값의 주소가 범위를 벗어나지 않도록 하기 위한 것입니다. The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + 지금은 Span 또는 IsByRefLike 변수 '{0}'을(를) 사용할 수 없습니다. 로컬 값의 주소가 범위를 벗어나지 않도록 하기 위한 것입니다. A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. - A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + 지금은 식에서 반환된 Span 또는 IsByRefLike 값을 사용할 수 없습니다. 로컬 값의 주소가 범위를 벗어나지 않도록 하기 위한 것입니다. Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. - Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + 식에서 반환된 값의 주소를 가져올 수 없습니다. 주소를 가져오기 전에 반환된 값을 let 바인딩 값에 할당하세요. diff --git a/src/fsharp/xlf/FSComp.txt.pl.xlf b/src/fsharp/xlf/FSComp.txt.pl.xlf index 3be3a2b000..c596dbd0cb 100644 --- a/src/fsharp/xlf/FSComp.txt.pl.xlf +++ b/src/fsharp/xlf/FSComp.txt.pl.xlf @@ -109,7 +109,7 @@ All branches of a pattern match expression must return values of the same type. The first branch returned a value of type '{0}', but this branch returned a value of type '{1}'. - Wszystkie gałęzie wyrażenia dopasowania do wzorca muszą mieć ten sam typ. Oczekiwano, że to wyrażenie będzie miało typ „{0}”, ale tutaj ma typ „{1}”. + Wszystkie gałęzie wyrażenia dopasowania do wzorca muszą zwracać wartości tego samego typu. Pierwsza gałąź zwróciła wartość typu „{0}”, ale ta gałąź zwróciła wartość typu „{1}” @@ -5434,7 +5434,7 @@ The attribute {0} specified version '{1}', but this value is invalid and has been ignored - Element {0} określił wersję „{1}”, ale ta wartość jest nieprawidłowa i została zignorowana + Atrybut {0} określił wersję „{1}”, ale ta wartość jest nieprawidłowa i została zignorowana @@ -6974,7 +6974,7 @@ Used in computation expressions to pattern match directly over the result of another computation expression. - Used in computation expressions to pattern match directly over the result of another computation expression. + Używane w wyrażeniach obliczenia do dopasowania do wzorca bezpośrednio w wyniku innego wyrażenia obliczenia. @@ -6984,82 +6984,82 @@ The byref pointer is readonly, so this write is not permitted. - The byref pointer is readonly, so this write is not permitted. + Wskaźnik byref jest tylko do odczytu, więc ten zapis nie jest dozwolony. A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' - A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + Aby można było zmodyfikować zawartość lub pobrać adres typu wartości, wartość musi być modyfikowalna, na przykład „let mutable x = ...” A ReadOnly attribute has been applied to a struct type with a mutable field. - A ReadOnly attribute has been applied to a struct type with a mutable field. + Atrybut ReadOnly został zastosowany do typu struktury z polem modyfikowalnym. A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. - A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + Wskaźnik byref zwracany przez funkcję lub metodę jest niejawnie wyłuskiwany, począwszy od wersji 4.5 języka F#. Aby pobrać wartość zwracaną jako wskaźnik, użyj operatora address-of, np. „&f(x)” lub „&obj.Method(arg1, arg2)”. A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. - A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + Typ z adnotacją IsByRefLike musi również być strukturą. Rozważ dodanie atrybutu [<Struct>] do tego typu. The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + W tym miejscu nie można użyć adresu zmiennej „{0}” ani powiązanego wyrażenia. Ma to na celu uniemożliwienie adresowi wartości lokalnej wykroczenia poza zakres. The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + Z tej funkcji lub metody nie można zwrócić wyrażenia Span ani IsByRefLike, ponieważ jest ona złożona przy użyciu elementów, które mogą wykroczyć poza swój zakres. This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. - This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + Ta wartość nie może zostać przypisana, ponieważ element docelowy „{0}” może odwoływać się do pamięci innej niż pamięć lokalna dla stosu, natomiast przypisywane wyrażenie może potencjalnie odwoływać się do pamięci lokalnej dla stosu. Dzięki temu łatwiej uniemożliwić wskaźnikom do pamięci powiązanej ze stosem wykroczenie poza ich zakres. A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' - A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + Wartość zdefiniowana w module musi być modyfikowalna w celu uzyskania jej adresu, np. „let mutable x = ...” A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. - A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + Typ z adnotacją IsReadOnly musi również być strukturą. Rozważ dodanie atrybutu [<Struct>] do tego typu. Struct members cannot return the address of fields of the struct by reference - Struct members cannot return the address of fields of the struct by reference + Składowe struktury nie mogą zwracać adresów pól struktury przez odwołanie The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. - The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + W tym miejscu nie można użyć wywołania funkcji lub metody, ponieważ jeden argument, który jest elementem byref typu Span lub IsByRefLike innego niż lokalnego dla stosu, został użyty z innym argumentem, który jest typem Span lub IsByRefLike lokalnym dla stosu. Ma to na celu zapewnienie, że adres wartości lokalnej nie wykracza poza swój zakres. The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + W tym miejscu nie można użyć adresu wartości zwróconej z wyrażenia. Ma to na celu uniemożliwienie adresowi wartości lokalnej wykroczenia poza zakres. The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + W tym miejscu nie można użyć zmiennej Span lub IsByRefLike „{0}”. Ma to na celu uniemożliwienie adresowi wartości lokalnej wykroczenia poza zakres. A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. - A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + W tym miejscu nie można użyć wartości Span lub IsByRefLike zwróconej z wyrażenia. Ma to na celu uniemożliwienie adresowi wartości lokalnej wykroczenia poza zakres. Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. - Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + Nie można uzyskać adresu wartości zwróconej przez wyrażenie. Przypisz zwróconą wartość do wartości powiązanej za pomocą instrukcji let przed uzyskaniem adresu. diff --git a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf index 4e0963e2fa..753d847edc 100644 --- a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf +++ b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf @@ -109,7 +109,7 @@ All branches of a pattern match expression must return values of the same type. The first branch returned a value of type '{0}', but this branch returned a value of type '{1}'. - Todas as ramificações de uma expressão de correspondência de padrões devem ter o mesmo tipo. Essa expressão deveria ter o tipo '{0}', mas aqui tem o tipo '{1}'. + Todos os branches de uma expressão correspondente ao padrão precisam retornar valores do mesmo tipo. O primeiro branch retornou um valor do tipo '{0}', mas este branch retornou um valor do tipo '{1}'. @@ -5434,7 +5434,7 @@ The attribute {0} specified version '{1}', but this value is invalid and has been ignored - Um {0} especificou a versão '{1}', mas esse valor é inválido e foi ignorado + O atributo {0} especificou a versão '{1}', mas esse valor é inválido e foi ignorado @@ -6974,7 +6974,7 @@ Used in computation expressions to pattern match directly over the result of another computation expression. - Used in computation expressions to pattern match directly over the result of another computation expression. + Usado em expressões de computação para corresponder ao padrão diretamente sobre o resultado de outra expressão de computação. @@ -6984,82 +6984,82 @@ The byref pointer is readonly, so this write is not permitted. - The byref pointer is readonly, so this write is not permitted. + O ponteiro byref é somente leitura. Portanto, esta gravação não é permitida. A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' - A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + Um valor deve ser mutável para que seja possível mudar o conteúdo ou pegar o endereço de um tipo de valor, por exemplo: 'let mutable x = ...' A ReadOnly attribute has been applied to a struct type with a mutable field. - A ReadOnly attribute has been applied to a struct type with a mutable field. + O atributo ReadOnly foi aplicado a um tipo de struct com um campo mutável. A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. - A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + Um ponteiro byref retornado por uma função ou um método é implicitamente desreferenciado de F # 4.5. Para adquirir o valor retornado como um ponteiro, utilize o operador de endereços, por exemplo, '&f(x)' ou '&obj.Method(arg1, arg2)'. A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. - A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + Um tipo anotado com IsByRefLike também deve ser um struct. Considere adicionar o atributo [<Struct>] ao tipo. The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + O endereço da variável '{0}' ou de uma expressão relacionada não pode ser utilizado neste ponto. Isso tem como objetivo garantir que o endereço do valor local não escape de seu escopo. The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + A expressão Span ou IsByRefLike não pode ser retornada desta função ou deste método porque ela é composta utilizando elementos que podem escapar de seu escopo. This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. - This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + Este valor não pode ser atribuído porque o destino '{0}' pode se referir a uma memória local não empilhada, enquanto a expressão que está sendo atribuída é avaliada para possivelmente se referir à memória local empilhada. Isso tem como objetivo ajudar a evitar que os ponteiros da memória vinculada à pilha escapem de seu escopo. A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' - A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + O valor definido em um módulo deve ser mutável para obter seu endereço, por exemplo, 'let mutable x = ...' A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. - A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + Um tipo anotado com IsReadOnly também deve ser um struct. Considere adicionar o atributo [<Struct>] ao tipo. Struct members cannot return the address of fields of the struct by reference - Struct members cannot return the address of fields of the struct by reference + Os membros do struct não podem retornar o endereço dos campos do struct por referência The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. - The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + A função ou a chamada do método não pode ser utilizada neste ponto porque um argumento, que é um byref de um tipo Span ou IsByRefLike local não empilhado, é utilizado com outro argumento, que é um tipo Span ou IsByRefLike local empilhado. Isso tem como objetivo garantir que o endereço do valor local não escape de seu escopo. The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + O endereço de um valor retornado da expressão não pode ser utilizado neste ponto. Isso tem como objetivo garantir que o endereço do valor local não escape de seu escopo. The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + A variável '{0}' de Span ou IsByRefLike não pode ser utilizada neste ponto. Isso tem como objetivo garantir que o endereço do valor local não escape de seu escopo. A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. - A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + O valor Span ou IsByRefLike retornado da expressão não pode ser utilizado neste ponto. Isso tem como objetivo garantir que o endereço do valor local não escape de seu escopo. Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. - Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + Não é possível obter o endereço do valor retornado da expressão. Atribua o valor retornado a um valor associado a let antes de obter o endereço. diff --git a/src/fsharp/xlf/FSComp.txt.ru.xlf b/src/fsharp/xlf/FSComp.txt.ru.xlf index cf15071f17..86e036f40a 100644 --- a/src/fsharp/xlf/FSComp.txt.ru.xlf +++ b/src/fsharp/xlf/FSComp.txt.ru.xlf @@ -109,7 +109,7 @@ All branches of a pattern match expression must return values of the same type. The first branch returned a value of type '{0}', but this branch returned a value of type '{1}'. - Все ветви выражения сопоставления шаблона должны иметь один и тот же тип. В этом выражении ожидалось использование типа "{0}", но используется тип "{1}". + Все ветви выражения сопоставления шаблонов должны возвращать значения одного типа. Первая ветвь возвратила значение типа "{0}", а эта ветвь — типа "{1}". @@ -5434,7 +5434,7 @@ The attribute {0} specified version '{1}', but this value is invalid and has been ignored - В {0} была указана версия "{1}", однако это значение является недопустимым и было проигнорировано + В атрибуте {0} указана версия "{1}", однако это значение недопустимо и было проигнорировано @@ -6974,7 +6974,7 @@ Used in computation expressions to pattern match directly over the result of another computation expression. - Used in computation expressions to pattern match directly over the result of another computation expression. + Используется в выражениях вычислений для сопоставления шаблонов непосредственно с результатом другого выражения вычислений. @@ -6984,82 +6984,82 @@ The byref pointer is readonly, so this write is not permitted. - The byref pointer is readonly, so this write is not permitted. + Указатель byref доступен только для чтения, поэтому операция записи запрещена. A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' - A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + Чтобы изменить содержимое или получить адрес типа значения, значение должно быть изменяемым, например, "let mutable x = ..." A ReadOnly attribute has been applied to a struct type with a mutable field. - A ReadOnly attribute has been applied to a struct type with a mutable field. + Атрибут ReadOnly был применен к типу структуры с изменяемым полем. A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. - A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + Указатель byref, возвращаемый функцией или методом, неявным образом разыменовывается в F# 4.5. Для получения возвращаемого значения в виде указателя используйте оператор address-of, например &f(x) или &obj.Method(arg1, arg2). A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. - A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + Тип с аннотацией IsByRefLike также должен быть структурой. Рекомендуется добавить к типу атрибут [<Struct>]. The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + На этом этапе невозможно использовать адрес переменной "{0}" или связанного выражения. В этом случае гарантируется, что адрес локального значения не обходит свою область. The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + Выражение Span или IsByRefLike не может быть возвращено этой функцией или методом, так как оно создано с помощью элементов, которые могут обходить свою область. This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. - This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + Это значение не может быть назначено, так как целевой элемент "{0}" может ссылаться на отличную от локальной для стека память, тогда как назначаемое выражение оценивается как потенциально ссылающееся на локальную для стека память. В этом случае гарантируется, что указатели на привязанную к стеку память не обходят свою область. A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' - A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + Чтобы получить свой адрес, значение, определенное в модуле, должно быть изменяемым, например "let mutable x = ...". A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. - A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + Тип с аннотацией IsReadOnly также должен быть структурой. Рекомендуется добавить к типу атрибут [<Struct>]. Struct members cannot return the address of fields of the struct by reference - Struct members cannot return the address of fields of the struct by reference + Члены структуры не могут возвращать адрес полей структуры по ссылке The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. - The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + На этом этапе невозможно использовать вызов функции или метода, так как один аргумент, представляющий собой byref с отличным от локального для стека типом Span или IsByRefLike, используется с другим аргументом, имеющим локальный для стека тип Span или IsByRefLike. В этом случае гарантируется, что адрес локального значения не обходит свою область. The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + На этом этапе невозможно использовать адрес значения, возвращаемого выражением. В этом случае гарантируется, что адрес локального значения не обходит свою область. The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + На этом этапе невозможно использовать переменную Span или IsByRefLike "{0}". В этом случае гарантируется, что адрес локального значения не обходит свою область. A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. - A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + На этом этапе невозможно использовать значение Span или IsByRefLike, возвращаемое выражением. В этом случае гарантируется, что адрес локального значения не обходит свою область. Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. - Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + Невозможно получить адрес значения, возвращенного из выражения. Используйте возвращенное значение в качестве значения с привязкой let, прежде чем получить адрес. diff --git a/src/fsharp/xlf/FSComp.txt.tr.xlf b/src/fsharp/xlf/FSComp.txt.tr.xlf index 2fc70b0912..a81169d083 100644 --- a/src/fsharp/xlf/FSComp.txt.tr.xlf +++ b/src/fsharp/xlf/FSComp.txt.tr.xlf @@ -109,7 +109,7 @@ All branches of a pattern match expression must return values of the same type. The first branch returned a value of type '{0}', but this branch returned a value of type '{1}'. - Bir pattern match ifadesinin tüm dalları aynı türe sahip olmalıdır. Bu ifadenin '{0}' türünde olması bekleniyordu ancak burada '{1}' türünde. + Bir desen eşleştirme ifadesinin tüm dalları aynı türdeki değerleri döndürmelidir. Birinci dal '{0}' türünde bir değer döndürdü ancak bu dal '{1}' türünde bir değer döndürdü. @@ -5434,7 +5434,7 @@ The attribute {0} specified version '{1}', but this value is invalid and has been ignored - {0} ile sürüm '{1}' belirtildi, ancak bu değer geçersiz ve yok sayıldı + {0} özniteliğinde '{1}' sürümü belirtildi, ancak bu değer geçersiz olduğundan yoksayıldı @@ -6974,7 +6974,7 @@ Used in computation expressions to pattern match directly over the result of another computation expression. - Used in computation expressions to pattern match directly over the result of another computation expression. + Başka bir hesaplama ifadesinin sonucu üzerinde doğrudan desen eşleştirmesi için hesaplama ifadelerinde kullanılır. @@ -6984,82 +6984,82 @@ The byref pointer is readonly, so this write is not permitted. - The byref pointer is readonly, so this write is not permitted. + Byref işaretçisi salt okunur olduğundan bu yazma işlemine izin verilmiyor. A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' - A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + İçeriği değiştirmek veya değer türünün adresini almak için bir değerin değiştirilebilir olması gerekir, örn. 'let mutable x = ...' A ReadOnly attribute has been applied to a struct type with a mutable field. - A ReadOnly attribute has been applied to a struct type with a mutable field. + Değiştirilebilir bir alana sahip bir yapı türüne ReadOnly özniteliği uygulandı. A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. - A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + Bir işlev veya metot tarafından döndürülen bir byref işaretçisinin başvurusu F# 4.5 itibarıyla örtük olarak kaldırıldı. Dönüş değerini bir işaretçi olarak edinmek için address-of işlecini kullanın. Örn. '&f(x)' veya '&obj.Method(arg1, arg2)'. A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. - A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + IsByRefLike ek açıklaması eklenmiş bir tür aynı zamanda bir yapı olmalıdır. Türe [<Struct>] özniteliğini eklemeyi göz önünde bulundurun. The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + Bu noktada '{0}' değişkeninin veya ilgili bir değişkenin adresi kullanılamaz. Bunun amacı, yerel değerin adresinin kapsamı dışına kaçmasını engellemektir. The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + Span veya IsByRefLike ifadesi kapsamından kaçabilecek öğeler kullanılarak oluşturulduğundan, bu işlev veya metottan döndürülemez. This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. - This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + '{0}' hedefi yığında yerel olmayan belleğe başvurabileceğinden ve atanmakta olan ifadenin yığında yerel belleğe başvurma olasılığının olduğu tespit edildiğinden bu değer atanamaz. Bunun amacı, yığınla sınırlı belleğe yönelik işaretçilerin kapsamlarından kaçmasının önlenmesine yardımcı olmaktır. A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' - A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + Bir modülde tanımlanan bir değerin adresini alabilmesi için değiştirilebilir olması gerekir. Örn. 'let mutable x = ...' A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. - A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + IsReadOnly ek açıklaması eklenmiş bir tür aynı zamanda bir yapı olmalıdır. Türe [<Struct>] özniteliğini eklemeyi göz önünde bulundurun. Struct members cannot return the address of fields of the struct by reference - Struct members cannot return the address of fields of the struct by reference + Yapı üyeleri, başvuruya göre yapı alanlarının adreslerini döndüremez The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. - The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + Yığında yerel olmayan bir Span veya IsByRefLike türünün byref’i olan bir bağımsız değişken yığında yerel olan başka bir Span veya IsByRefLike türüyle birlikte kullanıldığından işlev veya metot çağrısı bu noktada kullanılamaz. Bunun amacı, yerel değerin adresinin kapsamından kaçmasının önlenmesine yardımcı olmaktır. The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + Bu noktada ifadeden döndürülen bir değerin adresi kullanılamaz. Bunun amacı, yerel değerin adresinin kapsamı dışına kaçmasını engellemektir. The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + Bu noktada Span veya IsByRefLike değişkeni '{0}' kullanılamaz. Bunun amacı, yerel değerin adresinin kapsamı dışına kaçmasını engellemektir. A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. - A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + Bu noktada ifadeden döndürülen bir Span veya IsByRefLike değeri kullanılamaz. Bunun amacı, yerel değerin adresinin kapsamı dışına kaçmasını engellemektir. Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. - Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + İfadeden döndürülen değerin adresi alınamaz. Adresi almadan önce, döndürülen değeri let ile bağlanmış bir değere atayın. diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf index eb6b470b4f..dd458728c8 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf @@ -109,7 +109,7 @@ All branches of a pattern match expression must return values of the same type. The first branch returned a value of type '{0}', but this branch returned a value of type '{1}'. - 模式匹配表达式的所有分支必须具有同一类型。此表达式的类型应为“{0}”,但此处类型为“{1}”。 + 模式匹配表达式的所有分支必须返回相同类型的值。第一个分支返回“{0}”类型的值,但此分支返回“{1}”类型的值。 @@ -5434,7 +5434,7 @@ The attribute {0} specified version '{1}', but this value is invalid and has been ignored - {0} 指定的版本“{1}”,但此值无效,已被忽略 + 属性 {0} 指定版本“{1}”,但此值无效,已被忽略 @@ -6974,7 +6974,7 @@ Used in computation expressions to pattern match directly over the result of another computation expression. - Used in computation expressions to pattern match directly over the result of another computation expression. + 在计算表达式中用于直接对另一个计算表达式的结果进行模式匹配。 @@ -6984,82 +6984,82 @@ The byref pointer is readonly, so this write is not permitted. - The byref pointer is readonly, so this write is not permitted. + 此 byref 指针为只读,因此,不允许此写入。 A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' - A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + 值必须是可变的,以便更改内容或采用值类型的地址,例如“let mutable x = ...” A ReadOnly attribute has been applied to a struct type with a mutable field. - A ReadOnly attribute has been applied to a struct type with a mutable field. + 已对包含可变字段的结构类型应用只读属性。 A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. - A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + 截至 F# 4.5,隐式取消引用函数或方法返回的 byref 指针。若要获取返回值作为指针,请使用 address-of 运算符,例如 “&f(x)” 或 “&obj.Method(arg1, arg2)”。 A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. - A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + 使用 IsByRefLike 注释的类型也必须为结构。考虑将 [<Struct>] 属性添加到类型中。 The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + 此时无法使用变量“{0}”或相关表达式的地址。这是为了确保本地值的地址不超出其范围。 The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + 无法从此函数或方法返回 Span 或 IsByRefLike 表达式,因为它由可能超出其范围的元素组成。 This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. - This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + 无法分配此值,因为目标“{0}”可能涉及非堆栈本地内存,而分配的表达式经评估可能涉及堆栈本地内存。这有助于防止指向堆栈绑定内存的指针超出其范围。 A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' - A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + 在模块中定义的值必须是可变的,以便获取其地址,例如 “let mutable x = ...” A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. - A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + 使用 IsReadOnly 注释的类型也必须为结构。考虑将 [<Struct>] 属性添加到类型中。 Struct members cannot return the address of fields of the struct by reference - Struct members cannot return the address of fields of the struct by reference + 结构成员无法通过引用返回此结构的字段地址 The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. - The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + 此时无法使用函数或方法调用,因为结合使用了一个非堆栈本地 Span 或 IsByRefLike 类型的 byref 参数和另一堆栈本地 Span 或 IsByRefLike 类型的参数。这是为了确保本地值的地址不超出其范围。 The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + 此时无法使用从表达式返回的值的地址。这是为了确保本地值的地址不超出其范围。 The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + 此时无法使用 Span 或 IsByRefLike 变量“{0}”。这是为了确保本地值的地址不超出其范围。 A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. - A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + 此时无法使用从表达式返回的 Span 或 IsByRefLike 值。这是为了确保本地值的地址不超出其范围。 Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. - Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + 无法采用从表达式返回的地址值。在采用地址前将返回值分配给 let 绑定值。 diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf index 342da40e1b..d3da3af897 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf @@ -109,7 +109,7 @@ All branches of a pattern match expression must return values of the same type. The first branch returned a value of type '{0}', but this branch returned a value of type '{1}'. - 模式比對運算式的所有分支都必須是同一種類型。此運算式應具備類型 '{0}',但卻是類型 '{1}'。 + 模式比對運算式的所有分支,都必須傳回相同類型的值。第一個分支傳回了類型 '{0}' 的值,但此分支卻傳回了類型 '{1}' 的值。 @@ -5434,7 +5434,7 @@ The attribute {0} specified version '{1}', but this value is invalid and has been ignored - {0} 指定的版本 '{1}',但是此值無效,已被忽略。 + 屬性 {0} 指定了版本 '{1}',但該值無效,所以已忽略。 @@ -6974,7 +6974,7 @@ Used in computation expressions to pattern match directly over the result of another computation expression. - Used in computation expressions to pattern match directly over the result of another computation expression. + 用於計算運算式中,直接對另一個計算運算式的結果進行模式比對。 @@ -6984,82 +6984,82 @@ The byref pointer is readonly, so this write is not permitted. - The byref pointer is readonly, so this write is not permitted. + byref 指標為唯讀指標,所以不允許此寫入。 A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' - A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' + 值必須是可變動的,才能變動內容或接受實值類型的位址,例如 'let mutable x = ...' A ReadOnly attribute has been applied to a struct type with a mutable field. - A ReadOnly attribute has been applied to a struct type with a mutable field. + 已將 ReadOnly 屬性套用至具備可變動欄位的結構類型。 A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. - A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. + 函式或方法所傳回的 byref 指標,隱含會取值為 F# 4.5。如需將傳回值擷取為指標,請使用 address-of 運算子,例如 '&f(x)' 或 '&obj.Method(arg1, arg2)'。 A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. - A type annotated with IsByRefLike must also be a struct. Consider adding the [<Struct>] attribute to the type. + 標註有 IsByRefLike 的類型,必須是結構。請考慮對該類型新增 [<Struct>] 屬性。 The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + 此時不可使用變數 '{0}' 或相關運算式的位址。如此可確保本機值的位址不會逸出其範圍。 The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + 無法從此函式或方法傳回 Span 或 IsByRefLike 運算式,因為其使用可能會逸出其範圍的項目撰寫。 This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. - This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. + 因為目標 '{0}' 會參考非本機堆疊的記憶體,所以無法指派此值。而目前所指派的運算式則評定為可能會參考本機堆疊的記憶體。如此可有助於避免進入受堆疊拘束記憶體的指標會逸出其範圍。 A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' - A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' + 模組中定義的值必須可以變動,才可取用其位址,例如 'let mutable x = ...' A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. - A type annotated with IsReadOnly must also be a struct. Consider adding the [<Struct>] attribute to the type. + 標註有 IsReadOnly 的類型,必須是結構。請考慮對該類型新增 [<Struct>] 屬性。 Struct members cannot return the address of fields of the struct by reference - Struct members cannot return the address of fields of the struct by reference + 結構成員無法經由參考方式,傳回結構欄位的位址 The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. - The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. + 此時不可使用函式或方法呼叫,原因是非本機堆疊 Span 或 IsByRefLike 類型的 byref 引數,目前與本機堆疊 Span 或 IsByRefLike 類型的引數一起使用。如此可確保本機值的位址不會逸出其範圍。 The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + 此時不可使用運算式傳回值的位址。如此可確保本機值的位址不會逸出其範圍。 The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - The Span or IsByRefLike variable '{0}' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + 此時不可使用 Span 或 IsByRefLike 變數 '{0}'。如此可確保本機值的位址不會逸出其範圍。 A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. - A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. + 此時不可使用運算式傳回值的 Span 或 IsByRefLike。如此可確保本機值的位址不會逸出其範圍。 Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. - Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + 無法使用運算式傳回值的位址。在使用位址前,先將傳回值指派給以 let 繫結的值。 diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf index e6df03463f..73d205eca8 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf @@ -154,7 +154,7 @@ CodeLens - CodeLens + CodeLens diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf index 6f8a82dc3c..b728e57410 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf @@ -154,7 +154,7 @@ CodeLens - CodeLens + CodeLens diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf index 0aecbe8541..26758d30cf 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf @@ -154,7 +154,7 @@ CodeLens - CodeLens + CodeLens diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf index 73c43a740b..eadd06f5db 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf @@ -154,7 +154,7 @@ CodeLens - CodeLens + CodeLens diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf index 908553bafe..d288d6839f 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf @@ -154,7 +154,7 @@ CodeLens - CodeLens + CodeLens diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf index 85b803b418..8b05b335d8 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf @@ -154,7 +154,7 @@ CodeLens - CodeLens + CodeLens diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf index 0a73238b52..b017a3562e 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf @@ -154,7 +154,7 @@ CodeLens - CodeLens + CodeLens diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf index 4feb60afd4..e0898181ec 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf @@ -154,7 +154,7 @@ CodeLens - CodeLens + CodeLens diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf index 202d965684..03c3c7bf66 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf @@ -154,7 +154,7 @@ CodeLens - CodeLens + CodeLens diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf index deb6b7d6f5..16a1bba37a 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf @@ -154,7 +154,7 @@ CodeLens - CodeLens + CodeLens diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf index 46f3718742..dd4dd7d6c0 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf @@ -154,7 +154,7 @@ CodeLens - CodeLens + CodeLens diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf index 9d5a304899..1c301f002c 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf @@ -154,7 +154,7 @@ CodeLens - CodeLens + CodeLens diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf index 64051ba68d..bcbd222af0 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf @@ -154,7 +154,7 @@ CodeLens - CodeLens + CodeLens diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.cs.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.cs.xlf index 2bf350178d..5f16f51b7a 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.cs.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.cs.xlf @@ -204,7 +204,7 @@ Console Application (.NET Framework) - Konzolová aplikace + Konzolová aplikace (.NET Framework) @@ -214,7 +214,7 @@ Library (.NET Framework) - Knihovna + Knihovna (.NET Framework) @@ -224,7 +224,7 @@ Tutorial (.NET Framework) - Tutoriál + Kurz (.NET Framework) @@ -434,12 +434,12 @@ Microsoft Visual F# Tools 10.2 for F# 4.5 - Microsoft Visual F# Tools 10.1 pro F# 4.1 + Microsoft Visual F# Tools 10.2 pro F# 4.5 Microsoft Visual F# Tools 10.2 for F# 4.5 - Microsoft Visual F# Tools 10.1 pro F# 4.1 + Microsoft Visual F# Tools 10.2 pro F# 4.5 @@ -454,7 +454,7 @@ Visual F# Tools 10.2 for F# 4.5 - Visual F# Tools 10.1 pro F# 4.1 + Visual F# Tools 10.2 pro F# 4.5 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.de.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.de.xlf index 88bd80c786..1171f11de4 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.de.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.de.xlf @@ -204,7 +204,7 @@ Console Application (.NET Framework) - Konsolenanwendung + Konsolenanwendung (.NET Framework) @@ -214,7 +214,7 @@ Library (.NET Framework) - Bibliothek + Bibliothek (.NET Framework) @@ -224,7 +224,7 @@ Tutorial (.NET Framework) - Tutorial + Tutorial (.NET Framework) @@ -434,12 +434,12 @@ Microsoft Visual F# Tools 10.2 for F# 4.5 - Microsoft Visual F# Tools 10.1 für F# 4.1 + Microsoft Visual F# Tools 10.2 für F# 4.5 Microsoft Visual F# Tools 10.2 for F# 4.5 - Microsoft Visual F# Tools 10.1 für F# 4.1 + Microsoft Visual F# Tools 10.2 für F# 4.5 @@ -454,7 +454,7 @@ Visual F# Tools 10.2 for F# 4.5 - Visual F# Tools 10.1 für F# 4.1 + Visual F# Tools 10.2 für F# 4.5 @@ -524,7 +524,7 @@ Reference Manager - {0} - Verweis-Manager - {0} + Verweis-Manager – {0} diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.es.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.es.xlf index 1c7a726364..653304cb11 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.es.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.es.xlf @@ -204,7 +204,7 @@ Console Application (.NET Framework) - Aplicación de consola + Aplicación de consola (.NET Framework) @@ -214,7 +214,7 @@ Library (.NET Framework) - Biblioteca + Biblioteca (.NET Framework) @@ -224,7 +224,7 @@ Tutorial (.NET Framework) - Tutorial + Tutorial (.NET Framework) @@ -434,12 +434,12 @@ Microsoft Visual F# Tools 10.2 for F# 4.5 - Herramientas de Microsoft Visual F# 10.1 para F# 4.1 + Herramientas de Microsoft Visual F# 10.2 para F# 4.5 Microsoft Visual F# Tools 10.2 for F# 4.5 - Herramientas de Microsoft Visual F# 10.1 para F# 4.1 + Herramientas de Microsoft Visual F# 10.2 para F# 4.5 @@ -454,7 +454,7 @@ Visual F# Tools 10.2 for F# 4.5 - Herramientas de Visual F# 10.1 para F# 4.1 + Herramientas de Visual F# 10.2 para F# 4.5 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.fr.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.fr.xlf index b08464c474..a587c08ae0 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.fr.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.fr.xlf @@ -204,7 +204,7 @@ Console Application (.NET Framework) - Application console + Application console (.NET Framework) @@ -214,7 +214,7 @@ Library (.NET Framework) - Bibliothèque + Bibliothèque (.NET Framework) @@ -224,7 +224,7 @@ Tutorial (.NET Framework) - Didacticiel + Tutoriel (.NET Framework) @@ -434,12 +434,12 @@ Microsoft Visual F# Tools 10.2 for F# 4.5 - Microsoft Visual F# Tools 10.1 pour F# 4.1 + Microsoft Visual F# Tools 10.2 pour F# 4.5 Microsoft Visual F# Tools 10.2 for F# 4.5 - Microsoft Visual F# Tools 10.1 pour F# 4.1 + Microsoft Visual F# Tools 10.2 pour F# 4.5 @@ -454,7 +454,7 @@ Visual F# Tools 10.2 for F# 4.5 - Visual F# Tools 10.1 pour F# 4.1 + Visual F# Tools 10.2 pour F# 4.5 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.it.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.it.xlf index b23b7d6d11..08d29b2473 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.it.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.it.xlf @@ -64,7 +64,7 @@ Sets the .ico file to use as your application icon. - Imposta il file ico da utilizzare come icona dell'applicazione. + Consente di impostare il file con estensione da usare come icona dell'applicazione. @@ -114,7 +114,7 @@ Target Platform Location - Percorso della piattaforma di destinazione + Percorso piattaforma di destinazione @@ -204,7 +204,7 @@ Console Application (.NET Framework) - Applicazione console + Applicazione console (.NET Framework) @@ -214,7 +214,7 @@ Library (.NET Framework) - Libreria + Libreria (.NET Framework) @@ -224,7 +224,7 @@ Tutorial (.NET Framework) - Esercitazione + Esercitazione (.NET Framework) @@ -329,7 +329,7 @@ A project item for consuming a .NET Managed Resources File (Resx) using ResxFile type provider. - Elemento di progetto per l'utilizzo di un file di risorse gestite .NET (Resx) utilizzando il provider di tipi ResxFile. + Elemento di progetto per l'utilizzo di un file di risorse gestite .NET (Resx) con il provider di tipi ResxFile. @@ -339,7 +339,7 @@ A project item for using the SqlDataConnection (LINQ to SQL) type provider to generate types and consume data in a live SQL database. - Elemento di progetto per l'utilizzo del provider di tipi SqlDataConnection (LINQ to SQL) per generare i tipi e utilizzare i dati in un database SQL attivo. + Elemento di progetto per l'uso del provider di tipi SqlDataConnection (LINQ to SQL) per generare i tipi e utilizzare i dati in un database SQL attivo. @@ -349,7 +349,7 @@ A project item for using the SqlEntityConnection (Entity Data Model) type provider to generate types and consume data in a live SQL database. - Elemento di progetto per l'utilizzo del provider di tipi SqlEntityConnection (Entity Data Model) per generare i tipi e utilizzare i dati in un database SQL attivo. + Elemento di progetto per l'uso del provider di tipi SqlEntityConnection (Entity Data Model) per generare i tipi e utilizzare i dati in un database SQL attivo. @@ -434,12 +434,12 @@ Microsoft Visual F# Tools 10.2 for F# 4.5 - Microsoft Visual F# Tools 10.1 per F# 4.1 + Microsoft Visual F# Tools 10.2 per F# 4.5 Microsoft Visual F# Tools 10.2 for F# 4.5 - Microsoft Visual F# Tools 10.1 per F# 4.1 + Microsoft Visual F# Tools 10.2 per F# 4.5 @@ -454,7 +454,7 @@ Visual F# Tools 10.2 for F# 4.5 - Visual F# Tools 10.1 per F# 4.1 + Visual F# Tools 10.2 per F# 4.5 @@ -539,7 +539,7 @@ All of the Framework assemblies are already referenced. Please use the Object Browser to explore the references in the Framework. - Si è già fatto riferimento a tutti gli assembly del framework. Utilizzare Visualizzatore oggetti per esplorare i riferimenti nel framework. + Si è già fatto riferimento a tutti gli assembly del framework. Usare Visualizzatore oggetti per esplorare i riferimenti nel framework. diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ja.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ja.xlf index 0d43e6538f..3bac34d1a9 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ja.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ja.xlf @@ -204,7 +204,7 @@ Console Application (.NET Framework) - コンソール アプリケーション + コンソール アプリケーション (.NET Framework) @@ -214,7 +214,7 @@ Library (.NET Framework) - ライブラリ + ライブラリ (.NET Framework) @@ -224,7 +224,7 @@ Tutorial (.NET Framework) - チュートリアル + チュートリアル (.NET Framework) @@ -329,7 +329,7 @@ A project item for consuming a .NET Managed Resources File (Resx) using ResxFile type provider. - ResxFile 型プロバイダーを使用して .NET マネージ リソース ファイル (Resx) を使用するためのプロジェクト アイテムです。 + ResxFile 型プロバイダーを使用して .NET マネージド リソース ファイル (Resx) を使用するためのプロジェクト アイテムです。 @@ -409,7 +409,7 @@ F# Interactive - F# Interactive + F# インタラクティブ @@ -434,12 +434,12 @@ Microsoft Visual F# Tools 10.2 for F# 4.5 - Microsoft Visual F# Tools 10.1 for F# 4.1 + Microsoft Visual F# Tools 10.2 for F# 4.5 Microsoft Visual F# Tools 10.2 for F# 4.5 - Microsoft Visual F# Tools 10.1 for F# 4.1 + Microsoft Visual F# Tools 10.2 for F# 4.5 @@ -454,12 +454,12 @@ Visual F# Tools 10.2 for F# 4.5 - Visual F# Tools 10.1 for F# 4.1 + Visual F# Tools 10.2 for F# 4.5 F# Interactive - F# Interactive + F# インタラクティブ @@ -509,7 +509,7 @@ Change path and command line arguments passed to the F# Interactive - F# Interactive に渡されるパスとコマンド ライン引数を変更します + F# インタラクティブに渡されるパスとコマンド ライン引数を変更します diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ko.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ko.xlf index d6d96708d3..2ddb349f1d 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ko.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ko.xlf @@ -204,7 +204,7 @@ Console Application (.NET Framework) - 콘솔 응용 프로그램 + 콘솔 응용 프로그램(.NET Framework) @@ -214,7 +214,7 @@ Library (.NET Framework) - 라이브러리 + 라이브러리(.NET Framework) @@ -224,7 +224,7 @@ Tutorial (.NET Framework) - 자습서 + 자습서(.NET Framework) @@ -409,7 +409,7 @@ F# Interactive - F# Interactive + F# 대화형 @@ -434,12 +434,12 @@ Microsoft Visual F# Tools 10.2 for F# 4.5 - F# 4.1용 Microsoft Visual F# Tools 10.1 + F# 4.5용 Microsoft Visual F# Tools 10.2 Microsoft Visual F# Tools 10.2 for F# 4.5 - F# 4.1용 Microsoft Visual F# Tools 10.1 + F# 4.5용 Microsoft Visual F# Tools 10.2 @@ -454,12 +454,12 @@ Visual F# Tools 10.2 for F# 4.5 - F# 4.1용 Visual F# Tools 10.1 + F# 4.5용 Visual F# Tools 10.2 F# Interactive - F# Interactive + F# 대화형 @@ -509,7 +509,7 @@ Change path and command line arguments passed to the F# Interactive - F# Interactive에 전달된 경로 및 명령줄 인수를 변경합니다. + F# 대화형에 전달된 경로 및 명령줄 인수를 변경합니다. diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pl.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pl.xlf index 446885c19f..19db868b25 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pl.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pl.xlf @@ -204,7 +204,7 @@ Console Application (.NET Framework) - Aplikacja konsolowa + Aplikacja konsolowa (.NET Framework) @@ -214,7 +214,7 @@ Library (.NET Framework) - Biblioteka + Biblioteka (.NET Framework) @@ -224,7 +224,7 @@ Tutorial (.NET Framework) - Samouczek + Samouczek (.NET Framework) @@ -434,12 +434,12 @@ Microsoft Visual F# Tools 10.2 for F# 4.5 - Microsoft Visual F# Tools 10.1 for F# 4.1 + Microsoft Visual F# Tools 10.2 for F# 4.5 Microsoft Visual F# Tools 10.2 for F# 4.5 - Microsoft Visual F# Tools 10.1 for F# 4.1 + Microsoft Visual F# Tools 10.2 for F# 4.5 @@ -454,7 +454,7 @@ Visual F# Tools 10.2 for F# 4.5 - Visual F# Tools 10.1 for F# 4.1 + Visual F# Tools 10.2 for F# 4.5 @@ -484,7 +484,7 @@ The project '{0}' could not be opened because opening it would cause a folder to be rendered multiple times in the solution explorer. One such problematic item is '{1}'. To open this project in Visual Studio, first edit the project file and fix the problem. - Nie można otworzyć projektu „{0}”, ponieważ spowodowałoby to wielokrotne zrenderowanie folderu w eksploratorze rozwiązań. Jednym z elementów powodujących problemy jest „{1}”. Aby otworzyć ten projekt w programie Visual Studio, najpierw edytuj plik projektu i rozwiąż problem. + Nie można otworzyć projektu „{0}”, ponieważ spowodowałoby to wielokrotne renderowanie folderu w eksploratorze rozwiązań. Jednym z elementów powodujących problemy jest „{1}”. Aby otworzyć ten projekt w programie Visual Studio, najpierw edytuj plik projektu i rozwiąż problem. @@ -509,7 +509,7 @@ Change path and command line arguments passed to the F# Interactive - Zmień ścieżkę i argumenty wiersza polecenia przekazywane do programu F# Interactive + Zmień ścieżkę i argumenty wiersza polecenia przekazywane do narzędzia F# Interactive diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pt-BR.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pt-BR.xlf index 5819cfb25d..845ca2cf55 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pt-BR.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pt-BR.xlf @@ -204,7 +204,7 @@ Console Application (.NET Framework) - Aplicativo do Console + Aplicativo do Console (.NET Framework) @@ -214,7 +214,7 @@ Library (.NET Framework) - Biblioteca + Biblioteca (.NET Framework) @@ -224,7 +224,7 @@ Tutorial (.NET Framework) - Tutorial + Tutorial (.NET Framework) @@ -434,12 +434,12 @@ Microsoft Visual F# Tools 10.2 for F# 4.5 - Microsoft Visual F# Tools 10.1 para F# 4.1 + Microsoft Visual F# Tools 10.2 para F# 4.5 Microsoft Visual F# Tools 10.2 for F# 4.5 - Microsoft Visual F# Tools 10.1 para F# 4.1 + Microsoft Visual F# Tools 10.2 para F# 4.5 @@ -454,7 +454,7 @@ Visual F# Tools 10.2 for F# 4.5 - Visual F# Tools 10.1 para F# 4.1 + Visual F# Tools 10.2 para F# 4.5 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ru.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ru.xlf index 91deb71c4e..7d372af31d 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ru.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ru.xlf @@ -204,7 +204,7 @@ Console Application (.NET Framework) - Консольное приложение + Консольное приложение (.NET Framework) @@ -214,7 +214,7 @@ Library (.NET Framework) - Библиотека + Библиотека (.NET Framework) @@ -224,7 +224,7 @@ Tutorial (.NET Framework) - Учебник + Учебник (.NET Framework) @@ -434,12 +434,12 @@ Microsoft Visual F# Tools 10.2 for F# 4.5 - Microsoft Visual F# Tools 10.1 для F# 4.1 + Microsoft Visual F# Tools 10.2 для F# 4.5 Microsoft Visual F# Tools 10.2 for F# 4.5 - Microsoft Visual F# Tools 10.1 для F# 4.1 + Microsoft Visual F# Tools 10.2 для F# 4.5 @@ -454,7 +454,7 @@ Visual F# Tools 10.2 for F# 4.5 - Visual F# Tools 10.1 для F# 4.1 + Visual F# Tools 10.2 для F# 4.5 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.tr.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.tr.xlf index 34ff7909c6..825c60397e 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.tr.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.tr.xlf @@ -204,7 +204,7 @@ Console Application (.NET Framework) - Konsol Uygulaması + Konsol Uygulaması (.NET Framework) @@ -214,7 +214,7 @@ Library (.NET Framework) - Kitaplık + Kitaplık (.NET Framework) @@ -224,7 +224,7 @@ Tutorial (.NET Framework) - Öğretici + Öğretici (.NET Framework) @@ -409,7 +409,7 @@ F# Interactive - F# Interactive + F# Etkileşimli @@ -434,12 +434,12 @@ Microsoft Visual F# Tools 10.2 for F# 4.5 - F# 4.1 için Microsoft Visual F# Tools 10.1 + F# 4.5 için Microsoft Visual F# Tools 10.2 Microsoft Visual F# Tools 10.2 for F# 4.5 - F# 4.1 için Microsoft Visual F# Tools 10.1 + F# 4.5 için Microsoft Visual F# Tools 10.2 @@ -454,12 +454,12 @@ Visual F# Tools 10.2 for F# 4.5 - F# 4.1 için Visual F# Araçları 10.1 + F# 4.5 için Visual F# Tools 10.2 F# Interactive - F# Interactive + F# Etkileşimli @@ -509,7 +509,7 @@ Change path and command line arguments passed to the F# Interactive - Yolu ve F# Interactive'e geçirilen komut satırı bağımsız değişkenlerini değiştir + Yolu ve F# Etkileşimli'ye geçirilen komut satırı bağımsız değişkenlerini değiştir diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hans.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hans.xlf index 8c055e144c..68a622d5f6 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hans.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hans.xlf @@ -204,7 +204,7 @@ Console Application (.NET Framework) - 控制台应用程序 + 控制台应用程序(.NET Framework) @@ -214,7 +214,7 @@ Library (.NET Framework) - + 库(.NET Framework) @@ -224,7 +224,7 @@ Tutorial (.NET Framework) - 教程 + 教程(.NET Framework) @@ -409,7 +409,7 @@ F# Interactive - F# 交互 + F# 交互窗口 @@ -434,12 +434,12 @@ Microsoft Visual F# Tools 10.2 for F# 4.5 - Microsoft Visual F# Tools 10.1 for F# 4.1 + Microsoft Visual F# Tools 10.2 for F# 4.5 Microsoft Visual F# Tools 10.2 for F# 4.5 - Microsoft Visual F# Tools 10.1 for F# 4.1 + Microsoft Visual F# Tools 10.2 for F# 4.5 @@ -454,12 +454,12 @@ Visual F# Tools 10.2 for F# 4.5 - Visual F# Tools 10.1 for F# 4.1 + Visual F# Tools 10.2 for F# 4.5 F# Interactive - F# 交互 + F# 交互窗口 @@ -509,7 +509,7 @@ Change path and command line arguments passed to the F# Interactive - 更改传递给 F# 交互的路径和命令行参数 + 更改传递给 F# 交互窗口的路径和命令行参数 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hant.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hant.xlf index 541dee6bd6..180e9957b9 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hant.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hant.xlf @@ -204,7 +204,7 @@ Console Application (.NET Framework) - 主控台應用程式 + 主控台應用程式 (.NET Framework) @@ -214,7 +214,7 @@ Library (.NET Framework) - 程式庫 + 程式庫 (.NET Framework) @@ -224,7 +224,7 @@ Tutorial (.NET Framework) - 教學課程 + 教學課程 (.NET Framework) @@ -409,7 +409,7 @@ F# Interactive - F# Interactive + F# 互動 @@ -434,12 +434,12 @@ Microsoft Visual F# Tools 10.2 for F# 4.5 - Microsoft Visual F# Tools 10.1 for F# 4.1 + Microsoft Visual F# Tools 10.2 for F# 4.5 Microsoft Visual F# Tools 10.2 for F# 4.5 - Microsoft Visual F# Tools 10.1 for F# 4.1 + Microsoft Visual F# Tools 10.2 for F# 4.5 @@ -454,12 +454,12 @@ Visual F# Tools 10.2 for F# 4.5 - Visual F# Tools 10.1 for F# 4.1 + Visual F# Tools 10.2 for F# 4.5 F# Interactive - F# Interactive + F# 互動 @@ -509,7 +509,7 @@ Change path and command line arguments passed to the F# Interactive - 變更傳遞到 F# Interactive 的路徑和命令列引數 + 變更傳遞到 F# 互動的路徑和命令列引數 diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf index a77ae430c4..51cb1772b6 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf @@ -59,7 +59,7 @@ Number of projects whose data is cached in memory - Velikost mezipaměti pro kontrolu projektů + Počet projektů, jejichž data jsou uložená v mezipaměti @@ -109,57 +109,57 @@ Time until stale results are used (in milliseconds) - Time until stale results are used (in milliseconds) + Doba, do kdy se budou používat zastaralé výsledky (v milisekundách) IntelliSense Performance Options - IntelliSense Performance Options + Možnosti výkonu pro IntelliSense F# Project and Caching Performance Options - F# Project and Caching Performance Options + Možnosti výkonu pro ukládání do mezipaměti a projekt F# Enable stale data for IntelliSense features - Enable stale data for IntelliSense features + Povolit zastaralá data pro funkce IntelliSense In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. - In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + V odkazech v paměti pro různé projekty jsou uložená data na úrovni projektů, aby mohly mezi projekty fungovat funkce IDE. Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. - Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + Projektová data jsou uložená v mezipaměti pro funkce IDE. Vyšší hodnoty znamenají využití více paměti, protože je uloženo více projektů. Vyladění této hodnoty by nemělo mít vliv na malá a středně velká řešení. CodeLens - CodeLens + CodeLens Show annotations to the right instead of above the line - Show annotations to the right instead of above the line + Zobrazí poznámky napravo místo nad řádkem. Enable CodeLens (Experimental) - Enable CodeLens (Experimental) + Povolit funkci CodeLens (experimentální) Annotation prefix - Annotation prefix + Předpona poznámky Use colors in annotations - Use colors in annotations + Použít barvy v poznámkách diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf index f344152468..36398c9203 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf @@ -59,7 +59,7 @@ Number of projects whose data is cached in memory - Überprüfung der Projektcachegröße + Anzahl von Projekten, deren Daten im Arbeitsspeicher zwischengespeichert werden @@ -109,57 +109,57 @@ Time until stale results are used (in milliseconds) - Time until stale results are used (in milliseconds) + Zeit bis zur Verwendung veralteter Ergebnisse (in Millisekunden) IntelliSense Performance Options - IntelliSense Performance Options + Optionen zur IntelliSense-Leistung F# Project and Caching Performance Options - F# Project and Caching Performance Options + Optionen zur F#-Projekt- und Cacheleistung Enable stale data for IntelliSense features - Enable stale data for IntelliSense features + Veraltete Daten für IntelliSense-Features aktivieren In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. - In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + Bei projektübergreifenden In-Memory-Verweisen werden Daten auf Projektebene im Arbeitsspeicher abgelegt, damit IDE-Features projektübergreifend verwendet werden können. Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. - Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + Für IDE-Features werden Projektdaten zwischengespeichert. Bei höheren Werten wird mehr Arbeitsspeicher beansprucht, weil mehr Projekte zwischengespeichert werden. Die Optimierung dieses Werts besitzt keine Auswirkungen auf kleine oder mittelgroße Projektmappen. CodeLens - CodeLens + CodeLens Show annotations to the right instead of above the line - Show annotations to the right instead of above the line + Anmerkungen nicht oberhalb der Zeile, sondern rechts neben der Zeile anzeigen Enable CodeLens (Experimental) - Enable CodeLens (Experimental) + CodeLens aktivieren (experimentell) Annotation prefix - Annotation prefix + Anmerkungspräfix Use colors in annotations - Use colors in annotations + Farben in Anmerkungen verwenden diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf index e47998a5ae..6bec7285ca 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf @@ -59,7 +59,7 @@ Number of projects whose data is cached in memory - Tamaño de caché de comprobación de proyectos + Número de proyectos cuyos datos se almacenan en la memoria caché @@ -104,62 +104,62 @@ Show outlining and collapsible nodes for F# code - Mostrar los nodos de esquematización y contraíbles del código F# + Mostrar los nodos de esquematización y contraíbles del código de F# Time until stale results are used (in milliseconds) - Time until stale results are used (in milliseconds) + Tiempo hasta que se utilizan los resultados obsoletos (en milisegundos) IntelliSense Performance Options - IntelliSense Performance Options + Opciones de rendimiento de IntelliSense F# Project and Caching Performance Options - F# Project and Caching Performance Options + Opciones de rendimiento de almacenamiento en caché y proyectos de F# Enable stale data for IntelliSense features - Enable stale data for IntelliSense features + Habilitar datos obsoletos para características de IntelliSense In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. - In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + Las referencias en memoria entre proyectos almacenan los datos de nivel de proyecto en memoria para permitir que las características del IDE funcionen de unos proyectos a otros. Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. - Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + Los datos de proyecto se almacenan en caché para que funcionen las características del IDE. Los valores más altos utilizan más memoria porque se almacenan en caché más proyectos. El ajuste de este valor no debería afectar a soluciones de tamaño pequeño o medio. CodeLens - CodeLens + CodeLens Show annotations to the right instead of above the line - Show annotations to the right instead of above the line + Mostrar anotaciones a la derecha en lugar de encima de la línea Enable CodeLens (Experimental) - Enable CodeLens (Experimental) + Habilitar CodeLens (experimental) Annotation prefix - Annotation prefix + Prefijo de anotación Use colors in annotations - Use colors in annotations + Usar colores en anotaciones diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf index e663734d95..47ee2a2ddd 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf @@ -59,7 +59,7 @@ Number of projects whose data is cached in memory - Taille du cache de vérification du projet + Nombre de projets dont les données sont mises en cache dans la mémoire @@ -104,62 +104,62 @@ Show outlining and collapsible nodes for F# code - Afficher le mode plan et les nœuds réductibles pour le code F# + Afficher les nœuds de plan ou réductibles pour le code F# Time until stale results are used (in milliseconds) - Time until stale results are used (in milliseconds) + Délai avant l'utilisation des résultats périmés (en millisecondes) IntelliSense Performance Options - IntelliSense Performance Options + Options relatives aux performances d'IntelliSense F# Project and Caching Performance Options - F# Project and Caching Performance Options + Options relatives aux performances de la mise en cache et des projets F# Enable stale data for IntelliSense features - Enable stale data for IntelliSense features + Activer les données périmées pour les fonctionnalités IntelliSense In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. - In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + Les références inter-projets en mémoire stockent les données de niveau projet dans la mémoire pour permettre aux fonctionnalités de l'IDE de fonctionner sur plusieurs projets. Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. - Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + Les données de projet sont mises en cache pour les fonctionnalités de l'IDE. Les valeurs plus élevées utilisent plus de mémoire, car davantage de projets sont mis en cache. L'ajustement de cette valeur ne devrait pas affecter les petites ou moyennes solutions. CodeLens - CodeLens + CodeLens Show annotations to the right instead of above the line - Show annotations to the right instead of above the line + Afficher les annotations à droite plutôt qu'au-dessus de la ligne Enable CodeLens (Experimental) - Enable CodeLens (Experimental) + Activer CodeLens (expérimental) Annotation prefix - Annotation prefix + Préfixe d'annotation Use colors in annotations - Use colors in annotations + Utiliser des couleurs dans les annotations diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf index 107d6e418f..4df3cad4e6 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf @@ -59,7 +59,7 @@ Number of projects whose data is cached in memory - Dimensioni della cache di controllo del progetto + Numero di progetti i cui dati sono disponibili nella cache in memoria @@ -109,57 +109,57 @@ Time until stale results are used (in milliseconds) - Time until stale results are used (in milliseconds) + Intervallo di utilizzo dei risultati non aggiornati (in millisecondi) IntelliSense Performance Options - IntelliSense Performance Options + Opzioni per le prestazioni IntelliSense F# Project and Caching Performance Options - F# Project and Caching Performance Options + Opzioni per le prestazioni di memorizzazione nella cache e progetti F# Enable stale data for IntelliSense features - Enable stale data for IntelliSense features + Abilita dati non aggiornati per le funzionalità IntelliSense In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. - In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + I riferimenti tra progetti in memoria consentono di archiviare in memoria i dati a livello di progetto per consentire l'uso di funzionalità IDE tra progetti. Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. - Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + I dati del progetto sono memorizzati nella cache per le funzionalità IDE. Con valori più elevati viene usata una maggiore quantità di memoria perché nella cache viene memorizzato un numero maggiore di progetti. La disattivazione di questo valore non dovrebbe influire su soluzioni di piccole e medie dimensioni. CodeLens - CodeLens + CodeLens Show annotations to the right instead of above the line - Show annotations to the right instead of above the line + Mostra le annotazioni a destra anziché sopra la riga Enable CodeLens (Experimental) - Enable CodeLens (Experimental) + Abilita CodeLens (sperimentale) Annotation prefix - Annotation prefix + Prefisso annotazione Use colors in annotations - Use colors in annotations + Usa colori nelle annotazioni diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf index 5cc1e04063..979ba7d0a5 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf @@ -59,7 +59,7 @@ Number of projects whose data is cached in memory - プロジェクト チェックのキャッシュ サイズ + データがメモリ内にキャッシュされているプロジェクトの数 @@ -109,57 +109,57 @@ Time until stale results are used (in milliseconds) - Time until stale results are used (in milliseconds) + 古い結果が使用されるまでの時間 (ミリ秒) IntelliSense Performance Options - IntelliSense Performance Options + IntelliSense のパフォーマンス オプション F# Project and Caching Performance Options - F# Project and Caching Performance Options + F# プロジェクトとキャッシュのパフォーマンス オプション Enable stale data for IntelliSense features - Enable stale data for IntelliSense features + IntelliSense 機能に対して古いデータを有効にする In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. - In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + メモリ内のプロジェクト間参照に、プロジェクトをまたいで IDE 機能を動作可能にするプロジェクト レベルのデータが格納されます。 Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. - Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + IDE 機能のためにプロジェクト データがキャッシュされます。値を高くすると、キャッシュされるプロジェクトが多くなるため、メモリ使用量が増えます。この値の調整は、小規模または中規模のソリューションに影響しません。 CodeLens - CodeLens + CodeLens Show annotations to the right instead of above the line - Show annotations to the right instead of above the line + 注釈を行の上ではなく右に表示する Enable CodeLens (Experimental) - Enable CodeLens (Experimental) + CodeLens を有効にする (試験段階) Annotation prefix - Annotation prefix + 注釈のプレフィックス Use colors in annotations - Use colors in annotations + 注釈でカラーを使用する diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf index c25a055850..e199a658ef 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf @@ -59,7 +59,7 @@ Number of projects whose data is cached in memory - 프로젝트 검사 캐시 크기 + 메모리에 데이터가 캐시된 프로젝트 수 @@ -109,57 +109,57 @@ Time until stale results are used (in milliseconds) - Time until stale results are used (in milliseconds) + 부실 결과가 사용될 때까지 시간(밀리초) IntelliSense Performance Options - IntelliSense Performance Options + IntelliSense 성능 옵션 F# Project and Caching Performance Options - F# Project and Caching Performance Options + F# 프로젝트 및 캐싱 성능 옵션 Enable stale data for IntelliSense features - Enable stale data for IntelliSense features + IntelliSense 기능에 대해 부실 데이터 사용 In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. - In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + 메모리 내 크로스 프로젝트 참조가 메모리에 프로젝트 수준 데이터를 저장하여 IDE 기능이 프로젝트에서 작동하도록 합니다. Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. - Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + 프로젝트 데이터가 IDE 기능에 대해 캐시됩니다. 값이 클수록 프로제트가 더 많이 캐시되므로 메모리를 더 많이 사용합니다. 이 값을 조정해도 중소 규모 솔루션에 영향을 미치지 않습니다. CodeLens - CodeLens + CodeLens Show annotations to the right instead of above the line - Show annotations to the right instead of above the line + 선 위가 아니라 오른쪽에 주석 표시 Enable CodeLens (Experimental) - Enable CodeLens (Experimental) + CodeLens 사용(실험적) Annotation prefix - Annotation prefix + 주석 접두사 Use colors in annotations - Use colors in annotations + 주석에서 색 사용 diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf index d32e81df30..d1e98b2a03 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf @@ -59,7 +59,7 @@ Number of projects whose data is cached in memory - Rozmiar pamięci podręcznej sprawdzania projektu + Liczba projektów, które mają dane buforowane w pamięci @@ -109,57 +109,57 @@ Time until stale results are used (in milliseconds) - Time until stale results are used (in milliseconds) + Czas do użycia nieodświeżonych wyników (w milisekundach) IntelliSense Performance Options - IntelliSense Performance Options + Opcje wydajności IntelliSense F# Project and Caching Performance Options - F# Project and Caching Performance Options + Opcje wydajności buforowania i projektów F# Enable stale data for IntelliSense features - Enable stale data for IntelliSense features + Włącz dane nieodświeżone na potrzeby funkcji IntelliSense In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. - In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + Odwołania między projektami w pamięci przechowują dane na poziomie projektu w pamięci, aby umożliwić funkcjom środowiska IDE działanie w wielu projektach. Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. - Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + Dane projektów są buforowane na potrzeby funkcji środowiska IDE. Wyższe wartości powodują używanie większej ilości pamięci, ponieważ buforowanych jest więcej projektów. Dostrajanie tej wartości nie powinno mieć wpływu na małe ani średnie rozwiązania. CodeLens - CodeLens + CodeLens Show annotations to the right instead of above the line - Show annotations to the right instead of above the line + Pokaż adnotacje po prawej, a nie ponad wierszem Enable CodeLens (Experimental) - Enable CodeLens (Experimental) + Włącz funkcję CodeLens (eksperymentalna) Annotation prefix - Annotation prefix + Prefiks adnotacji Use colors in annotations - Use colors in annotations + Stosuj kolory w adnotacjach diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf index a928d2d109..2cc9825f37 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf @@ -59,7 +59,7 @@ Number of projects whose data is cached in memory - Tamanho do cache de verificação do projeto + Número de projetos cujos dados estão em cache na memória @@ -109,57 +109,57 @@ Time until stale results are used (in milliseconds) - Time until stale results are used (in milliseconds) + Tempo até que os resultados obsoletos sejam utilizados (em milissegundos) IntelliSense Performance Options - IntelliSense Performance Options + Opções de desempenho do IntelliSense F# Project and Caching Performance Options - F# Project and Caching Performance Options + Projeto em F# e opções de desempenho em cache Enable stale data for IntelliSense features - Enable stale data for IntelliSense features + Habilitar dados obsoletos para os recursos do IntelliSense In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. - In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + As referências entre projetos na memória armazenam os dados de nível de projeto na memória para permitir que os recursos do IDE funcionem nos projetos. Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. - Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + Os dados do projeto são colocados em cache para os recursos do IDE. Os valores mais altos utilizam mais memória porque mais projetos são colocados em cache. O ajuste desses valores não deve afetar as soluções de pequeno ou médio porte. CodeLens - CodeLens + CodeLens Show annotations to the right instead of above the line - Show annotations to the right instead of above the line + Mostrar anotações à direita da linha, em vez de acima dela Enable CodeLens (Experimental) - Enable CodeLens (Experimental) + Habilitar CodeLens (Experimental) Annotation prefix - Annotation prefix + Prefixo da anotação Use colors in annotations - Use colors in annotations + Usar cores em anotações diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf index 5aa3a0d436..05e4c974d6 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf @@ -59,7 +59,7 @@ Number of projects whose data is cached in memory - Размер кэша проверки проекта + Число проектов, данные которых кэшируются в памяти @@ -104,62 +104,62 @@ Show outlining and collapsible nodes for F# code - Показать структурирование и сворачиваемые узлы для кода F# + Показать структурирование и свертываемые узлы для кода F# Time until stale results are used (in milliseconds) - Time until stale results are used (in milliseconds) + Используются результаты времени до устаревания (в мс) IntelliSense Performance Options - IntelliSense Performance Options + Параметры производительности IntelliSense F# Project and Caching Performance Options - F# Project and Caching Performance Options + Проект F# и параметры производительности кэширования Enable stale data for IntelliSense features - Enable stale data for IntelliSense features + Включение устаревших данных для функций IntelliSense In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. - In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + Перекрестные ссылки между проектами в памяти хранят данные уровня проекта в памяти, поэтому функции и компоненты IDE могут работать в разных проектах. Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. - Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + Для функций и компонентов IDE используются кэшированные данные проекта. Более высокие значения потребляют больший объем памяти, так как кэшируется больше проектов. Настройка этого значения не должна влиять на решения небольших или средних размеров. CodeLens - CodeLens + CodeLens Show annotations to the right instead of above the line - Show annotations to the right instead of above the line + Показать примечания справа от строки, а не над ней Enable CodeLens (Experimental) - Enable CodeLens (Experimental) + Включить CodeLens (экспериментальная функция) Annotation prefix - Annotation prefix + Префикс примечания Use colors in annotations - Use colors in annotations + Использовать цветные примечания diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf index fb1d80ee99..8988b4a51e 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf @@ -59,7 +59,7 @@ Number of projects whose data is cached in memory - Proje denetimi önbelleği boyutu + Verileri bellekte önbelleğe alınan proje sayısı @@ -109,57 +109,57 @@ Time until stale results are used (in milliseconds) - Time until stale results are used (in milliseconds) + Eski sonuçların kullanılması için geçecek süre (milisaniye cinsinden) IntelliSense Performance Options - IntelliSense Performance Options + IntelliSense Performans Seçenekleri F# Project and Caching Performance Options - F# Project and Caching Performance Options + F# Proje ve Önbelleğe Alma Performansı Seçenekleri Enable stale data for IntelliSense features - Enable stale data for IntelliSense features + IntelliSense özellikleri için eski verileri etkinleştir In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. - In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + Bellek içi projeler arası başvurular, IDE özelliklerinin farklı projelerde çalışmasına imkan tanımak için bellekte proje düzeyi veriler depolar. Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. - Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + IDE özellikleri için proje verileri önbelleğe alınır. Değer yüksek olduğunda daha fazla proje önbelleğe alındığından daha fazla bellek kullanılır. Bu değerin ayarlanması küçük veya orta ölçekli çözümleri etkilememelidir. CodeLens - CodeLens + CodeLens Show annotations to the right instead of above the line - Show annotations to the right instead of above the line + Ek açıklamaları satırın üstü yerine sağ tarafta göster Enable CodeLens (Experimental) - Enable CodeLens (Experimental) + CodeLens’i Etkinleştir (Deneysel) Annotation prefix - Annotation prefix + Ek açıklama ön eki Use colors in annotations - Use colors in annotations + Ek açıklamalarda renk kullan diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf index 27f9a39a25..1a1c14ae7f 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf @@ -59,7 +59,7 @@ Number of projects whose data is cached in memory - 项目检查缓存大小 + 内存中缓存了其数据的项目数 @@ -104,62 +104,62 @@ Show outlining and collapsible nodes for F# code - 显示 F# 代码的大纲和可折叠节点 + 显示 F# 代码的大纲显示节点和可折叠节点 Time until stale results are used (in milliseconds) - Time until stale results are used (in milliseconds) + 使用过时结果前等待的时间(以毫秒计) IntelliSense Performance Options - IntelliSense Performance Options + IntelliSense 性能选项 F# Project and Caching Performance Options - F# Project and Caching Performance Options + F# 项目和缓存性能选项 Enable stale data for IntelliSense features - Enable stale data for IntelliSense features + 针对 IntelliSense 功能启用过时数据 In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. - In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + 内存中跨项目引用将项目级数据存储在内存中,让 IDE 功能能够跨项目工作。 Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. - Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + 针对 IDE 功能缓存项目数据。值越大,缓存的项目越多,因此使用的内存越多。调整此值不应影响小型或中型解决方案。 CodeLens - CodeLens + CodeLens Show annotations to the right instead of above the line - Show annotations to the right instead of above the line + 在行右侧而非上方显示批注 Enable CodeLens (Experimental) - Enable CodeLens (Experimental) + 启用 CodeLens (试验) Annotation prefix - Annotation prefix + 批注前缀 Use colors in annotations - Use colors in annotations + 在批注中使用颜色 diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf index 2f7dc68ba2..6fa74c80d1 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf @@ -59,7 +59,7 @@ Number of projects whose data is cached in memory - 專案檢查快取大小 + 資料會快取到記憶體的專案數 @@ -109,57 +109,57 @@ Time until stale results are used (in milliseconds) - Time until stale results are used (in milliseconds) + 使用過時結果前等待的時間 (毫秒) IntelliSense Performance Options - IntelliSense Performance Options + IntelliSense 效能選項 F# Project and Caching Performance Options - F# Project and Caching Performance Options + F# 專案與快取效能選項 Enable stale data for IntelliSense features - Enable stale data for IntelliSense features + 為 IntelliSense 功能啟用過時資料 In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. - In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. + 記憶體內跨專案參考,會在記憶體中儲存專案等級的資料,以允許 IDE 功能在各專案中皆可運作。 Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. - Project data is cached for IDE features. Higher values use more memory because more projects are cached. Tuning this value should not affect small or medium-sized solutions. + 專案資料會進行快取,供 IDE 功能使用。值較高時會使用較多的記憶體,這是因為會快取較多的專案數。調整此值應該不會影響中小型的解決方案。 CodeLens - CodeLens + CodeLens Show annotations to the right instead of above the line - Show annotations to the right instead of above the line + 在行的右方而非上方顯示註釋 Enable CodeLens (Experimental) - Enable CodeLens (Experimental) + 啟用 CodeLens (實驗性) Annotation prefix - Annotation prefix + 註釋前置詞 Use colors in annotations - Use colors in annotations + 在註釋中使用色彩 From 5b4b63344854db2ff5f5f7d64918ec7d41baf1e7 Mon Sep 17 00:00:00 2001 From: Gauthier Segay Date: Thu, 12 Jul 2018 22:57:41 -0700 Subject: [PATCH 085/150] update testguide.md relative to fsharpqa tests (#5160) * Adjustments to TESTGUIDE.md relative to usage of fsharpqa tests Tentative to add a .fsx test runner calling into perl, idea will be, once it is having tests pass, to make the script modify the test list file to tag arbitrary tests and run only those, and then revert the tagging. I'm not sure if this can be made to work consistently but it is worth trying. * make run.fsharpqa.test.fsx work * * add tests/fsharpqa/readme.md file, giving overview of the suite, description of file formats and describing a workflow when adding / fixing F# QA tests * mention above readme.md in TESTGUIDE.md * add helper project to FSharp.sln to navigate among the F# QA test files (find env.lst, source and log files, etc.) --- FSharp.sln | 17 ++++++++++ TESTGUIDE.md | 13 +++++--- tests/fsharpqa/fsharpqafiles.csproj | 16 ++++++++++ tests/fsharpqa/readme.md | 34 ++++++++++++++++++++ tests/fsharpqa/run.fsharpqa.test.fsx | 46 ++++++++++++++++++++++++++++ 5 files changed, 121 insertions(+), 5 deletions(-) create mode 100644 tests/fsharpqa/fsharpqafiles.csproj create mode 100644 tests/fsharpqa/readme.md create mode 100644 tests/fsharpqa/run.fsharpqa.test.fsx diff --git a/FSharp.sln b/FSharp.sln index 033b789a8b..246b1d02dd 100644 --- a/FSharp.sln +++ b/FSharp.sln @@ -39,6 +39,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{B8DDA694 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Libraries", "Libraries", "{3058BC79-8E79-4645-B05D-48CC182FA8A6}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "fsharpqafiles", "tests\fsharpqa\fsharpqafiles.csproj", "{AAAAD274-696A-49EC-AAAA-F870BE91AAAA}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -181,6 +183,17 @@ Global {88E2D422-6852-46E3-A740-83E391DC7973}.Release|Any CPU.Build.0 = Release|Any CPU {88E2D422-6852-46E3-A740-83E391DC7973}.Release|x86.ActiveCfg = Release|Any CPU {88E2D422-6852-46E3-A740-83E391DC7973}.Release|x86.Build.0 = Release|Any CPU + {AAAAD274-696A-49EC-AAAA-F870BE91AAAA}.Debug|Any CPU.ActiveCfg = Debug|x86 + {AAAAD274-696A-49EC-AAAA-F870BE91AAAA}.Debug|x86.ActiveCfg = Debug|x86 + {AAAAD274-696A-49EC-AAAA-F870BE91AAAA}.Debug|x86.Build.0 = Debug|x86 + {AAAAD274-696A-49EC-AAAA-F870BE91AAAA}.Proto|Any CPU.ActiveCfg = Debug|x86 + {AAAAD274-696A-49EC-AAAA-F870BE91AAAA}.Proto|Any CPU.Build.0 = Debug|x86 + {AAAAD274-696A-49EC-AAAA-F870BE91AAAA}.Proto|x86.ActiveCfg = Debug|x86 + {AAAAD274-696A-49EC-AAAA-F870BE91AAAA}.Proto|x86.Build.0 = Debug|x86 + {AAAAD274-696A-49EC-AAAA-F870BE91AAAA}.Release|Any CPU.ActiveCfg = Debug|x86 + {AAAAD274-696A-49EC-AAAA-F870BE91AAAA}.Release|Any CPU.Build.0 = Debug|x86 + {AAAAD274-696A-49EC-AAAA-F870BE91AAAA}.Release|x86.ActiveCfg = Debug|x86 + {AAAAD274-696A-49EC-AAAA-F870BE91AAAA}.Release|x86.Build.0 = Debug|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -197,5 +210,9 @@ Global {C163E892-5BF7-4B59-AA99-B0E8079C67C4} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449} {A8D9641A-9170-4CF4-8FE0-6DB8C134E1B5} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449} {88E2D422-6852-46E3-A740-83E391DC7973} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449} + {AAAAD274-696A-49EC-AAAA-F870BE91AAAA} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {BD5177C7-1380-40E7-94D2-7768E1A8B1B8} EndGlobalSection EndGlobal diff --git a/TESTGUIDE.md b/TESTGUIDE.md index 9cb6377f0a..7d63576752 100644 --- a/TESTGUIDE.md +++ b/TESTGUIDE.md @@ -12,10 +12,7 @@ To run tests, use variations such as the following, depending on which test suit ## Prerequisites -In order to run the FSharpQA suite, you will need to install [Perl](http://www.perl.org/get.html) (ActiveState Perl 5.16.3 is known to work fine). -Perl must be included in the `%PATH%` for the below steps to work. It is also recommended that you run tests from an elevated command prompt, as there are a couple of test cases which require administrative privileges. - -The Perl requirement is gradually being removed. +It is recommended that you run tests from an elevated command prompt, as there are a couple of test cases which require administrative privileges. ## Test Suites @@ -47,12 +44,18 @@ See note about baseline under "Other Tips" bellow for tests checking expectation ### FSharpQA Suite +The FSharpQA suite relies on [Perl](http://www.perl.org/get.html), StrawberryPerl64 package from nuget is used automatically by the test suite. + These tests use the `RunAll.pl` framework to execute, however the easiest way to run them is via the `build.cmd` script, see [usage examples](https://github.com/Microsoft/visualfsharp/blob/master/build.cmd#L31). Tests are grouped in folders per area. Each folder contains a number of source code files and a single `env.lst` file. The `env.lst` file defines a series of test cases, one per line. -Each test case runs an optional "pre command," compiles a given set of source files using given flags, optionally runs the resulting binary, then optionally runs a final "post command." + +Each test case runs an optional "pre command," compiles a given set of source files using given flags, optionally runs the resulting binary, then optionally runs a final "post command". + If all of these steps complete without issue, the test is considered to have passed. +Read more at [tests/fsharpqa/readme.md](tests/fsharpqa/readme.md). + #### Test lists For the FSharpQA suite, the list of test areas and their associated "tags" is stored at diff --git a/tests/fsharpqa/fsharpqafiles.csproj b/tests/fsharpqa/fsharpqafiles.csproj new file mode 100644 index 0000000000..d014c7a309 --- /dev/null +++ b/tests/fsharpqa/fsharpqafiles.csproj @@ -0,0 +1,16 @@ + + + + {AAAAD274-696A-49EC-AAAA-F870BE91AAAA} + v4.6.2 + + + + + + + + + + + \ No newline at end of file diff --git a/tests/fsharpqa/readme.md b/tests/fsharpqa/readme.md new file mode 100644 index 0000000000..88bda09b36 --- /dev/null +++ b/tests/fsharpqa/readme.md @@ -0,0 +1,34 @@ +# F# QA Tests + +## Layout description + +### Source/test.lst + +This file is the entry point in the test discovery system of F# QA suite. + +About the format: +* lines starting with `#` are considered as comments, +* each entry is defined in a single line +* elements within entry are tab delimited +** first element is a comma separated list of tags classifying the tests of that entry +** last element is the folder containing the tests +* each of the entries' folder have a `env.lst` file listing individual tests + +### env.lst + +(TODO, describe the format) + +## Workflow when adding or fixing tests + +You can use [run.fsharpqa.test.fsx](run.fsharpqa.test.fsx) script, and edit the end of it to specify which classifying tag you are working with. Evaluating the script should run the relevant tests. + +A convenience "fsharpqafiles.csproj" project is located in the fsharp.sln solution, the only purpose is to facillitate navigation to test files that frequently need to be edited from within the IDE/text editor environment. + +* edit Source/test.lst, find the entry you like to work with and give it a unique tag (e.g. "RERUN") +* within the suite, if you are only interested about a specific test, you can comment lines in `env.lst` files by prepending those with `#` +* adjust [run.fsharpqa.test.fsx](run.fsharpqa.test.fsx) and evaluate it +* open `../TestResults/runpl.log` which should contain failures or be empty (in which cases, your tests are passing). +* adjust the tests and repeat from step 2 + +(TODO, provide some guidance about how to define env.lst files) + diff --git a/tests/fsharpqa/run.fsharpqa.test.fsx b/tests/fsharpqa/run.fsharpqa.test.fsx new file mode 100644 index 0000000000..101e41f7a2 --- /dev/null +++ b/tests/fsharpqa/run.fsharpqa.test.fsx @@ -0,0 +1,46 @@ +// Work In Progress +// this script helps run a subset of the fsharpqa tests without calling a full build.cmd + +open System.IO +open System.Diagnostics + +let releaseOrDebug = "Debug" +let setEnvVar name value = + System.Environment.SetEnvironmentVariable(name, value) + +let addToPath path = + let currentPath = System.Environment.GetEnvironmentVariable "PATH" + + let splits = currentPath.Split(Path.PathSeparator) + if not(Array.contains path splits) then + setEnvVar "PATH" (path + (string Path.PathSeparator) + currentPath) + +let rootFolder = Path.Combine(__SOURCE_DIRECTORY__, "..", "..") +let compilerBinFolder = Path.Combine(rootFolder, releaseOrDebug, "net40", "bin") +setEnvVar "CSC_PIPE" (Path.Combine(rootFolder, "packages", "Microsoft.Net.Compilers.2.7.0", "tools", "csc.exe")) +setEnvVar "FSC" (Path.Combine(compilerBinFolder, "fsc.exe")) +setEnvVar "FSCOREDLLPATH" (Path.Combine(compilerBinFolder, "FSharp.Core.dll")) +addToPath compilerBinFolder + +let runPerl arguments = + // a bit expeditive, but does the deed + Process.GetProcessesByName("perl") |> Array.iter (fun p -> p.Kill()) + use perlProcess = new Process() + perlProcess.StartInfo.set_FileName (Path.Combine(rootFolder, "packages", "StrawberryPerl64.5.22.2.1", "Tools", "perl", "bin", "perl.exe")) + perlProcess.StartInfo.set_Arguments (arguments |> Array.map(fun a -> @"""" + a + @"""") |> String.concat " ") + perlProcess.StartInfo.set_WorkingDirectory (Path.Combine(rootFolder, "tests", "fsharpqa", "source")) + perlProcess.StartInfo.set_RedirectStandardOutput true + perlProcess.StartInfo.set_RedirectStandardError true + perlProcess.StartInfo.set_UseShellExecute false + perlProcess.Start() |> ignore + while (not perlProcess.StandardOutput.EndOfStream) do + perlProcess.StandardOutput.ReadLine() |> printfn "%s" + while (not perlProcess.StandardError.EndOfStream) do + perlProcess.StandardError.ReadLine() |> printfn "%s" + perlProcess.WaitForExit() + if perlProcess.ExitCode <> 0 then + failwithf "exit code: %i" perlProcess.ExitCode + +let testResultDir = Path.Combine(rootFolder, "tests", "TestResults") +let perlScript = Path.Combine(rootFolder, "tests", "fsharpqa", "testenv", "bin", "runall.pl") +runPerl [|perlScript; "-resultsroot";testResultDir ;"-ttags:Conformance06"|] \ No newline at end of file From 781b410032be8d822e7ef6b113deeefb280336fd Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Fri, 13 Jul 2018 21:19:42 +0200 Subject: [PATCH 086/150] Optimize truncate for n = 0 (#5099) Thanks for this. --- src/fsharp/FSharp.Core/local.fs | 13 +++++++------ src/fsharp/FSharp.Core/seq.fs | 1 + 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/fsharp/FSharp.Core/local.fs b/src/fsharp/FSharp.Core/local.fs index f89ae5b3c0..779b543cd2 100644 --- a/src/fsharp/FSharp.Core/local.fs +++ b/src/fsharp/FSharp.Core/local.fs @@ -756,12 +756,13 @@ module internal List = truncateToFreshConsTail cons2 (count-1) t let truncate count list = - match list with - | [] -> list - | _ :: ([] as nil) -> if count > 0 then list else nil - | h::t -> - if count <= 0 then [] - else + if count <= 0 then + [] + else + match list with + | [] + | [_] -> list + | h::t -> let cons = freshConsNoTail h truncateToFreshConsTail cons (count-1) t cons diff --git a/src/fsharp/FSharp.Core/seq.fs b/src/fsharp/FSharp.Core/seq.fs index 1397c2475d..f057e8f3fd 100644 --- a/src/fsharp/FSharp.Core/seq.fs +++ b/src/fsharp/FSharp.Core/seq.fs @@ -852,6 +852,7 @@ namespace Microsoft.FSharp.Collections [] let truncate count (source: seq<'T>) = checkNonNull "source" source + if count <= 0 then empty else seq { let i = ref 0 use ie = source.GetEnumerator() while !i < count && ie.MoveNext() do From 8d39484bf1b3b6b6e558ebb111c8d1b4795e3c42 Mon Sep 17 00:00:00 2001 From: Vasily Kirichenko Date: Fri, 13 Jul 2018 22:23:49 +0300 Subject: [PATCH 087/150] add parent's path to nested classes' entity path (#5297) --- src/fsharp/NameResolution.fs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/fsharp/NameResolution.fs b/src/fsharp/NameResolution.fs index 6dc2e35f23..cf4d50c4a2 100644 --- a/src/fsharp/NameResolution.fs +++ b/src/fsharp/NameResolution.fs @@ -2909,7 +2909,8 @@ let rec ResolveTypeLongIdentPrim sink (ncenv:NameResolver) occurence first fully | OpenQualified -> match LookupTypeNameInEnvHaveArity fullyQualified id.idText staticResInfo.NumStaticArgs nenv with | Some tcref when IsEntityAccessible ncenv.amap m2 ad tcref -> - OneResult (ResolveTypeLongIdentInTyconRefPrim ncenv typeNameResInfo ad ResolutionInfo.Empty genOk 1 m2 tcref id2 rest2) + let resInfo = ResolutionInfo.Empty.AddEntity(id.idRange, tcref) + OneResult (ResolveTypeLongIdentInTyconRefPrim ncenv typeNameResInfo ad resInfo genOk 1 m2 tcref id2 rest2) | _ -> NoResultsOrUsefulErrors From c9f74092003431400bd8f4483e258bad46ca67f7 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Fri, 13 Jul 2018 18:20:23 -0700 Subject: [PATCH 088/150] Move nuget packages to templates vsix (#5330) --- .../Template/ConsoleApplication.vstemplate | 2 +- .../LibraryProject/Template/Library.vstemplate | 2 +- .../TutorialProject/Template/Tutorial.vstemplate | 2 +- .../Vsix/VisualFSharpFull/VisualFSharpFull.csproj | 10 ---------- .../VisualFSharpTemplates/VisualFSharpTemplates.csproj | 10 ++++++++++ 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.vstemplate b/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.vstemplate index 193eab4557..90f50e2d6d 100644 --- a/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.vstemplate +++ b/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.vstemplate @@ -25,7 +25,7 @@ NuGet.VisualStudio.TemplateWizard - + diff --git a/vsintegration/ProjectTemplates/LibraryProject/Template/Library.vstemplate b/vsintegration/ProjectTemplates/LibraryProject/Template/Library.vstemplate index 7473220c3b..db3850602d 100644 --- a/vsintegration/ProjectTemplates/LibraryProject/Template/Library.vstemplate +++ b/vsintegration/ProjectTemplates/LibraryProject/Template/Library.vstemplate @@ -25,7 +25,7 @@ NuGet.VisualStudio.TemplateWizard - + diff --git a/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.vstemplate b/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.vstemplate index 53b273e1aa..1fe64c81c8 100644 --- a/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.vstemplate +++ b/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.vstemplate @@ -23,7 +23,7 @@ NuGet.VisualStudio.TemplateWizard - + diff --git a/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj b/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj index 0a7a71da1b..71c698df42 100644 --- a/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj +++ b/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj @@ -23,16 +23,6 @@ License.txt true - - PreserveNewest - packages\FSharp.Core.4.5.0.nupkg - true - - - PreserveNewest - packages\System.ValueTuple.4.4.0.nupkg - true - PreserveNewest FSharp.Data.TypeProviders.dll diff --git a/vsintegration/Vsix/VisualFSharpTemplates/VisualFSharpTemplates.csproj b/vsintegration/Vsix/VisualFSharpTemplates/VisualFSharpTemplates.csproj index c3a446ae60..97600c9671 100644 --- a/vsintegration/Vsix/VisualFSharpTemplates/VisualFSharpTemplates.csproj +++ b/vsintegration/Vsix/VisualFSharpTemplates/VisualFSharpTemplates.csproj @@ -11,6 +11,16 @@ + + PreserveNewest + packages\FSharp.Core.4.5.0.nupkg + true + + + PreserveNewest + packages\System.ValueTuple.4.4.0.nupkg + true + Designer From 816a5a25b4a8bea43b72eb41bb55589d7605a1cd Mon Sep 17 00:00:00 2001 From: Will Smith Date: Fri, 13 Jul 2018 18:21:23 -0700 Subject: [PATCH 089/150] Minor ref scoping fixes (#5317) * Slight change to error messages. Disallow any locals from address returning in obj expression methods and delegates * Added more tests * Updating baselines * Renamed IsLimitOutsideScope --- src/fsharp/FSComp.txt | 17 ++++--- src/fsharp/PostInferenceChecks.fs | 56 +++++++++++------------- src/fsharp/xlf/FSComp.txt.cs.xlf | 5 --- src/fsharp/xlf/FSComp.txt.de.xlf | 5 --- src/fsharp/xlf/FSComp.txt.en.xlf | 5 --- src/fsharp/xlf/FSComp.txt.es.xlf | 5 --- src/fsharp/xlf/FSComp.txt.fr.xlf | 5 --- src/fsharp/xlf/FSComp.txt.it.xlf | 5 --- src/fsharp/xlf/FSComp.txt.ja.xlf | 5 --- src/fsharp/xlf/FSComp.txt.ko.xlf | 5 --- src/fsharp/xlf/FSComp.txt.pl.xlf | 5 --- src/fsharp/xlf/FSComp.txt.pt-BR.xlf | 5 --- src/fsharp/xlf/FSComp.txt.ru.xlf | 5 --- src/fsharp/xlf/FSComp.txt.tr.xlf | 5 --- src/fsharp/xlf/FSComp.txt.zh-Hans.xlf | 5 --- src/fsharp/xlf/FSComp.txt.zh-Hant.xlf | 5 --- tests/fsharp/core/byrefs/test.bsl | 6 +-- tests/fsharp/core/byrefs/test2.bsl | 4 ++ tests/fsharp/core/byrefs/test2.fsx | 22 +++++----- tests/fsharp/core/span/test.bsl | 10 ++--- tests/fsharp/core/span/test2.bsl | 22 ++++++---- tests/fsharp/core/span/test2.fsx | 35 +++++++++++++++ tests/fsharp/typecheck/sigs/neg106.bsl | 4 +- tests/fsharp/typecheck/sigs/neg106.vsbsl | 4 +- tests/fsharp/typecheck/sigs/neg107.bsl | 10 ++--- tests/fsharp/typecheck/sigs/neg107.vsbsl | 10 ++--- 26 files changed, 119 insertions(+), 151 deletions(-) diff --git a/src/fsharp/FSComp.txt b/src/fsharp/FSComp.txt index 3b058f3a8f..45b1fd97ac 100644 --- a/src/fsharp/FSComp.txt +++ b/src/fsharp/FSComp.txt @@ -1431,12 +1431,11 @@ notAFunctionButMaybeDeclaration,"This value is not a function and cannot be appl 3226,tcByrefReturnImplicitlyDereferenced,"A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'." 3227,tcByRefLikeNotStruct,"A type annotated with IsByRefLike must also be a struct. Consider adding the [] attribute to the type." 3228,chkNoByrefAddressOfValueFromExpression,"The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope." -3229,chkNoReturnOfLimitedSpan,"The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope." -3230,chkNoWriteToLimitedSpan,"This value can't be assigned because the target '%s' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope." -3231,tastValueMustBeLocal,"A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...'" -3232,tcIsReadOnlyNotStruct,"A type annotated with IsReadOnly must also be a struct. Consider adding the [] attribute to the type." -3234,chkStructsMayNotReturnAddressesOfContents,"Struct members cannot return the address of fields of the struct by reference" -3235,chkNoByrefLikeFunctionCall,"The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope." -3236,chkNoSpanLikeVariable,"The Span or IsByRefLike variable '%s' cannot be used at this point. This is to ensure the address of the local value does not escape its scope." -3237,chkNoSpanLikeValueFromExpression,"A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope." -3238,tastCantTakeAddressOfExpression,"Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address." \ No newline at end of file +3229,chkNoWriteToLimitedSpan,"This value can't be assigned because the target '%s' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope." +3230,tastValueMustBeLocal,"A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...'" +3231,tcIsReadOnlyNotStruct,"A type annotated with IsReadOnly must also be a struct. Consider adding the [] attribute to the type." +3232,chkStructsMayNotReturnAddressesOfContents,"Struct members cannot return the address of fields of the struct by reference" +3233,chkNoByrefLikeFunctionCall,"The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope." +3234,chkNoSpanLikeVariable,"The Span or IsByRefLike variable '%s' cannot be used at this point. This is to ensure the address of the local value does not escape its scope." +3235,chkNoSpanLikeValueFromExpression,"A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope." +3236,tastCantTakeAddressOfExpression,"Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address." \ No newline at end of file diff --git a/src/fsharp/PostInferenceChecks.fs b/src/fsharp/PostInferenceChecks.fs index 8df140f1c7..68309091b3 100644 --- a/src/fsharp/PostInferenceChecks.fs +++ b/src/fsharp/PostInferenceChecks.fs @@ -496,20 +496,33 @@ type PermitByRefExpr = /// Context allows for byref typed expr, but the byref must be returnable | YesReturnable + /// Context allows for byref typed expr, but the byref must be returnable and a non-local + | YesReturnableNonLocal + /// General (address-of expr and byref values not allowed) | No member context.Disallow = match context with | PermitByRefExpr.Yes - | PermitByRefExpr.YesReturnable -> false + | PermitByRefExpr.YesReturnable + | PermitByRefExpr.YesReturnableNonLocal -> false | _ -> true member context.PermitOnlyReturnable = match context with - | PermitByRefExpr.YesReturnable -> true + | PermitByRefExpr.YesReturnable + | PermitByRefExpr.YesReturnableNonLocal -> true + | _ -> false + + member context.PermitOnlyReturnableNonLocal = + match context with + | PermitByRefExpr.YesReturnableNonLocal -> true | _ -> false +let inline IsLimitEscapingScope env (context: PermitByRefExpr) limit = + (limit.scope >= env.returnScope || (limit.IsLocal && context.PermitOnlyReturnableNonLocal)) + let mkArgsPermit n = if n=1 then PermitByRefExpr.Yes else PermitByRefExpr.YesTupleOfArgs n @@ -678,7 +691,7 @@ and CheckValUse (cenv: cenv) (env: env) (vref: ValRef, vFlags, m) (context: Perm // &y let isReturnExprBuiltUsingStackReferringByRefLike = context.PermitOnlyReturnable && - ((HasLimitFlag LimitFlags.ByRef limit && limit.scope >= env.returnScope) || + ((HasLimitFlag LimitFlags.ByRef limit && IsLimitEscapingScope env context limit) || HasLimitFlag LimitFlags.StackReferringSpanLike limit) if isReturnExprBuiltUsingStackReferringByRefLike then @@ -760,7 +773,7 @@ and CheckCallLimitArgs cenv env m returnTy limitArgs (context: PermitByRefExpr) HasLimitFlag LimitFlags.ByRefOfStackReferringSpanLike limitArgs) if cenv.reportErrors then - if context.PermitOnlyReturnable && ((isReturnLimitedByRef && limitArgs.scope >= env.returnScope) || isReturnLimitedSpanLike) then + if context.PermitOnlyReturnable && ((isReturnLimitedByRef && IsLimitEscapingScope env context limitArgs) || isReturnLimitedSpanLike) then if isReturnLimitedSpanLike then errorR(Error(FSComp.SR.chkNoSpanLikeValueFromExpression(), m)) else @@ -830,24 +843,6 @@ and CheckCallWithReceiver cenv env m returnTy args contexts context = limitArgs CheckCallLimitArgs cenv env m returnTy limitArgs context -/// Check call arguments, including the return argument. Permits returnable byref. -and CheckCallPermitReturnableByRef cenv env m returnTy args = - let limitArgs = CheckExprsPermitByRefLike cenv env args - CheckCallLimitArgs cenv env m returnTy limitArgs PermitByRefExpr.YesReturnable - -/// Check call arguments, including the return argument. The receiver argument is handled differently. Permits returnable byref. -and CheckCallWithReceiverPermitReturnableByRef cenv env m returnTy args = - CheckCallWithReceiver cenv env m returnTy args (List.init args.Length (fun _ -> PermitByRefExpr.Yes)) PermitByRefExpr.YesReturnable - -/// Check call arguments, including the return argument. Permits byref. -and CheckCallPermitByRefLike cenv env m returnTy args = - let limitArgs = CheckExprsPermitByRefLike cenv env args - CheckCallLimitArgs cenv env m returnTy limitArgs PermitByRefExpr.Yes - -/// Check call arguments, including the return argument. The receiver argument is handled differently. Permits byref. -and CheckCallWithReceiverPermitByRefLike cenv env m returnTy args = - CheckCallWithReceiver cenv env m returnTy args (List.init args.Length (fun _ -> PermitByRefExpr.Yes)) PermitByRefExpr.Yes - /// Check an expression, given information about the position of the expression and CheckExpr (cenv:cenv) (env:env) origExpr (context:PermitByRefExpr) : Limit = let g = cenv.g @@ -1049,9 +1044,7 @@ and CheckMethod cenv env baseValOpt (TObjExprMethod(_,attribs,tps,vs,body,m)) = CheckAttribs cenv env attribs CheckNoReraise cenv None body CheckEscapes cenv true m (match baseValOpt with Some x -> x:: vs | None -> vs) body |> ignore - let limit = CheckExprPermitReturnableByRef cenv env body - if HasLimitFlag LimitFlags.StackReferringSpanLike limit then - errorR(Error(FSComp.SR.chkNoReturnOfLimitedSpan(), body.Range)) + CheckExpr cenv { env with returnScope = env.returnScope + 1 } body PermitByRefExpr.YesReturnableNonLocal |> ignore and CheckInterfaceImpls cenv env baseValOpt l = l |> List.iter (CheckInterfaceImpl cenv env baseValOpt) @@ -1101,17 +1094,20 @@ and CheckExprOp cenv env (op,tyargs,args,m) context expr = not args.IsEmpty let returnTy = tyOfExpr g expr + + let argContexts = List.init args.Length (fun _ -> PermitByRefExpr.Yes) + match tys with | [ty] when context.PermitOnlyReturnable && isByrefLikeTy g m ty -> if hasReceiver then - CheckCallWithReceiverPermitReturnableByRef cenv env m returnTy args + CheckCallWithReceiver cenv env m returnTy args argContexts context else - CheckCallPermitReturnableByRef cenv env m returnTy args + CheckCall cenv env m returnTy args argContexts context | _ -> if hasReceiver then - CheckCallWithReceiverPermitByRefLike cenv env m returnTy args + CheckCallWithReceiver cenv env m returnTy args argContexts PermitByRefExpr.Yes else - CheckCallPermitByRefLike cenv env m returnTy args + CheckCall cenv env m returnTy args argContexts PermitByRefExpr.Yes | TOp.Tuple tupInfo,_,_ when not (evalTupInfoIsStruct tupInfo) -> match context with @@ -1139,7 +1135,7 @@ and CheckExprOp cenv env (op,tyargs,args,m) context expr = let returningAddrOfLocal = context.PermitOnlyReturnable && HasLimitFlag LimitFlags.ByRef limit && - limit.scope >= env.returnScope + IsLimitEscapingScope env context limit if returningAddrOfLocal then if vref.IsCompilerGenerated then diff --git a/src/fsharp/xlf/FSComp.txt.cs.xlf b/src/fsharp/xlf/FSComp.txt.cs.xlf index 2790a73ff0..c35b624ab8 100644 --- a/src/fsharp/xlf/FSComp.txt.cs.xlf +++ b/src/fsharp/xlf/FSComp.txt.cs.xlf @@ -7012,11 +7012,6 @@ Adresa proměnné {0} nebo související výraz nejde v tomto bodě použít. Je tím zajištěno, aby adresa lokální hodnoty neunikla ze svého rozsahu. - - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - Výraz Span nebo IsByRefLike nejde vrátit z této funkce nebo metody, protože se skládá pomocí elementů, které můžou uniknout ze svého rozsahu. - - This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. Tuto hodnotu nejde přiřadit, protože cíl {0} může odkazovat na paměť, která nepoužívá lokální zásobník (non-stack-local), zatímco přiřazovaný výraz je vyhodnocený tak, že může případně odkazovat na paměť s lokálním zásobníkem (stack-local). Díky tomu se zabraňuje, aby ukazatele na paměť svázanou se zásobníkem (stack-bound) unikly ze svého rozsahu. diff --git a/src/fsharp/xlf/FSComp.txt.de.xlf b/src/fsharp/xlf/FSComp.txt.de.xlf index 330b8a9c15..6473c1ca2e 100644 --- a/src/fsharp/xlf/FSComp.txt.de.xlf +++ b/src/fsharp/xlf/FSComp.txt.de.xlf @@ -7012,11 +7012,6 @@ Die Adresse der Variablen "{0}" oder ein entsprechender Ausdruck kann zu diesem Zeitpunkt nicht verwendet werden. Hierdurch wird sichergestellt, dass die Adresse des lokalen Werts den zugehörigen Bereich nicht verlässt. - - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - Der Ausdruck "Span" oder "IsByRefLike" kann von dieser Funktion oder Methode nicht zurückgegeben werden, weil er anhand von Elementen zusammengestellt wurde, die möglicherweise ihren Bereich verlassen. - - This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. Dieser Wert kann nicht zugewiesen werden, weil das Ziel "{0}" möglicherweise auf einen lokalen Nicht-Stapel-Arbeitsspeicher verweist, während der zugewiesene Ausdruck laut Auswertung möglicherweise auf einen lokalen Stapelarbeitsspeicher verweist. So wird verhindert, dass Zeiger auf stapelgebundenen Arbeitsspeicher ihren Bereich verlassen. diff --git a/src/fsharp/xlf/FSComp.txt.en.xlf b/src/fsharp/xlf/FSComp.txt.en.xlf index 3d980b3618..201f95f601 100644 --- a/src/fsharp/xlf/FSComp.txt.en.xlf +++ b/src/fsharp/xlf/FSComp.txt.en.xlf @@ -7012,11 +7012,6 @@ The address of the variable '{0}' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - - This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. diff --git a/src/fsharp/xlf/FSComp.txt.es.xlf b/src/fsharp/xlf/FSComp.txt.es.xlf index b5b5847fcf..b0d681b1a7 100644 --- a/src/fsharp/xlf/FSComp.txt.es.xlf +++ b/src/fsharp/xlf/FSComp.txt.es.xlf @@ -7012,11 +7012,6 @@ En este punto, no se puede usar la dirección de la variable “{0}” o una expresión relacionada. Esto es para asegurar que la dirección del valor local no escape de su ámbito. - - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - Esta función o este método no puede devolver la expresión Span o IsByRefLike, porque está compuesta por elementos que pueden escapar de su ámbito. - - This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. No se puede asignar este valor porque el destino “{0}” puede hacer referencia a memoria local fuera de la pila, mientras que la expresión que se va a asignar podría hacer referencia a memoria local de la pila. Esto es para evitar que los punteros de memoria ligada a la pila escapen de su ámbito. diff --git a/src/fsharp/xlf/FSComp.txt.fr.xlf b/src/fsharp/xlf/FSComp.txt.fr.xlf index 5e170980a8..67a531340f 100644 --- a/src/fsharp/xlf/FSComp.txt.fr.xlf +++ b/src/fsharp/xlf/FSComp.txt.fr.xlf @@ -7012,11 +7012,6 @@ L'adresse de la variable '{0}' ou une expression associée ne peut pas être utilisée à ce stade. Cela permet de s'assurer que l'adresse de la valeur locale ne sort pas de sa portée. - - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - L'expression Span ou IsByRefLike ne peut pas être retournée à partir de cette fonction ou méthode, car elle est composée d'éléments qui peuvent sortir de leur portée. - - This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. Impossible d’affecter cette valeur car la cible '{0}' peut faire référence à une mémoire non locale (hors de la pile), tandis que l'expression en cours d’affectation est évaluée comme faisant potentiellement référence à une mémoire locale (dans la pile). Cela permet d'éviter que les pointeurs vers la mémoire liée à la pile ne sortent de leur portée. diff --git a/src/fsharp/xlf/FSComp.txt.it.xlf b/src/fsharp/xlf/FSComp.txt.it.xlf index 27fe33fcc3..be2e50ff23 100644 --- a/src/fsharp/xlf/FSComp.txt.it.xlf +++ b/src/fsharp/xlf/FSComp.txt.it.xlf @@ -7012,11 +7012,6 @@ In questo punto non è possibile usare l'indirizzo della variabile '{0}' o un'espressione correlata. Questo serve ad assicurare che l'indirizzo del valore locale non ignori il relativo ambito. - - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - Questa funzione o questo metodo non può restituire l'espressione Span o IsByRefLike perché è composta usando elementi che potrebbero ignorare il relativo ambito. - - This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. Non è possibile assegnare questo valore perché l'elemento '{0}' di destinazione può fare riferimento alla memoria locale non stack, mentre l'espressione da assegnare viene valutata in modo da fare potenzialmente riferimento alla memoria locale stack. Tale comportamento consente di evitare puntatori a memoria associata allo stack che ignorano il relativo ambito. diff --git a/src/fsharp/xlf/FSComp.txt.ja.xlf b/src/fsharp/xlf/FSComp.txt.ja.xlf index 41a9631d63..66c7b08581 100644 --- a/src/fsharp/xlf/FSComp.txt.ja.xlf +++ b/src/fsharp/xlf/FSComp.txt.ja.xlf @@ -7012,11 +7012,6 @@ 現時点で、変数 '{0}' または関連する式のアドレスは使用できません。これは、ローカル値のアドレスがスコープを回避しないようにするためです。 - - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - この関数またはメソッドから Span または IsByRefLike 式を返すことはできません。スコープを回避できる要素を使用してその式が作成されているためです。 - - This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. この値をターゲット '{0}' に割り当てることはできません。このターゲットは非スタック ローカルのメモリを参照できるのに対して、割り当てられる式はスタック ローカルのメモリに評価される可能性があるためです。これは、スタックにバインドされたメモリへのポインターが自身のスコープを回避することを防止するために役立ちます。 diff --git a/src/fsharp/xlf/FSComp.txt.ko.xlf b/src/fsharp/xlf/FSComp.txt.ko.xlf index 6fee6c0f91..379b9edb25 100644 --- a/src/fsharp/xlf/FSComp.txt.ko.xlf +++ b/src/fsharp/xlf/FSComp.txt.ko.xlf @@ -7012,11 +7012,6 @@ 지금은 '{0}' 변수의 주소 또는 관련 식을 사용할 수 없습니다. 로컬 값의 주소가 범위를 벗어나지 않도록 하기 위한 것입니다. - - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - 범위를 벗어날 수 있는 요소를 사용하여 구성되므로 이 함수 또는 메서드에서 Span 또는 IsByRefLike 식을 반환할 수 없습니다. - - This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. '{0}' 대상이 비스택 로컬 메모리를 참조할 수 있는데, 할당되는 식은 잠재적으로 스택 로컬 메모리를 참조하도록 평가되므로 이 값을 할당할 수 없습니다. 스택에 바인딩된 메모리에 대한 포인터가 범위를 벗어나지 않도록 하기 위한 것입니다. diff --git a/src/fsharp/xlf/FSComp.txt.pl.xlf b/src/fsharp/xlf/FSComp.txt.pl.xlf index c596dbd0cb..5e296e9a85 100644 --- a/src/fsharp/xlf/FSComp.txt.pl.xlf +++ b/src/fsharp/xlf/FSComp.txt.pl.xlf @@ -7012,11 +7012,6 @@ W tym miejscu nie można użyć adresu zmiennej „{0}” ani powiązanego wyrażenia. Ma to na celu uniemożliwienie adresowi wartości lokalnej wykroczenia poza zakres. - - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - Z tej funkcji lub metody nie można zwrócić wyrażenia Span ani IsByRefLike, ponieważ jest ona złożona przy użyciu elementów, które mogą wykroczyć poza swój zakres. - - This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. Ta wartość nie może zostać przypisana, ponieważ element docelowy „{0}” może odwoływać się do pamięci innej niż pamięć lokalna dla stosu, natomiast przypisywane wyrażenie może potencjalnie odwoływać się do pamięci lokalnej dla stosu. Dzięki temu łatwiej uniemożliwić wskaźnikom do pamięci powiązanej ze stosem wykroczenie poza ich zakres. diff --git a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf index 753d847edc..5c8c437880 100644 --- a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf +++ b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf @@ -7012,11 +7012,6 @@ O endereço da variável '{0}' ou de uma expressão relacionada não pode ser utilizado neste ponto. Isso tem como objetivo garantir que o endereço do valor local não escape de seu escopo. - - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - A expressão Span ou IsByRefLike não pode ser retornada desta função ou deste método porque ela é composta utilizando elementos que podem escapar de seu escopo. - - This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. Este valor não pode ser atribuído porque o destino '{0}' pode se referir a uma memória local não empilhada, enquanto a expressão que está sendo atribuída é avaliada para possivelmente se referir à memória local empilhada. Isso tem como objetivo ajudar a evitar que os ponteiros da memória vinculada à pilha escapem de seu escopo. diff --git a/src/fsharp/xlf/FSComp.txt.ru.xlf b/src/fsharp/xlf/FSComp.txt.ru.xlf index 86e036f40a..fe4b9d5e7c 100644 --- a/src/fsharp/xlf/FSComp.txt.ru.xlf +++ b/src/fsharp/xlf/FSComp.txt.ru.xlf @@ -7012,11 +7012,6 @@ На этом этапе невозможно использовать адрес переменной "{0}" или связанного выражения. В этом случае гарантируется, что адрес локального значения не обходит свою область. - - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - Выражение Span или IsByRefLike не может быть возвращено этой функцией или методом, так как оно создано с помощью элементов, которые могут обходить свою область. - - This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. Это значение не может быть назначено, так как целевой элемент "{0}" может ссылаться на отличную от локальной для стека память, тогда как назначаемое выражение оценивается как потенциально ссылающееся на локальную для стека память. В этом случае гарантируется, что указатели на привязанную к стеку память не обходят свою область. diff --git a/src/fsharp/xlf/FSComp.txt.tr.xlf b/src/fsharp/xlf/FSComp.txt.tr.xlf index a81169d083..f837606166 100644 --- a/src/fsharp/xlf/FSComp.txt.tr.xlf +++ b/src/fsharp/xlf/FSComp.txt.tr.xlf @@ -7012,11 +7012,6 @@ Bu noktada '{0}' değişkeninin veya ilgili bir değişkenin adresi kullanılamaz. Bunun amacı, yerel değerin adresinin kapsamı dışına kaçmasını engellemektir. - - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - Span veya IsByRefLike ifadesi kapsamından kaçabilecek öğeler kullanılarak oluşturulduğundan, bu işlev veya metottan döndürülemez. - - This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. '{0}' hedefi yığında yerel olmayan belleğe başvurabileceğinden ve atanmakta olan ifadenin yığında yerel belleğe başvurma olasılığının olduğu tespit edildiğinden bu değer atanamaz. Bunun amacı, yığınla sınırlı belleğe yönelik işaretçilerin kapsamlarından kaçmasının önlenmesine yardımcı olmaktır. diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf index dd458728c8..3a1592cef8 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf @@ -7012,11 +7012,6 @@ 此时无法使用变量“{0}”或相关表达式的地址。这是为了确保本地值的地址不超出其范围。 - - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - 无法从此函数或方法返回 Span 或 IsByRefLike 表达式,因为它由可能超出其范围的元素组成。 - - This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. 无法分配此值,因为目标“{0}”可能涉及非堆栈本地内存,而分配的表达式经评估可能涉及堆栈本地内存。这有助于防止指向堆栈绑定内存的指针超出其范围。 diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf index d3da3af897..3299536074 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf @@ -7012,11 +7012,6 @@ 此時不可使用變數 '{0}' 或相關運算式的位址。如此可確保本機值的位址不會逸出其範圍。 - - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - 無法從此函式或方法傳回 Span 或 IsByRefLike 運算式,因為其使用可能會逸出其範圍的項目撰寫。 - - This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. 因為目標 '{0}' 會參考非本機堆疊的記憶體,所以無法指派此值。而目前所指派的運算式則評定為可能會參考本機堆疊的記憶體。如此可有助於避免進入受堆疊拘束記憶體的指標會逸出其範圍。 diff --git a/tests/fsharp/core/byrefs/test.bsl b/tests/fsharp/core/byrefs/test.bsl index b1602e42b2..835868db91 100644 --- a/tests/fsharp/core/byrefs/test.bsl +++ b/tests/fsharp/core/byrefs/test.bsl @@ -43,11 +43,11 @@ test.fsx(66,34,66,47): typecheck error FS1204: This construct is for use in the test.fsx(66,34,66,47): typecheck error FS1204: This construct is for use in the FSharp.Core library and should not be used directly -test.fsx(71,21,71,23): typecheck error FS3238: Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. +test.fsx(71,21,71,23): typecheck error FS3236: Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. -test.fsx(72,21,72,23): typecheck error FS3238: Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. +test.fsx(72,21,72,23): typecheck error FS3236: Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. -test.fsx(78,21,78,37): typecheck error FS3238: Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. +test.fsx(78,21,78,37): typecheck error FS3236: Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. test.fsx(85,22,85,23): typecheck error FS0001: This expression was expected to have type 'inref' diff --git a/tests/fsharp/core/byrefs/test2.bsl b/tests/fsharp/core/byrefs/test2.bsl index 232cc82edb..5cdb952a47 100644 --- a/tests/fsharp/core/byrefs/test2.bsl +++ b/tests/fsharp/core/byrefs/test2.bsl @@ -24,3 +24,7 @@ test2.fsx(93,28,93,29): typecheck error FS0421: The address of the variable 'x' test2.fsx(93,17,93,29): typecheck error FS0425: The type of a first-class function cannot contain byrefs test2.fsx(93,17,93,29): typecheck error FS0425: The type of a first-class function cannot contain byrefs + +test2.fsx(112,53,112,54): typecheck error FS3209: The address of the variable 'x' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(124,33,124,34): typecheck error FS3209: The address of the variable 'x' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. diff --git a/tests/fsharp/core/byrefs/test2.fsx b/tests/fsharp/core/byrefs/test2.fsx index 54bbe2b082..a65471c145 100644 --- a/tests/fsharp/core/byrefs/test2.fsx +++ b/tests/fsharp/core/byrefs/test2.fsx @@ -93,10 +93,7 @@ module NegativeTests = let f = fun () -> &x // not allowed () -#endif - -module Tests = - + type ByRefInterface = abstract Test : byref * byref -> byref @@ -112,7 +109,7 @@ module Tests = let obj2 = { new ByRefInterface with - member __.Test(_x,y) = &x } // is allowed + member __.Test(_x,y) = &x } // is not allowed a <- obj2 &y } @@ -120,6 +117,15 @@ module Tests = let mutable y = 500 obj.Test(&x, &y) |> ignore a + + type Beef = delegate of unit-> byref + let testBeef () = + let mutable x = 1 + let f = Beef(fun () -> &x) // is not allowed + () +#endif + +module Tests = let test1 () = let x = 1 @@ -132,12 +138,6 @@ module Tests = () () - type Beef = delegate of unit-> byref - let test2 () = - let mutable x = 1 - let f = Beef(fun () -> &x) // is allowed - () - let aa = if !failures then (stdout.WriteLine "Test Failed"; exit 1) else (stdout.WriteLine "Test Passed"; diff --git a/tests/fsharp/core/span/test.bsl b/tests/fsharp/core/span/test.bsl index c573f76226..5e2d421653 100644 --- a/tests/fsharp/core/span/test.bsl +++ b/tests/fsharp/core/span/test.bsl @@ -1,13 +1,13 @@ -test.fsx(303,46,303,86): typecheck error FS3235: The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. +test.fsx(303,46,303,86): typecheck error FS3233: The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. -test.fsx(306,13,306,86): typecheck error FS3230: This value can't be assigned because the target 'param1' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. +test.fsx(306,13,306,86): typecheck error FS3229: This value can't be assigned because the target 'param1' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. -test.fsx(309,13,309,62): typecheck error FS3230: This value can't be assigned because the target 'param1' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. +test.fsx(309,13,309,62): typecheck error FS3229: This value can't be assigned because the target 'param1' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. -test.fsx(348,13,348,57): typecheck error FS3230: This value can't be assigned because the target 'addr' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. +test.fsx(348,13,348,57): typecheck error FS3229: This value can't be assigned because the target 'addr' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. -test.fsx(351,13,351,38): typecheck error FS3230: This value can't be assigned because the target 'param1' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. +test.fsx(351,13,351,38): typecheck error FS3229: This value can't be assigned because the target 'param1' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. test.fsx(354,14,354,29): typecheck error FS3209: The address of the variable 'stackReferring3' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. diff --git a/tests/fsharp/core/span/test2.bsl b/tests/fsharp/core/span/test2.bsl index 006788c004..0011c8ebc2 100644 --- a/tests/fsharp/core/span/test2.bsl +++ b/tests/fsharp/core/span/test2.bsl @@ -25,25 +25,25 @@ test2.fsx(119,14,119,37): typecheck error FS3228: The address of a value returne test2.fsx(124,14,124,15): typecheck error FS3209: The address of the variable 'y' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. -test2.fsx(128,13,128,42): typecheck error FS3237: A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. +test2.fsx(128,13,128,42): typecheck error FS3235: A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. test2.fsx(132,14,132,41): typecheck error FS3228: The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. test2.fsx(136,14,136,71): typecheck error FS3228: The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. -test2.fsx(140,13,140,52): typecheck error FS3237: A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. +test2.fsx(140,13,140,52): typecheck error FS3235: A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. -test2.fsx(144,13,144,14): typecheck error FS3236: The Span or IsByRefLike variable 's' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. +test2.fsx(144,13,144,14): typecheck error FS3234: The Span or IsByRefLike variable 's' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. -test2.fsx(149,13,149,52): typecheck error FS3237: A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. +test2.fsx(149,13,149,52): typecheck error FS3235: A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. -test2.fsx(153,21,153,84): typecheck error FS3235: The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. +test2.fsx(153,21,153,84): typecheck error FS3233: The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. -test2.fsx(154,13,154,14): typecheck error FS3236: The Span or IsByRefLike variable 'y' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. +test2.fsx(154,13,154,14): typecheck error FS3234: The Span or IsByRefLike variable 'y' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. -test2.fsx(158,13,158,83): typecheck error FS3237: A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. +test2.fsx(158,13,158,83): typecheck error FS3235: A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. -test2.fsx(163,13,163,14): typecheck error FS3236: The Span or IsByRefLike variable 'y' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. +test2.fsx(163,13,163,14): typecheck error FS3234: The Span or IsByRefLike variable 'y' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. test2.fsx(167,14,167,71): typecheck error FS3228: The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. @@ -51,7 +51,7 @@ test2.fsx(191,43,191,44): typecheck error FS3209: The address of the variable 'x test2.fsx(195,14,195,15): typecheck error FS3209: The address of the variable 'y' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. -test2.fsx(199,13,199,19): typecheck error FS3230: This value can't be assigned because the target 'x' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. +test2.fsx(199,13,199,19): typecheck error FS3229: This value can't be assigned because the target 'x' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. test2.fsx(204,26,204,27): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. @@ -72,3 +72,7 @@ test2.fsx(208,14,208,18): typecheck error FS0437: A type would store a byref typ test2.fsx(214,13,214,18): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. test2.fsx(213,14,213,19): typecheck error FS0437: A type would store a byref typed value. This is not permitted by Common IL. + +test2.fsx(222,18,222,23): typecheck error FS3228: The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(231,17,231,18): typecheck error FS3234: The Span or IsByRefLike variable 's' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. diff --git a/tests/fsharp/core/span/test2.fsx b/tests/fsharp/core/span/test2.fsx index 2cdb4f4c7f..e3be6f7887 100644 --- a/tests/fsharp/core/span/test2.fsx +++ b/tests/fsharp/core/span/test2.fsx @@ -214,6 +214,23 @@ namespace Tests Funcn : FuncType } + type TestDelegate_should_not_work27 = delegate of unit -> byref + + let should_not_work27 () = + let f = TestDelegate_should_not_work27(fun () -> + let mutable s = Span.Empty + &s.[0] + ) + () + + type TestDelegate_should_not_work28 = delegate of unit -> Span + + let should_not_work28 () = + let f = TestDelegate_should_not_work28(fun () -> + let mutable s = Span.Empty + s + ) + () #endif let should_work1 () = @@ -355,4 +372,22 @@ namespace Tests let yopac = let mutable s = Span.Empty &s.[0] // this looks like it's out of scope, but this is coming from a stack referring span-like type. + () + + type TestDelegate_should_work31 = delegate of unit -> byref + + let should_work31 () = + let f = TestDelegate_should_work31(fun () -> + let s = Span.Empty + &s.[0] + ) + () + + type TestDelegate_should_work32 = delegate of unit -> Span + + let should_work32 () = + let f = TestDelegate_should_work32(fun () -> + let s = Span.Empty + s + ) () \ No newline at end of file diff --git a/tests/fsharp/typecheck/sigs/neg106.bsl b/tests/fsharp/typecheck/sigs/neg106.bsl index bfa1ff5e6b..41e3aa68b5 100644 --- a/tests/fsharp/typecheck/sigs/neg106.bsl +++ b/tests/fsharp/typecheck/sigs/neg106.bsl @@ -1,5 +1,5 @@ -neg106.fs(8,59,8,61): typecheck error FS3231: A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' +neg106.fs(8,59,8,61): typecheck error FS3230: A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' neg106.fs(13,18,13,72): typecheck error FS0041: No overloads match for method 'CompareExchange'. The available overloads are shown below. neg106.fs(13,18,13,72): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: int, comparand: int) : int'. Type constraint mismatch. The type @@ -38,7 +38,7 @@ is not compatible with type 'byref<'a>' . -neg106.fs(17,59,17,61): typecheck error FS3238: Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. +neg106.fs(17,59,17,61): typecheck error FS3236: Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. neg106.fs(17,14,17,68): typecheck error FS0041: No overloads match for method 'CompareExchange'. The available overloads are shown below. neg106.fs(17,14,17,68): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: int, comparand: int) : int'. Type constraint mismatch. The type diff --git a/tests/fsharp/typecheck/sigs/neg106.vsbsl b/tests/fsharp/typecheck/sigs/neg106.vsbsl index bfa1ff5e6b..41e3aa68b5 100644 --- a/tests/fsharp/typecheck/sigs/neg106.vsbsl +++ b/tests/fsharp/typecheck/sigs/neg106.vsbsl @@ -1,5 +1,5 @@ -neg106.fs(8,59,8,61): typecheck error FS3231: A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' +neg106.fs(8,59,8,61): typecheck error FS3230: A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' neg106.fs(13,18,13,72): typecheck error FS0041: No overloads match for method 'CompareExchange'. The available overloads are shown below. neg106.fs(13,18,13,72): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: int, comparand: int) : int'. Type constraint mismatch. The type @@ -38,7 +38,7 @@ is not compatible with type 'byref<'a>' . -neg106.fs(17,59,17,61): typecheck error FS3238: Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. +neg106.fs(17,59,17,61): typecheck error FS3236: Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. neg106.fs(17,14,17,68): typecheck error FS0041: No overloads match for method 'CompareExchange'. The available overloads are shown below. neg106.fs(17,14,17,68): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: int, comparand: int) : int'. Type constraint mismatch. The type diff --git a/tests/fsharp/typecheck/sigs/neg107.bsl b/tests/fsharp/typecheck/sigs/neg107.bsl index d3610f83a1..f511b6af3c 100644 --- a/tests/fsharp/typecheck/sigs/neg107.bsl +++ b/tests/fsharp/typecheck/sigs/neg107.bsl @@ -55,15 +55,15 @@ neg107.fsx(37,33,37,34): typecheck error FS0425: The type of a first-class funct neg107.fsx(37,33,37,34): typecheck error FS0425: The type of a first-class function cannot contain byrefs -neg107.fsx(45,34,45,40): typecheck error FS3234: Struct members cannot return the address of fields of the struct by reference +neg107.fsx(45,34,45,40): typecheck error FS3232: Struct members cannot return the address of fields of the struct by reference -neg107.fsx(45,34,45,38): typecheck error FS3234: Struct members cannot return the address of fields of the struct by reference +neg107.fsx(45,34,45,38): typecheck error FS3232: Struct members cannot return the address of fields of the struct by reference -neg107.fsx(53,34,53,38): typecheck error FS3234: Struct members cannot return the address of fields of the struct by reference +neg107.fsx(53,34,53,38): typecheck error FS3232: Struct members cannot return the address of fields of the struct by reference -neg107.fsx(67,34,67,40): typecheck error FS3234: Struct members cannot return the address of fields of the struct by reference +neg107.fsx(67,34,67,40): typecheck error FS3232: Struct members cannot return the address of fields of the struct by reference -neg107.fsx(67,34,67,38): typecheck error FS3234: Struct members cannot return the address of fields of the struct by reference +neg107.fsx(67,34,67,38): typecheck error FS3232: Struct members cannot return the address of fields of the struct by reference neg107.fsx(71,19,71,20): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. diff --git a/tests/fsharp/typecheck/sigs/neg107.vsbsl b/tests/fsharp/typecheck/sigs/neg107.vsbsl index d3610f83a1..f511b6af3c 100644 --- a/tests/fsharp/typecheck/sigs/neg107.vsbsl +++ b/tests/fsharp/typecheck/sigs/neg107.vsbsl @@ -55,15 +55,15 @@ neg107.fsx(37,33,37,34): typecheck error FS0425: The type of a first-class funct neg107.fsx(37,33,37,34): typecheck error FS0425: The type of a first-class function cannot contain byrefs -neg107.fsx(45,34,45,40): typecheck error FS3234: Struct members cannot return the address of fields of the struct by reference +neg107.fsx(45,34,45,40): typecheck error FS3232: Struct members cannot return the address of fields of the struct by reference -neg107.fsx(45,34,45,38): typecheck error FS3234: Struct members cannot return the address of fields of the struct by reference +neg107.fsx(45,34,45,38): typecheck error FS3232: Struct members cannot return the address of fields of the struct by reference -neg107.fsx(53,34,53,38): typecheck error FS3234: Struct members cannot return the address of fields of the struct by reference +neg107.fsx(53,34,53,38): typecheck error FS3232: Struct members cannot return the address of fields of the struct by reference -neg107.fsx(67,34,67,40): typecheck error FS3234: Struct members cannot return the address of fields of the struct by reference +neg107.fsx(67,34,67,40): typecheck error FS3232: Struct members cannot return the address of fields of the struct by reference -neg107.fsx(67,34,67,38): typecheck error FS3234: Struct members cannot return the address of fields of the struct by reference +neg107.fsx(67,34,67,38): typecheck error FS3232: Struct members cannot return the address of fields of the struct by reference neg107.fsx(71,19,71,20): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. From 31495ebc8a44e094371a21baf7842a1dbdcbfc72 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Tue, 17 Jul 2018 18:36:48 -0700 Subject: [PATCH 090/150] Combotptest (#5346) * Enable comboprovider tests * paths --- .../BasicProvider/TestBasicProvider.cmd | 4 +-- .../ComboProvider/TestComboProvider.cmd | 28 +++++++++---------- .../EndToEndBuildTests/EndToEndBuildTests.cmd | 4 +++ 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/tests/EndToEndBuildTests/BasicProvider/TestBasicProvider.cmd b/tests/EndToEndBuildTests/BasicProvider/TestBasicProvider.cmd index d36bddb15d..7d8475c39c 100644 --- a/tests/EndToEndBuildTests/BasicProvider/TestBasicProvider.cmd +++ b/tests/EndToEndBuildTests/BasicProvider/TestBasicProvider.cmd @@ -15,7 +15,7 @@ rem Build typeprovider package with desktop compiler rem Test it with both desktop and coreclr compilers rem -if not '%NUGET_PACKAGES%' == '' rd %NUGET_PACKAGES%\basicprovider /s /q +if not '%NUGET_PACKAGES%' == '' rd %NUGET_PACKAGES%\BasicProvider /s /q @echo %__scriptpath%..\..\..\tools\dotnet20\dotnet.exe pack BasicProvider\BasicProvider.fsproj -o %~dp0artifacts -c release -v minimal -p:FSharpTestCompilerVersion=net40 %__scriptpath%..\..\..\tools\dotnet20\dotnet.exe pack BasicProvider\BasicProvider.fsproj -o %~dp0artifacts -c release -v minimal -p:FSharpTestCompilerVersion=net40 @@ -33,7 +33,7 @@ rem rem Build typeprovider package with coreclr compiler rem Test it with both desktop and coreclr compilers rem -if not '%NUGET_PACKAGES%' == '' rd %NUGET_PACKAGES%\basicprovider /s /q +if not '%NUGET_PACKAGES%' == '' rd %NUGET_PACKAGES%\BasicProvider /s /q @echo %__scriptpath%..\..\..\tools\dotnet20\dotnet.exe pack BasicProvider\BasicProvider.fsproj -o %~dp0artifacts -c release -v minimal -p:FSharpTestCompilerVersion=coreclr %__scriptpath%..\..\..\tools\dotnet20\dotnet.exe pack BasicProvider\BasicProvider.fsproj -o %~dp0artifacts -c release -v minimal -p:FSharpTestCompilerVersion=coreclr diff --git a/tests/EndToEndBuildTests/ComboProvider/TestComboProvider.cmd b/tests/EndToEndBuildTests/ComboProvider/TestComboProvider.cmd index c3beb6b9ae..ccd8c4d2e3 100644 --- a/tests/EndToEndBuildTests/ComboProvider/TestComboProvider.cmd +++ b/tests/EndToEndBuildTests/ComboProvider/TestComboProvider.cmd @@ -14,36 +14,36 @@ rem Build typeprovider package with desktop compiler rem Test it with both desktop and coreclr compilers rem -if not '%NUGET_PACKAGES%' == '' rd %NUGET_PACKAGES%\basicprovider /s /q +if not '%NUGET_PACKAGES%' == '' rd %NUGET_PACKAGES%\ComboProvider /s /q -@echo %__scriptpath%..\..\..\tools\dotnet20\dotnet.exe pack ComboProvider\ComboProvider.fsproj -o %~dp0artifacts -c release -v minimal -p:FSharpTestCompilerVersion=net40 -%__scriptpath%..\..\..\tools\dotnet20\dotnet.exe pack ComboProvider\ComboProvider.fsproj -o %~dp0artifacts -c release -v minimal -p:FSharpTestCompilerVersion=net40 +@echo %__scriptpath%..\..\..\tools\dotnet20\dotnet.exe pack ComboProvider\ComboProvider\ComboProvider.fsproj -o %~dp0artifacts -c release -v minimal -p:FSharpTestCompilerVersion=net40 +%__scriptpath%..\..\..\tools\dotnet20\dotnet.exe pack ComboProvider\ComboProvider\ComboProvider.fsproj -o %~dp0artifacts -c release -v minimal -p:FSharpTestCompilerVersion=net40 @if ERRORLEVEL 1 echo Error: ComboProvider failed && goto :failure -@echo %__scriptpath%..\..\..\tools\dotnet20\dotnet.exe test ComboProvider.Tests\ComboProvider.Tests.fsproj -c release -v minimal -p:TestTargetFramework=net461 -p:FSharpTestCompilerVersion=net40 -%__scriptpath%..\..\..\tools\dotnet20\dotnet.exe test ComboProvider.Tests\ComboProvider.Tests.fsproj -c release -v minimal -p:TestTargetFramework=net461 -p:FSharpTestCompilerVersion=net40 +@echo %__scriptpath%..\..\..\tools\dotnet20\dotnet.exe test ComboProvider\ComboProvider.Tests\ComboProvider.Tests.fsproj -c release -v minimal -p:TestTargetFramework=net461 -p:FSharpTestCompilerVersion=net40 +%__scriptpath%..\..\..\tools\dotnet20\dotnet.exe test ComboProvider\ComboProvider.Tests\ComboProvider.Tests.fsproj -c release -v minimal -p:TestTargetFramework=net461 -p:FSharpTestCompilerVersion=net40 @if ERRORLEVEL 1 echo Error: ComboProvider failed && goto :failure -@echo %__scriptpath%..\..\..\tools\dotnet20\dotnet.exe test ComboProvider.Tests\ComboProvider.Tests.fsproj -c release -v minimal -p:TestTargetFramework=netcoreapp2.0 -p:FSharpTestCompilerVersion=coreclr -%__scriptpath%..\..\..\tools\dotnet20\dotnet.exe test ComboProvider.Tests\ComboProvider.Tests.fsproj -c release -v minimal -p:TestTargetFramework=netcoreapp2.0 -p:FSharpTestCompilerVersion=coreclr +@echo %__scriptpath%..\..\..\tools\dotnet20\dotnet.exe test ComboProvider\ComboProvider.Tests\ComboProvider.Tests.fsproj -c release -v minimal -p:TestTargetFramework=netcoreapp2.0 -p:FSharpTestCompilerVersion=coreclr +%__scriptpath%..\..\..\tools\dotnet20\dotnet.exe test ComboProvider\ComboProvider.Tests\ComboProvider.Tests.fsproj -c release -v minimal -p:TestTargetFramework=netcoreapp2.0 -p:FSharpTestCompilerVersion=coreclr @if ERRORLEVEL 1 echo Error: ComboProviderProvider failed && goto :failure rem rem Build typeprovider package with coreclr compiler rem Test it with both desktop and coreclr compilers rem -if not '%NUGET_PACKAGES%' == '' rd %NUGET_PACKAGES%\basicprovider /s /q +if not '%NUGET_PACKAGES%' == '' rd %NUGET_PACKAGES%\ComboProvider /s /q -@echo %__scriptpath%..\..\..\tools\dotnet20\dotnet.exe pack ComboProvider\ComboProvider.fsproj -o %~dp0artifacts -c release -v minimal -p:FSharpTestCompilerVersion=coreclr -%__scriptpath%..\..\..\tools\dotnet20\dotnet.exe pack ComboProvider\ComboProvider.fsproj -o %~dp0artifacts -c release -v minimal FSharpTestCompilerVersion +@echo %__scriptpath%..\..\..\tools\dotnet20\dotnet.exe pack ComboProvider\ComboProvider\ComboProvider.fsproj -o %~dp0artifacts -c release -v minimal -p:FSharpTestCompilerVersion=coreclr +%__scriptpath%..\..\..\tools\dotnet20\dotnet.exe pack ComboProvider\ComboProvider\ComboProvider.fsproj -o %~dp0artifacts -c release -v minimal -p:FSharpTestCompilerVersion=coreclr @if ERRORLEVEL 1 echo Error: ComboProviderProvider failed && goto :failure -@echo%__scriptpath%..\..\..\tools\dotnet20\dotnet.exe test ComboProvider.Tests\ComboProvider.Tests.fsproj -c release -v minimal -p:TestTargetFramework=net461 -p:FSharpTestCompilerVersion=net40 -%__scriptpath%..\..\..\tools\dotnet20\dotnet.exe test ComboProvider.Tests\ComboProvider.Tests.fsproj -c release -v minimal -p:TestTargetFramework=net461 -p:FSharpTestCompilerVersion=net40 +@echo%__scriptpath%..\..\..\tools\dotnet20\dotnet.exe test ComboProvider\ComboProvider.Tests\ComboProvider.Tests.fsproj -c release -v minimal -p:TestTargetFramework=net461 -p:FSharpTestCompilerVersion=net40 +%__scriptpath%..\..\..\tools\dotnet20\dotnet.exe test ComboProvider\ComboProvider.Tests\ComboProvider.Tests.fsproj -c release -v minimal -p:TestTargetFramework=net461 -p:FSharpTestCompilerVersion=net40 @if ERRORLEVEL 1 echo Error: TestBasicProvider failed && goto :failure -@echo %__scriptpath%..\..\..\tools\dotnet20\dotnet.exe test ComboProvider.Tests\ComboProvider.Tests.fsproj -v minimal -p:TestTargetFramework=netcoreapp2.0 -p:FSharpTestCompilerVersion=coreclr -%__scriptpath%..\..\..\tools\dotnet20\dotnet.exe test ComboProvider.Tests\ComboProvider.Tests.fsproj -c release -v minimal -p:TestTargetFramework=netcoreapp2.0 -p:FSharpTestCompilerVersion=coreclr +@echo %__scriptpath%..\..\..\tools\dotnet20\dotnet.exe test ComboProvider\ComboProvider.Tests\ComboProvider.Tests.fsproj -v minimal -p:TestTargetFramework=netcoreapp2.0 -p:FSharpTestCompilerVersion=coreclr +%__scriptpath%..\..\..\tools\dotnet20\dotnet.exe test ComboProvider\ComboProvider.Tests\ComboProvider.Tests.fsproj -c release -v minimal -p:TestTargetFramework=netcoreapp2.0 -p:FSharpTestCompilerVersion=coreclr @if ERRORLEVEL 1 echo Error: ComboProvider failed && goto :failure :success diff --git a/tests/EndToEndBuildTests/EndToEndBuildTests.cmd b/tests/EndToEndBuildTests/EndToEndBuildTests.cmd index 9a2a21b025..f1cb22c49e 100644 --- a/tests/EndToEndBuildTests/EndToEndBuildTests.cmd +++ b/tests/EndToEndBuildTests/EndToEndBuildTests.cmd @@ -11,6 +11,10 @@ set __scriptpath=%~dp0 call %__scriptpath%BasicProvider\TestBasicProvider.cmd @if ERRORLEVEL 1 echo Error: TestBasicProvider failed && goto :failure +@echo %__scriptpath%ComboProvider\TestComboProvider.cmd +call %__scriptpath%ComboProvider\TestComboProvider.cmd +@if ERRORLEVEL 1 echo Error: TestComboProvider failed && goto :failure + :success endlocal echo Succeeded From 6014fe2cd368bed6ece20dac5719d732ec2febc0 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Wed, 18 Jul 2018 14:40:06 -0700 Subject: [PATCH 091/150] Fixes: #4822 --- Support for arbitrary value in AssemblyInformationalVersionAttribute (#5336) * remove TypeChecker validation * update testcase baselines * Update fsharpqa tests * Feedback * Update nowarn test --- build/targets/GenerateAssemblyAttributes.targets | 2 -- src/fsharp/TypeChecker.fs | 1 - tests/fsharp/core/versionAttributes/NoWarn2003.fs | 5 ++--- tests/fsharp/core/versionAttributes/out.stderr.bsl | 4 ---- .../CustomAttributes/AttributeUsage/X_AssemblyVersion01.fs | 2 -- .../CustomAttributes/AttributeUsage/X_AssemblyVersion02.fs | 2 -- 6 files changed, 2 insertions(+), 14 deletions(-) diff --git a/build/targets/GenerateAssemblyAttributes.targets b/build/targets/GenerateAssemblyAttributes.targets index b082253c43..11206a9b76 100644 --- a/build/targets/GenerateAssemblyAttributes.targets +++ b/build/targets/GenerateAssemblyAttributes.targets @@ -26,8 +26,6 @@ $(IntermediateOutputPath)$(MSBuildProjectName).AssemblyVersion$(DefaultLanguageSourceExtension) - - 2003;$(NoWarn) diff --git a/src/fsharp/TypeChecker.fs b/src/fsharp/TypeChecker.fs index 2ffcfe75f5..658baff82f 100755 --- a/src/fsharp/TypeChecker.fs +++ b/src/fsharp/TypeChecker.fs @@ -17293,7 +17293,6 @@ let TypeCheckOneImplFile try IL.parseILVersion version |> ignore; true with _ -> false match attrName with - | "System.Reflection.AssemblyInformationalVersionAttribute" | "System.Reflection.AssemblyFileVersionAttribute" //TODO compile error like c# compiler? | "System.Reflection.AssemblyVersionAttribute" when not (isValid()) -> warning(Error(FSComp.SR.fscBadAssemblyVersion(attrName, version), range)) diff --git a/tests/fsharp/core/versionAttributes/NoWarn2003.fs b/tests/fsharp/core/versionAttributes/NoWarn2003.fs index 130e854715..be2350b451 100644 --- a/tests/fsharp/core/versionAttributes/NoWarn2003.fs +++ b/tests/fsharp/core/versionAttributes/NoWarn2003.fs @@ -1,13 +1,12 @@ namespace System open System.Reflection -[] - do () namespace System open System.Reflection #nowarn "2003" -[] +[] + do () \ No newline at end of file diff --git a/tests/fsharp/core/versionAttributes/out.stderr.bsl b/tests/fsharp/core/versionAttributes/out.stderr.bsl index 86fdb0fe4d..89d567a757 100644 --- a/tests/fsharp/core/versionAttributes/out.stderr.bsl +++ b/tests/fsharp/core/versionAttributes/out.stderr.bsl @@ -6,13 +6,9 @@ Test 2================================================= NoWarn2003_2.fs(8,6): warning FS0988: Main module of program is empty: nothing will happen when it is run Test 3================================================= -Warn2003_1.fs(5,42): warning FS2003: The attribute System.Reflection.AssemblyInformationalVersionAttribute specified version '5.0.0-beta024', but this value is invalid and has been ignored - Warn2003_1.fs(7,6): warning FS0988: Main module of program is empty: nothing will happen when it is run Test 4================================================= -Warn2003_2.fs(4,42): warning FS2003: The attribute System.Reflection.AssemblyInformationalVersionAttribute specified version '5.0.0-beta024', but this value is invalid and has been ignored - Warn2003_2.fs(6,6): warning FS0988: Main module of program is empty: nothing will happen when it is run Test 5================================================= diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/AttributeUsage/X_AssemblyVersion01.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/AttributeUsage/X_AssemblyVersion01.fs index bffe0e26fd..fffa537e1b 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/AttributeUsage/X_AssemblyVersion01.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/AttributeUsage/X_AssemblyVersion01.fs @@ -1,9 +1,7 @@ // #Regression #Conformance #DeclarationElements #Attributes -//The attribute System.Reflection.AssemblyInformationalVersionAttribute specified version '6\.5\.4\.3\.2', but this value is invalid and has been ignored //The attribute System.Reflection.AssemblyFileVersionAttribute specified version '9\.8\.7\.6\.5', but this value is invalid and has been ignored [] -[] [] do () diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/AttributeUsage/X_AssemblyVersion02.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/AttributeUsage/X_AssemblyVersion02.fs index c7bfb33e20..3be7ab70be 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/AttributeUsage/X_AssemblyVersion02.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/AttributeUsage/X_AssemblyVersion02.fs @@ -1,9 +1,7 @@ // #Regression #Conformance #DeclarationElements #Attributes -//The attribute System.Reflection.AssemblyInformationalVersionAttribute specified version '6\.5\.\*\.3', but this value is invalid and has been ignored //The attribute System.Reflection.AssemblyFileVersionAttribute specified version '9\.8\.\*\.6', but this value is invalid and has been ignored [] -[] [] do () From 2ebf674f79f5699e138ec86ef95b0a67358210a6 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Thu, 19 Jul 2018 15:29:00 -0700 Subject: [PATCH 092/150] clean up version number computation --- build/targets/AssemblyVersions.props | 7 ++- setup/FSharp.Setup.props | 9 +-- .../Microsoft.FSharp.Dependencies/Files.swr | 2 +- .../Microsoft.FSharp.Dependencies.swixproj | 2 + setup/fsharp-setup-build.proj | 2 +- src/FSharpSource.Settings.targets | 56 +------------------ 6 files changed, 13 insertions(+), 65 deletions(-) diff --git a/build/targets/AssemblyVersions.props b/build/targets/AssemblyVersions.props index 63e5f4426c..fb9dde7e23 100644 --- a/build/targets/AssemblyVersions.props +++ b/build/targets/AssemblyVersions.props @@ -3,6 +3,8 @@ $([System.DateTime]::Now.ToString(yyyyMMdd.0)) + + $(BUILD_BUILDNUMBER.Replace(".DRAFT", "")) diff --git a/setup/FSharp.Setup.props b/setup/FSharp.Setup.props index 3bb96f73f2..899f78e6ba 100644 --- a/setup/FSharp.Setup.props +++ b/setup/FSharp.Setup.props @@ -13,13 +13,8 @@ - - $(VSAssemblyVersion.Split('.')[0]).$(VSAssemblyVersion.Split('.')[1]) - - $([System.DateTime]::Now.ToString(yyyyMMdd.0)) - - $(FSharpProductVersion).$(BUILD_BUILDNUMBER.Replace(".DRAFT", "")) - + + $(VSMajorVersion).$(VSMinorVersion).$(BUILD_BUILDNUMBER) diff --git a/setup/Swix/Microsoft.FSharp.Dependencies/Files.swr b/setup/Swix/Microsoft.FSharp.Dependencies/Files.swr index 69d151d0e5..d44b547752 100644 --- a/setup/Swix/Microsoft.FSharp.Dependencies/Files.swr +++ b/setup/Swix/Microsoft.FSharp.Dependencies/Files.swr @@ -3,7 +3,7 @@ use vs package name=Microsoft.FSharp.Dependencies version=$(FSharpPackageVersion) -folder "InstallDir:MSBuild\Microsoft\VisualStudio\v15.0\FSharp" +folder "InstallDir:MSBuild\Microsoft\VisualStudio\v$(VSGeneralVersion)\FSharp" file "Microsoft.FSharp.targets" source="$(BinariesFolder)\setup\resources\Microsoft.FSharp.Shim.targets" file "Microsoft.Portable.FSharp.targets" source="$(BinariesFolder)\setup\resources\Microsoft.Portable.FSharp.Shim.targets" file "Microsoft.FSharp.NetSdk.targets" source="$(BinariesFolder)\setup\resources\Microsoft.FSharp.NetSdk.Shim.targets" diff --git a/setup/Swix/Microsoft.FSharp.Dependencies/Microsoft.FSharp.Dependencies.swixproj b/setup/Swix/Microsoft.FSharp.Dependencies/Microsoft.FSharp.Dependencies.swixproj index 86a39d7005..06d75f70f7 100644 --- a/setup/Swix/Microsoft.FSharp.Dependencies/Microsoft.FSharp.Dependencies.swixproj +++ b/setup/Swix/Microsoft.FSharp.Dependencies/Microsoft.FSharp.Dependencies.swixproj @@ -21,6 +21,7 @@ $(PackagePreprocessorDefinitions);BinariesFolder=$(BinariesFolder) $(PackagePreprocessorDefinitions);PackagesFolder=$(PackagesFolder) $(PackagePreprocessorDefinitions);FSharpPackageVersion=$(FSharpPackageVersion) + $(PackagePreprocessorDefinitions);VSGeneralVersion=$(VSGeneralVersion) @@ -30,6 +31,7 @@ + diff --git a/setup/fsharp-setup-build.proj b/setup/fsharp-setup-build.proj index 25606dede3..e56e3191bd 100644 --- a/setup/fsharp-setup-build.proj +++ b/setup/fsharp-setup-build.proj @@ -45,7 +45,7 @@ Properties="Configuration=$(Configuration);IsLangPack=%(VsixProjects.IsLangPack);FSharpPackageVersion=$(FSharpPackageVersion);OutputPath=$(VsixBuildLocation);DisableOutputPathCopying=true;$(CustomProps)" /> + Properties="LocaleCode=%(SwixSetupProjects.LocaleCode);LocaleId=%(SwixSetupProjects.LocaleId);LocaleParentId=%(SwixSetupProjects.LocaleParentId);LocaleParentCulture=%(SwixSetupProjects.LocaleParentCulture);LocaleSpecificCulture=%(SwixSetupProjects.LocaleSpecificCulture);IsLangPack=%(SwixSetupProjects.IsLangPack);FSharpPackageVersion=$(FSharpPackageVersion);VSGeneralVersion=$(VSGeneralVersion);$(CustomProps)"/> diff --git a/src/FSharpSource.Settings.targets b/src/FSharpSource.Settings.targets index 9886721ec8..595bcccef8 100644 --- a/src/FSharpSource.Settings.targets +++ b/src/FSharpSource.Settings.targets @@ -18,61 +18,7 @@ Debug - - - 4.4.3.0 - 10.1.1.0 - 10.1.4 - 15.7.0.0 - - - - - $([System.DateTime]::Now.ToString(yyyyMMdd.0)) - - - <_Build_Year>$(BUILD_BUILDNUMBER.Substring(0, 4)) - <_Build_Month>$(BUILD_BUILDNUMBER.Substring(4, 2)) - <_Build_Day>$(BUILD_BUILDNUMBER.Substring(6, 2)) - <_Build_Number>$(BUILD_BUILDNUMBER.Substring(9)) - $(_Build_Year).$(_Build_Month).$(_Build_Day).$(_Build_Number) - - $(FSCoreVersion) - - - $(FSProductVersion) - - - $(VSAssemblyVersion) - - - $(BUILD_BUILDNUMBER.Split('.')[0].Substring(2)) - $(BUILD_BUILDNUMBER.Split('.')[1].PadLeft(2, '0')) - $(BuildTimeStamp_Date)$(BuildTimeStamp_Number) - $(MicroBuildAssemblyVersion.Substring(0, $(MicroBuildAssemblyVersion.LastIndexOf('.')))) - $(MicroBuildAssemblyVersion_WithoutRevision).$(BuildTimeStamp) - $(BuildTimeStamp_Date)-$(BuildTimeStamp_Number) - + From b3475fa708f78fb7b6135dc6dfa7bdfa77273a39 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Fri, 20 Jul 2018 11:33:36 -0700 Subject: [PATCH 093/150] update to FSharp.Core package 4.5.1 (#5352) --- src/fsharp/FSharp.Build/Microsoft.FSharp.NetSdk.props | 2 +- .../ConsoleProject/Template/ConsoleApplication.fsproj | 2 +- .../ConsoleProject/Template/ConsoleApplication.vstemplate | 2 +- .../ProjectTemplates/LibraryProject/Template/Library.fsproj | 2 +- .../ProjectTemplates/LibraryProject/Template/Library.vstemplate | 2 +- .../ProjectTemplates/TutorialProject/Template/Tutorial.fsproj | 2 +- .../TutorialProject/Template/Tutorial.vstemplate | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/fsharp/FSharp.Build/Microsoft.FSharp.NetSdk.props b/src/fsharp/FSharp.Build/Microsoft.FSharp.NetSdk.props index ec9a9c4f87..82c01a57bb 100644 --- a/src/fsharp/FSharp.Build/Microsoft.FSharp.NetSdk.props +++ b/src/fsharp/FSharp.Build/Microsoft.FSharp.NetSdk.props @@ -73,7 +73,7 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and 4.4.0 - 4.5.0 + 4.5.1 $(DefaultValueTuplePackageVersion) $(DefaultFSharpCorePackageVersion) diff --git a/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.fsproj b/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.fsproj index e2b643f6c5..fb4debf76c 100644 --- a/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.fsproj +++ b/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.fsproj @@ -42,7 +42,7 @@ - ..\packages\FSharp.Core.4.5.0\lib\net45\FSharp.Core.dll + ..\packages\FSharp.Core.4.5.1\lib\net45\FSharp.Core.dll True diff --git a/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.vstemplate b/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.vstemplate index 90f50e2d6d..6860164c1b 100644 --- a/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.vstemplate +++ b/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.vstemplate @@ -27,7 +27,7 @@ - + diff --git a/vsintegration/ProjectTemplates/LibraryProject/Template/Library.fsproj b/vsintegration/ProjectTemplates/LibraryProject/Template/Library.fsproj index 9249b782e0..39adb41aa2 100644 --- a/vsintegration/ProjectTemplates/LibraryProject/Template/Library.fsproj +++ b/vsintegration/ProjectTemplates/LibraryProject/Template/Library.fsproj @@ -38,7 +38,7 @@ - ..\packages\FSharp.Core.4.5.0\lib\net45\FSharp.Core.dll + ..\packages\FSharp.Core.4.5.1\lib\net45\FSharp.Core.dll True diff --git a/vsintegration/ProjectTemplates/LibraryProject/Template/Library.vstemplate b/vsintegration/ProjectTemplates/LibraryProject/Template/Library.vstemplate index db3850602d..27b8fc3925 100644 --- a/vsintegration/ProjectTemplates/LibraryProject/Template/Library.vstemplate +++ b/vsintegration/ProjectTemplates/LibraryProject/Template/Library.vstemplate @@ -27,7 +27,7 @@ - + diff --git a/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.fsproj b/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.fsproj index 61927697e8..b6fd29e595 100644 --- a/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.fsproj +++ b/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.fsproj @@ -45,7 +45,7 @@ - ..\packages\FSharp.Core.4.5.0\lib\net45\FSharp.Core.dll + ..\packages\FSharp.Core.4.5.1\lib\net45\FSharp.Core.dll True diff --git a/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.vstemplate b/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.vstemplate index 1fe64c81c8..2f07274db1 100644 --- a/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.vstemplate +++ b/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.vstemplate @@ -25,7 +25,7 @@ - + From 79ee42f602e8d49a85eb6e2c59d8bb57a74f2296 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Fri, 20 Jul 2018 11:34:09 -0700 Subject: [PATCH 094/150] Update tooling version to 10.2.2 (#5349) --- src/FSharpSource.Settings.targets | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/FSharpSource.Settings.targets b/src/FSharpSource.Settings.targets index 273d18ee76..e5ff865285 100644 --- a/src/FSharpSource.Settings.targets +++ b/src/FSharpSource.Settings.targets @@ -21,8 +21,8 @@ 4.5.0.0 - 10.2.1.0 - 10.2.1 + 10.2.2.0 + 10.2.2 15.7.0.0 From eb32ee80725d74d9541dc2448680200ad60a8b23 Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Sun, 22 Jul 2018 04:58:31 +0200 Subject: [PATCH 095/150] Don't create dict for empty lists (#5348) * Shortcut empty arrays for groupBy * Shortcut empty seqs for groupBy * Don't create dict for empty lists --- src/fsharp/FSharp.Core/array.fs | 4 +++- src/fsharp/FSharp.Core/local.fs | 4 ++++ src/fsharp/FSharp.Core/seq.fs | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/fsharp/FSharp.Core/array.fs b/src/fsharp/FSharp.Core/array.fs index f9cced85d3..b92e3d9503 100644 --- a/src/fsharp/FSharp.Core/array.fs +++ b/src/fsharp/FSharp.Core/array.fs @@ -405,10 +405,12 @@ namespace Microsoft.FSharp.Collections loop 0 let inline groupByImpl (comparer:IEqualityComparer<'SafeKey>) (keyf:'T->'SafeKey) (getKey:'SafeKey->'Key) (array: 'T[]) = + let length = array.Length + if length = 0 then Microsoft.FSharp.Primitives.Basics.Array.zeroCreateUnchecked 0 else let dict = Dictionary<_,ResizeArray<_>> comparer // Build the groupings - for i = 0 to (array.Length - 1) do + for i = 0 to length - 1 do let v = array.[i] let safeKey = keyf v let mutable prev = Unchecked.defaultof<_> diff --git a/src/fsharp/FSharp.Core/local.fs b/src/fsharp/FSharp.Core/local.fs index 779b543cd2..4229779518 100644 --- a/src/fsharp/FSharp.Core/local.fs +++ b/src/fsharp/FSharp.Core/local.fs @@ -196,6 +196,10 @@ module internal List = cons let groupBy (comparer:IEqualityComparer<'SafeKey>) (keyf:'T->'SafeKey) (getKey:'SafeKey->'Key) (list: 'T list) = + match list with + | [] -> [] + | _ -> + let dict = Dictionary<_, _ list []> comparer // Build the groupings diff --git a/src/fsharp/FSharp.Core/seq.fs b/src/fsharp/FSharp.Core/seq.fs index f057e8f3fd..f8ef697a8e 100644 --- a/src/fsharp/FSharp.Core/seq.fs +++ b/src/fsharp/FSharp.Core/seq.fs @@ -1032,6 +1032,8 @@ namespace Microsoft.FSharp.Collections let inline groupByImpl (comparer:IEqualityComparer<'SafeKey>) (keyf:'T->'SafeKey) (getKey:'SafeKey->'Key) (seq:seq<'T>) = checkNonNull "seq" seq + if isEmpty seq then empty else + let dict = Dictionary<_,ResizeArray<_>> comparer // Previously this was 1, but I think this is rather stingy, considering that we are already paying From 245a63848bae8bf569a1b05d34dc4b40680d1e54 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Mon, 23 Jul 2018 10:19:42 -0700 Subject: [PATCH 096/150] Cherrypick uithread from Dev15.8 (#5364) --- .../DocumentTask.cs | 3 ++- .../LanguageService.cs | 4 ++-- .../Project/IDEBuildLogger.cs | 18 +++++++++--------- .../src/FSharp.ProjectSystem.FSharp/Project.fs | 3 ++- vsintegration/tests/UnitTests/TestLib.Utils.fs | 1 + 5 files changed, 16 insertions(+), 13 deletions(-) diff --git a/vsintegration/src/FSharp.LanguageService.Base/DocumentTask.cs b/vsintegration/src/FSharp.LanguageService.Base/DocumentTask.cs index 058562cf0f..d6664bb6a5 100644 --- a/vsintegration/src/FSharp.LanguageService.Base/DocumentTask.cs +++ b/vsintegration/src/FSharp.LanguageService.Base/DocumentTask.cs @@ -21,7 +21,8 @@ using VsShell = Microsoft.VisualStudio.Shell.VsShellUtilities; using System.Diagnostics.CodeAnalysis; -namespace Microsoft.VisualStudio.FSharp.LanguageService { +namespace Microsoft.VisualStudio.FSharp.LanguageService +{ internal static class UIThread { static SynchronizationContext ctxt; static bool isUnitTestingMode = false; diff --git a/vsintegration/src/FSharp.LanguageService.Base/LanguageService.cs b/vsintegration/src/FSharp.LanguageService.Base/LanguageService.cs index 18a00ea5f3..257f638cb4 100644 --- a/vsintegration/src/FSharp.LanguageService.Base/LanguageService.cs +++ b/vsintegration/src/FSharp.LanguageService.Base/LanguageService.cs @@ -685,8 +685,8 @@ internal BackgroundRequest_DEPRECATED CreateBackgroundRequest(FSharpSourceBase_D // Implemented in FSharpLanguageService.fs internal abstract BackgroundRequest_DEPRECATED CreateBackgroundRequest(int line, int col, TokenInfo info, string sourceText, ITextSnapshot snapshot, MethodTipMiscellany_DEPRECATED methodTipMiscellany, string fname, BackgroundRequestReason reason, IVsTextView view,AuthoringSink sink, ISource source, int timestamp, bool synchronous); - // Implemented in FSharpLanguageService.fs - internal abstract void OnParseFileOrCheckFileComplete(BackgroundRequest_DEPRECATED req); + // Implemented in FSharpLanguageService.fs + internal abstract void OnParseFileOrCheckFileComplete(BackgroundRequest_DEPRECATED req); internal void EnsureBackgroundThreadStarted() { diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/IDEBuildLogger.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/IDEBuildLogger.cs index 927c2c6f9d..edb1883ff8 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/IDEBuildLogger.cs +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/IDEBuildLogger.cs @@ -250,22 +250,22 @@ private void AddToErrorList( span.iEndLine = endLine < startLine ? span.iStartLine : endLine; span.iEndIndex = (endColumn < startColumn) && (span.iStartLine == span.iEndLine) ? span.iStartIndex : endColumn; - if (OutputWindowPane != null - && (this.Verbosity != LoggerVerbosity.Quiet || errorEvent is BuildErrorEventArgs)) - { - // Format error and output it to the output window - string message = this.FormatMessage(errorEvent.Message); + if (OutputWindowPane != null + && (this.Verbosity != LoggerVerbosity.Quiet || errorEvent is BuildErrorEventArgs)) + { + // Format error and output it to the output window + string message = this.FormatMessage(errorEvent.Message); DefaultCompilerError e = new DefaultCompilerError(file, span.iStartLine, span.iStartIndex, span.iEndLine, span.iEndIndex, errorCode, - message); - e.IsWarning = isWarning; + message); + e.IsWarning = isWarning; - Output(GetFormattedErrorMessage(e)); - } + Output(GetFormattedErrorMessage(e)); + } UIThread.Run(delegate() { diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/Project.fs b/vsintegration/src/FSharp.ProjectSystem.FSharp/Project.fs index 33bb1245c6..d33ea17447 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/Project.fs +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/Project.fs @@ -200,7 +200,8 @@ namespace rec Microsoft.VisualStudio.FSharp.ProjectSystem resourceValue override this.Initialize() = - UIThread.CaptureSynchronizationContext() + Microsoft.VisualStudio.FSharp.LanguageService.UIThread.CaptureSynchronizationContext() + Microsoft.VisualStudio.FSharp.ProjectSystem.UIThread.CaptureSynchronizationContext() base.Initialize() diff --git a/vsintegration/tests/UnitTests/TestLib.Utils.fs b/vsintegration/tests/UnitTests/TestLib.Utils.fs index d4c44696b7..d67e55fe8e 100644 --- a/vsintegration/tests/UnitTests/TestLib.Utils.fs +++ b/vsintegration/tests/UnitTests/TestLib.Utils.fs @@ -51,6 +51,7 @@ module Asserts = module UIStuff = let SetupSynchronizationContext() = + Microsoft.VisualStudio.FSharp.ProjectSystem.UIThread.InitUnitTestingMode() Microsoft.VisualStudio.FSharp.LanguageService.UIThread.InitUnitTestingMode() Microsoft.VisualStudio.FSharp.ProjectSystem.UIThread.InitUnitTestingMode() From ca22bfe2e57c39d72e4a8e9bbe1f3766aec042d5 Mon Sep 17 00:00:00 2001 From: Isaac Abraham Date: Tue, 24 Jul 2018 06:41:36 +0200 Subject: [PATCH 097/150] Better expression errors (#5114) * Initial commit. * Add missing xlf files. * Update messages. * Simplify list and array messages. * Add missing xlf files. * Simply text further. * Update bsl file. * Update neg 80 baseline. * More unit test whack-a-mole. --- .../FSharp.Compiler.Private/FSComp.fs | 8 ++++---- src/fsharp/FSComp.txt | 10 +++++----- src/fsharp/xlf/FSComp.txt.cs.xlf | 18 ++++++++--------- src/fsharp/xlf/FSComp.txt.de.xlf | 18 ++++++++--------- src/fsharp/xlf/FSComp.txt.en.xlf | 20 +++++++++---------- src/fsharp/xlf/FSComp.txt.es.xlf | 18 ++++++++--------- src/fsharp/xlf/FSComp.txt.fr.xlf | 18 ++++++++--------- src/fsharp/xlf/FSComp.txt.it.xlf | 18 ++++++++--------- src/fsharp/xlf/FSComp.txt.ja.xlf | 18 ++++++++--------- src/fsharp/xlf/FSComp.txt.ko.xlf | 18 ++++++++--------- src/fsharp/xlf/FSComp.txt.pl.xlf | 18 ++++++++--------- src/fsharp/xlf/FSComp.txt.pt-BR.xlf | 18 ++++++++--------- src/fsharp/xlf/FSComp.txt.ru.xlf | 18 ++++++++--------- src/fsharp/xlf/FSComp.txt.tr.xlf | 18 ++++++++--------- src/fsharp/xlf/FSComp.txt.zh-Hans.xlf | 18 ++++++++--------- src/fsharp/xlf/FSComp.txt.zh-Hant.xlf | 18 ++++++++--------- tests/fsharp/typecheck/sigs/neg20.bsl | 18 ++++++++--------- tests/fsharp/typecheck/sigs/neg80.vsbsl | 2 +- .../async/ReturnBangNonAsync_IfThenElse.fs | 2 +- .../Source/Warnings/ElseBranchHasWrongType.fs | 2 +- .../Warnings/ElseBranchHasWrongType2.fs | 2 +- .../Warnings/ElseBranchHasWrongType3.fs | 2 +- .../Warnings/ElseBranchHasWrongType4.fs | 2 +- .../Warnings/NestedElseBranchHasWrongType.fs | 2 +- .../Warnings/WarnIfMissingElseBranch.fs | 2 +- .../Warnings/WarnIfMissingElseBranch3.fs | 2 +- 26 files changed, 154 insertions(+), 154 deletions(-) diff --git a/src/buildfromsource/FSharp.Compiler.Private/FSComp.fs b/src/buildfromsource/FSharp.Compiler.Private/FSComp.fs index 894d6051fe..c8eb953fea 100644 --- a/src/buildfromsource/FSharp.Compiler.Private/FSComp.fs +++ b/src/buildfromsource/FSharp.Compiler.Private/FSComp.fs @@ -163,19 +163,19 @@ type internal SR private() = /// Add . for indexer access. /// (Originally from ..\FSComp.txt:19) static member addIndexerDot() = (GetStringFunc("addIndexerDot",",,,") ) - /// All elements of a list constructor expression must have the same type. This expression was expected to have type '%s', but here has type '%s'. + /// All elements of a list constructor expression must have the same type. The first element has type '%s', but there is also an element of type '%s'. /// (Originally from ..\FSComp.txt:20) static member listElementHasWrongType(a0 : System.String, a1 : System.String) = (GetStringFunc("listElementHasWrongType",",,,%s,,,%s,,,") a0 a1) - /// All elements of an array constructor expression must have the same type. This expression was expected to have type '%s', but here has type '%s'. + /// All elements of an array constructor expression must have the same type. The first element has type '%s', but there is also an element of type '%s'. /// (Originally from ..\FSComp.txt:21) static member arrayElementHasWrongType(a0 : System.String, a1 : System.String) = (GetStringFunc("arrayElementHasWrongType",",,,%s,,,%s,,,") a0 a1) - /// The 'if' expression is missing an 'else' branch. The 'then' branch has type '%s'. Because 'if' is an expression, and not a statement, add an 'else' branch which returns a value of the same type. + /// The 'if' expression is missing an 'else' branch. Because 'if' is an expression, and not a statement, add an 'else' branch which returns a value of the same type as the first branch ('%s'). /// (Originally from ..\FSComp.txt:22) static member missingElseBranch(a0 : System.String) = (GetStringFunc("missingElseBranch",",,,%s,,,") a0) /// The 'if' expression needs to have type '%s' to satisfy context type requirements. It currently has type '%s'. /// (Originally from ..\FSComp.txt:23) static member ifExpression(a0 : System.String, a1 : System.String) = (GetStringFunc("ifExpression",",,,%s,,,%s,,,") a0 a1) - /// All branches of an 'if' expression must have the same type. This expression was expected to have type '%s', but here has type '%s'. + /// All branches of an 'if' expression must return values of the same type. The first branch returned a value of type '%s', but this branch returned a value of type '%s'. /// (Originally from ..\FSComp.txt:24) static member elseBranchHasWrongType(a0 : System.String, a1 : System.String) = (GetStringFunc("elseBranchHasWrongType",",,,%s,,,%s,,,") a0 a1) /// All branches of a pattern match expression must return values of the same type. The first branch returned a value of type '%s', but this branch returned a value of type '%s'. diff --git a/src/fsharp/FSComp.txt b/src/fsharp/FSComp.txt index 3b058f3a8f..868c54a65c 100644 --- a/src/fsharp/FSComp.txt +++ b/src/fsharp/FSComp.txt @@ -17,12 +17,12 @@ undefinedNameTypeParameter,"The type parameter %s is not defined." undefinedNamePatternDiscriminator,"The pattern discriminator '%s' is not defined." replaceWithSuggestion,"Replace with '%s'" addIndexerDot,"Add . for indexer access." -listElementHasWrongType,"All elements of a list constructor expression must have the same type. This expression was expected to have type '%s', but here has type '%s'." -arrayElementHasWrongType,"All elements of an array constructor expression must have the same type. This expression was expected to have type '%s', but here has type '%s'." -missingElseBranch,"The 'if' expression is missing an 'else' branch. The 'then' branch has type '%s'. Because 'if' is an expression, and not a statement, add an 'else' branch which returns a value of the same type." +listElementHasWrongType,"All elements of a list must be of the same type as the first element, which here is '%s'. This element has type '%s'." +arrayElementHasWrongType,"All elements of an array must be of the same type as the first element, which here is '%s'. This element has type '%s'." +missingElseBranch,"This 'if' expression is missing an 'else' branch. Because 'if' is an expression, and not a statement, add an 'else' branch which also returns a value of type '%s'." ifExpression,"The 'if' expression needs to have type '%s' to satisfy context type requirements. It currently has type '%s'." -elseBranchHasWrongType,"All branches of an 'if' expression must have the same type. This expression was expected to have type '%s', but here has type '%s'." -followingPatternMatchClauseHasWrongType,"All branches of a pattern match expression must return values of the same type. The first branch returned a value of type '%s', but this branch returned a value of type '%s'." +elseBranchHasWrongType,"All branches of an 'if' expression must return values of the same type as the first branch, which here is '%s'. This branch returns a value of type '%s'." +followingPatternMatchClauseHasWrongType,"All branches of a pattern match expression must return values of the same type as the first branch, which here is '%s'. This branch returns a value of type '%s'." patternMatchGuardIsNotBool,"A pattern match guard must be of type 'bool', but this 'when' expression is of type '%s'." commaInsteadOfSemicolonInRecord,"A ';' is used to separate field values in records. Consider replacing ',' with ';'." derefInsteadOfNot,"The '!' operator is used to dereference a ref cell. Consider using 'not expr' here." diff --git a/src/fsharp/xlf/FSComp.txt.cs.xlf b/src/fsharp/xlf/FSComp.txt.cs.xlf index d86b89f176..437c586778 100644 --- a/src/fsharp/xlf/FSComp.txt.cs.xlf +++ b/src/fsharp/xlf/FSComp.txt.cs.xlf @@ -83,18 +83,18 @@ - All elements of a list constructor expression must have the same type. This expression was expected to have type '{0}', but here has type '{1}'. - Všechny elementy výrazu konstruktoru seznamu musí mít stejný typ. Očekávalo se, že tento výraz bude mít typ {0}, ale tady je typu {1}. + All elements of a list must be of the same type as the first element, which here is '{0}'. This element has type '{1}'. + Všechny elementy výrazu konstruktoru seznamu musí mít stejný typ. Očekávalo se, že tento výraz bude mít typ {0}, ale tady je typu {1}. - All elements of an array constructor expression must have the same type. This expression was expected to have type '{0}', but here has type '{1}'. - Všechny elementy výrazu konstruktoru pole musí mít stejný typ. Očekávalo se, že tento výraz bude mít typ {0}, ale tady je typu {1}. + All elements of an array must be of the same type as the first element, which here is '{0}'. This element has type '{1}'. + Všechny elementy výrazu konstruktoru pole musí mít stejný typ. Očekávalo se, že tento výraz bude mít typ {0}, ale tady je typu {1}. - The 'if' expression is missing an 'else' branch. The 'then' branch has type '{0}'. Because 'if' is an expression, and not a statement, add an 'else' branch which returns a value of the same type. - Ve výrazu if chybí větev else. Větev then je typu {0}. Protože if je výraz a ne příkaz, přidejte větev else, která vrátí hodnotu stejného typu. + This 'if' expression is missing an 'else' branch. Because 'if' is an expression, and not a statement, add an 'else' branch which also returns a value of type '{0}'. + Ve výrazu if chybí větev else. Větev then je typu {0}. Protože if je výraz a ne příkaz, přidejte větev else, která vrátí hodnotu stejného typu. @@ -103,12 +103,12 @@ - All branches of an 'if' expression must have the same type. This expression was expected to have type '{0}', but here has type '{1}'. - Všechny větve výrazu if musí mít stejný typ. Očekávalo se, že tento výraz bude mít typ {0}, ale tady je typu {1}. + All branches of an 'if' expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. + Všechny větve výrazu if musí mít stejný typ. Očekávalo se, že tento výraz bude mít typ {0}, ale tady je typu {1}. - All branches of a pattern match expression must return values of the same type. The first branch returned a value of type '{0}', but this branch returned a value of type '{1}'. + All branches of a pattern match expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. Všechny větve výrazu porovnání vzorů musí vracet hodnoty stejného typu. První větev vrátila hodnotu typu {0}, ale tato větev vrátila hodnotu typu {1}. diff --git a/src/fsharp/xlf/FSComp.txt.de.xlf b/src/fsharp/xlf/FSComp.txt.de.xlf index b77b2924ff..0c692a275c 100644 --- a/src/fsharp/xlf/FSComp.txt.de.xlf +++ b/src/fsharp/xlf/FSComp.txt.de.xlf @@ -83,18 +83,18 @@ - All elements of a list constructor expression must have the same type. This expression was expected to have type '{0}', but here has type '{1}'. - Alle Elemente eines Listenkonstruktorausdrucks müssen den gleichen Typ aufweisen. Es wurde erwartet, dass dieser Ausdruck den Typ "{0}" aufweist, hier liegt aber der Typ "{1}" vor. + All elements of a list must be of the same type as the first element, which here is '{0}'. This element has type '{1}'. + Alle Elemente eines Listenkonstruktorausdrucks müssen den gleichen Typ aufweisen. Es wurde erwartet, dass dieser Ausdruck den Typ "{0}" aufweist, hier liegt aber der Typ "{1}" vor. - All elements of an array constructor expression must have the same type. This expression was expected to have type '{0}', but here has type '{1}'. - Alle Elemente eines Arraykonstruktorausdrucks müssen den gleichen Typ aufweisen. Es wurde erwartet, dass dieser Ausdruck den Typ "{0}" aufweist, hier liegt aber der Typ "{1}" vor. + All elements of an array must be of the same type as the first element, which here is '{0}'. This element has type '{1}'. + Alle Elemente eines Arraykonstruktorausdrucks müssen den gleichen Typ aufweisen. Es wurde erwartet, dass dieser Ausdruck den Typ "{0}" aufweist, hier liegt aber der Typ "{1}" vor. - The 'if' expression is missing an 'else' branch. The 'then' branch has type '{0}'. Because 'if' is an expression, and not a statement, add an 'else' branch which returns a value of the same type. - Dem if-Ausdruck fehlt ein else-Branch. Der then-Branch weist den Typ "{0}" auf. Da "if" ein Ausdruck und keine Anweisung ist, fügen Sie einen else-Branch hinzu, der einen Wert des gleichen Typs zurückgibt. + This 'if' expression is missing an 'else' branch. Because 'if' is an expression, and not a statement, add an 'else' branch which also returns a value of type '{0}'. + Dem if-Ausdruck fehlt ein else-Branch. Der then-Branch weist den Typ "{0}" auf. Da "if" ein Ausdruck und keine Anweisung ist, fügen Sie einen else-Branch hinzu, der einen Wert des gleichen Typs zurückgibt. @@ -103,12 +103,12 @@ - All branches of an 'if' expression must have the same type. This expression was expected to have type '{0}', but here has type '{1}'. - Alle Branches eines if-Ausdrucks müssen den gleichen Typ aufweisen. Es wurde erwartet, dass dieser Ausdruck den Typ "{0}" aufweist, hier liegt aber der Typ "{1}" vor. + All branches of an 'if' expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. + Alle Branches eines if-Ausdrucks müssen den gleichen Typ aufweisen. Es wurde erwartet, dass dieser Ausdruck den Typ "{0}" aufweist, hier liegt aber der Typ "{1}" vor. - All branches of a pattern match expression must return values of the same type. The first branch returned a value of type '{0}', but this branch returned a value of type '{1}'. + All branches of a pattern match expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. Alle Branches eines Musterübereinstimmungsausdrucks müssen Werte des gleichen Typs zurückgeben. Der erste Branch hat einen Wert vom Typ "{0}" zurückgegeben, aber dieser Branch gab einen Wert vom Typ "{1}" zurück. diff --git a/src/fsharp/xlf/FSComp.txt.en.xlf b/src/fsharp/xlf/FSComp.txt.en.xlf index 3d980b3618..2a67f47824 100644 --- a/src/fsharp/xlf/FSComp.txt.en.xlf +++ b/src/fsharp/xlf/FSComp.txt.en.xlf @@ -83,18 +83,18 @@ - All elements of a list constructor expression must have the same type. This expression was expected to have type '{0}', but here has type '{1}'. - All elements of a list constructor expression must have the same type. This expression was expected to have type '{0}', but here has type '{1}'. + All elements of a list must be of the same type as the first element, which here is '{0}'. This element has type '{1}'. + All elements of a list must be of the same type as the first element, which here is '{0}'. This element has type '{1}'. - All elements of an array constructor expression must have the same type. This expression was expected to have type '{0}', but here has type '{1}'. - All elements of an array constructor expression must have the same type. This expression was expected to have type '{0}', but here has type '{1}'. + All elements of an array must be of the same type as the first element, which here is '{0}'. This element has type '{1}'. + All elements of an array must be of the same type as the first element, which here is '{0}'. This element has type '{1}'. - The 'if' expression is missing an 'else' branch. The 'then' branch has type '{0}'. Because 'if' is an expression, and not a statement, add an 'else' branch which returns a value of the same type. - The 'if' expression is missing an 'else' branch. The 'then' branch has type '{0}'. Because 'if' is an expression, and not a statement, add an 'else' branch which returns a value of the same type. + This 'if' expression is missing an 'else' branch. Because 'if' is an expression, and not a statement, add an 'else' branch which also returns a value of type '{0}'. + This 'if' expression is missing an 'else' branch. Because 'if' is an expression, and not a statement, add an 'else' branch which also returns a value of type '{0}'. @@ -103,13 +103,13 @@ - All branches of an 'if' expression must have the same type. This expression was expected to have type '{0}', but here has type '{1}'. - All branches of an 'if' expression must have the same type. This expression was expected to have type '{0}', but here has type '{1}'. + All branches of an 'if' expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. + All branches of an 'if' expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. - All branches of a pattern match expression must return values of the same type. The first branch returned a value of type '{0}', but this branch returned a value of type '{1}'. - All branches of a pattern match expression must return values of the same type. The first branch returned a value of type '{0}', but this branch returned a value of type '{1}'. + All branches of a pattern match expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. + All branches of a pattern match expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. diff --git a/src/fsharp/xlf/FSComp.txt.es.xlf b/src/fsharp/xlf/FSComp.txt.es.xlf index e57dc1ec93..b902554d16 100644 --- a/src/fsharp/xlf/FSComp.txt.es.xlf +++ b/src/fsharp/xlf/FSComp.txt.es.xlf @@ -83,18 +83,18 @@ - All elements of a list constructor expression must have the same type. This expression was expected to have type '{0}', but here has type '{1}'. - Todas las ramas de una expresión de constructor de lista deben tener el mismo tipo. Se esperaba que esta expresión tuviera el tipo "{0}", pero aquí tiene el tipo "{1}". + All elements of a list must be of the same type as the first element, which here is '{0}'. This element has type '{1}'. + Todas las ramas de una expresión de constructor de lista deben tener el mismo tipo. Se esperaba que esta expresión tuviera el tipo "{0}", pero aquí tiene el tipo "{1}". - All elements of an array constructor expression must have the same type. This expression was expected to have type '{0}', but here has type '{1}'. - Todos los elementos de una expresión de constructor de matriz deben tener el mismo tipo. Se esperaba que esta expresión tuviera el tipo "{0}", pero aquí tiene el tipo "{1}". + All elements of an array must be of the same type as the first element, which here is '{0}'. This element has type '{1}'. + Todos los elementos de una expresión de constructor de matriz deben tener el mismo tipo. Se esperaba que esta expresión tuviera el tipo "{0}", pero aquí tiene el tipo "{1}". - The 'if' expression is missing an 'else' branch. The 'then' branch has type '{0}'. Because 'if' is an expression, and not a statement, add an 'else' branch which returns a value of the same type. - La expresión "if" no tiene una rama "else". La rama "then" tiene el tipo '{0}'. Dado que "if" es una expresión y no una instrucción, agregue una rama "else" que devuelva un valor del mismo tipo. + This 'if' expression is missing an 'else' branch. Because 'if' is an expression, and not a statement, add an 'else' branch which also returns a value of type '{0}'. + La expresión "if" no tiene una rama "else". La rama "then" tiene el tipo '{0}'. Dado que "if" es una expresión y no una instrucción, agregue una rama "else" que devuelva un valor del mismo tipo. @@ -103,12 +103,12 @@ - All branches of an 'if' expression must have the same type. This expression was expected to have type '{0}', but here has type '{1}'. - Todas las ramas de una expresión "if" deben devolver el mismo tipo. Se esperaba que esta expresión tuviera el tipo "{0}", pero aquí tiene el tipo "{1}". + All branches of an 'if' expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. + Todas las ramas de una expresión "if" deben devolver el mismo tipo. Se esperaba que esta expresión tuviera el tipo "{0}", pero aquí tiene el tipo "{1}". - All branches of a pattern match expression must return values of the same type. The first branch returned a value of type '{0}', but this branch returned a value of type '{1}'. + All branches of a pattern match expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. Todas las ramas de una expresión de coincidencia de patrón deben devolver valores del mismo tipo. La primera rama devolvió un valor de tipo "{0}", pero esta rama devolvió un valor de tipo "\{1 \}". diff --git a/src/fsharp/xlf/FSComp.txt.fr.xlf b/src/fsharp/xlf/FSComp.txt.fr.xlf index 65707d9801..d0db5deb33 100644 --- a/src/fsharp/xlf/FSComp.txt.fr.xlf +++ b/src/fsharp/xlf/FSComp.txt.fr.xlf @@ -83,18 +83,18 @@ - All elements of a list constructor expression must have the same type. This expression was expected to have type '{0}', but here has type '{1}'. - Tous les éléments d'une expression comportant un constructeur de liste doivent avoir le même type. Cette expression était censée avoir le type '{0}', mais elle a ici le type '{1}'. + All elements of a list must be of the same type as the first element, which here is '{0}'. This element has type '{1}'. + Tous les éléments d'une expression comportant un constructeur de liste doivent avoir le même type. Cette expression était censée avoir le type '{0}', mais elle a ici le type '{1}'. - All elements of an array constructor expression must have the same type. This expression was expected to have type '{0}', but here has type '{1}'. - Tous les éléments d'une expression comportant un constructeur de tableau doivent avoir le même type. Cette expression était censée avoir le type '{0}', mais elle a ici le type '{1}'. + All elements of an array must be of the same type as the first element, which here is '{0}'. This element has type '{1}'. + Tous les éléments d'une expression comportant un constructeur de tableau doivent avoir le même type. Cette expression était censée avoir le type '{0}', mais elle a ici le type '{1}'. - The 'if' expression is missing an 'else' branch. The 'then' branch has type '{0}'. Because 'if' is an expression, and not a statement, add an 'else' branch which returns a value of the same type. - Il manque à l'expression 'if' une branche 'else'. La branche 'then' a le type '{0}'. Dans la mesure où 'if' est une expression, et non une instruction, ajoutez une branche 'else' qui retourne une valeur du même type. + This 'if' expression is missing an 'else' branch. Because 'if' is an expression, and not a statement, add an 'else' branch which also returns a value of type '{0}'. + Il manque à l'expression 'if' une branche 'else'. La branche 'then' a le type '{0}'. Dans la mesure où 'if' est une expression, et non une instruction, ajoutez une branche 'else' qui retourne une valeur du même type. @@ -103,12 +103,12 @@ - All branches of an 'if' expression must have the same type. This expression was expected to have type '{0}', but here has type '{1}'. - Toutes les branches d'une expression 'if' doivent avoir le même type. Cette expression était censée avoir le type '{0}', mais elle a ici le type '{1}'. + All branches of an 'if' expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. + Toutes les branches d'une expression 'if' doivent avoir le même type. Cette expression était censée avoir le type '{0}', mais elle a ici le type '{1}'. - All branches of a pattern match expression must return values of the same type. The first branch returned a value of type '{0}', but this branch returned a value of type '{1}'. + All branches of a pattern match expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. Toutes les branches d'une expression comportant des critères spéciaux doivent retourner des valeurs du même type. La première branche a retourné une valeur de type '{0}', mais cette branche a retourné une valeur de type '{1}'. diff --git a/src/fsharp/xlf/FSComp.txt.it.xlf b/src/fsharp/xlf/FSComp.txt.it.xlf index 42ed6fe71a..7d73029c21 100644 --- a/src/fsharp/xlf/FSComp.txt.it.xlf +++ b/src/fsharp/xlf/FSComp.txt.it.xlf @@ -83,18 +83,18 @@ - All elements of a list constructor expression must have the same type. This expression was expected to have type '{0}', but here has type '{1}'. - Il tipo di tutti gli elementi di un'espressione di costruttore di elenco deve essere lo stesso. Il tipo previsto di questa espressione è '{0}', ma quello effettivo è '{1}'. + All elements of a list must be of the same type as the first element, which here is '{0}'. This element has type '{1}'. + Il tipo di tutti gli elementi di un'espressione di costruttore di elenco deve essere lo stesso. Il tipo previsto di questa espressione è '{0}', ma quello effettivo è '{1}'. - All elements of an array constructor expression must have the same type. This expression was expected to have type '{0}', but here has type '{1}'. - Il tipo di tutti gli elementi di un'espressione di costruttore di matrice deve essere lo stesso. Il tipo previsto di questa espressione è '{0}', ma quello effettivo è '{1}'. + All elements of an array must be of the same type as the first element, which here is '{0}'. This element has type '{1}'. + Il tipo di tutti gli elementi di un'espressione di costruttore di matrice deve essere lo stesso. Il tipo previsto di questa espressione è '{0}', ma quello effettivo è '{1}'. - The 'if' expression is missing an 'else' branch. The 'then' branch has type '{0}'. Because 'if' is an expression, and not a statement, add an 'else' branch which returns a value of the same type. - Nell'espressione 'if' manca un ramo 'else'. Il tipo del ramo 'then' è '{0}'. Dal momento che 'if' è un'espressione e non un'istruzione, aggiungere un ramo 'else' che restituisca un valore dello stesso tipo. + This 'if' expression is missing an 'else' branch. Because 'if' is an expression, and not a statement, add an 'else' branch which also returns a value of type '{0}'. + Nell'espressione 'if' manca un ramo 'else'. Il tipo del ramo 'then' è '{0}'. Dal momento che 'if' è un'espressione e non un'istruzione, aggiungere un ramo 'else' che restituisca un valore dello stesso tipo. @@ -103,12 +103,12 @@ - All branches of an 'if' expression must have the same type. This expression was expected to have type '{0}', but here has type '{1}'. - Il tipo di tutti i rami di un'espressione 'if' deve essere lo stesso. Il tipo previsto di questa espressione è '{0}', ma quello effettivo è '{1}'. + All branches of an 'if' expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. + Il tipo di tutti i rami di un'espressione 'if' deve essere lo stesso. Il tipo previsto di questa espressione è '{0}', ma quello effettivo è '{1}'. - All branches of a pattern match expression must return values of the same type. The first branch returned a value of type '{0}', but this branch returned a value of type '{1}'. + All branches of a pattern match expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. Tutti i rami di un'espressione di criteri di ricerca devono restituire valori dello stesso tipo. Il primo ramo ha restituito un valore di tipo '{0}', ma questo ramo ha restituito un valore di tipo '{1}'. diff --git a/src/fsharp/xlf/FSComp.txt.ja.xlf b/src/fsharp/xlf/FSComp.txt.ja.xlf index b5fcee295b..3919d22f6e 100644 --- a/src/fsharp/xlf/FSComp.txt.ja.xlf +++ b/src/fsharp/xlf/FSComp.txt.ja.xlf @@ -83,18 +83,18 @@ - All elements of a list constructor expression must have the same type. This expression was expected to have type '{0}', but here has type '{1}'. - リスト コンストラクター式のすべての要素は同じ型である必要があります。この式に必要な型は '{0}' ですが、ここでは型 '{1}' になっています。 + All elements of a list must be of the same type as the first element, which here is '{0}'. This element has type '{1}'. + リスト コンストラクター式のすべての要素は同じ型である必要があります。この式に必要な型は '{0}' ですが、ここでは型 '{1}' になっています。 - All elements of an array constructor expression must have the same type. This expression was expected to have type '{0}', but here has type '{1}'. - 配列コンストラクター式の要素はすべて同じ型である必要があります。この式に必要な型は '{0}' ですが、ここでは型 '{1}' になっています。 + All elements of an array must be of the same type as the first element, which here is '{0}'. This element has type '{1}'. + 配列コンストラクター式の要素はすべて同じ型である必要があります。この式に必要な型は '{0}' ですが、ここでは型 '{1}' になっています。 - The 'if' expression is missing an 'else' branch. The 'then' branch has type '{0}'. Because 'if' is an expression, and not a statement, add an 'else' branch which returns a value of the same type. - 'if' 式に 'else' ブランチがありません。'then' ブランチは型 '{0}' です。'if' はステートメントではなく式であるため、同じ型の値を返す 'else' ブランチを追加してください。 + This 'if' expression is missing an 'else' branch. Because 'if' is an expression, and not a statement, add an 'else' branch which also returns a value of type '{0}'. + 'if' 式に 'else' ブランチがありません。'then' ブランチは型 '{0}' です。'if' はステートメントではなく式であるため、同じ型の値を返す 'else' ブランチを追加してください。 @@ -103,12 +103,12 @@ - All branches of an 'if' expression must have the same type. This expression was expected to have type '{0}', but here has type '{1}'. - if' 式のすべてのブランチは同じ型である必要があります。この式に必要な型は '{0}' ですが、ここでは型 '{1}' になっています。 + All branches of an 'if' expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. + if' 式のすべてのブランチは同じ型である必要があります。この式に必要な型は '{0}' ですが、ここでは型 '{1}' になっています。 - All branches of a pattern match expression must return values of the same type. The first branch returned a value of type '{0}', but this branch returned a value of type '{1}'. + All branches of a pattern match expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. パターン マッチ式のすべてのブランチは、同じ型の値を返す必要があります。最初のブランチが返した値の型は '{0}' ですが、このブランチが返した値の型は '{1}' です。 diff --git a/src/fsharp/xlf/FSComp.txt.ko.xlf b/src/fsharp/xlf/FSComp.txt.ko.xlf index f052e23210..d38e7c3478 100644 --- a/src/fsharp/xlf/FSComp.txt.ko.xlf +++ b/src/fsharp/xlf/FSComp.txt.ko.xlf @@ -83,18 +83,18 @@ - All elements of a list constructor expression must have the same type. This expression was expected to have type '{0}', but here has type '{1}'. - 목록 생성자의 모든 요소는 동일한 형식이어야 합니다. 이 식에는 '{0}' 형식이 필요하지만 여기에서는 '{1}' 형식이 지정되었습니다. + All elements of a list must be of the same type as the first element, which here is '{0}'. This element has type '{1}'. + 목록 생성자의 모든 요소는 동일한 형식이어야 합니다. 이 식에는 '{0}' 형식이 필요하지만 여기에서는 '{1}' 형식이 지정되었습니다. - All elements of an array constructor expression must have the same type. This expression was expected to have type '{0}', but here has type '{1}'. - 배열 생성자의 모든 요소는 동일한 형식이어야 합니다. 이 식에는 '{0}' 형식이 필요하지만 여기에서는 '{1}' 형식이 지정되었습니다. + All elements of an array must be of the same type as the first element, which here is '{0}'. This element has type '{1}'. + 배열 생성자의 모든 요소는 동일한 형식이어야 합니다. 이 식에는 '{0}' 형식이 필요하지만 여기에서는 '{1}' 형식이 지정되었습니다. - The 'if' expression is missing an 'else' branch. The 'then' branch has type '{0}'. Because 'if' is an expression, and not a statement, add an 'else' branch which returns a value of the same type. - 'if' 식에 'else' 분기가 누락되었습니다. 'then' 분기의 형식은 '{0}'입니다. 'if'는 문이 아니라 식이므로 동일한 형식의 값을 반환하는 'else' 분기를 추가하세요. + This 'if' expression is missing an 'else' branch. Because 'if' is an expression, and not a statement, add an 'else' branch which also returns a value of type '{0}'. + 'if' 식에 'else' 분기가 누락되었습니다. 'then' 분기의 형식은 '{0}'입니다. 'if'는 문이 아니라 식이므로 동일한 형식의 값을 반환하는 'else' 분기를 추가하세요. @@ -103,12 +103,12 @@ - All branches of an 'if' expression must have the same type. This expression was expected to have type '{0}', but here has type '{1}'. - if' 식의 모든 분기는 동일한 형식이어야 합니다. 이 식에는 '{0}' 형식이 필요하지만 여기에서는 '{1}' 형식이 지정되었습니다. + All branches of an 'if' expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. + if' 식의 모든 분기는 동일한 형식이어야 합니다. 이 식에는 '{0}' 형식이 필요하지만 여기에서는 '{1}' 형식이 지정되었습니다. - All branches of a pattern match expression must return values of the same type. The first branch returned a value of type '{0}', but this branch returned a value of type '{1}'. + All branches of a pattern match expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. 패턴 일치 식의 모든 분기는 동일한 형식의 값을 반환해야 합니다. 첫 번째 분기는 '{0}' 형식의 값을 반환했지만 이 분기는 '{1}' 형식의 값을 반환했습니다. diff --git a/src/fsharp/xlf/FSComp.txt.pl.xlf b/src/fsharp/xlf/FSComp.txt.pl.xlf index 47846ad6a0..e2afe0bfa2 100644 --- a/src/fsharp/xlf/FSComp.txt.pl.xlf +++ b/src/fsharp/xlf/FSComp.txt.pl.xlf @@ -83,18 +83,18 @@ - All elements of a list constructor expression must have the same type. This expression was expected to have type '{0}', but here has type '{1}'. - Wszystkie elementy wyrażenia konstruktora listy muszą mieć ten sam typ. Oczekiwano, że to wyrażenie będzie miało typ „{0}”, ale tutaj ma typ „{1}”. + All elements of a list must be of the same type as the first element, which here is '{0}'. This element has type '{1}'. + Wszystkie elementy wyrażenia konstruktora listy muszą mieć ten sam typ. Oczekiwano, że to wyrażenie będzie miało typ „{0}”, ale tutaj ma typ „{1}”. - All elements of an array constructor expression must have the same type. This expression was expected to have type '{0}', but here has type '{1}'. - Wszystkie elementy wyrażenia konstruktora tablicy muszą mieć ten sam typ. Oczekiwano, że to wyrażenie będzie miało typ „{0}”, ale tutaj ma typ „{1}”. + All elements of an array must be of the same type as the first element, which here is '{0}'. This element has type '{1}'. + Wszystkie elementy wyrażenia konstruktora tablicy muszą mieć ten sam typ. Oczekiwano, że to wyrażenie będzie miało typ „{0}”, ale tutaj ma typ „{1}”. - The 'if' expression is missing an 'else' branch. The 'then' branch has type '{0}'. Because 'if' is an expression, and not a statement, add an 'else' branch which returns a value of the same type. - W wyrażeniu „if” brakuje gałęzi „else”. Gałąź „then” ma typ „{0}”. Jako że „if” jest wyrażeniem, a nie instrukcją, dodaj gałąź „else”, która będzie zwracać wartość tego samego typu. + This 'if' expression is missing an 'else' branch. Because 'if' is an expression, and not a statement, add an 'else' branch which also returns a value of type '{0}'. + W wyrażeniu „if” brakuje gałęzi „else”. Gałąź „then” ma typ „{0}”. Jako że „if” jest wyrażeniem, a nie instrukcją, dodaj gałąź „else”, która będzie zwracać wartość tego samego typu. @@ -103,12 +103,12 @@ - All branches of an 'if' expression must have the same type. This expression was expected to have type '{0}', but here has type '{1}'. - Wszystkie gałęzie wyrażenia „if” muszą mieć ten sam typ. Oczekiwano, że to wyrażenie będzie miało typ „{0}”, ale tutaj ma typ „{1}”. + All branches of an 'if' expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. + Wszystkie gałęzie wyrażenia „if” muszą mieć ten sam typ. Oczekiwano, że to wyrażenie będzie miało typ „{0}”, ale tutaj ma typ „{1}”. - All branches of a pattern match expression must return values of the same type. The first branch returned a value of type '{0}', but this branch returned a value of type '{1}'. + All branches of a pattern match expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. Wszystkie gałęzie wyrażenia dopasowania do wzorca muszą zwracać wartości tego samego typu. Pierwsza gałąź zwróciła wartość typu „{0}”, ale ta gałąź zwróciła wartość typu „{1}” diff --git a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf index 45ba078c79..c80ac3eb45 100644 --- a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf +++ b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf @@ -83,18 +83,18 @@ - All elements of a list constructor expression must have the same type. This expression was expected to have type '{0}', but here has type '{1}'. - Todos os elementos de uma expressão do construtor de lista devem ter o mesmo tipo. Essa expressão deveria ter o tipo '{0}', mas aqui tem o tipo '{1}'. + All elements of a list must be of the same type as the first element, which here is '{0}'. This element has type '{1}'. + Todos os elementos de uma expressão do construtor de lista devem ter o mesmo tipo. Essa expressão deveria ter o tipo '{0}', mas aqui tem o tipo '{1}'. - All elements of an array constructor expression must have the same type. This expression was expected to have type '{0}', but here has type '{1}'. - Todos os elementos de uma expressão do construtor de matriz devem ter o mesmo tipo. Essa expressão deveria ter o tipo '{0}', mas aqui tem o tipo '{1}'. + All elements of an array must be of the same type as the first element, which here is '{0}'. This element has type '{1}'. + Todos os elementos de uma expressão do construtor de matriz devem ter o mesmo tipo. Essa expressão deveria ter o tipo '{0}', mas aqui tem o tipo '{1}'. - The 'if' expression is missing an 'else' branch. The 'then' branch has type '{0}'. Because 'if' is an expression, and not a statement, add an 'else' branch which returns a value of the same type. - A expressão 'if' está sem uma ramificação 'else'. A ramificação 'then' tem tipo '{0}'. Como 'if' é uma expressão e não uma instrução, adicione uma ramificação 'else' que retorna um valor do mesmo tipo. + This 'if' expression is missing an 'else' branch. Because 'if' is an expression, and not a statement, add an 'else' branch which also returns a value of type '{0}'. + A expressão 'if' está sem uma ramificação 'else'. A ramificação 'then' tem tipo '{0}'. Como 'if' é uma expressão e não uma instrução, adicione uma ramificação 'else' que retorna um valor do mesmo tipo. @@ -103,12 +103,12 @@ - All branches of an 'if' expression must have the same type. This expression was expected to have type '{0}', but here has type '{1}'. - Todas as ramificações de uma expressão 'if' devem ter o mesmo tipo. Essa expressão deveria ter o tipo '{0}', mas aqui tem o tipo '{1}'. + All branches of an 'if' expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. + Todas as ramificações de uma expressão 'if' devem ter o mesmo tipo. Essa expressão deveria ter o tipo '{0}', mas aqui tem o tipo '{1}'. - All branches of a pattern match expression must return values of the same type. The first branch returned a value of type '{0}', but this branch returned a value of type '{1}'. + All branches of a pattern match expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. Todos os branches de uma expressão correspondente ao padrão precisam retornar valores do mesmo tipo. O primeiro branch retornou um valor do tipo '{0}', mas este branch retornou um valor do tipo '{1}'. diff --git a/src/fsharp/xlf/FSComp.txt.ru.xlf b/src/fsharp/xlf/FSComp.txt.ru.xlf index f030129d31..e5fc3dd44d 100644 --- a/src/fsharp/xlf/FSComp.txt.ru.xlf +++ b/src/fsharp/xlf/FSComp.txt.ru.xlf @@ -83,18 +83,18 @@ - All elements of a list constructor expression must have the same type. This expression was expected to have type '{0}', but here has type '{1}'. - Все элементы выражения конструктора списка должны иметь один и тот же тип. В этом выражении ожидалось использование типа "{0}", но используется тип "{1}". + All elements of a list must be of the same type as the first element, which here is '{0}'. This element has type '{1}'. + Все элементы выражения конструктора списка должны иметь один и тот же тип. В этом выражении ожидалось использование типа "{0}", но используется тип "{1}". - All elements of an array constructor expression must have the same type. This expression was expected to have type '{0}', but here has type '{1}'. - Все элементы выражения конструктора массива должны иметь один и тот же тип. В этом выражении ожидалось использование типа "{0}", но используется тип "{1}". + All elements of an array must be of the same type as the first element, which here is '{0}'. This element has type '{1}'. + Все элементы выражения конструктора массива должны иметь один и тот же тип. В этом выражении ожидалось использование типа "{0}", но используется тип "{1}". - The 'if' expression is missing an 'else' branch. The 'then' branch has type '{0}'. Because 'if' is an expression, and not a statement, add an 'else' branch which returns a value of the same type. - Выражение "if" не содержит ветвь "else". Ветвь "then" включает тип "{0}". Так как "if" является выражением, а не оператором, добавьте ветвь "else", которая возвращает значение того же типа. + This 'if' expression is missing an 'else' branch. Because 'if' is an expression, and not a statement, add an 'else' branch which also returns a value of type '{0}'. + Выражение "if" не содержит ветвь "else". Ветвь "then" включает тип "{0}". Так как "if" является выражением, а не оператором, добавьте ветвь "else", которая возвращает значение того же типа. @@ -103,12 +103,12 @@ - All branches of an 'if' expression must have the same type. This expression was expected to have type '{0}', but here has type '{1}'. - Все ветви выражения "if" должны иметь один и тот же тип. В этом выражении ожидалось использование типа "{0}", но используется тип "{1}". + All branches of an 'if' expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. + Все ветви выражения "if" должны иметь один и тот же тип. В этом выражении ожидалось использование типа "{0}", но используется тип "{1}". - All branches of a pattern match expression must return values of the same type. The first branch returned a value of type '{0}', but this branch returned a value of type '{1}'. + All branches of a pattern match expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. Все ветви выражения сопоставления шаблонов должны возвращать значения одного типа. Первая ветвь возвратила значение типа "{0}", а эта ветвь — типа "{1}". diff --git a/src/fsharp/xlf/FSComp.txt.tr.xlf b/src/fsharp/xlf/FSComp.txt.tr.xlf index 0dd1d5677d..a5f51b9b30 100644 --- a/src/fsharp/xlf/FSComp.txt.tr.xlf +++ b/src/fsharp/xlf/FSComp.txt.tr.xlf @@ -83,18 +83,18 @@ - All elements of a list constructor expression must have the same type. This expression was expected to have type '{0}', but here has type '{1}'. - Bir list constructor ifadesinin tüm öğeleri aynı türe sahip olmalıdır. Bu ifadenin '{0}' türünde olması bekleniyordu ancak burada '{1}' türünde. + All elements of a list must be of the same type as the first element, which here is '{0}'. This element has type '{1}'. + Bir list constructor ifadesinin tüm öğeleri aynı türe sahip olmalıdır. Bu ifadenin '{0}' türünde olması bekleniyordu ancak burada '{1}' türünde. - All elements of an array constructor expression must have the same type. This expression was expected to have type '{0}', but here has type '{1}'. - Bir array constructor ifadesinin tüm öğeleri aynı türe sahip olmalıdır. Bu ifadenin '{0}' türünde olması bekleniyordu ancak burada '{1}' türünde. + All elements of an array must be of the same type as the first element, which here is '{0}'. This element has type '{1}'. + Bir array constructor ifadesinin tüm öğeleri aynı türe sahip olmalıdır. Bu ifadenin '{0}' türünde olması bekleniyordu ancak burada '{1}' türünde. - The 'if' expression is missing an 'else' branch. The 'then' branch has type '{0}'. Because 'if' is an expression, and not a statement, add an 'else' branch which returns a value of the same type. - 'if' ifadesinde bir 'else' dalı eksik. 'then' dalı '{0}' türünde. 'if' bir ifade değil deyim olduğundan, aynı türde değer döndüren bir 'else' dalı eklemeniz gerekir. + This 'if' expression is missing an 'else' branch. Because 'if' is an expression, and not a statement, add an 'else' branch which also returns a value of type '{0}'. + 'if' ifadesinde bir 'else' dalı eksik. 'then' dalı '{0}' türünde. 'if' bir ifade değil deyim olduğundan, aynı türde değer döndüren bir 'else' dalı eklemeniz gerekir. @@ -103,12 +103,12 @@ - All branches of an 'if' expression must have the same type. This expression was expected to have type '{0}', but here has type '{1}'. - Bir 'if' ifadesinin tüm dalları aynı türe sahip olmalıdır. Bu ifadenin '{0}' türünde olması bekleniyordu ancak burada '{1}' türünde. + All branches of an 'if' expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. + Bir 'if' ifadesinin tüm dalları aynı türe sahip olmalıdır. Bu ifadenin '{0}' türünde olması bekleniyordu ancak burada '{1}' türünde. - All branches of a pattern match expression must return values of the same type. The first branch returned a value of type '{0}', but this branch returned a value of type '{1}'. + All branches of a pattern match expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. Bir desen eşleştirme ifadesinin tüm dalları aynı türdeki değerleri döndürmelidir. Birinci dal '{0}' türünde bir değer döndürdü ancak bu dal '{1}' türünde bir değer döndürdü. diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf index 940577a783..b3afbb4874 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf @@ -83,18 +83,18 @@ - All elements of a list constructor expression must have the same type. This expression was expected to have type '{0}', but here has type '{1}'. - 列表构造函数表达式的所有元素必须具有同一类型。此表达式的类型应为“{0}”,但此处类型为“{1}”。 + All elements of a list must be of the same type as the first element, which here is '{0}'. This element has type '{1}'. + 列表构造函数表达式的所有元素必须具有同一类型。此表达式的类型应为“{0}”,但此处类型为“{1}”。 - All elements of an array constructor expression must have the same type. This expression was expected to have type '{0}', but here has type '{1}'. - 数组构造函数表达式的所有元素必须具有同一类型。此表达式的类型应为“{0}”,但此处类型为“{1}”。 + All elements of an array must be of the same type as the first element, which here is '{0}'. This element has type '{1}'. + 数组构造函数表达式的所有元素必须具有同一类型。此表达式的类型应为“{0}”,但此处类型为“{1}”。 - The 'if' expression is missing an 'else' branch. The 'then' branch has type '{0}'. Because 'if' is an expression, and not a statement, add an 'else' branch which returns a value of the same type. - if 表达式缺少 "else" branch。"then" branch 的类型为“{0}”。因为 "if" 是一个表达式,而非语句,请添加将返回同一类型值的 "else" branch。 + This 'if' expression is missing an 'else' branch. Because 'if' is an expression, and not a statement, add an 'else' branch which also returns a value of type '{0}'. + if 表达式缺少 "else" branch。"then" branch 的类型为“{0}”。因为 "if" 是一个表达式,而非语句,请添加将返回同一类型值的 "else" branch。 @@ -103,12 +103,12 @@ - All branches of an 'if' expression must have the same type. This expression was expected to have type '{0}', but here has type '{1}'. - if 表达式的所有分支必须具有同一类型。此表达式的类型应为“{0}”,但此处类型为“{1}”。 + All branches of an 'if' expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. + if 表达式的所有分支必须具有同一类型。此表达式的类型应为“{0}”,但此处类型为“{1}”。 - All branches of a pattern match expression must return values of the same type. The first branch returned a value of type '{0}', but this branch returned a value of type '{1}'. + All branches of a pattern match expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. 模式匹配表达式的所有分支必须返回相同类型的值。第一个分支返回“{0}”类型的值,但此分支返回“{1}”类型的值。 diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf index 2d8636ea59..af11701007 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf @@ -83,18 +83,18 @@ - All elements of a list constructor expression must have the same type. This expression was expected to have type '{0}', but here has type '{1}'. - 清單建構函式運算式的所有分支都必須是同一種類型。此運算式應具備類型 '{0}',但卻為類型 '{1}'。 + All elements of a list must be of the same type as the first element, which here is '{0}'. This element has type '{1}'. + 清單建構函式運算式的所有分支都必須是同一種類型。此運算式應具備類型 '{0}',但卻為類型 '{1}'。 - All elements of an array constructor expression must have the same type. This expression was expected to have type '{0}', but here has type '{1}'. - 陣列建構函式運算式的所有項目都必須是同一種類型。此運算式應具備類型 '{0}',但卻是類型 '{1}'。 + All elements of an array must be of the same type as the first element, which here is '{0}'. This element has type '{1}'. + 陣列建構函式運算式的所有項目都必須是同一種類型。此運算式應具備類型 '{0}',但卻是類型 '{1}'。 - The 'if' expression is missing an 'else' branch. The 'then' branch has type '{0}'. Because 'if' is an expression, and not a statement, add an 'else' branch which returns a value of the same type. - 'if' 運算式遺漏 'else' 分支。'then' 分支具有類型 '{0}'。因為 'if' 為運算式而非陳述式,所以請新增會傳回的值類型相同的 'else' 分支。 + This 'if' expression is missing an 'else' branch. Because 'if' is an expression, and not a statement, add an 'else' branch which also returns a value of type '{0}'. + 'if' 運算式遺漏 'else' 分支。'then' 分支具有類型 '{0}'。因為 'if' 為運算式而非陳述式,所以請新增會傳回的值類型相同的 'else' 分支。 @@ -103,12 +103,12 @@ - All branches of an 'if' expression must have the same type. This expression was expected to have type '{0}', but here has type '{1}'. - if' 運算式的所有分支都必須是同一種類型。此運算式應具備類型 '{0}',但卻是類型 '{1}'。 + All branches of an 'if' expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. + if' 運算式的所有分支都必須是同一種類型。此運算式應具備類型 '{0}',但卻是類型 '{1}'。 - All branches of a pattern match expression must return values of the same type. The first branch returned a value of type '{0}', but this branch returned a value of type '{1}'. + All branches of a pattern match expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. 模式比對運算式的所有分支,都必須傳回相同類型的值。第一個分支傳回了類型 '{0}' 的值,但此分支卻傳回了類型 '{1}' 的值。 diff --git a/tests/fsharp/typecheck/sigs/neg20.bsl b/tests/fsharp/typecheck/sigs/neg20.bsl index ce156bee94..f9ec690978 100644 --- a/tests/fsharp/typecheck/sigs/neg20.bsl +++ b/tests/fsharp/typecheck/sigs/neg20.bsl @@ -69,17 +69,17 @@ neg20.fs(53,38,53,39): typecheck error FS0001: This expression was expected to h but here has type 'int' -neg20.fs(60,26,60,33): typecheck error FS0001: All elements of a list constructor expression must have the same type. This expression was expected to have type 'B', but here has type 'A'. +neg20.fs(60,26,60,33): typecheck error FS0001: All elements of a list must be of the same type as the first element, which here is 'B'. This element has type 'A'. -neg20.fs(61,27,61,35): typecheck error FS0001: All elements of a list constructor expression must have the same type. This expression was expected to have type 'B1', but here has type 'B2'. +neg20.fs(61,27,61,35): typecheck error FS0001: All elements of a list must be of the same type as the first element, which here is 'B1'. This element has type 'B2'. -neg20.fs(62,26,62,33): typecheck error FS0001: All elements of a list constructor expression must have the same type. This expression was expected to have type 'C', but here has type 'B'. +neg20.fs(62,26,62,33): typecheck error FS0001: All elements of a list must be of the same type as the first element, which here is 'C'. This element has type 'B'. -neg20.fs(66,25,66,32): typecheck error FS0001: All elements of a list constructor expression must have the same type. This expression was expected to have type 'A', but here has type 'B'. +neg20.fs(66,25,66,32): typecheck error FS0001: All elements of a list must be of the same type as the first element, which here is 'A'. This element has type 'B'. -neg20.fs(67,27,67,34): typecheck error FS0001: All elements of a list constructor expression must have the same type. This expression was expected to have type 'B', but here has type 'C'. +neg20.fs(67,27,67,34): typecheck error FS0001: All elements of a list must be of the same type as the first element, which here is 'B'. This element has type 'C'. -neg20.fs(70,31,70,38): typecheck error FS0001: All elements of a list constructor expression must have the same type. This expression was expected to have type 'B', but here has type 'C'. +neg20.fs(70,31,70,38): typecheck error FS0001: All elements of a list must be of the same type as the first element, which here is 'B'. This element has type 'C'. neg20.fs(71,34,71,42): typecheck error FS0001: Type mismatch. Expecting a 'A list' @@ -110,9 +110,9 @@ but given a 'B list' The type 'A' does not match the type 'B' -neg20.fs(83,47,83,54): typecheck error FS0001: All branches of an 'if' expression must have the same type. This expression was expected to have type 'B', but here has type 'C'. +neg20.fs(83,47,83,54): typecheck error FS0001: All branches of an 'if' expression must return values of the same type as the first branch, which here is 'B'. This branch returns a value of type 'C'. -neg20.fs(87,54,87,61): typecheck error FS0001: All branches of a pattern match expression must return values of the same type. The first branch returned a value of type 'B', but this branch returned a value of type 'C'. +neg20.fs(87,54,87,61): typecheck error FS0001: All branches of a pattern match expression must return values of the same type as the first branch, which here is 'B'. This branch returns a value of type 'C'. neg20.fs(92,19,92,26): typecheck error FS0001: This expression was expected to have type 'A' @@ -129,7 +129,7 @@ neg20.fs(97,26,97,33): typecheck error FS0001: This expression was expected to h but here has type 'B' -neg20.fs(99,26,99,33): typecheck error FS0001: All elements of a list constructor expression must have the same type. This expression was expected to have type 'B', but here has type 'A'. +neg20.fs(99,26,99,33): typecheck error FS0001: All elements of a list must be of the same type as the first element, which here is 'B'. This element has type 'A'. neg20.fs(108,12,108,16): typecheck error FS0001: Type mismatch. Expecting a 'B * B -> 'a' diff --git a/tests/fsharp/typecheck/sigs/neg80.vsbsl b/tests/fsharp/typecheck/sigs/neg80.vsbsl index 7016f1992f..d8bb6d1a0b 100644 --- a/tests/fsharp/typecheck/sigs/neg80.vsbsl +++ b/tests/fsharp/typecheck/sigs/neg80.vsbsl @@ -3,6 +3,6 @@ neg80.fsx(79,5,79,6): parse error FS0010: Unexpected symbol '|' in pattern match neg80.fsx(79,5,79,6): parse error FS0010: Unexpected symbol '|' in pattern matching -neg80.fsx(79,6,79,6): typecheck error FS0001: All branches of a pattern match expression must return values of the same type. The first branch returned a value of type 'string', but this branch returned a value of type 'unit'. +neg80.fsx(79,6,79,6): typecheck error FS0001: All branches of a pattern match expression must return values of the same type as the first branch, which here is 'string'. This branch returns a value of type 'unit'. neg80.fsx(76,11,76,13): typecheck error FS0025: Incomplete pattern matches on this expression. For example, the value 'Horizontal (_, _)' may indicate a case not covered by the pattern(s). diff --git a/tests/fsharpqa/Source/Diagnostics/async/ReturnBangNonAsync_IfThenElse.fs b/tests/fsharpqa/Source/Diagnostics/async/ReturnBangNonAsync_IfThenElse.fs index 51be95c940..74f2176d4c 100644 --- a/tests/fsharpqa/Source/Diagnostics/async/ReturnBangNonAsync_IfThenElse.fs +++ b/tests/fsharpqa/Source/Diagnostics/async/ReturnBangNonAsync_IfThenElse.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics #Async // Regression tests for FSHARP1.0:4394 -//This expression was expected to have type +//All branches of an 'if' expression must return values of the same type as the first branch async { if true then return () else diff --git a/tests/fsharpqa/Source/Warnings/ElseBranchHasWrongType.fs b/tests/fsharpqa/Source/Warnings/ElseBranchHasWrongType.fs index 876d29ab37..b14b495304 100644 --- a/tests/fsharpqa/Source/Warnings/ElseBranchHasWrongType.fs +++ b/tests/fsharpqa/Source/Warnings/ElseBranchHasWrongType.fs @@ -1,5 +1,5 @@ // #Warnings -//All branches of an 'if' expression must have the same type. This expression was expected to have type 'string', but here has type 'int'. +//All branches of an 'if' expression must return values of the same type as the first branch, which here is 'string'. This branch returns a value of type 'int'. let test = 100 let y = diff --git a/tests/fsharpqa/Source/Warnings/ElseBranchHasWrongType2.fs b/tests/fsharpqa/Source/Warnings/ElseBranchHasWrongType2.fs index 55fec2f162..06d83f76aa 100644 --- a/tests/fsharpqa/Source/Warnings/ElseBranchHasWrongType2.fs +++ b/tests/fsharpqa/Source/Warnings/ElseBranchHasWrongType2.fs @@ -1,5 +1,5 @@ // #Warnings -//All branches of an 'if' expression must have the same type. This expression was expected to have type 'string', but here has type 'int'. +//All branches of an 'if' expression must return values of the same type as the first branch, which here is 'string'. This branch returns a value of type 'int'. let test = 100 let f x = test diff --git a/tests/fsharpqa/Source/Warnings/ElseBranchHasWrongType3.fs b/tests/fsharpqa/Source/Warnings/ElseBranchHasWrongType3.fs index eb8a190fde..1306c79475 100644 --- a/tests/fsharpqa/Source/Warnings/ElseBranchHasWrongType3.fs +++ b/tests/fsharpqa/Source/Warnings/ElseBranchHasWrongType3.fs @@ -1,5 +1,5 @@ // #Warnings -//All branches of an 'if' expression must have the same type. This expression was expected to have type 'string', but here has type 'int'. +//All branches of an 'if' expression must return values of the same type as the first branch, which here is 'string'. This branch returns a value of type 'int'. let f x = x + 4 diff --git a/tests/fsharpqa/Source/Warnings/ElseBranchHasWrongType4.fs b/tests/fsharpqa/Source/Warnings/ElseBranchHasWrongType4.fs index 09db1e3083..8339a930d3 100644 --- a/tests/fsharpqa/Source/Warnings/ElseBranchHasWrongType4.fs +++ b/tests/fsharpqa/Source/Warnings/ElseBranchHasWrongType4.fs @@ -1,5 +1,5 @@ // #Warnings -//All branches of an 'if' expression must have the same type. This expression was expected to have type 'string', but here has type 'int'. +//All branches of an 'if' expression must return values of the same type as the first branch, which here is 'string'. This branch returns a value of type 'int'. let f x = x + 4 diff --git a/tests/fsharpqa/Source/Warnings/NestedElseBranchHasWrongType.fs b/tests/fsharpqa/Source/Warnings/NestedElseBranchHasWrongType.fs index ab5a8da39f..a8e63cee65 100644 --- a/tests/fsharpqa/Source/Warnings/NestedElseBranchHasWrongType.fs +++ b/tests/fsharpqa/Source/Warnings/NestedElseBranchHasWrongType.fs @@ -1,5 +1,5 @@ // #Warnings -//All branches of an 'if' expression must have the same type. +//All branches of an 'if' expression must return values of the same type as the first branch, which here is 'bool'. This branch returns a value of type 'string'. let x = 1 if x = 1 then true diff --git a/tests/fsharpqa/Source/Warnings/WarnIfMissingElseBranch.fs b/tests/fsharpqa/Source/Warnings/WarnIfMissingElseBranch.fs index fd832d947c..9e6e9d7efe 100644 --- a/tests/fsharpqa/Source/Warnings/WarnIfMissingElseBranch.fs +++ b/tests/fsharpqa/Source/Warnings/WarnIfMissingElseBranch.fs @@ -1,5 +1,5 @@ // #Warnings -//The 'if' expression is missing an 'else' branch. The 'then' branch has type 'string'. Because 'if' is an expression, and not a statement, add an 'else' branch which returns a value of the same type. +//This 'if' expression is missing an 'else' branch. Because 'if' is an expression, and not a statement, add an 'else' branch which also returns a value of type 'string'. let x = 10 let y = diff --git a/tests/fsharpqa/Source/Warnings/WarnIfMissingElseBranch3.fs b/tests/fsharpqa/Source/Warnings/WarnIfMissingElseBranch3.fs index 7e17b46f40..cbf7d5acf1 100644 --- a/tests/fsharpqa/Source/Warnings/WarnIfMissingElseBranch3.fs +++ b/tests/fsharpqa/Source/Warnings/WarnIfMissingElseBranch3.fs @@ -1,5 +1,5 @@ // #Warnings -//The 'if' expression is missing an 'else' branch. The 'then' branch has type 'string'. Because 'if' is an expression, and not a statement, add an 'else' branch which returns a value of the same type. +//This 'if' expression is missing an 'else' branch. Because 'if' is an expression, and not a statement, add an 'else' branch which also returns a value of type 'string'. let x = 10 let y = From 475d2f0bbf773ee62d0a0ac10170ee74e51c835a Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Tue, 24 Jul 2018 16:21:00 -0700 Subject: [PATCH 098/150] preserve directory structure when recursively copying files --- FSharpBuild.Directory.Build.targets | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/FSharpBuild.Directory.Build.targets b/FSharpBuild.Directory.Build.targets index 923863bb20..a447c35111 100644 --- a/FSharpBuild.Directory.Build.targets +++ b/FSharpBuild.Directory.Build.targets @@ -29,8 +29,8 @@ - - + + From d636c947cdcc5e03193d059067494646cebbcfc0 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Thu, 26 Jul 2018 23:47:52 +0100 Subject: [PATCH 099/150] fix binary compat problem for inref struct pointers (#5388) --- src/fsharp/TastPickle.fs | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/src/fsharp/TastPickle.fs b/src/fsharp/TastPickle.fs index 6bc5636525..406c085064 100755 --- a/src/fsharp/TastPickle.fs +++ b/src/fsharp/TastPickle.fs @@ -121,6 +121,7 @@ type WriterState = onlerefs: Table osimpletys: Table oglobals : TcGlobals + mutable isStructThisArgPos : bool ofile : string /// Indicates if we are using in-memory format, where we store XML docs as well oInMem : bool @@ -709,7 +710,8 @@ let pickleObjWithDanglingCcus inMem file g scope p x = osimpletys=Table<_>.Create "osimpletys" oglobals=g ofile=file - oInMem=inMem } + oInMem=inMem + isStructThisArgPos = false} p x st1 let sizes = st1.otycons.Size, @@ -731,7 +733,8 @@ let pickleObjWithDanglingCcus inMem file g scope p x = osimpletys=Table<_>.Create "osimpletys (fake)" oglobals=g ofile=file - oInMem=inMem } + oInMem=inMem + isStructThisArgPos = false } p_tup7 (p_array p_encoded_ccuref) (p_tup3 p_int p_int p_int) @@ -1268,6 +1271,13 @@ let p_tys = (p_list p_ty) let fill_p_attribs,p_attribs = p_hole() +// In F# 4.5, the type of the "this" pointer for structs is considered to be inref for the purposes of checking the implementation +// of the struct. However for backwards compat reaons we can't serialize this as the type. +let checkForInRefStructThisArg st ty = + let g = st.oglobals + let _, tauTy = tryDestForallTy g ty + isFunTy g tauTy && isFunTy g (rangeOfFunTy g tauTy) && isInByrefTy g (domainOfFunTy g tauTy) + let p_nonlocal_val_ref (nlv:NonLocalValOrMemberRef) st = let a = nlv.EnclosingEntity let key = nlv.ItemKey @@ -1277,7 +1287,13 @@ let p_nonlocal_val_ref (nlv:NonLocalValOrMemberRef) st = p_bool pkey.MemberIsOverride st p_string pkey.LogicalName st p_int pkey.TotalArgCount st + let isStructThisArgPos = + match key.TypeForLinkage with + | None -> false + | Some ty -> checkForInRefStructThisArg st ty + st.isStructThisArgPos <- isStructThisArgPos p_option p_ty key.TypeForLinkage st + st.isStructThisArgPos <- false let rec p_vref ctxt x st = match x with @@ -1539,6 +1555,7 @@ let u_tyar_specs = (u_list u_tyar_spec) let _ = fill_p_ty (fun ty st -> let ty = stripTyparEqns ty + let ty = if isInByrefTy st.oglobals ty && st.isStructThisArgPos then destByrefTy st.oglobals ty else ty match ty with | TType_tuple (tupInfo,l) -> if evalTupInfoIsStruct tupInfo then @@ -1547,7 +1564,11 @@ let _ = fill_p_ty (fun ty st -> p_byte 0 st; p_tys l st | TType_app(ERefNonLocal nleref,[]) -> p_byte 1 st; p_simpletyp nleref st | TType_app (tc,tinst) -> p_byte 2 st; p_tup2 (p_tcref "typ") p_tys (tc,tinst) st - | TType_fun (d,r) -> p_byte 3 st; p_tup2 p_ty p_ty (d,r) st + | TType_fun (d,r) -> + p_byte 3 st + p_ty d st + st.isStructThisArgPos <- false + p_ty r st | TType_var r -> p_byte 4 st; p_tpref r st | TType_forall (tps,r) -> p_byte 5 st; p_tup2 p_tyar_specs p_ty (tps,r) st | TType_measure unt -> p_byte 6 st; p_measure_expr unt st @@ -1815,7 +1836,12 @@ and p_ValData x st = p_option p_string x.ValCompiledName st // only keep range information on published values, not on optimization data p_ranges (x.ValReprInfo |> Option.map (fun _ -> x.val_range, x.DefinitionRange)) st + + let isStructThisArgPos = x.IsMember && checkForInRefStructThisArg st x.Type + st.isStructThisArgPos <- isStructThisArgPos p_ty x.val_type st + st.isStructThisArgPos <- false + p_int64 x.val_flags.PickledBits st p_option p_member_info x.MemberInfo st p_attribs x.Attribs st From 98f8d71666347f1f6ad373f67bde29ef8bf7bccd Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Thu, 26 Jul 2018 16:15:41 -0700 Subject: [PATCH 100/150] fix doc comment issues that prevented proper XML parsing (#5362) --- src/fsharp/FSharp.Core/async.fsi | 1 - src/fsharp/FSharp.Core/prim-types.fsi | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/fsharp/FSharp.Core/async.fsi b/src/fsharp/FSharp.Core/async.fsi index 53f6877628..b3312c6990 100644 --- a/src/fsharp/FSharp.Core/async.fsi +++ b/src/fsharp/FSharp.Core/async.fsi @@ -427,7 +427,6 @@ namespace Microsoft.FSharp.Control /// The default is used if this parameter is not provided. /// A System.Threading.Tasks.Task that will be completed /// in the corresponding state once the computation terminates (produces the result, throws exception or gets canceled) - /// static member StartImmediateAsTask: computation:Async<'T> * ?cancellationToken:CancellationToken-> Task<'T> diff --git a/src/fsharp/FSharp.Core/prim-types.fsi b/src/fsharp/FSharp.Core/prim-types.fsi index b755436b71..61786826a2 100644 --- a/src/fsharp/FSharp.Core/prim-types.fsi +++ b/src/fsharp/FSharp.Core/prim-types.fsi @@ -808,7 +808,7 @@ namespace Microsoft.FSharp.Core #endif type byref<'T, 'Kind> = (# "!0&" #) - /// Represents a managed pointer in F# code. For F# 4.5+ this is considered equivalent to byref<'T, ByRefKinds.InOut> + /// Represents a managed pointer in F# code. For F# 4.5+ this is considered equivalent to byref<'T, ByRefKinds.InOut> type byref<'T> = (# "!0&" #) /// Represents the types of byrefs in F# 4.5+ @@ -1850,7 +1850,7 @@ namespace Microsoft.FSharp.Core /// /// Use the constructors ValueSome and ValueNone to create values of this type. /// Use the values in the ValueOption module to manipulate values of this type, - /// or pattern match against the values directly. + /// or pattern match against the values directly. [] [] [] @@ -1870,7 +1870,7 @@ namespace Microsoft.FSharp.Core /// /// Use the constructors ValueSome and ValueNone to create values of this type. /// Use the values in the ValueOption module to manipulate values of this type, - /// or pattern match against the values directly. + /// or pattern match against the values directly. and 'T voption = ValueOption<'T> /// Helper type for error handling without exceptions. From e1fb26377ef9c1548a2b945664108dedfa8f8852 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Thu, 26 Jul 2018 23:47:52 +0100 Subject: [PATCH 101/150] fix binary compat problem for inref struct pointers (#5388) --- src/fsharp/TastPickle.fs | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/src/fsharp/TastPickle.fs b/src/fsharp/TastPickle.fs index 6bc5636525..406c085064 100755 --- a/src/fsharp/TastPickle.fs +++ b/src/fsharp/TastPickle.fs @@ -121,6 +121,7 @@ type WriterState = onlerefs: Table osimpletys: Table oglobals : TcGlobals + mutable isStructThisArgPos : bool ofile : string /// Indicates if we are using in-memory format, where we store XML docs as well oInMem : bool @@ -709,7 +710,8 @@ let pickleObjWithDanglingCcus inMem file g scope p x = osimpletys=Table<_>.Create "osimpletys" oglobals=g ofile=file - oInMem=inMem } + oInMem=inMem + isStructThisArgPos = false} p x st1 let sizes = st1.otycons.Size, @@ -731,7 +733,8 @@ let pickleObjWithDanglingCcus inMem file g scope p x = osimpletys=Table<_>.Create "osimpletys (fake)" oglobals=g ofile=file - oInMem=inMem } + oInMem=inMem + isStructThisArgPos = false } p_tup7 (p_array p_encoded_ccuref) (p_tup3 p_int p_int p_int) @@ -1268,6 +1271,13 @@ let p_tys = (p_list p_ty) let fill_p_attribs,p_attribs = p_hole() +// In F# 4.5, the type of the "this" pointer for structs is considered to be inref for the purposes of checking the implementation +// of the struct. However for backwards compat reaons we can't serialize this as the type. +let checkForInRefStructThisArg st ty = + let g = st.oglobals + let _, tauTy = tryDestForallTy g ty + isFunTy g tauTy && isFunTy g (rangeOfFunTy g tauTy) && isInByrefTy g (domainOfFunTy g tauTy) + let p_nonlocal_val_ref (nlv:NonLocalValOrMemberRef) st = let a = nlv.EnclosingEntity let key = nlv.ItemKey @@ -1277,7 +1287,13 @@ let p_nonlocal_val_ref (nlv:NonLocalValOrMemberRef) st = p_bool pkey.MemberIsOverride st p_string pkey.LogicalName st p_int pkey.TotalArgCount st + let isStructThisArgPos = + match key.TypeForLinkage with + | None -> false + | Some ty -> checkForInRefStructThisArg st ty + st.isStructThisArgPos <- isStructThisArgPos p_option p_ty key.TypeForLinkage st + st.isStructThisArgPos <- false let rec p_vref ctxt x st = match x with @@ -1539,6 +1555,7 @@ let u_tyar_specs = (u_list u_tyar_spec) let _ = fill_p_ty (fun ty st -> let ty = stripTyparEqns ty + let ty = if isInByrefTy st.oglobals ty && st.isStructThisArgPos then destByrefTy st.oglobals ty else ty match ty with | TType_tuple (tupInfo,l) -> if evalTupInfoIsStruct tupInfo then @@ -1547,7 +1564,11 @@ let _ = fill_p_ty (fun ty st -> p_byte 0 st; p_tys l st | TType_app(ERefNonLocal nleref,[]) -> p_byte 1 st; p_simpletyp nleref st | TType_app (tc,tinst) -> p_byte 2 st; p_tup2 (p_tcref "typ") p_tys (tc,tinst) st - | TType_fun (d,r) -> p_byte 3 st; p_tup2 p_ty p_ty (d,r) st + | TType_fun (d,r) -> + p_byte 3 st + p_ty d st + st.isStructThisArgPos <- false + p_ty r st | TType_var r -> p_byte 4 st; p_tpref r st | TType_forall (tps,r) -> p_byte 5 st; p_tup2 p_tyar_specs p_ty (tps,r) st | TType_measure unt -> p_byte 6 st; p_measure_expr unt st @@ -1815,7 +1836,12 @@ and p_ValData x st = p_option p_string x.ValCompiledName st // only keep range information on published values, not on optimization data p_ranges (x.ValReprInfo |> Option.map (fun _ -> x.val_range, x.DefinitionRange)) st + + let isStructThisArgPos = x.IsMember && checkForInRefStructThisArg st x.Type + st.isStructThisArgPos <- isStructThisArgPos p_ty x.val_type st + st.isStructThisArgPos <- false + p_int64 x.val_flags.PickledBits st p_option p_member_info x.MemberInfo st p_attribs x.Attribs st From 6eafdd377b5d939c9181bc02a7e3ea75e1fe89fa Mon Sep 17 00:00:00 2001 From: Kevin Ransom Date: Thu, 26 Jul 2018 16:03:09 -0700 Subject: [PATCH 102/150] CherryPick binary compat fix and update fsharp core nuget version --- src/FSharpSource.Settings.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FSharpSource.Settings.targets b/src/FSharpSource.Settings.targets index e5ff865285..a9f6c495d6 100644 --- a/src/FSharpSource.Settings.targets +++ b/src/FSharpSource.Settings.targets @@ -101,7 +101,7 @@ 4.1.19 4.1 - 4.5.1 + 4.5.2 4.5 From e0602ed8c30a71793e5680b5aed53c23847a2de4 Mon Sep 17 00:00:00 2001 From: Kevin Ransom Date: Thu, 26 Jul 2018 16:40:51 -0700 Subject: [PATCH 103/150] Minor build cleanup, Rev Tools version, and update templates and sdk to use FSharp.Core.nuget 4.5.2 --- packages.config | 2 +- src/FSharpSource.Settings.targets | 12 ++++-------- .../FSharp.Build/Microsoft.FSharp.NetSdk.props | 2 +- .../FSharp.Core.nuget/FSharp.Core.LatestNuget.nuspec | 2 +- src/fsharp/FSharp.Core.nuget/FSharp.Core.nuget.proj | 7 ++----- src/utils/CompilerLocationUtils.fs | 2 +- .../Template/ConsoleApplication.fsproj | 2 +- .../Template/ConsoleApplication.vstemplate | 2 +- .../LibraryProject/Template/Library.fsproj | 2 +- .../LibraryProject/Template/Library.vstemplate | 2 +- .../TutorialProject/Template/Tutorial.fsproj | 2 +- .../TutorialProject/Template/Tutorial.vstemplate | 2 +- .../VisualFSharpTemplates.csproj | 4 ++-- 13 files changed, 18 insertions(+), 25 deletions(-) diff --git a/packages.config b/packages.config index 686a11da97..42c7049c7e 100644 --- a/packages.config +++ b/packages.config @@ -19,7 +19,7 @@ - + diff --git a/src/FSharpSource.Settings.targets b/src/FSharpSource.Settings.targets index e5ff865285..04a45b8b38 100644 --- a/src/FSharpSource.Settings.targets +++ b/src/FSharpSource.Settings.targets @@ -21,8 +21,10 @@ 4.5.0.0 - 10.2.2.0 - 10.2.2 + 4.5 + 10.2.3.0 + 10.2.3 + 10.2 15.7.0.0 @@ -98,12 +100,6 @@ obj\$(Configuration)\$(TargetDotnetProfile)\ obj\$(Configuration)\$(TargetDotnetProfile)\$(PortableProfileBeingReferenced)\ - - 4.1.19 - 4.1 - 4.5.1 - 4.5 - obj\$(Configuration)\$(TargetDotnetProfile)\ obj\$(Configuration)\$(TargetDotnetProfile)\$(PortableProfileBeingReferenced)\ diff --git a/src/fsharp/FSharp.Build/Microsoft.FSharp.NetSdk.props b/src/fsharp/FSharp.Build/Microsoft.FSharp.NetSdk.props index 82c01a57bb..4ee6ad991a 100644 --- a/src/fsharp/FSharp.Build/Microsoft.FSharp.NetSdk.props +++ b/src/fsharp/FSharp.Build/Microsoft.FSharp.NetSdk.props @@ -73,7 +73,7 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and 4.4.0 - 4.5.1 + 4.5.2 $(DefaultValueTuplePackageVersion) $(DefaultFSharpCorePackageVersion) diff --git a/src/fsharp/FSharp.Core.nuget/FSharp.Core.LatestNuget.nuspec b/src/fsharp/FSharp.Core.nuget/FSharp.Core.LatestNuget.nuspec index 44ae12b44f..786d951ab3 100644 --- a/src/fsharp/FSharp.Core.nuget/FSharp.Core.LatestNuget.nuspec +++ b/src/fsharp/FSharp.Core.nuget/FSharp.Core.LatestNuget.nuspec @@ -6,7 +6,7 @@ FSharp.Core for F# 4.5 FSharp.Core for F# 4.5 - FSharp.Core redistributables from Visual F# Tools version 10.2 For F# 4.5 + FSharp.Core redistributables from Visual F# Tools version 10.3 For F# 4.5 Supported Platforms: .NET 4.5+ (net45) netstandard1.6 (netstandard1.6) diff --git a/src/fsharp/FSharp.Core.nuget/FSharp.Core.nuget.proj b/src/fsharp/FSharp.Core.nuget/FSharp.Core.nuget.proj index 4440f4ab72..ed762c252a 100644 --- a/src/fsharp/FSharp.Core.nuget/FSharp.Core.nuget.proj +++ b/src/fsharp/FSharp.Core.nuget/FSharp.Core.nuget.proj @@ -55,11 +55,8 @@ $(FSharpCoreFrozenPortableTargetPackageVersion) $(FSharpCoreFrozenPortableTargetMajorVersion) - $(FSharpCore41TargetPackageVersion) - $(FSharpCore41TargetMajorVersion) - - $(FSharpCoreLatestTargetPackageVersion) - $(FSharpCoreLatestTargetMajorVersion) + $(FSCorePackageVersion) + $(FSCoreMajorVersion) $(GitHeadSha) diff --git a/src/utils/CompilerLocationUtils.fs b/src/utils/CompilerLocationUtils.fs index 00cad27bec..06cc5893e2 100644 --- a/src/utils/CompilerLocationUtils.fs +++ b/src/utils/CompilerLocationUtils.fs @@ -12,7 +12,7 @@ open System.Runtime.InteropServices module internal FSharpEnvironment = /// The F# version reported in the banner - let FSharpBannerVersion = "10.2.1 for F# 4.5" + let FSharpBannerVersion = "10.2.3 for F# 4.5" let versionOf<'t> = #if FX_RESHAPED_REFLECTION diff --git a/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.fsproj b/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.fsproj index fb4debf76c..df9b2a7d3e 100644 --- a/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.fsproj +++ b/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.fsproj @@ -42,7 +42,7 @@ - ..\packages\FSharp.Core.4.5.1\lib\net45\FSharp.Core.dll + ..\packages\FSharp.Core.4.5.2\lib\net45\FSharp.Core.dll True diff --git a/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.vstemplate b/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.vstemplate index 6860164c1b..301cf58f31 100644 --- a/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.vstemplate +++ b/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.vstemplate @@ -27,7 +27,7 @@ - + diff --git a/vsintegration/ProjectTemplates/LibraryProject/Template/Library.fsproj b/vsintegration/ProjectTemplates/LibraryProject/Template/Library.fsproj index 39adb41aa2..83b2def573 100644 --- a/vsintegration/ProjectTemplates/LibraryProject/Template/Library.fsproj +++ b/vsintegration/ProjectTemplates/LibraryProject/Template/Library.fsproj @@ -38,7 +38,7 @@ - ..\packages\FSharp.Core.4.5.1\lib\net45\FSharp.Core.dll + ..\packages\FSharp.Core.4.5.2\lib\net45\FSharp.Core.dll True diff --git a/vsintegration/ProjectTemplates/LibraryProject/Template/Library.vstemplate b/vsintegration/ProjectTemplates/LibraryProject/Template/Library.vstemplate index 27b8fc3925..e83b31f66f 100644 --- a/vsintegration/ProjectTemplates/LibraryProject/Template/Library.vstemplate +++ b/vsintegration/ProjectTemplates/LibraryProject/Template/Library.vstemplate @@ -27,7 +27,7 @@ - + diff --git a/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.fsproj b/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.fsproj index b6fd29e595..053f6d845e 100644 --- a/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.fsproj +++ b/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.fsproj @@ -45,7 +45,7 @@ - ..\packages\FSharp.Core.4.5.1\lib\net45\FSharp.Core.dll + ..\packages\FSharp.Core.4.5.2\lib\net45\FSharp.Core.dll True diff --git a/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.vstemplate b/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.vstemplate index 2f07274db1..8b75ea9197 100644 --- a/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.vstemplate +++ b/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.vstemplate @@ -25,7 +25,7 @@ - + diff --git a/vsintegration/Vsix/VisualFSharpTemplates/VisualFSharpTemplates.csproj b/vsintegration/Vsix/VisualFSharpTemplates/VisualFSharpTemplates.csproj index 97600c9671..60e874bfbb 100644 --- a/vsintegration/Vsix/VisualFSharpTemplates/VisualFSharpTemplates.csproj +++ b/vsintegration/Vsix/VisualFSharpTemplates/VisualFSharpTemplates.csproj @@ -11,9 +11,9 @@ - + PreserveNewest - packages\FSharp.Core.4.5.0.nupkg + packages\FSharp.Core.4.5.2.nupkg true From ab675e29562094efc0db2397a69e11614c5a808d Mon Sep 17 00:00:00 2001 From: Kevin Ransom Date: Thu, 26 Jul 2018 22:25:32 -0700 Subject: [PATCH 104/150] More cleanup --- build/targets/AssemblyVersions.props | 8 ++++++-- src/FSharpSource.Settings.targets | 1 + src/fsharp/FSharp.Core.nuget/FSharp.Core.nuget.proj | 1 - 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/build/targets/AssemblyVersions.props b/build/targets/AssemblyVersions.props index 2e1a254852..10784c9c0d 100644 --- a/build/targets/AssemblyVersions.props +++ b/build/targets/AssemblyVersions.props @@ -20,9 +20,13 @@ $(_Build_Year).$(_Build_Month).$(_Build_Day).$(_Build_Number) 4.5.0.0 - 10.2.0.0 - 10.2.0 + 4.5 + 4.5.3 + 10.2.3.0 + 10.2.3 + 10.2 15.8.0.0 + $(FSCoreVersion) diff --git a/src/FSharpSource.Settings.targets b/src/FSharpSource.Settings.targets index 04a45b8b38..9887505a1f 100644 --- a/src/FSharpSource.Settings.targets +++ b/src/FSharpSource.Settings.targets @@ -22,6 +22,7 @@ 4.5.0.0 4.5 + 4.5.3 10.2.3.0 10.2.3 10.2 diff --git a/src/fsharp/FSharp.Core.nuget/FSharp.Core.nuget.proj b/src/fsharp/FSharp.Core.nuget/FSharp.Core.nuget.proj index ed762c252a..dd75adb362 100644 --- a/src/fsharp/FSharp.Core.nuget/FSharp.Core.nuget.proj +++ b/src/fsharp/FSharp.Core.nuget/FSharp.Core.nuget.proj @@ -17,7 +17,6 @@ - From 3531cd93b4d6994dc6fa3f41faaee833f7c3a2f9 Mon Sep 17 00:00:00 2001 From: Kevin Ransom Date: Thu, 26 Jul 2018 22:42:27 -0700 Subject: [PATCH 105/150] feedback --- src/fsharp/FSharp.Core.nuget/FSharp.Core.LatestNuget.nuspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fsharp/FSharp.Core.nuget/FSharp.Core.LatestNuget.nuspec b/src/fsharp/FSharp.Core.nuget/FSharp.Core.LatestNuget.nuspec index 786d951ab3..44ae12b44f 100644 --- a/src/fsharp/FSharp.Core.nuget/FSharp.Core.LatestNuget.nuspec +++ b/src/fsharp/FSharp.Core.nuget/FSharp.Core.LatestNuget.nuspec @@ -6,7 +6,7 @@ FSharp.Core for F# 4.5 FSharp.Core for F# 4.5 - FSharp.Core redistributables from Visual F# Tools version 10.3 For F# 4.5 + FSharp.Core redistributables from Visual F# Tools version 10.2 For F# 4.5 Supported Platforms: .NET 4.5+ (net45) netstandard1.6 (netstandard1.6) From 6e0b79a722219cd0a1319118e8ea161a6df10a21 Mon Sep 17 00:00:00 2001 From: Kevin Ransom Date: Fri, 27 Jul 2018 11:08:22 -0700 Subject: [PATCH 106/150] Signing --- build/config/AssemblySignToolData.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/config/AssemblySignToolData.json b/build/config/AssemblySignToolData.json index fb765304e7..2a2070bb67 100644 --- a/build/config/AssemblySignToolData.json +++ b/build/config/AssemblySignToolData.json @@ -57,7 +57,7 @@ } ], "exclude": [ - "FSharp.Core.4.5.0.nupkg", + "FSharp.Core.4.5.2.nupkg", "FSharp.Data.TypeProviders.dll", "Microsoft.Build.Conversion.Core.dll", "Microsoft.Build.dll", From 1414fe55d1d0dcbbe03ff659ac0babd292784887 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Fri, 27 Jul 2018 21:16:33 +0100 Subject: [PATCH 107/150] better fix for #5369 (#5398) --- src/fsharp/TastPickle.fs | 47 +++++++++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 18 deletions(-) diff --git a/src/fsharp/TastPickle.fs b/src/fsharp/TastPickle.fs index 406c085064..3f184165ad 100755 --- a/src/fsharp/TastPickle.fs +++ b/src/fsharp/TastPickle.fs @@ -121,7 +121,6 @@ type WriterState = onlerefs: Table osimpletys: Table oglobals : TcGlobals - mutable isStructThisArgPos : bool ofile : string /// Indicates if we are using in-memory format, where we store XML docs as well oInMem : bool @@ -506,9 +505,13 @@ let p_maybe_lazy p (x: MaybeLazy<_>) st = p_lazy_impl p x.Value st let p_hole () = - let h = ref (None : 'T pickler option) + let h = ref (None : ('T -> WriterState -> unit) option) (fun f -> h := Some f),(fun x st -> match !h with Some f -> f x st | None -> pfailwith st "p_hole: unfilled hole") +let p_hole2 () = + let h = ref (None : ('Arg -> 'T -> WriterState -> unit) option) + (fun f -> h := Some f),(fun arg x st -> match !h with Some f -> f arg x st | None -> pfailwith st "p_hole2: unfilled hole") + let u_array_core f n st = let res = Array.zeroCreate n for i = 0 to n-1 do @@ -710,8 +713,7 @@ let pickleObjWithDanglingCcus inMem file g scope p x = osimpletys=Table<_>.Create "osimpletys" oglobals=g ofile=file - oInMem=inMem - isStructThisArgPos = false} + oInMem=inMem } p x st1 let sizes = st1.otycons.Size, @@ -733,8 +735,7 @@ let pickleObjWithDanglingCcus inMem file g scope p x = osimpletys=Table<_>.Create "osimpletys (fake)" oglobals=g ofile=file - oInMem=inMem - isStructThisArgPos = false } + oInMem=inMem } p_tup7 (p_array p_encoded_ccuref) (p_tup3 p_int p_int p_int) @@ -1266,7 +1267,9 @@ let u_rfref st = let a,b = u_tup2 u_tcref u_string st in RFRef(a,b) let u_tpref st = u_local_item_ref st.itypars st // forward reference -let fill_p_ty,p_ty = p_hole() +let fill_p_ty2,p_ty2 = p_hole2() + +let p_ty = p_ty2 false let p_tys = (p_list p_ty) let fill_p_attribs,p_attribs = p_hole() @@ -1291,9 +1294,7 @@ let p_nonlocal_val_ref (nlv:NonLocalValOrMemberRef) st = match key.TypeForLinkage with | None -> false | Some ty -> checkForInRefStructThisArg st ty - st.isStructThisArgPos <- isStructThisArgPos - p_option p_ty key.TypeForLinkage st - st.isStructThisArgPos <- false + p_option (p_ty2 isStructThisArgPos) key.TypeForLinkage st let rec p_vref ctxt x st = match x with @@ -1553,9 +1554,17 @@ let u_tyar_spec st = let u_tyar_specs = (u_list u_tyar_spec) -let _ = fill_p_ty (fun ty st -> +let _ = fill_p_ty2 (fun isStructThisArgPos ty st -> let ty = stripTyparEqns ty - let ty = if isInByrefTy st.oglobals ty && st.isStructThisArgPos then destByrefTy st.oglobals ty else ty + + // See comment on 'checkForInRefStructThisArg' + let ty = + if isInByrefTy st.oglobals ty && isStructThisArgPos then + // Convert the inref to a byref + mkByrefTy st.oglobals (destByrefTy st.oglobals ty) + else + ty + match ty with | TType_tuple (tupInfo,l) -> if evalTupInfoIsStruct tupInfo then @@ -1566,11 +1575,15 @@ let _ = fill_p_ty (fun ty st -> | TType_app (tc,tinst) -> p_byte 2 st; p_tup2 (p_tcref "typ") p_tys (tc,tinst) st | TType_fun (d,r) -> p_byte 3 st - p_ty d st - st.isStructThisArgPos <- false + // Note, the "this" argument may be found in the domain position of a function type, so propagate the isStructThisArgPos value + p_ty2 isStructThisArgPos d st p_ty r st | TType_var r -> p_byte 4 st; p_tpref r st - | TType_forall (tps,r) -> p_byte 5 st; p_tup2 p_tyar_specs p_ty (tps,r) st + | TType_forall (tps,r) -> + p_byte 5 st + p_tyar_specs tps st + // Note, the "this" argument may be found in the body of a generic forall type, so propagate the isStructThisArgPos value + p_ty2 isStructThisArgPos r st | TType_measure unt -> p_byte 6 st; p_measure_expr unt st | TType_ucase (uc,tinst) -> p_byte 7 st; p_tup2 p_ucref p_tys (uc,tinst) st) @@ -1838,9 +1851,7 @@ and p_ValData x st = p_ranges (x.ValReprInfo |> Option.map (fun _ -> x.val_range, x.DefinitionRange)) st let isStructThisArgPos = x.IsMember && checkForInRefStructThisArg st x.Type - st.isStructThisArgPos <- isStructThisArgPos - p_ty x.val_type st - st.isStructThisArgPos <- false + p_ty2 isStructThisArgPos x.val_type st p_int64 x.val_flags.PickledBits st p_option p_member_info x.MemberInfo st From 8cecf33461ac74b7155174a54fa5745465550891 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Fri, 27 Jul 2018 21:16:33 +0100 Subject: [PATCH 108/150] better fix for #5369 (#5398) --- src/fsharp/TastPickle.fs | 47 +++++++++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 18 deletions(-) diff --git a/src/fsharp/TastPickle.fs b/src/fsharp/TastPickle.fs index 406c085064..3f184165ad 100755 --- a/src/fsharp/TastPickle.fs +++ b/src/fsharp/TastPickle.fs @@ -121,7 +121,6 @@ type WriterState = onlerefs: Table osimpletys: Table oglobals : TcGlobals - mutable isStructThisArgPos : bool ofile : string /// Indicates if we are using in-memory format, where we store XML docs as well oInMem : bool @@ -506,9 +505,13 @@ let p_maybe_lazy p (x: MaybeLazy<_>) st = p_lazy_impl p x.Value st let p_hole () = - let h = ref (None : 'T pickler option) + let h = ref (None : ('T -> WriterState -> unit) option) (fun f -> h := Some f),(fun x st -> match !h with Some f -> f x st | None -> pfailwith st "p_hole: unfilled hole") +let p_hole2 () = + let h = ref (None : ('Arg -> 'T -> WriterState -> unit) option) + (fun f -> h := Some f),(fun arg x st -> match !h with Some f -> f arg x st | None -> pfailwith st "p_hole2: unfilled hole") + let u_array_core f n st = let res = Array.zeroCreate n for i = 0 to n-1 do @@ -710,8 +713,7 @@ let pickleObjWithDanglingCcus inMem file g scope p x = osimpletys=Table<_>.Create "osimpletys" oglobals=g ofile=file - oInMem=inMem - isStructThisArgPos = false} + oInMem=inMem } p x st1 let sizes = st1.otycons.Size, @@ -733,8 +735,7 @@ let pickleObjWithDanglingCcus inMem file g scope p x = osimpletys=Table<_>.Create "osimpletys (fake)" oglobals=g ofile=file - oInMem=inMem - isStructThisArgPos = false } + oInMem=inMem } p_tup7 (p_array p_encoded_ccuref) (p_tup3 p_int p_int p_int) @@ -1266,7 +1267,9 @@ let u_rfref st = let a,b = u_tup2 u_tcref u_string st in RFRef(a,b) let u_tpref st = u_local_item_ref st.itypars st // forward reference -let fill_p_ty,p_ty = p_hole() +let fill_p_ty2,p_ty2 = p_hole2() + +let p_ty = p_ty2 false let p_tys = (p_list p_ty) let fill_p_attribs,p_attribs = p_hole() @@ -1291,9 +1294,7 @@ let p_nonlocal_val_ref (nlv:NonLocalValOrMemberRef) st = match key.TypeForLinkage with | None -> false | Some ty -> checkForInRefStructThisArg st ty - st.isStructThisArgPos <- isStructThisArgPos - p_option p_ty key.TypeForLinkage st - st.isStructThisArgPos <- false + p_option (p_ty2 isStructThisArgPos) key.TypeForLinkage st let rec p_vref ctxt x st = match x with @@ -1553,9 +1554,17 @@ let u_tyar_spec st = let u_tyar_specs = (u_list u_tyar_spec) -let _ = fill_p_ty (fun ty st -> +let _ = fill_p_ty2 (fun isStructThisArgPos ty st -> let ty = stripTyparEqns ty - let ty = if isInByrefTy st.oglobals ty && st.isStructThisArgPos then destByrefTy st.oglobals ty else ty + + // See comment on 'checkForInRefStructThisArg' + let ty = + if isInByrefTy st.oglobals ty && isStructThisArgPos then + // Convert the inref to a byref + mkByrefTy st.oglobals (destByrefTy st.oglobals ty) + else + ty + match ty with | TType_tuple (tupInfo,l) -> if evalTupInfoIsStruct tupInfo then @@ -1566,11 +1575,15 @@ let _ = fill_p_ty (fun ty st -> | TType_app (tc,tinst) -> p_byte 2 st; p_tup2 (p_tcref "typ") p_tys (tc,tinst) st | TType_fun (d,r) -> p_byte 3 st - p_ty d st - st.isStructThisArgPos <- false + // Note, the "this" argument may be found in the domain position of a function type, so propagate the isStructThisArgPos value + p_ty2 isStructThisArgPos d st p_ty r st | TType_var r -> p_byte 4 st; p_tpref r st - | TType_forall (tps,r) -> p_byte 5 st; p_tup2 p_tyar_specs p_ty (tps,r) st + | TType_forall (tps,r) -> + p_byte 5 st + p_tyar_specs tps st + // Note, the "this" argument may be found in the body of a generic forall type, so propagate the isStructThisArgPos value + p_ty2 isStructThisArgPos r st | TType_measure unt -> p_byte 6 st; p_measure_expr unt st | TType_ucase (uc,tinst) -> p_byte 7 st; p_tup2 p_ucref p_tys (uc,tinst) st) @@ -1838,9 +1851,7 @@ and p_ValData x st = p_ranges (x.ValReprInfo |> Option.map (fun _ -> x.val_range, x.DefinitionRange)) st let isStructThisArgPos = x.IsMember && checkForInRefStructThisArg st x.Type - st.isStructThisArgPos <- isStructThisArgPos - p_ty x.val_type st - st.isStructThisArgPos <- false + p_ty2 isStructThisArgPos x.val_type st p_int64 x.val_flags.PickledBits st p_option p_member_info x.MemberInfo st From 5e7e9b2151c077fd95de62abdf2f98eb0f092fe2 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Thu, 26 Jul 2018 10:07:58 -0700 Subject: [PATCH 109/150] add VSTS CI --- .vsts-dotnet.yml | 59 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .vsts-dotnet.yml diff --git a/.vsts-dotnet.yml b/.vsts-dotnet.yml new file mode 100644 index 0000000000..67f78e6df0 --- /dev/null +++ b/.vsts-dotnet.yml @@ -0,0 +1,59 @@ +phases: +- phase: Linux + queue: + name: Hosted Linux Preview + timeoutInMinutes: 90 + parallel: 2 + matrix: + release_default: + _command: ./mono/cibuild.sh + _args: release + release_fcs: + _command: ./fcs/build.sh + _args: Build + steps: + - script: $(_command) $(_args) + - task: PublishBuildArtifacts@1 + inputs: + PathtoPublish: '$(Build.SourcesDirectory)/tests/TestResults' + ArtifactName: 'Linux $(_command) $(_args)' + publishLocation: Container + continueOnError: true + condition: failed() + +- phase: Windows + queue: + name: Hosted VS2017 + timeoutInMinutes: 90 + parallel: 7 + matrix: + ci_part1: + _command: build.cmd + _args: release ci_part1 + ci_part2: + _command: build.cmd + _args: release ci_part2 + ci_part3: + _command: build.cmd + _args: release ci_part3 + ci_part4: + _command: build.cmd + _args: release ci_part4 + debug_default: + _command: build.cmd + _args: debug + net40_no_vs: + _command: build.cmd + _args: release net40 + release_fcs: + _command: fcs\build.cmd + _args: TestAndNuget + steps: + - script: $(_command) $(_args) + - task: PublishBuildArtifacts@1 + inputs: + PathtoPublish: '$(Build.SourcesDirectory)\tests\TestResults' + ArtifactName: 'Windows $(_command) $(_args)' + publishLocation: Container + continueOnError: true + condition: failed() From 5ea0ac0a4db18a28c5b4143e231c8d13d58786fa Mon Sep 17 00:00:00 2001 From: Jason Imison Date: Sat, 28 Jul 2018 02:01:18 +0100 Subject: [PATCH 110/150] Treat pinvokes like abstract methods for debugging (#5404) We need a row to be recorded in the MethodDebugInformation table. Fixes #4637 --- src/absil/ilwrite.fs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/absil/ilwrite.fs b/src/absil/ilwrite.fs index 37b85145a8..d28348bf86 100644 --- a/src/absil/ilwrite.fs +++ b/src/absil/ilwrite.fs @@ -2526,7 +2526,8 @@ let GenMethodDefAsRow cenv env midx (md: ILMethodDef) = SequencePoints=seqpoints } cenv.AddCode code addr - | MethodBody.Abstract -> + | MethodBody.Abstract + | MethodBody.PInvoke _ -> // Now record the PDB record for this method - we write this out later. if cenv.generatePdb then cenv.pdbinfo.Add From ab6f7804d2bea12f88d32f76a76dd7e4a23a19e2 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Fri, 27 Jul 2018 23:38:42 -0700 Subject: [PATCH 111/150] report VSTS CI badges (#5412) --- README.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 59c5b88dfd..e46dcae408 100644 --- a/README.md +++ b/README.md @@ -16,12 +16,11 @@ For historical reasons this repository is called "visualfsharp" and currently al ## Build Status -| | Ubuntu (Build) | Windows (Debug Build) | Windows (Release Tests 1) | Windows (Release Tests 2) | Windows (Release Tests 3) | Windows (Release Tests 4) | -|:----------:|:----------------:|:----------------:|:------------------:|:-----------------------:|:---------------------:|:---------------------:| -|**master** |[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/master/release_ubuntu14.04)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/master/job/release_ubuntu14.04/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/master/debug_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/master/job/debug_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/master/release_ci_part1_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/master/job/release_ci_part1_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/master/release_ci_part2_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/master/job/release_ci_part2_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/master/release_ci_part3_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/master/job/release_ci_part3_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/master/release_ci_part4_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/master/job/release_ci_part4_windows_nt/)| -**dev15.6** |[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.6/release_ubuntu14.04)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.6/job/release_ubuntu14.04/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.6/debug_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.6/job/debug_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.6/release_ci_part1_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.6/job/release_ci_part1_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.6/release_ci_part2_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.6/job/release_ci_part2_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.6/release_ci_part3_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.6/job/release_ci_part3_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.6/release_ci_part4_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.6/job/release_ci_part4_windows_nt/)| -**dev15.7** |[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.7/release_ubuntu14.04)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.7/job/release_ubuntu14.04/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.7/debug_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.7/job/debug_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.7/release_ci_part1_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.7/job/release_ci_part1_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.7/release_ci_part2_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.7/job/release_ci_part2_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.7/release_ci_part3_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.7/job/release_ci_part3_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.7/release_ci_part4_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.7/job/release_ci_part4_windows_nt/)| -**dev15.8** |[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.8/release_ubuntu14.04)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.8/job/release_ubuntu14.04/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.8/debug_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.8/job/debug_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.8/release_ci_part1_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.8/job/release_ci_part1_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.8/release_ci_part2_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.8/job/release_ci_part2_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.8/release_ci_part3_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.8/job/release_ci_part3_windows_nt/)|[![Build Status](https://ci2.dot.net/buildStatus/icon?job=Microsoft_visualfsharp/dev15.8/release_ci_part4_windows_nt)](https://ci2.dot.net/job/Microsoft_visualfsharp/job/dev15.8/job/release_ci_part4_windows_nt/)| +| Branch | Status | +|:------:|:------:| +|master|[![Build Status](https://dotnet.visualstudio.com/_apis/public/build/definitions/9ee6d478-d288-47f7-aacc-f6e6d082ae6d/106/badge?branchname=master)](https://dotnet.visualstudio.com/public/public%20Team/_build?definitionId=106&_a=history)| +|dev15.9|[![Build Status](https://dotnet.visualstudio.com/_apis/public/build/definitions/9ee6d478-d288-47f7-aacc-f6e6d082ae6d/106/badge?branchname=dev15.9)](https://dotnet.visualstudio.com/public/public%20Team/_build?definitionId=106&_a=history)| +|dev16.0|[![Build Status](https://dotnet.visualstudio.com/_apis/public/build/definitions/9ee6d478-d288-47f7-aacc-f6e6d082ae6d/106/badge?branchname=dev16.0)](https://dotnet.visualstudio.com/public/public%20Team/_build?definitionId=106&_a=history)| ## Help improve the Quality of the Tools by Using the Nightly Releases of Visual F# Tools To setup Visual Studio to use the latest nightly releases of the Visual F# Tools: From 09dd2fa976239b6282f7118d97a2f510a4e72ded Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Sat, 28 Jul 2018 00:47:43 -0700 Subject: [PATCH 112/150] Add build logging (#5414) --- build.cmd | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/build.cmd b/build.cmd index 7c7cfd6e96..4d1f623857 100644 --- a/build.cmd +++ b/build.cmd @@ -724,8 +724,8 @@ if "%BUILD_PROTO%" == "1" ( if "%BUILD_PROTO_WITH_CORECLR_LKG%" == "1" ( - echo %_msbuildexe% %msbuildflags% src\fsharp-proto-build.proj /p:BUILD_PROTO_WITH_CORECLR_LKG=%BUILD_PROTO_WITH_CORECLR_LKG% /p:Configuration=Proto /p:DisableLocalization=true - %_msbuildexe% %msbuildflags% src\fsharp-proto-build.proj /p:BUILD_PROTO_WITH_CORECLR_LKG=%BUILD_PROTO_WITH_CORECLR_LKG% /p:Configuration=Proto /p:DisableLocalization=true + echo %_msbuildexe% %msbuildflags% src\fsharp-proto-build.proj /p:BUILD_PROTO_WITH_CORECLR_LKG=%BUILD_PROTO_WITH_CORECLR_LKG% /p:Configuration=Proto /p:DisableLocalization=true /bl:artifacts\protobuild-net40.build.binlog + %_msbuildexe% %msbuildflags% src\fsharp-proto-build.proj /p:BUILD_PROTO_WITH_CORECLR_LKG=%BUILD_PROTO_WITH_CORECLR_LKG% /p:Configuration=Proto /p:DisableLocalization=true /bl:artifacts\protobuild-net40.build.binlog @if ERRORLEVEL 1 echo Error: compiler proto build failed && goto :failure ) @@ -734,8 +734,8 @@ if "%BUILD_PROTO%" == "1" ( echo %_ngenexe% install packages\FSharp.Compiler.Tools.4.1.27\tools\fsc.exe /nologo %_ngenexe% install packages\FSharp.Compiler.Tools.4.1.27\tools\fsc.exe /nologo - echo %_msbuildexe% %msbuildflags% src\fsharp-proto-build.proj /p:BUILD_PROTO_WITH_CORECLR_LKG=%BUILD_PROTO_WITH_CORECLR_LKG% /p:Configuration=Proto /p:DisableLocalization=true - %_msbuildexe% %msbuildflags% src\fsharp-proto-build.proj /p:BUILD_PROTO_WITH_CORECLR_LKG=%BUILD_PROTO_WITH_CORECLR_LKG% /p:Configuration=Proto /p:DisableLocalization=true + echo %_msbuildexe% %msbuildflags% src\fsharp-proto-build.proj /p:BUILD_PROTO_WITH_CORECLR_LKG=%BUILD_PROTO_WITH_CORECLR_LKG% /p:Configuration=Proto /p:DisableLocalization=true /bl:artifacts\protobuild-coreclr.build.binlog + %_msbuildexe% %msbuildflags% src\fsharp-proto-build.proj /p:BUILD_PROTO_WITH_CORECLR_LKG=%BUILD_PROTO_WITH_CORECLR_LKG% /p:Configuration=Proto /p:DisableLocalization=true /bl:artifacts\protobuild-coreclr.build.binlog @if ERRORLEVEL 1 echo Error: compiler proto build failed && goto :failure ) @@ -758,8 +758,8 @@ if "%BUILD_PHASE%" == "1" ( echo %_msbuildexe% %msbuildflags% build-everything.proj /t:Restore %BUILD_DIAG% %_msbuildexe% %msbuildflags% build-everything.proj /t:Restore %BUILD_DIAG% - echo %_msbuildexe% %msbuildflags% build-everything.proj /p:Configuration=%BUILD_CONFIG% %BUILD_DIAG% /p:BUILD_PUBLICSIGN=%BUILD_PUBLICSIGN% - %_msbuildexe% %msbuildflags% build-everything.proj /p:Configuration=%BUILD_CONFIG% %BUILD_DIAG% /p:BUILD_PUBLICSIGN=%BUILD_PUBLICSIGN% + echo %_msbuildexe% %msbuildflags% build-everything.proj /p:Configuration=%BUILD_CONFIG% %BUILD_DIAG% /p:BUILD_PUBLICSIGN=%BUILD_PUBLICSIGN% /bl:artifacts\msbuild.build-everything.build.%BUILD_CONFIG%.binlog + %_msbuildexe% %msbuildflags% build-everything.proj /p:Configuration=%BUILD_CONFIG% %BUILD_DIAG% /p:BUILD_PUBLICSIGN=%BUILD_PUBLICSIGN% /bl:artifacts\msbuild.build-everything.build.%BUILD_CONFIG%.binlog @if ERRORLEVEL 1 echo Error build failed && goto :failure ) @@ -783,8 +783,8 @@ if not "%SIGN_TYPE%" == "" ( echo ---------------- Done with assembly signing, start package creation --------------- -echo %_msbuildexe% %msbuildflags% build-nuget-packages.proj /p:Configuration=%BUILD_CONFIG% - %_msbuildexe% %msbuildflags% build-nuget-packages.proj /p:Configuration=%BUILD_CONFIG% +echo %_msbuildexe% %msbuildflags% build-nuget-packages.proj /p:Configuration=%BUILD_CONFIG% /bl:artifacts\msbuild.build-nuget-packages.build.%BUILD_CONFIG%.binlog + %_msbuildexe% %msbuildflags% build-nuget-packages.proj /p:Configuration=%BUILD_CONFIG% /bl:artifacts\msbuild.build-nuget-packages.build.%BUILD_CONFIG%.binlog if ERRORLEVEL 1 echo Error building NuGet packages && goto :failure if not "%SIGN_TYPE%" == "" ( @@ -794,8 +794,8 @@ if not "%SIGN_TYPE%" == "" ( ) if "%BUILD_SETUP%" == "1" ( - echo %_msbuildexe% %msbuildflags% setup\build-insertion.proj /p:Configuration=%BUILD_CONFIG% - %_msbuildexe% %msbuildflags% setup\build-insertion.proj /p:Configuration=%BUILD_CONFIG% + echo %_msbuildexe% %msbuildflags% setup\build-insertion.proj /p:Configuration=%BUILD_CONFIG% /bl:artifacts\msbuild.build-insertion.build.%BUILD_CONFIG%.binlog + %_msbuildexe% %msbuildflags% setup\build-insertion.proj /p:Configuration=%BUILD_CONFIG% /bl:artifacts\msbuild.build-insertion.build.%BUILD_CONFIG%.binlog if ERRORLEVEL 1 echo Error building insertion packages && goto :failure ) @@ -808,8 +808,8 @@ if not "%SIGN_TYPE%" == "" ( echo ---------------- Done with signing, building insertion files --------------- if "%BUILD_SETUP%" == "1" ( - echo %_msbuildexe% %msbuildflags% setup\Swix\Microsoft.FSharp.vsmanproj /p:Configuration=%BUILD_CONFIG% - %_msbuildexe% %msbuildflags% setup\Swix\Microsoft.FSharp.vsmanproj /p:Configuration=%BUILD_CONFIG% + echo %_msbuildexe% %msbuildflags% setup\Swix\Microsoft.FSharp.vsmanproj /p:Configuration=%BUILD_CONFIG% /bl:artifacts\msbuild.setup-swix.build.%BUILD_CONFIG%.binlog + %_msbuildexe% %msbuildflags% setup\Swix\Microsoft.FSharp.vsmanproj /p:Configuration=%BUILD_CONFIG% /bl:artifacts\msbuild.setup-swix.build.%BUILD_CONFIG%.binlog if ERRORLEVEL 1 echo Error building .vsmanproj && goto :failure ) From 3960bf2077ab378ae7443a849f23a732684b33ae Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Sat, 28 Jul 2018 00:47:54 -0700 Subject: [PATCH 113/150] Add build logging (#5415) --- build.cmd | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/build.cmd b/build.cmd index e2508af570..16472b68b1 100644 --- a/build.cmd +++ b/build.cmd @@ -744,8 +744,8 @@ if "%BUILD_PROTO%" == "1" ( if "%BUILD_PROTO_WITH_CORECLR_LKG%" == "1" ( - echo %_msbuildexe% %msbuildflags% src\fsharp-proto-build.proj /p:BUILD_PROTO_WITH_CORECLR_LKG=%BUILD_PROTO_WITH_CORECLR_LKG% /p:Configuration=Proto /p:DisableLocalization=true - %_msbuildexe% %msbuildflags% src\fsharp-proto-build.proj /p:BUILD_PROTO_WITH_CORECLR_LKG=%BUILD_PROTO_WITH_CORECLR_LKG% /p:Configuration=Proto /p:DisableLocalization=true + echo %_msbuildexe% %msbuildflags% src\fsharp-proto-build.proj /p:BUILD_PROTO_WITH_CORECLR_LKG=%BUILD_PROTO_WITH_CORECLR_LKG% /p:Configuration=Proto /p:DisableLocalization=true /bl:artifacts\protobuild-net40.build.binlog + %_msbuildexe% %msbuildflags% src\fsharp-proto-build.proj /p:BUILD_PROTO_WITH_CORECLR_LKG=%BUILD_PROTO_WITH_CORECLR_LKG% /p:Configuration=Proto /p:DisableLocalization=true /bl:artifacts\protobuild-net40.build.binlog @if ERRORLEVEL 1 echo Error: compiler proto build failed && goto :failure ) @@ -754,8 +754,8 @@ if "%BUILD_PROTO%" == "1" ( echo %_ngenexe% install packages\FSharp.Compiler.Tools.4.1.27\tools\fsc.exe /nologo %_ngenexe% install packages\FSharp.Compiler.Tools.4.1.27\tools\fsc.exe /nologo - echo %_msbuildexe% %msbuildflags% src\fsharp-proto-build.proj /p:BUILD_PROTO_WITH_CORECLR_LKG=%BUILD_PROTO_WITH_CORECLR_LKG% /p:Configuration=Proto /p:DisableLocalization=true - %_msbuildexe% %msbuildflags% src\fsharp-proto-build.proj /p:BUILD_PROTO_WITH_CORECLR_LKG=%BUILD_PROTO_WITH_CORECLR_LKG% /p:Configuration=Proto /p:DisableLocalization=true + echo %_msbuildexe% %msbuildflags% src\fsharp-proto-build.proj /p:BUILD_PROTO_WITH_CORECLR_LKG=%BUILD_PROTO_WITH_CORECLR_LKG% /p:Configuration=Proto /p:DisableLocalization=true /bl:artifacts\protobuild-coreclr.build.binlog + %_msbuildexe% %msbuildflags% src\fsharp-proto-build.proj /p:BUILD_PROTO_WITH_CORECLR_LKG=%BUILD_PROTO_WITH_CORECLR_LKG% /p:Configuration=Proto /p:DisableLocalization=true /bl:artifacts\protobuild-coreclr.build.binlog @if ERRORLEVEL 1 echo Error: compiler proto build failed && goto :failure ) @@ -778,8 +778,8 @@ if "%BUILD_PHASE%" == "1" ( echo %_msbuildexe% %msbuildflags% build-everything.proj /t:Restore %BUILD_DIAG% %_msbuildexe% %msbuildflags% build-everything.proj /t:Restore %BUILD_DIAG% - echo %_msbuildexe% %msbuildflags% build-everything.proj /p:Configuration=%BUILD_CONFIG% %BUILD_DIAG% /p:BUILD_PUBLICSIGN=%BUILD_PUBLICSIGN% - %_msbuildexe% %msbuildflags% build-everything.proj /p:Configuration=%BUILD_CONFIG% %BUILD_DIAG% /p:BUILD_PUBLICSIGN=%BUILD_PUBLICSIGN% + echo %_msbuildexe% %msbuildflags% build-everything.proj /p:Configuration=%BUILD_CONFIG% %BUILD_DIAG% /p:BUILD_PUBLICSIGN=%BUILD_PUBLICSIGN% /bl:artifacts\msbuild.build-everything.build.%BUILD_CONFIG%.binlog + %_msbuildexe% %msbuildflags% build-everything.proj /p:Configuration=%BUILD_CONFIG% %BUILD_DIAG% /p:BUILD_PUBLICSIGN=%BUILD_PUBLICSIGN% /bl:artifacts\msbuild.build-everything.build.%BUILD_CONFIG%.binlog @if ERRORLEVEL 1 echo Error build failed && goto :failure ) @@ -803,8 +803,8 @@ if not "%SIGN_TYPE%" == "" ( echo ---------------- Done with assembly signing, start package creation --------------- -echo %_msbuildexe% %msbuildflags% build-nuget-packages.proj /p:Configuration=%BUILD_CONFIG% - %_msbuildexe% %msbuildflags% build-nuget-packages.proj /p:Configuration=%BUILD_CONFIG% +echo %_msbuildexe% %msbuildflags% build-nuget-packages.proj /p:Configuration=%BUILD_CONFIG% /bl:artifacts\msbuild.build-nuget-packages.build.%BUILD_CONFIG%.binlog + %_msbuildexe% %msbuildflags% build-nuget-packages.proj /p:Configuration=%BUILD_CONFIG% /bl:artifacts\msbuild.build-nuget-packages.build.%BUILD_CONFIG%.binlog if ERRORLEVEL 1 echo Error building NuGet packages && goto :failure if not "%SIGN_TYPE%" == "" ( @@ -814,8 +814,8 @@ if not "%SIGN_TYPE%" == "" ( ) if "%BUILD_SETUP%" == "1" ( - echo %_msbuildexe% %msbuildflags% setup\build-insertion.proj /p:Configuration=%BUILD_CONFIG% - %_msbuildexe% %msbuildflags% setup\build-insertion.proj /p:Configuration=%BUILD_CONFIG% + echo %_msbuildexe% %msbuildflags% setup\build-insertion.proj /p:Configuration=%BUILD_CONFIG% /bl:artifacts\msbuild.build-insertion.build.%BUILD_CONFIG%.binlog + %_msbuildexe% %msbuildflags% setup\build-insertion.proj /p:Configuration=%BUILD_CONFIG% /bl:artifacts\msbuild.build-insertion.build.%BUILD_CONFIG%.binlog if ERRORLEVEL 1 echo Error building insertion packages && goto :failure ) @@ -828,8 +828,8 @@ if not "%SIGN_TYPE%" == "" ( echo ---------------- Done with signing, building insertion files --------------- if "%BUILD_SETUP%" == "1" ( - echo %_msbuildexe% %msbuildflags% setup\Swix\Microsoft.FSharp.vsmanproj /p:Configuration=%BUILD_CONFIG% - %_msbuildexe% %msbuildflags% setup\Swix\Microsoft.FSharp.vsmanproj /p:Configuration=%BUILD_CONFIG% + echo %_msbuildexe% %msbuildflags% setup\Swix\Microsoft.FSharp.vsmanproj /p:Configuration=%BUILD_CONFIG% /bl:artifacts\msbuild.setup-swix.build.%BUILD_CONFIG%.binlog + %_msbuildexe% %msbuildflags% setup\Swix\Microsoft.FSharp.vsmanproj /p:Configuration=%BUILD_CONFIG% /bl:artifacts\msbuild.setup-swix.build.%BUILD_CONFIG%.binlog if ERRORLEVEL 1 echo Error building .vsmanproj && goto :failure ) From 6d1badb4e4300cf52e69ba79c05c6ba27ba38e9e Mon Sep 17 00:00:00 2001 From: Kevin Ransom Date: Sat, 28 Jul 2018 16:10:59 -0700 Subject: [PATCH 114/150] root log path --- build.cmd | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/build.cmd b/build.cmd index 16472b68b1..928de1adf2 100644 --- a/build.cmd +++ b/build.cmd @@ -744,8 +744,8 @@ if "%BUILD_PROTO%" == "1" ( if "%BUILD_PROTO_WITH_CORECLR_LKG%" == "1" ( - echo %_msbuildexe% %msbuildflags% src\fsharp-proto-build.proj /p:BUILD_PROTO_WITH_CORECLR_LKG=%BUILD_PROTO_WITH_CORECLR_LKG% /p:Configuration=Proto /p:DisableLocalization=true /bl:artifacts\protobuild-net40.build.binlog - %_msbuildexe% %msbuildflags% src\fsharp-proto-build.proj /p:BUILD_PROTO_WITH_CORECLR_LKG=%BUILD_PROTO_WITH_CORECLR_LKG% /p:Configuration=Proto /p:DisableLocalization=true /bl:artifacts\protobuild-net40.build.binlog + echo %_msbuildexe% %msbuildflags% src\fsharp-proto-build.proj /p:BUILD_PROTO_WITH_CORECLR_LKG=%BUILD_PROTO_WITH_CORECLR_LKG% /p:Configuration=Proto /p:DisableLocalization=true /bl:%~dp0artifacts\protobuild-net40.build.binlog + %_msbuildexe% %msbuildflags% src\fsharp-proto-build.proj /p:BUILD_PROTO_WITH_CORECLR_LKG=%BUILD_PROTO_WITH_CORECLR_LKG% /p:Configuration=Proto /p:DisableLocalization=true /bl:%~dp0artifacts\protobuild-net40.build.binlog @if ERRORLEVEL 1 echo Error: compiler proto build failed && goto :failure ) @@ -754,8 +754,8 @@ if "%BUILD_PROTO%" == "1" ( echo %_ngenexe% install packages\FSharp.Compiler.Tools.4.1.27\tools\fsc.exe /nologo %_ngenexe% install packages\FSharp.Compiler.Tools.4.1.27\tools\fsc.exe /nologo - echo %_msbuildexe% %msbuildflags% src\fsharp-proto-build.proj /p:BUILD_PROTO_WITH_CORECLR_LKG=%BUILD_PROTO_WITH_CORECLR_LKG% /p:Configuration=Proto /p:DisableLocalization=true /bl:artifacts\protobuild-coreclr.build.binlog - %_msbuildexe% %msbuildflags% src\fsharp-proto-build.proj /p:BUILD_PROTO_WITH_CORECLR_LKG=%BUILD_PROTO_WITH_CORECLR_LKG% /p:Configuration=Proto /p:DisableLocalization=true /bl:artifacts\protobuild-coreclr.build.binlog + echo %_msbuildexe% %msbuildflags% src\fsharp-proto-build.proj /p:BUILD_PROTO_WITH_CORECLR_LKG=%BUILD_PROTO_WITH_CORECLR_LKG% /p:Configuration=Proto /p:DisableLocalization=true /bl:%~dp0artifacts\protobuild-coreclr.build.binlog + %_msbuildexe% %msbuildflags% src\fsharp-proto-build.proj /p:BUILD_PROTO_WITH_CORECLR_LKG=%BUILD_PROTO_WITH_CORECLR_LKG% /p:Configuration=Proto /p:DisableLocalization=true /bl:%~dp0artifacts\protobuild-coreclr.build.binlog @if ERRORLEVEL 1 echo Error: compiler proto build failed && goto :failure ) @@ -778,8 +778,8 @@ if "%BUILD_PHASE%" == "1" ( echo %_msbuildexe% %msbuildflags% build-everything.proj /t:Restore %BUILD_DIAG% %_msbuildexe% %msbuildflags% build-everything.proj /t:Restore %BUILD_DIAG% - echo %_msbuildexe% %msbuildflags% build-everything.proj /p:Configuration=%BUILD_CONFIG% %BUILD_DIAG% /p:BUILD_PUBLICSIGN=%BUILD_PUBLICSIGN% /bl:artifacts\msbuild.build-everything.build.%BUILD_CONFIG%.binlog - %_msbuildexe% %msbuildflags% build-everything.proj /p:Configuration=%BUILD_CONFIG% %BUILD_DIAG% /p:BUILD_PUBLICSIGN=%BUILD_PUBLICSIGN% /bl:artifacts\msbuild.build-everything.build.%BUILD_CONFIG%.binlog + echo %_msbuildexe% %msbuildflags% build-everything.proj /p:Configuration=%BUILD_CONFIG% %BUILD_DIAG% /p:BUILD_PUBLICSIGN=%BUILD_PUBLICSIGN% /bl:%~dp0artifacts\msbuild.build-everything.build.%BUILD_CONFIG%.binlog + %_msbuildexe% %msbuildflags% build-everything.proj /p:Configuration=%BUILD_CONFIG% %BUILD_DIAG% /p:BUILD_PUBLICSIGN=%BUILD_PUBLICSIGN% /bl:%~dp0artifacts\msbuild.build-everything.build.%BUILD_CONFIG%.binlog @if ERRORLEVEL 1 echo Error build failed && goto :failure ) @@ -803,8 +803,8 @@ if not "%SIGN_TYPE%" == "" ( echo ---------------- Done with assembly signing, start package creation --------------- -echo %_msbuildexe% %msbuildflags% build-nuget-packages.proj /p:Configuration=%BUILD_CONFIG% /bl:artifacts\msbuild.build-nuget-packages.build.%BUILD_CONFIG%.binlog - %_msbuildexe% %msbuildflags% build-nuget-packages.proj /p:Configuration=%BUILD_CONFIG% /bl:artifacts\msbuild.build-nuget-packages.build.%BUILD_CONFIG%.binlog +echo %_msbuildexe% %msbuildflags% build-nuget-packages.proj /p:Configuration=%BUILD_CONFIG% /bl:=~dp0artifacts\msbuild.build-nuget-packages.build.%BUILD_CONFIG%.binlog + %_msbuildexe% %msbuildflags% build-nuget-packages.proj /p:Configuration=%BUILD_CONFIG% /bl:%~dp0artifacts\msbuild.build-nuget-packages.build.%BUILD_CONFIG%.binlog if ERRORLEVEL 1 echo Error building NuGet packages && goto :failure if not "%SIGN_TYPE%" == "" ( @@ -814,8 +814,8 @@ if not "%SIGN_TYPE%" == "" ( ) if "%BUILD_SETUP%" == "1" ( - echo %_msbuildexe% %msbuildflags% setup\build-insertion.proj /p:Configuration=%BUILD_CONFIG% /bl:artifacts\msbuild.build-insertion.build.%BUILD_CONFIG%.binlog - %_msbuildexe% %msbuildflags% setup\build-insertion.proj /p:Configuration=%BUILD_CONFIG% /bl:artifacts\msbuild.build-insertion.build.%BUILD_CONFIG%.binlog + echo %_msbuildexe% %msbuildflags% setup\build-insertion.proj /p:Configuration=%BUILD_CONFIG% /bl:%~dp0artifacts\msbuild.build-insertion.build.%BUILD_CONFIG%.binlog + %_msbuildexe% %msbuildflags% setup\build-insertion.proj /p:Configuration=%BUILD_CONFIG% /bl:%~dp0artifacts\msbuild.build-insertion.build.%BUILD_CONFIG%.binlog if ERRORLEVEL 1 echo Error building insertion packages && goto :failure ) @@ -828,8 +828,8 @@ if not "%SIGN_TYPE%" == "" ( echo ---------------- Done with signing, building insertion files --------------- if "%BUILD_SETUP%" == "1" ( - echo %_msbuildexe% %msbuildflags% setup\Swix\Microsoft.FSharp.vsmanproj /p:Configuration=%BUILD_CONFIG% /bl:artifacts\msbuild.setup-swix.build.%BUILD_CONFIG%.binlog - %_msbuildexe% %msbuildflags% setup\Swix\Microsoft.FSharp.vsmanproj /p:Configuration=%BUILD_CONFIG% /bl:artifacts\msbuild.setup-swix.build.%BUILD_CONFIG%.binlog + echo %_msbuildexe% %msbuildflags% setup\Swix\Microsoft.FSharp.vsmanproj /p:Configuration=%BUILD_CONFIG% /bl:%~dp0artifacts\msbuild.setup-swix.build.%BUILD_CONFIG%.binlog + %_msbuildexe% %msbuildflags% setup\Swix\Microsoft.FSharp.vsmanproj /p:Configuration=%BUILD_CONFIG% /bl:%~dp0artifacts\msbuild.setup-swix.build.%BUILD_CONFIG%.binlog if ERRORLEVEL 1 echo Error building .vsmanproj && goto :failure ) From 5ebfb8513f210c1dc18a0d5838202518cc441e46 Mon Sep 17 00:00:00 2001 From: Kevin Ransom Date: Sun, 29 Jul 2018 12:57:58 -0700 Subject: [PATCH 115/150] add restore binlog --- build.cmd | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/build.cmd b/build.cmd index 928de1adf2..7c911daabe 100644 --- a/build.cmd +++ b/build.cmd @@ -744,8 +744,8 @@ if "%BUILD_PROTO%" == "1" ( if "%BUILD_PROTO_WITH_CORECLR_LKG%" == "1" ( - echo %_msbuildexe% %msbuildflags% src\fsharp-proto-build.proj /p:BUILD_PROTO_WITH_CORECLR_LKG=%BUILD_PROTO_WITH_CORECLR_LKG% /p:Configuration=Proto /p:DisableLocalization=true /bl:%~dp0artifacts\protobuild-net40.build.binlog - %_msbuildexe% %msbuildflags% src\fsharp-proto-build.proj /p:BUILD_PROTO_WITH_CORECLR_LKG=%BUILD_PROTO_WITH_CORECLR_LKG% /p:Configuration=Proto /p:DisableLocalization=true /bl:%~dp0artifacts\protobuild-net40.build.binlog + echo %_msbuildexe% %msbuildflags% src\fsharp-proto-build.proj /p:BUILD_PROTO_WITH_CORECLR_LKG=%BUILD_PROTO_WITH_CORECLR_LKG% /p:Configuration=Proto /p:DisableLocalization=true /bl:%~dp0%BUILD_CONFIG%\net40\binprotobuild-net40.build.binlog + %_msbuildexe% %msbuildflags% src\fsharp-proto-build.proj /p:BUILD_PROTO_WITH_CORECLR_LKG=%BUILD_PROTO_WITH_CORECLR_LKG% /p:Configuration=Proto /p:DisableLocalization=true /bl:%~dp0%BUILD_CONFIG%\net40\binprotobuild-net40.build.binlog @if ERRORLEVEL 1 echo Error: compiler proto build failed && goto :failure ) @@ -754,8 +754,8 @@ if "%BUILD_PROTO%" == "1" ( echo %_ngenexe% install packages\FSharp.Compiler.Tools.4.1.27\tools\fsc.exe /nologo %_ngenexe% install packages\FSharp.Compiler.Tools.4.1.27\tools\fsc.exe /nologo - echo %_msbuildexe% %msbuildflags% src\fsharp-proto-build.proj /p:BUILD_PROTO_WITH_CORECLR_LKG=%BUILD_PROTO_WITH_CORECLR_LKG% /p:Configuration=Proto /p:DisableLocalization=true /bl:%~dp0artifacts\protobuild-coreclr.build.binlog - %_msbuildexe% %msbuildflags% src\fsharp-proto-build.proj /p:BUILD_PROTO_WITH_CORECLR_LKG=%BUILD_PROTO_WITH_CORECLR_LKG% /p:Configuration=Proto /p:DisableLocalization=true /bl:%~dp0artifacts\protobuild-coreclr.build.binlog + echo %_msbuildexe% %msbuildflags% src\fsharp-proto-build.proj /p:BUILD_PROTO_WITH_CORECLR_LKG=%BUILD_PROTO_WITH_CORECLR_LKG% /p:Configuration=Proto /p:DisableLocalization=true /bl:%~dp0%BUILD_CONFIG%\net40\binprotobuild-coreclr.build.binlog + %_msbuildexe% %msbuildflags% src\fsharp-proto-build.proj /p:BUILD_PROTO_WITH_CORECLR_LKG=%BUILD_PROTO_WITH_CORECLR_LKG% /p:Configuration=Proto /p:DisableLocalization=true /bl:%~dp0%BUILD_CONFIG%\net40\binprotobuild-coreclr.build.binlog @if ERRORLEVEL 1 echo Error: compiler proto build failed && goto :failure ) @@ -775,11 +775,11 @@ echo ---------------- Done with SDK restore, starting build -------------------- if "%BUILD_PHASE%" == "1" ( - echo %_msbuildexe% %msbuildflags% build-everything.proj /t:Restore %BUILD_DIAG% - %_msbuildexe% %msbuildflags% build-everything.proj /t:Restore %BUILD_DIAG% + echo %_msbuildexe% %msbuildflags% build-everything.proj /t:Restore %BUILD_DIAG% /bl:%~dp0%BUILD_CONFIG%\net40\binmsbuild.build-everything.restore.%BUILD_CONFIG%.binlog + %_msbuildexe% %msbuildflags% build-everything.proj /t:Restore %BUILD_DIAG% /bl:%~dp0%BUILD_CONFIG%\net40\binmsbuild.build-everything.restore.%BUILD_CONFIG%.binlog - echo %_msbuildexe% %msbuildflags% build-everything.proj /p:Configuration=%BUILD_CONFIG% %BUILD_DIAG% /p:BUILD_PUBLICSIGN=%BUILD_PUBLICSIGN% /bl:%~dp0artifacts\msbuild.build-everything.build.%BUILD_CONFIG%.binlog - %_msbuildexe% %msbuildflags% build-everything.proj /p:Configuration=%BUILD_CONFIG% %BUILD_DIAG% /p:BUILD_PUBLICSIGN=%BUILD_PUBLICSIGN% /bl:%~dp0artifacts\msbuild.build-everything.build.%BUILD_CONFIG%.binlog + echo %_msbuildexe% %msbuildflags% build-everything.proj /p:Configuration=%BUILD_CONFIG% %BUILD_DIAG% /p:BUILD_PUBLICSIGN=%BUILD_PUBLICSIGN% /bl:%~dp0%BUILD_CONFIG%\net40\binmsbuild.build-everything.build.%BUILD_CONFIG%.binlog + %_msbuildexe% %msbuildflags% build-everything.proj /p:Configuration=%BUILD_CONFIG% %BUILD_DIAG% /p:BUILD_PUBLICSIGN=%BUILD_PUBLICSIGN% /bl:%~dp0%BUILD_CONFIG%\net40\binmsbuild.build-everything.build.%BUILD_CONFIG%.binlog @if ERRORLEVEL 1 echo Error build failed && goto :failure ) @@ -804,7 +804,7 @@ if not "%SIGN_TYPE%" == "" ( echo ---------------- Done with assembly signing, start package creation --------------- echo %_msbuildexe% %msbuildflags% build-nuget-packages.proj /p:Configuration=%BUILD_CONFIG% /bl:=~dp0artifacts\msbuild.build-nuget-packages.build.%BUILD_CONFIG%.binlog - %_msbuildexe% %msbuildflags% build-nuget-packages.proj /p:Configuration=%BUILD_CONFIG% /bl:%~dp0artifacts\msbuild.build-nuget-packages.build.%BUILD_CONFIG%.binlog + %_msbuildexe% %msbuildflags% build-nuget-packages.proj /p:Configuration=%BUILD_CONFIG% /bl:%~dp0%BUILD_CONFIG%\net40\binmsbuild.build-nuget-packages.build.%BUILD_CONFIG%.binlog if ERRORLEVEL 1 echo Error building NuGet packages && goto :failure if not "%SIGN_TYPE%" == "" ( @@ -814,8 +814,8 @@ if not "%SIGN_TYPE%" == "" ( ) if "%BUILD_SETUP%" == "1" ( - echo %_msbuildexe% %msbuildflags% setup\build-insertion.proj /p:Configuration=%BUILD_CONFIG% /bl:%~dp0artifacts\msbuild.build-insertion.build.%BUILD_CONFIG%.binlog - %_msbuildexe% %msbuildflags% setup\build-insertion.proj /p:Configuration=%BUILD_CONFIG% /bl:%~dp0artifacts\msbuild.build-insertion.build.%BUILD_CONFIG%.binlog + echo %_msbuildexe% %msbuildflags% setup\build-insertion.proj /p:Configuration=%BUILD_CONFIG% /bl:%~dp0%BUILD_CONFIG%\net40\binmsbuild.build-insertion.build.%BUILD_CONFIG%.binlog + %_msbuildexe% %msbuildflags% setup\build-insertion.proj /p:Configuration=%BUILD_CONFIG% /bl:%~dp0%BUILD_CONFIG%\net40\binmsbuild.build-insertion.build.%BUILD_CONFIG%.binlog if ERRORLEVEL 1 echo Error building insertion packages && goto :failure ) @@ -828,8 +828,8 @@ if not "%SIGN_TYPE%" == "" ( echo ---------------- Done with signing, building insertion files --------------- if "%BUILD_SETUP%" == "1" ( - echo %_msbuildexe% %msbuildflags% setup\Swix\Microsoft.FSharp.vsmanproj /p:Configuration=%BUILD_CONFIG% /bl:%~dp0artifacts\msbuild.setup-swix.build.%BUILD_CONFIG%.binlog - %_msbuildexe% %msbuildflags% setup\Swix\Microsoft.FSharp.vsmanproj /p:Configuration=%BUILD_CONFIG% /bl:%~dp0artifacts\msbuild.setup-swix.build.%BUILD_CONFIG%.binlog + echo %_msbuildexe% %msbuildflags% setup\Swix\Microsoft.FSharp.vsmanproj /p:Configuration=%BUILD_CONFIG% /bl:%~dp0%BUILD_CONFIG%\net40\binmsbuild.setup-swix.build.%BUILD_CONFIG%.binlog + %_msbuildexe% %msbuildflags% setup\Swix\Microsoft.FSharp.vsmanproj /p:Configuration=%BUILD_CONFIG% /bl:%~dp0%BUILD_CONFIG%\net40\binmsbuild.setup-swix.build.%BUILD_CONFIG%.binlog if ERRORLEVEL 1 echo Error building .vsmanproj && goto :failure ) From 81c3272393427ef0042f207362142aebdf299626 Mon Sep 17 00:00:00 2001 From: Kevin Ransom Date: Sun, 29 Jul 2018 14:54:46 -0700 Subject: [PATCH 116/150] pin valuetuple --- build/targets/PackageVersions.props | 1 + vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj | 1 + .../FSharp.LanguageService.Base.csproj | 1 + .../src/FSharp.LanguageService/FSharp.LanguageService.fsproj | 1 + vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj | 1 + 5 files changed, 5 insertions(+) diff --git a/build/targets/PackageVersions.props b/build/targets/PackageVersions.props index f4bcf0d7ba..b3c6197206 100644 --- a/build/targets/PackageVersions.props +++ b/build/targets/PackageVersions.props @@ -7,6 +7,7 @@ 1.5.0 + 4.3.0 $(RoslynPackageVersion) diff --git a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj index 504b85959d..397f3e65d1 100644 --- a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj +++ b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj @@ -163,6 +163,7 @@ + diff --git a/vsintegration/src/FSharp.LanguageService.Base/FSharp.LanguageService.Base.csproj b/vsintegration/src/FSharp.LanguageService.Base/FSharp.LanguageService.Base.csproj index 636c1ff171..3d68a1501c 100644 --- a/vsintegration/src/FSharp.LanguageService.Base/FSharp.LanguageService.Base.csproj +++ b/vsintegration/src/FSharp.LanguageService.Base/FSharp.LanguageService.Base.csproj @@ -62,6 +62,7 @@ + diff --git a/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj b/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj index 0515bf323e..0216d3d5e7 100644 --- a/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj +++ b/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj @@ -89,6 +89,7 @@ + diff --git a/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj b/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj index 2586b5c826..a6dea0c902 100644 --- a/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj +++ b/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj @@ -84,6 +84,7 @@ + From c6606e418418635abebd3a885698674ecb927e6a Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Sun, 29 Jul 2018 20:39:03 -0700 Subject: [PATCH 117/150] add valuetuple to unittsts --- vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj | 1 + 1 file changed, 1 insertion(+) diff --git a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj index 4074ac2b69..93e750d9f0 100644 --- a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj +++ b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj @@ -204,6 +204,7 @@ + From 575bea89d912fa897620a7c0ce5638c51e217f61 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Sun, 29 Jul 2018 21:29:42 -0700 Subject: [PATCH 118/150] valuetuple version --- .../LanguageServiceProfiling/LanguageServiceProfiling.fsproj | 1 + vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj | 1 + .../src/FSharp.LanguageService/FSharp.LanguageService.fsproj | 1 + .../src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj | 1 + vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj | 1 + vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj | 1 + vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj | 1 + 7 files changed, 7 insertions(+) diff --git a/vsintegration/Utils/LanguageServiceProfiling/LanguageServiceProfiling.fsproj b/vsintegration/Utils/LanguageServiceProfiling/LanguageServiceProfiling.fsproj index 58257f0b93..165f8cd3b3 100644 --- a/vsintegration/Utils/LanguageServiceProfiling/LanguageServiceProfiling.fsproj +++ b/vsintegration/Utils/LanguageServiceProfiling/LanguageServiceProfiling.fsproj @@ -6,6 +6,7 @@ Exe true true + $(DefaultValueTuplePackageVersion) true diff --git a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj index 397f3e65d1..a2675c2b7e 100644 --- a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj +++ b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj @@ -10,6 +10,7 @@ $(NoWarn);75 true true + $(DefaultValueTuplePackageVersion) $(OtherFlags) --warnon:1182 --subsystemversion:6.00 true false diff --git a/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj b/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj index 0216d3d5e7..61dd4c3c1a 100644 --- a/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj +++ b/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj @@ -10,6 +10,7 @@ $(NoWarn);75 true true + $(DefaultValueTuplePackageVersion) $(OtherFlags) --warnon:1182 --subsystemversion:6.00 true false diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj b/vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj index 0851e3c5c2..4777bbabeb 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj @@ -11,6 +11,7 @@ $(NoWarn);52;62;75 true true + $(DefaultValueTuplePackageVersion) $(OtherFlags) --warnon:1182 --subsystemversion:6.00 true false diff --git a/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj b/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj index a6dea0c902..b5d5610d1e 100644 --- a/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj +++ b/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj @@ -10,6 +10,7 @@ $(NoWarn);47;75 true true + $(DefaultValueTuplePackageVersion) $(OtherFlags) --subsystemversion:6.00 true false diff --git a/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj b/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj index 2202c29904..2ad48ace78 100644 --- a/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj +++ b/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj @@ -8,6 +8,7 @@ $(NoWarn);45;47;52;58;75 true true + $(DefaultValueTuplePackageVersion) true false diff --git a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj index 93e750d9f0..29a6b8a70c 100644 --- a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj +++ b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj @@ -9,6 +9,7 @@ NO_PROJECTCRACKER;$(DefineConstants) true true + $(DefaultValueTuplePackageVersion) true false From 9a2abb283bfe5550cd70e966add90f561a1fe05c Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Sun, 29 Jul 2018 23:55:37 -0700 Subject: [PATCH 119/150] use correct system.valuetuple package version --- .../LanguageServiceProfiling/LanguageServiceProfiling.fsproj | 2 +- vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj | 2 +- .../src/FSharp.LanguageService/FSharp.LanguageService.fsproj | 2 +- .../src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj | 2 +- vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj | 2 +- vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj | 2 +- vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/vsintegration/Utils/LanguageServiceProfiling/LanguageServiceProfiling.fsproj b/vsintegration/Utils/LanguageServiceProfiling/LanguageServiceProfiling.fsproj index 165f8cd3b3..21a4ab6c6d 100644 --- a/vsintegration/Utils/LanguageServiceProfiling/LanguageServiceProfiling.fsproj +++ b/vsintegration/Utils/LanguageServiceProfiling/LanguageServiceProfiling.fsproj @@ -6,7 +6,7 @@ Exe true true - $(DefaultValueTuplePackageVersion) + $(SystemValueTuplePackageVersion) true diff --git a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj index a2675c2b7e..c6e73ba3d1 100644 --- a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj +++ b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj @@ -10,7 +10,7 @@ $(NoWarn);75 true true - $(DefaultValueTuplePackageVersion) + $(SystemValueTuplePackageVersion) $(OtherFlags) --warnon:1182 --subsystemversion:6.00 true false diff --git a/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj b/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj index 61dd4c3c1a..f6871ba816 100644 --- a/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj +++ b/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj @@ -10,7 +10,7 @@ $(NoWarn);75 true true - $(DefaultValueTuplePackageVersion) + $(SystemValueTuplePackageVersion) $(OtherFlags) --warnon:1182 --subsystemversion:6.00 true false diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj b/vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj index 4777bbabeb..2735ced983 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj @@ -11,7 +11,7 @@ $(NoWarn);52;62;75 true true - $(DefaultValueTuplePackageVersion) + $(SystemValueTuplePackageVersion) $(OtherFlags) --warnon:1182 --subsystemversion:6.00 true false diff --git a/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj b/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj index b5d5610d1e..bac4cbffbb 100644 --- a/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj +++ b/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj @@ -10,7 +10,7 @@ $(NoWarn);47;75 true true - $(DefaultValueTuplePackageVersion) + $(SystemValueTuplePackageVersion) $(OtherFlags) --subsystemversion:6.00 true false diff --git a/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj b/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj index 2ad48ace78..7f6006cc47 100644 --- a/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj +++ b/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj @@ -8,7 +8,7 @@ $(NoWarn);45;47;52;58;75 true true - $(DefaultValueTuplePackageVersion) + $(SystemValueTuplePackageVersion) true false diff --git a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj index 29a6b8a70c..bf4cd4ed02 100644 --- a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj +++ b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj @@ -9,7 +9,7 @@ NO_PROJECTCRACKER;$(DefineConstants) true true - $(DefaultValueTuplePackageVersion) + $(SystemValueTuplePackageVersion) true false From 1f1af7e52ea419933fdcc5a95db8c8bcd38725d6 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Tue, 31 Jul 2018 10:49:04 -0700 Subject: [PATCH 120/150] rename YAML build definitions --- .vsts-pr.yaml | 59 +++++++++++++++++++++++++ .vsts-signed.yaml | 107 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 166 insertions(+) create mode 100644 .vsts-pr.yaml create mode 100644 .vsts-signed.yaml diff --git a/.vsts-pr.yaml b/.vsts-pr.yaml new file mode 100644 index 0000000000..67f78e6df0 --- /dev/null +++ b/.vsts-pr.yaml @@ -0,0 +1,59 @@ +phases: +- phase: Linux + queue: + name: Hosted Linux Preview + timeoutInMinutes: 90 + parallel: 2 + matrix: + release_default: + _command: ./mono/cibuild.sh + _args: release + release_fcs: + _command: ./fcs/build.sh + _args: Build + steps: + - script: $(_command) $(_args) + - task: PublishBuildArtifacts@1 + inputs: + PathtoPublish: '$(Build.SourcesDirectory)/tests/TestResults' + ArtifactName: 'Linux $(_command) $(_args)' + publishLocation: Container + continueOnError: true + condition: failed() + +- phase: Windows + queue: + name: Hosted VS2017 + timeoutInMinutes: 90 + parallel: 7 + matrix: + ci_part1: + _command: build.cmd + _args: release ci_part1 + ci_part2: + _command: build.cmd + _args: release ci_part2 + ci_part3: + _command: build.cmd + _args: release ci_part3 + ci_part4: + _command: build.cmd + _args: release ci_part4 + debug_default: + _command: build.cmd + _args: debug + net40_no_vs: + _command: build.cmd + _args: release net40 + release_fcs: + _command: fcs\build.cmd + _args: TestAndNuget + steps: + - script: $(_command) $(_args) + - task: PublishBuildArtifacts@1 + inputs: + PathtoPublish: '$(Build.SourcesDirectory)\tests\TestResults' + ArtifactName: 'Windows $(_command) $(_args)' + publishLocation: Container + continueOnError: true + condition: failed() diff --git a/.vsts-signed.yaml b/.vsts-signed.yaml new file mode 100644 index 0000000000..6d5193b38c --- /dev/null +++ b/.vsts-signed.yaml @@ -0,0 +1,107 @@ +queue: + name: VSEng-MicroBuildVS2017 + timeoutInMinutes: 300 + demands: + - visualstudio + - DotNetFramework + - msbuild + +variables: + MSBuildConfiguration: 'Release' + +steps: +# Install Signing Plugin +- task: ms-vseng.MicroBuildTasks.30666190-6959-11e5-9f96-f56098202fef.MicroBuildSigningPlugin@1 + displayName: Install Signing Plugin + inputs: + signType: real + condition: and(succeeded(), in(variables['PB_SignType'], 'test', 'real')) + +# Install Swix Plugin +- task: ms-vseng.MicroBuildTasks.32f78468-e895-4f47-962c-58a699361df8.MicroBuildSwixPlugin@1 + displayName: Install Swix Plugin + +# Run build.cmd +- task: CmdLine@1 + displayName: Run build.cmd + inputs: + filename: build.cmd + arguments: microbuild + +# Publish nightly package to MyGet +- task: PowerShell@1 + displayName: Publish nightly package to MyGet + inputs: + scriptName: 'setup\publish-assets.ps1' + arguments: '-binariesPath $(MSBuildConfiguration) -branchName $(Build.SourceBranch) -apiKey $(FSharp.MyGetApiKey)' + condition: and(succeeded(), contains(variables['PB_PublishType'], 'myget'), in(variables['Build.SourceBranchName'], 'master', 'dev15.7', 'dev15.8')) + +# Publish packages to Azure Blob Storage +- task: MSBuild@1 + displayName: Publish packages to Azure Blob Storage + inputs: + solution: PublishToBlob.proj + msbuildArguments: '/t:Build /p:ExpectedFeedUrl=$(PB_PublishBlobFeedUrl) /p:AccountKey=$(PB_PublishBlobFeedKey) /p:ManifestBranch=$(SourceBranch) /p:ManifestCommit=$(SourceVersion) /p:ManifestBuildId=$(OfficialBuildId)' + condition: and(succeeded(), contains(variables['PB_PublishType'], 'blob')) + +# Run BinSkim +- task: securedevelopmentteam.vss-secure-development-tools.build-task-binskim.BinSkim@3 + displayName: Run BinSkim + inputs: + arguments: 'analyze "$(MSBuildConfiguration)\*.dll" "$(MSBuildConfiguration)\*.exe" --recurse --output "$(MSBuildConfiguration)\artifacts"' + continueOnError: true + +# Create static drop +- task: PublishBuildArtifacts@1 + displayName: Create static drop + inputs: + PathtoPublish: '$(MSBuildConfiguration)' + ArtifactName: '$(Build.BuildNumber)' + publishLocation: FilePath + TargetPath: '$(DropRoot)\$(Build.DefinitionName)\$(Build.SourceBranchName)' + Parallel: true + ParallelCount: 64 + condition: and(succeeded(), contains(variables['PB_PublishType'], 'drop')) + +# Publish symbols +- task: PublishSymbols@1 + displayName: Publish symbols + inputs: + SymbolsPath: '$(DropRoot)\$(Build.DefinitionName)\$(Build.SourceBranchName)\$(Build.BuildNumber)\Symbols' + SearchPattern: '**\*.dll;**\*.exe;**\*.pdb' + SymbolsFolder: '$(Build.SourcesDirectory)\$(MSBuildConfiguration)' + TreatNotIndexedAsWarning: true + SymbolsProduct: '$(Build.DefinitionName)' + SymbolsVersion: '$(Build.BuildNumber)' + continueOnError: true + condition: and(succeeded(), contains(variables['PB_PublishType'], 'symbols')) + +# Upload VSTS Drop +- task: ms-vseng.MicroBuildTasks.4305a8de-ba66-4d8b-b2d1-0dc4ecbbf5e8.MicroBuildUploadVstsDropFolder@1 + displayName: Upload VSTS Drop + inputs: + DropFolder: '$(Build.SourcesDirectory)\$(MSBuildConfiguration)\insertion' + condition: and(succeeded(), contains(variables['PB_PublishType'], 'vsts')) + +# Execute cleanup tasks +- task: ms-vseng.MicroBuildTasks.521a94ea-9e68-468a-8167-6dcf361ea776.MicroBuildCleanup@1 + displayName: Execute cleanup tasks + condition: succeededOrFailed() + +# Publish Artifact: MicroBuildOutputs +- task: PublishBuildArtifacts@1 + displayName: 'Publish Artifact: MicroBuildOutputs' + inputs: + PathtoPublish: '$(Build.StagingDirectory)\MicroBuild\Output' + ArtifactName: MicroBuildOutputs + publishLocation: Container + condition: and(succeeded(), contains(variables['PB_PublishType'], 'microbuild')) + +# Publish Symbols to Symweb +- task: ms-vscs-artifact.build-tasks.artifactSymbolTask-1.artifactSymbolTask@0 + displayName: Publish symbols to SymWeb + inputs: + symbolServiceURI: 'https://microsoft.artifacts.visualstudio.com/DefaultCollection' + sourcePath: '$(DropRoot)\$(Build.DefinitionName)\$(Build.SourceBranchName)\$(Build.BuildNumber)\Symbols' + usePat: false + condition: and(succeeded(), contains(variables['PB_PublishType'], 'symweb')) From f401839080bd5f9945ca4a401a8d86fa70447307 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Tue, 31 Jul 2018 10:55:13 -0700 Subject: [PATCH 121/150] rename YAML build definition --- .vsts-signed.yaml | 107 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 .vsts-signed.yaml diff --git a/.vsts-signed.yaml b/.vsts-signed.yaml new file mode 100644 index 0000000000..6c76437dc2 --- /dev/null +++ b/.vsts-signed.yaml @@ -0,0 +1,107 @@ +queue: + name: VSEng-MicroBuildVS2017 + timeoutInMinutes: 300 + demands: + - visualstudio + - DotNetFramework + - msbuild + +variables: + MSBuildConfiguration: 'Release' + +steps: +# Install Signing Plugin +- task: ms-vseng.MicroBuildTasks.30666190-6959-11e5-9f96-f56098202fef.MicroBuildSigningPlugin@1 + displayName: Install Signing Plugin + inputs: + signType: real + condition: and(succeeded(), in(variables['PB_SignType'], 'test', 'real')) + +# Install Swix Plugin +- task: ms-vseng.MicroBuildTasks.32f78468-e895-4f47-962c-58a699361df8.MicroBuildSwixPlugin@1 + displayName: Install Swix Plugin + +# Run build.cmd +- task: CmdLine@1 + displayName: Run build.cmd + inputs: + filename: build.cmd + arguments: microbuild + +# Publish nightly package to MyGet +- task: PowerShell@1 + displayName: Publish nightly package to MyGet + inputs: + scriptName: 'setup\publish-assets.ps1' + arguments: '-binariesPath $(MSBuildConfiguration) -branchName $(Build.SourceBranch) -apiKey $(FSharp.MyGetApiKey)' + condition: and(succeeded(), contains(variables['PB_PublishType'], 'myget'), in(variables['Build.SourceBranchName'], 'master', 'dev15.7', 'dev15.8')) + +# Publish packages to Azure Blob Storage +- task: MSBuild@1 + displayName: Publish packages to Azure Blob Storage + inputs: + solution: PublishToBlob.proj + msbuildArguments: '/t:Build /p:ExpectedFeedUrl=$(PB_PublishBlobFeedUrl) /p:AccountKey=$(PB_PublishBlobFeedKey) /p:ManifestBranch=$(SourceBranch) /p:ManifestCommit=$(SourceVersion) /p:ManifestBuildId=$(OfficialBuildId)' + condition: and(succeeded(), contains(variables['PB_PublishType'], 'blob')) + +# Run BinSkim +- task: securedevelopmentteam.vss-secure-development-tools.build-task-binskim.BinSkim@3 + displayName: Run BinSkim + inputs: + arguments: 'analyze "$(MSBuildConfiguration)\*.dll" "$(MSBuildConfiguration)\*.exe" --recurse --output "$(MSBuildConfiguration)\artifacts"' + continueOnError: true + +# Create static drop +- task: PublishBuildArtifacts@1 + displayName: Create static drop + inputs: + PathtoPublish: '$(MSBuildConfiguration)' + ArtifactName: '$(Build.BuildNumber)' + publishLocation: FilePath + TargetPath: '$(DropRoot)\$(Build.DefinitionName)\$(Build.SourceBranchName)' + Parallel: true + ParallelCount: 64 + condition: and(succeeded(), contains(variables['PB_PublishType'], 'drop')) + +# Publish symbols +- task: PublishSymbols@1 + displayName: Publish symbols + inputs: + SymbolsPath: '$(DropRoot)\$(Build.DefinitionName)\$(Build.SourceBranchName)\$(Build.BuildNumber)\Symbols' + SearchPattern: '**\*.dll;**\*.exe;**\*.pdb' + SymbolsFolder: '$(Build.SourcesDirectory)\$(MSBuildConfiguration)' + TreatNotIndexedAsWarning: true + SymbolsProduct: '$(Build.DefinitionName)' + SymbolsVersion: '$(Build.BuildNumber)' + continueOnError: true + condition: and(succeeded(), contains(variables['PB_PublishType'], 'symbols')) + +# Upload VSTS Drop +- task: ms-vseng.MicroBuildTasks.4305a8de-ba66-4d8b-b2d1-0dc4ecbbf5e8.MicroBuildUploadVstsDropFolder@1 + displayName: Upload VSTS Drop + inputs: + DropFolder: '$(Build.SourcesDirectory)\$(MSBuildConfiguration)\insertion' + condition: and(succeeded(), contains(variables['PB_PublishType'], 'vsts')) + +# Execute cleanup tasks +- task: ms-vseng.MicroBuildTasks.521a94ea-9e68-468a-8167-6dcf361ea776.MicroBuildCleanup@1 + displayName: Execute cleanup tasks + condition: succeededOrFailed() + +# Publish Artifact: MicroBuildOutputs +- task: PublishBuildArtifacts@1 + displayName: 'Publish Artifact: MicroBuildOutputs' + inputs: + PathtoPublish: '$(Build.StagingDirectory)\MicroBuild\Output' + ArtifactName: MicroBuildOutputs + publishLocation: Container + condition: and(succeeded(), contains(variables['PB_PublishType'], 'microbuild')) + +# Publish Symbols to Symweb +- task: ms-vscs-artifact.build-tasks.artifactSymbolTask-1.artifactSymbolTask@0 + displayName: Publish symbols to SymWeb + inputs: + symbolServiceURI: 'https://microsoft.artifacts.visualstudio.com/DefaultCollection' + sourcePath: '$(DropRoot)\$(Build.DefinitionName)\$(Build.SourceBranchName)\$(Build.BuildNumber)\Symbols' + usePat: false + condition: and(succeeded(), contains(variables['PB_PublishType'], 'symweb')) From 0dbac8733bccf4b6dbdc74cb3c4021a4af400018 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Tue, 31 Jul 2018 10:59:25 -0700 Subject: [PATCH 122/150] rename YAML build definition --- .vsts-signed.yaml | 105 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 .vsts-signed.yaml diff --git a/.vsts-signed.yaml b/.vsts-signed.yaml new file mode 100644 index 0000000000..f7f4a4439d --- /dev/null +++ b/.vsts-signed.yaml @@ -0,0 +1,105 @@ +queue: + name: VSEng-MicroBuildVS2017 + timeoutInMinutes: 300 + demands: + - visualstudio + - DotNetFramework + - msbuild + +variables: + MSBuildConfiguration: 'Release' + +steps: +# Install Signing Plugin +- task: ms-vseng.MicroBuildTasks.30666190-6959-11e5-9f96-f56098202fef.MicroBuildSigningPlugin@1 + displayName: Install Signing Plugin + inputs: + signType: real + condition: and(succeeded(), in(variables['PB_SignType'], 'test', 'real')) + +# Install Swix Plugin +- task: ms-vseng.MicroBuildTasks.32f78468-e895-4f47-962c-58a699361df8.MicroBuildSwixPlugin@1 + displayName: Install Swix Plugin + +# Run build.cmd +- task: CmdLine@1 + displayName: Run build.cmd + inputs: + filename: build.cmd + arguments: microbuild + +# Publish nightly package to MyGet +- task: PowerShell@1 + displayName: Publish nightly package to MyGet + inputs: + scriptName: 'setup\publish-assets.ps1' + arguments: '-binariesPath $(MSBuildConfiguration) -branchName $(Build.SourceBranch) -apiKey $(FSharp.MyGetApiKey)' + condition: and(succeeded(), contains(variables['PB_PublishType'], 'myget'), in(variables['Build.SourceBranchName'], 'master', 'dev15.7', 'dev15.8')) + +# Publish packages to Azure Blob Storage +- task: MSBuild@1 + displayName: Publish packages to Azure Blob Storage + inputs: + solution: PublishToBlob.proj + msbuildArguments: '/t:Build /p:ExpectedFeedUrl=$(PB_PublishBlobFeedUrl) /p:AccountKey=$(PB_PublishBlobFeedKey) /p:ManifestBranch=$(SourceBranch) /p:ManifestCommit=$(SourceVersion) /p:ManifestBuildId=$(OfficialBuildId)' + condition: and(succeeded(), contains(variables['PB_PublishType'], 'blob')) + +# Run BinSkim +- task: securedevelopmentteam.vss-secure-development-tools.build-task-binskim.BinSkim@3 + displayName: Run BinSkim + inputs: + arguments: 'analyze "$(MSBuildConfiguration)\*.dll" "$(MSBuildConfiguration)\*.exe" --recurse --output "$(MSBuildConfiguration)\artifacts"' + continueOnError: true + +# Create static drop +- task: ms-vseng.MicroBuildTasks.bd4b789e-7292-4b73-a8ee-612d3dd615f1.MicroBuildStaticDrop@1 + displayName: Create static drop + inputs: + CopyRoot: '$(MSBuildConfiguration)' + Contents: '**' + ArtifactName: Binaries + TargetPath: '$(DropRoot)\$(Build.DefinitionName)\$(Build.SourceBranchName)\$(Build.BuildNumber)\Binaries' + condition: and(succeeded(), contains(variables['PB_PublishType'], 'drop')) + +# Publish symbols +- task: PublishSymbols@1 + displayName: Publish symbols + inputs: + SymbolsPath: '$(DropRoot)\$(Build.DefinitionName)\$(Build.SourceBranchName)\$(Build.BuildNumber)\Symbols' + SearchPattern: '**\*.dll;**\*.exe;**\*.pdb' + SymbolsFolder: '$(Build.SourcesDirectory)\$(MSBuildConfiguration)' + TreatNotIndexedAsWarning: true + SymbolsProduct: '$(Build.DefinitionName)' + SymbolsVersion: '$(Build.BuildNumber)' + continueOnError: true + condition: and(succeeded(), contains(variables['PB_PublishType'], 'symbols')) + +# Upload VSTS Drop +- task: ms-vseng.MicroBuildTasks.4305a8de-ba66-4d8b-b2d1-0dc4ecbbf5e8.MicroBuildUploadVstsDropFolder@1 + displayName: Upload VSTS Drop + inputs: + DropFolder: '$(Build.SourcesDirectory)\$(MSBuildConfiguration)\insertion' + condition: and(succeeded(), contains(variables['PB_PublishType'], 'vsts')) + +# Execute cleanup tasks +- task: ms-vseng.MicroBuildTasks.521a94ea-9e68-468a-8167-6dcf361ea776.MicroBuildCleanup@1 + displayName: Execute cleanup tasks + condition: succeededOrFailed() + +# Publish Artifact: MicroBuildOutputs +- task: PublishBuildArtifacts@1 + displayName: 'Publish Artifact: MicroBuildOutputs' + inputs: + PathtoPublish: '$(Build.StagingDirectory)\MicroBuild\Output' + ArtifactName: MicroBuildOutputs + publishLocation: Container + condition: and(succeeded(), contains(variables['PB_PublishType'], 'microbuild')) + +# Publish Symbols to Symweb +- task: ms-vscs-artifact.build-tasks.artifactSymbolTask-1.artifactSymbolTask@0 + displayName: Publish symbols to SymWeb + inputs: + symbolServiceURI: 'https://microsoft.artifacts.visualstudio.com/DefaultCollection' + sourcePath: '$(DropRoot)\$(Build.DefinitionName)\$(Build.SourceBranchName)\$(Build.BuildNumber)\Symbols' + usePat: false + condition: and(succeeded(), contains(variables['PB_PublishType'], 'symweb')) From 4d4353dea33664a48f4198841d61b862102ddb4b Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Tue, 31 Jul 2018 11:08:46 -0700 Subject: [PATCH 123/150] remove old YAML files --- .vsts-ci.yaml | 107 ----------------------------------------------- .vsts-dotnet.yml | 59 -------------------------- 2 files changed, 166 deletions(-) delete mode 100644 .vsts-ci.yaml delete mode 100644 .vsts-dotnet.yml diff --git a/.vsts-ci.yaml b/.vsts-ci.yaml deleted file mode 100644 index 6c76437dc2..0000000000 --- a/.vsts-ci.yaml +++ /dev/null @@ -1,107 +0,0 @@ -queue: - name: VSEng-MicroBuildVS2017 - timeoutInMinutes: 300 - demands: - - visualstudio - - DotNetFramework - - msbuild - -variables: - MSBuildConfiguration: 'Release' - -steps: -# Install Signing Plugin -- task: ms-vseng.MicroBuildTasks.30666190-6959-11e5-9f96-f56098202fef.MicroBuildSigningPlugin@1 - displayName: Install Signing Plugin - inputs: - signType: real - condition: and(succeeded(), in(variables['PB_SignType'], 'test', 'real')) - -# Install Swix Plugin -- task: ms-vseng.MicroBuildTasks.32f78468-e895-4f47-962c-58a699361df8.MicroBuildSwixPlugin@1 - displayName: Install Swix Plugin - -# Run build.cmd -- task: CmdLine@1 - displayName: Run build.cmd - inputs: - filename: build.cmd - arguments: microbuild - -# Publish nightly package to MyGet -- task: PowerShell@1 - displayName: Publish nightly package to MyGet - inputs: - scriptName: 'setup\publish-assets.ps1' - arguments: '-binariesPath $(MSBuildConfiguration) -branchName $(Build.SourceBranch) -apiKey $(FSharp.MyGetApiKey)' - condition: and(succeeded(), contains(variables['PB_PublishType'], 'myget'), in(variables['Build.SourceBranchName'], 'master', 'dev15.7', 'dev15.8')) - -# Publish packages to Azure Blob Storage -- task: MSBuild@1 - displayName: Publish packages to Azure Blob Storage - inputs: - solution: PublishToBlob.proj - msbuildArguments: '/t:Build /p:ExpectedFeedUrl=$(PB_PublishBlobFeedUrl) /p:AccountKey=$(PB_PublishBlobFeedKey) /p:ManifestBranch=$(SourceBranch) /p:ManifestCommit=$(SourceVersion) /p:ManifestBuildId=$(OfficialBuildId)' - condition: and(succeeded(), contains(variables['PB_PublishType'], 'blob')) - -# Run BinSkim -- task: securedevelopmentteam.vss-secure-development-tools.build-task-binskim.BinSkim@3 - displayName: Run BinSkim - inputs: - arguments: 'analyze "$(MSBuildConfiguration)\*.dll" "$(MSBuildConfiguration)\*.exe" --recurse --output "$(MSBuildConfiguration)\artifacts"' - continueOnError: true - -# Create static drop -- task: PublishBuildArtifacts@1 - displayName: Create static drop - inputs: - PathtoPublish: '$(MSBuildConfiguration)' - ArtifactName: '$(Build.BuildNumber)' - publishLocation: FilePath - TargetPath: '$(DropRoot)\$(Build.DefinitionName)\$(Build.SourceBranchName)' - Parallel: true - ParallelCount: 64 - condition: and(succeeded(), contains(variables['PB_PublishType'], 'drop')) - -# Publish symbols -- task: PublishSymbols@1 - displayName: Publish symbols - inputs: - SymbolsPath: '$(DropRoot)\$(Build.DefinitionName)\$(Build.SourceBranchName)\$(Build.BuildNumber)\Symbols' - SearchPattern: '**\*.dll;**\*.exe;**\*.pdb' - SymbolsFolder: '$(Build.SourcesDirectory)\$(MSBuildConfiguration)' - TreatNotIndexedAsWarning: true - SymbolsProduct: '$(Build.DefinitionName)' - SymbolsVersion: '$(Build.BuildNumber)' - continueOnError: true - condition: and(succeeded(), contains(variables['PB_PublishType'], 'symbols')) - -# Upload VSTS Drop -- task: ms-vseng.MicroBuildTasks.4305a8de-ba66-4d8b-b2d1-0dc4ecbbf5e8.MicroBuildUploadVstsDropFolder@1 - displayName: Upload VSTS Drop - inputs: - DropFolder: '$(Build.SourcesDirectory)\$(MSBuildConfiguration)\insertion' - condition: and(succeeded(), contains(variables['PB_PublishType'], 'vsts')) - -# Execute cleanup tasks -- task: ms-vseng.MicroBuildTasks.521a94ea-9e68-468a-8167-6dcf361ea776.MicroBuildCleanup@1 - displayName: Execute cleanup tasks - condition: succeededOrFailed() - -# Publish Artifact: MicroBuildOutputs -- task: PublishBuildArtifacts@1 - displayName: 'Publish Artifact: MicroBuildOutputs' - inputs: - PathtoPublish: '$(Build.StagingDirectory)\MicroBuild\Output' - ArtifactName: MicroBuildOutputs - publishLocation: Container - condition: and(succeeded(), contains(variables['PB_PublishType'], 'microbuild')) - -# Publish Symbols to Symweb -- task: ms-vscs-artifact.build-tasks.artifactSymbolTask-1.artifactSymbolTask@0 - displayName: Publish symbols to SymWeb - inputs: - symbolServiceURI: 'https://microsoft.artifacts.visualstudio.com/DefaultCollection' - sourcePath: '$(DropRoot)\$(Build.DefinitionName)\$(Build.SourceBranchName)\$(Build.BuildNumber)\Symbols' - usePat: false - condition: and(succeeded(), contains(variables['PB_PublishType'], 'symweb')) diff --git a/.vsts-dotnet.yml b/.vsts-dotnet.yml deleted file mode 100644 index 67f78e6df0..0000000000 --- a/.vsts-dotnet.yml +++ /dev/null @@ -1,59 +0,0 @@ -phases: -- phase: Linux - queue: - name: Hosted Linux Preview - timeoutInMinutes: 90 - parallel: 2 - matrix: - release_default: - _command: ./mono/cibuild.sh - _args: release - release_fcs: - _command: ./fcs/build.sh - _args: Build - steps: - - script: $(_command) $(_args) - - task: PublishBuildArtifacts@1 - inputs: - PathtoPublish: '$(Build.SourcesDirectory)/tests/TestResults' - ArtifactName: 'Linux $(_command) $(_args)' - publishLocation: Container - continueOnError: true - condition: failed() - -- phase: Windows - queue: - name: Hosted VS2017 - timeoutInMinutes: 90 - parallel: 7 - matrix: - ci_part1: - _command: build.cmd - _args: release ci_part1 - ci_part2: - _command: build.cmd - _args: release ci_part2 - ci_part3: - _command: build.cmd - _args: release ci_part3 - ci_part4: - _command: build.cmd - _args: release ci_part4 - debug_default: - _command: build.cmd - _args: debug - net40_no_vs: - _command: build.cmd - _args: release net40 - release_fcs: - _command: fcs\build.cmd - _args: TestAndNuget - steps: - - script: $(_command) $(_args) - - task: PublishBuildArtifacts@1 - inputs: - PathtoPublish: '$(Build.SourcesDirectory)\tests\TestResults' - ArtifactName: 'Windows $(_command) $(_args)' - publishLocation: Container - continueOnError: true - condition: failed() From c9fcfa9bc24da301a69ccb0055562dd3ac1a63da Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Tue, 31 Jul 2018 11:10:51 -0700 Subject: [PATCH 124/150] remove old YAML file --- .vsts-ci.yaml | 105 ---------------------------------------------- .vsts-signed.yaml | 2 +- 2 files changed, 1 insertion(+), 106 deletions(-) delete mode 100644 .vsts-ci.yaml diff --git a/.vsts-ci.yaml b/.vsts-ci.yaml deleted file mode 100644 index f7f4a4439d..0000000000 --- a/.vsts-ci.yaml +++ /dev/null @@ -1,105 +0,0 @@ -queue: - name: VSEng-MicroBuildVS2017 - timeoutInMinutes: 300 - demands: - - visualstudio - - DotNetFramework - - msbuild - -variables: - MSBuildConfiguration: 'Release' - -steps: -# Install Signing Plugin -- task: ms-vseng.MicroBuildTasks.30666190-6959-11e5-9f96-f56098202fef.MicroBuildSigningPlugin@1 - displayName: Install Signing Plugin - inputs: - signType: real - condition: and(succeeded(), in(variables['PB_SignType'], 'test', 'real')) - -# Install Swix Plugin -- task: ms-vseng.MicroBuildTasks.32f78468-e895-4f47-962c-58a699361df8.MicroBuildSwixPlugin@1 - displayName: Install Swix Plugin - -# Run build.cmd -- task: CmdLine@1 - displayName: Run build.cmd - inputs: - filename: build.cmd - arguments: microbuild - -# Publish nightly package to MyGet -- task: PowerShell@1 - displayName: Publish nightly package to MyGet - inputs: - scriptName: 'setup\publish-assets.ps1' - arguments: '-binariesPath $(MSBuildConfiguration) -branchName $(Build.SourceBranch) -apiKey $(FSharp.MyGetApiKey)' - condition: and(succeeded(), contains(variables['PB_PublishType'], 'myget'), in(variables['Build.SourceBranchName'], 'master', 'dev15.7', 'dev15.8')) - -# Publish packages to Azure Blob Storage -- task: MSBuild@1 - displayName: Publish packages to Azure Blob Storage - inputs: - solution: PublishToBlob.proj - msbuildArguments: '/t:Build /p:ExpectedFeedUrl=$(PB_PublishBlobFeedUrl) /p:AccountKey=$(PB_PublishBlobFeedKey) /p:ManifestBranch=$(SourceBranch) /p:ManifestCommit=$(SourceVersion) /p:ManifestBuildId=$(OfficialBuildId)' - condition: and(succeeded(), contains(variables['PB_PublishType'], 'blob')) - -# Run BinSkim -- task: securedevelopmentteam.vss-secure-development-tools.build-task-binskim.BinSkim@3 - displayName: Run BinSkim - inputs: - arguments: 'analyze "$(MSBuildConfiguration)\*.dll" "$(MSBuildConfiguration)\*.exe" --recurse --output "$(MSBuildConfiguration)\artifacts"' - continueOnError: true - -# Create static drop -- task: ms-vseng.MicroBuildTasks.bd4b789e-7292-4b73-a8ee-612d3dd615f1.MicroBuildStaticDrop@1 - displayName: Create static drop - inputs: - CopyRoot: '$(MSBuildConfiguration)' - Contents: '**' - ArtifactName: Binaries - TargetPath: '$(DropRoot)\$(Build.DefinitionName)\$(Build.SourceBranchName)\$(Build.BuildNumber)\Binaries' - condition: and(succeeded(), contains(variables['PB_PublishType'], 'drop')) - -# Publish symbols -- task: PublishSymbols@1 - displayName: Publish symbols - inputs: - SymbolsPath: '$(DropRoot)\$(Build.DefinitionName)\$(Build.SourceBranchName)\$(Build.BuildNumber)\Symbols' - SearchPattern: '**\*.dll;**\*.exe;**\*.pdb' - SymbolsFolder: '$(Build.SourcesDirectory)\$(MSBuildConfiguration)' - TreatNotIndexedAsWarning: true - SymbolsProduct: '$(Build.DefinitionName)' - SymbolsVersion: '$(Build.BuildNumber)' - continueOnError: true - condition: and(succeeded(), contains(variables['PB_PublishType'], 'symbols')) - -# Upload VSTS Drop -- task: ms-vseng.MicroBuildTasks.4305a8de-ba66-4d8b-b2d1-0dc4ecbbf5e8.MicroBuildUploadVstsDropFolder@1 - displayName: Upload VSTS Drop - inputs: - DropFolder: '$(Build.SourcesDirectory)\$(MSBuildConfiguration)\insertion' - condition: and(succeeded(), contains(variables['PB_PublishType'], 'vsts')) - -# Execute cleanup tasks -- task: ms-vseng.MicroBuildTasks.521a94ea-9e68-468a-8167-6dcf361ea776.MicroBuildCleanup@1 - displayName: Execute cleanup tasks - condition: succeededOrFailed() - -# Publish Artifact: MicroBuildOutputs -- task: PublishBuildArtifacts@1 - displayName: 'Publish Artifact: MicroBuildOutputs' - inputs: - PathtoPublish: '$(Build.StagingDirectory)\MicroBuild\Output' - ArtifactName: MicroBuildOutputs - publishLocation: Container - condition: and(succeeded(), contains(variables['PB_PublishType'], 'microbuild')) - -# Publish Symbols to Symweb -- task: ms-vscs-artifact.build-tasks.artifactSymbolTask-1.artifactSymbolTask@0 - displayName: Publish symbols to SymWeb - inputs: - symbolServiceURI: 'https://microsoft.artifacts.visualstudio.com/DefaultCollection' - sourcePath: '$(DropRoot)\$(Build.DefinitionName)\$(Build.SourceBranchName)\$(Build.BuildNumber)\Symbols' - usePat: false - condition: and(succeeded(), contains(variables['PB_PublishType'], 'symweb')) diff --git a/.vsts-signed.yaml b/.vsts-signed.yaml index f7f4a4439d..4669581cb8 100644 --- a/.vsts-signed.yaml +++ b/.vsts-signed.yaml @@ -1,7 +1,7 @@ queue: name: VSEng-MicroBuildVS2017 timeoutInMinutes: 300 - demands: + demands: - visualstudio - DotNetFramework - msbuild From 54522b401a19fb0752f4f9598e6ec6e3947c23e3 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Tue, 31 Jul 2018 11:12:28 -0700 Subject: [PATCH 125/150] rename old YAML file --- .vsts-ci.yaml | 107 ---------------------------------------------- .vsts-signed.yaml | 2 +- 2 files changed, 1 insertion(+), 108 deletions(-) delete mode 100644 .vsts-ci.yaml diff --git a/.vsts-ci.yaml b/.vsts-ci.yaml deleted file mode 100644 index 6c76437dc2..0000000000 --- a/.vsts-ci.yaml +++ /dev/null @@ -1,107 +0,0 @@ -queue: - name: VSEng-MicroBuildVS2017 - timeoutInMinutes: 300 - demands: - - visualstudio - - DotNetFramework - - msbuild - -variables: - MSBuildConfiguration: 'Release' - -steps: -# Install Signing Plugin -- task: ms-vseng.MicroBuildTasks.30666190-6959-11e5-9f96-f56098202fef.MicroBuildSigningPlugin@1 - displayName: Install Signing Plugin - inputs: - signType: real - condition: and(succeeded(), in(variables['PB_SignType'], 'test', 'real')) - -# Install Swix Plugin -- task: ms-vseng.MicroBuildTasks.32f78468-e895-4f47-962c-58a699361df8.MicroBuildSwixPlugin@1 - displayName: Install Swix Plugin - -# Run build.cmd -- task: CmdLine@1 - displayName: Run build.cmd - inputs: - filename: build.cmd - arguments: microbuild - -# Publish nightly package to MyGet -- task: PowerShell@1 - displayName: Publish nightly package to MyGet - inputs: - scriptName: 'setup\publish-assets.ps1' - arguments: '-binariesPath $(MSBuildConfiguration) -branchName $(Build.SourceBranch) -apiKey $(FSharp.MyGetApiKey)' - condition: and(succeeded(), contains(variables['PB_PublishType'], 'myget'), in(variables['Build.SourceBranchName'], 'master', 'dev15.7', 'dev15.8')) - -# Publish packages to Azure Blob Storage -- task: MSBuild@1 - displayName: Publish packages to Azure Blob Storage - inputs: - solution: PublishToBlob.proj - msbuildArguments: '/t:Build /p:ExpectedFeedUrl=$(PB_PublishBlobFeedUrl) /p:AccountKey=$(PB_PublishBlobFeedKey) /p:ManifestBranch=$(SourceBranch) /p:ManifestCommit=$(SourceVersion) /p:ManifestBuildId=$(OfficialBuildId)' - condition: and(succeeded(), contains(variables['PB_PublishType'], 'blob')) - -# Run BinSkim -- task: securedevelopmentteam.vss-secure-development-tools.build-task-binskim.BinSkim@3 - displayName: Run BinSkim - inputs: - arguments: 'analyze "$(MSBuildConfiguration)\*.dll" "$(MSBuildConfiguration)\*.exe" --recurse --output "$(MSBuildConfiguration)\artifacts"' - continueOnError: true - -# Create static drop -- task: PublishBuildArtifacts@1 - displayName: Create static drop - inputs: - PathtoPublish: '$(MSBuildConfiguration)' - ArtifactName: '$(Build.BuildNumber)' - publishLocation: FilePath - TargetPath: '$(DropRoot)\$(Build.DefinitionName)\$(Build.SourceBranchName)' - Parallel: true - ParallelCount: 64 - condition: and(succeeded(), contains(variables['PB_PublishType'], 'drop')) - -# Publish symbols -- task: PublishSymbols@1 - displayName: Publish symbols - inputs: - SymbolsPath: '$(DropRoot)\$(Build.DefinitionName)\$(Build.SourceBranchName)\$(Build.BuildNumber)\Symbols' - SearchPattern: '**\*.dll;**\*.exe;**\*.pdb' - SymbolsFolder: '$(Build.SourcesDirectory)\$(MSBuildConfiguration)' - TreatNotIndexedAsWarning: true - SymbolsProduct: '$(Build.DefinitionName)' - SymbolsVersion: '$(Build.BuildNumber)' - continueOnError: true - condition: and(succeeded(), contains(variables['PB_PublishType'], 'symbols')) - -# Upload VSTS Drop -- task: ms-vseng.MicroBuildTasks.4305a8de-ba66-4d8b-b2d1-0dc4ecbbf5e8.MicroBuildUploadVstsDropFolder@1 - displayName: Upload VSTS Drop - inputs: - DropFolder: '$(Build.SourcesDirectory)\$(MSBuildConfiguration)\insertion' - condition: and(succeeded(), contains(variables['PB_PublishType'], 'vsts')) - -# Execute cleanup tasks -- task: ms-vseng.MicroBuildTasks.521a94ea-9e68-468a-8167-6dcf361ea776.MicroBuildCleanup@1 - displayName: Execute cleanup tasks - condition: succeededOrFailed() - -# Publish Artifact: MicroBuildOutputs -- task: PublishBuildArtifacts@1 - displayName: 'Publish Artifact: MicroBuildOutputs' - inputs: - PathtoPublish: '$(Build.StagingDirectory)\MicroBuild\Output' - ArtifactName: MicroBuildOutputs - publishLocation: Container - condition: and(succeeded(), contains(variables['PB_PublishType'], 'microbuild')) - -# Publish Symbols to Symweb -- task: ms-vscs-artifact.build-tasks.artifactSymbolTask-1.artifactSymbolTask@0 - displayName: Publish symbols to SymWeb - inputs: - symbolServiceURI: 'https://microsoft.artifacts.visualstudio.com/DefaultCollection' - sourcePath: '$(DropRoot)\$(Build.DefinitionName)\$(Build.SourceBranchName)\$(Build.BuildNumber)\Symbols' - usePat: false - condition: and(succeeded(), contains(variables['PB_PublishType'], 'symweb')) diff --git a/.vsts-signed.yaml b/.vsts-signed.yaml index 6c76437dc2..6d5193b38c 100644 --- a/.vsts-signed.yaml +++ b/.vsts-signed.yaml @@ -1,7 +1,7 @@ queue: name: VSEng-MicroBuildVS2017 timeoutInMinutes: 300 - demands: + demands: - visualstudio - DotNetFramework - msbuild From e7f2bfc9779ab0ae7f23d1d71650c690913397e4 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Wed, 1 Aug 2018 16:32:00 -0700 Subject: [PATCH 126/150] netci.remoovy --- netci.groovy | 124 --------------------------------------------------- 1 file changed, 124 deletions(-) delete mode 100644 netci.groovy diff --git a/netci.groovy b/netci.groovy deleted file mode 100644 index 3352243365..0000000000 --- a/netci.groovy +++ /dev/null @@ -1,124 +0,0 @@ -import jobs.generation.Utilities; -import jobs.generation.JobReport; - -def project = GithubProject -def branch = GithubBranchName - -def osList = ['Windows_NT', 'Ubuntu16.04'] //, 'OSX'], 'CentOS7.1' - -def static getBuildJobName(def configuration, def os) { - return configuration.toLowerCase() + '_' + os.toLowerCase() -} - -[true, false].each { isPullRequest -> - osList.each { os -> - def configurations = []; - if (os == 'Windows_NT') { - configurations = ['Debug_default', 'Release_ci_part1', 'Release_ci_part2', 'Release_ci_part3', 'Release_ci_part4', 'Release_net40_no_vs', 'Release_fcs' ]; - } - else - { - // Linux - // TODO: It should be possible to enable these configurations immediately subsequent to the PR containing this line - //configurations = ['Debug_default', 'Release_net40_test', 'Release_fcs' ]; - configurations = [ 'Release_default', 'Release_fcs' ]; - } - - configurations.each { configuration -> - - def jobName = getBuildJobName(configuration, os) - def buildCommand = ''; - def buildOutput= ''; - def buildArgs= ''; - - if (configuration == "Release_fcs" && branch != "dev15.5") { - // Build and test FCS NuGet package - buildOutput = "release" - if (os == 'Windows_NT') { - buildCommand = ".\\fcs\\build.cmd TestAndNuget" - } - else { - buildCommand = "./fcs/cibuild.sh Build" - } - } - else if (configuration == "Debug_default") { - buildOutput = "debug" - if (os == 'Windows_NT') { - buildCommand = "build.cmd debug" - } - else { - buildCommand = "./mono/cibuild.sh debug" - } - } - else if (configuration == "Release_default") { - buildOutput = "release" - if (os == 'Windows_NT') { - buildCommand = "build.cmd release" - } - else { - buildCommand = "./mono/cibuild.sh release" - } - } - else if (configuration == "Release_net40_test") { - buildOutput = "release" - buildCommand = "build.cmd release net40 test" - } - else if (configuration == "Release_ci_part1") { - buildOutput = "release" - buildCommand = "build.cmd release ci_part1" - } - else if (configuration == "Release_ci_part2") { - buildOutput = "release" - buildCommand = "build.cmd release ci_part2" - } - else if (configuration == "Release_ci_part3") { - buildOutput = "release" - buildCommand = "build.cmd release ci_part3" - } - else if (configuration == "Release_ci_part4") { - buildOutput = "release" - buildCommand = "build.cmd release ci_part4" - } - else if (configuration == "Release_net40_no_vs") { - buildOutput = "release" - buildCommand = "build.cmd release net40" - } - - - def newJobName = Utilities.getFullJobName(project, jobName, isPullRequest) - def newJob = job(newJobName) { - steps { - if (os == 'Windows_NT') { - batchFile(buildCommand) - } - else { - shell(buildCommand) - } - } - } - - // TODO: set to false after tests are fully enabled - def skipIfNoTestFiles = true - def skipIfNoBuildOutput = false - - // outer-latest = "sudo is enabled by default" - // latest-or-auto = "sudo is not enabled" - // - // https://github.com/Microsoft/visualfsharp/pull/4372#issuecomment-367850885 - def affinity = (configuration == 'Release_net40_no_vs' ? 'latest-or-auto' : (os == 'Windows_NT' ? 'latest-dev15-5' : 'outer-latest')) - Utilities.setMachineAffinity(newJob, os, affinity) - Utilities.standardJobSetup(newJob, project, isPullRequest, "*/${branch}") - - Utilities.addArchival(newJob, "tests/TestResults/*.*", "", skipIfNoTestFiles, false) - Utilities.addArchival(newJob, "${buildOutput}/**", "", skipIfNoBuildOutput, false) - if (isPullRequest) { - Utilities.addGithubPRTriggerForBranch(newJob, branch, "${os} ${configuration} Build") - } - else { - Utilities.addGithubPushTrigger(newJob) - } - } - } -} - -JobReport.Report.generateJobReport(out) From 0c50721872f4fd2432da234d322816b3cc99e12a Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Thu, 2 Aug 2018 01:01:51 -0700 Subject: [PATCH 127/150] [WIP] --- rework msbuild dependencies (#5425) Rework msbuild dependencies --- DotnetCLIToolsVersion.txt | 2 +- build.cmd | 30 +- build/config/AssemblySignToolData.json | 3 - build/config/InsertionSignToolData.json | 2 - build/targets/AssemblyVersions.props | 2 + build/targets/PackageVersions.props | 10 +- packages.config | 15 +- .../Swix/Microsoft.FSharp.Compiler/Files.swr | 2 - setup/packages.config | 5 +- src/FSharp.Profiles.props | 1 - src/FSharpSource.Settings.targets | 18 +- .../FSharp.Compiler.Private/.gitignore | 1 + .../FSharp.Compiler.Private/FSComp.fs | 10 +- .../FSharp.Compiler.Private/FSComp.resx | 10 +- .../targets/PackageVersions.props | 4 +- .../FSharp.Build-proto.fsproj | 37 +- src/fsharp/FSharp.Build/FSharp.Build.fsproj | 26 +- .../FSharp.Compiler.Private.fsproj | 33 +- .../FSharp.Compiler.Private.netcore.nuspec | 4 +- .../FSharp.Compiler.Private/project.json | 4 +- .../Microsoft.FSharp.Compiler.nuspec | 4 +- .../Testing.FSharp.Compiler.nuspec | 4 +- src/fsharp/Fsc-proto/Fsc-proto.fsproj | 28 +- src/fsharp/Fsc-proto/app.config | 6 - src/fsharp/Fsc/Fsc.fsproj | 2 + src/fsharp/Fsc/app.config | 4 - src/fsharp/fsi/Fsi.fsproj | 1 + src/fsharp/fsi/app.config | 4 - src/fsharp/fsiAnyCpu/FsiAnyCPU.fsproj | 1 + src/fsharp/fsiAnyCpu/app.config | 4 - .../FSharp.Build.UnitTests.fsproj | 25 +- .../FSharp.Compiler.Unittests.fsproj | 2 +- .../FSharp.Core.Unittests.fsproj | 2 +- tests/FSharp.Core.UnitTests/project.json | 2 +- tests/fsharp/FSharp.Tests.FSharpSuite.fsproj | 4 +- tests/fsharp/app.config | 2 +- tests/fsharp/packages.config | 4 +- .../src/HostedCompilerServer/App.config | 2 +- .../HostedCompilerServer.fsproj | 2 +- vsintegration/Directory.Build.props | 2 + vsintegration/Directory.Build.targets | 21 +- .../LanguageServiceProfiling.fsproj | 1 - .../VisualFSharpFull/VisualFSharpFull.csproj | 10 - .../VisualFSharpTemplates.csproj | 1 - .../src/FSharp.Editor/FSharp.Editor.fsproj | 2 - .../FSharp.LanguageService.Base.csproj | 1 - .../FSharp.LanguageService.fsproj | 1 - .../FSharp.PatternMatcher.csproj | 5 - .../Project/ProjectBase.files | 32 +- .../Project/ProjectFactory.cs | 530 +----------------- .../Project/ProjectSystem.Base.csproj | 2 +- .../FSharp.ProjectSystem.FSharp.dll.config | 19 - .../ProjectSystem.fsproj | 2 - .../FSharp.PropertiesPages.vbproj | 1 + .../FSharp.UIResources.csproj | 1 - .../src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj | 1 - .../tests/GetTypesVSUnitTests/App.config | 13 + .../GetTypesVSUnitTests.fsproj | 3 + .../tests/Salsa/VisualFSharp.Salsa.fsproj | 1 - vsintegration/tests/UnitTests/App.config | 39 +- .../Tests.ProjectSystem.UpToDate.fs | 4 + .../UnitTests/VisualFSharp.UnitTests.fsproj | 3 +- 62 files changed, 253 insertions(+), 764 deletions(-) delete mode 100644 vsintegration/src/FSharp.ProjectSystem.FSharp/FSharp.ProjectSystem.FSharp.dll.config create mode 100644 vsintegration/tests/GetTypesVSUnitTests/App.config diff --git a/DotnetCLIToolsVersion.txt b/DotnetCLIToolsVersion.txt index bdf337873d..6e840019a3 100644 --- a/DotnetCLIToolsVersion.txt +++ b/DotnetCLIToolsVersion.txt @@ -1 +1 @@ -2.1.300-rtm-008707 + 2.1.400-preview-009197 diff --git a/build.cmd b/build.cmd index 4d1f623857..89f6361eb1 100644 --- a/build.cmd +++ b/build.cmd @@ -556,7 +556,7 @@ echo. echo ---------------- Done with arguments, starting preparation ----------------- -set BuildToolsPackage=Microsoft.VSSDK.BuildTools.15.1.192 +set BuildToolsPackage=Microsoft.VSSDK.BuildTools.15.6.170 if "%VSSDKInstall%"=="" ( set VSSDKInstall=%~dp0packages\%BuildToolsPackage%\tools\vssdk ) @@ -717,6 +717,8 @@ if "%BUILD_PROTO_WITH_CORECLR_LKG%" == "1" ( ) echo ---------------- Done with package restore, starting proto ------------------------ +set logdir=%~dp0%BUILD_CONFIG%\logs +if not exist "!logdir!" mkdir "!logdir!" rem Build Proto if "%BUILD_PROTO%" == "1" ( @@ -724,8 +726,8 @@ if "%BUILD_PROTO%" == "1" ( if "%BUILD_PROTO_WITH_CORECLR_LKG%" == "1" ( - echo %_msbuildexe% %msbuildflags% src\fsharp-proto-build.proj /p:BUILD_PROTO_WITH_CORECLR_LKG=%BUILD_PROTO_WITH_CORECLR_LKG% /p:Configuration=Proto /p:DisableLocalization=true /bl:artifacts\protobuild-net40.build.binlog - %_msbuildexe% %msbuildflags% src\fsharp-proto-build.proj /p:BUILD_PROTO_WITH_CORECLR_LKG=%BUILD_PROTO_WITH_CORECLR_LKG% /p:Configuration=Proto /p:DisableLocalization=true /bl:artifacts\protobuild-net40.build.binlog + echo %_msbuildexe% %msbuildflags% src\fsharp-proto-build.proj /p:BUILD_PROTO_WITH_CORECLR_LKG=%BUILD_PROTO_WITH_CORECLR_LKG% /p:Configuration=Proto /p:DisableLocalization=true /bl:%~dp0%BUILD_CONFIG%\logs\protobuild-coreclr.build.binlog + %_msbuildexe% %msbuildflags% src\fsharp-proto-build.proj /p:BUILD_PROTO_WITH_CORECLR_LKG=%BUILD_PROTO_WITH_CORECLR_LKG% /p:Configuration=Proto /p:DisableLocalization=true /bl:%~dp0%BUILD_CONFIG%\logs\protobuild-coreclr.build.binlog @if ERRORLEVEL 1 echo Error: compiler proto build failed && goto :failure ) @@ -734,8 +736,8 @@ if "%BUILD_PROTO%" == "1" ( echo %_ngenexe% install packages\FSharp.Compiler.Tools.4.1.27\tools\fsc.exe /nologo %_ngenexe% install packages\FSharp.Compiler.Tools.4.1.27\tools\fsc.exe /nologo - echo %_msbuildexe% %msbuildflags% src\fsharp-proto-build.proj /p:BUILD_PROTO_WITH_CORECLR_LKG=%BUILD_PROTO_WITH_CORECLR_LKG% /p:Configuration=Proto /p:DisableLocalization=true /bl:artifacts\protobuild-coreclr.build.binlog - %_msbuildexe% %msbuildflags% src\fsharp-proto-build.proj /p:BUILD_PROTO_WITH_CORECLR_LKG=%BUILD_PROTO_WITH_CORECLR_LKG% /p:Configuration=Proto /p:DisableLocalization=true /bl:artifacts\protobuild-coreclr.build.binlog + echo %_msbuildexe% %msbuildflags% src\fsharp-proto-build.proj /p:BUILD_PROTO_WITH_CORECLR_LKG=%BUILD_PROTO_WITH_CORECLR_LKG% /p:Configuration=Proto /p:DisableLocalization=true /bl:%~dp0%BUILD_CONFIG%\logs\protobuild-net40.build.binlog + %_msbuildexe% %msbuildflags% src\fsharp-proto-build.proj /p:BUILD_PROTO_WITH_CORECLR_LKG=%BUILD_PROTO_WITH_CORECLR_LKG% /p:Configuration=Proto /p:DisableLocalization=true /bl:%~dp0%BUILD_CONFIG%\logs\protobuild-net40.build.binlog @if ERRORLEVEL 1 echo Error: compiler proto build failed && goto :failure ) @@ -758,8 +760,8 @@ if "%BUILD_PHASE%" == "1" ( echo %_msbuildexe% %msbuildflags% build-everything.proj /t:Restore %BUILD_DIAG% %_msbuildexe% %msbuildflags% build-everything.proj /t:Restore %BUILD_DIAG% - echo %_msbuildexe% %msbuildflags% build-everything.proj /p:Configuration=%BUILD_CONFIG% %BUILD_DIAG% /p:BUILD_PUBLICSIGN=%BUILD_PUBLICSIGN% /bl:artifacts\msbuild.build-everything.build.%BUILD_CONFIG%.binlog - %_msbuildexe% %msbuildflags% build-everything.proj /p:Configuration=%BUILD_CONFIG% %BUILD_DIAG% /p:BUILD_PUBLICSIGN=%BUILD_PUBLICSIGN% /bl:artifacts\msbuild.build-everything.build.%BUILD_CONFIG%.binlog + echo %_msbuildexe% %msbuildflags% build-everything.proj /p:Configuration=%BUILD_CONFIG% %BUILD_DIAG% /p:BUILD_PUBLICSIGN=%BUILD_PUBLICSIGN% /bl:%~dp0%BUILD_CONFIG%\logs\msbuild.build-everything.build.%BUILD_CONFIG%.binlog + %_msbuildexe% %msbuildflags% build-everything.proj /p:Configuration=%BUILD_CONFIG% %BUILD_DIAG% /p:BUILD_PUBLICSIGN=%BUILD_PUBLICSIGN% /bl:%~dp0%BUILD_CONFIG%\logs\msbuild.build-everything.build.%BUILD_CONFIG%.binlog @if ERRORLEVEL 1 echo Error build failed && goto :failure ) @@ -783,8 +785,8 @@ if not "%SIGN_TYPE%" == "" ( echo ---------------- Done with assembly signing, start package creation --------------- -echo %_msbuildexe% %msbuildflags% build-nuget-packages.proj /p:Configuration=%BUILD_CONFIG% /bl:artifacts\msbuild.build-nuget-packages.build.%BUILD_CONFIG%.binlog - %_msbuildexe% %msbuildflags% build-nuget-packages.proj /p:Configuration=%BUILD_CONFIG% /bl:artifacts\msbuild.build-nuget-packages.build.%BUILD_CONFIG%.binlog +echo %_msbuildexe% %msbuildflags% build-nuget-packages.proj /p:Configuration=%BUILD_CONFIG% /bl:%~dp0%BUILD_CONFIG%\logs\msbuild.build-nuget-packages.build.%BUILD_CONFIG%.binlog + %_msbuildexe% %msbuildflags% build-nuget-packages.proj /p:Configuration=%BUILD_CONFIG% /bl:%~dp0%BUILD_CONFIG%\logs\msbuild.build-nuget-packages.build.%BUILD_CONFIG%.binlog if ERRORLEVEL 1 echo Error building NuGet packages && goto :failure if not "%SIGN_TYPE%" == "" ( @@ -794,8 +796,8 @@ if not "%SIGN_TYPE%" == "" ( ) if "%BUILD_SETUP%" == "1" ( - echo %_msbuildexe% %msbuildflags% setup\build-insertion.proj /p:Configuration=%BUILD_CONFIG% /bl:artifacts\msbuild.build-insertion.build.%BUILD_CONFIG%.binlog - %_msbuildexe% %msbuildflags% setup\build-insertion.proj /p:Configuration=%BUILD_CONFIG% /bl:artifacts\msbuild.build-insertion.build.%BUILD_CONFIG%.binlog + echo %_msbuildexe% %msbuildflags% setup\build-insertion.proj /p:Configuration=%BUILD_CONFIG% /bl:%~dp0%BUILD_CONFIG%\logs\msbuild.build-insertion.build.%BUILD_CONFIG%.binlog + %_msbuildexe% %msbuildflags% setup\build-insertion.proj /p:Configuration=%BUILD_CONFIG% /bl:%~dp0%BUILD_CONFIG%\logs\msbuild.build-insertion.build.%BUILD_CONFIG%.binlog if ERRORLEVEL 1 echo Error building insertion packages && goto :failure ) @@ -808,8 +810,8 @@ if not "%SIGN_TYPE%" == "" ( echo ---------------- Done with signing, building insertion files --------------- if "%BUILD_SETUP%" == "1" ( - echo %_msbuildexe% %msbuildflags% setup\Swix\Microsoft.FSharp.vsmanproj /p:Configuration=%BUILD_CONFIG% /bl:artifacts\msbuild.setup-swix.build.%BUILD_CONFIG%.binlog - %_msbuildexe% %msbuildflags% setup\Swix\Microsoft.FSharp.vsmanproj /p:Configuration=%BUILD_CONFIG% /bl:artifacts\msbuild.setup-swix.build.%BUILD_CONFIG%.binlog + echo %_msbuildexe% %msbuildflags% setup\Swix\Microsoft.FSharp.vsmanproj /p:Configuration=%BUILD_CONFIG% /bl:%~dp0%BUILD_CONFIG%\logs\msbuild.setup-swix.build.%BUILD_CONFIG%.binlog + %_msbuildexe% %msbuildflags% setup\Swix\Microsoft.FSharp.vsmanproj /p:Configuration=%BUILD_CONFIG% /bl:%~dp0%BUILD_CONFIG%\logs\msbuild.setup-swix.build.%BUILD_CONFIG%.binlog if ERRORLEVEL 1 echo Error building .vsmanproj && goto :failure ) @@ -1183,6 +1185,8 @@ if "%TEST_VS_IDEUNIT_SUITE%" == "1" ( type "!ERRORFILE!" echo -------end vs-ide-unit errors ------------------------ echo Error: Running tests vs-ideunit failed, see logs above, search for "Errors and Failures" -- FAILED + echo Command Line for running tests + echo "!NUNIT3_CONSOLE!" --verbose --x86 --framework:V4.0 --result:"!XMLFILE!;format=nunit3" !OUTPUTARG! !ERRORARG! --work:"!FSCBINPATH!" --workers=1 --agents=1 --full "!FSCBINPATH!\VisualFSharp.UnitTests.dll" !WHERE_ARG_NUNIT! echo ---------------------------------------------------------------------------------------------------- goto :failure ) diff --git a/build/config/AssemblySignToolData.json b/build/config/AssemblySignToolData.json index 4adf89a4ca..7f2e96af1a 100644 --- a/build/config/AssemblySignToolData.json +++ b/build/config/AssemblySignToolData.json @@ -58,16 +58,13 @@ ], "exclude": [ "FSharp.Data.TypeProviders.dll", - "Microsoft.Build.Conversion.Core.dll", "Microsoft.Build.dll", - "Microsoft.Build.Engine.dll", "Microsoft.Build.Framework.dll", "Microsoft.Build.Tasks.Core.dll", "Microsoft.Build.Utilities.Core.dll", "Newtonsoft.Json.dll", "System.Collections.Immutable.dll", "System.Reflection.Metadata.dll", - "System.ValueTuple.4.3.1.nupkg", "System.ValueTuple.4.4.0.nupkg", "System.ValueTuple.dll" ] diff --git a/build/config/InsertionSignToolData.json b/build/config/InsertionSignToolData.json index 7c1815885d..ec8432ca9a 100644 --- a/build/config/InsertionSignToolData.json +++ b/build/config/InsertionSignToolData.json @@ -27,8 +27,6 @@ "fsiAnyCpu.exe", "FSharp.Data.TypeProviders.dll", "Microsoft.Build.dll", - "Microsoft.Build.Conversion.Core.dll", - "Microsoft.Build.Engine.dll", "Microsoft.Build.Framework.dll", "Microsoft.Build.Tasks.Core.dll", "Microsoft.Build.Utilities.Core.dll", diff --git a/build/targets/AssemblyVersions.props b/build/targets/AssemblyVersions.props index fb9dde7e23..533365487d 100644 --- a/build/targets/AssemblyVersions.props +++ b/build/targets/AssemblyVersions.props @@ -24,10 +24,12 @@ 4.4.3.0 10.1.1.0 10.1.4 + 15 7 $(VSMajorVersion).0 $(VSMajorVersion).$(VSMinorVersion).0.0 + $(FSCoreVersion) diff --git a/build/targets/PackageVersions.props b/build/targets/PackageVersions.props index 63137a9172..7a880552c7 100644 --- a/build/targets/PackageVersions.props +++ b/build/targets/PackageVersions.props @@ -6,8 +6,11 @@ $([System.IO.File]::ReadAllText('$(MSBuildThisFileDirectory)..\..\RoslynPackageVersion.txt').Trim()) - 1.3.1 + 1.4.0 + 4.3.0 1.5.0 + 1.5.0 + 4.3.0 $(RoslynPackageVersion) @@ -27,7 +30,7 @@ 8.0.1 14.0.25420 - 15.6.27740 + 15.6.27740 15.0.26201-alpha 1.1.4322 15.0.26201 @@ -60,10 +63,11 @@ 12.0.30112 15.6.27740 15.6.27740 + 15.3.23 15.0.26201 15.3.15 9.0.30729 - 15.1.192 + 15.6.170 12.0.4 7.0.4 8.0.4 diff --git a/packages.config b/packages.config index f5c44bd294..bd4c73fc8a 100644 --- a/packages.config +++ b/packages.config @@ -15,16 +15,21 @@ - - - + + + - + + + + + + @@ -36,7 +41,7 @@ - + diff --git a/setup/Swix/Microsoft.FSharp.Compiler/Files.swr b/setup/Swix/Microsoft.FSharp.Compiler/Files.swr index daa7eae6d6..8a4f3d1dce 100644 --- a/setup/Swix/Microsoft.FSharp.Compiler/Files.swr +++ b/setup/Swix/Microsoft.FSharp.Compiler/Files.swr @@ -18,9 +18,7 @@ folder "InstallDir:Common7\IDE\CommonExtensions\Microsoft\FSharp" file source="$(BinariesFolder)\net40\bin\fsi.exe.config" file source="$(BinariesFolder)\net40\bin\fsiAnyCpu.exe" vs.file.ngen=yes file source="$(BinariesFolder)\net40\bin\fsiAnyCpu.exe.config" - file source="$(BinariesFolder)\net40\bin\Microsoft.Build.Conversion.Core.dll" file source="$(BinariesFolder)\net40\bin\Microsoft.Build.dll" - file source="$(BinariesFolder)\net40\bin\Microsoft.Build.Engine.dll" file source="$(BinariesFolder)\net40\bin\Microsoft.Build.Framework.dll" file source="$(BinariesFolder)\net40\bin\Microsoft.Build.Tasks.Core.dll" file source="$(BinariesFolder)\net40\bin\Microsoft.Build.Utilities.Core.dll" diff --git a/setup/packages.config b/setup/packages.config index f62527d8ca..56b0bfb939 100644 --- a/setup/packages.config +++ b/setup/packages.config @@ -1,14 +1,13 @@ - - + + - diff --git a/src/FSharp.Profiles.props b/src/FSharp.Profiles.props index 02df84da82..915781c953 100644 --- a/src/FSharp.Profiles.props +++ b/src/FSharp.Profiles.props @@ -50,7 +50,6 @@ $(DefineConstants);FX_JITTRACKING_ISSUE $(DefineConstants);FX_NO_INDENTED_TEXT_WRITER $(DefineConstants);FX_RESHAPED_REFLECTION_CORECLR - $(DefineConstants);FX_RESHAPED_MSBUILD $(DefineConstants);FSI_TODO_NETCORE $(OtherFlags) --simpleresolution diff --git a/src/FSharpSource.Settings.targets b/src/FSharpSource.Settings.targets index 595bcccef8..7be98c2d47 100644 --- a/src/FSharpSource.Settings.targets +++ b/src/FSharpSource.Settings.targets @@ -19,6 +19,7 @@ + @@ -33,13 +34,6 @@ true - 15.0.26201 - 1.3.1 - Microsoft.VSSDK.BuildTools.15.1.192 - - 15.3.23 - 15.3.15 - obj\$(Configuration)\$(TargetDotnetProfile)\ obj\$(Configuration)\$(TargetDotnetProfile)\$(PortableProfileBeingReferenced)\ @@ -90,11 +84,11 @@ true false true - $(MSBuildThisFileDirectory)..\packages\$(VSSDK_BUILDTOOLS_VERSION)\tools\vssdk - $(MSBuildThisFileDirectory)..\packages\$(VSSDK_BUILDTOOLS_VERSION)\tools\vssdk\bin - $(MSBuildThisFileDirectory)..\packages\$(VSSDK_BUILDTOOLS_VERSION)\tools\vssdk\Microsoft.VsSDK.targets - $(MSBuildThisFileDirectory)..\packages\$(VSSDK_BUILDTOOLS_VERSION)\tools\vssdk\inc - $(MSBuildThisFileDirectory)..\packages\$(VSSDK_BUILDTOOLS_VERSION)\tools\vssdk\schemas\VSIXManifestSchema.xsd + $(MSBuildThisFileDirectory)..\packages\Microsoft.VSSDK.BuildTools.$(MicrosoftVSSDKBuildToolsPackageVersion)\tools\vssdk + $(MSBuildThisFileDirectory)..\packages\Microsoft.VSSDK.BuildTools.$(MicrosoftVSSDKBuildToolsPackageVersion)\tools\vssdk\bin + $(MSBuildThisFileDirectory)..\packages\Microsoft.VSSDK.BuildTools.$(MicrosoftVSSDKBuildToolsPackageVersion)\tools\vssdk\Microsoft.VsSDK.targets + $(MSBuildThisFileDirectory)..\packages\Microsoft.VSSDK.BuildTools.$(MicrosoftVSSDKBuildToolsPackageVersion)\tools\vssdk\inc + $(MSBuildThisFileDirectory)..\packages\Microsoft.VSSDK.BuildTools.$(MicrosoftVSSDKBuildToolsPackageVersion)\tools\vssdk\schemas\VSIXManifestSchema.xsd diff --git a/src/buildfromsource/FSharp.Compiler.Private/.gitignore b/src/buildfromsource/FSharp.Compiler.Private/.gitignore index fa6bb93f54..510ecbe0b2 100644 --- a/src/buildfromsource/FSharp.Compiler.Private/.gitignore +++ b/src/buildfromsource/FSharp.Compiler.Private/.gitignore @@ -7,3 +7,4 @@ pars.fsi pplex.fs pppars.fs pppars.fsi +FSComp.*.resources diff --git a/src/buildfromsource/FSharp.Compiler.Private/FSComp.fs b/src/buildfromsource/FSharp.Compiler.Private/FSComp.fs index c8eb953fea..969a949408 100644 --- a/src/buildfromsource/FSharp.Compiler.Private/FSComp.fs +++ b/src/buildfromsource/FSharp.Compiler.Private/FSComp.fs @@ -163,22 +163,22 @@ type internal SR private() = /// Add . for indexer access. /// (Originally from ..\FSComp.txt:19) static member addIndexerDot() = (GetStringFunc("addIndexerDot",",,,") ) - /// All elements of a list constructor expression must have the same type. The first element has type '%s', but there is also an element of type '%s'. + /// All elements of a list must be of the same type as the first element, which here is '%s'. This element has type '%s'. /// (Originally from ..\FSComp.txt:20) static member listElementHasWrongType(a0 : System.String, a1 : System.String) = (GetStringFunc("listElementHasWrongType",",,,%s,,,%s,,,") a0 a1) - /// All elements of an array constructor expression must have the same type. The first element has type '%s', but there is also an element of type '%s'. + /// All elements of an array must be of the same type as the first element, which here is '%s'. This element has type '%s'. /// (Originally from ..\FSComp.txt:21) static member arrayElementHasWrongType(a0 : System.String, a1 : System.String) = (GetStringFunc("arrayElementHasWrongType",",,,%s,,,%s,,,") a0 a1) - /// The 'if' expression is missing an 'else' branch. Because 'if' is an expression, and not a statement, add an 'else' branch which returns a value of the same type as the first branch ('%s'). + /// This 'if' expression is missing an 'else' branch. Because 'if' is an expression, and not a statement, add an 'else' branch which also returns a value of type '%s'. /// (Originally from ..\FSComp.txt:22) static member missingElseBranch(a0 : System.String) = (GetStringFunc("missingElseBranch",",,,%s,,,") a0) /// The 'if' expression needs to have type '%s' to satisfy context type requirements. It currently has type '%s'. /// (Originally from ..\FSComp.txt:23) static member ifExpression(a0 : System.String, a1 : System.String) = (GetStringFunc("ifExpression",",,,%s,,,%s,,,") a0 a1) - /// All branches of an 'if' expression must return values of the same type. The first branch returned a value of type '%s', but this branch returned a value of type '%s'. + /// All branches of an 'if' expression must return values of the same type as the first branch, which here is '%s'. This branch returns a value of type '%s'. /// (Originally from ..\FSComp.txt:24) static member elseBranchHasWrongType(a0 : System.String, a1 : System.String) = (GetStringFunc("elseBranchHasWrongType",",,,%s,,,%s,,,") a0 a1) - /// All branches of a pattern match expression must return values of the same type. The first branch returned a value of type '%s', but this branch returned a value of type '%s'. + /// All branches of a pattern match expression must return values of the same type as the first branch, which here is '%s'. This branch returns a value of type '%s'. /// (Originally from ..\FSComp.txt:25) static member followingPatternMatchClauseHasWrongType(a0 : System.String, a1 : System.String) = (GetStringFunc("followingPatternMatchClauseHasWrongType",",,,%s,,,%s,,,") a0 a1) /// A pattern match guard must be of type 'bool', but this 'when' expression is of type '%s'. diff --git a/src/buildfromsource/FSharp.Compiler.Private/FSComp.resx b/src/buildfromsource/FSharp.Compiler.Private/FSComp.resx index 535542cd9f..1c591492fa 100644 --- a/src/buildfromsource/FSharp.Compiler.Private/FSComp.resx +++ b/src/buildfromsource/FSharp.Compiler.Private/FSComp.resx @@ -166,22 +166,22 @@ Add . for indexer access. - All elements of a list constructor expression must have the same type. This expression was expected to have type '{0}', but here has type '{1}'. + All elements of a list must be of the same type as the first element, which here is '{0}'. This element has type '{1}'. - All elements of an array constructor expression must have the same type. This expression was expected to have type '{0}', but here has type '{1}'. + All elements of an array must be of the same type as the first element, which here is '{0}'. This element has type '{1}'. - The 'if' expression is missing an 'else' branch. The 'then' branch has type '{0}'. Because 'if' is an expression, and not a statement, add an 'else' branch which returns a value of the same type. + This 'if' expression is missing an 'else' branch. Because 'if' is an expression, and not a statement, add an 'else' branch which also returns a value of type '{0}'. The 'if' expression needs to have type '{0}' to satisfy context type requirements. It currently has type '{1}'. - All branches of an 'if' expression must have the same type. This expression was expected to have type '{0}', but here has type '{1}'. + All branches of an 'if' expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. - All branches of a pattern match expression must return values of the same type. The first branch returned a value of type '{0}', but this branch returned a value of type '{1}'. + All branches of a pattern match expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. A pattern match guard must be of type 'bool', but this 'when' expression is of type '{0}'. diff --git a/src/buildfromsource/targets/PackageVersions.props b/src/buildfromsource/targets/PackageVersions.props index 1186f2bf36..e4f39318ba 100644 --- a/src/buildfromsource/targets/PackageVersions.props +++ b/src/buildfromsource/targets/PackageVersions.props @@ -3,14 +3,14 @@ - 1.3.1 + 1.4.0 4.3.0 4.3.0 4.3.0 4.3.0 4.3.0 4.3.0 - 1.4.2 + 1.5.0 4.3.0 4.3.0 4.3.0 diff --git a/src/fsharp/FSharp.Build-proto/FSharp.Build-proto.fsproj b/src/fsharp/FSharp.Build-proto/FSharp.Build-proto.fsproj index fa539c3c2b..1bae3eda98 100644 --- a/src/fsharp/FSharp.Build-proto/FSharp.Build-proto.fsproj +++ b/src/fsharp/FSharp.Build-proto/FSharp.Build-proto.fsproj @@ -6,7 +6,9 @@ Proto AnyCPU + + Library FSharp.Build @@ -54,6 +56,9 @@ Microsoft.FSharp.Overrides.NetSdk.targets + + Microsoft.VisualFSharp.Type.Providers.Redist + @@ -63,22 +68,24 @@ - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.Framework.dll + + $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Framework.$(MicrosoftBuildFrameworkPackageVersion)\lib\net46\Microsoft.Build.Framework.dll - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.dll + + $(FSharpSourcesRoot)\..\packages\Microsoft.Build.$(MicrosoftBuildPackageVersion)\lib\net46\Microsoft.Build.dll - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.Utilities.Core.dll + + $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Utilities.Core.$(MicrosoftBuildUtilitiesCorePackageVersion)\lib\net46\Microsoft.Build.Utilities.Core.dll - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.Tasks.Core.dll + + $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Tasks.Core.$(MicrosoftBuildTasksCorePackageVersion)\lib\net46\Microsoft.Build.Tasks.Core.dll + + + $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Tasks.Core.$(MicrosoftBuildTasksCorePackageVersion)\lib\net46\Microsoft.Build.Tasks.Core.dll + + + $(FSharpSourcesRoot)\..\packages\System.IO.Compression.$(SystemIoCompressionPackageVersion)\lib\net46\System.IO.Compression.dll - - {DED3BBD7-53F4-428A-8C9F-27968E768605} - FSharp.Core - @@ -94,5 +101,11 @@ $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Tasks.Core.14.3.0\lib\net45\Microsoft.Build.Tasks.Core.dll + + + {DED3BBD7-53F4-428A-8C9F-27968E768605} + FSharp.Core + + diff --git a/src/fsharp/FSharp.Build/FSharp.Build.fsproj b/src/fsharp/FSharp.Build/FSharp.Build.fsproj index dd8adb83f5..81876081b5 100644 --- a/src/fsharp/FSharp.Build/FSharp.Build.fsproj +++ b/src/fsharp/FSharp.Build/FSharp.Build.fsproj @@ -6,7 +6,9 @@ FSharp true + + Debug AnyCPU @@ -38,6 +40,7 @@ + @@ -47,20 +50,23 @@ - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.Framework.dll + + $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Framework.$(MicrosoftBuildFrameworkPackageVersion)\lib\net46\Microsoft.Build.Framework.dll + + + $(FSharpSourcesRoot)\..\packages\Microsoft.Build.$(MicrosoftBuildPackageVersion)\lib\net46\Microsoft.Build.dll - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.dll + + $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Utilities.Core.$(MicrosoftBuildUtilitiesCorePackageVersion)\lib\net46\Microsoft.Build.Utilities.Core.dll - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.Utilities.Core.dll + + $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Tasks.Core.$(MicrosoftBuildTasksCorePackageVersion)\lib\net46\Microsoft.Build.Tasks.Core.dll - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.Tasks.Core.dll + + $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Tasks.Core.$(MicrosoftBuildTasksCorePackageVersion)\lib\net46\Microsoft.Build.Tasks.Core.dll - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Type.Providers.Redist.$(MicrosoftVisualFSharpTypeProvidersRedistPackageVersion)\content\4.3.0.0\FSharp.Data.TypeProviders.dll + + $(FSharpSourcesRoot)\..\packages\System.IO.Compression.$(SystemIoCompressionPackageVersion)\lib\net46\System.IO.Compression.dll diff --git a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj index 989a9970ee..1c2ce9e86a 100644 --- a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj +++ b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj @@ -25,8 +25,6 @@ - - @@ -675,28 +673,37 @@ - ..\..\..\packages\System.Reflection.Metadata.1.4.2\lib\portable-net45+win8\System.Reflection.Metadata.dll + ..\..\..\packages\System.Reflection.Metadata.$(SystemReflectionMetadataPackageVersion)\lib\portable-net45+win8\System.Reflection.Metadata.dll - ..\..\..\packages\System.Collections.Immutable.$(SystemCollectionsImmutableVersion)\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll + ..\..\..\packages\System.Collections.Immutable.$(SystemCollectionsImmutablePackageVersion)\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll - ..\..\..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll + ..\..\..\packages\System.ValueTuple.$(SystemValueTuplePackageVersion)\lib\netstandard1.0\System.ValueTuple.dll true - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.Framework.dll + + $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Framework.$(MicrosoftBuildFrameworkPackageVersion)\lib\net46\Microsoft.Build.Framework.dll - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.dll + + $(FSharpSourcesRoot)\..\packages\Microsoft.Build.$(MicrosoftBuildPackageVersion)\lib\net46\Microsoft.Build.dll - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.Utilities.Core.dll + + $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Utilities.Core.$(MicrosoftBuildUtilitiesCorePackageVersion)\lib\net46\Microsoft.Build.Utilities.Core.dll - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.Tasks.Core.dll + + $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Tasks.Core.$(MicrosoftBuildTasksCorePackageVersion)\lib\net46\Microsoft.Build.Tasks.Core.dll + + + $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Tasks.Core.$(MicrosoftBuildTasksCorePackageVersion)\lib\net46\Microsoft.Build.Tasks.Core.dll + + + $(FSharpSourcesRoot)\..\packages\System.IO.Compression.$(SystemIoCompressionPackageVersion)\lib\net46\System.IO.Compression.dll + + + $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Type.Providers.Redist.$(MicrosoftVisualFSharpTypeProvidersRedistPackageVersion)\content\4.3.0.0\FSharp.Data.TypeProviders.dll diff --git a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.netcore.nuspec b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.netcore.nuspec index 5f1ffaf131..687e2bf9a0 100644 --- a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.netcore.nuspec +++ b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.netcore.nuspec @@ -16,7 +16,7 @@ - + @@ -31,7 +31,7 @@ - + diff --git a/src/fsharp/FSharp.Compiler.Private/project.json b/src/fsharp/FSharp.Compiler.Private/project.json index 5a42750905..8cfa7c410a 100644 --- a/src/fsharp/FSharp.Compiler.Private/project.json +++ b/src/fsharp/FSharp.Compiler.Private/project.json @@ -1,7 +1,7 @@ { "dependencies": { "NETStandard.Library": "1.6.1", - "System.Collections.Immutable":"1.3.1", + "System.Collections.Immutable":"1.4.0", "System.Diagnostics.Process": "4.3.0", "System.Diagnostics.TraceSource": "4.3.0", "System.Linq.Expressions": "4.3.0", @@ -17,7 +17,7 @@ "System.Threading.Tasks.Parallel": "4.3.0", "System.Threading.Thread": "4.3.0", "System.Threading.ThreadPool": "4.3.0", - "System.ValueTuple": "4.4.0" + "System.ValueTuple": "4.3.0" }, "runtimes": { "win7-x86": { }, diff --git a/src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuspec b/src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuspec index e26b6dd36e..b8f85762b1 100644 --- a/src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuspec +++ b/src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuspec @@ -18,7 +18,7 @@ - + @@ -33,7 +33,7 @@ - + diff --git a/src/fsharp/FSharp.Compiler.nuget/Testing.FSharp.Compiler.nuspec b/src/fsharp/FSharp.Compiler.nuget/Testing.FSharp.Compiler.nuspec index e512806ebc..f67c5eb82a 100644 --- a/src/fsharp/FSharp.Compiler.nuget/Testing.FSharp.Compiler.nuspec +++ b/src/fsharp/FSharp.Compiler.nuget/Testing.FSharp.Compiler.nuspec @@ -16,7 +16,7 @@ - + @@ -31,7 +31,7 @@ - + diff --git a/src/fsharp/Fsc-proto/Fsc-proto.fsproj b/src/fsharp/Fsc-proto/Fsc-proto.fsproj index 4577e7535b..5cccf4f17a 100644 --- a/src/fsharp/Fsc-proto/Fsc-proto.fsproj +++ b/src/fsharp/Fsc-proto/Fsc-proto.fsproj @@ -461,13 +461,13 @@ - $(FSharpSourcesRoot)\..\packages\System.Reflection.Metadata.1.4.2\lib\portable-net45+win8\System.Reflection.Metadata.dll + $(FSharpSourcesRoot)\..\packages\System.Reflection.Metadata.$(SystemReflectionMetadataPackageVersion)\lib\portable-net45+win8\System.Reflection.Metadata.dll - $(FSharpSourcesRoot)\..\packages\System.Collections.Immutable.$(SystemCollectionsImmutableVersion)\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll + $(FSharpSourcesRoot)\..\packages\System.Collections.Immutable.$(SystemCollectionsImmutablePackageVersion)\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll - $(FSharpSourcesRoot)\..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll + $(FSharpSourcesRoot)\..\packages\System.ValueTuple.$(SystemValueTuplePackageVersion)\lib\netstandard1.0\System.ValueTuple.dll {DED3BBD7-53F4-428A-8C9F-27968E768605} @@ -475,17 +475,23 @@ - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.Framework.dll + + $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Framework.$(MicrosoftBuildFrameworkPackageVersion)\lib\net46\Microsoft.Build.Framework.dll - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.dll + + $(FSharpSourcesRoot)\..\packages\Microsoft.Build.$(MicrosoftBuildPackageVersion)\lib\net46\Microsoft.Build.dll - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.Utilities.Core.dll + + $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Utilities.Core.$(MicrosoftBuildUtilitiesCorePackageVersion)\lib\net46\Microsoft.Build.Utilities.Core.dll - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.Tasks.Core.dll + + $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Tasks.Core.$(MicrosoftBuildTasksCorePackageVersion)\lib\net46\Microsoft.Build.Tasks.Core.dll + + + $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Tasks.Core.$(MicrosoftBuildTasksCorePackageVersion)\lib\net46\Microsoft.Build.Tasks.Core.dll + + + $(FSharpSourcesRoot)\..\packages\System.IO.Compression.$(SystemIoCompressionPackageVersion)\lib\net46\System.IO.Compression.dll diff --git a/src/fsharp/Fsc-proto/app.config b/src/fsharp/Fsc-proto/app.config index 46b5e39962..dc90fef34d 100644 --- a/src/fsharp/Fsc-proto/app.config +++ b/src/fsharp/Fsc-proto/app.config @@ -1,11 +1,5 @@ - - - - - - diff --git a/src/fsharp/Fsc/Fsc.fsproj b/src/fsharp/Fsc/Fsc.fsproj index 9cb4d2df14..aa6c8eed8f 100644 --- a/src/fsharp/Fsc/Fsc.fsproj +++ b/src/fsharp/Fsc/Fsc.fsproj @@ -6,6 +6,7 @@ $(MSBuildProjectDirectory)\..\.. FSharp true + true @@ -21,6 +22,7 @@ $(NoWarn);62 fsc true + true $(OtherFlags) --warnon:1182 diff --git a/src/fsharp/Fsc/app.config b/src/fsharp/Fsc/app.config index 4e10e78a90..513fabfcba 100644 --- a/src/fsharp/Fsc/app.config +++ b/src/fsharp/Fsc/app.config @@ -8,10 +8,6 @@ - - - - diff --git a/src/fsharp/fsi/Fsi.fsproj b/src/fsharp/fsi/Fsi.fsproj index 91fa598e7c..ad16d0c001 100644 --- a/src/fsharp/fsi/Fsi.fsproj +++ b/src/fsharp/fsi/Fsi.fsproj @@ -5,6 +5,7 @@ $(MSBuildProjectDirectory)\..\.. FSharp true + true diff --git a/src/fsharp/fsi/app.config b/src/fsharp/fsi/app.config index 6409add7b6..2502e2a0a0 100644 --- a/src/fsharp/fsi/app.config +++ b/src/fsharp/fsi/app.config @@ -7,10 +7,6 @@ - - - - diff --git a/src/fsharp/fsiAnyCpu/FsiAnyCPU.fsproj b/src/fsharp/fsiAnyCpu/FsiAnyCPU.fsproj index c4d3bd1f4f..894178d18b 100644 --- a/src/fsharp/fsiAnyCpu/FsiAnyCPU.fsproj +++ b/src/fsharp/fsiAnyCpu/FsiAnyCPU.fsproj @@ -5,6 +5,7 @@ $(MSBuildProjectDirectory)\..\.. FSharp true + true diff --git a/src/fsharp/fsiAnyCpu/app.config b/src/fsharp/fsiAnyCpu/app.config index 75abd58318..da520a7267 100644 --- a/src/fsharp/fsiAnyCpu/app.config +++ b/src/fsharp/fsiAnyCpu/app.config @@ -8,10 +8,6 @@ - - - - diff --git a/tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj b/tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj index 0522cf51f5..93cf3dfa3b 100644 --- a/tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj +++ b/tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj @@ -43,17 +43,26 @@ - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.Framework.dll + + $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Framework.$(MicrosoftBuildFrameworkPackageVersion)\lib\net46\Microsoft.Build.Framework.dll - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.dll + + $(FSharpSourcesRoot)\..\packages\Microsoft.Build.$(MicrosoftBuildPackageVersion)\lib\net46\Microsoft.Build.dll - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.Utilities.Core.dll + + $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Utilities.Core.$(MicrosoftBuildUtilitiesCorePackageVersion)\lib\net46\Microsoft.Build.Utilities.Core.dll - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.Tasks.Core.dll + + $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Tasks.Core.$(MicrosoftBuildTasksCorePackageVersion)\lib\net46\Microsoft.Build.Tasks.Core.dll + + + $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Tasks.Core.$(MicrosoftBuildTasksCorePackageVersion)\lib\net46\Microsoft.Build.Tasks.Core.dll + + + $(FSharpSourcesRoot)\..\packages\System.IO.Compression.$(SystemIoCompressionPackageVersion)\lib\net46\System.IO.Compression.dll + + + $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Type.Providers.Redist.$(MicrosoftVisualFSharpTypeProvidersRedistPackageVersion)\content\4.3.0.0\FSharp.Data.TypeProviders.dll diff --git a/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.Unittests.fsproj b/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.Unittests.fsproj index 5357d4ffad..06b8a4b422 100644 --- a/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.Unittests.fsproj +++ b/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.Unittests.fsproj @@ -44,7 +44,7 @@ - ..\..\..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll + ..\..\..\packages\System.ValueTuple.$(SystemValueTuplePackageVersion)\lib\netstandard1.0\System.ValueTuple.dll diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core.Unittests.fsproj b/tests/FSharp.Core.UnitTests/FSharp.Core.Unittests.fsproj index aca29fe00a..b6148c0187 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core.Unittests.fsproj +++ b/tests/FSharp.Core.UnitTests/FSharp.Core.Unittests.fsproj @@ -52,7 +52,7 @@ $(FsCheckLibDir)\net452\FsCheck.dll - ..\..\packages\System.ValueTuple.4.4.0\lib\portable-net40+sl4+win8+wp8\System.ValueTuple.dll + ..\..\packages\System.ValueTuple.$(SystemValueTuplePackageVersion)\lib\portable-net40+sl4+win8+wp8\System.ValueTuple.dll True diff --git a/tests/FSharp.Core.UnitTests/project.json b/tests/FSharp.Core.UnitTests/project.json index 36a6823bf2..901129da26 100644 --- a/tests/FSharp.Core.UnitTests/project.json +++ b/tests/FSharp.Core.UnitTests/project.json @@ -8,7 +8,7 @@ "dependencies": { "nunit": "3.5.0", "nunitlite": "3.5.0", - "System.ValueTuple": "4.4.0", + "System.ValueTuple": "4.3.0", "FsCheck": "3.0.0-alpha3", "Testing.FSharp.Core": "4.2.4", "Microsoft.FSharp.TupleSample": "1.0.0-alpha-161112" diff --git a/tests/fsharp/FSharp.Tests.FSharpSuite.fsproj b/tests/fsharp/FSharp.Tests.FSharpSuite.fsproj index be325d2219..2ec2840bc8 100644 --- a/tests/fsharp/FSharp.Tests.FSharpSuite.fsproj +++ b/tests/fsharp/FSharp.Tests.FSharpSuite.fsproj @@ -47,11 +47,11 @@ - $(FSharpSourcesRoot)\..\packages\System.Collections.Immutable.$(SystemCollectionsImmutableVersion)\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll + $(FSharpSourcesRoot)\..\packages\System.Collections.Immutable.$(SystemCollectionsImmutablePackageVersion)\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll True - $(FSharpSourcesRoot)\..\packages\System.Reflection.Metadata.1.4.2\lib\portable-net45+win8\System.Reflection.Metadata.dll + $(FSharpSourcesRoot)\..\packages\System.Reflection.Metadata.$(SystemReflectionMetadataPackageVersion)\lib\portable-net45+win8\System.Reflection.Metadata.dll True diff --git a/tests/fsharp/app.config b/tests/fsharp/app.config index bd1c9c33df..4d982a5761 100644 --- a/tests/fsharp/app.config +++ b/tests/fsharp/app.config @@ -4,7 +4,7 @@ - + diff --git a/tests/fsharp/packages.config b/tests/fsharp/packages.config index 1d5c24f97f..8837b82cd9 100644 --- a/tests/fsharp/packages.config +++ b/tests/fsharp/packages.config @@ -6,6 +6,6 @@ - - + + \ No newline at end of file diff --git a/tests/fsharpqa/testenv/src/HostedCompilerServer/App.config b/tests/fsharpqa/testenv/src/HostedCompilerServer/App.config index 885af92830..b989490079 100644 --- a/tests/fsharpqa/testenv/src/HostedCompilerServer/App.config +++ b/tests/fsharpqa/testenv/src/HostedCompilerServer/App.config @@ -13,7 +13,7 @@ - + diff --git a/tests/fsharpqa/testenv/src/HostedCompilerServer/HostedCompilerServer.fsproj b/tests/fsharpqa/testenv/src/HostedCompilerServer/HostedCompilerServer.fsproj index 685ebedd83..1a79ff36d5 100644 --- a/tests/fsharpqa/testenv/src/HostedCompilerServer/HostedCompilerServer.fsproj +++ b/tests/fsharpqa/testenv/src/HostedCompilerServer/HostedCompilerServer.fsproj @@ -50,7 +50,7 @@ FSharp.Compiler.Private - $(FSharpSourcesRoot)\..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll + $(FSharpSourcesRoot)\..\packages\System.ValueTuple.$(SystemValueTuplePackageVersion)\lib\netstandard1.0\System.ValueTuple.dll true diff --git a/vsintegration/Directory.Build.props b/vsintegration/Directory.Build.props index fa9f1e6747..5a7b0782ce 100644 --- a/vsintegration/Directory.Build.props +++ b/vsintegration/Directory.Build.props @@ -3,6 +3,8 @@ + net46 + v4.6 true diff --git a/vsintegration/Directory.Build.targets b/vsintegration/Directory.Build.targets index 366cce05ba..8e55b927f9 100644 --- a/vsintegration/Directory.Build.targets +++ b/vsintegration/Directory.Build.targets @@ -11,6 +11,11 @@ net462 + + + true + + @@ -19,11 +24,17 @@ - - - - - + + + + + + + + + + + diff --git a/vsintegration/Utils/LanguageServiceProfiling/LanguageServiceProfiling.fsproj b/vsintegration/Utils/LanguageServiceProfiling/LanguageServiceProfiling.fsproj index f43dcbd9cc..3df9f726d6 100644 --- a/vsintegration/Utils/LanguageServiceProfiling/LanguageServiceProfiling.fsproj +++ b/vsintegration/Utils/LanguageServiceProfiling/LanguageServiceProfiling.fsproj @@ -2,7 +2,6 @@ - net46 Exe true true diff --git a/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj b/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj index bea8f3a831..c36df45788 100644 --- a/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj +++ b/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj @@ -3,7 +3,6 @@ - net46 Library Microsoft\FSharp netcoreapp1.0 @@ -23,11 +22,6 @@ License.txt true - - PreserveNewest - packages\System.ValueTuple.4.3.1.nupkg - true - PreserveNewest packages\System.ValueTuple.4.4.0.nupkg @@ -212,10 +206,6 @@ - - - - diff --git a/vsintegration/Vsix/VisualFSharpTemplates/VisualFSharpTemplates.csproj b/vsintegration/Vsix/VisualFSharpTemplates/VisualFSharpTemplates.csproj index c3a446ae60..91f9f2bddc 100644 --- a/vsintegration/Vsix/VisualFSharpTemplates/VisualFSharpTemplates.csproj +++ b/vsintegration/Vsix/VisualFSharpTemplates/VisualFSharpTemplates.csproj @@ -4,7 +4,6 @@ VisualFSharpTemplate - net46 Library Microsoft\FSharpTemplates false diff --git a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj index 806fed2a6a..1e9f36c59d 100644 --- a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj +++ b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj @@ -3,7 +3,6 @@ - net46 Library true false @@ -148,7 +147,6 @@ - diff --git a/vsintegration/src/FSharp.LanguageService.Base/FSharp.LanguageService.Base.csproj b/vsintegration/src/FSharp.LanguageService.Base/FSharp.LanguageService.Base.csproj index ffb8ab07e6..4cdef16b68 100644 --- a/vsintegration/src/FSharp.LanguageService.Base/FSharp.LanguageService.Base.csproj +++ b/vsintegration/src/FSharp.LanguageService.Base/FSharp.LanguageService.Base.csproj @@ -3,7 +3,6 @@ - net46 Library false true diff --git a/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj b/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj index a6451981d9..2ed06d4385 100644 --- a/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj +++ b/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj @@ -66,7 +66,6 @@ - diff --git a/vsintegration/src/FSharp.PatternMatcher/FSharp.PatternMatcher.csproj b/vsintegration/src/FSharp.PatternMatcher/FSharp.PatternMatcher.csproj index f793788688..da6305fb62 100644 --- a/vsintegration/src/FSharp.PatternMatcher/FSharp.PatternMatcher.csproj +++ b/vsintegration/src/FSharp.PatternMatcher/FSharp.PatternMatcher.csproj @@ -3,7 +3,6 @@ - net46 Library false true @@ -18,8 +17,4 @@ - - - - \ No newline at end of file diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectBase.files b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectBase.files index 5096b9d418..09bea264a0 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectBase.files +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectBase.files @@ -15,23 +15,23 @@ False global - - Microsoft.Build.Engine.dll - Microsoft.Build.Engine - Yes - global + + $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Framework.$(MicrosoftBuildFrameworkPackageVersion)\lib\net46\Microsoft.Build.Framework.dll - - Microsoft.Build.Framework.dll - Microsoft.Build.Framework - Yes - global - - - Microsoft.Build.Utilities.v3.5.dll - Microsoft.Build.Utilities.v3.5 - Yes - global + + $(FSharpSourcesRoot)\..\packages\Microsoft.Build.$(MicrosoftBuildPackageVersion)\lib\net46\Microsoft.Build.dll + + + $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Utilities.Core.$(MicrosoftBuildUtilitiesCorePackageVersion)\lib\net46\Microsoft.Build.Utilities.Core.dll + + + $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Tasks.Core.$(MicrosoftBuildTasksCorePackageVersion)\lib\net46\Microsoft.Build.Tasks.Core.dll + + + $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Tasks.Core.$(MicrosoftBuildTasksCorePackageVersion)\lib\net46\Microsoft.Build.Tasks.Core.dll + + + $(FSharpSourcesRoot)\..\packages\System.IO.Compression.$(SystemIoCompressionPackageVersion)\lib\net46\System.IO.Compression.dll diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectFactory.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectFactory.cs index e254b442ad..ae2e290cb7 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectFactory.cs +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectFactory.cs @@ -20,8 +20,6 @@ namespace Microsoft.VisualStudio.FSharp.ProjectSystem /// Creates projects within the solution /// internal abstract class ProjectFactory : Microsoft.VisualStudio.Shell.Flavor.FlavoredProjectFactoryBase - , IVsProjectUpgradeViaFactory, IVsProjectUpgradeViaFactory4 - { private Microsoft.VisualStudio.Shell.Package package; private System.IServiceProvider site; @@ -143,7 +141,7 @@ protected override void CreateProject(string fileName, string location, string n { installDir = String.Empty; } - else + else { // Ensure that we have trailing backslash as this is done for the langproj macros too. if (installDir[installDir.Length - 1] != Path.DirectorySeparatorChar) @@ -376,531 +374,5 @@ private IProjectEvents GetProjectEventsProvider() return null; } - private string m_lastUpgradedProjectFile; - private const string SCC_PROJECT_NAME = "SccProjectName"; - private string m_sccProjectName; - private const string SCC_AUX_PATH = "SccAuxPath"; - private string m_sccAuxPath; - private const string SCC_LOCAL_PATH = "SccLocalPath"; - private string m_sccLocalPath; - private const string SCC_PROVIDER = "SccProvider"; - private string m_sccProvider; - public virtual int GetSccInfo(string projectFileName, out string sccProjectName, out string sccAuxPath, out string sccLocalPath, out string provider) - { - // we should only be asked for SCC info on a project that we have just upgraded. - if (!String.Equals(this.m_lastUpgradedProjectFile, projectFileName, StringComparison.OrdinalIgnoreCase)) - { - sccProjectName = ""; - sccAuxPath = ""; - sccLocalPath = ""; - provider = ""; - return VSConstants.E_FAIL; - } - sccProjectName = this.m_sccProjectName; - sccAuxPath = this.m_sccAuxPath; - sccLocalPath = this.m_sccLocalPath; - provider = this.m_sccProvider; - return VSConstants.S_OK; - } - - int IVsProjectUpgradeViaFactory.UpgradeProject_CheckOnly(string projectFileName, IVsUpgradeLogger upgradeLogger, out int upgradeRequired, out Guid newProjectFactory, out uint upgradeCapabilityFlags) - { - __VSPPROJECTUPGRADEVIAFACTORYREPAIRFLAGS upgradeRequiredFlag; - var hr = DoUpgradeProject_CheckOnly(projectFileName, upgradeLogger, out upgradeRequiredFlag, out newProjectFactory, out upgradeCapabilityFlags); - upgradeRequired = upgradeRequiredFlag != __VSPPROJECTUPGRADEVIAFACTORYREPAIRFLAGS.VSPUVF_PROJECT_NOREPAIR ? 1 : 0; - return hr; - } - - void IVsProjectUpgradeViaFactory4.UpgradeProject_CheckOnly(string projectFileName, IVsUpgradeLogger upgradeLogger, out uint upgradeRequired, out Guid newProjectFactory, out uint upgradeCapabilityFlags) - { - __VSPPROJECTUPGRADEVIAFACTORYREPAIRFLAGS upgradeRequiredFlag; - DoUpgradeProject_CheckOnly(projectFileName, upgradeLogger, out upgradeRequiredFlag, out newProjectFactory, out upgradeCapabilityFlags); - upgradeRequired = (uint)upgradeRequiredFlag; - } - - public virtual int DoUpgradeProject_CheckOnly(string projectFileName, IVsUpgradeLogger upgradeLogger, out __VSPPROJECTUPGRADEVIAFACTORYREPAIRFLAGS upgradeRequired, out Guid newProjectFactory, out uint upgradeCapabilityFlags) - { - newProjectFactory = GetType().GUID; - var project = ProjectRootElement.Open(projectFileName); - // enable Side-by-Side and CopyBackup support - upgradeCapabilityFlags = (uint)(__VSPPROJECTUPGRADEVIAFACTORYFLAGS.PUVFF_BACKUPSUPPORTED | __VSPPROJECTUPGRADEVIAFACTORYFLAGS.PUVFF_COPYBACKUP | __VSPPROJECTUPGRADEVIAFACTORYFLAGS.PUVFF_SXSBACKUP); - - if (this.buildEngine.GetLoadedProjects(projectFileName).Count > 0) - { - // project has already been loaded - upgradeRequired = __VSPPROJECTUPGRADEVIAFACTORYREPAIRFLAGS.VSPUVF_PROJECT_NOREPAIR; - return VSConstants.S_OK; - } - var projectInspector = new ProjectInspector(projectFileName); - if (projectInspector.IsPoisoned(Site)) - { - // poisoned project cannot be opened (does not require upgrade) - upgradeRequired = __VSPPROJECTUPGRADEVIAFACTORYREPAIRFLAGS.VSPUVF_PROJECT_NOREPAIR; - return VSConstants.S_OK; - } - - // only upgrade known tool versions. - if (string.Equals("4.0", project.ToolsVersion, StringComparison.Ordinal)) - { - // For 4.0, we need to take a deeper look. The logic is in - // vsproject\xmake\XMakeConversion\ProjectFileConverter.cs - var projectConverter = new Microsoft.Build.Conversion.ProjectFileConverter(); - projectConverter.OldProjectFile = projectFileName; - projectConverter.NewProjectFile = projectFileName; - if (projectConverter.FSharpSpecificConversions(false)) - { - upgradeRequired = - projectInspector.IsLikeDev10MinusProject() - ? __VSPPROJECTUPGRADEVIAFACTORYREPAIRFLAGS.VSPUVF_PROJECT_ONEWAYUPGRADE - : __VSPPROJECTUPGRADEVIAFACTORYREPAIRFLAGS.VSPUVF_PROJECT_SAFEREPAIR; - return VSConstants.S_OK; - } - else - { - upgradeRequired = __VSPPROJECTUPGRADEVIAFACTORYREPAIRFLAGS.VSPUVF_PROJECT_NOREPAIR; - return VSConstants.S_OK; - } - } - else - if (string.Equals("3.5", project.ToolsVersion, StringComparison.Ordinal) - || string.Equals("2.0", project.ToolsVersion, StringComparison.Ordinal)) - - { - // For 3.5 or 2.0, we always need to upgrade. - upgradeRequired = __VSPPROJECTUPGRADEVIAFACTORYREPAIRFLAGS.VSPUVF_PROJECT_ONEWAYUPGRADE; - return VSConstants.S_OK; - } - upgradeRequired = __VSPPROJECTUPGRADEVIAFACTORYREPAIRFLAGS.VSPUVF_PROJECT_NOREPAIR; - return VSConstants.S_OK; - } - - private int NormalizeUpgradeFlag(uint upgradeFlag, out __VSPPROJECTUPGRADEVIAFACTORYFLAGS flag, ref string copyLocation) - { - flag = (__VSPPROJECTUPGRADEVIAFACTORYFLAGS)upgradeFlag; - // normalize flags - switch (flag) - { - case __VSPPROJECTUPGRADEVIAFACTORYFLAGS.PUVFF_COPYBACKUP: - case __VSPPROJECTUPGRADEVIAFACTORYFLAGS.PUVFF_SXSBACKUP: - break; - default: - // ignore unknown flags - flag &= (__VSPPROJECTUPGRADEVIAFACTORYFLAGS.PUVFF_COPYBACKUP | __VSPPROJECTUPGRADEVIAFACTORYFLAGS.PUVFF_SXSBACKUP); - break; - } - - //if copy upgrade, then we need a copy location that ends in a backslash. - if (HasCopyBackupFlag(flag)) - { - if (string.IsNullOrEmpty(copyLocation) || copyLocation[copyLocation.Length - 1] != '\\') - { - if (HasSxSBackupFlag(flag)) - { - //if both SxS AND CopyBack were specified, then fall back to SxS - flag &= ~__VSPPROJECTUPGRADEVIAFACTORYFLAGS.PUVFF_COPYBACKUP; - } - else - { - //Only CopyBackup was specified and an invalid backup location was given, so bail - return VSConstants.E_INVALIDARG; - } - } - else - { - //Favor copy backup to SxS backup - flag &= ~__VSPPROJECTUPGRADEVIAFACTORYFLAGS.PUVFF_SXSBACKUP; - } - } - return VSConstants.S_OK; - } - - public virtual int UpgradeProject( - string projectFilePath, - uint upgradeFlag, - string initialCopyLocation, - out string upgradeFullyQualifiedFileName, - IVsUpgradeLogger upgradeLogger, - out int upgradeRequired, - out Guid newProjectFactory - ) - { - // initialize out params in case of failure - upgradeFullyQualifiedFileName = null; - upgradeRequired = 0; - newProjectFactory = Guid.Empty; - - __VSPPROJECTUPGRADEVIAFACTORYFLAGS flag; - string copyLocation = initialCopyLocation; - var r = NormalizeUpgradeFlag(upgradeFlag, out flag, ref copyLocation); - if (r != VSConstants.S_OK) - { - return r; - } - - string projectName = Path.GetFileNameWithoutExtension(projectFilePath); - var logger = new ProjectUpgradeLogger(upgradeLogger, projectName, projectFilePath); - - uint ignore; - ((IVsProjectUpgradeViaFactory)this).UpgradeProject_CheckOnly(projectFilePath, upgradeLogger, out upgradeRequired, out newProjectFactory, out ignore); - - // no upgrade required and not 'copy-backup' - if (upgradeRequired == 0 && !HasCopyBackupFlag(flag)) - { - //Write an informational message "No upgrade required for project foo"? - logger.LogInfo(SR.GetString(SR.ProjectConversionNotRequired)); - logger.LogInfo(SR.GetString(SR.ConversionNotRequired)); - - upgradeFullyQualifiedFileName = projectFilePath; - return VSConstants.S_OK; - } - - // upgrade is not required but backup may still be needed - - var projectFileName = Path.GetFileName(projectFilePath); - upgradeFullyQualifiedFileName = projectFilePath; - - if (HasSxSBackupFlag(flag)) - { - // for SxS call use location near the original file - copyLocation = Path.GetDirectoryName(projectFilePath); - } - - // workflow is taken from vsprjfactory.cpp (vsproject\vsproject) - // 1. convert the project (in-memory) - // 2. save SCC related info - // 3. use data stored on step 2 in GetSccInfo calls (during QueryEditFiles) - // 4. if succeeded - save project on disk - // F# doesn't use .user file so all related code is skipped - try - { - // load MSBuild project in memory: this will be needed in all cases not depending whether upgrade is required or not - // we use this project to determine the set of files to copy - ProjectRootElement convertedProject = ConvertProject(projectFilePath, logger); - if (convertedProject == null) - { - throw new ProjectUpgradeFailedException(); - } - - // OK, we need upgrade, save SCC info and ask if project file can be edited - if (upgradeRequired != 0) - { - // 2. save SCC related info - this.m_lastUpgradedProjectFile = projectFilePath; - foreach (var property in convertedProject.Properties) - { - switch (property.Name) - { - case SCC_LOCAL_PATH: - this.m_sccLocalPath = property.Value; - break; - case SCC_AUX_PATH: - this.m_sccAuxPath = property.Value; - break; - case SCC_PROVIDER: - this.m_sccProvider = property.Value; - break; - case SCC_PROJECT_NAME: - this.m_sccProjectName = property.Value; - break; - default: - break; - } - } - - // 3. Query for edit (this call may query information stored on previous step) - IVsQueryEditQuerySave2 queryEdit = site.GetService(typeof(SVsQueryEditQuerySave)) as IVsQueryEditQuerySave2; - if (queryEdit != null) - { - uint editVerdict; - uint queryEditMoreInfo; - const tagVSQueryEditFlags tagVSQueryEditFlags_QEF_AllowUnopenedProjects = (tagVSQueryEditFlags)0x80; - - int hr = queryEdit.QueryEditFiles( - (uint)(tagVSQueryEditFlags.QEF_ForceEdit_NoPrompting | tagVSQueryEditFlags.QEF_DisallowInMemoryEdits | tagVSQueryEditFlags_QEF_AllowUnopenedProjects), - 1, new[] { projectFilePath }, null, null, out editVerdict, out queryEditMoreInfo); - - if (ErrorHandler.Failed(hr)) - { - throw new ProjectUpgradeFailedException(); - } - - if (editVerdict != (uint)tagVSQueryEditResult.QER_EditOK) - { - throw new ProjectUpgradeFailedException(SR.GetString(SR.UpgradeCannotOpenProjectFileForEdit)); - } - - // If file was modified during the checkout, maybe upgrade is not needed - if ((queryEditMoreInfo & (uint)tagVSQueryEditResultFlags.QER_MaybeChanged) != 0) - { - ((IVsProjectUpgradeViaFactory)this).UpgradeProject_CheckOnly(projectFilePath, upgradeLogger, out upgradeRequired, out newProjectFactory, out ignore); - if (upgradeRequired == 0) - { - if (logger != null) - { - logger.LogInfo(SR.GetString(SR.UpgradeNoNeedToUpgradeAfterCheckout)); - } - - return VSConstants.S_OK; - } - } - } - } - - // 3.1 copy backup - BackupProjectFilesIfNeeded(projectFilePath, logger, flag, copyLocation, convertedProject); - - // 4. if we have performed upgrade - save project to disk - if (upgradeRequired != 0) - { - try - { - convertedProject.Save(projectFilePath); - } - catch (Exception ex) - { - throw new ProjectUpgradeFailedException(ex.Message, ex); - } - } - // 821083: "Converted" should NOT be localized - it is referenced in the XSLT used to display the UpgradeReport - logger.LogStatus("Converted"); - - } - catch (ProjectUpgradeFailedException ex) - { - var exception = ex.InnerException ?? ex; - - if (exception != null && !string.IsNullOrEmpty(exception.Message)) - logger.LogError(exception.Message); - - upgradeFullyQualifiedFileName = ""; - m_lastUpgradedProjectFile = null; - return VSConstants.E_FAIL; - } - return VSConstants.S_OK; - } - - private void BackupProjectFilesIfNeeded( - string projectFilePath, - ProjectUpgradeLogger logger, - __VSPPROJECTUPGRADEVIAFACTORYFLAGS flag, - string copyLocation, - ProjectRootElement convertedProject - ) - { - var projectName = Path.GetFileNameWithoutExtension(projectFilePath); - var projectFileName = Path.GetFileName(projectFilePath); - - if (HasCopyBackupFlag(flag) || HasSxSBackupFlag(flag)) - { - if (HasSxSBackupFlag(flag) && !Directory.Exists(copyLocation)) - { - Debug.Assert(false, "Env should create the directory for us"); - throw new ProjectUpgradeFailedException(); - } - - // copy project file - { - var targetFilePath = Path.Combine(copyLocation, projectFileName); - if (HasSxSBackupFlag(flag)) - { - bool ignored; - targetFilePath = GetUniqueFileName(targetFilePath + ".old", out ignored); - } - - try - { - File.Copy(projectFilePath, targetFilePath); - logger.LogInfo(SR.GetString(SR.ProjectBackupSuccessful, targetFilePath)); - } - catch (Exception ex) - { - var message = SR.GetString(SR.ErrorMakingProjectBackup, targetFilePath); - throw new ProjectUpgradeFailedException(string.Format("{0} : {1}", message, ex.Message)); - } - } - - if (HasCopyBackupFlag(flag)) - { - //Now iterate through the project items and copy them to the new location - //All projects under the solution retain its folder hierarchy - var types = new[] { "Compile", "None", "Content", "EmbeddedResource", "Resource", "BaseApplicationManifest", "ApplicationDefinition", "Page" }; - - var metadataLookup = - convertedProject - .Items - .GroupBy(i => i.ItemType) - .ToDictionary(x => x.Key); - - var sourceProjectDir = Path.GetDirectoryName(projectFilePath); - foreach (var ty in types) - { - if (metadataLookup.ContainsKey(ty)) - { - foreach (var item in metadataLookup[ty]) - { - var linkMetadataElement = item.Metadata.FirstOrDefault(me => me.Name == "Link"); - string linked = linkMetadataElement != null && !string.IsNullOrEmpty(linkMetadataElement.Value) ? linkMetadataElement.Value : null; - - var include = item.Include; - - Debug.Assert(!string.IsNullOrEmpty(include)); - - string sourceFilePath; - - var targetFileName = Path.Combine(copyLocation, linked ?? include); - - if (Path.IsPathRooted(include)) - { - //if the path is fully qualified already, then just use it - sourceFilePath = include; - } - else - { - //otherwise tack the filename on to the path - sourceFilePath = Path.Combine(sourceProjectDir, include); - } - if (linked != null && include[0] == '.') - { - //if linked file up a level (or more), then turn it into a path without the ..\ in the middle - sourceFilePath = Path.GetFullPath(sourceFilePath); - } - - bool initiallyUnique; - targetFileName = GetUniqueFileName(targetFileName, out initiallyUnique); - if (!initiallyUnique) - { - logger.LogInfo(SR.GetString(SR.BackupNameConflict, targetFileName)); - } - - //Warn user in upgrade log if linked files are used "project may not build" - if (linked != null && HasCopyBackupFlag(flag)) - { - logger.LogWarning(SR.GetString(SR.ProjectContainsLinkedFile, targetFileName)); - } - - // ensure target folder exists - Directory.CreateDirectory(Path.GetDirectoryName(targetFileName)); - - try - { - File.Copy(sourceFilePath, targetFileName); - logger.LogInfo(SR.GetString(SR.BackupSuccessful, targetFileName)); - } - catch (Exception ex) - { - var message = SR.GetString(SR.ErrorMakingBackup, targetFileName); - logger.LogError(string.Format("{0} : {1}", message, ex.Message)); - } - } - } - } - } - } - } - - /// - /// Allows to avoid repeatable checks if logger exists + provides more convinient interface - /// - private class ProjectUpgradeLogger - { - private Action<__VSUL_ERRORLEVEL, string> write; - public ProjectUpgradeLogger(IVsUpgradeLogger logger, string projectName, string projectFileName) - { - if (logger != null) - { - write = (errLevel, message) => logger.LogMessage((uint)errLevel, projectName, projectFileName, message) ; - } - else - { - write = delegate { }; - } - } - - public void LogInfo(string message) - { - write(__VSUL_ERRORLEVEL.VSUL_INFORMATIONAL, message); - } - public void LogWarning(string message) - { - write(__VSUL_ERRORLEVEL.VSUL_WARNING, message); - } - public void LogError(string message) - { - write(__VSUL_ERRORLEVEL.VSUL_ERROR, message); - } - public void LogStatus(string message) - { - write(__VSUL_ERRORLEVEL.VSUL_STATUSMSG, message); - } - } - - private class ProjectUpgradeFailedException : Exception - { - public ProjectUpgradeFailedException() : base() { } - public ProjectUpgradeFailedException(string message) : base(message) { } - public ProjectUpgradeFailedException(string message, Exception inner) : base(message, inner) { } - } - - /// - /// Performs in-memory conversion of the project with a given path - /// - /// Root element of the converted project or null if conversion failed. - private ProjectRootElement ConvertProject(string projectFileName, ProjectUpgradeLogger logger) - { - var projectConverter = new Microsoft.Build.Conversion.ProjectFileConverter(); - projectConverter.OldProjectFile = projectFileName; - projectConverter.NewProjectFile = projectFileName; - ProjectRootElement convertedProject = null; - try - { - convertedProject = projectConverter.ConvertInMemory(); - } - catch (Exception ex) - { - logger.LogInfo(ex.Message); - } - return convertedProject; - } - - /// - /// Helper for checking if flag has PUVFF_SXSBACKUP value - /// - private static bool HasSxSBackupFlag(__VSPPROJECTUPGRADEVIAFACTORYFLAGS flag) - { - return flag.HasFlag(__VSPPROJECTUPGRADEVIAFACTORYFLAGS.PUVFF_SXSBACKUP); - } - - /// - /// Helper for checking if flag has PUVFF_COPYBACKUP value - /// - private static bool HasCopyBackupFlag(__VSPPROJECTUPGRADEVIAFACTORYFLAGS flag) - { - return flag.HasFlag(__VSPPROJECTUPGRADEVIAFACTORYFLAGS.PUVFF_COPYBACKUP); - } - - /// - /// Generates unique name for the given path by appending 0..n to the file name - /// - /// Initial location - /// true if original file name was already unique, otherwise - false - /// Unique file path - private string GetUniqueFileName(string initialPath, out bool initiallyUnique) - { - initiallyUnique = true; - if (!File.Exists(initialPath)) - return initialPath; - - initiallyUnique = false; - var originalExtension = Path.GetExtension(initialPath); - var pathSansExtension = Path.Combine(Path.GetDirectoryName(initialPath), Path.GetFileNameWithoutExtension(initialPath)); - var i = 1; - while(true) - { - var f = string.Format("{0}{1}{2}", pathSansExtension, i, originalExtension); - if (!File.Exists(f)) - return f; - i++; - } - } } } diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj index 4568dc27d6..5698b15ab6 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj @@ -3,7 +3,6 @@ - net46 Library FSharp.ProjectSystem.Base false @@ -59,6 +58,7 @@ + diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/FSharp.ProjectSystem.FSharp.dll.config b/vsintegration/src/FSharp.ProjectSystem.FSharp/FSharp.ProjectSystem.FSharp.dll.config deleted file mode 100644 index 64c1aeab9d..0000000000 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/FSharp.ProjectSystem.FSharp.dll.config +++ /dev/null @@ -1,19 +0,0 @@ - - - -
- - - - - - - - - - - - - - - \ No newline at end of file diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj b/vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj index 1c7dc28132..da3a1a3c7b 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj @@ -3,7 +3,6 @@ - net46 Library FSharp.ProjectSystem.FSharp true @@ -90,7 +89,6 @@ - diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj index 543bb41c6f..136f0b001d 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj @@ -71,6 +71,7 @@ + diff --git a/vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj b/vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj index 3261a886e8..522650bbd0 100644 --- a/vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj +++ b/vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj @@ -3,7 +3,6 @@ - net46 Library $(NoWarn);1591 false diff --git a/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj b/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj index 7093b123e5..2606d53008 100644 --- a/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj +++ b/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj @@ -73,7 +73,6 @@ - diff --git a/vsintegration/tests/GetTypesVSUnitTests/App.config b/vsintegration/tests/GetTypesVSUnitTests/App.config new file mode 100644 index 0000000000..274bc3450a --- /dev/null +++ b/vsintegration/tests/GetTypesVSUnitTests/App.config @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/vsintegration/tests/GetTypesVSUnitTests/GetTypesVSUnitTests.fsproj b/vsintegration/tests/GetTypesVSUnitTests/GetTypesVSUnitTests.fsproj index 275d1a0775..0ea02ddd64 100644 --- a/vsintegration/tests/GetTypesVSUnitTests/GetTypesVSUnitTests.fsproj +++ b/vsintegration/tests/GetTypesVSUnitTests/GetTypesVSUnitTests.fsproj @@ -9,10 +9,12 @@ true false true + true + @@ -21,6 +23,7 @@ + diff --git a/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj b/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj index c3e8d228ee..2470a4404c 100644 --- a/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj +++ b/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj @@ -50,7 +50,6 @@ - diff --git a/vsintegration/tests/UnitTests/App.config b/vsintegration/tests/UnitTests/App.config index 52c9692323..ccede64297 100644 --- a/vsintegration/tests/UnitTests/App.config +++ b/vsintegration/tests/UnitTests/App.config @@ -2,37 +2,36 @@ - + - - - - - - - - - - + + + + - - + + + + - - + + + + - - + + + + - - + + - diff --git a/vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.UpToDate.fs b/vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.UpToDate.fs index a101cce301..41b596fcfa 100644 --- a/vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.UpToDate.fs +++ b/vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.UpToDate.fs @@ -14,6 +14,7 @@ open System.Text.RegularExpressions open Microsoft.VisualStudio open Microsoft.VisualStudio.Shell open Microsoft.VisualStudio.Shell.Interop +open Microsoft.VisualStudio.FSharp open Microsoft.VisualStudio.FSharp.ProjectSystem // Internal unittest namespaces @@ -27,6 +28,9 @@ open UnitTests.TestLib.ProjectSystem type UpToDate() = inherit TheTests() + [] + member public __.Init () = AssemblyResolver.addResolver () + [] member public this.ItemInputs () = this.MakeProjectAndDo(["file1.fs"], [], @" diff --git a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj index c6f3b3b912..298011f2e9 100644 --- a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj +++ b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj @@ -9,6 +9,7 @@ NO_PROJECTCRACKER;$(DefineConstants) true true + true false @@ -149,7 +150,7 @@ Roslyn\DocumentHighlightsServiceTests.fs - + From 0f9876a914ddbac0c2a71bdc2971d11ad722bc7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbyn=C4=9Bk=20Sailer?= Date: Thu, 2 Aug 2018 12:16:04 +0200 Subject: [PATCH 128/150] LOC CHECKIN | Microsoft/visualfsharp master | 20180802 --- src/fsharp/fsi/xlf/FSIstrings.txt.cs.xlf | 2 +- src/fsharp/fsi/xlf/FSIstrings.txt.de.xlf | 2 +- src/fsharp/fsi/xlf/FSIstrings.txt.es.xlf | 8 ++++---- src/fsharp/fsi/xlf/FSIstrings.txt.fr.xlf | 2 +- src/fsharp/fsi/xlf/FSIstrings.txt.it.xlf | 2 +- src/fsharp/fsi/xlf/FSIstrings.txt.ja.xlf | 14 +++++++------- src/fsharp/fsi/xlf/FSIstrings.txt.ko.xlf | 14 +++++++------- src/fsharp/fsi/xlf/FSIstrings.txt.pt-BR.xlf | 10 +++++----- src/fsharp/fsi/xlf/FSIstrings.txt.ru.xlf | 4 ++-- src/fsharp/fsi/xlf/FSIstrings.txt.tr.xlf | 12 ++++++------ src/fsharp/fsi/xlf/FSIstrings.txt.zh-Hans.xlf | 12 ++++++------ src/fsharp/fsi/xlf/FSIstrings.txt.zh-Hant.xlf | 14 +++++++------- .../Template/xlf/Tutorial.fsx.de.xlf | 6 +++--- .../Template/xlf/Tutorial.fsx.es.xlf | 4 ++-- .../Template/xlf/Tutorial.fsx.fr.xlf | 8 ++++---- .../Template/xlf/Tutorial.fsx.it.xlf | 6 +++--- .../Template/xlf/Tutorial.fsx.ja.xlf | 16 ++++++++-------- .../Template/xlf/Tutorial.fsx.ko.xlf | 6 +++--- .../Template/xlf/Tutorial.fsx.pl.xlf | 4 ++-- .../Template/xlf/Tutorial.fsx.ru.xlf | 4 ++-- .../Template/xlf/Tutorial.fsx.tr.xlf | 2 +- .../Template/xlf/Tutorial.fsx.zh-Hans.xlf | 4 ++-- .../Template/xlf/Tutorial.fsx.zh-Hant.xlf | 4 ++-- .../xlf/MenusAndCommands.vsct.es.xlf | 2 +- .../xlf/MenusAndCommands.vsct.ja.xlf | 14 +++++++------- .../xlf/MenusAndCommands.vsct.ko.xlf | 16 ++++++++-------- .../xlf/MenusAndCommands.vsct.pl.xlf | 2 +- .../xlf/MenusAndCommands.vsct.ru.xlf | 2 +- .../xlf/MenusAndCommands.vsct.tr.xlf | 16 ++++++++-------- .../xlf/MenusAndCommands.vsct.zh-Hans.xlf | 16 ++++++++-------- .../xlf/MenusAndCommands.vsct.zh-Hant.xlf | 14 +++++++------- .../xlf/VSPackage.de.xlf | 2 +- .../xlf/VSPackage.it.xlf | 12 ++++++------ .../xlf/VSPackage.ja.xlf | 8 ++++---- .../xlf/VSPackage.ko.xlf | 6 +++--- .../xlf/VSPackage.pl.xlf | 4 ++-- .../xlf/VSPackage.tr.xlf | 6 +++--- .../xlf/VSPackage.zh-Hans.xlf | 6 +++--- .../xlf/VSPackage.zh-Hant.xlf | 6 +++--- .../src/FSharp.VS.FSI/xlf/Properties.cs.xlf | 2 +- .../src/FSharp.VS.FSI/xlf/Properties.de.xlf | 4 ++-- .../src/FSharp.VS.FSI/xlf/Properties.fr.xlf | 2 +- .../src/FSharp.VS.FSI/xlf/Properties.ja.xlf | 12 ++++++------ .../src/FSharp.VS.FSI/xlf/Properties.ko.xlf | 12 ++++++------ .../src/FSharp.VS.FSI/xlf/Properties.pl.xlf | 4 ++-- .../src/FSharp.VS.FSI/xlf/Properties.pt-BR.xlf | 8 ++++---- .../src/FSharp.VS.FSI/xlf/Properties.ru.xlf | 2 +- .../src/FSharp.VS.FSI/xlf/Properties.tr.xlf | 10 +++++----- .../src/FSharp.VS.FSI/xlf/Properties.zh-Hans.xlf | 12 ++++++------ .../src/FSharp.VS.FSI/xlf/Properties.zh-Hant.xlf | 12 ++++++------ .../src/FSharp.VS.FSI/xlf/VFSIstrings.txt.cs.xlf | 2 +- .../src/FSharp.VS.FSI/xlf/VFSIstrings.txt.de.xlf | 2 +- .../src/FSharp.VS.FSI/xlf/VFSIstrings.txt.ja.xlf | 6 +++--- .../src/FSharp.VS.FSI/xlf/VFSIstrings.txt.ko.xlf | 8 ++++---- .../src/FSharp.VS.FSI/xlf/VFSIstrings.txt.pl.xlf | 2 +- .../FSharp.VS.FSI/xlf/VFSIstrings.txt.pt-BR.xlf | 4 ++-- .../src/FSharp.VS.FSI/xlf/VFSIstrings.txt.tr.xlf | 8 ++++---- .../xlf/VFSIstrings.txt.zh-Hans.xlf | 8 ++++---- .../xlf/VFSIstrings.txt.zh-Hant.xlf | 8 ++++---- 59 files changed, 210 insertions(+), 210 deletions(-) diff --git a/src/fsharp/fsi/xlf/FSIstrings.txt.cs.xlf b/src/fsharp/fsi/xlf/FSIstrings.txt.cs.xlf index 2567d3f26f..d4667e04c0 100644 --- a/src/fsharp/fsi/xlf/FSIstrings.txt.cs.xlf +++ b/src/fsharp/fsi/xlf/FSIstrings.txt.cs.xlf @@ -264,7 +264,7 @@ Prevents references from being locked by the F# Interactive process - Znemožňuje zamknutí referencí interaktivním procesem jazyka F#. + Znemožňuje zamknutí referencí procesem nástroje F# Interactive. diff --git a/src/fsharp/fsi/xlf/FSIstrings.txt.de.xlf b/src/fsharp/fsi/xlf/FSIstrings.txt.de.xlf index ec345eadd3..f87d3361f2 100644 --- a/src/fsharp/fsi/xlf/FSIstrings.txt.de.xlf +++ b/src/fsharp/fsi/xlf/FSIstrings.txt.de.xlf @@ -264,7 +264,7 @@ Prevents references from being locked by the F# Interactive process - Verhindert, dass Verweise vom interaktiven Prozess F# gesperrt werden + Verhindert, dass Verweise vom F# Interactive-Prozess gesperrt werden diff --git a/src/fsharp/fsi/xlf/FSIstrings.txt.es.xlf b/src/fsharp/fsi/xlf/FSIstrings.txt.es.xlf index a43b278bb1..6af67db255 100644 --- a/src/fsharp/fsi/xlf/FSIstrings.txt.es.xlf +++ b/src/fsharp/fsi/xlf/FSIstrings.txt.es.xlf @@ -99,7 +99,7 @@ A problem occurred starting the F# Interactive process. This may be due to a known problem with background process console support for Unicode-enabled applications on some Windows systems. Try selecting Tools->Options->F# Interactive for Visual Studio and enter '--fsi-server-no-unicode'. - Se produjo un problema al iniciar el proceso de F# interactivo. Esto puede deberse a un problema conocido de compatibilidad de la consola de procesos en segundo plano con aplicaciones habilitadas para Unicode en algunos sistemas Windows. Pruebe lo siguiente: seleccione Herramientas->Opciones->F# interactivo para Visual Studio y escriba '--fsi-server-no-unicode'. + Se produjo un problema al iniciar el proceso de F# interactivo. Esto puede deberse a un problema conocido de compatibilidad de la consola de procesos en segundo plano con aplicaciones habilitadas para Unicode en algunos sistemas Windows. Pruebe lo siguiente: seleccione Herramientas->Opciones->F# interactivo para Visual Studio y escriba “--fsi-server-no-unicode”. @@ -139,7 +139,7 @@ F# Interactive directives: - Directivas de F#: + Directivas de F# interactivo: @@ -214,7 +214,7 @@ --> Referenced '{0}' (file may be locked by F# Interactive process) - --> '{0}' al que se hace referencia (el archivo puede estar bloqueado por un proceso de F# interactivo) + --> “{0}” al que se hace referencia (el archivo puede estar bloqueado por un proceso de F# interactivo) @@ -259,7 +259,7 @@ F# Interactive for F# {0} - F# Interactive para F# {0} + F# interactivo para F# {0} diff --git a/src/fsharp/fsi/xlf/FSIstrings.txt.fr.xlf b/src/fsharp/fsi/xlf/FSIstrings.txt.fr.xlf index 4343c88666..917a17f435 100644 --- a/src/fsharp/fsi/xlf/FSIstrings.txt.fr.xlf +++ b/src/fsharp/fsi/xlf/FSIstrings.txt.fr.xlf @@ -264,7 +264,7 @@ Prevents references from being locked by the F# Interactive process - Empêche le blocage des références par le processus interactif F# + Empêche le blocage des références par le processus de F# Interactive diff --git a/src/fsharp/fsi/xlf/FSIstrings.txt.it.xlf b/src/fsharp/fsi/xlf/FSIstrings.txt.it.xlf index bdba37d1c7..d7f05d6aa9 100644 --- a/src/fsharp/fsi/xlf/FSIstrings.txt.it.xlf +++ b/src/fsharp/fsi/xlf/FSIstrings.txt.it.xlf @@ -114,7 +114,7 @@ Invalid directive '#{0} {1}' - Direttiva non valida '#{0} {1}' + Direttiva '#{0} {1}' non valida diff --git a/src/fsharp/fsi/xlf/FSIstrings.txt.ja.xlf b/src/fsharp/fsi/xlf/FSIstrings.txt.ja.xlf index 8697e6da83..0751b4601e 100644 --- a/src/fsharp/fsi/xlf/FSIstrings.txt.ja.xlf +++ b/src/fsharp/fsi/xlf/FSIstrings.txt.ja.xlf @@ -99,7 +99,7 @@ A problem occurred starting the F# Interactive process. This may be due to a known problem with background process console support for Unicode-enabled applications on some Windows systems. Try selecting Tools->Options->F# Interactive for Visual Studio and enter '--fsi-server-no-unicode'. - F# Interactive のプロセスの開始中に問題が発生しました。この原因は、一部の Windows システム上での Unicode 対応アプリケーションのバックグラウンド プロセス コンソールのサポートに関する既知の問題にある可能性があります。[ツール]5D; の [オプション]5D; から [F# Interactive for Visual Studio]5D; を選択し、「--fsi-server-no-unicode」と入力してください。 + F# インタラクティブのプロセスの開始中に問題が発生しました。この原因は、一部の Windows システム上での Unicode 対応アプリケーションのバックグラウンド プロセス コンソールのサポートに関する既知の問題にある可能性があります。[ツール]5D; の [オプション]5D; から [F# Interactive for Visual Studio]5D; を選択し、「--fsi-server-no-unicode」と入力してください。 @@ -139,7 +139,7 @@ F# Interactive directives: - F# Interactive ディレクティブ: + F# インタラクティブ ディレクティブ: @@ -174,7 +174,7 @@ F# Interactive command line options: - F# Interactive コマンド ライン オプション: + F# インタラクティブ コマンド ライン オプション: @@ -214,7 +214,7 @@ --> Referenced '{0}' (file may be locked by F# Interactive process) - --> '{0}' を参照しました (ファイルが F# Interactive のプロセスによってロックされている可能性があります) + --> '{0}' を参照しました (ファイルが F# インタラクティブのプロセスによってロックされている可能性があります) @@ -254,17 +254,17 @@ Microsoft (R) F# Interactive version {0} - Microsoft (R) F# Interactive Version {0} + Microsoft (R) F# インタラクティブ バージョン {0} F# Interactive for F# {0} - F# {0} の F# Interactive + F# {0} の F# インタラクティブ Prevents references from being locked by the F# Interactive process - 参照が F# 対話型プロセスによってロックされないようにします。 + 参照が F# インタラクティブ プロセスによってロックされないようにします。 diff --git a/src/fsharp/fsi/xlf/FSIstrings.txt.ko.xlf b/src/fsharp/fsi/xlf/FSIstrings.txt.ko.xlf index 6f6d927ebf..69a5d3b535 100644 --- a/src/fsharp/fsi/xlf/FSIstrings.txt.ko.xlf +++ b/src/fsharp/fsi/xlf/FSIstrings.txt.ko.xlf @@ -99,7 +99,7 @@ A problem occurred starting the F# Interactive process. This may be due to a known problem with background process console support for Unicode-enabled applications on some Windows systems. Try selecting Tools->Options->F# Interactive for Visual Studio and enter '--fsi-server-no-unicode'. - F# Interactive 프로세스를 시작하는 동안 오류가 발생했습니다. 일부 Windows 시스템에서 나타나는 유니코드 기반 응용 프로그램의 백그라운드 프로세스 콘솔 지원과 관련된 알려진 문제가 원인일 수 있습니다. [도구]5D;->[옵션]5D;->[F# Interactive for Visual Studio]5D;를 선택하고 '--fsi-server-no-unicode'를 입력해 보세요. + F# 대화형 프로세스를 시작하는 동안 오류가 발생했습니다. 일부 Windows 시스템에서 나타나는 유니코드 기반 응용 프로그램의 백그라운드 프로세스 콘솔 지원과 관련된 알려진 문제가 원인일 수 있습니다. [도구]5D;->[옵션]5D;->[Visual Studio용 F# 대화형]5D;를 선택하고 '--fsi-server-no-unicode'를 입력해 보세요. @@ -139,7 +139,7 @@ F# Interactive directives: - F# Interactive 지시문: + F# 대화형 지시문: @@ -174,7 +174,7 @@ F# Interactive command line options: - F# Interactive 명령줄 옵션: + F# 대화형 명령줄 옵션: @@ -214,7 +214,7 @@ --> Referenced '{0}' (file may be locked by F# Interactive process) - --> '{0}' 참조됨(파일은 F# Interactive 프로세스에 의해 잠길 수 있음) + --> '{0}' 참조됨(파일은 F# 대화형 프로세스에 의해 잠길 수 있음) @@ -254,17 +254,17 @@ Microsoft (R) F# Interactive version {0} - Microsoft (R) F# Interactive 버전 {0} + Microsoft (R) F# 대화형 버전 {0} F# Interactive for F# {0} - F# {0}에 대한 F# Interactive + F# {0}에 대한 F# 대화형 Prevents references from being locked by the F# Interactive process - 참조가 F# Interactive 프로세스에 의해 잠기지 않도록 합니다. + 참조가 F# 대화형 프로세스에 의해 잠기지 않도록 합니다. diff --git a/src/fsharp/fsi/xlf/FSIstrings.txt.pt-BR.xlf b/src/fsharp/fsi/xlf/FSIstrings.txt.pt-BR.xlf index 7d8838f24f..d35388b4cb 100644 --- a/src/fsharp/fsi/xlf/FSIstrings.txt.pt-BR.xlf +++ b/src/fsharp/fsi/xlf/FSIstrings.txt.pt-BR.xlf @@ -99,7 +99,7 @@ A problem occurred starting the F# Interactive process. This may be due to a known problem with background process console support for Unicode-enabled applications on some Windows systems. Try selecting Tools->Options->F# Interactive for Visual Studio and enter '--fsi-server-no-unicode'. - Um problema ocorreu na inicialização do processo interativo #F. Isto pode ter ocorrido devido a um problema conhecido com processo de fundo do console de apoio pelo aplicativos habilitados Unicode em alguns sistemas do Windows. Tente Ferramentas->Opções->Interativo F# para Visual Studio e insira '--fsi-server-no-unicode'. + Um problema ocorreu na inicialização do processo F# Interativo. Isto pode ter ocorrido devido a um problema conhecido com processo de fundo do console de apoio pelo aplicativos habilitados Unicode em alguns sistemas do Windows. Tente Ferramentas->Opções->F# Interativo para Visual Studio e insira '--fsi-server-no-unicode'. @@ -139,7 +139,7 @@ F# Interactive directives: - Diretrizes interativas F#: + Diretrizes F# Interativo: @@ -174,7 +174,7 @@ F# Interactive command line options: - Opções de linha de comando F# interativo: + Opções de linha de comando F# Interativo: @@ -254,7 +254,7 @@ Microsoft (R) F# Interactive version {0} - Microsoft (R) F# Interactive versão {0} + Microsoft (R) F# Interativo versão {0} @@ -264,7 +264,7 @@ Prevents references from being locked by the F# Interactive process - Impede que as referências sejam bloqueadas pelo processo de F# interativo + Impede que as referências sejam bloqueadas pelo processo de F# Interativo diff --git a/src/fsharp/fsi/xlf/FSIstrings.txt.ru.xlf b/src/fsharp/fsi/xlf/FSIstrings.txt.ru.xlf index 1d6ce4e963..6e40ee07dd 100644 --- a/src/fsharp/fsi/xlf/FSIstrings.txt.ru.xlf +++ b/src/fsharp/fsi/xlf/FSIstrings.txt.ru.xlf @@ -99,7 +99,7 @@ A problem occurred starting the F# Interactive process. This may be due to a known problem with background process console support for Unicode-enabled applications on some Windows systems. Try selecting Tools->Options->F# Interactive for Visual Studio and enter '--fsi-server-no-unicode'. - Возникла проблема при запуске процесса F# Interactive. Это может быть вызвано известной проблемой с поддержкой консоли фонового процесса для приложений с поддержкой Юникода в некоторых системах Windows. Попробуйте выбрать "Сервис->Параметры->F# Interactive для Visual Studio" и ввести "--fsi-server-no-unicode". + Возникла проблема при запуске процесса F# Interactive. Это может быть вызвано известной проблемой с поддержкой консоли фонового процесса для приложений с поддержкой Юникода в некоторых системах Windows. Попробуйте выбрать "Сервис" -> "Параметры" -> "F# Interactive для Visual Studio" и ввести "--fsi-server-no-unicode". @@ -264,7 +264,7 @@ Prevents references from being locked by the F# Interactive process - Предотвращает блокировку ссылок интерактивным процессом F#. + Предотвращает блокировку ссылок процессом F# Interactive. diff --git a/src/fsharp/fsi/xlf/FSIstrings.txt.tr.xlf b/src/fsharp/fsi/xlf/FSIstrings.txt.tr.xlf index 7393283389..6497500a1f 100644 --- a/src/fsharp/fsi/xlf/FSIstrings.txt.tr.xlf +++ b/src/fsharp/fsi/xlf/FSIstrings.txt.tr.xlf @@ -99,7 +99,7 @@ A problem occurred starting the F# Interactive process. This may be due to a known problem with background process console support for Unicode-enabled applications on some Windows systems. Try selecting Tools->Options->F# Interactive for Visual Studio and enter '--fsi-server-no-unicode'. - F# Interactive işlemi başlatılırken bir sorun oluştu. Bu durum, bazı Windows sistemlerindeki Unicode kullanan uygulamalara yönelik arka plan işlemi konsol desteğinde bilinen bir soruna bağlı olabilir. Visual Studio için Araçlar->Seçenekler->F# Interactive'i seçmeyi deneyin ve '--fsi-server-no-unicode' girin. + F# Etkileşimli işlemi başlatılırken bir sorun oluştu. Bu durum, bazı Windows sistemlerindeki Unicode kullanan uygulamalara yönelik arka plan işlemi konsol desteğinde bilinen bir soruna bağlı olabilir. Visual Studio için Araçlar->Seçenekler->F# Etkileşimli'yi seçmeyi deneyin ve '--fsi-server-no-unicode' girin. @@ -139,7 +139,7 @@ F# Interactive directives: - F# Interactive yönergeleri: + F# Etkileşimli yönergeleri: @@ -174,7 +174,7 @@ F# Interactive command line options: - F# Interactive komut satırı seçenekleri: + F# Etkileşimli komut satırı seçenekleri: @@ -214,7 +214,7 @@ --> Referenced '{0}' (file may be locked by F# Interactive process) - --> '{0}' öğesine başvuruldu (dosya F# Interactive işlemi tarafından kilitlenmiş olabilir) + --> '{0}' öğesine başvuruldu (dosya F# Etkileşimli işlemi tarafından kilitlenmiş olabilir) @@ -254,12 +254,12 @@ Microsoft (R) F# Interactive version {0} - Microsoft (R) F# Interactive sürüm {0} + Microsoft (R) F# Etkileşimli sürüm {0} F# Interactive for F# {0} - F# {0} için F# Interactive + F# {0} için F# Etkileşimli diff --git a/src/fsharp/fsi/xlf/FSIstrings.txt.zh-Hans.xlf b/src/fsharp/fsi/xlf/FSIstrings.txt.zh-Hans.xlf index 317abba3c1..6089715c68 100644 --- a/src/fsharp/fsi/xlf/FSIstrings.txt.zh-Hans.xlf +++ b/src/fsharp/fsi/xlf/FSIstrings.txt.zh-Hans.xlf @@ -99,7 +99,7 @@ A problem occurred starting the F# Interactive process. This may be due to a known problem with background process console support for Unicode-enabled applications on some Windows systems. Try selecting Tools->Options->F# Interactive for Visual Studio and enter '--fsi-server-no-unicode'. - 启动 F# 交互进程时发生问题。此情况可能是由一个已知问题导致的,即某些 Windows 系统上的后台进程控制台不支持启用了 Unicode 的应用程序。请尝试选择“工具”->“选项”->“F# 交互 for Visual Studio”,然后输入“--fsi-server-no-unicode”。 + 启动 F# 交互窗口进程时发生问题。此情况可能是由一个已知问题导致的,即某些 Windows 系统上的后台进程控制台不支持启用了 Unicode 的应用程序。请尝试选择“工具”->“选项”->“适用于 Visual Studio 的 F# 交互窗口”,然后输入“--fsi-server-no-unicode”。 @@ -139,7 +139,7 @@ F# Interactive directives: - F# 交互指令: + F# 交互窗口指令: @@ -174,7 +174,7 @@ F# Interactive command line options: - F# 交互命令行选项: + F# 交互窗口命令行选项: @@ -214,7 +214,7 @@ --> Referenced '{0}' (file may be locked by F# Interactive process) - --> 已引用“{0}”(文件可能由 F# 交互进程锁定) + --> 已引用“{0}”(文件可能由 F# 交互窗口进程锁定) @@ -254,7 +254,7 @@ Microsoft (R) F# Interactive version {0} - Microsoft(R) F# 交互版本 {0} + Microsoft(R) F# 交互窗口版本 {0} @@ -264,7 +264,7 @@ Prevents references from being locked by the F# Interactive process - 防止引用被 F# 交互式进程锁定 + 防止引用被 F# 交互窗口进程锁定 diff --git a/src/fsharp/fsi/xlf/FSIstrings.txt.zh-Hant.xlf b/src/fsharp/fsi/xlf/FSIstrings.txt.zh-Hant.xlf index 84501a17e1..1752c12240 100644 --- a/src/fsharp/fsi/xlf/FSIstrings.txt.zh-Hant.xlf +++ b/src/fsharp/fsi/xlf/FSIstrings.txt.zh-Hant.xlf @@ -99,7 +99,7 @@ A problem occurred starting the F# Interactive process. This may be due to a known problem with background process console support for Unicode-enabled applications on some Windows systems. Try selecting Tools->Options->F# Interactive for Visual Studio and enter '--fsi-server-no-unicode'. - 啟動 F# Interactive 處理序時發生問題。這可能是因為背景處理序主控台對於支援某些 Windows 系統上具備 Unicode 支援功能之應用程式的已知問題所造成。請嘗試選取 [工具]5D; -> [選項]5D; -> [F# Interactive for Visual Studio]5D;,然後輸入 '--fsi-server-no-unicode'。 + 啟動 F# 互動處理序時發生問題。這可能是因為背景處理序主控台對於支援某些 Windows 系統上具備 Unicode 支援功能之應用程式的已知問題所造成。請嘗試選取 [工具]5D; -> [選項]5D; -> [F# Interactive for Visual Studio]5D;,然後輸入 '--fsi-server-no-unicode'。 @@ -139,7 +139,7 @@ F# Interactive directives: - F# Interactive 指示詞: + F# 互動指示詞: @@ -174,7 +174,7 @@ F# Interactive command line options: - F# Interactive 命令列選項: + F# 互動命令列選項: @@ -214,7 +214,7 @@ --> Referenced '{0}' (file may be locked by F# Interactive process) - --> 參考的 '{0}' (檔案可能已被 F# Interactive 處理序鎖定) + --> 參考的 '{0}' (檔案可能已被 F# 互動處理序鎖定) @@ -254,17 +254,17 @@ Microsoft (R) F# Interactive version {0} - Microsoft (R) F# Interactive 版本 {0} + Microsoft (R) F# 互動版本 {0} F# Interactive for F# {0} - 適用於 F# {0} 的 F# Interactive + 適用於 F# {0} 的 F# 互動 Prevents references from being locked by the F# Interactive process - 避免參考遭 F# 互動式處理序封鎖 + 避免參考遭 F# 互動處理序封鎖 diff --git a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.de.xlf b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.de.xlf index eda7363478..34712e5a59 100644 --- a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.de.xlf +++ b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.de.xlf @@ -14,7 +14,7 @@ and select "Execute in Interactive". You can open the F# Interactive Window from the "View" menu. - und wählen Sie "Interaktiv ausführen" aus. Sie können das F# Interactive-Fenster über das Menü "Ansicht" öffnen. + und wählen Sie "In Interactive ausführen" aus. Sie können das F# Interactive-Fenster über das Menü "Ansicht" öffnen. @@ -1479,7 +1479,7 @@ To learn more, see: https://docs.microsoft.com/en-us/dotnet/articles/fsharp/language-reference/generics/ - Weitere Informationen finden Sie unter:: https://docs.microsoft.com/de-de/dotnet/articles/fsharp/language-reference/generics/ + Weitere Informationen finden Sie unter: https://docs.microsoft.com/de-de/dotnet/articles/fsharp/language-reference/generics/ @@ -1529,7 +1529,7 @@ To learn more, see: https://docs.microsoft.com/en-us/dotnet/articles/fsharp/language-reference/interfaces - Weitere Informationen finden Sie unter:: https://docs.microsoft.com/de-de/dotnet/articles/fsharp/language-reference/interfaces + Weitere Informationen finden Sie unter: https://docs.microsoft.com/de-de/dotnet/articles/fsharp/language-reference/interfaces diff --git a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.es.xlf b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.es.xlf index d57b4b8df1..638544aa50 100644 --- a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.es.xlf +++ b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.es.xlf @@ -9,12 +9,12 @@ To execute the code in F# Interactive, highlight a section of code and press Alt-Enter or right-click - Para ejecutar el código en F# interactivo, resalte una sección de código y presione Alt-Entrar, o haga clic con el botón secundario + Para ejecutar el código en F# interactivo, resalte una sección de código y presione Alt+Entrar, o bien haga clic con el botón secundario and select "Execute in Interactive". You can open the F# Interactive Window from the "View" menu. - y seleccione "Ejecutar en modo interactivo". Puede abrir la ventana de F# interactivo desde el menú "Ver". + y seleccione "Ejecutar en modo interactivo". Puede abrir la ventana de F# interactivo desde el menú "Ver". diff --git a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.fr.xlf b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.fr.xlf index 8521a7d3e6..51bdc34726 100644 --- a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.fr.xlf +++ b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.fr.xlf @@ -9,7 +9,7 @@ To execute the code in F# Interactive, highlight a section of code and press Alt-Enter or right-click - Pour exécuter le code dans F# Interactive, mettez en surbrillance une portion du code, puis appuyez sur Alt+Entrée ou cliquez avec le bouton droit, + Pour exécuter le code en F# Interactive, mettez en surbrillance une portion du code, puis appuyez sur Alt+Entrée ou cliquez avec le bouton droit, @@ -159,7 +159,7 @@ Values in F# are immutable by default. They cannot be changed - Les valeurs dans F# sont immuables par défaut. Elles ne peuvent pas être changées + Les valeurs en F# sont immuables par défaut. Elles ne peuvent pas être changées @@ -209,7 +209,7 @@ Much of F# programming consists of defining functions that transform input data to produce - La programmation F# consiste en grande partie à définir des fonctions qui transforment des données d'entrée pour produire des + La programmation en F# consiste en grande partie à définir des fonctions qui transforment des données d'entrée pour produire des @@ -584,7 +584,7 @@ This is using what is known as function composition. This is possible because functions in F# - C'est ce qui s'appelle la composition de fonctions. Cela vient du fait que les fonctions dans F# + C'est ce qui s'appelle la composition de fonctions. Cela vient du fait que les fonctions en F# diff --git a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.it.xlf b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.it.xlf index cd81ada44f..72ec6792d6 100644 --- a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.it.xlf +++ b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.it.xlf @@ -699,7 +699,7 @@ they are generally faster and support fast random access. This comes at the cost of being less safe by being mutable. - sono in genere più veloci e supportano l'accesso casuale rapido. La maggiore velocità implica però una minore sicurezza in quanto questi elementi sono modificabili. + sono in genere più veloci e supportano l'accesso casuale rapido. La maggiore velocità implica però una minore sicurezza perché questi elementi sono modificabili. @@ -1299,12 +1299,12 @@ They are used extensively in F# code to represent the cases where many other - Questi valori sono ampiamente utilizzati nel codice F# per rappresentare i casi in cui molti altri + Questi valori sono ampiamente usati nel codice F# per rappresentare i casi in cui molti altri languages would use null references. - linguaggi utilizzerebbero riferimenti null. + linguaggi userebbero riferimenti Null. diff --git a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.ja.xlf b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.ja.xlf index 6e1fe4af58..2528a68e89 100644 --- a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.ja.xlf +++ b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.ja.xlf @@ -9,12 +9,12 @@ To execute the code in F# Interactive, highlight a section of code and press Alt-Enter or right-click - F# Interactive でコードを実行するには、コードの一部を強調表示して、Alt キーを押しながら Enter キーを押すか、右マウス ボタンをクリックし + F# インタラクティブでコードを実行するには、コードの一部を強調表示して、Alt キーを押しながら Enter キーを押すか、右マウス ボタンをクリックし and select "Execute in Interactive". You can open the F# Interactive Window from the "View" menu. - [対話形式で実行]5D; を選択します。[表示]5D; メニューから F# Interactive ウィンドウを開くことができます。 + [対話形式で実行]5D; を選択します。[表示]5D; メニューから F# インタラクティブ ウィンドウを開くことができます。 @@ -489,7 +489,7 @@ A shorter way to write 'squareOddValuesAndAddOne' is to nest each - 'squareOddValuesAndAddOne' を記述するためのより簡単な方法は、 + 'squareOddValuesAndAddOne' を書き込むためのより簡単な方法は、 @@ -509,7 +509,7 @@ A preferred way to write 'squareOddValuesAndAddOne' is to use F# pipe operators. - 'squareOddValuesAndAddOne' を記述するための推奨される方法は、F# パイプ演算子を使用する方法です。 + 'squareOddValuesAndAddOne' を書き込むための推奨される方法は、F# パイプ演算子を使用する方法です。 @@ -949,7 +949,7 @@ This example shows how to write a function that processes a record value. - この例では、レコード値を処理する関数を記述する方法を示します。 + この例では、レコード値を処理する関数を書き込む方法を示します。 @@ -994,7 +994,7 @@ Data stored in DUs can be one of several distinct values. - DU に格納されるデータは、複数の個別の値のいずれかになります。 + DU の格納データは、複数の個別の値のいずれかになります。 @@ -1099,7 +1099,7 @@ and the other being a Node with a value and two subtrees. - もう片方は値と 2 つのサブツリーを含むノードです。 + もう片方は値と 2 つのサブツリーを含む Node です。 @@ -1259,7 +1259,7 @@ which is useful when you're writing functions which make use of Partial Application. - これは、部分適用を利用する関数を記述している場合に役立ちます。 + これは、部分適用を利用する関数を書き込む場合に役立ちます。 diff --git a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.ko.xlf b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.ko.xlf index 98adbab087..6e4f9c147a 100644 --- a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.ko.xlf +++ b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.ko.xlf @@ -9,17 +9,17 @@ To execute the code in F# Interactive, highlight a section of code and press Alt-Enter or right-click - F# Interactive에서 코드를 실행하려면 코드 섹션을 강조 표시하고 Alt-Enter를 누르거나 마우스 오른쪽 단추를 클릭한 다음 + F# 대화형에서 코드를 실행하려면 코드 섹션을 강조 표시하고 <Alt+Enter>를 누르거나 마우스 오른쪽 단추를 클릭한 다음 and select "Execute in Interactive". You can open the F# Interactive Window from the "View" menu. - "대화형으로 실행"을 선택하세요. "보기" 메뉴에서 F# Interactive 창을 열 수 있습니다. + "대화형으로 실행"을 선택하세요. "보기" 메뉴에서 F# 대화형 창을 열 수 있습니다. For more about F#, see: - F#에 대한 자세한 내용은 다음을 참조하십시오: + F#에 대한 자세한 내용은 다음을 참조하세요. diff --git a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.pl.xlf b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.pl.xlf index bbc054b3b3..510321d6dc 100644 --- a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.pl.xlf +++ b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.pl.xlf @@ -9,12 +9,12 @@ To execute the code in F# Interactive, highlight a section of code and press Alt-Enter or right-click - Aby wykonać kod w programie F# Interactive, zaznacz sekcję kodu i naciśnij kombinację klawiszy Alt-Enter lub kliknij prawym przyciskiem myszy, + Aby wykonać kod w narzędziu F# Interactive, zaznacz sekcję kodu i naciśnij kombinację klawiszy Alt-Enter lub kliknij prawym przyciskiem myszy, and select "Execute in Interactive". You can open the F# Interactive Window from the "View" menu. - a następnie wybierz opcję „Wykonaj w programie Interactive”. Okno programu F# Interactive można otworzyć z menu „Widok”. + a następnie wybierz opcję „Wykonaj w trybie interaktywnym”. Okno narzędzia F# Interactive można otworzyć z menu „Widok”. diff --git a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.ru.xlf b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.ru.xlf index 81bf3a4523..338efcef1f 100644 --- a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.ru.xlf +++ b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.ru.xlf @@ -9,12 +9,12 @@ To execute the code in F# Interactive, highlight a section of code and press Alt-Enter or right-click - Чтобы выполнить код в интерактивном режиме F#, выделите фрагмент кода и нажмите ALT+ВВОД или щелкните правой кнопкой мыши + Чтобы выполнить код в F# Interactive, выделите фрагмент кода и нажмите ALT+ВВОД или щелкните правой кнопкой мыши and select "Execute in Interactive". You can open the F# Interactive Window from the "View" menu. - и выберите команду "Выполнение в интерактивном режиме". Интерактивное окно F# можно также открыть из меню "Вид". + и выберите команду "Выполнение в Interactive". Окно F# Interactive можно также открыть из меню "Вид". diff --git a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.tr.xlf b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.tr.xlf index ee608d25f2..cc131aae88 100644 --- a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.tr.xlf +++ b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.tr.xlf @@ -9,7 +9,7 @@ To execute the code in F# Interactive, highlight a section of code and press Alt-Enter or right-click - Kodu Etkileşimli F#'da yürütmek için kodun bir bölümünü vurgulayın ve Alt-Enter'a basın veya sağ tıklatın + Kodu F# Etkileşimli'de yürütmek için kodun bir bölümünü vurgulayın ve Alt-Enter'a basın veya sağ tıklatın diff --git a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.zh-Hans.xlf b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.zh-Hans.xlf index 99965aaf19..80f00248fc 100644 --- a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.zh-Hans.xlf +++ b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.zh-Hans.xlf @@ -9,12 +9,12 @@ To execute the code in F# Interactive, highlight a section of code and press Alt-Enter or right-click - 若要在 F# 交互中执行代码,请突出显示一个代码节并按 Alt-Enter 或右击 + 若要在 F# 交互窗口中执行代码,请突出显示一个代码节并按 Alt-Enter 或右击 and select "Execute in Interactive". You can open the F# Interactive Window from the "View" menu. - 并选择“在 Interactive 中执行”。 可从“视图”菜单中打开 F# 交互窗口。 + 并选择“在交互窗口中执行”。 可从“视图”菜单中打开 F# 交互窗口。 diff --git a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.zh-Hant.xlf b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.zh-Hant.xlf index b9a80b8d0d..128330e9ee 100644 --- a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.zh-Hant.xlf +++ b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.zh-Hant.xlf @@ -9,12 +9,12 @@ To execute the code in F# Interactive, highlight a section of code and press Alt-Enter or right-click - 若要執行 F# Interactive 中的程式碼,請反白顯示某個程式碼區段並按下 Alt-Enter,或者以滑鼠右鍵按一下 + 若要執行 F# 互動中的程式碼,請反白顯示某個程式碼區段並按下 Alt-Enter,或者以滑鼠右鍵按一下 and select "Execute in Interactive". You can open the F# Interactive Window from the "View" menu. - 並選取 [以互動方式執行]5D;。您可以從 [檢視]5D; 功能表開啟 F# Interactive 視窗。 + 並選取 [以互動方式執行]5D;。您可以從 [檢視]5D; 功能表開啟 F# 互動視窗。 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.es.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.es.xlf index 5f286a9569..8f421623fd 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.es.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.es.xlf @@ -74,7 +74,7 @@ Debug In Interactive - Depurar en Interactive + Depurar en interactivo diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.ja.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.ja.xlf index 181e3e1d41..4266774b23 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.ja.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.ja.xlf @@ -49,7 +49,7 @@ F# Interactive - F# Interactive + F# インタラクティブ @@ -84,12 +84,12 @@ &Send to F# Interactive - F# Interactive に送信(&S) + F# インタラクティブに送信(&S) &Send to F# Interactive - F# Interactive に送信(&S) + F# インタラクティブに送信(&S) @@ -99,12 +99,12 @@ &Send References to F# Interactive - 参照を F# Interactive に送信(&S) + 参照を F# インタラクティブに送信(&S) &Send References to F# Interactive - 参照を F# Interactive に送信(&S) + 参照を F# インタラクティブに送信(&S) @@ -114,12 +114,12 @@ &Send Project Output to F# Interactive - プロジェクト出力を F# Interactive に送信(&S) + プロジェクト出力を F# インタラクティブに送信(&S) &Send Project Output to F# Interactive - プロジェクト出力を F# Interactive に送信(&S) + プロジェクト出力を F# インタラクティブに送信(&S) diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.ko.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.ko.xlf index 4f24ffe248..626dd1404f 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.ko.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.ko.xlf @@ -49,7 +49,7 @@ F# Interactive - F# Interactive + F# 대화형 @@ -74,7 +74,7 @@ Debug In Interactive - Interactive에서 디버그 + 대화형에서 디버그 @@ -84,12 +84,12 @@ &Send to F# Interactive - F# Interactive로 보내기(&S) + F# 대화형으로 보내기(&S) &Send to F# Interactive - F# Interactive로 보내기(&S) + F# 대화형으로 보내기(&S) @@ -99,12 +99,12 @@ &Send References to F# Interactive - F# Interactive로 참조 보내기(&S) + F# 대화형으로 참조 보내기(&S) &Send References to F# Interactive - F# Interactive로 참조 보내기(&S) + F# 대화형으로 참조 보내기(&S) @@ -114,12 +114,12 @@ &Send Project Output to F# Interactive - F# Interactive로 프로젝트 출력 보내기(&S) + F# 대화형으로 프로젝트 출력 보내기(&S) &Send Project Output to F# Interactive - F# Interactive로 프로젝트 출력 보내기(&S) + F# 대화형으로 프로젝트 출력 보내기(&S) diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.pl.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.pl.xlf index ed56d4a9d1..0b59a2dd7d 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.pl.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.pl.xlf @@ -74,7 +74,7 @@ Debug In Interactive - Debuguj w programie Interactive + Debuguj w trybie interaktywnym diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.ru.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.ru.xlf index 77e44dc54e..0af53178de 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.ru.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.ru.xlf @@ -74,7 +74,7 @@ Debug In Interactive - Интерактивная отладка + Отладка в Interactive diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.tr.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.tr.xlf index 94f40d1055..4ac66f5451 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.tr.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.tr.xlf @@ -49,7 +49,7 @@ F# Interactive - F# Interactive + F# Etkileşimli @@ -74,7 +74,7 @@ Debug In Interactive - Etkileşimde Hata Ayıklama + Etkileşimli’de Hata Ayıklama @@ -84,12 +84,12 @@ &Send to F# Interactive - &F# Interactive'e Gönder + &F# Etkileşimli'ye Gönder &Send to F# Interactive - &F# Interactive'e Gönder + &F# Etkileşimli'ye Gönder @@ -99,12 +99,12 @@ &Send References to F# Interactive - &Başvuruları F# Interactive'e Gönder + &Başvuruları F# Etkileşimli'ye Gönder &Send References to F# Interactive - &Başvuruları F# Interactive'e Gönder + &Başvuruları F# Etkileşimli'ye Gönder @@ -114,12 +114,12 @@ &Send Project Output to F# Interactive - &Proje Çıkışını F# Interactive'e Gönder + &Proje Çıkışını F# Etkileşimli'ye Gönder &Send Project Output to F# Interactive - &Proje Çıkışını F# Interactive'e Gönder + &Proje Çıkışını F# Etkileşimli'ye Gönder diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.zh-Hans.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.zh-Hans.xlf index 102b31ba7b..e6ee3a7ac1 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.zh-Hans.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.zh-Hans.xlf @@ -49,7 +49,7 @@ F# Interactive - F# 交互 + F# 交互窗口 @@ -74,7 +74,7 @@ Debug In Interactive - Interactive 中的调试 + 交互窗口中的调试 @@ -84,12 +84,12 @@ &Send to F# Interactive - 发送到 F# 交互(&S) + 发送到 F# 交互窗口(&S) &Send to F# Interactive - 发送到 F# 交互(&S) + 发送到 F# 交互窗口(&S) @@ -99,12 +99,12 @@ &Send References to F# Interactive - 将引用发送到 F# 交互(&S) + 将引用发送到 F# 交互窗口(&S) &Send References to F# Interactive - 将引用发送到 F# 交互(&S) + 将引用发送到 F# 交互窗口(&S) @@ -114,12 +114,12 @@ &Send Project Output to F# Interactive - 将项目输出发送到 F# 交互(&S) + 将项目输出发送到 F# 交互窗口(&S) &Send Project Output to F# Interactive - 将项目输出发送到 F# 交互(&S) + 将项目输出发送到 F# 交互窗口(&S) diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.zh-Hant.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.zh-Hant.xlf index be349e3b8e..af5e9e57b4 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.zh-Hant.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.zh-Hant.xlf @@ -49,7 +49,7 @@ F# Interactive - F# Interactive + F# 互動 @@ -84,12 +84,12 @@ &Send to F# Interactive - 傳送到 F# Interactive(&S) + 傳送到 F# 互動 (&S) &Send to F# Interactive - 傳送到 F# Interactive(&S) + 傳送到 F# 互動 (&S) @@ -99,12 +99,12 @@ &Send References to F# Interactive - 傳送參考到 F# Interactive(&S) + 傳送參考到 F# 互動 (&S) &Send References to F# Interactive - 傳送參考到 F# Interactive(&S) + 傳送參考到 F# 互動 (&S) @@ -114,12 +114,12 @@ &Send Project Output to F# Interactive - 傳送專案輸出到 F# Interactive(&S) + 傳送專案輸出到 F# 互動 (&S) &Send Project Output to F# Interactive - 傳送專案輸出到 F# Interactive(&S) + 傳送專案輸出到 F# 互動 (&S) diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.de.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.de.xlf index 02cbc8a503..eadfaa3a17 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.de.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.de.xlf @@ -524,7 +524,7 @@ Reference Manager - {0} - Verweis-Manager - {0} + Verweis-Manager – {0} diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.it.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.it.xlf index e7f5739ea4..df3921e5d3 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.it.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.it.xlf @@ -64,7 +64,7 @@ Sets the .ico file to use as your application icon. - Imposta il file ico da utilizzare come icona dell'applicazione. + Consente di impostare il file con estensione da usare come icona dell'applicazione. @@ -114,7 +114,7 @@ Target Platform Location - Percorso della piattaforma di destinazione + Percorso piattaforma di destinazione @@ -329,7 +329,7 @@ A project item for consuming a .NET Managed Resources File (Resx) using ResxFile type provider. - Elemento di progetto per l'utilizzo di un file di risorse gestite .NET (Resx) utilizzando il provider di tipi ResxFile. + Elemento di progetto per l'utilizzo di un file di risorse gestite .NET (Resx) con il provider di tipi ResxFile. @@ -339,7 +339,7 @@ A project item for using the SqlDataConnection (LINQ to SQL) type provider to generate types and consume data in a live SQL database. - Elemento di progetto per l'utilizzo del provider di tipi SqlDataConnection (LINQ to SQL) per generare i tipi e utilizzare i dati in un database SQL attivo. + Elemento di progetto per l'uso del provider di tipi SqlDataConnection (LINQ to SQL) per generare i tipi e utilizzare i dati in un database SQL attivo. @@ -349,7 +349,7 @@ A project item for using the SqlEntityConnection (Entity Data Model) type provider to generate types and consume data in a live SQL database. - Elemento di progetto per l'utilizzo del provider di tipi SqlEntityConnection (Entity Data Model) per generare i tipi e utilizzare i dati in un database SQL attivo. + Elemento di progetto per l'uso del provider di tipi SqlEntityConnection (Entity Data Model) per generare i tipi e utilizzare i dati in un database SQL attivo. @@ -539,7 +539,7 @@ All of the Framework assemblies are already referenced. Please use the Object Browser to explore the references in the Framework. - Si è già fatto riferimento a tutti gli assembly del framework. Utilizzare Visualizzatore oggetti per esplorare i riferimenti nel framework. + Si è già fatto riferimento a tutti gli assembly del framework. Usare Visualizzatore oggetti per esplorare i riferimenti nel framework. diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ja.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ja.xlf index a93164380e..a4058bdf90 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ja.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ja.xlf @@ -329,7 +329,7 @@ A project item for consuming a .NET Managed Resources File (Resx) using ResxFile type provider. - ResxFile 型プロバイダーを使用して .NET マネージ リソース ファイル (Resx) を使用するためのプロジェクト アイテムです。 + ResxFile 型プロバイダーを使用して .NET マネージド リソース ファイル (Resx) を使用するためのプロジェクト アイテムです。 @@ -409,7 +409,7 @@ F# Interactive - F# Interactive + F# インタラクティブ @@ -459,7 +459,7 @@ F# Interactive - F# Interactive + F# インタラクティブ @@ -509,7 +509,7 @@ Change path and command line arguments passed to the F# Interactive - F# Interactive に渡されるパスとコマンド ライン引数を変更します + F# インタラクティブに渡されるパスとコマンド ライン引数を変更します diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ko.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ko.xlf index 01446eb80d..6ffce1b1ef 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ko.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ko.xlf @@ -409,7 +409,7 @@ F# Interactive - F# Interactive + F# 대화형 @@ -459,7 +459,7 @@ F# Interactive - F# Interactive + F# 대화형 @@ -509,7 +509,7 @@ Change path and command line arguments passed to the F# Interactive - F# Interactive에 전달된 경로 및 명령줄 인수를 변경합니다. + F# 대화형에 전달된 경로 및 명령줄 인수를 변경합니다. diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pl.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pl.xlf index 5fc2d93bc8..a9560e8e02 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pl.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pl.xlf @@ -484,7 +484,7 @@ The project '{0}' could not be opened because opening it would cause a folder to be rendered multiple times in the solution explorer. One such problematic item is '{1}'. To open this project in Visual Studio, first edit the project file and fix the problem. - Nie można otworzyć projektu „{0}”, ponieważ spowodowałoby to wielokrotne zrenderowanie folderu w eksploratorze rozwiązań. Jednym z elementów powodujących problemy jest „{1}”. Aby otworzyć ten projekt w programie Visual Studio, najpierw edytuj plik projektu i rozwiąż problem. + Nie można otworzyć projektu „{0}”, ponieważ spowodowałoby to wielokrotne renderowanie folderu w eksploratorze rozwiązań. Jednym z elementów powodujących problemy jest „{1}”. Aby otworzyć ten projekt w programie Visual Studio, najpierw edytuj plik projektu i rozwiąż problem. @@ -509,7 +509,7 @@ Change path and command line arguments passed to the F# Interactive - Zmień ścieżkę i argumenty wiersza polecenia przekazywane do programu F# Interactive + Zmień ścieżkę i argumenty wiersza polecenia przekazywane do narzędzia F# Interactive diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.tr.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.tr.xlf index ec718c3ec1..c0a645a849 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.tr.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.tr.xlf @@ -409,7 +409,7 @@ F# Interactive - F# Interactive + F# Etkileşimli @@ -459,7 +459,7 @@ F# Interactive - F# Interactive + F# Etkileşimli @@ -509,7 +509,7 @@ Change path and command line arguments passed to the F# Interactive - Yolu ve F# Interactive'e geçirilen komut satırı bağımsız değişkenlerini değiştir + Yolu ve F# Etkileşimli'ye geçirilen komut satırı bağımsız değişkenlerini değiştir diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hans.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hans.xlf index 898b3599dc..480e260dff 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hans.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hans.xlf @@ -409,7 +409,7 @@ F# Interactive - F# 交互 + F# 交互窗口 @@ -459,7 +459,7 @@ F# Interactive - F# 交互 + F# 交互窗口 @@ -509,7 +509,7 @@ Change path and command line arguments passed to the F# Interactive - 更改传递给 F# 交互的路径和命令行参数 + 更改传递给 F# 交互窗口的路径和命令行参数 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hant.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hant.xlf index b2cb3abbc2..de4c9fa2a9 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hant.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hant.xlf @@ -409,7 +409,7 @@ F# Interactive - F# Interactive + F# 互動 @@ -459,7 +459,7 @@ F# Interactive - F# Interactive + F# 互動 @@ -509,7 +509,7 @@ Change path and command line arguments passed to the F# Interactive - 變更傳遞到 F# Interactive 的路徑和命令列引數 + 變更傳遞到 F# 互動的路徑和命令列引數 diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.cs.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.cs.xlf index 88082b432a..8b43cbae35 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.cs.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.cs.xlf @@ -34,7 +34,7 @@ Prevents referenced assemblies from being locked by the F# Interactive process. - Znemožňuje zamknutí odkazovaných sestavení interaktivním procesem jazyka F#. + Znemožňuje zamknutí odkazovaných sestavení procesem nástroje F# Interactive. diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.de.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.de.xlf index 02f16fcd19..defc84aed7 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.de.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.de.xlf @@ -4,7 +4,7 @@ 64-bit F# Interactive - 64-Bit-F# Interactive + 64-Bit-Version von F# Interactive @@ -34,7 +34,7 @@ Prevents referenced assemblies from being locked by the F# Interactive process. - Verhindert, dass referenzierte Assemblys vom interaktiven F#-Prozess gesperrt werden. + Verhindert, dass referenzierte Assemblys vom F# Interactive-Prozess gesperrt werden. diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.fr.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.fr.xlf index 98821a22a4..1c66865aea 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.fr.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.fr.xlf @@ -34,7 +34,7 @@ Prevents referenced assemblies from being locked by the F# Interactive process. - Empêche le blocage des assemblys référencés par le processus interactif F#. + Empêche le blocage des assemblys référencés par le processus de F# Interactive. diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.ja.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.ja.xlf index 86a7626559..2ecad3011a 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.ja.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.ja.xlf @@ -4,22 +4,22 @@ 64-bit F# Interactive - 64 ビット F# Interactive + 64 ビット F# インタラクティブ If set to true, and the current machine is 64-bit, then run F# Interactive as a 64-bit process. (Otherwise, F# Interactive is a 32-bit process.) - true に設定されていて、現在のコンピューターが 64 ビットである場合は、F# Interactive を 64 ビット プロセスで実行してください (そうしないと、F# Interactive は 32 ビット プロセスになります)。 + true に設定されていて、現在のコンピューターが 64 ビットである場合は、F# インタラクティブを 64 ビット プロセスで実行してください (そうしないと、F# インタラクティブは 32 ビット プロセスになります)。 F# Interactive options - F# Interactive オプション + F# インタラクティブ オプション Additional command line arguments passed to the F# Interactive executable by Visual Studio. (optimization and debug flags are ignored if script debugging is enabled) - 追加のコマンド ライン引数が Visual Studio によって F# Interactive 実行可能ファイルに渡されました。(スクリプト デバッグが有効な場合、最適化とデバッグのフラグは無視されます) + 追加のコマンド ライン引数が Visual Studio によって F# インタラクティブ実行可能ファイルに渡されました。(スクリプト デバッグが有効な場合、最適化とデバッグのフラグは無視されます) @@ -34,7 +34,7 @@ Prevents referenced assemblies from being locked by the F# Interactive process. - 参照アセンブリを F# 対話型プロセスによってロックされないようにします。 + 参照アセンブリを F# インタラクティブ プロセスによってロックされないようにします。 @@ -44,7 +44,7 @@ Enable debugging of F# scripts (may impact script performance, requires reset of F# Interactive) - F# スクリプトのデバッグを有効にする (スクリプトのパフォーマンスに影響を与える可能性があります。F# Interactive のリセットが必要です) + F# スクリプトのデバッグを有効にする (スクリプトのパフォーマンスに影響を与える可能性があります。F# インタラクティブのリセットが必要です) diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.ko.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.ko.xlf index 09b61356b7..b030fad5e5 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.ko.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.ko.xlf @@ -4,22 +4,22 @@ 64-bit F# Interactive - 64-bit F# Interactive + 64비트 F# 대화형 If set to true, and the current machine is 64-bit, then run F# Interactive as a 64-bit process. (Otherwise, F# Interactive is a 32-bit process.) - true로 설정하는 경우 현재 컴퓨터가 64비트이면 F# Interactive를 64비트 프로세스로 실행하고, 그렇지 않으면 F# Interactive가 32비트 프로세스로 실행됩니다. + true로 설정하는 경우 현재 컴퓨터가 64비트이면 F# 대화형을 64비트 프로세스로 실행하고, 그렇지 않으면 F# 대화형이 32비트 프로세스로 실행됩니다. F# Interactive options - F# Interactive 옵션 + F# 대화형 옵션 Additional command line arguments passed to the F# Interactive executable by Visual Studio. (optimization and debug flags are ignored if script debugging is enabled) - Visual Studio에서 F# Interactive 실행 파일로 전달되는 추가 명령줄 인수입니다. 스크립트 디버깅을 사용하도록 설정한 경우 최적화 및 디버그 플래그는 무시됩니다. + Visual Studio에서 F# 대화형 실행 파일로 전달되는 추가 명령줄 인수입니다. 스크립트 디버깅을 사용하도록 설정한 경우 최적화 및 디버그 플래그는 무시됩니다. @@ -34,7 +34,7 @@ Prevents referenced assemblies from being locked by the F# Interactive process. - 참조된 어셈블리가 F# Interactive 프로세스에 의해 잠기지 않도록 합니다. + 참조된 어셈블리가 F# 대화형 프로세스에 의해 잠기지 않도록 합니다. @@ -44,7 +44,7 @@ Enable debugging of F# scripts (may impact script performance, requires reset of F# Interactive) - F# 스크립트 디버깅 사용(스크립트 성능에 영향을 주고, F# Interactive를 다시 설정해야 할 수 있음) + F# 스크립트 디버깅 사용(스크립트 성능에 영향을 주고, F# 대화형을 다시 설정해야 할 수 있음) diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.pl.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.pl.xlf index be021424fa..48e1694269 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.pl.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.pl.xlf @@ -19,7 +19,7 @@ Additional command line arguments passed to the F# Interactive executable by Visual Studio. (optimization and debug flags are ignored if script debugging is enabled) - Argumenty wiersza polecenia przekazywane do pliku wykonywalnego programu F# Interactive przez program Visual Studio. (Flagi optymalizacji i debugowania są ignorowane, jeśli włączone jest debugowanie skryptów). + Argumenty wiersza polecenia przekazywane do pliku wykonywalnego narzędzia F# Interactive przez program Visual Studio. (Flagi optymalizacji i debugowania są ignorowane, jeśli włączone jest debugowanie skryptów). @@ -44,7 +44,7 @@ Enable debugging of F# scripts (may impact script performance, requires reset of F# Interactive) - Włącz debugowanie skryptów w języku F# (może to mieć wpływ na wydajność skryptów, wymaga zresetowania programu F# Interactive) + Włącz debugowanie skryptów w języku F# (może to mieć wpływ na wydajność skryptów, wymaga zresetowania narzędzia F# Interactive) diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.pt-BR.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.pt-BR.xlf index 7ff727dbdc..39b9925257 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.pt-BR.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.pt-BR.xlf @@ -4,17 +4,17 @@ 64-bit F# Interactive - F# Interative de 64 bits + F# Interativo de 64 bits If set to true, and the current machine is 64-bit, then run F# Interactive as a 64-bit process. (Otherwise, F# Interactive is a 32-bit process.) - Se estiver definido como true, e o computador atual for 64 bits, execute o F# Interactive como um processo de 64 bits. (Caso contrário, o F# Interactive será um processo de 32 bits.) + Se estiver definido como true, e o computador atual for 64 bits, execute o F# Interativo como um processo de 64 bits. (Caso contrário, o F# Interativo será um processo de 32 bits.) F# Interactive options - Opções interativas F# + Opções F# Interativo @@ -34,7 +34,7 @@ Prevents referenced assemblies from being locked by the F# Interactive process. - Impede que os assemblies referenciados sejam bloqueados pelo processo de F# interativo. + Impede que os assemblies referenciados sejam bloqueados pelo processo de F# Interativo. diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.ru.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.ru.xlf index a4acb57958..b8733de8c1 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.ru.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.ru.xlf @@ -34,7 +34,7 @@ Prevents referenced assemblies from being locked by the F# Interactive process. - Предотвращает блокировку сборок, на которые указаны ссылки, интерактивным процессом F#. + Предотвращает блокировку сборок, на которые указаны ссылки, процессом F# Interactive. diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.tr.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.tr.xlf index ef22f880df..5fef942b6e 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.tr.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.tr.xlf @@ -4,22 +4,22 @@ 64-bit F# Interactive - 64 bit F# Interactive + 64 bit F# Etkileşimli If set to true, and the current machine is 64-bit, then run F# Interactive as a 64-bit process. (Otherwise, F# Interactive is a 32-bit process.) - True olarak ayarlanırsa ve geçerli makine 64 bit ise F# Interactive'i 64 bit işlem olarak çalıştırın. (Aksi takdirde F# Interactive 32 bit işlemdir.) + True olarak ayarlanırsa ve geçerli makine 64 bit ise F# Etkileşimli'yi 64 bit işlem olarak çalıştırın. (Aksi takdirde F# Etkileşimli 32 bit işlemdir.) F# Interactive options - F# Interactive seçenekleri + F# Etkileşimli seçenekleri Additional command line arguments passed to the F# Interactive executable by Visual Studio. (optimization and debug flags are ignored if script debugging is enabled) - Visual Studio tarafından çalıştırılabilen F# Interactive'e geçirilmiş ek komut satırı bağımsız değişkenleri. (Betik hata ayıklaması etkinleştirilmişse en iyi duruma getirme ve hata ayıklama bayrakları yok sayılır.) + Visual Studio tarafından çalıştırılabilen F# Etkileşimli'ye geçirilmiş ek komut satırı bağımsız değişkenleri. (Betik hata ayıklaması etkinleştirilmişse en iyi duruma getirme ve hata ayıklama bayrakları yok sayılır.) @@ -44,7 +44,7 @@ Enable debugging of F# scripts (may impact script performance, requires reset of F# Interactive) - F# betiklerinde hata ayıklamayı etkinleştir (betik performansını etkileyebilir, F# Interactive'in sıfırlanmasını gerektirir) + F# betiklerinde hata ayıklamayı etkinleştir (betik performansını etkileyebilir, F# Etkileşimli'nin sıfırlanmasını gerektirir) diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.zh-Hans.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.zh-Hans.xlf index 9ee4a212ea..19c1475592 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.zh-Hans.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.zh-Hans.xlf @@ -4,22 +4,22 @@ 64-bit F# Interactive - 64 位 F# 交互 + 64 位 F# 交互窗口 If set to true, and the current machine is 64-bit, then run F# Interactive as a 64-bit process. (Otherwise, F# Interactive is a 32-bit process.) - 如果设为 true,且当前计算机是 64 位的,则将 F# 交互作为 64 位进程运行。(否则,F# 交互为 32 位进程。) + 如果设为 true,且当前计算机是 64 位的,则将 F# 交互窗口作为 64 位进程运行。(否则,F# 交互窗口为 32 位进程。) F# Interactive options - F# 交互选项 + F# 交互窗口选项 Additional command line arguments passed to the F# Interactive executable by Visual Studio. (optimization and debug flags are ignored if script debugging is enabled) - 其他命令行参数传递到 Visual Studio 执行的 F# 交互可执行文件。(若已启动脚本调试,则忽略优化和调试标志) + 其他命令行参数传递到 Visual Studio 执行的 F# 交互窗口可执行文件。(若已启动脚本调试,则忽略优化和调试标志) @@ -34,7 +34,7 @@ Prevents referenced assemblies from being locked by the F# Interactive process. - 防止被引用的程序集被 F# 交互式进程锁定。 + 防止被引用的程序集被 F# 交互窗口进程锁定。 @@ -44,7 +44,7 @@ Enable debugging of F# scripts (may impact script performance, requires reset of F# Interactive) - 启用 F# 脚本的调试(可能会影响脚本性能,需要重置 F# 交互) + 启用 F# 脚本的调试(可能会影响脚本性能,需要重置 F# 交互窗口) diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.zh-Hant.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.zh-Hant.xlf index f073907740..dd4f7af326 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.zh-Hant.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.zh-Hant.xlf @@ -4,22 +4,22 @@ 64-bit F# Interactive - 64 位元 F# Interactive + 64 位元 F# 互動 If set to true, and the current machine is 64-bit, then run F# Interactive as a 64-bit process. (Otherwise, F# Interactive is a 32-bit process.) - 如果設為 true,並且目前電腦為 64 位元,則 F# Interactive 會當做 64 位元處理序來執行 (反之,F# Interactive 則為 32 位元處理序)。 + 如果設為 true,並且目前電腦為 64 位元,則 F# 互動會當做 64 位元處理序來執行 (反之,F# 互動則為 32 位元處理序)。 F# Interactive options - F# Interactive 選項 + F# 互動選項 Additional command line arguments passed to the F# Interactive executable by Visual Studio. (optimization and debug flags are ignored if script debugging is enabled) - 由 Visual Studio 額外傳遞給 F# Interactive 可執行檔的命令列引數。(若啟用指令碼偵錯,則會忽略最佳化及偵錯旗標) + 由 Visual Studio 額外傳遞給 F# 互動可執行檔的命令列引數。(若啟用指令碼偵錯,則會忽略最佳化及偵錯旗標) @@ -34,7 +34,7 @@ Prevents referenced assemblies from being locked by the F# Interactive process. - 避免參考的組件遭 F# 互動式處理序封鎖。 + 避免參考的組件遭 F# 互動處理序封鎖。 @@ -44,7 +44,7 @@ Enable debugging of F# scripts (may impact script performance, requires reset of F# Interactive) - 啟用 F# 指令碼偵錯 (可能會影響指令碼效能,必須重設 F# Interactive) + 啟用 F# 指令碼偵錯 (可能會影響指令碼效能,必須重設 F# 互動) diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.cs.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.cs.xlf index b79b747fad..82a60809e7 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.cs.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.cs.xlf @@ -4,7 +4,7 @@ Cannot create window F# Interactive ToolWindow - Nedá se vytvořit Okno nástrojů F# Interactive. + Nedá se vytvořit Okno nástroje F# Interactive. diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.de.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.de.xlf index c241350805..e8dabd63d6 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.de.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.de.xlf @@ -4,7 +4,7 @@ Cannot create window F# Interactive ToolWindow - Das Fenster für F# Interactive ToolWindow kann nicht erstellt werden. + Das F# Interactive-Toolfenster kann nicht erstellt werden. diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.ja.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.ja.xlf index 6c377da902..83d693f545 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.ja.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.ja.xlf @@ -29,12 +29,12 @@ F# Interactive - F# Interactive + F# インタラクティブ Could not find fsi.exe, the F# Interactive executable.\nThis file does not exist:\n\n{0}\n - F# Interactive 実行可能ファイルである fsi.exe が見つかりませんでした。\nこのファイルは存在しません:\n\n{0}\n + F# インタラクティブ実行可能ファイルである fsi.exe が見つかりませんでした。\nこのファイルは存在しません:\n\n{0}\n @@ -44,7 +44,7 @@ The current F# Interactive session is not configured for debugging. For the best experience, enable debugging in F# Interactive settings, then reset the session.\n\nAttempt debugging with current settings? - 現在の F# Interactive セッションは、デバッグのために構成されていません。最適にご利用いただくには、F# Interactive 設定でデバッグを有効にし、セッションをリセットしてください。\n\n現在の設定でデバッグを試みますか? + 現在の F# インタラクティブ セッションは、デバッグのために構成されていません。最適にご利用いただくには、F# インタラクティブ設定でデバッグを有効にし、セッションをリセットしてください。\n\n現在の設定でデバッグを試みますか? diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.ko.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.ko.xlf index de1927894c..5f01c48a66 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.ko.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.ko.xlf @@ -4,7 +4,7 @@ Cannot create window F# Interactive ToolWindow - F# Interactive ToolWindow 창을 만들 수 없습니다. + F# 대화형 ToolWindow 창을 만들 수 없습니다. @@ -29,12 +29,12 @@ F# Interactive - F# Interactive + F# 대화형 Could not find fsi.exe, the F# Interactive executable.\nThis file does not exist:\n\n{0}\n - F# Interactive 실행 파일 fsi.exe를 찾을 수 없습니다.\n이 파일이 없습니다.\n\n{0}\n + F# 대화형 실행 파일 fsi.exe를 찾을 수 없습니다.\n이 파일이 없습니다.\n\n{0}\n @@ -44,7 +44,7 @@ The current F# Interactive session is not configured for debugging. For the best experience, enable debugging in F# Interactive settings, then reset the session.\n\nAttempt debugging with current settings? - 현재 F# Interactive 세션이 디버깅용으로 구성되지 않았습니다. 최상의 환경을 유지하려면 F# Interactive 설정에서 디버깅을 사용하도록 설정한 다음 세션을 다시 설정하세요.\n\n현재 설정으로 디버깅을 시도할까요? + 현재 F# 대화형 세션이 디버깅용으로 구성되지 않았습니다. 최상의 환경을 유지하려면 F# 대화형 설정에서 디버깅을 사용하도록 설정한 다음, 세션을 다시 설정하세요.\n\n현재 설정으로 디버깅을 시도하시겠습니까? diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.pl.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.pl.xlf index 29a4607675..34a6486541 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.pl.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.pl.xlf @@ -44,7 +44,7 @@ The current F# Interactive session is not configured for debugging. For the best experience, enable debugging in F# Interactive settings, then reset the session.\n\nAttempt debugging with current settings? - Bieżąca sesja programu F# Interactive nie jest skonfigurowana do debugowania. Aby uzyskać najlepszy efekt, włącz debugowanie w ustawieniach programu F# Interactive, a następnie zresetuj sesję.\n\nPodjąć próbę debugowania z bieżącymi ustawieniami? + Bieżąca sesja narzędzia F# Interactive nie jest skonfigurowana do debugowania. Aby uzyskać najlepszy efekt, włącz debugowanie w ustawieniach narzędzia F# Interactive, a następnie zresetuj sesję.\n\nPodjąć próbę debugowania z bieżącymi ustawieniami? diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.pt-BR.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.pt-BR.xlf index e09d486218..50aff66765 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.pt-BR.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.pt-BR.xlf @@ -4,7 +4,7 @@ Cannot create window F# Interactive ToolWindow - Não é possível criar a Janela interativa F# ToolWindow + Não é possível criar a Janela F# Interativo ToolWindow @@ -34,7 +34,7 @@ Could not find fsi.exe, the F# Interactive executable.\nThis file does not exist:\n\n{0}\n - Não foi possível encontrar fsi.exe, o Executável interativo F#.\nEste arquivo não existe:\n\n{0}\n + Não foi possível encontrar fsi.exe, o Executável F# Interativo.\nEste arquivo não existe:\n\n{0}\n diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.tr.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.tr.xlf index 41ee78b871..6d80fb6bee 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.tr.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.tr.xlf @@ -4,7 +4,7 @@ Cannot create window F# Interactive ToolWindow - F# Interactive ToolWindow penceresi oluşturulamıyor + F# Etkileşimli ToolWindow penceresi oluşturulamıyor @@ -29,12 +29,12 @@ F# Interactive - F# Interactive + F# Etkileşimli Could not find fsi.exe, the F# Interactive executable.\nThis file does not exist:\n\n{0}\n - F# Interactive çalıştırılabilir dosyası olan fsi.exe bulunamıyor.\nBu dosya yok:\n\n{0}\n + F# Etkileşimli çalıştırılabilir dosyası olan fsi.exe bulunamıyor.\nBu dosya yok:\n\n{0}\n @@ -44,7 +44,7 @@ The current F# Interactive session is not configured for debugging. For the best experience, enable debugging in F# Interactive settings, then reset the session.\n\nAttempt debugging with current settings? - Geçerli F# Interactive oturumu hata ayıklama için yapılandırılmamış. En iyi deneyim için, F# Interactive ayarlarında hata ayıklamayı etkinleştirin ve ardından oturumu sıfırlayın.\n\nGeçerli ayarlarla hata ayıklama denensin mi? + Geçerli F# Etkileşimli oturumu hata ayıklama için yapılandırılmamış. En iyi deneyim için, F# Etkileşimli ayarlarında hata ayıklamayı etkinleştirin ve ardından oturumu sıfırlayın.\n\nGeçerli ayarlarla hata ayıklama denensin mi? diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.zh-Hans.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.zh-Hans.xlf index 2340318ee6..3124ad3236 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.zh-Hans.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.zh-Hans.xlf @@ -4,7 +4,7 @@ Cannot create window F# Interactive ToolWindow - 无法创建窗口 F# 交互 ToolWindow + 无法创建“F# 交互窗口”工具窗口 @@ -29,12 +29,12 @@ F# Interactive - F# 交互 + F# 交互窗口 Could not find fsi.exe, the F# Interactive executable.\nThis file does not exist:\n\n{0}\n - 未能找到 F# 交互可执行文件 fsi.exe。\n此文件不存在:\n\n{0}\n + 未能找到 F# 交互窗口可执行文件 fsi.exe。\n此文件不存在:\n\n{0}\n @@ -44,7 +44,7 @@ The current F# Interactive session is not configured for debugging. For the best experience, enable debugging in F# Interactive settings, then reset the session.\n\nAttempt debugging with current settings? - 当前 F# 交互会话未进行调试配置。为实现最佳体验,请启用 F# 交互设置中的调试,然后重置会话。\n\n是否尝试用当前设置进行调试? + 当前 F# 窗口会话未进行调试配置。为实现最佳体验,请启用 F# 交互窗口设置中的调试,然后重置会话。\n\n是否尝试用当前设置进行调试? diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.zh-Hant.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.zh-Hant.xlf index 1fff22f170..ba06ff3281 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.zh-Hant.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.zh-Hant.xlf @@ -4,7 +4,7 @@ Cannot create window F# Interactive ToolWindow - 無法建立視窗 F# Interactive 工具視窗 + 無法建立視窗 F# 互動工具視窗 @@ -29,12 +29,12 @@ F# Interactive - F# Interactive + F# 互動 Could not find fsi.exe, the F# Interactive executable.\nThis file does not exist:\n\n{0}\n - 找不到 F# Interactive 可執行檔 fsi.exe。\n這個檔案不存在:\n\n{0}\n + 找不到 F# 互動可執行檔 fsi.exe。\n這個檔案不存在:\n\n{0}\n @@ -44,7 +44,7 @@ The current F# Interactive session is not configured for debugging. For the best experience, enable debugging in F# Interactive settings, then reset the session.\n\nAttempt debugging with current settings? - 目前的 F# Interactive 工作階段並未設定偵錯功能。最佳做法是啟用 F# Interactive 設定中的偵錯設定,然後重設此工作階段。\n\n要嘗試使用目前的設定進行偵錯嗎? + 目前的 F# 互動工作階段並未設定偵錯功能。最佳做法是啟用 F# 互動設定中的偵錯設定,然後重設此工作階段。\n\n要嘗試使用目前的設定進行偵錯嗎? From dde48f1121365443b09f77b052227044ebc327d9 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Mon, 6 Aug 2018 10:34:05 -0700 Subject: [PATCH 129/150] Under some scenarios al build task cannot find the sdk build tools (#5460) --- build.cmd | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/build.cmd b/build.cmd index 89f6361eb1..c72308a2d1 100644 --- a/build.cmd +++ b/build.cmd @@ -555,6 +555,14 @@ echo. echo. echo ---------------- Done with arguments, starting preparation ----------------- +rem set TargetFrameworkSDKToolsDirectory --- needed for sdk to find al.exe. +if not "%TargetFrameworkSDKToolsDirectory%" == "" ( goto have_TargetFrameworkSDKToolsDirectory ) +set TargetFrameworkSDKToolsDirectory=%WindowsSDK_ExecutablePath_x64% + +if not "%TargetFrameworkSDKToolsDirectory%" == "" ( goto have_TargetFrameworkSDKToolsDirectory ) +set TargetFrameworkSDKToolsDirectory=%WindowsSDK_ExecutablePath_x86% + +:have_TargetFrameworkSDKToolsDirectory set BuildToolsPackage=Microsoft.VSSDK.BuildTools.15.6.170 if "%VSSDKInstall%"=="" ( @@ -574,6 +582,7 @@ if "%RestorePackages%"=="" ( @echo VSSDKInstall: %VSSDKInstall% @echo VSSDKToolsPath: %VSSDKToolsPath% @echo VSSDKIncludes: %VSSDKIncludes% +@echo TargetFrameworkSDKToolsDirectory: %TargetFrameworkSDKToolsDirectory% @call src\update.cmd signonly From 1af4f56ac6d30ccb40ed0fedf70157f985ee5f3e Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Mon, 6 Aug 2018 10:34:48 -0700 Subject: [PATCH 130/150] End-2-end tests (#5462) --- .../BasicProvider.Tests/BasicProvider.Tests.fsproj | 12 ++++++++++-- .../ComboProvider.Tests/ComboProvider.Tests.fsproj | 7 +++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/tests/EndToEndBuildTests/BasicProvider/BasicProvider.Tests/BasicProvider.Tests.fsproj b/tests/EndToEndBuildTests/BasicProvider/BasicProvider.Tests/BasicProvider.Tests.fsproj index 4adb25a718..ea6a3b75b5 100644 --- a/tests/EndToEndBuildTests/BasicProvider/BasicProvider.Tests/BasicProvider.Tests.fsproj +++ b/tests/EndToEndBuildTests/BasicProvider/BasicProvider.Tests/BasicProvider.Tests.fsproj @@ -1,4 +1,5 @@  + Library netcoreapp2.0 @@ -19,6 +20,13 @@ - - \ No newline at end of file + + + + + + + + + diff --git a/tests/EndToEndBuildTests/ComboProvider/ComboProvider.Tests/ComboProvider.Tests.fsproj b/tests/EndToEndBuildTests/ComboProvider/ComboProvider.Tests/ComboProvider.Tests.fsproj index 3f1308f644..7101aa290b 100644 --- a/tests/EndToEndBuildTests/ComboProvider/ComboProvider.Tests/ComboProvider.Tests.fsproj +++ b/tests/EndToEndBuildTests/ComboProvider/ComboProvider.Tests/ComboProvider.Tests.fsproj @@ -22,4 +22,11 @@ + + + + + + + \ No newline at end of file From 3c7f59e61ea15d5db31fa7c55d13ed3726236fec Mon Sep 17 00:00:00 2001 From: Vasily Kirichenko Date: Tue, 7 Aug 2018 20:26:22 +0300 Subject: [PATCH 131/150] Custom operations are at the top of completion list & remove active pattern values from the list (#4831) * custom operations are at the top of completion list * do not pick rhs NameResolutionEnvironment in completion if it corresponds to a computation expression * Revert "do not pick rhs NameResolutionEnvironment in completion if it corresponds to a computation expression" This reverts commit 4548ca2ea2fb730f9b896462bd00745621e3b245. * fix after merge * put active patterns (as functions) to the very end of completion list * filter out active patterns-as-value from completion list * Revert "put active patterns (as functions) to the very end of completion list" This reverts commit c26b24cc4a730bb0f741b73f39cc4601b7810127. --- src/fsharp/service/ServiceDeclarationLists.fs | 14 +++++++++++--- src/fsharp/service/service.fs | 1 + src/fsharp/symbols/SymbolHelpers.fs | 1 + src/fsharp/symbols/SymbolHelpers.fsi | 1 + .../FSharp.Editor/Completion/CompletionUtils.fs | 15 ++++++++------- .../tests/UnitTests/CompletionProviderTests.fs | 14 ++++++++++++++ 6 files changed, 36 insertions(+), 10 deletions(-) diff --git a/src/fsharp/service/ServiceDeclarationLists.fs b/src/fsharp/service/ServiceDeclarationLists.fs index 838d221ead..85d7249f61 100644 --- a/src/fsharp/service/ServiceDeclarationLists.fs +++ b/src/fsharp/service/ServiceDeclarationLists.fs @@ -615,15 +615,23 @@ type FSharpDeclarationListInfo(declarations: FSharpDeclarationListItem[], isForT | None -> item.Item.DisplayName name, items) - // Filter out operators (and list) + // Filter out operators, active patterns (as values) and the empty list let items = // Check whether this item looks like an operator. let isOperatorItem(name, items: CompletionItem list) = match items |> List.map (fun x -> x.Item) with | [Item.Value _ | Item.MethodGroup _ | Item.UnionCase _] -> IsOperatorName name | _ -> false - let isFSharpList name = (name = "[]") // list shows up as a Type and a UnionCase, only such entity with a symbolic name, but want to filter out of intellisense - items |> List.filter (fun (displayName, items) -> not (isOperatorItem(displayName, items)) && not (isFSharpList displayName)) + + let isActivePatternItem (items: CompletionItem list) = + match items |> List.map (fun x -> x.Item) with + | [Item.Value vref] -> IsActivePatternName vref.CompiledName + | _ -> false + + items |> List.filter (fun (displayName, items) -> + not (isOperatorItem(displayName, items)) && + not (displayName = "[]") && // list shows up as a Type and a UnionCase, only such entity with a symbolic name, but want to filter out of intellisense + not (isActivePatternItem items)) let decls = items diff --git a/src/fsharp/service/service.fs b/src/fsharp/service/service.fs index 34e2e9d2d5..07c95abc5a 100644 --- a/src/fsharp/service/service.fs +++ b/src/fsharp/service/service.fs @@ -577,6 +577,7 @@ type TypeCheckInfo | Item.Event _ -> CompletionItemKind.Event | Item.ILField _ | Item.Value _ -> CompletionItemKind.Field + | Item.CustomOperation _ -> CompletionItemKind.CustomOperation | _ -> CompletionItemKind.Other { ItemWithInst = item diff --git a/src/fsharp/symbols/SymbolHelpers.fs b/src/fsharp/symbols/SymbolHelpers.fs index f7450623ec..2a3031e004 100644 --- a/src/fsharp/symbols/SymbolHelpers.fs +++ b/src/fsharp/symbols/SymbolHelpers.fs @@ -275,6 +275,7 @@ type CompletionItemKind = | Method of isExtension : bool | Event | Argument + | CustomOperation | Other type UnresolvedSymbol = diff --git a/src/fsharp/symbols/SymbolHelpers.fsi b/src/fsharp/symbols/SymbolHelpers.fsi index 03d62d4aec..cbc351baf5 100755 --- a/src/fsharp/symbols/SymbolHelpers.fsi +++ b/src/fsharp/symbols/SymbolHelpers.fsi @@ -113,6 +113,7 @@ type public CompletionItemKind = | Method of isExtension : bool | Event | Argument + | CustomOperation | Other type UnresolvedSymbol = diff --git a/vsintegration/src/FSharp.Editor/Completion/CompletionUtils.fs b/vsintegration/src/FSharp.Editor/Completion/CompletionUtils.fs index 2abba274ac..705128a3e1 100644 --- a/vsintegration/src/FSharp.Editor/Completion/CompletionUtils.fs +++ b/vsintegration/src/FSharp.Editor/Completion/CompletionUtils.fs @@ -102,10 +102,11 @@ module internal CompletionUtils = let inline getKindPriority kind = match kind with - | CompletionItemKind.Property -> 0 - | CompletionItemKind.Field -> 1 - | CompletionItemKind.Method (isExtension = false) -> 2 - | CompletionItemKind.Event -> 3 - | CompletionItemKind.Argument -> 4 - | CompletionItemKind.Other -> 5 - | CompletionItemKind.Method (isExtension = true) -> 6 \ No newline at end of file + | CompletionItemKind.CustomOperation -> 0 + | CompletionItemKind.Property -> 1 + | CompletionItemKind.Field -> 2 + | CompletionItemKind.Method (isExtension = false) -> 3 + | CompletionItemKind.Event -> 4 + | CompletionItemKind.Argument -> 5 + | CompletionItemKind.Other -> 6 + | CompletionItemKind.Method (isExtension = true) -> 7 \ No newline at end of file diff --git a/vsintegration/tests/UnitTests/CompletionProviderTests.fs b/vsintegration/tests/UnitTests/CompletionProviderTests.fs index 5accd920ef..794d959946 100644 --- a/vsintegration/tests/UnitTests/CompletionProviderTests.fs +++ b/vsintegration/tests/UnitTests/CompletionProviderTests.fs @@ -603,6 +603,20 @@ module M2 = """ VerifyCompletionList(fileContents, " Ext", ["Extensions"; "ExtraTopLevelOperators"], []) +[] +let ``Custom operations should be at the top of completion list inside computation expression``() = + let fileContents = """ +let joinLocal = 1 + +let _ = + query { + for i in 1..10 do + select i + join + } +""" + VerifyCompletionList(fileContents, " join", ["groupJoin"; "join"; "leftOuterJoin"; "joinLocal"], []) + #if EXE ShouldDisplaySystemNamespace() #endif From e65d2e682ca1df1c411feba675e7427c3228a658 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Wed, 8 Aug 2018 14:56:57 -0700 Subject: [PATCH 132/150] Fixes: #5470 (#5480) --- src/fsharp/FSharp.Build/FSharp.Build.fsproj | 4 +++- .../FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj | 3 --- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/fsharp/FSharp.Build/FSharp.Build.fsproj b/src/fsharp/FSharp.Build/FSharp.Build.fsproj index 81876081b5..0046e73338 100644 --- a/src/fsharp/FSharp.Build/FSharp.Build.fsproj +++ b/src/fsharp/FSharp.Build/FSharp.Build.fsproj @@ -40,7 +40,6 @@ - @@ -68,6 +67,9 @@ $(FSharpSourcesRoot)\..\packages\System.IO.Compression.$(SystemIoCompressionPackageVersion)\lib\net46\System.IO.Compression.dll + + $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Type.Providers.Redist.$(MicrosoftVisualFSharpTypeProvidersRedistPackageVersion)\content\4.3.0.0\FSharp.Data.TypeProviders.dll + diff --git a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj index 1c2ce9e86a..4b5affe091 100644 --- a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj +++ b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj @@ -702,9 +702,6 @@ $(FSharpSourcesRoot)\..\packages\System.IO.Compression.$(SystemIoCompressionPackageVersion)\lib\net46\System.IO.Compression.dll - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Type.Providers.Redist.$(MicrosoftVisualFSharpTypeProvidersRedistPackageVersion)\content\4.3.0.0\FSharp.Data.TypeProviders.dll - From 7f40a5028817bee330f06409d04067684eb03846 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Wed, 8 Aug 2018 23:53:49 -0700 Subject: [PATCH 133/150] Remove a ton of build warnings (#5483) --- build.cmd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.cmd b/build.cmd index c72308a2d1..f2b092b7b0 100644 --- a/build.cmd +++ b/build.cmd @@ -557,10 +557,10 @@ echo. echo ---------------- Done with arguments, starting preparation ----------------- rem set TargetFrameworkSDKToolsDirectory --- needed for sdk to find al.exe. if not "%TargetFrameworkSDKToolsDirectory%" == "" ( goto have_TargetFrameworkSDKToolsDirectory ) -set TargetFrameworkSDKToolsDirectory=%WindowsSDK_ExecutablePath_x64% +set TargetFrameworkSDKToolsDirectory=%WindowsSDK_ExecutablePath_x64% if not "%TargetFrameworkSDKToolsDirectory%" == "" ( goto have_TargetFrameworkSDKToolsDirectory ) -set TargetFrameworkSDKToolsDirectory=%WindowsSDK_ExecutablePath_x86% +set TargetFrameworkSDKToolsDirectory=%WindowsSDK_ExecutablePath_x86% :have_TargetFrameworkSDKToolsDirectory From 2101df0319b5f0464872f0976f45193bc8cfa622 Mon Sep 17 00:00:00 2001 From: Vasily Kirichenko Date: Thu, 9 Aug 2018 10:07:29 +0300 Subject: [PATCH 134/150] add Path and default traverse into VisitLetOrUse (#5158) --- src/fsharp/service/ServiceParseTreeWalk.fs | 10 +++++----- src/fsharp/service/ServiceUntypedParse.fs | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/fsharp/service/ServiceParseTreeWalk.fs b/src/fsharp/service/ServiceParseTreeWalk.fs index a8eb0bfed2..7f94652a18 100755 --- a/src/fsharp/service/ServiceParseTreeWalk.fs +++ b/src/fsharp/service/ServiceParseTreeWalk.fs @@ -83,8 +83,8 @@ module public AstTraversal = abstract VisitComponentInfo : SynComponentInfo -> 'T option default this.VisitComponentInfo (_) = None /// VisitLetOrUse allows overriding behavior when visiting module or local let or use bindings - abstract VisitLetOrUse : SynBinding list * range -> 'T option - default this.VisitLetOrUse (_, _) = None + abstract VisitLetOrUse : TraversePath * (SynBinding -> 'T option) * SynBinding list * range -> 'T option + default this.VisitLetOrUse (_, _, _, _) = None /// VisitType allows overriding behavior when visiting simple pats abstract VisitSimplePats : SynSimplePat list -> 'T option default this.VisitSimplePats (_) = None @@ -158,7 +158,7 @@ module public AstTraversal = | SynModuleDecl.ModuleAbbrev(_ident, _longIdent, _range) -> None | SynModuleDecl.NestedModule(_synComponentInfo, _isRec, synModuleDecls, _, _range) -> synModuleDecls |> List.map (fun x -> dive x x.Range (traverseSynModuleDecl path)) |> pick decl | SynModuleDecl.Let(_, synBindingList, range) -> - match visitor.VisitLetOrUse(synBindingList, range) with + match visitor.VisitLetOrUse(path, traverseSynBinding path, synBindingList, range) with | Some x -> Some x | None -> synBindingList |> List.map (fun x -> dive x x.RangeOfBindingAndRhs (traverseSynBinding path)) |> pick decl | SynModuleDecl.DoExpr(_sequencePointInfoForBinding, synExpr, _range) -> traverseSynExpr path synExpr @@ -364,7 +364,7 @@ module public AstTraversal = |> pick expr | SynExpr.TypeApp(synExpr, _, _synTypeList, _commas, _, _, _range) -> traverseSynExpr synExpr | SynExpr.LetOrUse(_, _, synBindingList, synExpr, range) -> - match visitor.VisitLetOrUse(synBindingList, range) with + match visitor.VisitLetOrUse(path, traverseSynBinding path, synBindingList, range) with | Some x -> Some x | None -> [yield! synBindingList |> List.map (fun x -> dive x x.RangeOfBindingAndRhs (traverseSynBinding path)) @@ -586,7 +586,7 @@ module public AstTraversal = ] |> pick m | SynMemberDefn.AutoProperty(_attribs, _isStatic, _id, _tyOpt, _propKind, _, _xmlDoc, _access, synExpr, _, _) -> traverseSynExpr path synExpr | SynMemberDefn.LetBindings(synBindingList, _, _, range) -> - match visitor.VisitLetOrUse(synBindingList, range) with + match visitor.VisitLetOrUse(path, traverseSynBinding path, synBindingList, range) with | Some x -> Some x | None -> synBindingList |> List.map (fun x -> dive x x.RangeOfBindingAndRhs (traverseSynBinding path)) |> pick m | SynMemberDefn.AbstractSlot(_synValSig, _memberFlags, _range) -> None diff --git a/src/fsharp/service/ServiceUntypedParse.fs b/src/fsharp/service/ServiceUntypedParse.fs index 397e6f604b..18cb8023de 100755 --- a/src/fsharp/service/ServiceUntypedParse.fs +++ b/src/fsharp/service/ServiceUntypedParse.fs @@ -1289,7 +1289,7 @@ module UntypedParseImpl = if rangeContainsPos range pos then Some CompletionContext.Invalid else None - member __.VisitLetOrUse(bindings, range) = + member __.VisitLetOrUse(_, _, bindings, range) = match bindings with | [] when range.StartLine = pos.Line -> Some CompletionContext.Invalid | _ -> None From 6648060fd93302e15ed63ba8a2a6c15a4801593d Mon Sep 17 00:00:00 2001 From: TIHan Date: Thu, 9 Aug 2018 15:20:57 -0700 Subject: [PATCH 135/150] Rev'ed Roslyn package version to fix glyph tags --- RoslynPackageVersion.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RoslynPackageVersion.txt b/RoslynPackageVersion.txt index 834f262953..d0a9234a2f 100644 --- a/RoslynPackageVersion.txt +++ b/RoslynPackageVersion.txt @@ -1 +1 @@ -2.8.0 +2.9.0-beta8-63208-01 \ No newline at end of file From e435b6e14021853d00cdac76fbfa5e902167c484 Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Fri, 10 Aug 2018 02:13:01 +0200 Subject: [PATCH 136/150] cleanup (#5484) --- src/absil/ilwritepdb.fs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/absil/ilwritepdb.fs b/src/absil/ilwritepdb.fs index f90630a396..553c93ac58 100644 --- a/src/absil/ilwritepdb.fs +++ b/src/absil/ilwritepdb.fs @@ -449,8 +449,8 @@ let generatePortablePdb (embedAllSource:bool) (embedSourceList:string list) (sou let convert (content:IEnumerable) = use sha = System.Security.Cryptography.SHA1.Create() // IncrementalHash is core only let hash = content - |> Seq.map ( fun c -> c.GetBytes().Array |> sha.ComputeHash ) - |> Seq.collect id |> Array.ofSeq |> sha.ComputeHash + |> Seq.collect (fun c -> c.GetBytes().Array |> sha.ComputeHash) + |> Array.ofSeq |> sha.ComputeHash BlobContentId.FromHash(hash) System.Func, BlobContentId>( convert ) From 0a924443937cb5e6ea239c087fef03f07b81ac0c Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Thu, 9 Aug 2018 17:27:41 -0700 Subject: [PATCH 137/150] Address log file generation (#3) --- build.cmd | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.cmd b/build.cmd index 7c911daabe..941609ab14 100644 --- a/build.cmd +++ b/build.cmd @@ -737,6 +737,8 @@ if "%BUILD_PROTO_WITH_CORECLR_LKG%" == "1" ( ) echo ---------------- Done with package restore, starting proto ------------------------ +set logdir=%~dp0%BUILD_CONFIG%\net40\ +if not exist "!logdir!" mkdir "!logdir!" rem Build Proto if "%BUILD_PROTO%" == "1" ( From c55dd2c3d618eb93a8d16e503947342b1fa93556 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Fri, 10 Aug 2018 15:23:42 -0700 Subject: [PATCH 138/150] exclude external assembly from signing --- build/config/AssemblySignToolData.json | 1 + 1 file changed, 1 insertion(+) diff --git a/build/config/AssemblySignToolData.json b/build/config/AssemblySignToolData.json index 2a2070bb67..26b1489e79 100644 --- a/build/config/AssemblySignToolData.json +++ b/build/config/AssemblySignToolData.json @@ -57,6 +57,7 @@ } ], "exclude": [ + "e_sqlite3.dll", "FSharp.Core.4.5.2.nupkg", "FSharp.Data.TypeProviders.dll", "Microsoft.Build.Conversion.Core.dll", From f0d373adf6c52559e1def8ad42036e37051fb785 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Fri, 10 Aug 2018 17:25:20 -0700 Subject: [PATCH 139/150] remove unnecessary build step --- .vsts-signed.yaml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.vsts-signed.yaml b/.vsts-signed.yaml index 6d5193b38c..83973b32d2 100644 --- a/.vsts-signed.yaml +++ b/.vsts-signed.yaml @@ -44,13 +44,6 @@ steps: msbuildArguments: '/t:Build /p:ExpectedFeedUrl=$(PB_PublishBlobFeedUrl) /p:AccountKey=$(PB_PublishBlobFeedKey) /p:ManifestBranch=$(SourceBranch) /p:ManifestCommit=$(SourceVersion) /p:ManifestBuildId=$(OfficialBuildId)' condition: and(succeeded(), contains(variables['PB_PublishType'], 'blob')) -# Run BinSkim -- task: securedevelopmentteam.vss-secure-development-tools.build-task-binskim.BinSkim@3 - displayName: Run BinSkim - inputs: - arguments: 'analyze "$(MSBuildConfiguration)\*.dll" "$(MSBuildConfiguration)\*.exe" --recurse --output "$(MSBuildConfiguration)\artifacts"' - continueOnError: true - # Create static drop - task: PublishBuildArtifacts@1 displayName: Create static drop From 5410276bee022690769d1e78b884ab82b42d0074 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Sat, 11 Aug 2018 21:35:24 -0700 Subject: [PATCH 140/150] Fix5481 (#5486) * Fixes: #5470 * Fix #5481 --- src/absil/ilwritepdb.fs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/absil/ilwritepdb.fs b/src/absil/ilwritepdb.fs index 553c93ac58..61771a9b2d 100644 --- a/src/absil/ilwritepdb.fs +++ b/src/absil/ilwritepdb.fs @@ -416,10 +416,16 @@ let generatePortablePdb (embedAllSource:bool) (embedSourceList:string list) (sou let collectScopes scope = let list = new List() - let rec toList scope = - list.Add scope - scope.Children |> Seq.iter(fun s -> toList s) - toList scope + let rec toList scope parent = + let nested = + match parent with + | Some p -> scope.StartOffset <> p.StartOffset || scope.EndOffset <> p.EndOffset + | None -> true + + if nested then list.Add scope + scope.Children |> Seq.iter(fun s -> toList s (if nested then Some scope else parent)) + + toList scope None list.ToArray() |> Array.sortWith scopeSorter collectScopes scope |> Seq.iter(fun s -> From be5cb58a8e1c0fe7932dbaa88bf15d75a1114b24 Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Sun, 12 Aug 2018 06:38:04 +0200 Subject: [PATCH 141/150] Empty shortcuts (#5370) * Empty shortcuts * Empty shortcuts * Empty shortcuts --- src/fsharp/FSharp.Core/array.fs | 6 ++++++ src/fsharp/FSharp.Core/list.fs | 4 ++++ src/fsharp/FSharp.Core/seq.fs | 3 +++ 3 files changed, 13 insertions(+) diff --git a/src/fsharp/FSharp.Core/array.fs b/src/fsharp/FSharp.Core/array.fs index b92e3d9503..29713557fc 100644 --- a/src/fsharp/FSharp.Core/array.fs +++ b/src/fsharp/FSharp.Core/array.fs @@ -163,6 +163,9 @@ namespace Microsoft.FSharp.Collections Microsoft.FSharp.Primitives.Basics.Array.subUnchecked 0 count array let inline countByImpl (comparer:IEqualityComparer<'SafeKey>) (projection:'T->'SafeKey) (getKey:'SafeKey->'Key) (array:'T[]) = + let length = array.Length + if length = 0 then Microsoft.FSharp.Primitives.Basics.Array.zeroCreateUnchecked 0 else + let dict = Dictionary comparer // Build the groupings @@ -279,6 +282,9 @@ namespace Microsoft.FSharp.Collections [] let distinctBy projection (array:'T[]) = checkNonNull "array" array + let length = array.Length + if length = 0 then Microsoft.FSharp.Primitives.Basics.Array.zeroCreateUnchecked 0 else + let temp = Microsoft.FSharp.Primitives.Basics.Array.zeroCreateUnchecked array.Length let mutable i = 0 let hashSet = HashSet<_>(HashIdentity.Structural<_>) diff --git a/src/fsharp/FSharp.Core/list.fs b/src/fsharp/FSharp.Core/list.fs index aea7ef55ea..f02ceffcff 100644 --- a/src/fsharp/FSharp.Core/list.fs +++ b/src/fsharp/FSharp.Core/list.fs @@ -48,6 +48,10 @@ namespace Microsoft.FSharp.Collections let concat lists = Microsoft.FSharp.Primitives.Basics.List.concat lists let inline countByImpl (comparer:IEqualityComparer<'SafeKey>) (projection:'T->'SafeKey) (getKey:'SafeKey->'Key) (list:'T list) = + match list with + | [] -> [] + | _ -> + let dict = Dictionary comparer let rec loop srcList = match srcList with diff --git a/src/fsharp/FSharp.Core/seq.fs b/src/fsharp/FSharp.Core/seq.fs index f8ef697a8e..3162a0fe59 100644 --- a/src/fsharp/FSharp.Core/seq.fs +++ b/src/fsharp/FSharp.Core/seq.fs @@ -1087,6 +1087,7 @@ namespace Microsoft.FSharp.Collections [] let distinct source = checkNonNull "source" source + if isEmpty source then empty else seq { let hashSet = HashSet<'T>(HashIdentity.Structural<'T>) for v in source do if hashSet.Add(v) then @@ -1095,6 +1096,7 @@ namespace Microsoft.FSharp.Collections [] let distinctBy projection source = checkNonNull "source" source + if isEmpty source then empty else seq { let hashSet = HashSet<_>(HashIdentity.Structural<_>) for v in source do if hashSet.Add(projection v) then @@ -1138,6 +1140,7 @@ namespace Microsoft.FSharp.Collections let inline countByImpl (comparer:IEqualityComparer<'SafeKey>) (keyf:'T->'SafeKey) (getKey:'SafeKey->'Key) (source:seq<'T>) = checkNonNull "source" source + if isEmpty source then empty else let dict = Dictionary comparer From 0deafaf8d2672b0adf591fca152f7d78e218df81 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Tue, 14 Aug 2018 11:44:50 -0700 Subject: [PATCH 142/150] Update microsoft build version for build task (#5499) --- src/fsharp/FSharp.Build/project.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/fsharp/FSharp.Build/project.json b/src/fsharp/FSharp.Build/project.json index e9b92c192f..849f4f7f42 100644 --- a/src/fsharp/FSharp.Build/project.json +++ b/src/fsharp/FSharp.Build/project.json @@ -1,9 +1,9 @@ { "dependencies": { - "Microsoft.Build": "15.1.548", - "Microsoft.Build.Framework": "15.1.548", - "Microsoft.Build.Tasks.Core": "15.1.548", - "Microsoft.Build.Utilities.Core": "15.1.548", + "Microsoft.Build": "15.6.85", + "Microsoft.Build.Framework": "15.6.85", + "Microsoft.Build.Tasks.Core": "15.6.85", + "Microsoft.Build.Utilities.Core": "15.6.85", "Microsoft.NETCore.Platforms": "1.1.0", "Microsoft.Win32.Registry": { "version": "4.3.0", From 77e6267dd8a253f32383fc87934ea55eae1248c3 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Tue, 14 Aug 2018 22:25:59 -0700 Subject: [PATCH 143/150] Set minimum target framework for templates to .NET 4.5 (#5509) --- .../ConsoleProject/Template/ConsoleApplication.vstemplate | 2 +- .../ProjectTemplates/LibraryProject/Template/Library.vstemplate | 2 +- .../TutorialProject/Template/Tutorial.vstemplate | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.vstemplate b/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.vstemplate index de642efe4a..2fc00865ce 100644 --- a/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.vstemplate +++ b/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.vstemplate @@ -6,7 +6,7 @@ Microsoft.FSharp.Application FSharp - 2.0 + 4.5 1 true ConsoleApplication diff --git a/vsintegration/ProjectTemplates/LibraryProject/Template/Library.vstemplate b/vsintegration/ProjectTemplates/LibraryProject/Template/Library.vstemplate index b8a72c8b77..94835b4a03 100644 --- a/vsintegration/ProjectTemplates/LibraryProject/Template/Library.vstemplate +++ b/vsintegration/ProjectTemplates/LibraryProject/Template/Library.vstemplate @@ -6,7 +6,7 @@ Microsoft.FSharp.Library FSharp - 2.0 + 4.5 1 true Library diff --git a/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.vstemplate b/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.vstemplate index 8dabbfe335..245897e535 100644 --- a/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.vstemplate +++ b/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.vstemplate @@ -6,7 +6,7 @@ Microsoft.FSharp.Tutorial FSharp - 2.0 + 4.5 1 true Tutorial From 6a548ca4de8b3d415f3c14d8e1c81391b22e8da9 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Thu, 16 Aug 2018 00:20:54 -0700 Subject: [PATCH 144/150] Fix # 5514 (#5516) --- src/utils/CompilerLocationUtils.fs | 32 ++++--------------- .../PropertyPages/ApplicationPropPage.vb | 23 ++----------- 2 files changed, 10 insertions(+), 45 deletions(-) diff --git a/src/utils/CompilerLocationUtils.fs b/src/utils/CompilerLocationUtils.fs index 9bfcbf3fc2..541adf5e33 100644 --- a/src/utils/CompilerLocationUtils.fs +++ b/src/utils/CompilerLocationUtils.fs @@ -217,31 +217,13 @@ module internal FSharpEnvironment = match probePoint with | Some p when safeExists (Path.Combine(p,"FSharp.Core.dll")) -> Some p | _ -> - - // On windows the location of the compiler is via a registry key - - // Note: If the keys below change, be sure to update code in: - // Property pages (ApplicationPropPage.vb) - let keys = - [| - @"Software\Microsoft\FSharp\10.1\Runtime\v4.0"; - @"Software\Microsoft\FSharp\4.1\Runtime\v4.0"; - @"Software\Microsoft\FSharp\4.0\Runtime\v4.0" - |] - let path = keys |> Seq.tryPick(fun k -> tryRegKey k) - match path with - | Some _ -> path - | None -> - // On Unix we let you set FSHARP_COMPILER_BIN. I've rarely seen this used and its not documented in the install instructions. - let result = - let var = System.Environment.GetEnvironmentVariable("FSHARP_COMPILER_BIN") - if String.IsNullOrEmpty(var) then None - else Some(var) - match result with - | Some _ -> result - | None -> - // For the prototype compiler, we can just use the current domain - tryCurrentDomain() + // We let you set FSHARP_COMPILER_BIN. I've rarely seen this used and its not documented in the install instructions. + let result = System.Environment.GetEnvironmentVariable("FSHARP_COMPILER_BIN") + if not (String.IsNullOrEmpty(result)) then + Some result + else + // For the prototype compiler, we can just use the current domain + tryCurrentDomain() with e -> System.Diagnostics.Debug.Assert(false, "Error while determining default location of F# compiler") None diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/ApplicationPropPage.vb b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/ApplicationPropPage.vb index 964304b02e..692619c912 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/ApplicationPropPage.vb +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/ApplicationPropPage.vb @@ -49,8 +49,6 @@ Namespace Microsoft.VisualStudio.Editors.PropertyPages Protected Const INDEX_WINDOWSCLASSLIB As Integer = 2 Protected Const INDEX_LAST As Integer = INDEX_WINDOWSCLASSLIB Public Const Const_TargetFrameworkMoniker As String = "TargetFrameworkMoniker" - Private m_v20FSharpRedistInstalled As Boolean = False - Private m_v40FSharpRedistInstalled As Boolean = False Friend WithEvents TargetFramework As System.Windows.Forms.ComboBox Friend WithEvents TargetFrameworkLabel As System.Windows.Forms.Label @@ -75,12 +73,6 @@ Namespace Microsoft.VisualStudio.Editors.PropertyPages m_OutputTypeStringKeys(INDEX_COMMANDLINEAPP) = SR.GetString(SR.PPG_CommandLineApp) m_OutputTypeStringKeys(INDEX_WINDOWSCLASSLIB) = SR.GetString(SR.PPG_WindowsClassLib) - Dim v20FSharpRedistKey As String = "HKEY_LOCAL_MACHINE\Software\Microsoft\FSharp\10.1\Runtime\v2.0" - Dim v40FSharpRedistKey As String = "HKEY_LOCAL_MACHINE\Software\Microsoft\FSharp\10.1\Runtime\v4.0" - - m_v20FSharpRedistInstalled = Not (IsNothing(Microsoft.Win32.Registry.GetValue(v20FSharpRedistKey, Nothing, Nothing))) - m_v40FSharpRedistInstalled = Not (IsNothing(Microsoft.Win32.Registry.GetValue(v40FSharpRedistKey, Nothing, Nothing))) - 'Add any initialization after the InitializeComponent() call AddChangeHandlers() @@ -587,18 +579,9 @@ Namespace Microsoft.VisualStudio.Editors.PropertyPages If moniker.StartsWith(".NETCoreApp") OrElse moniker.StartsWith(".NETStandard") Then Return True End If - If moniker.Contains("v2") Then - Return Me.m_v20FSharpRedistInstalled - End If - If moniker.Contains("v3.0") Then - Return Me.m_v20FSharpRedistInstalled - End If - If moniker.Contains("v3.5") Then - Return Me.m_v20FSharpRedistInstalled - End If - '' Is this cheating? - If moniker.Contains("v4") Then - Return Me.m_v40FSharpRedistInstalled + ' With the latest tooling, if we have editors the redist is installed by definition + If moniker.Contains("v2") Or moniker.Contains("v3.0") Or moniker.Contains("v3.5") Or moniker.Contains("v4") Then + Return True End If Return False End Function From bffb2ab0a6cbd5d284094ee4220e9a9ad32ee28d Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Thu, 16 Aug 2018 00:21:17 -0700 Subject: [PATCH 145/150] Always do TFM Attributes at front of compile list (#5511) --- src/fsharp/FSharp.Build/Microsoft.FSharp.Targets | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/fsharp/FSharp.Build/Microsoft.FSharp.Targets b/src/fsharp/FSharp.Build/Microsoft.FSharp.Targets index b5e46e4428..b0193c5668 100644 --- a/src/fsharp/FSharp.Build/Microsoft.FSharp.Targets +++ b/src/fsharp/FSharp.Build/Microsoft.FSharp.Targets @@ -394,8 +394,7 @@ this file. Overwrite="true"/> - - + From 89275d2ce1ec3953d737017a8be087c2579259f3 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Wed, 22 Aug 2018 15:16:28 -0700 Subject: [PATCH 146/150] Fix #4075 - Replace Embed property with EmbeddedFiles item group in Microsoft.FSharp.Targets (#5487) * Fix #4075 * EmbeddedFiles --- src/fsharp/FSharp.Build/Fsc.fs | 12 +++++++----- src/fsharp/FSharp.Build/Microsoft.FSharp.Targets | 6 +++++- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/fsharp/FSharp.Build/Fsc.fs b/src/fsharp/FSharp.Build/Fsc.fs index 684f473265..95f3ec2f98 100644 --- a/src/fsharp/FSharp.Build/Fsc.fs +++ b/src/fsharp/FSharp.Build/Fsc.fs @@ -38,7 +38,7 @@ type public Fsc () as this = let mutable documentationFile : string = null let mutable dotnetFscCompilerPath : string = null let mutable embedAllSources = false - let mutable embed : string = null + let mutable embeddedFiles : ITaskItem[] = [||] let mutable generateInterfaceFile : string = null let mutable highEntropyVA : bool = false let mutable keyFile : string = null @@ -106,7 +106,9 @@ type public Fsc () as this = | _ -> null) if embedAllSources then builder.AppendSwitch("--embed+") - builder.AppendSwitchIfNotNull("--embed:", embed) + if embeddedFiles <> null then + for item in embeddedFiles do + builder.AppendSwitchIfNotNull("--embed:", item.ItemSpec) builder.AppendSwitchIfNotNull("--sourcelink:", sourceLink) // NoFramework if noFramework then @@ -290,9 +292,9 @@ type public Fsc () as this = with get() = embedAllSources and set(s) = embedAllSources <- s - member fsc.Embed - with get() = embed - and set(e) = embed <- e + member fsc.EmbeddedFiles + with get() = embeddedFiles + and set(e) = embeddedFiles <- e // --generate-interface-file : // Print the inferred interface of the diff --git a/src/fsharp/FSharp.Build/Microsoft.FSharp.Targets b/src/fsharp/FSharp.Build/Microsoft.FSharp.Targets index b0193c5668..8808c10ebc 100644 --- a/src/fsharp/FSharp.Build/Microsoft.FSharp.Targets +++ b/src/fsharp/FSharp.Build/Microsoft.FSharp.Targets @@ -260,6 +260,10 @@ this file. Include="@(_CoreCompileResourceInputs);@(CompiledLicenseFile);@(AdditionalEmbeddedResource)" /> + + + + Date: Wed, 22 Aug 2018 15:42:46 -0700 Subject: [PATCH 147/150] create the F# SDK package from all existing NuGet packages Also fix a bug where we were mis-packing the current FSharp.Core 4.5 as 4.4.3. --- setup/Swix/Microsoft.FSharp.SDK/Files.swr | 48 +++++++++---------- .../Microsoft.FSharp.SDK.swixproj | 1 - setup/packages.config | 2 + 3 files changed, 26 insertions(+), 25 deletions(-) diff --git a/setup/Swix/Microsoft.FSharp.SDK/Files.swr b/setup/Swix/Microsoft.FSharp.SDK/Files.swr index 271db6961c..228bc93343 100644 --- a/setup/Swix/Microsoft.FSharp.SDK/Files.swr +++ b/setup/Swix/Microsoft.FSharp.SDK/Files.swr @@ -17,10 +17,10 @@ folder "InstallDir:Common7\IDE\CommonExtensions\Microsoft\FSharpSdk" file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETCore\3.7.4.0\FSharp.Core.sigdata" file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETCore\3.7.4.0\FSharp.Core.xml" folder "3.7.41.0" - file source="$(BinariesFolder)\profiles\portable-net45+netcore45\FSharp.Core.dll" - file source="$(BinariesFolder)\profiles\portable-net45+netcore45\FSharp.Core.optdata" - file source="$(BinariesFolder)\profiles\portable-net45+netcore45\FSharp.Core.sigdata" - file source="$(BinariesFolder)\profiles\portable-net45+netcore45\FSharp.Core.xml" + file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\portable-net45+netcore45\FSharp.Core.dll" + file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\portable-net45+netcore45\FSharp.Core.optdata" + file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\portable-net45+netcore45\FSharp.Core.sigdata" + file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\portable-net45+netcore45\FSharp.Core.xml" folder "3.78.3.1" file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETCore\3.78.3.1\FSharp.Core.dll" file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETCore\3.78.3.1\FSharp.Core.optdata" @@ -32,10 +32,10 @@ folder "InstallDir:Common7\IDE\CommonExtensions\Microsoft\FSharpSdk" file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETCore\3.78.4.0\FSharp.Core.sigdata" file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETCore\3.78.4.0\FSharp.Core.xml" folder "3.78.41.0" - file source="$(BinariesFolder)\profiles\portable-net45+netcore45+wp8\FSharp.Core.dll" - file source="$(BinariesFolder)\profiles\portable-net45+netcore45+wp8\FSharp.Core.optdata" - file source="$(BinariesFolder)\profiles\portable-net45+netcore45+wp8\FSharp.Core.sigdata" - file source="$(BinariesFolder)\profiles\portable-net45+netcore45+wp8\FSharp.Core.xml" + file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\portable-net45+netcore45+wp8\FSharp.Core.dll" + file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\portable-net45+netcore45+wp8\FSharp.Core.optdata" + file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\portable-net45+netcore45+wp8\FSharp.Core.sigdata" + file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\portable-net45+netcore45+wp8\FSharp.Core.xml" folder "3.259.3.1" file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETCore\3.259.3.1\FSharp.Core.dll" file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETCore\3.259.3.1\FSharp.Core.optdata" @@ -47,10 +47,10 @@ folder "InstallDir:Common7\IDE\CommonExtensions\Microsoft\FSharpSdk" file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETCore\3.259.4.0\FSharp.Core.sigdata" file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETCore\3.259.4.0\FSharp.Core.xml" folder "3.259.41.0" - file source="$(BinariesFolder)\profiles\portable-net45+netcore45+wpa81+wp8\FSharp.Core.dll" - file source="$(BinariesFolder)\profiles\portable-net45+netcore45+wpa81+wp8\FSharp.Core.optdata" - file source="$(BinariesFolder)\profiles\portable-net45+netcore45+wpa81+wp8\FSharp.Core.sigdata" - file source="$(BinariesFolder)\profiles\portable-net45+netcore45+wpa81+wp8\FSharp.Core.xml" + file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\portable-net45+netcore45+wpa81+wp8\FSharp.Core.dll" + file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\portable-net45+netcore45+wpa81+wp8\FSharp.Core.optdata" + file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\portable-net45+netcore45+wpa81+wp8\FSharp.Core.sigdata" + file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\portable-net45+netcore45+wpa81+wp8\FSharp.Core.xml" folder ".NETFramework\v4.0" folder "4.3.0.0" @@ -69,15 +69,15 @@ folder "InstallDir:Common7\IDE\CommonExtensions\Microsoft\FSharpSdk" file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETFramework\v4.0\4.4.0.0\FSharp.Core.sigdata" file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETFramework\v4.0\4.4.0.0\FSharp.Core.xml" folder "4.4.1.0" - file source="$(BinariesFolder)\versions\4.4.1.0\FSharp.Core.dll" - file source="$(BinariesFolder)\versions\4.4.1.0\FSharp.Core.optdata" - file source="$(BinariesFolder)\versions\4.4.1.0\FSharp.Core.sigdata" - file source="$(BinariesFolder)\versions\4.4.1.0\FSharp.Core.xml" + file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core.10.1.0\lib\versions\4.4.1.0\FSharp.Core.dll" + file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core.10.1.0\lib\versions\4.4.1.0\FSharp.Core.optdata" + file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core.10.1.0\lib\versions\4.4.1.0\FSharp.Core.sigdata" + file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core.10.1.0\lib\versions\4.4.1.0\FSharp.Core.xml" folder "4.4.3.0" - file source="$(BinariesFolder)\net40\bin\FSharp.Core.dll" - file source="$(BinariesFolder)\net40\bin\FSharp.Core.optdata" - file source="$(BinariesFolder)\net40\bin\FSharp.Core.sigdata" - file source="$(BinariesFolder)\net40\bin\FSharp.Core.xml" + file source="$(PackagesFolder)\FSharp.Core.4.3.4\lib\net45\FSharp.Core.dll" + file source="$(PackagesFolder)\FSharp.Core.4.3.4\lib\net45\FSharp.Core.optdata" + file source="$(PackagesFolder)\FSharp.Core.4.3.4\lib\net45\FSharp.Core.sigdata" + file source="$(PackagesFolder)\FSharp.Core.4.3.4\lib\net45\FSharp.Core.xml" folder ".NETPortable" folder "2.3.5.0" @@ -96,7 +96,7 @@ folder "InstallDir:Common7\IDE\CommonExtensions\Microsoft\FSharpSdk" file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETPortable\3.47.4.0\FSharp.Core.sigdata" file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETPortable\3.47.4.0\FSharp.Core.xml" folder "3.47.41.0" - file source="$(BinariesFolder)\profiles\portable-net45+sl5+netcore45\FSharp.Core.dll" - file source="$(BinariesFolder)\profiles\portable-net45+sl5+netcore45\FSharp.Core.optdata" - file source="$(BinariesFolder)\profiles\portable-net45+sl5+netcore45\FSharp.Core.sigdata" - file source="$(BinariesFolder)\profiles\portable-net45+sl5+netcore45\FSharp.Core.xml" + file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\portable-net45+sl5+netcore45\FSharp.Core.dll" + file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\portable-net45+sl5+netcore45\FSharp.Core.optdata" + file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\portable-net45+sl5+netcore45\FSharp.Core.sigdata" + file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\portable-net45+sl5+netcore45\FSharp.Core.xml" diff --git a/setup/Swix/Microsoft.FSharp.SDK/Microsoft.FSharp.SDK.swixproj b/setup/Swix/Microsoft.FSharp.SDK/Microsoft.FSharp.SDK.swixproj index bde4a368d4..9256eadc32 100644 --- a/setup/Swix/Microsoft.FSharp.SDK/Microsoft.FSharp.SDK.swixproj +++ b/setup/Swix/Microsoft.FSharp.SDK/Microsoft.FSharp.SDK.swixproj @@ -18,7 +18,6 @@ - $(PackagePreprocessorDefinitions);BinariesFolder=$(BinariesFolder) $(PackagePreprocessorDefinitions);PackagesFolder=$(PackagesFolder) $(PackagePreprocessorDefinitions);FSharpPackageVersion=$(FSharpPackageVersion) diff --git a/setup/packages.config b/setup/packages.config index 737180bc5d..f6caa5c2da 100644 --- a/setup/packages.config +++ b/setup/packages.config @@ -10,4 +10,6 @@ + + From 15d9391e78c554f91824d2be2e69938cd811df68 Mon Sep 17 00:00:00 2001 From: Jason Malinowski Date: Tue, 28 Aug 2018 15:20:51 -0700 Subject: [PATCH 148/150] Decouple the F# language service from AbstractProject (#5553) The F# language service presumed that IWorkspaceProjectContext is implemented by an AbstractProject, which is an assumption that isn't safe going forward. This removes that presumption, and tweaks a few other things that should allow F# to continue to function once we further refactor the project system work in Roslyn. --- .../LanguageService/LanguageService.fs | 57 +++++++++++-------- 1 file changed, 32 insertions(+), 25 deletions(-) diff --git a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs index 297f1c1745..151926d974 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs @@ -408,13 +408,13 @@ type internal FSharpLanguageService(package : FSharpPackage) = if String.IsNullOrWhiteSpace projectFileName then projectFileName else Path.GetFileNameWithoutExtension projectFileName - let singleFileProjects = ConcurrentDictionary<_, AbstractProject>() + let singleFileProjects = ConcurrentDictionary<_, IWorkspaceProjectContext>() let tryRemoveSingleFileProject projectId = match singleFileProjects.TryRemove(projectId) with | true, project -> projectInfoManager.ClearInfoForSingleFileProject(projectId) - project.Disconnect() + project.Dispose() | _ -> () let invalidPathChars = set (Path.GetInvalidPathChars()) @@ -501,16 +501,18 @@ type internal FSharpLanguageService(package : FSharpPackage) = /// Sync the Roslyn information for the project held in 'projectContext' to match the information given by 'site'. /// Also sync the info in ProjectInfoManager if necessary. - member this.SyncProject(project: AbstractProject, projectContext: IWorkspaceProjectContext, site: IProjectSite, workspace, forceUpdate, userOpName) = + member this.SyncProject(projectContext: IWorkspaceProjectContext, site: IProjectSite, workspace: VisualStudioWorkspaceImpl, forceUpdate, userOpName) = let wellFormedFilePathSetIgnoreCase (paths: seq) = HashSet(paths |> Seq.filter isPathWellFormed |> Seq.map (fun s -> try Path.GetFullPath(s) with _ -> s), StringComparer.OrdinalIgnoreCase) let mutable updated = forceUpdate + let project = workspace.CurrentSolution.Projects |> Seq.filter (fun p -> p.Name = projectContext.DisplayName) |> Seq.exactlyOne + // Sync the source files in projectContext. Note that these source files are __not__ maintained in order in projectContext // as edits are made. It seems this is ok because the source file list is only used to drive roslyn per-file checking. let updatedFiles = site.CompilationSourceFiles |> wellFormedFilePathSetIgnoreCase - let originalFiles = project.GetCurrentDocuments() |> Seq.map (fun file -> file.FilePath) |> wellFormedFilePathSetIgnoreCase + let originalFiles = project.Documents |> Seq.map (fun file -> file.FilePath) |> wellFormedFilePathSetIgnoreCase for file in updatedFiles do if not(originalFiles.Contains(file)) then @@ -523,7 +525,7 @@ type internal FSharpLanguageService(package : FSharpPackage) = updated <- true let updatedRefs = site.CompilationReferences |> wellFormedFilePathSetIgnoreCase - let originalRefs = project.GetCurrentMetadataReferences() |> Seq.map (fun ref -> ref.FilePath) |> wellFormedFilePathSetIgnoreCase + let originalRefs = project.MetadataReferences |> Enumerable.OfType |> Seq.map (fun ref -> ref.FilePath) |> wellFormedFilePathSetIgnoreCase for ref in updatedRefs do if not(originalRefs.Contains(ref)) then @@ -566,11 +568,14 @@ type internal FSharpLanguageService(package : FSharpPackage) = let projectFileName = site.ProjectFileName let projectDisplayName = projectDisplayNameOf projectFileName - let projectId = workspace.ProjectTracker.GetOrCreateProjectIdForPath(projectFileName, projectDisplayName) + // This projectId is not guaranteed to be the same ProjectId that will actually be created once we call CreateProjectContext + // in Roslyn versions once https://github.com/dotnet/roslyn/pull/26931 is merged. Roslyn will still guarantee that once + // there is a project in the workspace with the same path, it'll return the ID of that. So this is sufficient to use + // in that case as long as we only use it to call GetProject. + let fakeProjectId = workspace.ProjectTracker.GetOrCreateProjectIdForPath(projectFileName, projectDisplayName) - if isNull (workspace.ProjectTracker.GetProject projectId) then + if isNull (workspace.ProjectTracker.GetProject fakeProjectId) then let projectContextFactory = package.ComponentModel.GetService(); - let errorReporter = ProjectExternalErrorReporter(projectId, "FS", this.SystemServiceProvider) let hierarchy = site.ProjectProvider @@ -589,27 +594,27 @@ type internal FSharpLanguageService(package : FSharpPackage) = projectFileName, projectGuid, hierarchy, - Option.toObj site.CompilationBinOutputPath, - errorReporter) - - let project = projectContext :?> AbstractProject + Option.toObj site.CompilationBinOutputPath) + + // The real project ID that was actually added. See comments for fakeProjectId why this one is actually good. + let realProjectId = workspace.ProjectTracker.GetOrCreateProjectIdForPath(projectFileName, projectDisplayName) // Sync IProjectSite --> projectContext, and IProjectSite --> ProjectInfoManage - this.SyncProject(project, projectContext, site, workspace, forceUpdate=true, userOpName=userOpName) + this.SyncProject(projectContext, site, workspace, forceUpdate=true, userOpName=userOpName) - site.BuildErrorReporter <- Some (errorReporter :> Microsoft.VisualStudio.Shell.Interop.IVsLanguageServiceBuildErrorReporter2) + site.BuildErrorReporter <- Some (projectContext :?> Microsoft.VisualStudio.Shell.Interop.IVsLanguageServiceBuildErrorReporter2) // TODO: consider forceUpdate = false here. forceUpdate=true may be causing repeated computation? site.AdviseProjectSiteChanges(FSharpConstants.FSharpLanguageServiceCallbackName, - AdviseProjectSiteChanges(fun () -> this.SyncProject(project, projectContext, site, workspace, forceUpdate=true, userOpName="AdviseProjectSiteChanges."+userOpName))) + AdviseProjectSiteChanges(fun () -> this.SyncProject(projectContext, site, workspace, forceUpdate=true, userOpName="AdviseProjectSiteChanges."+userOpName))) site.AdviseProjectSiteClosed(FSharpConstants.FSharpLanguageServiceCallbackName, AdviseProjectSiteChanges(fun () -> - projectInfoManager.ClearInfoForProject(project.Id) + projectInfoManager.ClearInfoForProject(realProjectId) optionsAssociation.Remove(projectContext) |> ignore - project.Disconnect())) + projectContext.Dispose())) - for referencedSite in ProjectSitesAndFiles.GetReferencedProjectSites(Some projectId, site, this.SystemServiceProvider, Some (this.Workspace :>obj), Some projectInfoManager.FSharpOptions ) do + for referencedSite in ProjectSitesAndFiles.GetReferencedProjectSites(Some realProjectId, site, this.SystemServiceProvider, Some (this.Workspace :>obj), Some projectInfoManager.FSharpOptions ) do setup referencedSite setup (siteProvider.GetProjectSite()) @@ -619,19 +624,21 @@ type internal FSharpLanguageService(package : FSharpPackage) = let projectFileName = fileName let projectDisplayName = projectDisplayNameOf projectFileName - let projectId = workspace.ProjectTracker.GetOrCreateProjectIdForPath(projectFileName, projectDisplayName) - let _referencedProjectFileNames, parsingOptions, projectOptions = projectInfoManager.ComputeSingleFileOptions (tryGetOrCreateProjectId workspace, fileName, loadTime, fileContents) |> Async.RunSynchronously - projectInfoManager.AddOrUpdateSingleFileProject(projectId, (loadTime, parsingOptions, projectOptions)) + let mutable projectId = workspace.ProjectTracker.GetOrCreateProjectIdForPath(projectFileName, projectDisplayName) if isNull (workspace.ProjectTracker.GetProject projectId) then let projectContextFactory = package.ComponentModel.GetService(); - let errorReporter = ProjectExternalErrorReporter(projectId, "FS", this.SystemServiceProvider) - let projectContext = projectContextFactory.CreateProjectContext(FSharpConstants.FSharpLanguageName, projectDisplayName, projectFileName, projectId.Id, hier, null, errorReporter) + let projectContext = projectContextFactory.CreateProjectContext(FSharpConstants.FSharpLanguageName, projectDisplayName, projectFileName, projectId.Id, hier, null) + + projectId <- workspace.ProjectTracker.GetOrCreateProjectIdForPath(projectFileName, projectDisplayName) + projectContext.AddSourceFile(fileName) - let project = projectContext :?> AbstractProject - singleFileProjects.[projectId] <- project + singleFileProjects.[projectId] <- projectContext + + let _referencedProjectFileNames, parsingOptions, projectOptions = projectInfoManager.ComputeSingleFileOptions (tryGetOrCreateProjectId workspace, fileName, loadTime, fileContents) |> Async.RunSynchronously + projectInfoManager.AddOrUpdateSingleFileProject(projectId, (loadTime, parsingOptions, projectOptions)) override this.ContentTypeName = FSharpConstants.FSharpContentTypeName override this.LanguageName = FSharpConstants.FSharpLanguageName From 33804eb56aa5c7f46b852ad0c317ca27ac78cb9d Mon Sep 17 00:00:00 2001 From: Don Syme Date: Wed, 5 Sep 2018 12:12:21 +0100 Subject: [PATCH 149/150] update version --- fcs/README.md | 6 +++--- fcs/RELEASE_NOTES.md | 5 ++++- fcs/fcs.props | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/fcs/README.md b/fcs/README.md index 661ac76351..f348a934ff 100644 --- a/fcs/README.md +++ b/fcs/README.md @@ -60,9 +60,9 @@ which does things like: You can push the packages if you have permissions, either automatically using ``build Release`` or manually set APIKEY=... - ..\fsharp\.nuget\nuget.exe push %HOMEDRIVE%%HOMEPATH%\Downloads\FSharp.Compiler.Service.24.0.1.nupkg %APIKEY% -Source https://nuget.org - ..\fsharp\.nuget\nuget.exe push %HOMEDRIVE%%HOMEPATH%\Downloads\FSharp.Compiler.Service.MSBuild.v12.24.0.1.nupkg %APIKEY% -Source https://nuget.org - ..\fsharp\.nuget\nuget.exe push %HOMEDRIVE%%HOMEPATH%\Downloads\FSharp.Compiler.Service.ProjectCracker.24.0.1.nupkg %APIKEY% -Source https://nuget.org + ..\fsharp\.nuget\nuget.exe push %HOMEDRIVE%%HOMEPATH%\Downloads\FSharp.Compiler.Service.25.0.1.nupkg %APIKEY% -Source https://nuget.org + ..\fsharp\.nuget\nuget.exe push %HOMEDRIVE%%HOMEPATH%\Downloads\FSharp.Compiler.Service.MSBuild.v12.25.0.1.nupkg %APIKEY% -Source https://nuget.org + ..\fsharp\.nuget\nuget.exe push %HOMEDRIVE%%HOMEPATH%\Downloads\FSharp.Compiler.Service.ProjectCracker.25.0.1.nupkg %APIKEY% -Source https://nuget.org ### Use of Paket and FAKE diff --git a/fcs/RELEASE_NOTES.md b/fcs/RELEASE_NOTES.md index 2b323ba496..8adc224c47 100644 --- a/fcs/RELEASE_NOTES.md +++ b/fcs/RELEASE_NOTES.md @@ -1,4 +1,7 @@ -#### 24.0.1 +#### 25.0.1 + * Integrate visualfsharp master to 15d9391e78c554f91824d2be2e69938cd811df68 + +#### 25.0.1 * Integrate visualfsharp master to 59156db2d0a744233d1baffee7088ca2d9f959c7 #### 23.0.3 diff --git a/fcs/fcs.props b/fcs/fcs.props index 4802bd2431..b698937373 100644 --- a/fcs/fcs.props +++ b/fcs/fcs.props @@ -3,7 +3,7 @@ - 24.0.1 + 25.0.1 --version:$(VersionPrefix) false From cc7bb4db4d549956e2b48141fe6bff2d85a530e7 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Wed, 5 Sep 2018 12:12:36 +0100 Subject: [PATCH 150/150] integrate visualfsharp master --- fcs/RELEASE_NOTES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fcs/RELEASE_NOTES.md b/fcs/RELEASE_NOTES.md index 8adc224c47..b1e1f640c5 100644 --- a/fcs/RELEASE_NOTES.md +++ b/fcs/RELEASE_NOTES.md @@ -1,7 +1,7 @@ #### 25.0.1 * Integrate visualfsharp master to 15d9391e78c554f91824d2be2e69938cd811df68 -#### 25.0.1 +#### 24.0.1 * Integrate visualfsharp master to 59156db2d0a744233d1baffee7088ca2d9f959c7 #### 23.0.3