From b52972eab10d74fc75e93f0ffb12f97d4e4c1f32 Mon Sep 17 00:00:00 2001 From: dawe Date: Sun, 12 May 2024 16:23:34 +0200 Subject: [PATCH 01/34] port fsih to fsi as a hash directive --- .../.FSharp.Compiler.Service/8.0.400.md | 1 + src/Compiler/Interactive/FSIstrings.txt | 1 + src/Compiler/Interactive/fsi.fs | 297 +++++++++++++++++- 3 files changed, 295 insertions(+), 4 deletions(-) diff --git a/docs/release-notes/.FSharp.Compiler.Service/8.0.400.md b/docs/release-notes/.FSharp.Compiler.Service/8.0.400.md index fd28a3c2736..7e57e05a868 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/8.0.400.md +++ b/docs/release-notes/.FSharp.Compiler.Service/8.0.400.md @@ -1,5 +1,6 @@ ### Fixed +* Added #h directive to fsi to show documentation in the REPL. ([PR #XXXX](https://github.com/dotnet/fsharp/pull/XXXX)) * Optimize simple mappings with preludes in computed collections. ([PR #17067](https://github.com/dotnet/fsharp/pull/17067)) * Improve error reporting for abstract members when used in classes. ([PR #17063](https://github.com/dotnet/fsharp/pull/17063)) * Improve error reporting when property has same name as DU case. ([Issue #16646](https://github.com/dotnet/fsharp/issues/16646), [PR #17088](https://github.com/dotnet/fsharp/pull/17088)) diff --git a/src/Compiler/Interactive/FSIstrings.txt b/src/Compiler/Interactive/FSIstrings.txt index c357f835be5..8f4f71c6465 100644 --- a/src/Compiler/Interactive/FSIstrings.txt +++ b/src/Compiler/Interactive/FSIstrings.txt @@ -32,6 +32,7 @@ fsiIntroPackageSourceUriInfo,"Include package source uri when searching for pack fsiIntroTextHashloadInfo,"Load the given file(s) as if compiled and referenced" fsiIntroTextHashtimeInfo,"Toggle timing on/off" fsiIntroTextHashhelpInfo,"Display help" +fsiIntroTextHashhInfo,"Display documentation for an expression, e.g. #h \"List.map\";;" fsiIntroTextHashquitInfo,"Exit" fsiIntroTextHashclearInfo,"Clear screen" fsiIntroTextHeader2commandLine," F# Interactive command line options:" diff --git a/src/Compiler/Interactive/fsi.fs b/src/Compiler/Interactive/fsi.fs index db33a53ee93..b9518ed2776 100644 --- a/src/Compiler/Interactive/fsi.fs +++ b/src/Compiler/Interactive/fsi.fs @@ -1239,6 +1239,7 @@ type internal FsiCommandLineOptions(fsi: FsiEvaluationSessionHostConfig, argv: s fsiConsoleOutput.uprintfn """ #load "file.fs" ...;; // %s""" (FSIstrings.SR.fsiIntroTextHashloadInfo ()) fsiConsoleOutput.uprintfn """ #time ["on"|"off"];; // %s""" (FSIstrings.SR.fsiIntroTextHashtimeInfo ()) fsiConsoleOutput.uprintfn """ #help;; // %s""" (FSIstrings.SR.fsiIntroTextHashhelpInfo ()) + fsiConsoleOutput.uprintfn """ #h "expr";; // %s""" (FSIstrings.SR.fsiIntroTextHashhInfo ()) if tcConfigB.langVersion.SupportsFeature(LanguageFeature.PackageManagement) then for msg in @@ -1410,6 +1411,268 @@ type internal FsiConsolePrompt(fsiOptions: FsiCommandLineOptions, fsiConsoleOutp member _.FsiOptions = fsiOptions +//---------------------------------------------------------------------------- +// fsi #h +//---------------------------------------------------------------------------- +module Fsih = + + module Parser = + + open System.Xml + + type Help = + { + Summary: string + Remarks: string option + Parameters: (string * string) list + Returns: string option + Exceptions: (string * string) list + Examples: (string * string) list + FullName: string + Assembly: string + } + + member this.Print(fsiConsoleOutput: FsiConsoleOutput) = + let parameters = + this.Parameters + |> List.map (fun (name, description) -> sprintf "- %s: %s" name description) + |> String.concat "\n" + + fsiConsoleOutput.uprintfn "\nDescription:\n%s" this.Summary + + match this.Remarks with + | Some r -> fsiConsoleOutput.uprintfn "\nRemarks:\n%s" r + | None -> () + + if not (String.IsNullOrWhiteSpace(parameters)) then + fsiConsoleOutput.uprintfn "\nParameters:\n%s" parameters + + match this.Returns with + | Some r -> fsiConsoleOutput.uprintfn "Returns:\n%s" r + | None -> () + + if not this.Exceptions.IsEmpty then + fsiConsoleOutput.uprintfn "\nExceptions:" + + for (exType, exDesc) in this.Exceptions do + fsiConsoleOutput.uprintfn "%s: %s" exType exDesc + + if not this.Examples.IsEmpty then + fsiConsoleOutput.uprintfn "\nExamples:" + + for example, desc in this.Examples do + fsiConsoleOutput.uprintfn "%s" example + + if not (String.IsNullOrWhiteSpace(desc)) then + fsiConsoleOutput.uprintfn $"""// {desc.Replace("\n", "\n// ")}""" + + fsiConsoleOutput.uprintfn "" + + fsiConsoleOutput.uprintfn "Full name: %s" this.FullName + fsiConsoleOutput.uprintfn "Assembly: %s\n" this.Assembly + + let cleanupXmlContent (s: string) = s.Replace("\n ", "\n").Trim() // some stray whitespace from the XML + + // remove any leading `X:` and trailing `N + let trimDotNet (s: string) = + let s = if s.Length > 2 && s[1] = ':' then s.Substring(2) else s + let idx = s.IndexOf('`') + let s = if idx > 0 then s.Substring(0, idx) else s + s + + let xmlDocCache = Dictionary() + + let getXmlDocument xmlPath = + match xmlDocCache.TryGetValue(xmlPath) with + | true, value -> + let xmlDocument = XmlDocument() + xmlDocument.LoadXml(value) + xmlDocument + | _ -> + let rawXml = File.ReadAllText(xmlPath) + let xmlDocument = XmlDocument() + xmlDocument.LoadXml(rawXml) + xmlDocCache.Add(xmlPath, rawXml) + xmlDocument + + let getTexts (node: Xml.XmlNode) = + seq { + for child in node.ChildNodes do + if child.Name = "#text" then + yield child.Value + + if child.Name = "c" then + yield child.InnerText + + if child.Name = "see" then + let cref = child.Attributes.GetNamedItem("cref") + + if not (isNull cref) then + yield cref.Value |> trimDotNet + } + |> String.concat "" + + let helpText (xmlPath: string) (assembly: string) (modName: string) (implName: string) (sourceName: string) = + let sourceName = sourceName.Replace('.', '#') // for .ctor + let implName = implName.Replace('.', '#') // for .ctor + let xmlName = $"{modName}.{implName}" + let xmlDocument = getXmlDocument xmlPath + + let node = + let toTry = + [ + $"/doc/members/member[contains(@name, ':{xmlName}`')]" + $"/doc/members/member[contains(@name, ':{xmlName}(')]" + $"/doc/members/member[contains(@name, ':{xmlName}')]" + ] + + seq { + for t in toTry do + let node = xmlDocument.SelectSingleNode(t) + if not (isNull node) then Some node else None + } + |> Seq.tryPick id + + match node with + | None -> None + | Some n -> + let summary = + n.SelectSingleNode("summary") + |> Option.ofObj + |> Option.map getTexts + |> Option.map cleanupXmlContent + + let remarks = + n.SelectSingleNode("remarks") + |> Option.ofObj + |> Option.map getTexts + |> Option.map cleanupXmlContent + + let parameters = + n.SelectNodes("param") + |> Seq.cast + |> Seq.map (fun n -> n.Attributes.GetNamedItem("name").Value.Trim(), n.InnerText.Trim()) + |> List.ofSeq + + let returns = + n.SelectSingleNode("returns") + |> Option.ofObj + |> Option.map (fun n -> getTexts(n).Trim()) + + let exceptions = + n.SelectNodes("exception") + |> Seq.cast + |> Seq.map (fun n -> + let exType = n.Attributes.GetNamedItem("cref").Value + let idx = exType.IndexOf(':') + let exType = if idx >= 0 then exType.Substring(idx + 1) else exType + exType.Trim(), n.InnerText.Trim()) + |> List.ofSeq + + let examples = + n.SelectNodes("example") + |> Seq.cast + |> Seq.map (fun n -> + let codeNode = n.SelectSingleNode("code") + + let code = + if isNull codeNode then + "" + else + n.RemoveChild(codeNode) |> ignore + cleanupXmlContent codeNode.InnerText + + code, cleanupXmlContent n.InnerText) + |> List.ofSeq + + match summary with + | Some s -> + { + Summary = s + Remarks = remarks + Parameters = parameters + Returns = returns + Exceptions = exceptions + Examples = examples + FullName = $"{modName}.{sourceName}" // the long ident as users see it + Assembly = assembly + } + |> Some + | None -> None + + module Expr = + + open Microsoft.FSharp.Quotations.Patterns + + let tryGetSourceName (methodInfo: MethodInfo) = + try + let attr = methodInfo.GetCustomAttribute() + Some attr.SourceName + with _ -> + None + + let getInfos (declaringType: Type) (sourceName: string option) (implName: string) = + let xmlPath = Path.ChangeExtension(declaringType.Assembly.Location, ".xml") + let assembly = Path.GetFileName(declaringType.Assembly.Location) + + if File.Exists(xmlPath) then + // for FullName cases like Microsoft.FSharp.Core.FSharpOption`1[System.Object] + let fullName = + let idx = declaringType.FullName.IndexOf('[') + + if idx >= 0 then + declaringType.FullName.Substring(0, idx) + else + declaringType.FullName + + let fullName = fullName.Replace('+', '.') // for FullName cases like Microsoft.FSharp.Collections.ArrayModule+Parallel + + Some(xmlPath, assembly, fullName, implName, sourceName |> Option.defaultValue implName) + else + None + + let rec exprNames expr = + match expr with + | Call(exprOpt, methodInfo, _exprList) -> + match exprOpt with + | Some _ -> None + | None -> + let sourceName = tryGetSourceName methodInfo + getInfos methodInfo.DeclaringType sourceName methodInfo.Name + | Lambda(_param, body) -> exprNames body + | Let(_, _, body) -> exprNames body + | Value(_o, t) -> getInfos t (Some t.Name) t.Name + | DefaultValue t -> getInfos t (Some t.Name) t.Name + | PropertyGet(_o, info, _) -> getInfos info.DeclaringType (Some info.Name) info.Name + | NewUnionCase(info, _exprList) -> getInfos info.DeclaringType (Some info.Name) info.Name + | NewObject(ctorInfo, _e) -> getInfos ctorInfo.DeclaringType (Some ctorInfo.Name) ctorInfo.Name + | NewArray(t, _exprs) -> getInfos t (Some t.Name) t.Name + | NewTuple _ -> + let x = (23, 42) + let t = x.GetType() + getInfos t (Some t.Name) t.Name + | NewStructTuple _ -> + let x = struct (23, 42) + let t = x.GetType() + getInfos t (Some t.Name) t.Name + | _ -> None + + module Logic = + + open Expr + open Parser + + module Quoted = + let tryGetDocumentation expr = + match exprNames expr with + | Some(xmlPath, assembly, modName, implName, sourceName) -> helpText xmlPath assembly modName implName sourceName + | _ -> None + + let h (fsiConsoleOutput: FsiConsoleOutput) (expr: Quotations.Expr) = + match tryGetDocumentation expr with + | None -> fsiConsoleOutput.uprintfn "unable to get documentation" + | Some d -> d.Print(fsiConsoleOutput) + //---------------------------------------------------------------------------- // Startup processing //---------------------------------------------------------------------------- @@ -2499,7 +2762,7 @@ type internal FsiDynamicCompiler processContents newState declaredImpls /// Evaluate the given expression and produce a new interactive state. - member fsiDynamicCompiler.EvalParsedExpression(ctok, diagnosticsLogger: DiagnosticsLogger, istate, expr: SynExpr) = + member fsiDynamicCompiler.EvalParsedExpression(ctok, diagnosticsLogger: DiagnosticsLogger, istate, expr: SynExpr, suppressItPrint) = let tcConfig = TcConfig.Create(tcConfigB, validate = false) let itName = "it" @@ -2513,7 +2776,7 @@ type internal FsiDynamicCompiler // Snarf the type for 'it' via the binding match istate.tcState.TcEnvFromImpls.NameEnv.FindUnqualifiedItem itName with | Item.Value vref -> - if not tcConfig.noFeedback then + if not tcConfig.noFeedback && not suppressItPrint then let infoReader = InfoReader(istate.tcGlobals, istate.tcImports.GetImportMap()) valuePrinter.InvokeExprPrinter( @@ -3724,9 +3987,35 @@ type FsiInteractionProcessor stopProcessingRecovery e range0 None + let runhDirective diagnosticsLogger ctok istate source = + let lexbuf = + UnicodeLexing.StringAsLexbuf(true, tcConfigB.langVersion, tcConfigB.strictIndentation, $"<@@ {source} @@>") + + let tokenizer = + fsiStdinLexerProvider.CreateBufferLexer("hdummy.fsx", lexbuf, diagnosticsLogger) + + let parsedInteraction = ParseInteraction tokenizer + + match parsedInteraction with + | Some(ParsedScriptInteraction.Definitions([ SynModuleDecl.Expr(e, _) ], _)) -> + + let _state, status = + fsiDynamicCompiler.EvalParsedExpression(ctok, diagnosticsLogger, istate, e, true) + + match status with + | Completed(Some compStatus) -> + match compStatus.ReflectionValue with + | :? FSharp.Quotations.Expr as qex -> Fsih.Logic.Quoted.h fsiConsoleOutput qex + | _ -> () + | _ -> () + | _ -> () + /// Partially process a hash directive, leaving state in packageManagerLines and required assemblies let PartiallyProcessHashDirective (ctok, istate, hash, diagnosticsLogger: DiagnosticsLogger) = match hash with + | ParsedHashDirective("h", ParsedHashDirectiveArguments [ source ], _m) -> + runhDirective diagnosticsLogger ctok istate source + istate, Completed None | ParsedHashDirective("load", ParsedHashDirectiveArguments sourceFiles, m) -> let istate = fsiDynamicCompiler.EvalSourceFiles(ctok, istate, m, sourceFiles, lexResourceManager, diagnosticsLogger) @@ -3866,7 +4155,7 @@ type FsiInteractionProcessor | InteractionGroup.HashDirectives [] -> istate, Completed None | InteractionGroup.Definitions([ SynModuleDecl.Expr(expr, _) ], _) -> - fsiDynamicCompiler.EvalParsedExpression(ctok, diagnosticsLogger, istate, expr) + fsiDynamicCompiler.EvalParsedExpression(ctok, diagnosticsLogger, istate, expr, false) | InteractionGroup.Definitions(defs, _) -> fsiDynamicCompiler.EvalParsedDefinitions(ctok, diagnosticsLogger, istate, true, false, defs) @@ -4060,7 +4349,7 @@ type FsiInteractionProcessor |> InteractiveCatch diagnosticsLogger (fun istate -> istate |> mainThreadProcessAction ctok (fun ctok istate -> - fsiDynamicCompiler.EvalParsedExpression(ctok, diagnosticsLogger, istate, expr))) + fsiDynamicCompiler.EvalParsedExpression(ctok, diagnosticsLogger, istate, expr, false))) let commitResult (istate, result) = match result with From 6a14c98550a02c7b69530a2612badf5ccd21a1de Mon Sep 17 00:00:00 2001 From: dawe Date: Sun, 12 May 2024 16:37:34 +0200 Subject: [PATCH 02/34] add PR number --- docs/release-notes/.FSharp.Compiler.Service/8.0.400.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/release-notes/.FSharp.Compiler.Service/8.0.400.md b/docs/release-notes/.FSharp.Compiler.Service/8.0.400.md index 7e57e05a868..398842ca477 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/8.0.400.md +++ b/docs/release-notes/.FSharp.Compiler.Service/8.0.400.md @@ -1,6 +1,6 @@ ### Fixed -* Added #h directive to fsi to show documentation in the REPL. ([PR #XXXX](https://github.com/dotnet/fsharp/pull/XXXX)) +* Added #h directive to fsi to show documentation in the REPL. ([PR #17140](https://github.com/dotnet/fsharp/pull/17140)) * Optimize simple mappings with preludes in computed collections. ([PR #17067](https://github.com/dotnet/fsharp/pull/17067)) * Improve error reporting for abstract members when used in classes. ([PR #17063](https://github.com/dotnet/fsharp/pull/17063)) * Improve error reporting when property has same name as DU case. ([Issue #16646](https://github.com/dotnet/fsharp/issues/16646), [PR #17088](https://github.com/dotnet/fsharp/pull/17088)) From 01d8ded22cf167eba7f9d86f3047dc72422803d5 Mon Sep 17 00:00:00 2001 From: dawe Date: Sun, 12 May 2024 17:03:46 +0200 Subject: [PATCH 03/34] update xlf files --- src/Compiler/Interactive/xlf/FSIstrings.txt.cs.xlf | 5 +++++ src/Compiler/Interactive/xlf/FSIstrings.txt.de.xlf | 5 +++++ src/Compiler/Interactive/xlf/FSIstrings.txt.es.xlf | 5 +++++ src/Compiler/Interactive/xlf/FSIstrings.txt.fr.xlf | 5 +++++ src/Compiler/Interactive/xlf/FSIstrings.txt.it.xlf | 5 +++++ src/Compiler/Interactive/xlf/FSIstrings.txt.ja.xlf | 5 +++++ src/Compiler/Interactive/xlf/FSIstrings.txt.ko.xlf | 5 +++++ src/Compiler/Interactive/xlf/FSIstrings.txt.pl.xlf | 5 +++++ src/Compiler/Interactive/xlf/FSIstrings.txt.pt-BR.xlf | 5 +++++ src/Compiler/Interactive/xlf/FSIstrings.txt.ru.xlf | 5 +++++ src/Compiler/Interactive/xlf/FSIstrings.txt.tr.xlf | 5 +++++ src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hans.xlf | 5 +++++ src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hant.xlf | 5 +++++ 13 files changed, 65 insertions(+) diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.cs.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.cs.xlf index 97dcca71c4c..d121c808b5d 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.cs.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.cs.xlf @@ -17,6 +17,11 @@ Vymazat obrazovku + + Display documentation for an expression, e.g. #h \"List.map\";; + Display documentation for an expression, e.g. #h \"List.map\";; + + Operation could not be completed due to earlier error Operaci nešlo dokončit z důvodu dřívější chyby. diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.de.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.de.xlf index a3d73b0e675..7ec35d5a512 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.de.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.de.xlf @@ -17,6 +17,11 @@ Bildschirm löschen + + Display documentation for an expression, e.g. #h \"List.map\";; + Display documentation for an expression, e.g. #h \"List.map\";; + + Operation could not be completed due to earlier error Der Vorgang konnte aufgrund eines vorherigen Fehlers nicht abgeschlossen werden. diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.es.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.es.xlf index 190ff245baa..31aeaa9faa7 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.es.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.es.xlf @@ -17,6 +17,11 @@ Borrar pantalla + + Display documentation for an expression, e.g. #h \"List.map\";; + Display documentation for an expression, e.g. #h \"List.map\";; + + Operation could not be completed due to earlier error La operación no se pudo completar debido a un error anterior diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.fr.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.fr.xlf index 38d7a20d8e9..0958e45c297 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.fr.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.fr.xlf @@ -17,6 +17,11 @@ Effacer l'écran + + Display documentation for an expression, e.g. #h \"List.map\";; + Display documentation for an expression, e.g. #h \"List.map\";; + + Operation could not be completed due to earlier error Impossible d'exécuter l'opération en raison d'une erreur antérieure diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.it.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.it.xlf index 9c916837e52..ae0691b08fe 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.it.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.it.xlf @@ -17,6 +17,11 @@ Cancella schermata + + Display documentation for an expression, e.g. #h \"List.map\";; + Display documentation for an expression, e.g. #h \"List.map\";; + + Operation could not be completed due to earlier error Non è stato possibile completare l'operazione a causa di un errore precedente diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.ja.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.ja.xlf index eab626f267e..66bdd5e8aac 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.ja.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.ja.xlf @@ -17,6 +17,11 @@ 画面をクリアする + + Display documentation for an expression, e.g. #h \"List.map\";; + Display documentation for an expression, e.g. #h \"List.map\";; + + Operation could not be completed due to earlier error 以前のエラーが原因で操作を完了できませんでした diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.ko.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.ko.xlf index be891b98188..703818f32a6 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.ko.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.ko.xlf @@ -17,6 +17,11 @@ 화면 지우기 + + Display documentation for an expression, e.g. #h \"List.map\";; + Display documentation for an expression, e.g. #h \"List.map\";; + + Operation could not be completed due to earlier error 이전 오류로 인해 작업을 완료할 수 없습니다. diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.pl.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.pl.xlf index 58adec37da4..7b27c91d068 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.pl.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.pl.xlf @@ -17,6 +17,11 @@ Wyczyść ekran + + Display documentation for an expression, e.g. #h \"List.map\";; + Display documentation for an expression, e.g. #h \"List.map\";; + + Operation could not be completed due to earlier error Nie udało się ukończyć operacji z powodu wcześniejszego błędu diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.pt-BR.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.pt-BR.xlf index b080a196f7c..713a8b5b33b 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.pt-BR.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.pt-BR.xlf @@ -17,6 +17,11 @@ Limpar tela + + Display documentation for an expression, e.g. #h \"List.map\";; + Display documentation for an expression, e.g. #h \"List.map\";; + + Operation could not be completed due to earlier error Não foi possível concluir a operação devido a um erro anterior diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.ru.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.ru.xlf index e46822530d8..942ea81bbb8 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.ru.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.ru.xlf @@ -17,6 +17,11 @@ Очистить экран + + Display documentation for an expression, e.g. #h \"List.map\";; + Display documentation for an expression, e.g. #h \"List.map\";; + + Operation could not be completed due to earlier error Операция не может быть завершена из-за предыдущей ошибки diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.tr.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.tr.xlf index 3222a474ef5..9449856167a 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.tr.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.tr.xlf @@ -17,6 +17,11 @@ Ekranı temizle + + Display documentation for an expression, e.g. #h \"List.map\";; + Display documentation for an expression, e.g. #h \"List.map\";; + + Operation could not be completed due to earlier error Önceki hata nedeniyle işlem tamamlanamadı diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hans.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hans.xlf index de485cc5361..9fd2b340994 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hans.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hans.xlf @@ -17,6 +17,11 @@ 清除屏幕 + + Display documentation for an expression, e.g. #h \"List.map\";; + Display documentation for an expression, e.g. #h \"List.map\";; + + Operation could not be completed due to earlier error 由于早期错误,无法完成操作 diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hant.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hant.xlf index 9348019132b..37fab090895 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hant.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hant.xlf @@ -17,6 +17,11 @@ 清空螢幕 + + Display documentation for an expression, e.g. #h \"List.map\";; + Display documentation for an expression, e.g. #h \"List.map\";; + + Operation could not be completed due to earlier error 因為先前發生錯誤,所以無法完成作業 From a8b39e9c2a4fcc4024ad04d7ca4f3309b618a768 Mon Sep 17 00:00:00 2001 From: dawe Date: Sun, 12 May 2024 19:24:32 +0200 Subject: [PATCH 04/34] update core printing baselines --- .../DependencyManagerInteractiveTests.fs | 2 ++ tests/fsharp/core/printing/output.1000.stdout.bsl | 1 + tests/fsharp/core/printing/output.200.stdout.bsl | 1 + tests/fsharp/core/printing/output.47.stdout.bsl | 1 + tests/fsharp/core/printing/output.multiemit.stdout.bsl | 1 + tests/fsharp/core/printing/output.off.stdout.bsl | 1 + tests/fsharp/core/printing/output.stdout.bsl | 1 + 7 files changed, 8 insertions(+) diff --git a/tests/FSharp.Compiler.Private.Scripting.UnitTests/DependencyManagerInteractiveTests.fs b/tests/FSharp.Compiler.Private.Scripting.UnitTests/DependencyManagerInteractiveTests.fs index 2fc5366eeed..52f9d416b3b 100644 --- a/tests/FSharp.Compiler.Private.Scripting.UnitTests/DependencyManagerInteractiveTests.fs +++ b/tests/FSharp.Compiler.Private.Scripting.UnitTests/DependencyManagerInteractiveTests.fs @@ -719,6 +719,7 @@ x |> Seq.iter(fun r -> """ #time ["on"|"off"];; // Toggle timing on/off""" """ #clear;; // Clear screen""" """ #help;; // Display help""" + """ #h "expr";; // Display documentation for an expression, e.g. #h "List.map";;""" """ #quit;; // Exit""" """""" """ F# Interactive command line options:""" @@ -766,6 +767,7 @@ x |> Seq.iter(fun r -> """ #load "file.fs" ...;; // Load the given file(s) as if compiled and referenced""" """ #time ["on"|"off"];; // Toggle timing on/off""" """ #help;; // Display help""" + """ #h "expr";; // Display documentation for an expression, e.g. #h "List.map";;""" """ #r "nuget:FSharp.Data, 3.1.2";; // Load Nuget Package 'FSharp.Data' version '3.1.2'""" """ #r "nuget:FSharp.Data";; // Load Nuget Package 'FSharp.Data' with the highest version""" """ #clear;; // Clear screen""" diff --git a/tests/fsharp/core/printing/output.1000.stdout.bsl b/tests/fsharp/core/printing/output.1000.stdout.bsl index ddde159fd6b..d8a4b78cebb 100644 --- a/tests/fsharp/core/printing/output.1000.stdout.bsl +++ b/tests/fsharp/core/printing/output.1000.stdout.bsl @@ -1101,6 +1101,7 @@ type 'a T4063 = | AT4063 of 'a #load "file.fs" ...;; // Load the given file(s) as if compiled and referenced #time ["on"|"off"];; // Toggle timing on/off #help;; // Display help + #h "expr";; // Display documentation for an expression, e.g. #h "List.map";; #r "nuget:FSharp.Data, 3.1.2";; // Load Nuget Package 'FSharp.Data' version '3.1.2' #r "nuget:FSharp.Data";; // Load Nuget Package 'FSharp.Data' with the highest version #clear;; // Clear screen diff --git a/tests/fsharp/core/printing/output.200.stdout.bsl b/tests/fsharp/core/printing/output.200.stdout.bsl index 89f13b2b05f..374de93a0f9 100644 --- a/tests/fsharp/core/printing/output.200.stdout.bsl +++ b/tests/fsharp/core/printing/output.200.stdout.bsl @@ -421,6 +421,7 @@ type 'a T4063 = | AT4063 of 'a #load "file.fs" ...;; // Load the given file(s) as if compiled and referenced #time ["on"|"off"];; // Toggle timing on/off #help;; // Display help + #h "expr";; // Display documentation for an expression, e.g. #h "List.map";; #r "nuget:FSharp.Data, 3.1.2";; // Load Nuget Package 'FSharp.Data' version '3.1.2' #r "nuget:FSharp.Data";; // Load Nuget Package 'FSharp.Data' with the highest version #clear;; // Clear screen diff --git a/tests/fsharp/core/printing/output.47.stdout.bsl b/tests/fsharp/core/printing/output.47.stdout.bsl index 37a93c6fe8e..8e36691241f 100644 --- a/tests/fsharp/core/printing/output.47.stdout.bsl +++ b/tests/fsharp/core/printing/output.47.stdout.bsl @@ -4060,6 +4060,7 @@ type 'a T4063 = | AT4063 of 'a #load "file.fs" ...;; // Load the given file(s) as if compiled and referenced #time ["on"|"off"];; // Toggle timing on/off #help;; // Display help + #h "expr";; // Display documentation for an expression, e.g. #h "List.map";; #clear;; // Clear screen #quit;; // Exit diff --git a/tests/fsharp/core/printing/output.multiemit.stdout.bsl b/tests/fsharp/core/printing/output.multiemit.stdout.bsl index ceb7d3d69a3..e0ff084cecc 100644 --- a/tests/fsharp/core/printing/output.multiemit.stdout.bsl +++ b/tests/fsharp/core/printing/output.multiemit.stdout.bsl @@ -4060,6 +4060,7 @@ type 'a T4063 = | AT4063 of 'a #load "file.fs" ...;; // Load the given file(s) as if compiled and referenced #time ["on"|"off"];; // Toggle timing on/off #help;; // Display help + #h "expr";; // Display documentation for an expression, e.g. #h "List.map";; #r "nuget:FSharp.Data, 3.1.2";; // Load Nuget Package 'FSharp.Data' version '3.1.2' #r "nuget:FSharp.Data";; // Load Nuget Package 'FSharp.Data' with the highest version #clear;; // Clear screen diff --git a/tests/fsharp/core/printing/output.off.stdout.bsl b/tests/fsharp/core/printing/output.off.stdout.bsl index 64444ac405b..ce4327c994f 100644 --- a/tests/fsharp/core/printing/output.off.stdout.bsl +++ b/tests/fsharp/core/printing/output.off.stdout.bsl @@ -248,6 +248,7 @@ type 'a T4063 = | AT4063 of 'a #load "file.fs" ...;; // Load the given file(s) as if compiled and referenced #time ["on"|"off"];; // Toggle timing on/off #help;; // Display help + #h "expr";; // Display documentation for an expression, e.g. #h "List.map";; #r "nuget:FSharp.Data, 3.1.2";; // Load Nuget Package 'FSharp.Data' version '3.1.2' #r "nuget:FSharp.Data";; // Load Nuget Package 'FSharp.Data' with the highest version #clear;; // Clear screen diff --git a/tests/fsharp/core/printing/output.stdout.bsl b/tests/fsharp/core/printing/output.stdout.bsl index ceb7d3d69a3..e0ff084cecc 100644 --- a/tests/fsharp/core/printing/output.stdout.bsl +++ b/tests/fsharp/core/printing/output.stdout.bsl @@ -4060,6 +4060,7 @@ type 'a T4063 = | AT4063 of 'a #load "file.fs" ...;; // Load the given file(s) as if compiled and referenced #time ["on"|"off"];; // Toggle timing on/off #help;; // Display help + #h "expr";; // Display documentation for an expression, e.g. #h "List.map";; #r "nuget:FSharp.Data, 3.1.2";; // Load Nuget Package 'FSharp.Data' version '3.1.2' #r "nuget:FSharp.Data";; // Load Nuget Package 'FSharp.Data' with the highest version #clear;; // Clear screen From 42f479d95f277330b6e14fe4e39bdcb4438c1927 Mon Sep 17 00:00:00 2001 From: dawe Date: Tue, 14 May 2024 22:56:34 +0200 Subject: [PATCH 05/34] rename module to FsiHelp --- src/Compiler/Interactive/fsi.fs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Compiler/Interactive/fsi.fs b/src/Compiler/Interactive/fsi.fs index b9518ed2776..13532eadee0 100644 --- a/src/Compiler/Interactive/fsi.fs +++ b/src/Compiler/Interactive/fsi.fs @@ -1414,7 +1414,7 @@ type internal FsiConsolePrompt(fsiOptions: FsiCommandLineOptions, fsiConsoleOutp //---------------------------------------------------------------------------- // fsi #h //---------------------------------------------------------------------------- -module Fsih = +module FsiHelp = module Parser = @@ -4005,7 +4005,7 @@ type FsiInteractionProcessor match status with | Completed(Some compStatus) -> match compStatus.ReflectionValue with - | :? FSharp.Quotations.Expr as qex -> Fsih.Logic.Quoted.h fsiConsoleOutput qex + | :? FSharp.Quotations.Expr as qex -> FsiHelp.Logic.Quoted.h fsiConsoleOutput qex | _ -> () | _ -> () | _ -> () From 909913c2bb43edf0af72b8ccac3cbf7fc1551c0d Mon Sep 17 00:00:00 2001 From: dawe Date: Tue, 14 May 2024 23:21:53 +0200 Subject: [PATCH 06/34] rewrite Help.Print() to return a string to be independent of FsiConsoleOutput. --- src/Compiler/Interactive/fsi.fs | 40 +++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/src/Compiler/Interactive/fsi.fs b/src/Compiler/Interactive/fsi.fs index 13532eadee0..6cb059535fd 100644 --- a/src/Compiler/Interactive/fsi.fs +++ b/src/Compiler/Interactive/fsi.fs @@ -1432,44 +1432,48 @@ module FsiHelp = Assembly: string } - member this.Print(fsiConsoleOutput: FsiConsoleOutput) = + member this.ToDisplayString() = + let sb = StringBuilder() + let parameters = this.Parameters |> List.map (fun (name, description) -> sprintf "- %s: %s" name description) |> String.concat "\n" - fsiConsoleOutput.uprintfn "\nDescription:\n%s" this.Summary + sb.AppendLine($"\nDescription:\n%s{this.Summary}") |> ignore match this.Remarks with - | Some r -> fsiConsoleOutput.uprintfn "\nRemarks:\n%s" r + | Some r -> sb.AppendLine $"\nRemarks:\n%s{r}" |> ignore | None -> () if not (String.IsNullOrWhiteSpace(parameters)) then - fsiConsoleOutput.uprintfn "\nParameters:\n%s" parameters + sb.AppendLine $"\nParameters:\n%s{parameters}" |> ignore match this.Returns with - | Some r -> fsiConsoleOutput.uprintfn "Returns:\n%s" r + | Some r -> sb.AppendLine $"Returns:\n%s{r}" |> ignore | None -> () if not this.Exceptions.IsEmpty then - fsiConsoleOutput.uprintfn "\nExceptions:" + sb.AppendLine "\nExceptions:" |> ignore for (exType, exDesc) in this.Exceptions do - fsiConsoleOutput.uprintfn "%s: %s" exType exDesc + sb.AppendLine $"%s{exType}: %s{exDesc}" |> ignore if not this.Examples.IsEmpty then - fsiConsoleOutput.uprintfn "\nExamples:" + sb.AppendLine "\nExamples:" |> ignore for example, desc in this.Examples do - fsiConsoleOutput.uprintfn "%s" example + sb.AppendLine example |> ignore if not (String.IsNullOrWhiteSpace(desc)) then - fsiConsoleOutput.uprintfn $"""// {desc.Replace("\n", "\n// ")}""" + sb.AppendLine $"""// {desc.Replace("\n", "\n// ")}""" |> ignore + + sb.AppendLine "" |> ignore - fsiConsoleOutput.uprintfn "" + sb.AppendLine $"Full name: %s{this.FullName}" |> ignore + sb.AppendLine $"Assembly: %s{this.Assembly}\n" |> ignore - fsiConsoleOutput.uprintfn "Full name: %s" this.FullName - fsiConsoleOutput.uprintfn "Assembly: %s\n" this.Assembly + sb.ToString() let cleanupXmlContent (s: string) = s.Replace("\n ", "\n").Trim() // some stray whitespace from the XML @@ -1668,10 +1672,10 @@ module FsiHelp = | Some(xmlPath, assembly, modName, implName, sourceName) -> helpText xmlPath assembly modName implName sourceName | _ -> None - let h (fsiConsoleOutput: FsiConsoleOutput) (expr: Quotations.Expr) = + let h (expr: Quotations.Expr) = match tryGetDocumentation expr with - | None -> fsiConsoleOutput.uprintfn "unable to get documentation" - | Some d -> d.Print(fsiConsoleOutput) + | None -> "unable to get documentation" + | Some d -> d.ToDisplayString() //---------------------------------------------------------------------------- // Startup processing @@ -4005,7 +4009,9 @@ type FsiInteractionProcessor match status with | Completed(Some compStatus) -> match compStatus.ReflectionValue with - | :? FSharp.Quotations.Expr as qex -> FsiHelp.Logic.Quoted.h fsiConsoleOutput qex + | :? FSharp.Quotations.Expr as qex -> + let s = FsiHelp.Logic.Quoted.h qex + fsiConsoleOutput.uprintf "%s" s | _ -> () | _ -> () | _ -> () From d3c4dafc0b83943f6e75a4ffdbadeb71b88e7dac Mon Sep 17 00:00:00 2001 From: dawe Date: Tue, 14 May 2024 23:38:02 +0200 Subject: [PATCH 07/34] move fsihelp module to dedicated file --- src/Compiler/FSharp.Compiler.Service.fsproj | 2 + src/Compiler/Interactive/fsi.fs | 266 ------------------- src/Compiler/Interactive/fsihelp.fs | 273 ++++++++++++++++++++ src/Compiler/Interactive/fsihelp.fsi | 7 + 4 files changed, 282 insertions(+), 266 deletions(-) create mode 100644 src/Compiler/Interactive/fsihelp.fs create mode 100644 src/Compiler/Interactive/fsihelp.fsi diff --git a/src/Compiler/FSharp.Compiler.Service.fsproj b/src/Compiler/FSharp.Compiler.Service.fsproj index 63428be3f11..251ff28ad23 100644 --- a/src/Compiler/FSharp.Compiler.Service.fsproj +++ b/src/Compiler/FSharp.Compiler.Service.fsproj @@ -523,6 +523,8 @@ + + diff --git a/src/Compiler/Interactive/fsi.fs b/src/Compiler/Interactive/fsi.fs index 6cb059535fd..9d333ee4eef 100644 --- a/src/Compiler/Interactive/fsi.fs +++ b/src/Compiler/Interactive/fsi.fs @@ -1411,272 +1411,6 @@ type internal FsiConsolePrompt(fsiOptions: FsiCommandLineOptions, fsiConsoleOutp member _.FsiOptions = fsiOptions -//---------------------------------------------------------------------------- -// fsi #h -//---------------------------------------------------------------------------- -module FsiHelp = - - module Parser = - - open System.Xml - - type Help = - { - Summary: string - Remarks: string option - Parameters: (string * string) list - Returns: string option - Exceptions: (string * string) list - Examples: (string * string) list - FullName: string - Assembly: string - } - - member this.ToDisplayString() = - let sb = StringBuilder() - - let parameters = - this.Parameters - |> List.map (fun (name, description) -> sprintf "- %s: %s" name description) - |> String.concat "\n" - - sb.AppendLine($"\nDescription:\n%s{this.Summary}") |> ignore - - match this.Remarks with - | Some r -> sb.AppendLine $"\nRemarks:\n%s{r}" |> ignore - | None -> () - - if not (String.IsNullOrWhiteSpace(parameters)) then - sb.AppendLine $"\nParameters:\n%s{parameters}" |> ignore - - match this.Returns with - | Some r -> sb.AppendLine $"Returns:\n%s{r}" |> ignore - | None -> () - - if not this.Exceptions.IsEmpty then - sb.AppendLine "\nExceptions:" |> ignore - - for (exType, exDesc) in this.Exceptions do - sb.AppendLine $"%s{exType}: %s{exDesc}" |> ignore - - if not this.Examples.IsEmpty then - sb.AppendLine "\nExamples:" |> ignore - - for example, desc in this.Examples do - sb.AppendLine example |> ignore - - if not (String.IsNullOrWhiteSpace(desc)) then - sb.AppendLine $"""// {desc.Replace("\n", "\n// ")}""" |> ignore - - sb.AppendLine "" |> ignore - - sb.AppendLine $"Full name: %s{this.FullName}" |> ignore - sb.AppendLine $"Assembly: %s{this.Assembly}\n" |> ignore - - sb.ToString() - - let cleanupXmlContent (s: string) = s.Replace("\n ", "\n").Trim() // some stray whitespace from the XML - - // remove any leading `X:` and trailing `N - let trimDotNet (s: string) = - let s = if s.Length > 2 && s[1] = ':' then s.Substring(2) else s - let idx = s.IndexOf('`') - let s = if idx > 0 then s.Substring(0, idx) else s - s - - let xmlDocCache = Dictionary() - - let getXmlDocument xmlPath = - match xmlDocCache.TryGetValue(xmlPath) with - | true, value -> - let xmlDocument = XmlDocument() - xmlDocument.LoadXml(value) - xmlDocument - | _ -> - let rawXml = File.ReadAllText(xmlPath) - let xmlDocument = XmlDocument() - xmlDocument.LoadXml(rawXml) - xmlDocCache.Add(xmlPath, rawXml) - xmlDocument - - let getTexts (node: Xml.XmlNode) = - seq { - for child in node.ChildNodes do - if child.Name = "#text" then - yield child.Value - - if child.Name = "c" then - yield child.InnerText - - if child.Name = "see" then - let cref = child.Attributes.GetNamedItem("cref") - - if not (isNull cref) then - yield cref.Value |> trimDotNet - } - |> String.concat "" - - let helpText (xmlPath: string) (assembly: string) (modName: string) (implName: string) (sourceName: string) = - let sourceName = sourceName.Replace('.', '#') // for .ctor - let implName = implName.Replace('.', '#') // for .ctor - let xmlName = $"{modName}.{implName}" - let xmlDocument = getXmlDocument xmlPath - - let node = - let toTry = - [ - $"/doc/members/member[contains(@name, ':{xmlName}`')]" - $"/doc/members/member[contains(@name, ':{xmlName}(')]" - $"/doc/members/member[contains(@name, ':{xmlName}')]" - ] - - seq { - for t in toTry do - let node = xmlDocument.SelectSingleNode(t) - if not (isNull node) then Some node else None - } - |> Seq.tryPick id - - match node with - | None -> None - | Some n -> - let summary = - n.SelectSingleNode("summary") - |> Option.ofObj - |> Option.map getTexts - |> Option.map cleanupXmlContent - - let remarks = - n.SelectSingleNode("remarks") - |> Option.ofObj - |> Option.map getTexts - |> Option.map cleanupXmlContent - - let parameters = - n.SelectNodes("param") - |> Seq.cast - |> Seq.map (fun n -> n.Attributes.GetNamedItem("name").Value.Trim(), n.InnerText.Trim()) - |> List.ofSeq - - let returns = - n.SelectSingleNode("returns") - |> Option.ofObj - |> Option.map (fun n -> getTexts(n).Trim()) - - let exceptions = - n.SelectNodes("exception") - |> Seq.cast - |> Seq.map (fun n -> - let exType = n.Attributes.GetNamedItem("cref").Value - let idx = exType.IndexOf(':') - let exType = if idx >= 0 then exType.Substring(idx + 1) else exType - exType.Trim(), n.InnerText.Trim()) - |> List.ofSeq - - let examples = - n.SelectNodes("example") - |> Seq.cast - |> Seq.map (fun n -> - let codeNode = n.SelectSingleNode("code") - - let code = - if isNull codeNode then - "" - else - n.RemoveChild(codeNode) |> ignore - cleanupXmlContent codeNode.InnerText - - code, cleanupXmlContent n.InnerText) - |> List.ofSeq - - match summary with - | Some s -> - { - Summary = s - Remarks = remarks - Parameters = parameters - Returns = returns - Exceptions = exceptions - Examples = examples - FullName = $"{modName}.{sourceName}" // the long ident as users see it - Assembly = assembly - } - |> Some - | None -> None - - module Expr = - - open Microsoft.FSharp.Quotations.Patterns - - let tryGetSourceName (methodInfo: MethodInfo) = - try - let attr = methodInfo.GetCustomAttribute() - Some attr.SourceName - with _ -> - None - - let getInfos (declaringType: Type) (sourceName: string option) (implName: string) = - let xmlPath = Path.ChangeExtension(declaringType.Assembly.Location, ".xml") - let assembly = Path.GetFileName(declaringType.Assembly.Location) - - if File.Exists(xmlPath) then - // for FullName cases like Microsoft.FSharp.Core.FSharpOption`1[System.Object] - let fullName = - let idx = declaringType.FullName.IndexOf('[') - - if idx >= 0 then - declaringType.FullName.Substring(0, idx) - else - declaringType.FullName - - let fullName = fullName.Replace('+', '.') // for FullName cases like Microsoft.FSharp.Collections.ArrayModule+Parallel - - Some(xmlPath, assembly, fullName, implName, sourceName |> Option.defaultValue implName) - else - None - - let rec exprNames expr = - match expr with - | Call(exprOpt, methodInfo, _exprList) -> - match exprOpt with - | Some _ -> None - | None -> - let sourceName = tryGetSourceName methodInfo - getInfos methodInfo.DeclaringType sourceName methodInfo.Name - | Lambda(_param, body) -> exprNames body - | Let(_, _, body) -> exprNames body - | Value(_o, t) -> getInfos t (Some t.Name) t.Name - | DefaultValue t -> getInfos t (Some t.Name) t.Name - | PropertyGet(_o, info, _) -> getInfos info.DeclaringType (Some info.Name) info.Name - | NewUnionCase(info, _exprList) -> getInfos info.DeclaringType (Some info.Name) info.Name - | NewObject(ctorInfo, _e) -> getInfos ctorInfo.DeclaringType (Some ctorInfo.Name) ctorInfo.Name - | NewArray(t, _exprs) -> getInfos t (Some t.Name) t.Name - | NewTuple _ -> - let x = (23, 42) - let t = x.GetType() - getInfos t (Some t.Name) t.Name - | NewStructTuple _ -> - let x = struct (23, 42) - let t = x.GetType() - getInfos t (Some t.Name) t.Name - | _ -> None - - module Logic = - - open Expr - open Parser - - module Quoted = - let tryGetDocumentation expr = - match exprNames expr with - | Some(xmlPath, assembly, modName, implName, sourceName) -> helpText xmlPath assembly modName implName sourceName - | _ -> None - - let h (expr: Quotations.Expr) = - match tryGetDocumentation expr with - | None -> "unable to get documentation" - | Some d -> d.ToDisplayString() - //---------------------------------------------------------------------------- // Startup processing //---------------------------------------------------------------------------- diff --git a/src/Compiler/Interactive/fsihelp.fs b/src/Compiler/Interactive/fsihelp.fs new file mode 100644 index 00000000000..34f6fcb4834 --- /dev/null +++ b/src/Compiler/Interactive/fsihelp.fs @@ -0,0 +1,273 @@ +module FSharp.Compiler.Interactive.FsiHelp + +[] +[] +do () + +open System +open System.Collections.Generic +open System.IO +open System.Text +open System.Reflection +open FSharp.Compiler + +module Parser = + + open System.Xml + + type Help = + { + Summary: string + Remarks: string option + Parameters: (string * string) list + Returns: string option + Exceptions: (string * string) list + Examples: (string * string) list + FullName: string + Assembly: string + } + + member this.ToDisplayString() = + let sb = StringBuilder() + + let parameters = + this.Parameters + |> List.map (fun (name, description) -> sprintf "- %s: %s" name description) + |> String.concat "\n" + + sb.AppendLine($"\nDescription:\n%s{this.Summary}") |> ignore + + match this.Remarks with + | Some r -> sb.AppendLine $"\nRemarks:\n%s{r}" |> ignore + | None -> () + + if not (String.IsNullOrWhiteSpace(parameters)) then + sb.AppendLine $"\nParameters:\n%s{parameters}" |> ignore + + match this.Returns with + | Some r -> sb.AppendLine $"Returns:\n%s{r}" |> ignore + | None -> () + + if not this.Exceptions.IsEmpty then + sb.AppendLine "\nExceptions:" |> ignore + + for (exType, exDesc) in this.Exceptions do + sb.AppendLine $"%s{exType}: %s{exDesc}" |> ignore + + if not this.Examples.IsEmpty then + sb.AppendLine "\nExamples:" |> ignore + + for example, desc in this.Examples do + sb.AppendLine example |> ignore + + if not (String.IsNullOrWhiteSpace(desc)) then + sb.AppendLine $"""// {desc.Replace("\n", "\n// ")}""" |> ignore + + sb.AppendLine "" |> ignore + + sb.AppendLine $"Full name: %s{this.FullName}" |> ignore + sb.AppendLine $"Assembly: %s{this.Assembly}\n" |> ignore + + sb.ToString() + + let cleanupXmlContent (s: string) = s.Replace("\n ", "\n").Trim() // some stray whitespace from the XML + + // remove any leading `X:` and trailing `N + let trimDotNet (s: string) = + let s = if s.Length > 2 && s[1] = ':' then s.Substring(2) else s + let idx = s.IndexOf('`') + let s = if idx > 0 then s.Substring(0, idx) else s + s + + let xmlDocCache = Dictionary() + + let getXmlDocument xmlPath = + match xmlDocCache.TryGetValue(xmlPath) with + | true, value -> + let xmlDocument = XmlDocument() + xmlDocument.LoadXml(value) + xmlDocument + | _ -> + let rawXml = File.ReadAllText(xmlPath) + let xmlDocument = XmlDocument() + xmlDocument.LoadXml(rawXml) + xmlDocCache.Add(xmlPath, rawXml) + xmlDocument + + let getTexts (node: Xml.XmlNode) = + seq { + for child in node.ChildNodes do + if child.Name = "#text" then + yield child.Value + + if child.Name = "c" then + yield child.InnerText + + if child.Name = "see" then + let cref = child.Attributes.GetNamedItem("cref") + + if not (isNull cref) then + yield cref.Value |> trimDotNet + } + |> String.concat "" + + let helpText (xmlPath: string) (assembly: string) (modName: string) (implName: string) (sourceName: string) = + let sourceName = sourceName.Replace('.', '#') // for .ctor + let implName = implName.Replace('.', '#') // for .ctor + let xmlName = $"{modName}.{implName}" + let xmlDocument = getXmlDocument xmlPath + + let node = + let toTry = + [ + $"/doc/members/member[contains(@name, ':{xmlName}`')]" + $"/doc/members/member[contains(@name, ':{xmlName}(')]" + $"/doc/members/member[contains(@name, ':{xmlName}')]" + ] + + seq { + for t in toTry do + let node = xmlDocument.SelectSingleNode(t) + if not (isNull node) then Some node else None + } + |> Seq.tryPick id + + match node with + | None -> None + | Some n -> + let summary = + n.SelectSingleNode("summary") + |> Option.ofObj + |> Option.map getTexts + |> Option.map cleanupXmlContent + + let remarks = + n.SelectSingleNode("remarks") + |> Option.ofObj + |> Option.map getTexts + |> Option.map cleanupXmlContent + + let parameters = + n.SelectNodes("param") + |> Seq.cast + |> Seq.map (fun n -> n.Attributes.GetNamedItem("name").Value.Trim(), n.InnerText.Trim()) + |> List.ofSeq + + let returns = + n.SelectSingleNode("returns") + |> Option.ofObj + |> Option.map (fun n -> getTexts(n).Trim()) + + let exceptions = + n.SelectNodes("exception") + |> Seq.cast + |> Seq.map (fun n -> + let exType = n.Attributes.GetNamedItem("cref").Value + let idx = exType.IndexOf(':') + let exType = if idx >= 0 then exType.Substring(idx + 1) else exType + exType.Trim(), n.InnerText.Trim()) + |> List.ofSeq + + let examples = + n.SelectNodes("example") + |> Seq.cast + |> Seq.map (fun n -> + let codeNode = n.SelectSingleNode("code") + + let code = + if isNull codeNode then + "" + else + n.RemoveChild(codeNode) |> ignore + cleanupXmlContent codeNode.InnerText + + code, cleanupXmlContent n.InnerText) + |> List.ofSeq + + match summary with + | Some s -> + { + Summary = s + Remarks = remarks + Parameters = parameters + Returns = returns + Exceptions = exceptions + Examples = examples + FullName = $"{modName}.{sourceName}" // the long ident as users see it + Assembly = assembly + } + |> Some + | None -> None + +module Expr = + + open Microsoft.FSharp.Quotations.Patterns + + let tryGetSourceName (methodInfo: MethodInfo) = + try + let attr = methodInfo.GetCustomAttribute() + Some attr.SourceName + with _ -> + None + + let getInfos (declaringType: Type) (sourceName: string option) (implName: string) = + let xmlPath = Path.ChangeExtension(declaringType.Assembly.Location, ".xml") + let assembly = Path.GetFileName(declaringType.Assembly.Location) + + if File.Exists(xmlPath) then + // for FullName cases like Microsoft.FSharp.Core.FSharpOption`1[System.Object] + let fullName = + let idx = declaringType.FullName.IndexOf('[') + + if idx >= 0 then + declaringType.FullName.Substring(0, idx) + else + declaringType.FullName + + let fullName = fullName.Replace('+', '.') // for FullName cases like Microsoft.FSharp.Collections.ArrayModule+Parallel + + Some(xmlPath, assembly, fullName, implName, sourceName |> Option.defaultValue implName) + else + None + + let rec exprNames expr = + match expr with + | Call(exprOpt, methodInfo, _exprList) -> + match exprOpt with + | Some _ -> None + | None -> + let sourceName = tryGetSourceName methodInfo + getInfos methodInfo.DeclaringType sourceName methodInfo.Name + | Lambda(_param, body) -> exprNames body + | Let(_, _, body) -> exprNames body + | Value(_o, t) -> getInfos t (Some t.Name) t.Name + | DefaultValue t -> getInfos t (Some t.Name) t.Name + | PropertyGet(_o, info, _) -> getInfos info.DeclaringType (Some info.Name) info.Name + | NewUnionCase(info, _exprList) -> getInfos info.DeclaringType (Some info.Name) info.Name + | NewObject(ctorInfo, _e) -> getInfos ctorInfo.DeclaringType (Some ctorInfo.Name) ctorInfo.Name + | NewArray(t, _exprs) -> getInfos t (Some t.Name) t.Name + | NewTuple _ -> + let x = (23, 42) + let t = x.GetType() + getInfos t (Some t.Name) t.Name + | NewStructTuple _ -> + let x = struct (23, 42) + let t = x.GetType() + getInfos t (Some t.Name) t.Name + | _ -> None + +module Logic = + + open Expr + open Parser + + module Quoted = + let tryGetDocumentation expr = + match exprNames expr with + | Some(xmlPath, assembly, modName, implName, sourceName) -> helpText xmlPath assembly modName implName sourceName + | _ -> None + + let h (expr: Quotations.Expr) = + match tryGetDocumentation expr with + | None -> "unable to get documentation" + | Some d -> d.ToDisplayString() diff --git a/src/Compiler/Interactive/fsihelp.fsi b/src/Compiler/Interactive/fsihelp.fsi new file mode 100644 index 00000000000..472211d32e2 --- /dev/null +++ b/src/Compiler/Interactive/fsihelp.fsi @@ -0,0 +1,7 @@ +module FSharp.Compiler.Interactive.FsiHelp + +module Logic = + + module Quoted = + + val h: expr: Quotations.Expr -> string From cea11e91f145f8c7c7b2838759273862d2c3e7fa Mon Sep 17 00:00:00 2001 From: dawe Date: Tue, 14 May 2024 23:51:23 +0200 Subject: [PATCH 08/34] use shims for the filesystem --- src/Compiler/Interactive/fsihelp.fs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Compiler/Interactive/fsihelp.fs b/src/Compiler/Interactive/fsihelp.fs index 34f6fcb4834..22e9d45ff01 100644 --- a/src/Compiler/Interactive/fsihelp.fs +++ b/src/Compiler/Interactive/fsihelp.fs @@ -10,6 +10,7 @@ open System.IO open System.Text open System.Reflection open FSharp.Compiler +open FSharp.Compiler.IO module Parser = @@ -88,7 +89,8 @@ module Parser = xmlDocument.LoadXml(value) xmlDocument | _ -> - let rawXml = File.ReadAllText(xmlPath) + use stream = FileSystem.OpenFileForReadShim(xmlPath) + let rawXml = stream.ReadAllText() let xmlDocument = XmlDocument() xmlDocument.LoadXml(rawXml) xmlDocCache.Add(xmlPath, rawXml) @@ -214,7 +216,7 @@ module Expr = let xmlPath = Path.ChangeExtension(declaringType.Assembly.Location, ".xml") let assembly = Path.GetFileName(declaringType.Assembly.Location) - if File.Exists(xmlPath) then + if FileSystem.FileExistsShim(xmlPath) then // for FullName cases like Microsoft.FSharp.Core.FSharpOption`1[System.Object] let fullName = let idx = declaringType.FullName.IndexOf('[') From 6c38121673c20c49666080f8e72bb22786c7f5f7 Mon Sep 17 00:00:00 2001 From: dawe Date: Wed, 15 May 2024 21:27:33 +0200 Subject: [PATCH 09/34] - Use fsi.h as an user interface. Unfortunately, we lose access to the shimed filesystem by being in the FSharp.Compiler.Interactive.Settings project. --- src/Compiler/FSharp.Compiler.Service.fsproj | 2 -- src/Compiler/Interactive/FSIstrings.txt | 2 +- src/Compiler/Interactive/fsi.fs | 30 +------------------ .../Interactive/xlf/FSIstrings.txt.cs.xlf | 6 ++-- .../Interactive/xlf/FSIstrings.txt.de.xlf | 6 ++-- .../Interactive/xlf/FSIstrings.txt.es.xlf | 6 ++-- .../Interactive/xlf/FSIstrings.txt.fr.xlf | 6 ++-- .../Interactive/xlf/FSIstrings.txt.it.xlf | 6 ++-- .../Interactive/xlf/FSIstrings.txt.ja.xlf | 6 ++-- .../Interactive/xlf/FSIstrings.txt.ko.xlf | 6 ++-- .../Interactive/xlf/FSIstrings.txt.pl.xlf | 6 ++-- .../Interactive/xlf/FSIstrings.txt.pt-BR.xlf | 6 ++-- .../Interactive/xlf/FSIstrings.txt.ru.xlf | 6 ++-- .../Interactive/xlf/FSIstrings.txt.tr.xlf | 6 ++-- .../xlf/FSIstrings.txt.zh-Hans.xlf | 6 ++-- .../xlf/FSIstrings.txt.zh-Hant.xlf | 6 ++-- ...Sharp.Compiler.Interactive.Settings.fsproj | 2 ++ .../fsiaux.fs | 2 ++ .../fsiaux.fsi | 3 ++ .../fsihelp.fs | 7 ++--- .../fsihelp.fsi | 0 21 files changed, 50 insertions(+), 76 deletions(-) rename src/{Compiler/Interactive => FSharp.Compiler.Interactive.Settings}/fsihelp.fs (97%) rename src/{Compiler/Interactive => FSharp.Compiler.Interactive.Settings}/fsihelp.fsi (100%) diff --git a/src/Compiler/FSharp.Compiler.Service.fsproj b/src/Compiler/FSharp.Compiler.Service.fsproj index 251ff28ad23..63428be3f11 100644 --- a/src/Compiler/FSharp.Compiler.Service.fsproj +++ b/src/Compiler/FSharp.Compiler.Service.fsproj @@ -523,8 +523,6 @@ - - diff --git a/src/Compiler/Interactive/FSIstrings.txt b/src/Compiler/Interactive/FSIstrings.txt index 8f4f71c6465..afdb8069063 100644 --- a/src/Compiler/Interactive/FSIstrings.txt +++ b/src/Compiler/Interactive/FSIstrings.txt @@ -32,7 +32,7 @@ fsiIntroPackageSourceUriInfo,"Include package source uri when searching for pack fsiIntroTextHashloadInfo,"Load the given file(s) as if compiled and referenced" fsiIntroTextHashtimeInfo,"Toggle timing on/off" fsiIntroTextHashhelpInfo,"Display help" -fsiIntroTextHashhInfo,"Display documentation for an expression, e.g. #h \"List.map\";;" +fsiIntroTextfsihelpInfo,"Display documentation for an expression, e.g. fsi.h List.map;;" fsiIntroTextHashquitInfo,"Exit" fsiIntroTextHashclearInfo,"Clear screen" fsiIntroTextHeader2commandLine," F# Interactive command line options:" diff --git a/src/Compiler/Interactive/fsi.fs b/src/Compiler/Interactive/fsi.fs index 9d333ee4eef..5fa7b493aaf 100644 --- a/src/Compiler/Interactive/fsi.fs +++ b/src/Compiler/Interactive/fsi.fs @@ -1239,7 +1239,6 @@ type internal FsiCommandLineOptions(fsi: FsiEvaluationSessionHostConfig, argv: s fsiConsoleOutput.uprintfn """ #load "file.fs" ...;; // %s""" (FSIstrings.SR.fsiIntroTextHashloadInfo ()) fsiConsoleOutput.uprintfn """ #time ["on"|"off"];; // %s""" (FSIstrings.SR.fsiIntroTextHashtimeInfo ()) fsiConsoleOutput.uprintfn """ #help;; // %s""" (FSIstrings.SR.fsiIntroTextHashhelpInfo ()) - fsiConsoleOutput.uprintfn """ #h "expr";; // %s""" (FSIstrings.SR.fsiIntroTextHashhInfo ()) if tcConfigB.langVersion.SupportsFeature(LanguageFeature.PackageManagement) then for msg in @@ -1252,6 +1251,7 @@ type internal FsiCommandLineOptions(fsi: FsiEvaluationSessionHostConfig, argv: s fsiConsoleOutput.uprintfn """ #clear;; // %s""" (FSIstrings.SR.fsiIntroTextHashclearInfo ()) fsiConsoleOutput.uprintfn """ #quit;; // %s""" (FSIstrings.SR.fsiIntroTextHashquitInfo ()) + fsiConsoleOutput.uprintfn """ fsi.h expr;; // %s""" (FSIstrings.SR.fsiIntroTextfsihelpInfo ()) fsiConsoleOutput.uprintfn "" fsiConsoleOutput.uprintfnn "%s" (FSIstrings.SR.fsiIntroTextHeader2commandLine ()) fsiConsoleOutput.uprintfn "%s" (FSIstrings.SR.fsiIntroTextHeader3 (helpLine)) @@ -3725,37 +3725,9 @@ type FsiInteractionProcessor stopProcessingRecovery e range0 None - let runhDirective diagnosticsLogger ctok istate source = - let lexbuf = - UnicodeLexing.StringAsLexbuf(true, tcConfigB.langVersion, tcConfigB.strictIndentation, $"<@@ {source} @@>") - - let tokenizer = - fsiStdinLexerProvider.CreateBufferLexer("hdummy.fsx", lexbuf, diagnosticsLogger) - - let parsedInteraction = ParseInteraction tokenizer - - match parsedInteraction with - | Some(ParsedScriptInteraction.Definitions([ SynModuleDecl.Expr(e, _) ], _)) -> - - let _state, status = - fsiDynamicCompiler.EvalParsedExpression(ctok, diagnosticsLogger, istate, e, true) - - match status with - | Completed(Some compStatus) -> - match compStatus.ReflectionValue with - | :? FSharp.Quotations.Expr as qex -> - let s = FsiHelp.Logic.Quoted.h qex - fsiConsoleOutput.uprintf "%s" s - | _ -> () - | _ -> () - | _ -> () - /// Partially process a hash directive, leaving state in packageManagerLines and required assemblies let PartiallyProcessHashDirective (ctok, istate, hash, diagnosticsLogger: DiagnosticsLogger) = match hash with - | ParsedHashDirective("h", ParsedHashDirectiveArguments [ source ], _m) -> - runhDirective diagnosticsLogger ctok istate source - istate, Completed None | ParsedHashDirective("load", ParsedHashDirectiveArguments sourceFiles, m) -> let istate = fsiDynamicCompiler.EvalSourceFiles(ctok, istate, m, sourceFiles, lexResourceManager, diagnosticsLogger) diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.cs.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.cs.xlf index d121c808b5d..47b15daa314 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.cs.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.cs.xlf @@ -17,9 +17,9 @@ Vymazat obrazovku - - Display documentation for an expression, e.g. #h \"List.map\";; - Display documentation for an expression, e.g. #h \"List.map\";; + + Display documentation for an expression, e.g. fsi.h List.map;; + Display documentation for an expression, e.g. fsi.h List.map;; diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.de.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.de.xlf index 7ec35d5a512..375f3d5fed4 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.de.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.de.xlf @@ -17,9 +17,9 @@ Bildschirm löschen - - Display documentation for an expression, e.g. #h \"List.map\";; - Display documentation for an expression, e.g. #h \"List.map\";; + + Display documentation for an expression, e.g. fsi.h List.map;; + Display documentation for an expression, e.g. fsi.h List.map;; diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.es.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.es.xlf index 31aeaa9faa7..37fd9922993 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.es.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.es.xlf @@ -17,9 +17,9 @@ Borrar pantalla - - Display documentation for an expression, e.g. #h \"List.map\";; - Display documentation for an expression, e.g. #h \"List.map\";; + + Display documentation for an expression, e.g. fsi.h List.map;; + Display documentation for an expression, e.g. fsi.h List.map;; diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.fr.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.fr.xlf index 0958e45c297..d44d26e6836 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.fr.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.fr.xlf @@ -17,9 +17,9 @@ Effacer l'écran - - Display documentation for an expression, e.g. #h \"List.map\";; - Display documentation for an expression, e.g. #h \"List.map\";; + + Display documentation for an expression, e.g. fsi.h List.map;; + Display documentation for an expression, e.g. fsi.h List.map;; diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.it.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.it.xlf index ae0691b08fe..b9aa1088952 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.it.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.it.xlf @@ -17,9 +17,9 @@ Cancella schermata - - Display documentation for an expression, e.g. #h \"List.map\";; - Display documentation for an expression, e.g. #h \"List.map\";; + + Display documentation for an expression, e.g. fsi.h List.map;; + Display documentation for an expression, e.g. fsi.h List.map;; diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.ja.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.ja.xlf index 66bdd5e8aac..d45f91d6990 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.ja.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.ja.xlf @@ -17,9 +17,9 @@ 画面をクリアする - - Display documentation for an expression, e.g. #h \"List.map\";; - Display documentation for an expression, e.g. #h \"List.map\";; + + Display documentation for an expression, e.g. fsi.h List.map;; + Display documentation for an expression, e.g. fsi.h List.map;; diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.ko.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.ko.xlf index 703818f32a6..9068bc8c91e 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.ko.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.ko.xlf @@ -17,9 +17,9 @@ 화면 지우기 - - Display documentation for an expression, e.g. #h \"List.map\";; - Display documentation for an expression, e.g. #h \"List.map\";; + + Display documentation for an expression, e.g. fsi.h List.map;; + Display documentation for an expression, e.g. fsi.h List.map;; diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.pl.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.pl.xlf index 7b27c91d068..93550e034b0 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.pl.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.pl.xlf @@ -17,9 +17,9 @@ Wyczyść ekran - - Display documentation for an expression, e.g. #h \"List.map\";; - Display documentation for an expression, e.g. #h \"List.map\";; + + Display documentation for an expression, e.g. fsi.h List.map;; + Display documentation for an expression, e.g. fsi.h List.map;; diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.pt-BR.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.pt-BR.xlf index 713a8b5b33b..8051674e0e7 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.pt-BR.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.pt-BR.xlf @@ -17,9 +17,9 @@ Limpar tela - - Display documentation for an expression, e.g. #h \"List.map\";; - Display documentation for an expression, e.g. #h \"List.map\";; + + Display documentation for an expression, e.g. fsi.h List.map;; + Display documentation for an expression, e.g. fsi.h List.map;; diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.ru.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.ru.xlf index 942ea81bbb8..c646ff6ef46 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.ru.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.ru.xlf @@ -17,9 +17,9 @@ Очистить экран - - Display documentation for an expression, e.g. #h \"List.map\";; - Display documentation for an expression, e.g. #h \"List.map\";; + + Display documentation for an expression, e.g. fsi.h List.map;; + Display documentation for an expression, e.g. fsi.h List.map;; diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.tr.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.tr.xlf index 9449856167a..7f740208bbb 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.tr.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.tr.xlf @@ -17,9 +17,9 @@ Ekranı temizle - - Display documentation for an expression, e.g. #h \"List.map\";; - Display documentation for an expression, e.g. #h \"List.map\";; + + Display documentation for an expression, e.g. fsi.h List.map;; + Display documentation for an expression, e.g. fsi.h List.map;; diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hans.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hans.xlf index 9fd2b340994..29570f6ef0d 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hans.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hans.xlf @@ -17,9 +17,9 @@ 清除屏幕 - - Display documentation for an expression, e.g. #h \"List.map\";; - Display documentation for an expression, e.g. #h \"List.map\";; + + Display documentation for an expression, e.g. fsi.h List.map;; + Display documentation for an expression, e.g. fsi.h List.map;; diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hant.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hant.xlf index 37fab090895..a3968453584 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hant.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hant.xlf @@ -17,9 +17,9 @@ 清空螢幕 - - Display documentation for an expression, e.g. #h \"List.map\";; - Display documentation for an expression, e.g. #h \"List.map\";; + + Display documentation for an expression, e.g. fsi.h List.map;; + Display documentation for an expression, e.g. fsi.h List.map;; diff --git a/src/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj b/src/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj index 85814ac6e5f..14759a7aa07 100644 --- a/src/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj +++ b/src/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj @@ -32,6 +32,8 @@ + + diff --git a/src/FSharp.Compiler.Interactive.Settings/fsiaux.fs b/src/FSharp.Compiler.Interactive.Settings/fsiaux.fs index 89362feb114..ae16155bc76 100644 --- a/src/FSharp.Compiler.Interactive.Settings/fsiaux.fs +++ b/src/FSharp.Compiler.Interactive.Settings/fsiaux.fs @@ -162,6 +162,8 @@ type InteractiveSession() = member _.AddPrintTransformer(printer: 'T -> obj) = addedPrinters <- Choice2Of2(typeof<'T>, (fun (x: obj) -> printer (unbox x))) :: addedPrinters + member _.h([] expr: Quotations.Expr<_>) = FsiHelp.Logic.Quoted.h expr + member internal self.SetEventLoop(run: (unit -> bool), invoke: ((unit -> obj) -> obj), restart: (unit -> unit)) = evLoop.ScheduleRestart() diff --git a/src/FSharp.Compiler.Interactive.Settings/fsiaux.fsi b/src/FSharp.Compiler.Interactive.Settings/fsiaux.fsi index 38373efb9bc..743adf07001 100644 --- a/src/FSharp.Compiler.Interactive.Settings/fsiaux.fsi +++ b/src/FSharp.Compiler.Interactive.Settings/fsiaux.fsi @@ -68,6 +68,9 @@ type InteractiveSession = /// Gets or sets a the current event loop being used to process interactions. member EventLoop: IEventLoop with get, set + /// Get the documentation for an expression. + member h: [] expr: Quotations.Expr<_> -> string + /// Sets the current event loop being used to process interactions. member internal SetEventLoop: (unit -> bool) * ((unit -> obj) -> obj) * (unit -> unit) -> unit diff --git a/src/Compiler/Interactive/fsihelp.fs b/src/FSharp.Compiler.Interactive.Settings/fsihelp.fs similarity index 97% rename from src/Compiler/Interactive/fsihelp.fs rename to src/FSharp.Compiler.Interactive.Settings/fsihelp.fs index 22e9d45ff01..974cd19bd9e 100644 --- a/src/Compiler/Interactive/fsihelp.fs +++ b/src/FSharp.Compiler.Interactive.Settings/fsihelp.fs @@ -9,8 +9,6 @@ open System.Collections.Generic open System.IO open System.Text open System.Reflection -open FSharp.Compiler -open FSharp.Compiler.IO module Parser = @@ -89,8 +87,7 @@ module Parser = xmlDocument.LoadXml(value) xmlDocument | _ -> - use stream = FileSystem.OpenFileForReadShim(xmlPath) - let rawXml = stream.ReadAllText() + let rawXml = System.IO.File.ReadAllText(xmlPath) let xmlDocument = XmlDocument() xmlDocument.LoadXml(rawXml) xmlDocCache.Add(xmlPath, rawXml) @@ -216,7 +213,7 @@ module Expr = let xmlPath = Path.ChangeExtension(declaringType.Assembly.Location, ".xml") let assembly = Path.GetFileName(declaringType.Assembly.Location) - if FileSystem.FileExistsShim(xmlPath) then + if System.IO.File.Exists(xmlPath) then // for FullName cases like Microsoft.FSharp.Core.FSharpOption`1[System.Object] let fullName = let idx = declaringType.FullName.IndexOf('[') diff --git a/src/Compiler/Interactive/fsihelp.fsi b/src/FSharp.Compiler.Interactive.Settings/fsihelp.fsi similarity index 100% rename from src/Compiler/Interactive/fsihelp.fsi rename to src/FSharp.Compiler.Interactive.Settings/fsihelp.fsi From fdbedae210e6396617aefc68ee2298bc64b3e91e Mon Sep 17 00:00:00 2001 From: dawe Date: Wed, 15 May 2024 22:29:01 +0200 Subject: [PATCH 10/34] use a fsi printer for nicer output --- .../fsiaux.fs | 8 +++++++- .../fsiaux.fsi | 2 +- .../fsihelp.fs | 9 ++------- .../fsihelp.fsi | 16 +++++++++++++++- 4 files changed, 25 insertions(+), 10 deletions(-) diff --git a/src/FSharp.Compiler.Interactive.Settings/fsiaux.fs b/src/FSharp.Compiler.Interactive.Settings/fsiaux.fs index ae16155bc76..3c6fbf4045f 100644 --- a/src/FSharp.Compiler.Interactive.Settings/fsiaux.fs +++ b/src/FSharp.Compiler.Interactive.Settings/fsiaux.fs @@ -162,7 +162,8 @@ type InteractiveSession() = member _.AddPrintTransformer(printer: 'T -> obj) = addedPrinters <- Choice2Of2(typeof<'T>, (fun (x: obj) -> printer (unbox x))) :: addedPrinters - member _.h([] expr: Quotations.Expr<_>) = FsiHelp.Logic.Quoted.h expr + member _.h([] expr: Quotations.Expr<_>) = + FsiHelp.Logic.Quoted.tryGetDocumentation expr member internal self.SetEventLoop(run: (unit -> bool), invoke: ((unit -> obj) -> obj), restart: (unit -> unit)) = evLoop.ScheduleRestart() @@ -180,6 +181,11 @@ type InteractiveSession() = module Settings = let fsi = new InteractiveSession() + fsi.AddPrinter(fun help -> + match help with + | None -> "No help available" + | Some help -> help.ToDisplayString()) + [] do () diff --git a/src/FSharp.Compiler.Interactive.Settings/fsiaux.fsi b/src/FSharp.Compiler.Interactive.Settings/fsiaux.fsi index 743adf07001..0062b16278a 100644 --- a/src/FSharp.Compiler.Interactive.Settings/fsiaux.fsi +++ b/src/FSharp.Compiler.Interactive.Settings/fsiaux.fsi @@ -69,7 +69,7 @@ type InteractiveSession = member EventLoop: IEventLoop with get, set /// Get the documentation for an expression. - member h: [] expr: Quotations.Expr<_> -> string + member h: [] expr: Quotations.Expr<_> -> FsiHelp.Parser.Help option /// Sets the current event loop being used to process interactions. member internal SetEventLoop: (unit -> bool) * ((unit -> obj) -> obj) * (unit -> unit) -> unit diff --git a/src/FSharp.Compiler.Interactive.Settings/fsihelp.fs b/src/FSharp.Compiler.Interactive.Settings/fsihelp.fs index 974cd19bd9e..e2263144447 100644 --- a/src/FSharp.Compiler.Interactive.Settings/fsihelp.fs +++ b/src/FSharp.Compiler.Interactive.Settings/fsihelp.fs @@ -65,7 +65,7 @@ module Parser = sb.AppendLine "" |> ignore sb.AppendLine $"Full name: %s{this.FullName}" |> ignore - sb.AppendLine $"Assembly: %s{this.Assembly}\n" |> ignore + sb.AppendLine $"Assembly: %s{this.Assembly}" |> ignore sb.ToString() @@ -261,12 +261,7 @@ module Logic = open Parser module Quoted = - let tryGetDocumentation expr = + let tryGetDocumentation (expr: Quotations.Expr) = match exprNames expr with | Some(xmlPath, assembly, modName, implName, sourceName) -> helpText xmlPath assembly modName implName sourceName | _ -> None - - let h (expr: Quotations.Expr) = - match tryGetDocumentation expr with - | None -> "unable to get documentation" - | Some d -> d.ToDisplayString() diff --git a/src/FSharp.Compiler.Interactive.Settings/fsihelp.fsi b/src/FSharp.Compiler.Interactive.Settings/fsihelp.fsi index 472211d32e2..0110520536e 100644 --- a/src/FSharp.Compiler.Interactive.Settings/fsihelp.fsi +++ b/src/FSharp.Compiler.Interactive.Settings/fsihelp.fsi @@ -1,7 +1,21 @@ module FSharp.Compiler.Interactive.FsiHelp +module Parser = + + type Help = + { Summary: string + Remarks: string option + Parameters: (string * string) list + Returns: string option + Exceptions: (string * string) list + Examples: (string * string) list + FullName: string + Assembly: string } + + member ToDisplayString: unit -> string + module Logic = module Quoted = - val h: expr: Quotations.Expr -> string + val tryGetDocumentation: expr: Quotations.Expr -> Parser.Help option From a7a2d4ae2f88b62b7d2de778c605c299de158f30 Mon Sep 17 00:00:00 2001 From: dawe Date: Wed, 15 May 2024 22:38:27 +0200 Subject: [PATCH 11/34] update baselines --- .../DependencyManagerInteractiveTests.fs | 4 ++-- tests/fsharp/core/printing/output.1000.stdout.bsl | 2 +- tests/fsharp/core/printing/output.200.stdout.bsl | 2 +- tests/fsharp/core/printing/output.47.stdout.bsl | 2 +- tests/fsharp/core/printing/output.multiemit.stdout.bsl | 2 +- tests/fsharp/core/printing/output.off.stdout.bsl | 2 +- tests/fsharp/core/printing/output.stdout.bsl | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/FSharp.Compiler.Private.Scripting.UnitTests/DependencyManagerInteractiveTests.fs b/tests/FSharp.Compiler.Private.Scripting.UnitTests/DependencyManagerInteractiveTests.fs index 52f9d416b3b..882e2fa95bd 100644 --- a/tests/FSharp.Compiler.Private.Scripting.UnitTests/DependencyManagerInteractiveTests.fs +++ b/tests/FSharp.Compiler.Private.Scripting.UnitTests/DependencyManagerInteractiveTests.fs @@ -719,8 +719,8 @@ x |> Seq.iter(fun r -> """ #time ["on"|"off"];; // Toggle timing on/off""" """ #clear;; // Clear screen""" """ #help;; // Display help""" - """ #h "expr";; // Display documentation for an expression, e.g. #h "List.map";;""" """ #quit;; // Exit""" + """ fsi.h expr;; // Display documentation for an expression, e.g. fsi.h List.map;;""" """""" """ F# Interactive command line options:""" """""" @@ -767,11 +767,11 @@ x |> Seq.iter(fun r -> """ #load "file.fs" ...;; // Load the given file(s) as if compiled and referenced""" """ #time ["on"|"off"];; // Toggle timing on/off""" """ #help;; // Display help""" - """ #h "expr";; // Display documentation for an expression, e.g. #h "List.map";;""" """ #r "nuget:FSharp.Data, 3.1.2";; // Load Nuget Package 'FSharp.Data' version '3.1.2'""" """ #r "nuget:FSharp.Data";; // Load Nuget Package 'FSharp.Data' with the highest version""" """ #clear;; // Clear screen""" """ #quit;; // Exit""" + """ fsi.h expr;; // Display documentation for an expression, e.g. fsi.h List.map;;""" """""" """ F# Interactive command line options:""" """""" diff --git a/tests/fsharp/core/printing/output.1000.stdout.bsl b/tests/fsharp/core/printing/output.1000.stdout.bsl index d8a4b78cebb..23843f5c1a7 100644 --- a/tests/fsharp/core/printing/output.1000.stdout.bsl +++ b/tests/fsharp/core/printing/output.1000.stdout.bsl @@ -1101,11 +1101,11 @@ type 'a T4063 = | AT4063 of 'a #load "file.fs" ...;; // Load the given file(s) as if compiled and referenced #time ["on"|"off"];; // Toggle timing on/off #help;; // Display help - #h "expr";; // Display documentation for an expression, e.g. #h "List.map";; #r "nuget:FSharp.Data, 3.1.2";; // Load Nuget Package 'FSharp.Data' version '3.1.2' #r "nuget:FSharp.Data";; // Load Nuget Package 'FSharp.Data' with the highest version #clear;; // Clear screen #quit;; // Exit + fsi.h expr;; // Display documentation for an expression, e.g. fsi.h List.map;; F# Interactive command line options: diff --git a/tests/fsharp/core/printing/output.200.stdout.bsl b/tests/fsharp/core/printing/output.200.stdout.bsl index 374de93a0f9..ff413860294 100644 --- a/tests/fsharp/core/printing/output.200.stdout.bsl +++ b/tests/fsharp/core/printing/output.200.stdout.bsl @@ -421,11 +421,11 @@ type 'a T4063 = | AT4063 of 'a #load "file.fs" ...;; // Load the given file(s) as if compiled and referenced #time ["on"|"off"];; // Toggle timing on/off #help;; // Display help - #h "expr";; // Display documentation for an expression, e.g. #h "List.map";; #r "nuget:FSharp.Data, 3.1.2";; // Load Nuget Package 'FSharp.Data' version '3.1.2' #r "nuget:FSharp.Data";; // Load Nuget Package 'FSharp.Data' with the highest version #clear;; // Clear screen #quit;; // Exit + fsi.h expr;; // Display documentation for an expression, e.g. fsi.h List.map;; F# Interactive command line options: diff --git a/tests/fsharp/core/printing/output.47.stdout.bsl b/tests/fsharp/core/printing/output.47.stdout.bsl index 8e36691241f..ca02563726e 100644 --- a/tests/fsharp/core/printing/output.47.stdout.bsl +++ b/tests/fsharp/core/printing/output.47.stdout.bsl @@ -4060,9 +4060,9 @@ type 'a T4063 = | AT4063 of 'a #load "file.fs" ...;; // Load the given file(s) as if compiled and referenced #time ["on"|"off"];; // Toggle timing on/off #help;; // Display help - #h "expr";; // Display documentation for an expression, e.g. #h "List.map";; #clear;; // Clear screen #quit;; // Exit + fsi.h expr;; // Display documentation for an expression, e.g. fsi.h List.map;; F# Interactive command line options: diff --git a/tests/fsharp/core/printing/output.multiemit.stdout.bsl b/tests/fsharp/core/printing/output.multiemit.stdout.bsl index e0ff084cecc..1b29cb8345f 100644 --- a/tests/fsharp/core/printing/output.multiemit.stdout.bsl +++ b/tests/fsharp/core/printing/output.multiemit.stdout.bsl @@ -4060,11 +4060,11 @@ type 'a T4063 = | AT4063 of 'a #load "file.fs" ...;; // Load the given file(s) as if compiled and referenced #time ["on"|"off"];; // Toggle timing on/off #help;; // Display help - #h "expr";; // Display documentation for an expression, e.g. #h "List.map";; #r "nuget:FSharp.Data, 3.1.2";; // Load Nuget Package 'FSharp.Data' version '3.1.2' #r "nuget:FSharp.Data";; // Load Nuget Package 'FSharp.Data' with the highest version #clear;; // Clear screen #quit;; // Exit + fsi.h expr;; // Display documentation for an expression, e.g. fsi.h List.map;; F# Interactive command line options: diff --git a/tests/fsharp/core/printing/output.off.stdout.bsl b/tests/fsharp/core/printing/output.off.stdout.bsl index ce4327c994f..9dbfc94f3bb 100644 --- a/tests/fsharp/core/printing/output.off.stdout.bsl +++ b/tests/fsharp/core/printing/output.off.stdout.bsl @@ -248,11 +248,11 @@ type 'a T4063 = | AT4063 of 'a #load "file.fs" ...;; // Load the given file(s) as if compiled and referenced #time ["on"|"off"];; // Toggle timing on/off #help;; // Display help - #h "expr";; // Display documentation for an expression, e.g. #h "List.map";; #r "nuget:FSharp.Data, 3.1.2";; // Load Nuget Package 'FSharp.Data' version '3.1.2' #r "nuget:FSharp.Data";; // Load Nuget Package 'FSharp.Data' with the highest version #clear;; // Clear screen #quit;; // Exit + fsi.h expr;; // Display documentation for an expression, e.g. fsi.h List.map;; F# Interactive command line options: diff --git a/tests/fsharp/core/printing/output.stdout.bsl b/tests/fsharp/core/printing/output.stdout.bsl index e0ff084cecc..1b29cb8345f 100644 --- a/tests/fsharp/core/printing/output.stdout.bsl +++ b/tests/fsharp/core/printing/output.stdout.bsl @@ -4060,11 +4060,11 @@ type 'a T4063 = | AT4063 of 'a #load "file.fs" ...;; // Load the given file(s) as if compiled and referenced #time ["on"|"off"];; // Toggle timing on/off #help;; // Display help - #h "expr";; // Display documentation for an expression, e.g. #h "List.map";; #r "nuget:FSharp.Data, 3.1.2";; // Load Nuget Package 'FSharp.Data' version '3.1.2' #r "nuget:FSharp.Data";; // Load Nuget Package 'FSharp.Data' with the highest version #clear;; // Clear screen #quit;; // Exit + fsi.h expr;; // Display documentation for an expression, e.g. fsi.h List.map;; F# Interactive command line options: From c0e6bcd4aad366d5675da30b01f2ceaad2dec8c4 Mon Sep 17 00:00:00 2001 From: dawe Date: Wed, 15 May 2024 23:34:48 +0200 Subject: [PATCH 12/34] remove suppressItPrint parameter --- src/Compiler/Interactive/fsi.fs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Compiler/Interactive/fsi.fs b/src/Compiler/Interactive/fsi.fs index 5fa7b493aaf..b837df7365c 100644 --- a/src/Compiler/Interactive/fsi.fs +++ b/src/Compiler/Interactive/fsi.fs @@ -2500,7 +2500,7 @@ type internal FsiDynamicCompiler processContents newState declaredImpls /// Evaluate the given expression and produce a new interactive state. - member fsiDynamicCompiler.EvalParsedExpression(ctok, diagnosticsLogger: DiagnosticsLogger, istate, expr: SynExpr, suppressItPrint) = + member fsiDynamicCompiler.EvalParsedExpression(ctok, diagnosticsLogger: DiagnosticsLogger, istate, expr: SynExpr) = let tcConfig = TcConfig.Create(tcConfigB, validate = false) let itName = "it" @@ -2514,7 +2514,7 @@ type internal FsiDynamicCompiler // Snarf the type for 'it' via the binding match istate.tcState.TcEnvFromImpls.NameEnv.FindUnqualifiedItem itName with | Item.Value vref -> - if not tcConfig.noFeedback && not suppressItPrint then + if not tcConfig.noFeedback then let infoReader = InfoReader(istate.tcGlobals, istate.tcImports.GetImportMap()) valuePrinter.InvokeExprPrinter( @@ -3867,7 +3867,7 @@ type FsiInteractionProcessor | InteractionGroup.HashDirectives [] -> istate, Completed None | InteractionGroup.Definitions([ SynModuleDecl.Expr(expr, _) ], _) -> - fsiDynamicCompiler.EvalParsedExpression(ctok, diagnosticsLogger, istate, expr, false) + fsiDynamicCompiler.EvalParsedExpression(ctok, diagnosticsLogger, istate, expr) | InteractionGroup.Definitions(defs, _) -> fsiDynamicCompiler.EvalParsedDefinitions(ctok, diagnosticsLogger, istate, true, false, defs) @@ -4061,7 +4061,7 @@ type FsiInteractionProcessor |> InteractiveCatch diagnosticsLogger (fun istate -> istate |> mainThreadProcessAction ctok (fun ctok istate -> - fsiDynamicCompiler.EvalParsedExpression(ctok, diagnosticsLogger, istate, expr, false))) + fsiDynamicCompiler.EvalParsedExpression(ctok, diagnosticsLogger, istate, expr))) let commitResult (istate, result) = match result with From c063b8961af13498bd059d5a0bc0163051745a16 Mon Sep 17 00:00:00 2001 From: dawe Date: Thu, 16 May 2024 01:04:31 +0200 Subject: [PATCH 13/34] Update src/FSharp.Compiler.Interactive.Settings/fsihelp.fs Co-authored-by: Brian Rourke Boll --- src/FSharp.Compiler.Interactive.Settings/fsihelp.fs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/FSharp.Compiler.Interactive.Settings/fsihelp.fs b/src/FSharp.Compiler.Interactive.Settings/fsihelp.fs index e2263144447..1d44adbeec0 100644 --- a/src/FSharp.Compiler.Interactive.Settings/fsihelp.fs +++ b/src/FSharp.Compiler.Interactive.Settings/fsihelp.fs @@ -246,13 +246,11 @@ module Expr = | NewObject(ctorInfo, _e) -> getInfos ctorInfo.DeclaringType (Some ctorInfo.Name) ctorInfo.Name | NewArray(t, _exprs) -> getInfos t (Some t.Name) t.Name | NewTuple _ -> - let x = (23, 42) - let t = x.GetType() - getInfos t (Some t.Name) t.Name + let ty = typeof<_ * _> + getInfos ty (Some ty.Name) ty.Name | NewStructTuple _ -> - let x = struct (23, 42) - let t = x.GetType() - getInfos t (Some t.Name) t.Name + let ty = typeof + getInfos ty (Some ty.Name) ty.Name | _ -> None module Logic = From db6a446fdf502419bb85177552145f6a20b59685 Mon Sep 17 00:00:00 2001 From: dawe Date: Thu, 16 May 2024 01:04:57 +0200 Subject: [PATCH 14/34] Update src/FSharp.Compiler.Interactive.Settings/fsihelp.fs Co-authored-by: Brian Rourke Boll --- src/FSharp.Compiler.Interactive.Settings/fsihelp.fs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/FSharp.Compiler.Interactive.Settings/fsihelp.fs b/src/FSharp.Compiler.Interactive.Settings/fsihelp.fs index 1d44adbeec0..1de065c4726 100644 --- a/src/FSharp.Compiler.Interactive.Settings/fsihelp.fs +++ b/src/FSharp.Compiler.Interactive.Settings/fsihelp.fs @@ -34,7 +34,10 @@ module Parser = |> List.map (fun (name, description) -> sprintf "- %s: %s" name description) |> String.concat "\n" - sb.AppendLine($"\nDescription:\n%s{this.Summary}") |> ignore + sb.AppendLine() + .AppendLine("Description:") + .AppendLine(this.Summary) + |> ignore match this.Remarks with | Some r -> sb.AppendLine $"\nRemarks:\n%s{r}" |> ignore From c8994eb55c5646a61cda2c24f5366e29688c6f52 Mon Sep 17 00:00:00 2001 From: dawe Date: Thu, 16 May 2024 01:12:00 +0200 Subject: [PATCH 15/34] use voption to let the printer work in the (v)none case --- src/FSharp.Compiler.Interactive.Settings/fsiaux.fs | 6 +++--- src/FSharp.Compiler.Interactive.Settings/fsiaux.fsi | 2 +- src/FSharp.Compiler.Interactive.Settings/fsihelp.fs | 8 ++++---- src/FSharp.Compiler.Interactive.Settings/fsihelp.fsi | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/FSharp.Compiler.Interactive.Settings/fsiaux.fs b/src/FSharp.Compiler.Interactive.Settings/fsiaux.fs index 3c6fbf4045f..8d016a0246e 100644 --- a/src/FSharp.Compiler.Interactive.Settings/fsiaux.fs +++ b/src/FSharp.Compiler.Interactive.Settings/fsiaux.fs @@ -181,10 +181,10 @@ type InteractiveSession() = module Settings = let fsi = new InteractiveSession() - fsi.AddPrinter(fun help -> + fsi.AddPrinter(fun help -> match help with - | None -> "No help available" - | Some help -> help.ToDisplayString()) + | ValueNone -> "No help available" + | ValueSome help -> help.ToDisplayString()) [] do () diff --git a/src/FSharp.Compiler.Interactive.Settings/fsiaux.fsi b/src/FSharp.Compiler.Interactive.Settings/fsiaux.fsi index 0062b16278a..3a29ad87fe5 100644 --- a/src/FSharp.Compiler.Interactive.Settings/fsiaux.fsi +++ b/src/FSharp.Compiler.Interactive.Settings/fsiaux.fsi @@ -69,7 +69,7 @@ type InteractiveSession = member EventLoop: IEventLoop with get, set /// Get the documentation for an expression. - member h: [] expr: Quotations.Expr<_> -> FsiHelp.Parser.Help option + member h: [] expr: Quotations.Expr<_> -> FsiHelp.Parser.Help voption /// Sets the current event loop being used to process interactions. member internal SetEventLoop: (unit -> bool) * ((unit -> obj) -> obj) * (unit -> unit) -> unit diff --git a/src/FSharp.Compiler.Interactive.Settings/fsihelp.fs b/src/FSharp.Compiler.Interactive.Settings/fsihelp.fs index 1de065c4726..7ddd0c4e396 100644 --- a/src/FSharp.Compiler.Interactive.Settings/fsihelp.fs +++ b/src/FSharp.Compiler.Interactive.Settings/fsihelp.fs @@ -135,7 +135,7 @@ module Parser = |> Seq.tryPick id match node with - | None -> None + | None -> ValueNone | Some n -> let summary = n.SelectSingleNode("summary") @@ -198,8 +198,8 @@ module Parser = FullName = $"{modName}.{sourceName}" // the long ident as users see it Assembly = assembly } - |> Some - | None -> None + |> ValueSome + | None -> ValueNone module Expr = @@ -265,4 +265,4 @@ module Logic = let tryGetDocumentation (expr: Quotations.Expr) = match exprNames expr with | Some(xmlPath, assembly, modName, implName, sourceName) -> helpText xmlPath assembly modName implName sourceName - | _ -> None + | _ -> ValueNone diff --git a/src/FSharp.Compiler.Interactive.Settings/fsihelp.fsi b/src/FSharp.Compiler.Interactive.Settings/fsihelp.fsi index 0110520536e..e04b2cd3809 100644 --- a/src/FSharp.Compiler.Interactive.Settings/fsihelp.fsi +++ b/src/FSharp.Compiler.Interactive.Settings/fsihelp.fsi @@ -18,4 +18,4 @@ module Logic = module Quoted = - val tryGetDocumentation: expr: Quotations.Expr -> Parser.Help option + val tryGetDocumentation: expr: Quotations.Expr -> Parser.Help voption From 9f7203f18c2fd02db9060af45eef6ee6b5724810 Mon Sep 17 00:00:00 2001 From: dawe Date: Thu, 16 May 2024 01:12:40 +0200 Subject: [PATCH 16/34] format --- src/FSharp.Compiler.Interactive.Settings/fsihelp.fs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/FSharp.Compiler.Interactive.Settings/fsihelp.fs b/src/FSharp.Compiler.Interactive.Settings/fsihelp.fs index 7ddd0c4e396..34e634e2384 100644 --- a/src/FSharp.Compiler.Interactive.Settings/fsihelp.fs +++ b/src/FSharp.Compiler.Interactive.Settings/fsihelp.fs @@ -34,10 +34,7 @@ module Parser = |> List.map (fun (name, description) -> sprintf "- %s: %s" name description) |> String.concat "\n" - sb.AppendLine() - .AppendLine("Description:") - .AppendLine(this.Summary) - |> ignore + sb.AppendLine().AppendLine("Description:").AppendLine(this.Summary) |> ignore match this.Remarks with | Some r -> sb.AppendLine $"\nRemarks:\n%s{r}" |> ignore From d605fd8ad52fb5277cee0c378e10f3101e8d1273 Mon Sep 17 00:00:00 2001 From: dawe Date: Thu, 16 May 2024 18:38:06 +0200 Subject: [PATCH 17/34] remove doubled assembly attributes --- src/FSharp.Compiler.Interactive.Settings/fsiaux.fs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/FSharp.Compiler.Interactive.Settings/fsiaux.fs b/src/FSharp.Compiler.Interactive.Settings/fsiaux.fs index 8d016a0246e..2c4ef19a242 100644 --- a/src/FSharp.Compiler.Interactive.Settings/fsiaux.fs +++ b/src/FSharp.Compiler.Interactive.Settings/fsiaux.fs @@ -9,10 +9,6 @@ open System open System.Diagnostics open System.Threading -[] -[] -do () - type IEventLoop = abstract Run: unit -> bool abstract Invoke: (unit -> 'T) -> 'T From eacde802ae58ecf3cfefbb7e414768aa3f6cbe48 Mon Sep 17 00:00:00 2001 From: dawe Date: Thu, 16 May 2024 18:38:25 +0200 Subject: [PATCH 18/34] refactor --- .../fsihelp.fs | 220 +++++++++--------- 1 file changed, 110 insertions(+), 110 deletions(-) diff --git a/src/FSharp.Compiler.Interactive.Settings/fsihelp.fs b/src/FSharp.Compiler.Interactive.Settings/fsihelp.fs index 34e634e2384..aa471fd8971 100644 --- a/src/FSharp.Compiler.Interactive.Settings/fsihelp.fs +++ b/src/FSharp.Compiler.Interactive.Settings/fsihelp.fs @@ -80,18 +80,21 @@ module Parser = let xmlDocCache = Dictionary() - let getXmlDocument xmlPath = - match xmlDocCache.TryGetValue(xmlPath) with - | true, value -> - let xmlDocument = XmlDocument() - xmlDocument.LoadXml(value) - xmlDocument - | _ -> - let rawXml = System.IO.File.ReadAllText(xmlPath) - let xmlDocument = XmlDocument() - xmlDocument.LoadXml(rawXml) - xmlDocCache.Add(xmlPath, rawXml) - xmlDocument + let tryGetXmlDocument xmlPath = + try + match xmlDocCache.TryGetValue(xmlPath) with + | true, value -> + let xmlDocument = XmlDocument() + xmlDocument.LoadXml(value) + Some xmlDocument + | _ -> + let rawXml = System.IO.File.ReadAllText(xmlPath) + let xmlDocument = XmlDocument() + xmlDocument.LoadXml(rawXml) + xmlDocCache.Add(xmlPath, rawXml) + Some xmlDocument + with _ -> + None let getTexts (node: Xml.XmlNode) = seq { @@ -110,93 +113,92 @@ module Parser = } |> String.concat "" - let helpText (xmlPath: string) (assembly: string) (modName: string) (implName: string) (sourceName: string) = + let tryMkHelp (xmlDocument: XmlDocument option) (assembly: string) (modName: string) (implName: string) (sourceName: string) = let sourceName = sourceName.Replace('.', '#') // for .ctor let implName = implName.Replace('.', '#') // for .ctor let xmlName = $"{modName}.{implName}" - let xmlDocument = getXmlDocument xmlPath - let node = - let toTry = - [ - $"/doc/members/member[contains(@name, ':{xmlName}`')]" - $"/doc/members/member[contains(@name, ':{xmlName}(')]" - $"/doc/members/member[contains(@name, ':{xmlName}')]" - ] + let toTry = + [ + $"/doc/members/member[contains(@name, ':{xmlName}`')]" + $"/doc/members/member[contains(@name, ':{xmlName}(')]" + $"/doc/members/member[contains(@name, ':{xmlName}')]" + ] + xmlDocument + |> Option.bind (fun xmlDocument -> seq { for t in toTry do let node = xmlDocument.SelectSingleNode(t) if not (isNull node) then Some node else None } - |> Seq.tryPick id - - match node with - | None -> ValueNone - | Some n -> - let summary = - n.SelectSingleNode("summary") - |> Option.ofObj - |> Option.map getTexts - |> Option.map cleanupXmlContent - - let remarks = - n.SelectSingleNode("remarks") - |> Option.ofObj - |> Option.map getTexts - |> Option.map cleanupXmlContent - - let parameters = - n.SelectNodes("param") - |> Seq.cast - |> Seq.map (fun n -> n.Attributes.GetNamedItem("name").Value.Trim(), n.InnerText.Trim()) - |> List.ofSeq - - let returns = - n.SelectSingleNode("returns") - |> Option.ofObj - |> Option.map (fun n -> getTexts(n).Trim()) - - let exceptions = - n.SelectNodes("exception") - |> Seq.cast - |> Seq.map (fun n -> - let exType = n.Attributes.GetNamedItem("cref").Value - let idx = exType.IndexOf(':') - let exType = if idx >= 0 then exType.Substring(idx + 1) else exType - exType.Trim(), n.InnerText.Trim()) - |> List.ofSeq - - let examples = - n.SelectNodes("example") - |> Seq.cast - |> Seq.map (fun n -> - let codeNode = n.SelectSingleNode("code") - - let code = - if isNull codeNode then - "" - else - n.RemoveChild(codeNode) |> ignore - cleanupXmlContent codeNode.InnerText - - code, cleanupXmlContent n.InnerText) - |> List.ofSeq - - match summary with - | Some s -> - { - Summary = s - Remarks = remarks - Parameters = parameters - Returns = returns - Exceptions = exceptions - Examples = examples - FullName = $"{modName}.{sourceName}" // the long ident as users see it - Assembly = assembly - } - |> ValueSome + |> Seq.tryPick id) + |> function | None -> ValueNone + | Some n -> + let summary = + n.SelectSingleNode("summary") + |> Option.ofObj + |> Option.map getTexts + |> Option.map cleanupXmlContent + + let remarks = + n.SelectSingleNode("remarks") + |> Option.ofObj + |> Option.map getTexts + |> Option.map cleanupXmlContent + + let parameters = + n.SelectNodes("param") + |> Seq.cast + |> Seq.map (fun n -> n.Attributes.GetNamedItem("name").Value.Trim(), n.InnerText.Trim()) + |> List.ofSeq + + let returns = + n.SelectSingleNode("returns") + |> Option.ofObj + |> Option.map (fun n -> getTexts(n).Trim()) + + let exceptions = + n.SelectNodes("exception") + |> Seq.cast + |> Seq.map (fun n -> + let exType = n.Attributes.GetNamedItem("cref").Value + let idx = exType.IndexOf(':') + let exType = if idx >= 0 then exType.Substring(idx + 1) else exType + exType.Trim(), n.InnerText.Trim()) + |> List.ofSeq + + let examples = + n.SelectNodes("example") + |> Seq.cast + |> Seq.map (fun n -> + let codeNode = n.SelectSingleNode("code") + + let code = + if isNull codeNode then + "" + else + n.RemoveChild(codeNode) |> ignore + cleanupXmlContent codeNode.InnerText + + code, cleanupXmlContent n.InnerText) + |> List.ofSeq + + match summary with + | Some s -> + { + Summary = s + Remarks = remarks + Parameters = parameters + Returns = returns + Exceptions = exceptions + Examples = examples + FullName = $"{modName}.{sourceName}" // the long ident as users see it + Assembly = assembly + } + |> ValueSome + | None -> ValueNone module Expr = @@ -211,23 +213,21 @@ module Expr = let getInfos (declaringType: Type) (sourceName: string option) (implName: string) = let xmlPath = Path.ChangeExtension(declaringType.Assembly.Location, ".xml") + let xmlDoc = Parser.tryGetXmlDocument xmlPath let assembly = Path.GetFileName(declaringType.Assembly.Location) - if System.IO.File.Exists(xmlPath) then - // for FullName cases like Microsoft.FSharp.Core.FSharpOption`1[System.Object] - let fullName = - let idx = declaringType.FullName.IndexOf('[') + // for FullName cases like Microsoft.FSharp.Core.FSharpOption`1[System.Object] + let fullName = + let idx = declaringType.FullName.IndexOf('[') - if idx >= 0 then - declaringType.FullName.Substring(0, idx) - else - declaringType.FullName + if idx >= 0 then + declaringType.FullName.Substring(0, idx) + else + declaringType.FullName - let fullName = fullName.Replace('+', '.') // for FullName cases like Microsoft.FSharp.Collections.ArrayModule+Parallel + let fullName = fullName.Replace('+', '.') // for FullName cases like Microsoft.FSharp.Collections.ArrayModule+Parallel - Some(xmlPath, assembly, fullName, implName, sourceName |> Option.defaultValue implName) - else - None + (xmlDoc, assembly, fullName, implName, sourceName |> Option.defaultValue implName) let rec exprNames expr = match expr with @@ -236,21 +236,21 @@ module Expr = | Some _ -> None | None -> let sourceName = tryGetSourceName methodInfo - getInfos methodInfo.DeclaringType sourceName methodInfo.Name + getInfos methodInfo.DeclaringType sourceName methodInfo.Name |> Some | Lambda(_param, body) -> exprNames body | Let(_, _, body) -> exprNames body - | Value(_o, t) -> getInfos t (Some t.Name) t.Name - | DefaultValue t -> getInfos t (Some t.Name) t.Name - | PropertyGet(_o, info, _) -> getInfos info.DeclaringType (Some info.Name) info.Name - | NewUnionCase(info, _exprList) -> getInfos info.DeclaringType (Some info.Name) info.Name - | NewObject(ctorInfo, _e) -> getInfos ctorInfo.DeclaringType (Some ctorInfo.Name) ctorInfo.Name - | NewArray(t, _exprs) -> getInfos t (Some t.Name) t.Name + | Value(_o, t) -> getInfos t (Some t.Name) t.Name |> Some + | DefaultValue t -> getInfos t (Some t.Name) t.Name |> Some + | PropertyGet(_o, info, _) -> getInfos info.DeclaringType (Some info.Name) info.Name |> Some + | NewUnionCase(info, _exprList) -> getInfos info.DeclaringType (Some info.Name) info.Name |> Some + | NewObject(ctorInfo, _e) -> getInfos ctorInfo.DeclaringType (Some ctorInfo.Name) ctorInfo.Name |> Some + | NewArray(t, _exprs) -> getInfos t (Some t.Name) t.Name |> Some | NewTuple _ -> let ty = typeof<_ * _> - getInfos ty (Some ty.Name) ty.Name + getInfos ty (Some ty.Name) ty.Name |> Some | NewStructTuple _ -> let ty = typeof - getInfos ty (Some ty.Name) ty.Name + getInfos ty (Some ty.Name) ty.Name |> Some | _ -> None module Logic = @@ -261,5 +261,5 @@ module Logic = module Quoted = let tryGetDocumentation (expr: Quotations.Expr) = match exprNames expr with - | Some(xmlPath, assembly, modName, implName, sourceName) -> helpText xmlPath assembly modName implName sourceName + | Some(xmlDocument, assembly, modName, implName, sourceName) -> tryMkHelp xmlDocument assembly modName implName sourceName | _ -> ValueNone From cbc2d993e6ff5cc29e0fc206796271c95e33f934 Mon Sep 17 00:00:00 2001 From: dawe Date: Thu, 16 May 2024 23:15:44 +0200 Subject: [PATCH 19/34] add some tests --- .../FSharp.Compiler.UnitTests.fsproj | 2 ++ .../FSharp.Compiler.UnitTests/FsiHelpTests.fs | 30 +++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 tests/FSharp.Compiler.UnitTests/FsiHelpTests.fs diff --git a/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.UnitTests.fsproj b/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.UnitTests.fsproj index 4b6e9a9fe4a..8cb0634285b 100644 --- a/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.UnitTests.fsproj +++ b/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.UnitTests.fsproj @@ -26,6 +26,7 @@ + @@ -81,6 +82,7 @@ + diff --git a/tests/FSharp.Compiler.UnitTests/FsiHelpTests.fs b/tests/FSharp.Compiler.UnitTests/FsiHelpTests.fs new file mode 100644 index 00000000000..12b805b9440 --- /dev/null +++ b/tests/FSharp.Compiler.UnitTests/FsiHelpTests.fs @@ -0,0 +1,30 @@ +namespace FSharp.Compiler.UnitTests + +open FSharp.Test.Assert +open Xunit + +[] +module FsiHelpTests = + + [] + let ``Can get help for FSharp.Compiler.Xml.PreXmlDoc.Create`` () = + match FSharp.Compiler.Interactive.FsiHelp.Logic.Quoted.tryGetDocumentation <@ FSharp.Compiler.Xml.PreXmlDoc.Create @> with + | ValueSome h -> + h.Assembly |> shouldBe "FSharp.Compiler.Service.dll" + h.FullName |> shouldBe "FSharp.Compiler.Xml.PreXmlDoc.Create" + + h.Summary + |> shouldBe "Create a PreXmlDoc from a collection of unprocessed lines" + | ValueNone -> Assert.True(false, "No xml documentation found") + + [] + let ``Can get help for FSharp.Compiler.Syntax.SyntaxNodes.tryPickLast`` () = + match FSharp.Compiler.Interactive.FsiHelp.Logic.Quoted.tryGetDocumentation <@ FSharp.Compiler.Syntax.SyntaxNodes.tryPickLast @> with + | ValueSome h -> + h.Assembly |> shouldBe "FSharp.Compiler.Service.dll" + h.FullName |> shouldBe "FSharp.Compiler.Syntax.SyntaxNodesModule.tryPickLast" + Assert.StartsWith("Applies the given function to each node of the AST and ", h.Summary) + h.Parameters |> shouldNotBeEmpty + h.Returns.IsSome |> shouldBeTrue + h.Examples |> shouldNotBeEmpty + | ValueNone -> Assert.True(false, "No xml documentation found") From 46f88442bd538002a81a17b34a152ecfac65967d Mon Sep 17 00:00:00 2001 From: dawe Date: Thu, 16 May 2024 23:59:52 +0200 Subject: [PATCH 20/34] - let xpath queries work with single quotes in names like "shouldn't" - add tests --- .../fsihelp.fs | 6 +++--- .../FSharp.Compiler.UnitTests/FsiHelpTests.fs | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/FSharp.Compiler.Interactive.Settings/fsihelp.fs b/src/FSharp.Compiler.Interactive.Settings/fsihelp.fs index aa471fd8971..f28cc3e25c8 100644 --- a/src/FSharp.Compiler.Interactive.Settings/fsihelp.fs +++ b/src/FSharp.Compiler.Interactive.Settings/fsihelp.fs @@ -120,9 +120,9 @@ module Parser = let toTry = [ - $"/doc/members/member[contains(@name, ':{xmlName}`')]" - $"/doc/members/member[contains(@name, ':{xmlName}(')]" - $"/doc/members/member[contains(@name, ':{xmlName}')]" + $"""/doc/members/member[contains(@name, ":{xmlName}`")]""" + $"""/doc/members/member[contains(@name, ":{xmlName}(")]""" + $"""/doc/members/member[contains(@name, ":{xmlName}")]""" ] xmlDocument diff --git a/tests/FSharp.Compiler.UnitTests/FsiHelpTests.fs b/tests/FSharp.Compiler.UnitTests/FsiHelpTests.fs index 12b805b9440..5f8d9882175 100644 --- a/tests/FSharp.Compiler.UnitTests/FsiHelpTests.fs +++ b/tests/FSharp.Compiler.UnitTests/FsiHelpTests.fs @@ -28,3 +28,21 @@ module FsiHelpTests = h.Returns.IsSome |> shouldBeTrue h.Examples |> shouldNotBeEmpty | ValueNone -> Assert.True(false, "No xml documentation found") + + [] + let ``Can get help for FSComp.SR.considerUpcast`` () = + match FSharp.Compiler.Interactive.FsiHelp.Logic.Quoted.tryGetDocumentation <@ FSComp.SR.considerUpcast @> with + | ValueSome h -> + h.Assembly |> shouldBe "FSharp.Compiler.Service.dll" + h.FullName |> shouldBe "FSComp.SR.considerUpcast" + Assert.StartsWith("The conversion from %s to %s is a compile-time safe upcast", h.Summary) + | ValueNone -> Assert.True(false, "No xml documentation found") + + [] + let ``Can get help for FSharp.Test.ReflectionHelper.shouldn't`` () = + match FSharp.Compiler.Interactive.FsiHelp.Logic.Quoted.tryGetDocumentation <@ FSharp.Test.ReflectionHelper.shouldn't @> with + | ValueSome h -> + h.Assembly |> shouldBe "FSharp.Test.Utilities.dll" + h.FullName |> shouldBe "FSharp.Test.ReflectionHelper.shouldn't" + Assert.StartsWith("Assert that function f ", h.Summary) + | ValueNone -> Assert.True(false, "No xml documentation found") From af88e7465eb0efa454695f3e462121867443eb6e Mon Sep 17 00:00:00 2001 From: dawe Date: Fri, 17 May 2024 20:15:21 +0200 Subject: [PATCH 21/34] Trigger Build From 0689e5c123e25664d1ee816edcd645e962231fda Mon Sep 17 00:00:00 2001 From: dawe Date: Sat, 18 May 2024 22:23:40 +0200 Subject: [PATCH 22/34] adjust changelog entry --- docs/release-notes/.FSharp.Compiler.Service/8.0.400.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/release-notes/.FSharp.Compiler.Service/8.0.400.md b/docs/release-notes/.FSharp.Compiler.Service/8.0.400.md index 590e538e50d..691eca50749 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/8.0.400.md +++ b/docs/release-notes/.FSharp.Compiler.Service/8.0.400.md @@ -1,6 +1,6 @@ ### Fixed -* Added #h directive to fsi to show documentation in the REPL. ([PR #17140](https://github.com/dotnet/fsharp/pull/17140)) +* Added `h` member to the `fsi` object to show documentation in the REPL. ([PR #17140](https://github.com/dotnet/fsharp/pull/17140)) * Error for partial implementation of interface with static and non-static abstract members. ([Issue #17138](https://github.com/dotnet/fsharp/issues/17138), [PR #17160](https://github.com/dotnet/fsharp/pull/17160)) * Optimize simple mappings with preludes in computed collections. ([PR #17067](https://github.com/dotnet/fsharp/pull/17067)) * Improve error reporting for abstract members when used in classes. ([PR #17063](https://github.com/dotnet/fsharp/pull/17063)) From 4631ac20c35a0c7765bfaaa81bd15259d6b919b2 Mon Sep 17 00:00:00 2001 From: dawe Date: Thu, 6 Jun 2024 11:17:27 +0200 Subject: [PATCH 23/34] move back to #h interface --- src/Compiler/FSharp.Compiler.Service.fsproj | 2 + src/Compiler/Interactive/FSIstrings.txt | 2 +- src/Compiler/Interactive/fsi.fs | 39 ++++++++++++++++--- .../Interactive}/fsihelp.fs | 9 ++++- .../Interactive}/fsihelp.fsi | 2 + .../Interactive/xlf/FSIstrings.txt.cs.xlf | 6 +-- .../Interactive/xlf/FSIstrings.txt.de.xlf | 6 +-- .../Interactive/xlf/FSIstrings.txt.es.xlf | 6 +-- .../Interactive/xlf/FSIstrings.txt.fr.xlf | 6 +-- .../Interactive/xlf/FSIstrings.txt.it.xlf | 6 +-- .../Interactive/xlf/FSIstrings.txt.ja.xlf | 6 +-- .../Interactive/xlf/FSIstrings.txt.ko.xlf | 6 +-- .../Interactive/xlf/FSIstrings.txt.pl.xlf | 6 +-- .../Interactive/xlf/FSIstrings.txt.pt-BR.xlf | 6 +-- .../Interactive/xlf/FSIstrings.txt.ru.xlf | 6 +-- .../Interactive/xlf/FSIstrings.txt.tr.xlf | 6 +-- .../xlf/FSIstrings.txt.zh-Hans.xlf | 6 +-- .../xlf/FSIstrings.txt.zh-Hant.xlf | 6 +-- ...Sharp.Compiler.Interactive.Settings.fsproj | 2 - .../fsiaux.fs | 12 ++---- .../fsiaux.fsi | 3 -- .../FSharp.Compiler.Service.Tests.fsproj | 1 - 22 files changed, 90 insertions(+), 60 deletions(-) rename src/{FSharp.Compiler.Interactive.Settings => Compiler/Interactive}/fsihelp.fs (96%) rename src/{FSharp.Compiler.Interactive.Settings => Compiler/Interactive}/fsihelp.fsi (91%) diff --git a/src/Compiler/FSharp.Compiler.Service.fsproj b/src/Compiler/FSharp.Compiler.Service.fsproj index 8f3285633bf..1196aa6bace 100644 --- a/src/Compiler/FSharp.Compiler.Service.fsproj +++ b/src/Compiler/FSharp.Compiler.Service.fsproj @@ -527,6 +527,8 @@ + + diff --git a/src/Compiler/Interactive/FSIstrings.txt b/src/Compiler/Interactive/FSIstrings.txt index afdb8069063..8f4f71c6465 100644 --- a/src/Compiler/Interactive/FSIstrings.txt +++ b/src/Compiler/Interactive/FSIstrings.txt @@ -32,7 +32,7 @@ fsiIntroPackageSourceUriInfo,"Include package source uri when searching for pack fsiIntroTextHashloadInfo,"Load the given file(s) as if compiled and referenced" fsiIntroTextHashtimeInfo,"Toggle timing on/off" fsiIntroTextHashhelpInfo,"Display help" -fsiIntroTextfsihelpInfo,"Display documentation for an expression, e.g. fsi.h List.map;;" +fsiIntroTextHashhInfo,"Display documentation for an expression, e.g. #h \"List.map\";;" fsiIntroTextHashquitInfo,"Exit" fsiIntroTextHashclearInfo,"Clear screen" fsiIntroTextHeader2commandLine," F# Interactive command line options:" diff --git a/src/Compiler/Interactive/fsi.fs b/src/Compiler/Interactive/fsi.fs index f94135119e3..077a73a91cb 100644 --- a/src/Compiler/Interactive/fsi.fs +++ b/src/Compiler/Interactive/fsi.fs @@ -1239,6 +1239,7 @@ type internal FsiCommandLineOptions(fsi: FsiEvaluationSessionHostConfig, argv: s fsiConsoleOutput.uprintfn """ #load "file.fs" ...;; // %s""" (FSIstrings.SR.fsiIntroTextHashloadInfo ()) fsiConsoleOutput.uprintfn """ #time ["on"|"off"];; // %s""" (FSIstrings.SR.fsiIntroTextHashtimeInfo ()) fsiConsoleOutput.uprintfn """ #help;; // %s""" (FSIstrings.SR.fsiIntroTextHashhelpInfo ()) + fsiConsoleOutput.uprintfn """ #h expr;; // %s""" (FSIstrings.SR.fsiIntroTextHashhInfo ()) if tcConfigB.langVersion.SupportsFeature(LanguageFeature.PackageManagement) then for msg in @@ -1251,7 +1252,6 @@ type internal FsiCommandLineOptions(fsi: FsiEvaluationSessionHostConfig, argv: s fsiConsoleOutput.uprintfn """ #clear;; // %s""" (FSIstrings.SR.fsiIntroTextHashclearInfo ()) fsiConsoleOutput.uprintfn """ #quit;; // %s""" (FSIstrings.SR.fsiIntroTextHashquitInfo ()) - fsiConsoleOutput.uprintfn """ fsi.h expr;; // %s""" (FSIstrings.SR.fsiIntroTextfsihelpInfo ()) fsiConsoleOutput.uprintfn "" fsiConsoleOutput.uprintfnn "%s" (FSIstrings.SR.fsiIntroTextHeader2commandLine ()) fsiConsoleOutput.uprintfn "%s" (FSIstrings.SR.fsiIntroTextHeader3 (helpLine)) @@ -2500,7 +2500,7 @@ type internal FsiDynamicCompiler processContents newState declaredImpls /// Evaluate the given expression and produce a new interactive state. - member fsiDynamicCompiler.EvalParsedExpression(ctok, diagnosticsLogger: DiagnosticsLogger, istate, expr: SynExpr) = + member fsiDynamicCompiler.EvalParsedExpression(ctok, diagnosticsLogger: DiagnosticsLogger, istate, expr: SynExpr, suppressItPrint) = let tcConfig = TcConfig.Create(tcConfigB, validate = false) let itName = "it" @@ -2514,7 +2514,7 @@ type internal FsiDynamicCompiler // Snarf the type for 'it' via the binding match istate.tcState.TcEnvFromImpls.NameEnv.FindUnqualifiedItem itName with | Item.Value vref -> - if not tcConfig.noFeedback then + if not tcConfig.noFeedback && not suppressItPrint then let infoReader = InfoReader(istate.tcGlobals, istate.tcImports.GetImportMap()) valuePrinter.InvokeExprPrinter( @@ -3725,6 +3725,31 @@ type FsiInteractionProcessor stopProcessingRecovery e range0 None + let runhDirective diagnosticsLogger ctok istate source = + let lexbuf = + UnicodeLexing.StringAsLexbuf(true, tcConfigB.langVersion, tcConfigB.strictIndentation, $"<@@ {source} @@>") + + let tokenizer = + fsiStdinLexerProvider.CreateBufferLexer("hdummy.fsx", lexbuf, diagnosticsLogger) + + let parsedInteraction = ParseInteraction tokenizer + + match parsedInteraction with + | Some(ParsedScriptInteraction.Definitions([ SynModuleDecl.Expr(e, _) ], _)) -> + + let _state, status = + fsiDynamicCompiler.EvalParsedExpression(ctok, diagnosticsLogger, istate, e, true) + + match status with + | Completed(Some compStatus) -> + match compStatus.ReflectionValue with + | :? FSharp.Quotations.Expr as qex -> + let s = FsiHelp.Logic.Quoted.h qex + fsiConsoleOutput.uprintf "%s" s + | _ -> () + | _ -> () + | _ -> () + /// Partially process a hash directive, leaving state in packageManagerLines and required assemblies let PartiallyProcessHashDirective (ctok, istate, hash, diagnosticsLogger: DiagnosticsLogger) = match hash with @@ -3821,6 +3846,10 @@ type FsiInteractionProcessor fsiOptions.ShowHelp(m) istate, Completed None + | ParsedHashDirective("h", ParsedHashDirectiveArguments [ source ], _m) -> + runhDirective diagnosticsLogger ctok istate source + istate, Completed None + | ParsedHashDirective(c, ParsedHashDirectiveArguments arg, m) -> warning (Error((FSComp.SR.fsiInvalidDirective (c, String.concat " " arg)), m)) istate, Completed None @@ -3867,7 +3896,7 @@ type FsiInteractionProcessor | InteractionGroup.HashDirectives [] -> istate, Completed None | InteractionGroup.Definitions([ SynModuleDecl.Expr(expr, _) ], _) -> - fsiDynamicCompiler.EvalParsedExpression(ctok, diagnosticsLogger, istate, expr) + fsiDynamicCompiler.EvalParsedExpression(ctok, diagnosticsLogger, istate, expr, false) | InteractionGroup.Definitions(defs, _) -> fsiDynamicCompiler.EvalParsedDefinitions(ctok, diagnosticsLogger, istate, true, false, defs) @@ -4061,7 +4090,7 @@ type FsiInteractionProcessor |> InteractiveCatch diagnosticsLogger (fun istate -> istate |> mainThreadProcessAction ctok (fun ctok istate -> - fsiDynamicCompiler.EvalParsedExpression(ctok, diagnosticsLogger, istate, expr))) + fsiDynamicCompiler.EvalParsedExpression(ctok, diagnosticsLogger, istate, expr, false))) let commitResult (istate, result) = match result with diff --git a/src/FSharp.Compiler.Interactive.Settings/fsihelp.fs b/src/Compiler/Interactive/fsihelp.fs similarity index 96% rename from src/FSharp.Compiler.Interactive.Settings/fsihelp.fs rename to src/Compiler/Interactive/fsihelp.fs index f28cc3e25c8..925885ed210 100644 --- a/src/FSharp.Compiler.Interactive.Settings/fsihelp.fs +++ b/src/Compiler/Interactive/fsihelp.fs @@ -9,6 +9,7 @@ open System.Collections.Generic open System.IO open System.Text open System.Reflection +open FSharp.Compiler.IO module Parser = @@ -88,7 +89,8 @@ module Parser = xmlDocument.LoadXml(value) Some xmlDocument | _ -> - let rawXml = System.IO.File.ReadAllText(xmlPath) + use stream = FileSystem.OpenFileForReadShim(xmlPath) + let rawXml = stream.ReadAllText() let xmlDocument = XmlDocument() xmlDocument.LoadXml(rawXml) xmlDocCache.Add(xmlPath, rawXml) @@ -263,3 +265,8 @@ module Logic = match exprNames expr with | Some(xmlDocument, assembly, modName, implName, sourceName) -> tryMkHelp xmlDocument assembly modName implName sourceName | _ -> ValueNone + + let h (expr: Quotations.Expr) = + match tryGetDocumentation expr with + | ValueNone -> "unable to get documentation" + | ValueSome d -> d.ToDisplayString() diff --git a/src/FSharp.Compiler.Interactive.Settings/fsihelp.fsi b/src/Compiler/Interactive/fsihelp.fsi similarity index 91% rename from src/FSharp.Compiler.Interactive.Settings/fsihelp.fsi rename to src/Compiler/Interactive/fsihelp.fsi index e04b2cd3809..40b6e291e05 100644 --- a/src/FSharp.Compiler.Interactive.Settings/fsihelp.fsi +++ b/src/Compiler/Interactive/fsihelp.fsi @@ -19,3 +19,5 @@ module Logic = module Quoted = val tryGetDocumentation: expr: Quotations.Expr -> Parser.Help voption + + val h: expr: Quotations.Expr -> string diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.cs.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.cs.xlf index 47b15daa314..d121c808b5d 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.cs.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.cs.xlf @@ -17,9 +17,9 @@ Vymazat obrazovku - - Display documentation for an expression, e.g. fsi.h List.map;; - Display documentation for an expression, e.g. fsi.h List.map;; + + Display documentation for an expression, e.g. #h \"List.map\";; + Display documentation for an expression, e.g. #h \"List.map\";; diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.de.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.de.xlf index 375f3d5fed4..7ec35d5a512 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.de.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.de.xlf @@ -17,9 +17,9 @@ Bildschirm löschen - - Display documentation for an expression, e.g. fsi.h List.map;; - Display documentation for an expression, e.g. fsi.h List.map;; + + Display documentation for an expression, e.g. #h \"List.map\";; + Display documentation for an expression, e.g. #h \"List.map\";; diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.es.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.es.xlf index 37fd9922993..31aeaa9faa7 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.es.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.es.xlf @@ -17,9 +17,9 @@ Borrar pantalla - - Display documentation for an expression, e.g. fsi.h List.map;; - Display documentation for an expression, e.g. fsi.h List.map;; + + Display documentation for an expression, e.g. #h \"List.map\";; + Display documentation for an expression, e.g. #h \"List.map\";; diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.fr.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.fr.xlf index d44d26e6836..0958e45c297 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.fr.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.fr.xlf @@ -17,9 +17,9 @@ Effacer l'écran - - Display documentation for an expression, e.g. fsi.h List.map;; - Display documentation for an expression, e.g. fsi.h List.map;; + + Display documentation for an expression, e.g. #h \"List.map\";; + Display documentation for an expression, e.g. #h \"List.map\";; diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.it.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.it.xlf index b9aa1088952..ae0691b08fe 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.it.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.it.xlf @@ -17,9 +17,9 @@ Cancella schermata - - Display documentation for an expression, e.g. fsi.h List.map;; - Display documentation for an expression, e.g. fsi.h List.map;; + + Display documentation for an expression, e.g. #h \"List.map\";; + Display documentation for an expression, e.g. #h \"List.map\";; diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.ja.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.ja.xlf index d45f91d6990..66bdd5e8aac 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.ja.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.ja.xlf @@ -17,9 +17,9 @@ 画面をクリアする - - Display documentation for an expression, e.g. fsi.h List.map;; - Display documentation for an expression, e.g. fsi.h List.map;; + + Display documentation for an expression, e.g. #h \"List.map\";; + Display documentation for an expression, e.g. #h \"List.map\";; diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.ko.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.ko.xlf index 9068bc8c91e..703818f32a6 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.ko.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.ko.xlf @@ -17,9 +17,9 @@ 화면 지우기 - - Display documentation for an expression, e.g. fsi.h List.map;; - Display documentation for an expression, e.g. fsi.h List.map;; + + Display documentation for an expression, e.g. #h \"List.map\";; + Display documentation for an expression, e.g. #h \"List.map\";; diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.pl.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.pl.xlf index 93550e034b0..7b27c91d068 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.pl.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.pl.xlf @@ -17,9 +17,9 @@ Wyczyść ekran - - Display documentation for an expression, e.g. fsi.h List.map;; - Display documentation for an expression, e.g. fsi.h List.map;; + + Display documentation for an expression, e.g. #h \"List.map\";; + Display documentation for an expression, e.g. #h \"List.map\";; diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.pt-BR.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.pt-BR.xlf index 8051674e0e7..713a8b5b33b 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.pt-BR.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.pt-BR.xlf @@ -17,9 +17,9 @@ Limpar tela - - Display documentation for an expression, e.g. fsi.h List.map;; - Display documentation for an expression, e.g. fsi.h List.map;; + + Display documentation for an expression, e.g. #h \"List.map\";; + Display documentation for an expression, e.g. #h \"List.map\";; diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.ru.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.ru.xlf index c646ff6ef46..942ea81bbb8 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.ru.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.ru.xlf @@ -17,9 +17,9 @@ Очистить экран - - Display documentation for an expression, e.g. fsi.h List.map;; - Display documentation for an expression, e.g. fsi.h List.map;; + + Display documentation for an expression, e.g. #h \"List.map\";; + Display documentation for an expression, e.g. #h \"List.map\";; diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.tr.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.tr.xlf index 7f740208bbb..9449856167a 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.tr.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.tr.xlf @@ -17,9 +17,9 @@ Ekranı temizle - - Display documentation for an expression, e.g. fsi.h List.map;; - Display documentation for an expression, e.g. fsi.h List.map;; + + Display documentation for an expression, e.g. #h \"List.map\";; + Display documentation for an expression, e.g. #h \"List.map\";; diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hans.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hans.xlf index 29570f6ef0d..9fd2b340994 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hans.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hans.xlf @@ -17,9 +17,9 @@ 清除屏幕 - - Display documentation for an expression, e.g. fsi.h List.map;; - Display documentation for an expression, e.g. fsi.h List.map;; + + Display documentation for an expression, e.g. #h \"List.map\";; + Display documentation for an expression, e.g. #h \"List.map\";; diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hant.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hant.xlf index a3968453584..37fab090895 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hant.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hant.xlf @@ -17,9 +17,9 @@ 清空螢幕 - - Display documentation for an expression, e.g. fsi.h List.map;; - Display documentation for an expression, e.g. fsi.h List.map;; + + Display documentation for an expression, e.g. #h \"List.map\";; + Display documentation for an expression, e.g. #h \"List.map\";; diff --git a/src/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj b/src/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj index 14759a7aa07..85814ac6e5f 100644 --- a/src/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj +++ b/src/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj @@ -32,8 +32,6 @@ - - diff --git a/src/FSharp.Compiler.Interactive.Settings/fsiaux.fs b/src/FSharp.Compiler.Interactive.Settings/fsiaux.fs index 2c4ef19a242..89362feb114 100644 --- a/src/FSharp.Compiler.Interactive.Settings/fsiaux.fs +++ b/src/FSharp.Compiler.Interactive.Settings/fsiaux.fs @@ -9,6 +9,10 @@ open System open System.Diagnostics open System.Threading +[] +[] +do () + type IEventLoop = abstract Run: unit -> bool abstract Invoke: (unit -> 'T) -> 'T @@ -158,9 +162,6 @@ type InteractiveSession() = member _.AddPrintTransformer(printer: 'T -> obj) = addedPrinters <- Choice2Of2(typeof<'T>, (fun (x: obj) -> printer (unbox x))) :: addedPrinters - member _.h([] expr: Quotations.Expr<_>) = - FsiHelp.Logic.Quoted.tryGetDocumentation expr - member internal self.SetEventLoop(run: (unit -> bool), invoke: ((unit -> obj) -> obj), restart: (unit -> unit)) = evLoop.ScheduleRestart() @@ -177,11 +178,6 @@ type InteractiveSession() = module Settings = let fsi = new InteractiveSession() - fsi.AddPrinter(fun help -> - match help with - | ValueNone -> "No help available" - | ValueSome help -> help.ToDisplayString()) - [] do () diff --git a/src/FSharp.Compiler.Interactive.Settings/fsiaux.fsi b/src/FSharp.Compiler.Interactive.Settings/fsiaux.fsi index 3a29ad87fe5..38373efb9bc 100644 --- a/src/FSharp.Compiler.Interactive.Settings/fsiaux.fsi +++ b/src/FSharp.Compiler.Interactive.Settings/fsiaux.fsi @@ -68,9 +68,6 @@ type InteractiveSession = /// Gets or sets a the current event loop being used to process interactions. member EventLoop: IEventLoop with get, set - /// Get the documentation for an expression. - member h: [] expr: Quotations.Expr<_> -> FsiHelp.Parser.Help voption - /// Sets the current event loop being used to process interactions. member internal SetEventLoop: (unit -> bool) * ((unit -> obj) -> obj) * (unit -> unit) -> unit diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj index b2ea76db56e..d0af2696e3b 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj @@ -81,7 +81,6 @@ - From c6a511fc352424a04acc4f6e00cedeef07a28812 Mon Sep 17 00:00:00 2001 From: dawe Date: Thu, 6 Jun 2024 11:25:32 +0200 Subject: [PATCH 24/34] rename tryGetDocumentation to tryGetHelp --- src/Compiler/Interactive/fsihelp.fs | 4 ++-- src/Compiler/Interactive/fsihelp.fsi | 2 +- tests/FSharp.Compiler.Service.Tests/FsiHelpTests.fs | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Compiler/Interactive/fsihelp.fs b/src/Compiler/Interactive/fsihelp.fs index 925885ed210..5936517d5c9 100644 --- a/src/Compiler/Interactive/fsihelp.fs +++ b/src/Compiler/Interactive/fsihelp.fs @@ -261,12 +261,12 @@ module Logic = open Parser module Quoted = - let tryGetDocumentation (expr: Quotations.Expr) = + let tryGetHelp (expr: Quotations.Expr) = match exprNames expr with | Some(xmlDocument, assembly, modName, implName, sourceName) -> tryMkHelp xmlDocument assembly modName implName sourceName | _ -> ValueNone let h (expr: Quotations.Expr) = - match tryGetDocumentation expr with + match tryGetHelp expr with | ValueNone -> "unable to get documentation" | ValueSome d -> d.ToDisplayString() diff --git a/src/Compiler/Interactive/fsihelp.fsi b/src/Compiler/Interactive/fsihelp.fsi index 40b6e291e05..34b8691c3f9 100644 --- a/src/Compiler/Interactive/fsihelp.fsi +++ b/src/Compiler/Interactive/fsihelp.fsi @@ -18,6 +18,6 @@ module Logic = module Quoted = - val tryGetDocumentation: expr: Quotations.Expr -> Parser.Help voption + val tryGetHelp: expr: Quotations.Expr -> Parser.Help voption val h: expr: Quotations.Expr -> string diff --git a/tests/FSharp.Compiler.Service.Tests/FsiHelpTests.fs b/tests/FSharp.Compiler.Service.Tests/FsiHelpTests.fs index 5f8d9882175..7364a89f94d 100644 --- a/tests/FSharp.Compiler.Service.Tests/FsiHelpTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/FsiHelpTests.fs @@ -8,7 +8,7 @@ module FsiHelpTests = [] let ``Can get help for FSharp.Compiler.Xml.PreXmlDoc.Create`` () = - match FSharp.Compiler.Interactive.FsiHelp.Logic.Quoted.tryGetDocumentation <@ FSharp.Compiler.Xml.PreXmlDoc.Create @> with + match FSharp.Compiler.Interactive.FsiHelp.Logic.Quoted.tryGetHelp <@ FSharp.Compiler.Xml.PreXmlDoc.Create @> with | ValueSome h -> h.Assembly |> shouldBe "FSharp.Compiler.Service.dll" h.FullName |> shouldBe "FSharp.Compiler.Xml.PreXmlDoc.Create" @@ -19,7 +19,7 @@ module FsiHelpTests = [] let ``Can get help for FSharp.Compiler.Syntax.SyntaxNodes.tryPickLast`` () = - match FSharp.Compiler.Interactive.FsiHelp.Logic.Quoted.tryGetDocumentation <@ FSharp.Compiler.Syntax.SyntaxNodes.tryPickLast @> with + match FSharp.Compiler.Interactive.FsiHelp.Logic.Quoted.tryGetHelp <@ FSharp.Compiler.Syntax.SyntaxNodes.tryPickLast @> with | ValueSome h -> h.Assembly |> shouldBe "FSharp.Compiler.Service.dll" h.FullName |> shouldBe "FSharp.Compiler.Syntax.SyntaxNodesModule.tryPickLast" @@ -31,7 +31,7 @@ module FsiHelpTests = [] let ``Can get help for FSComp.SR.considerUpcast`` () = - match FSharp.Compiler.Interactive.FsiHelp.Logic.Quoted.tryGetDocumentation <@ FSComp.SR.considerUpcast @> with + match FSharp.Compiler.Interactive.FsiHelp.Logic.Quoted.tryGetHelp <@ FSComp.SR.considerUpcast @> with | ValueSome h -> h.Assembly |> shouldBe "FSharp.Compiler.Service.dll" h.FullName |> shouldBe "FSComp.SR.considerUpcast" @@ -40,7 +40,7 @@ module FsiHelpTests = [] let ``Can get help for FSharp.Test.ReflectionHelper.shouldn't`` () = - match FSharp.Compiler.Interactive.FsiHelp.Logic.Quoted.tryGetDocumentation <@ FSharp.Test.ReflectionHelper.shouldn't @> with + match FSharp.Compiler.Interactive.FsiHelp.Logic.Quoted.tryGetHelp <@ FSharp.Test.ReflectionHelper.shouldn't @> with | ValueSome h -> h.Assembly |> shouldBe "FSharp.Test.Utilities.dll" h.FullName |> shouldBe "FSharp.Test.ReflectionHelper.shouldn't" From e8db338db882783f956fe8a07ae957a2246aef49 Mon Sep 17 00:00:00 2001 From: dawe Date: Thu, 6 Jun 2024 11:43:47 +0200 Subject: [PATCH 25/34] use #help "expr";; --- src/Compiler/Interactive/FSIstrings.txt | 2 +- src/Compiler/Interactive/fsi.fs | 4 ++-- src/Compiler/Interactive/xlf/FSIstrings.txt.cs.xlf | 6 +++--- src/Compiler/Interactive/xlf/FSIstrings.txt.de.xlf | 6 +++--- src/Compiler/Interactive/xlf/FSIstrings.txt.es.xlf | 6 +++--- src/Compiler/Interactive/xlf/FSIstrings.txt.fr.xlf | 6 +++--- src/Compiler/Interactive/xlf/FSIstrings.txt.it.xlf | 6 +++--- src/Compiler/Interactive/xlf/FSIstrings.txt.ja.xlf | 6 +++--- src/Compiler/Interactive/xlf/FSIstrings.txt.ko.xlf | 6 +++--- src/Compiler/Interactive/xlf/FSIstrings.txt.pl.xlf | 6 +++--- src/Compiler/Interactive/xlf/FSIstrings.txt.pt-BR.xlf | 6 +++--- src/Compiler/Interactive/xlf/FSIstrings.txt.ru.xlf | 6 +++--- src/Compiler/Interactive/xlf/FSIstrings.txt.tr.xlf | 6 +++--- src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hans.xlf | 6 +++--- src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hant.xlf | 6 +++--- .../DependencyManagerInteractiveTests.fs | 4 ++-- tests/fsharp/core/printing/output.1000.stdout.bsl | 2 +- tests/fsharp/core/printing/output.200.stdout.bsl | 2 +- tests/fsharp/core/printing/output.47.stdout.bsl | 2 +- tests/fsharp/core/printing/output.multiemit.stdout.bsl | 2 +- tests/fsharp/core/printing/output.off.stdout.bsl | 2 +- tests/fsharp/core/printing/output.stdout.bsl | 2 +- 22 files changed, 50 insertions(+), 50 deletions(-) diff --git a/src/Compiler/Interactive/FSIstrings.txt b/src/Compiler/Interactive/FSIstrings.txt index 8f4f71c6465..8f68ceb1cee 100644 --- a/src/Compiler/Interactive/FSIstrings.txt +++ b/src/Compiler/Interactive/FSIstrings.txt @@ -32,7 +32,7 @@ fsiIntroPackageSourceUriInfo,"Include package source uri when searching for pack fsiIntroTextHashloadInfo,"Load the given file(s) as if compiled and referenced" fsiIntroTextHashtimeInfo,"Toggle timing on/off" fsiIntroTextHashhelpInfo,"Display help" -fsiIntroTextHashhInfo,"Display documentation for an expression, e.g. #h \"List.map\";;" +fsiIntroTextHashhelpdocInfo,"Display documentation for an expression, e.g. #help \"List.map\";;" fsiIntroTextHashquitInfo,"Exit" fsiIntroTextHashclearInfo,"Clear screen" fsiIntroTextHeader2commandLine," F# Interactive command line options:" diff --git a/src/Compiler/Interactive/fsi.fs b/src/Compiler/Interactive/fsi.fs index 077a73a91cb..8a10575c72a 100644 --- a/src/Compiler/Interactive/fsi.fs +++ b/src/Compiler/Interactive/fsi.fs @@ -1239,7 +1239,7 @@ type internal FsiCommandLineOptions(fsi: FsiEvaluationSessionHostConfig, argv: s fsiConsoleOutput.uprintfn """ #load "file.fs" ...;; // %s""" (FSIstrings.SR.fsiIntroTextHashloadInfo ()) fsiConsoleOutput.uprintfn """ #time ["on"|"off"];; // %s""" (FSIstrings.SR.fsiIntroTextHashtimeInfo ()) fsiConsoleOutput.uprintfn """ #help;; // %s""" (FSIstrings.SR.fsiIntroTextHashhelpInfo ()) - fsiConsoleOutput.uprintfn """ #h expr;; // %s""" (FSIstrings.SR.fsiIntroTextHashhInfo ()) + fsiConsoleOutput.uprintfn """ #help "expr";; // %s""" (FSIstrings.SR.fsiIntroTextHashhelpdocInfo ()) if tcConfigB.langVersion.SupportsFeature(LanguageFeature.PackageManagement) then for msg in @@ -3846,7 +3846,7 @@ type FsiInteractionProcessor fsiOptions.ShowHelp(m) istate, Completed None - | ParsedHashDirective("h", ParsedHashDirectiveArguments [ source ], _m) -> + | ParsedHashDirective("help", ParsedHashDirectiveArguments [ source ], _m) -> runhDirective diagnosticsLogger ctok istate source istate, Completed None diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.cs.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.cs.xlf index d121c808b5d..5e5030207cc 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.cs.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.cs.xlf @@ -17,9 +17,9 @@ Vymazat obrazovku - - Display documentation for an expression, e.g. #h \"List.map\";; - Display documentation for an expression, e.g. #h \"List.map\";; + + Display documentation for an expression, e.g. #help \"List.map\";; + Display documentation for an expression, e.g. #help \"List.map\";; diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.de.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.de.xlf index 7ec35d5a512..2dbdee27284 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.de.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.de.xlf @@ -17,9 +17,9 @@ Bildschirm löschen - - Display documentation for an expression, e.g. #h \"List.map\";; - Display documentation for an expression, e.g. #h \"List.map\";; + + Display documentation for an expression, e.g. #help \"List.map\";; + Display documentation for an expression, e.g. #help \"List.map\";; diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.es.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.es.xlf index 31aeaa9faa7..a8ae9219964 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.es.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.es.xlf @@ -17,9 +17,9 @@ Borrar pantalla - - Display documentation for an expression, e.g. #h \"List.map\";; - Display documentation for an expression, e.g. #h \"List.map\";; + + Display documentation for an expression, e.g. #help \"List.map\";; + Display documentation for an expression, e.g. #help \"List.map\";; diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.fr.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.fr.xlf index 0958e45c297..e61cccf500b 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.fr.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.fr.xlf @@ -17,9 +17,9 @@ Effacer l'écran - - Display documentation for an expression, e.g. #h \"List.map\";; - Display documentation for an expression, e.g. #h \"List.map\";; + + Display documentation for an expression, e.g. #help \"List.map\";; + Display documentation for an expression, e.g. #help \"List.map\";; diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.it.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.it.xlf index ae0691b08fe..64026adc5c1 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.it.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.it.xlf @@ -17,9 +17,9 @@ Cancella schermata - - Display documentation for an expression, e.g. #h \"List.map\";; - Display documentation for an expression, e.g. #h \"List.map\";; + + Display documentation for an expression, e.g. #help \"List.map\";; + Display documentation for an expression, e.g. #help \"List.map\";; diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.ja.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.ja.xlf index 66bdd5e8aac..eea774992b7 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.ja.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.ja.xlf @@ -17,9 +17,9 @@ 画面をクリアする - - Display documentation for an expression, e.g. #h \"List.map\";; - Display documentation for an expression, e.g. #h \"List.map\";; + + Display documentation for an expression, e.g. #help \"List.map\";; + Display documentation for an expression, e.g. #help \"List.map\";; diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.ko.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.ko.xlf index 703818f32a6..7c46a574380 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.ko.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.ko.xlf @@ -17,9 +17,9 @@ 화면 지우기 - - Display documentation for an expression, e.g. #h \"List.map\";; - Display documentation for an expression, e.g. #h \"List.map\";; + + Display documentation for an expression, e.g. #help \"List.map\";; + Display documentation for an expression, e.g. #help \"List.map\";; diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.pl.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.pl.xlf index 7b27c91d068..66bb91059c7 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.pl.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.pl.xlf @@ -17,9 +17,9 @@ Wyczyść ekran - - Display documentation for an expression, e.g. #h \"List.map\";; - Display documentation for an expression, e.g. #h \"List.map\";; + + Display documentation for an expression, e.g. #help \"List.map\";; + Display documentation for an expression, e.g. #help \"List.map\";; diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.pt-BR.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.pt-BR.xlf index 713a8b5b33b..6ddb328eeed 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.pt-BR.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.pt-BR.xlf @@ -17,9 +17,9 @@ Limpar tela - - Display documentation for an expression, e.g. #h \"List.map\";; - Display documentation for an expression, e.g. #h \"List.map\";; + + Display documentation for an expression, e.g. #help \"List.map\";; + Display documentation for an expression, e.g. #help \"List.map\";; diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.ru.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.ru.xlf index 942ea81bbb8..9932617833e 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.ru.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.ru.xlf @@ -17,9 +17,9 @@ Очистить экран - - Display documentation for an expression, e.g. #h \"List.map\";; - Display documentation for an expression, e.g. #h \"List.map\";; + + Display documentation for an expression, e.g. #help \"List.map\";; + Display documentation for an expression, e.g. #help \"List.map\";; diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.tr.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.tr.xlf index 9449856167a..02afa4d46e6 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.tr.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.tr.xlf @@ -17,9 +17,9 @@ Ekranı temizle - - Display documentation for an expression, e.g. #h \"List.map\";; - Display documentation for an expression, e.g. #h \"List.map\";; + + Display documentation for an expression, e.g. #help \"List.map\";; + Display documentation for an expression, e.g. #help \"List.map\";; diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hans.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hans.xlf index 9fd2b340994..1142b504ab4 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hans.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hans.xlf @@ -17,9 +17,9 @@ 清除屏幕 - - Display documentation for an expression, e.g. #h \"List.map\";; - Display documentation for an expression, e.g. #h \"List.map\";; + + Display documentation for an expression, e.g. #help \"List.map\";; + Display documentation for an expression, e.g. #help \"List.map\";; diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hant.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hant.xlf index 37fab090895..181a74509c3 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hant.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hant.xlf @@ -17,9 +17,9 @@ 清空螢幕 - - Display documentation for an expression, e.g. #h \"List.map\";; - Display documentation for an expression, e.g. #h \"List.map\";; + + Display documentation for an expression, e.g. #help \"List.map\";; + Display documentation for an expression, e.g. #help \"List.map\";; diff --git a/tests/FSharp.Compiler.Private.Scripting.UnitTests/DependencyManagerInteractiveTests.fs b/tests/FSharp.Compiler.Private.Scripting.UnitTests/DependencyManagerInteractiveTests.fs index 882e2fa95bd..08c246637de 100644 --- a/tests/FSharp.Compiler.Private.Scripting.UnitTests/DependencyManagerInteractiveTests.fs +++ b/tests/FSharp.Compiler.Private.Scripting.UnitTests/DependencyManagerInteractiveTests.fs @@ -719,8 +719,8 @@ x |> Seq.iter(fun r -> """ #time ["on"|"off"];; // Toggle timing on/off""" """ #clear;; // Clear screen""" """ #help;; // Display help""" + """ #help "expr";; // Display documentation for an expression, e.g. #help "List.map";;""" """ #quit;; // Exit""" - """ fsi.h expr;; // Display documentation for an expression, e.g. fsi.h List.map;;""" """""" """ F# Interactive command line options:""" """""" @@ -767,11 +767,11 @@ x |> Seq.iter(fun r -> """ #load "file.fs" ...;; // Load the given file(s) as if compiled and referenced""" """ #time ["on"|"off"];; // Toggle timing on/off""" """ #help;; // Display help""" + """ #help "expr";; // Display documentation for an expression, e.g. #help "List.map";;""" """ #r "nuget:FSharp.Data, 3.1.2";; // Load Nuget Package 'FSharp.Data' version '3.1.2'""" """ #r "nuget:FSharp.Data";; // Load Nuget Package 'FSharp.Data' with the highest version""" """ #clear;; // Clear screen""" """ #quit;; // Exit""" - """ fsi.h expr;; // Display documentation for an expression, e.g. fsi.h List.map;;""" """""" """ F# Interactive command line options:""" """""" diff --git a/tests/fsharp/core/printing/output.1000.stdout.bsl b/tests/fsharp/core/printing/output.1000.stdout.bsl index 23843f5c1a7..7f49d3589e4 100644 --- a/tests/fsharp/core/printing/output.1000.stdout.bsl +++ b/tests/fsharp/core/printing/output.1000.stdout.bsl @@ -1101,11 +1101,11 @@ type 'a T4063 = | AT4063 of 'a #load "file.fs" ...;; // Load the given file(s) as if compiled and referenced #time ["on"|"off"];; // Toggle timing on/off #help;; // Display help + #help "expr";; // Display documentation for an expression, e.g. #help "List.map";; #r "nuget:FSharp.Data, 3.1.2";; // Load Nuget Package 'FSharp.Data' version '3.1.2' #r "nuget:FSharp.Data";; // Load Nuget Package 'FSharp.Data' with the highest version #clear;; // Clear screen #quit;; // Exit - fsi.h expr;; // Display documentation for an expression, e.g. fsi.h List.map;; F# Interactive command line options: diff --git a/tests/fsharp/core/printing/output.200.stdout.bsl b/tests/fsharp/core/printing/output.200.stdout.bsl index ff413860294..9d72b06bd00 100644 --- a/tests/fsharp/core/printing/output.200.stdout.bsl +++ b/tests/fsharp/core/printing/output.200.stdout.bsl @@ -421,11 +421,11 @@ type 'a T4063 = | AT4063 of 'a #load "file.fs" ...;; // Load the given file(s) as if compiled and referenced #time ["on"|"off"];; // Toggle timing on/off #help;; // Display help + #help "expr";; // Display documentation for an expression, e.g. #help "List.map";; #r "nuget:FSharp.Data, 3.1.2";; // Load Nuget Package 'FSharp.Data' version '3.1.2' #r "nuget:FSharp.Data";; // Load Nuget Package 'FSharp.Data' with the highest version #clear;; // Clear screen #quit;; // Exit - fsi.h expr;; // Display documentation for an expression, e.g. fsi.h List.map;; F# Interactive command line options: diff --git a/tests/fsharp/core/printing/output.47.stdout.bsl b/tests/fsharp/core/printing/output.47.stdout.bsl index ca02563726e..4f74411842a 100644 --- a/tests/fsharp/core/printing/output.47.stdout.bsl +++ b/tests/fsharp/core/printing/output.47.stdout.bsl @@ -4060,9 +4060,9 @@ type 'a T4063 = | AT4063 of 'a #load "file.fs" ...;; // Load the given file(s) as if compiled and referenced #time ["on"|"off"];; // Toggle timing on/off #help;; // Display help + #help "expr";; // Display documentation for an expression, e.g. #help "List.map";; #clear;; // Clear screen #quit;; // Exit - fsi.h expr;; // Display documentation for an expression, e.g. fsi.h List.map;; F# Interactive command line options: diff --git a/tests/fsharp/core/printing/output.multiemit.stdout.bsl b/tests/fsharp/core/printing/output.multiemit.stdout.bsl index 1b29cb8345f..c64325f060c 100644 --- a/tests/fsharp/core/printing/output.multiemit.stdout.bsl +++ b/tests/fsharp/core/printing/output.multiemit.stdout.bsl @@ -4060,11 +4060,11 @@ type 'a T4063 = | AT4063 of 'a #load "file.fs" ...;; // Load the given file(s) as if compiled and referenced #time ["on"|"off"];; // Toggle timing on/off #help;; // Display help + #help "expr";; // Display documentation for an expression, e.g. #help "List.map";; #r "nuget:FSharp.Data, 3.1.2";; // Load Nuget Package 'FSharp.Data' version '3.1.2' #r "nuget:FSharp.Data";; // Load Nuget Package 'FSharp.Data' with the highest version #clear;; // Clear screen #quit;; // Exit - fsi.h expr;; // Display documentation for an expression, e.g. fsi.h List.map;; F# Interactive command line options: diff --git a/tests/fsharp/core/printing/output.off.stdout.bsl b/tests/fsharp/core/printing/output.off.stdout.bsl index 9dbfc94f3bb..4e40dfb104b 100644 --- a/tests/fsharp/core/printing/output.off.stdout.bsl +++ b/tests/fsharp/core/printing/output.off.stdout.bsl @@ -248,11 +248,11 @@ type 'a T4063 = | AT4063 of 'a #load "file.fs" ...;; // Load the given file(s) as if compiled and referenced #time ["on"|"off"];; // Toggle timing on/off #help;; // Display help + #help "expr";; // Display documentation for an expression, e.g. #help "List.map";; #r "nuget:FSharp.Data, 3.1.2";; // Load Nuget Package 'FSharp.Data' version '3.1.2' #r "nuget:FSharp.Data";; // Load Nuget Package 'FSharp.Data' with the highest version #clear;; // Clear screen #quit;; // Exit - fsi.h expr;; // Display documentation for an expression, e.g. fsi.h List.map;; F# Interactive command line options: diff --git a/tests/fsharp/core/printing/output.stdout.bsl b/tests/fsharp/core/printing/output.stdout.bsl index 1b29cb8345f..c64325f060c 100644 --- a/tests/fsharp/core/printing/output.stdout.bsl +++ b/tests/fsharp/core/printing/output.stdout.bsl @@ -4060,11 +4060,11 @@ type 'a T4063 = | AT4063 of 'a #load "file.fs" ...;; // Load the given file(s) as if compiled and referenced #time ["on"|"off"];; // Toggle timing on/off #help;; // Display help + #help "expr";; // Display documentation for an expression, e.g. #help "List.map";; #r "nuget:FSharp.Data, 3.1.2";; // Load Nuget Package 'FSharp.Data' version '3.1.2' #r "nuget:FSharp.Data";; // Load Nuget Package 'FSharp.Data' with the highest version #clear;; // Clear screen #quit;; // Exit - fsi.h expr;; // Display documentation for an expression, e.g. fsi.h List.map;; F# Interactive command line options: From 9f7fa7a8dbb073dd4994c5200e0fca97b0786f53 Mon Sep 17 00:00:00 2001 From: dawe Date: Thu, 6 Jun 2024 11:51:42 +0200 Subject: [PATCH 26/34] append a newline if we don't find docs to position cursor correctly --- src/Compiler/Interactive/fsihelp.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Compiler/Interactive/fsihelp.fs b/src/Compiler/Interactive/fsihelp.fs index 5936517d5c9..baca58d382a 100644 --- a/src/Compiler/Interactive/fsihelp.fs +++ b/src/Compiler/Interactive/fsihelp.fs @@ -268,5 +268,5 @@ module Logic = let h (expr: Quotations.Expr) = match tryGetHelp expr with - | ValueNone -> "unable to get documentation" + | ValueNone -> "unable to get documentation\n" | ValueSome d -> d.ToDisplayString() From ef5d1a3be2e6471d694aae5099d516b3d0768f8f Mon Sep 17 00:00:00 2001 From: dawe Date: Thu, 6 Jun 2024 11:53:26 +0200 Subject: [PATCH 27/34] format --- src/Compiler/Interactive/fsi.fs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Compiler/Interactive/fsi.fs b/src/Compiler/Interactive/fsi.fs index 8a10575c72a..b6d8f2b99db 100644 --- a/src/Compiler/Interactive/fsi.fs +++ b/src/Compiler/Interactive/fsi.fs @@ -1239,7 +1239,10 @@ type internal FsiCommandLineOptions(fsi: FsiEvaluationSessionHostConfig, argv: s fsiConsoleOutput.uprintfn """ #load "file.fs" ...;; // %s""" (FSIstrings.SR.fsiIntroTextHashloadInfo ()) fsiConsoleOutput.uprintfn """ #time ["on"|"off"];; // %s""" (FSIstrings.SR.fsiIntroTextHashtimeInfo ()) fsiConsoleOutput.uprintfn """ #help;; // %s""" (FSIstrings.SR.fsiIntroTextHashhelpInfo ()) - fsiConsoleOutput.uprintfn """ #help "expr";; // %s""" (FSIstrings.SR.fsiIntroTextHashhelpdocInfo ()) + + fsiConsoleOutput.uprintfn + """ #help "expr";; // %s""" + (FSIstrings.SR.fsiIntroTextHashhelpdocInfo ()) if tcConfigB.langVersion.SupportsFeature(LanguageFeature.PackageManagement) then for msg in From 72071c950e9cf799209cce223bb88f78d7dbf00e Mon Sep 17 00:00:00 2001 From: dawe Date: Thu, 6 Jun 2024 12:18:49 +0200 Subject: [PATCH 28/34] adjust release notes again --- docs/release-notes/.FSharp.Compiler.Service/8.0.400.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/release-notes/.FSharp.Compiler.Service/8.0.400.md b/docs/release-notes/.FSharp.Compiler.Service/8.0.400.md index 39a6259ab55..34b94b5b1a1 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/8.0.400.md +++ b/docs/release-notes/.FSharp.Compiler.Service/8.0.400.md @@ -1,6 +1,6 @@ ### Fixed -* Added `h` member to the `fsi` object to show documentation in the REPL. ([PR #17140](https://github.com/dotnet/fsharp/pull/17140)) +* Extended #help directive in fsi to show documentation in the REPL. ([PR #17140](https://github.com/dotnet/fsharp/pull/17140)) * Fix internal error when dotting into delegates with multiple type parameters. ([PR #17227](https://github.com/dotnet/fsharp/pull/17227)) * Error for partial implementation of interface with static and non-static abstract members. ([Issue #17138](https://github.com/dotnet/fsharp/issues/17138), [PR #17160](https://github.com/dotnet/fsharp/pull/17160)) * Optimize simple mappings with preludes in computed collections. ([PR #17067](https://github.com/dotnet/fsharp/pull/17067)) From 35392f4690a4139f1a9882651a662cf2e8573336 Mon Sep 17 00:00:00 2001 From: dawe Date: Thu, 6 Jun 2024 13:57:38 +0200 Subject: [PATCH 29/34] update surfacearea baselines --- ...ervice.SurfaceArea.netstandard20.debug.bsl | 34 +++++++++++++++++++ ...vice.SurfaceArea.netstandard20.release.bsl | 34 +++++++++++++++++++ 2 files changed, 68 insertions(+) diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl index 909e42e2cdc..447ebd82026 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl @@ -4597,6 +4597,40 @@ FSharp.Compiler.Interactive.CtrlBreakHandlers+CtrlBreakService: Void Interrupt() FSharp.Compiler.Interactive.CtrlBreakHandlers+CtrlBreakService: Void Run() FSharp.Compiler.Interactive.CtrlBreakHandlers: FSharp.Compiler.Interactive.CtrlBreakHandlers+CtrlBreakClient FSharp.Compiler.Interactive.CtrlBreakHandlers: FSharp.Compiler.Interactive.CtrlBreakHandlers+CtrlBreakService +FSharp.Compiler.Interactive.FsiHelp+Logic+Quoted: Microsoft.FSharp.Core.FSharpValueOption`1[FSharp.Compiler.Interactive.FsiHelp+Parser+Help] tryGetHelp(Microsoft.FSharp.Quotations.FSharpExpr) +FSharp.Compiler.Interactive.FsiHelp+Logic+Quoted: System.String h(Microsoft.FSharp.Quotations.FSharpExpr) +FSharp.Compiler.Interactive.FsiHelp+Logic: FSharp.Compiler.Interactive.FsiHelp+Logic+Quoted +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: Boolean Equals(Help) +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: Boolean Equals(Help, System.Collections.IEqualityComparer) +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: Boolean Equals(System.Object) +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: Boolean Equals(System.Object, System.Collections.IEqualityComparer) +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: Int32 CompareTo(Help) +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: Int32 CompareTo(System.Object) +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: Int32 CompareTo(System.Object, System.Collections.IComparer) +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: Int32 GetHashCode() +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: Int32 GetHashCode(System.Collections.IEqualityComparer) +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`2[System.String,System.String]] Examples +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`2[System.String,System.String]] Exceptions +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`2[System.String,System.String]] Parameters +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`2[System.String,System.String]] get_Examples() +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`2[System.String,System.String]] get_Exceptions() +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`2[System.String,System.String]] get_Parameters() +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: Microsoft.FSharp.Core.FSharpOption`1[System.String] Remarks +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: Microsoft.FSharp.Core.FSharpOption`1[System.String] Returns +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: Microsoft.FSharp.Core.FSharpOption`1[System.String] get_Remarks() +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: Microsoft.FSharp.Core.FSharpOption`1[System.String] get_Returns() +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: System.String Assembly +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: System.String FullName +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: System.String Summary +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: System.String ToDisplayString() +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: System.String ToString() +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: System.String get_Assembly() +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: System.String get_FullName() +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: System.String get_Summary() +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: Void .ctor(System.String, Microsoft.FSharp.Core.FSharpOption`1[System.String], Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`2[System.String,System.String]], Microsoft.FSharp.Core.FSharpOption`1[System.String], Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`2[System.String,System.String]], Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`2[System.String,System.String]], System.String, System.String) +FSharp.Compiler.Interactive.FsiHelp+Parser: FSharp.Compiler.Interactive.FsiHelp+Parser+Help +FSharp.Compiler.Interactive.FsiHelp: FSharp.Compiler.Interactive.FsiHelp+Logic +FSharp.Compiler.Interactive.FsiHelp: FSharp.Compiler.Interactive.FsiHelp+Parser FSharp.Compiler.Interactive.Shell+CompilerInputStream: Boolean CanRead FSharp.Compiler.Interactive.Shell+CompilerInputStream: Boolean CanSeek FSharp.Compiler.Interactive.Shell+CompilerInputStream: Boolean CanWrite diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl index 909e42e2cdc..447ebd82026 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl @@ -4597,6 +4597,40 @@ FSharp.Compiler.Interactive.CtrlBreakHandlers+CtrlBreakService: Void Interrupt() FSharp.Compiler.Interactive.CtrlBreakHandlers+CtrlBreakService: Void Run() FSharp.Compiler.Interactive.CtrlBreakHandlers: FSharp.Compiler.Interactive.CtrlBreakHandlers+CtrlBreakClient FSharp.Compiler.Interactive.CtrlBreakHandlers: FSharp.Compiler.Interactive.CtrlBreakHandlers+CtrlBreakService +FSharp.Compiler.Interactive.FsiHelp+Logic+Quoted: Microsoft.FSharp.Core.FSharpValueOption`1[FSharp.Compiler.Interactive.FsiHelp+Parser+Help] tryGetHelp(Microsoft.FSharp.Quotations.FSharpExpr) +FSharp.Compiler.Interactive.FsiHelp+Logic+Quoted: System.String h(Microsoft.FSharp.Quotations.FSharpExpr) +FSharp.Compiler.Interactive.FsiHelp+Logic: FSharp.Compiler.Interactive.FsiHelp+Logic+Quoted +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: Boolean Equals(Help) +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: Boolean Equals(Help, System.Collections.IEqualityComparer) +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: Boolean Equals(System.Object) +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: Boolean Equals(System.Object, System.Collections.IEqualityComparer) +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: Int32 CompareTo(Help) +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: Int32 CompareTo(System.Object) +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: Int32 CompareTo(System.Object, System.Collections.IComparer) +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: Int32 GetHashCode() +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: Int32 GetHashCode(System.Collections.IEqualityComparer) +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`2[System.String,System.String]] Examples +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`2[System.String,System.String]] Exceptions +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`2[System.String,System.String]] Parameters +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`2[System.String,System.String]] get_Examples() +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`2[System.String,System.String]] get_Exceptions() +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`2[System.String,System.String]] get_Parameters() +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: Microsoft.FSharp.Core.FSharpOption`1[System.String] Remarks +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: Microsoft.FSharp.Core.FSharpOption`1[System.String] Returns +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: Microsoft.FSharp.Core.FSharpOption`1[System.String] get_Remarks() +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: Microsoft.FSharp.Core.FSharpOption`1[System.String] get_Returns() +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: System.String Assembly +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: System.String FullName +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: System.String Summary +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: System.String ToDisplayString() +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: System.String ToString() +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: System.String get_Assembly() +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: System.String get_FullName() +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: System.String get_Summary() +FSharp.Compiler.Interactive.FsiHelp+Parser+Help: Void .ctor(System.String, Microsoft.FSharp.Core.FSharpOption`1[System.String], Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`2[System.String,System.String]], Microsoft.FSharp.Core.FSharpOption`1[System.String], Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`2[System.String,System.String]], Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`2[System.String,System.String]], System.String, System.String) +FSharp.Compiler.Interactive.FsiHelp+Parser: FSharp.Compiler.Interactive.FsiHelp+Parser+Help +FSharp.Compiler.Interactive.FsiHelp: FSharp.Compiler.Interactive.FsiHelp+Logic +FSharp.Compiler.Interactive.FsiHelp: FSharp.Compiler.Interactive.FsiHelp+Parser FSharp.Compiler.Interactive.Shell+CompilerInputStream: Boolean CanRead FSharp.Compiler.Interactive.Shell+CompilerInputStream: Boolean CanSeek FSharp.Compiler.Interactive.Shell+CompilerInputStream: Boolean CanWrite From e12ae7f11dccde179b5672016b4a06e08eec53cd Mon Sep 17 00:00:00 2001 From: dawe Date: Mon, 10 Jun 2024 23:25:56 +0200 Subject: [PATCH 30/34] adjust help text to use "identifier" instead of "expression" --- src/Compiler/Interactive/FSIstrings.txt | 2 +- src/Compiler/Interactive/fsi.fs | 2 +- src/Compiler/Interactive/xlf/FSIstrings.txt.cs.xlf | 4 ++-- src/Compiler/Interactive/xlf/FSIstrings.txt.de.xlf | 4 ++-- src/Compiler/Interactive/xlf/FSIstrings.txt.es.xlf | 4 ++-- src/Compiler/Interactive/xlf/FSIstrings.txt.fr.xlf | 4 ++-- src/Compiler/Interactive/xlf/FSIstrings.txt.it.xlf | 4 ++-- src/Compiler/Interactive/xlf/FSIstrings.txt.ja.xlf | 4 ++-- src/Compiler/Interactive/xlf/FSIstrings.txt.ko.xlf | 4 ++-- src/Compiler/Interactive/xlf/FSIstrings.txt.pl.xlf | 4 ++-- src/Compiler/Interactive/xlf/FSIstrings.txt.pt-BR.xlf | 4 ++-- src/Compiler/Interactive/xlf/FSIstrings.txt.ru.xlf | 4 ++-- src/Compiler/Interactive/xlf/FSIstrings.txt.tr.xlf | 4 ++-- src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hans.xlf | 4 ++-- src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hant.xlf | 4 ++-- .../DependencyManagerInteractiveTests.fs | 4 ++-- tests/fsharp/core/printing/output.1000.stdout.bsl | 2 +- tests/fsharp/core/printing/output.200.stdout.bsl | 2 +- tests/fsharp/core/printing/output.47.stdout.bsl | 2 +- tests/fsharp/core/printing/output.multiemit.stdout.bsl | 2 +- tests/fsharp/core/printing/output.off.stdout.bsl | 2 +- tests/fsharp/core/printing/output.stdout.bsl | 2 +- 22 files changed, 36 insertions(+), 36 deletions(-) diff --git a/src/Compiler/Interactive/FSIstrings.txt b/src/Compiler/Interactive/FSIstrings.txt index 8f68ceb1cee..b415dda8af1 100644 --- a/src/Compiler/Interactive/FSIstrings.txt +++ b/src/Compiler/Interactive/FSIstrings.txt @@ -32,7 +32,7 @@ fsiIntroPackageSourceUriInfo,"Include package source uri when searching for pack fsiIntroTextHashloadInfo,"Load the given file(s) as if compiled and referenced" fsiIntroTextHashtimeInfo,"Toggle timing on/off" fsiIntroTextHashhelpInfo,"Display help" -fsiIntroTextHashhelpdocInfo,"Display documentation for an expression, e.g. #help \"List.map\";;" +fsiIntroTextHashhelpdocInfo,"Display documentation for an identifier, e.g. #help \"List.map\";;" fsiIntroTextHashquitInfo,"Exit" fsiIntroTextHashclearInfo,"Clear screen" fsiIntroTextHeader2commandLine," F# Interactive command line options:" diff --git a/src/Compiler/Interactive/fsi.fs b/src/Compiler/Interactive/fsi.fs index b6d8f2b99db..569ba4790b8 100644 --- a/src/Compiler/Interactive/fsi.fs +++ b/src/Compiler/Interactive/fsi.fs @@ -1241,7 +1241,7 @@ type internal FsiCommandLineOptions(fsi: FsiEvaluationSessionHostConfig, argv: s fsiConsoleOutput.uprintfn """ #help;; // %s""" (FSIstrings.SR.fsiIntroTextHashhelpInfo ()) fsiConsoleOutput.uprintfn - """ #help "expr";; // %s""" + """ #help "idn";; // %s""" (FSIstrings.SR.fsiIntroTextHashhelpdocInfo ()) if tcConfigB.langVersion.SupportsFeature(LanguageFeature.PackageManagement) then diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.cs.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.cs.xlf index 5e5030207cc..9146a0d2aa0 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.cs.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.cs.xlf @@ -18,8 +18,8 @@ - Display documentation for an expression, e.g. #help \"List.map\";; - Display documentation for an expression, e.g. #help \"List.map\";; + Display documentation for an identifier, e.g. #help \"List.map\";; + Display documentation for an identifier, e.g. #help \"List.map\";; diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.de.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.de.xlf index 2dbdee27284..ba8a2a310cb 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.de.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.de.xlf @@ -18,8 +18,8 @@ - Display documentation for an expression, e.g. #help \"List.map\";; - Display documentation for an expression, e.g. #help \"List.map\";; + Display documentation for an identifier, e.g. #help \"List.map\";; + Display documentation for an identifier, e.g. #help \"List.map\";; diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.es.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.es.xlf index a8ae9219964..f499bc3eafa 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.es.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.es.xlf @@ -18,8 +18,8 @@ - Display documentation for an expression, e.g. #help \"List.map\";; - Display documentation for an expression, e.g. #help \"List.map\";; + Display documentation for an identifier, e.g. #help \"List.map\";; + Display documentation for an identifier, e.g. #help \"List.map\";; diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.fr.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.fr.xlf index e61cccf500b..816e9ff898f 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.fr.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.fr.xlf @@ -18,8 +18,8 @@ - Display documentation for an expression, e.g. #help \"List.map\";; - Display documentation for an expression, e.g. #help \"List.map\";; + Display documentation for an identifier, e.g. #help \"List.map\";; + Display documentation for an identifier, e.g. #help \"List.map\";; diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.it.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.it.xlf index 64026adc5c1..93fa31ffda4 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.it.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.it.xlf @@ -18,8 +18,8 @@ - Display documentation for an expression, e.g. #help \"List.map\";; - Display documentation for an expression, e.g. #help \"List.map\";; + Display documentation for an identifier, e.g. #help \"List.map\";; + Display documentation for an identifier, e.g. #help \"List.map\";; diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.ja.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.ja.xlf index eea774992b7..316b88cfd0d 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.ja.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.ja.xlf @@ -18,8 +18,8 @@ - Display documentation for an expression, e.g. #help \"List.map\";; - Display documentation for an expression, e.g. #help \"List.map\";; + Display documentation for an identifier, e.g. #help \"List.map\";; + Display documentation for an identifier, e.g. #help \"List.map\";; diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.ko.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.ko.xlf index 7c46a574380..e577610033a 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.ko.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.ko.xlf @@ -18,8 +18,8 @@ - Display documentation for an expression, e.g. #help \"List.map\";; - Display documentation for an expression, e.g. #help \"List.map\";; + Display documentation for an identifier, e.g. #help \"List.map\";; + Display documentation for an identifier, e.g. #help \"List.map\";; diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.pl.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.pl.xlf index 66bb91059c7..b1b3cd575f0 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.pl.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.pl.xlf @@ -18,8 +18,8 @@ - Display documentation for an expression, e.g. #help \"List.map\";; - Display documentation for an expression, e.g. #help \"List.map\";; + Display documentation for an identifier, e.g. #help \"List.map\";; + Display documentation for an identifier, e.g. #help \"List.map\";; diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.pt-BR.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.pt-BR.xlf index 6ddb328eeed..d6607b63a13 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.pt-BR.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.pt-BR.xlf @@ -18,8 +18,8 @@ - Display documentation for an expression, e.g. #help \"List.map\";; - Display documentation for an expression, e.g. #help \"List.map\";; + Display documentation for an identifier, e.g. #help \"List.map\";; + Display documentation for an identifier, e.g. #help \"List.map\";; diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.ru.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.ru.xlf index 9932617833e..62ba1c091a2 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.ru.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.ru.xlf @@ -18,8 +18,8 @@ - Display documentation for an expression, e.g. #help \"List.map\";; - Display documentation for an expression, e.g. #help \"List.map\";; + Display documentation for an identifier, e.g. #help \"List.map\";; + Display documentation for an identifier, e.g. #help \"List.map\";; diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.tr.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.tr.xlf index 02afa4d46e6..d1d67300f2c 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.tr.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.tr.xlf @@ -18,8 +18,8 @@ - Display documentation for an expression, e.g. #help \"List.map\";; - Display documentation for an expression, e.g. #help \"List.map\";; + Display documentation for an identifier, e.g. #help \"List.map\";; + Display documentation for an identifier, e.g. #help \"List.map\";; diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hans.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hans.xlf index 1142b504ab4..1657fe4f304 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hans.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hans.xlf @@ -18,8 +18,8 @@ - Display documentation for an expression, e.g. #help \"List.map\";; - Display documentation for an expression, e.g. #help \"List.map\";; + Display documentation for an identifier, e.g. #help \"List.map\";; + Display documentation for an identifier, e.g. #help \"List.map\";; diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hant.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hant.xlf index 181a74509c3..0950c95bcee 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hant.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hant.xlf @@ -18,8 +18,8 @@ - Display documentation for an expression, e.g. #help \"List.map\";; - Display documentation for an expression, e.g. #help \"List.map\";; + Display documentation for an identifier, e.g. #help \"List.map\";; + Display documentation for an identifier, e.g. #help \"List.map\";; diff --git a/tests/FSharp.Compiler.Private.Scripting.UnitTests/DependencyManagerInteractiveTests.fs b/tests/FSharp.Compiler.Private.Scripting.UnitTests/DependencyManagerInteractiveTests.fs index 08c246637de..19c3009b17a 100644 --- a/tests/FSharp.Compiler.Private.Scripting.UnitTests/DependencyManagerInteractiveTests.fs +++ b/tests/FSharp.Compiler.Private.Scripting.UnitTests/DependencyManagerInteractiveTests.fs @@ -719,7 +719,7 @@ x |> Seq.iter(fun r -> """ #time ["on"|"off"];; // Toggle timing on/off""" """ #clear;; // Clear screen""" """ #help;; // Display help""" - """ #help "expr";; // Display documentation for an expression, e.g. #help "List.map";;""" + """ #help "idn";; // Display documentation for an identifier, e.g. #help "List.map";;""" """ #quit;; // Exit""" """""" """ F# Interactive command line options:""" @@ -767,7 +767,7 @@ x |> Seq.iter(fun r -> """ #load "file.fs" ...;; // Load the given file(s) as if compiled and referenced""" """ #time ["on"|"off"];; // Toggle timing on/off""" """ #help;; // Display help""" - """ #help "expr";; // Display documentation for an expression, e.g. #help "List.map";;""" + """ #help "idn";; // Display documentation for an identifier, e.g. #help "List.map";;""" """ #r "nuget:FSharp.Data, 3.1.2";; // Load Nuget Package 'FSharp.Data' version '3.1.2'""" """ #r "nuget:FSharp.Data";; // Load Nuget Package 'FSharp.Data' with the highest version""" """ #clear;; // Clear screen""" diff --git a/tests/fsharp/core/printing/output.1000.stdout.bsl b/tests/fsharp/core/printing/output.1000.stdout.bsl index 7f49d3589e4..784a4dc6ebc 100644 --- a/tests/fsharp/core/printing/output.1000.stdout.bsl +++ b/tests/fsharp/core/printing/output.1000.stdout.bsl @@ -1101,7 +1101,7 @@ type 'a T4063 = | AT4063 of 'a #load "file.fs" ...;; // Load the given file(s) as if compiled and referenced #time ["on"|"off"];; // Toggle timing on/off #help;; // Display help - #help "expr";; // Display documentation for an expression, e.g. #help "List.map";; + #help "idn";; // Display documentation for an identifier, e.g. #help "List.map";; #r "nuget:FSharp.Data, 3.1.2";; // Load Nuget Package 'FSharp.Data' version '3.1.2' #r "nuget:FSharp.Data";; // Load Nuget Package 'FSharp.Data' with the highest version #clear;; // Clear screen diff --git a/tests/fsharp/core/printing/output.200.stdout.bsl b/tests/fsharp/core/printing/output.200.stdout.bsl index 9d72b06bd00..f55f079eb58 100644 --- a/tests/fsharp/core/printing/output.200.stdout.bsl +++ b/tests/fsharp/core/printing/output.200.stdout.bsl @@ -421,7 +421,7 @@ type 'a T4063 = | AT4063 of 'a #load "file.fs" ...;; // Load the given file(s) as if compiled and referenced #time ["on"|"off"];; // Toggle timing on/off #help;; // Display help - #help "expr";; // Display documentation for an expression, e.g. #help "List.map";; + #help "idn";; // Display documentation for an identifier, e.g. #help "List.map";; #r "nuget:FSharp.Data, 3.1.2";; // Load Nuget Package 'FSharp.Data' version '3.1.2' #r "nuget:FSharp.Data";; // Load Nuget Package 'FSharp.Data' with the highest version #clear;; // Clear screen diff --git a/tests/fsharp/core/printing/output.47.stdout.bsl b/tests/fsharp/core/printing/output.47.stdout.bsl index 4f74411842a..71d343fd912 100644 --- a/tests/fsharp/core/printing/output.47.stdout.bsl +++ b/tests/fsharp/core/printing/output.47.stdout.bsl @@ -4060,7 +4060,7 @@ type 'a T4063 = | AT4063 of 'a #load "file.fs" ...;; // Load the given file(s) as if compiled and referenced #time ["on"|"off"];; // Toggle timing on/off #help;; // Display help - #help "expr";; // Display documentation for an expression, e.g. #help "List.map";; + #help "idn";; // Display documentation for an identifier, e.g. #help "List.map";; #clear;; // Clear screen #quit;; // Exit diff --git a/tests/fsharp/core/printing/output.multiemit.stdout.bsl b/tests/fsharp/core/printing/output.multiemit.stdout.bsl index c64325f060c..53e9706c4b7 100644 --- a/tests/fsharp/core/printing/output.multiemit.stdout.bsl +++ b/tests/fsharp/core/printing/output.multiemit.stdout.bsl @@ -4060,7 +4060,7 @@ type 'a T4063 = | AT4063 of 'a #load "file.fs" ...;; // Load the given file(s) as if compiled and referenced #time ["on"|"off"];; // Toggle timing on/off #help;; // Display help - #help "expr";; // Display documentation for an expression, e.g. #help "List.map";; + #help "idn";; // Display documentation for an identifier, e.g. #help "List.map";; #r "nuget:FSharp.Data, 3.1.2";; // Load Nuget Package 'FSharp.Data' version '3.1.2' #r "nuget:FSharp.Data";; // Load Nuget Package 'FSharp.Data' with the highest version #clear;; // Clear screen diff --git a/tests/fsharp/core/printing/output.off.stdout.bsl b/tests/fsharp/core/printing/output.off.stdout.bsl index 4e40dfb104b..d9cc13b5e15 100644 --- a/tests/fsharp/core/printing/output.off.stdout.bsl +++ b/tests/fsharp/core/printing/output.off.stdout.bsl @@ -248,7 +248,7 @@ type 'a T4063 = | AT4063 of 'a #load "file.fs" ...;; // Load the given file(s) as if compiled and referenced #time ["on"|"off"];; // Toggle timing on/off #help;; // Display help - #help "expr";; // Display documentation for an expression, e.g. #help "List.map";; + #help "idn";; // Display documentation for an identifier, e.g. #help "List.map";; #r "nuget:FSharp.Data, 3.1.2";; // Load Nuget Package 'FSharp.Data' version '3.1.2' #r "nuget:FSharp.Data";; // Load Nuget Package 'FSharp.Data' with the highest version #clear;; // Clear screen diff --git a/tests/fsharp/core/printing/output.stdout.bsl b/tests/fsharp/core/printing/output.stdout.bsl index c64325f060c..53e9706c4b7 100644 --- a/tests/fsharp/core/printing/output.stdout.bsl +++ b/tests/fsharp/core/printing/output.stdout.bsl @@ -4060,7 +4060,7 @@ type 'a T4063 = | AT4063 of 'a #load "file.fs" ...;; // Load the given file(s) as if compiled and referenced #time ["on"|"off"];; // Toggle timing on/off #help;; // Display help - #help "expr";; // Display documentation for an expression, e.g. #help "List.map";; + #help "idn";; // Display documentation for an identifier, e.g. #help "List.map";; #r "nuget:FSharp.Data, 3.1.2";; // Load Nuget Package 'FSharp.Data' version '3.1.2' #r "nuget:FSharp.Data";; // Load Nuget Package 'FSharp.Data' with the highest version #clear;; // Clear screen From 6894681463ebdef241807e4a20c8d0a27af8653f Mon Sep 17 00:00:00 2001 From: dawe Date: Tue, 11 Jun 2024 23:20:36 +0200 Subject: [PATCH 31/34] add unit test for non-identifier to show unhappy path --- tests/FSharp.Compiler.Service.Tests/FsiHelpTests.fs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/FSharp.Compiler.Service.Tests/FsiHelpTests.fs b/tests/FSharp.Compiler.Service.Tests/FsiHelpTests.fs index 7364a89f94d..d17b3421ed9 100644 --- a/tests/FSharp.Compiler.Service.Tests/FsiHelpTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/FsiHelpTests.fs @@ -46,3 +46,9 @@ module FsiHelpTests = h.FullName |> shouldBe "FSharp.Test.ReflectionHelper.shouldn't" Assert.StartsWith("Assert that function f ", h.Summary) | ValueNone -> Assert.True(false, "No xml documentation found") + + [] + let ``Can't get help for non-identifier`` () = + match FSharp.Compiler.Interactive.FsiHelp.Logic.Quoted.tryGetHelp <@ 23 @> with + | ValueSome h -> Assert.True(false, "No xml documentation expected") + | ValueNone -> () From c13ca6774d88db5f7dd5db28e89e2dece430727c Mon Sep 17 00:00:00 2001 From: dawe Date: Tue, 11 Jun 2024 23:21:03 +0200 Subject: [PATCH 32/34] add bsl entries for help output inside of fsi --- .../core/printing/output.1000.stdout.bsl | 21 +++++++++++++++++++ .../core/printing/output.200.stdout.bsl | 21 +++++++++++++++++++ .../fsharp/core/printing/output.47.stdout.bsl | 21 +++++++++++++++++++ .../core/printing/output.multiemit.stdout.bsl | 21 +++++++++++++++++++ .../core/printing/output.off.stdout.bsl | 21 +++++++++++++++++++ tests/fsharp/core/printing/output.stdout.bsl | 21 +++++++++++++++++++ tests/fsharp/core/printing/test.fsx | 2 ++ 7 files changed, 128 insertions(+) diff --git a/tests/fsharp/core/printing/output.1000.stdout.bsl b/tests/fsharp/core/printing/output.1000.stdout.bsl index 784a4dc6ebc..d948e0aa1b1 100644 --- a/tests/fsharp/core/printing/output.1000.stdout.bsl +++ b/tests/fsharp/core/printing/output.1000.stdout.bsl @@ -1111,6 +1111,27 @@ type 'a T4063 = | AT4063 of 'a +> val it: string = "Check #help for an identifier" + + +Description: +Builds a new collection whose elements are the results of applying the given function +to each of the elements of the collection. + +Parameters: +- mapping: The function to transform elements from the input list. +- list: The input list. +Returns: +The list of transformed elements. + +Examples: +let inputs = [ "a"; "bbb"; "cc" ] + +inputs |> List.map (fun x -> x.Length) +// Evaluates to [ 1; 3; 2 ] + +Full name: Microsoft.FSharp.Collections.ListModule.map +Assembly: FSharp.Core.dll > val it: string = "Check #time on and then off" > diff --git a/tests/fsharp/core/printing/output.200.stdout.bsl b/tests/fsharp/core/printing/output.200.stdout.bsl index f55f079eb58..f41c5b473c3 100644 --- a/tests/fsharp/core/printing/output.200.stdout.bsl +++ b/tests/fsharp/core/printing/output.200.stdout.bsl @@ -431,6 +431,27 @@ type 'a T4063 = | AT4063 of 'a +> val it: string = "Check #help for an identifier" + + +Description: +Builds a new collection whose elements are the results of applying the given function +to each of the elements of the collection. + +Parameters: +- mapping: The function to transform elements from the input list. +- list: The input list. +Returns: +The list of transformed elements. + +Examples: +let inputs = [ "a"; "bbb"; "cc" ] + +inputs |> List.map (fun x -> x.Length) +// Evaluates to [ 1; 3; 2 ] + +Full name: Microsoft.FSharp.Collections.ListModule.map +Assembly: FSharp.Core.dll > val it: string = "Check #time on and then off" > diff --git a/tests/fsharp/core/printing/output.47.stdout.bsl b/tests/fsharp/core/printing/output.47.stdout.bsl index 71d343fd912..e9c53795b12 100644 --- a/tests/fsharp/core/printing/output.47.stdout.bsl +++ b/tests/fsharp/core/printing/output.47.stdout.bsl @@ -4068,6 +4068,27 @@ type 'a T4063 = | AT4063 of 'a +> val it: string = "Check #help for an identifier" + + +Description: +Builds a new collection whose elements are the results of applying the given function +to each of the elements of the collection. + +Parameters: +- mapping: The function to transform elements from the input list. +- list: The input list. +Returns: +The list of transformed elements. + +Examples: +let inputs = [ "a"; "bbb"; "cc" ] + +inputs |> List.map (fun x -> x.Length) +// Evaluates to [ 1; 3; 2 ] + +Full name: Microsoft.FSharp.Collections.ListModule.map +Assembly: FSharp.Core.dll > val it: string = "Check #time on and then off" > diff --git a/tests/fsharp/core/printing/output.multiemit.stdout.bsl b/tests/fsharp/core/printing/output.multiemit.stdout.bsl index 53e9706c4b7..3d258a63b74 100644 --- a/tests/fsharp/core/printing/output.multiemit.stdout.bsl +++ b/tests/fsharp/core/printing/output.multiemit.stdout.bsl @@ -4070,6 +4070,27 @@ type 'a T4063 = | AT4063 of 'a +> val it: string = "Check #help for an identifier" + + +Description: +Builds a new collection whose elements are the results of applying the given function +to each of the elements of the collection. + +Parameters: +- mapping: The function to transform elements from the input list. +- list: The input list. +Returns: +The list of transformed elements. + +Examples: +let inputs = [ "a"; "bbb"; "cc" ] + +inputs |> List.map (fun x -> x.Length) +// Evaluates to [ 1; 3; 2 ] + +Full name: Microsoft.FSharp.Collections.ListModule.map +Assembly: FSharp.Core.dll > val it: string = "Check #time on and then off" > diff --git a/tests/fsharp/core/printing/output.off.stdout.bsl b/tests/fsharp/core/printing/output.off.stdout.bsl index d9cc13b5e15..f29095bd7fd 100644 --- a/tests/fsharp/core/printing/output.off.stdout.bsl +++ b/tests/fsharp/core/printing/output.off.stdout.bsl @@ -258,6 +258,27 @@ type 'a T4063 = | AT4063 of 'a +> val it: string = "Check #help for an identifier" + + +Description: +Builds a new collection whose elements are the results of applying the given function +to each of the elements of the collection. + +Parameters: +- mapping: The function to transform elements from the input list. +- list: The input list. +Returns: +The list of transformed elements. + +Examples: +let inputs = [ "a"; "bbb"; "cc" ] + +inputs |> List.map (fun x -> x.Length) +// Evaluates to [ 1; 3; 2 ] + +Full name: Microsoft.FSharp.Collections.ListModule.map +Assembly: FSharp.Core.dll > val it: string = "Check #time on and then off" > diff --git a/tests/fsharp/core/printing/output.stdout.bsl b/tests/fsharp/core/printing/output.stdout.bsl index 53e9706c4b7..3d258a63b74 100644 --- a/tests/fsharp/core/printing/output.stdout.bsl +++ b/tests/fsharp/core/printing/output.stdout.bsl @@ -4070,6 +4070,27 @@ type 'a T4063 = | AT4063 of 'a +> val it: string = "Check #help for an identifier" + + +Description: +Builds a new collection whose elements are the results of applying the given function +to each of the elements of the collection. + +Parameters: +- mapping: The function to transform elements from the input list. +- list: The input list. +Returns: +The list of transformed elements. + +Examples: +let inputs = [ "a"; "bbb"; "cc" ] + +inputs |> List.map (fun x -> x.Length) +// Evaluates to [ 1; 3; 2 ] + +Full name: Microsoft.FSharp.Collections.ListModule.map +Assembly: FSharp.Core.dll > val it: string = "Check #time on and then off" > diff --git a/tests/fsharp/core/printing/test.fsx b/tests/fsharp/core/printing/test.fsx index c0943540b49..02e6de789a6 100644 --- a/tests/fsharp/core/printing/test.fsx +++ b/tests/fsharp/core/printing/test.fsx @@ -211,6 +211,8 @@ module RepeatedModule = begin let repeatedByteLiteral = [| 12uy; 13uy; 14uy |] e (* Regressions for standard responses... *) "Check #help";; #help;; +"Check #help for an identifier" +#help "List.map";; "Check #time on and then off";; #time;; (* time on *) (* no eval in between, since time can vary and look like a regression *) From 29b3ad6ae26dfd9502966dd3af77fb5fcedee236 Mon Sep 17 00:00:00 2001 From: dawe Date: Wed, 12 Jun 2024 08:56:29 +0200 Subject: [PATCH 33/34] update line numbers in bsl files --- tests/fsharp/core/printing/output.1000.stdout.bsl | 14 +++++++------- tests/fsharp/core/printing/output.200.stdout.bsl | 14 +++++++------- tests/fsharp/core/printing/output.47.stdout.bsl | 10 +++++----- .../core/printing/output.multiemit.stdout.bsl | 14 +++++++------- tests/fsharp/core/printing/output.off.stdout.bsl | 4 ++-- tests/fsharp/core/printing/output.stdout.bsl | 14 +++++++------- 6 files changed, 35 insertions(+), 35 deletions(-) diff --git a/tests/fsharp/core/printing/output.1000.stdout.bsl b/tests/fsharp/core/printing/output.1000.stdout.bsl index d948e0aa1b1..f780a746484 100644 --- a/tests/fsharp/core/printing/output.1000.stdout.bsl +++ b/tests/fsharp/core/printing/output.1000.stdout.bsl @@ -1516,8 +1516,8 @@ module Test4343e = val cA: C val cB: C val cAB: C * C * C list = - (FSI_0091+Test4343e+C, FSI_0091+Test4343e+C, - [FSI_0091+Test4343e+C; FSI_0091+Test4343e+C]) + (FSI_0093+Test4343e+C, FSI_0093+Test4343e+C, + [FSI_0093+Test4343e+C; FSI_0093+Test4343e+C]) type D = new: x: int -> D override ToString: unit -> string @@ -1530,8 +1530,8 @@ module Test4343e = val cA: C val cB: C val cAB: C * C * C list = - (FSI_0091+Test4343e+C, FSI_0091+Test4343e+C, - [FSI_0091+Test4343e+C; FSI_0091+Test4343e+C]) + (FSI_0093+Test4343e+C, FSI_0093+Test4343e+C, + [FSI_0093+Test4343e+C; FSI_0093+Test4343e+C]) type D<'a> = new: x: 'a -> D<'a> override ToString: unit -> string @@ -1706,7 +1706,7 @@ module Regression5218 = type Regression4469 = new: unit -> Regression4469 member ToString: unit -> string -val r4469: Regression4469 = FSI_0107+Regression4469 +val r4469: Regression4469 = FSI_0109+Regression4469 val it: unit = () > Expect ABC = ABC @@ -2786,7 +2786,7 @@ val ShortName: string = "hi" > val list2: int list = [1] -module FSI_0317. +module FSI_0319. A8a951db8294f99e95ae1d276a7ddaefd93d1548e6bf749bdeae55d2649682b3 {"ImmutableField0":6} @@ -2808,7 +2808,7 @@ val it: unit = () > val it: {| AnonRecordField2: int |} = { AnonRecordField2 = 11 } -module FSI_0324.Project.fsproj +module FSI_0326.Project.fsproj type R3 = { ImmutableField3: int } diff --git a/tests/fsharp/core/printing/output.200.stdout.bsl b/tests/fsharp/core/printing/output.200.stdout.bsl index f41c5b473c3..fdf12045d2d 100644 --- a/tests/fsharp/core/printing/output.200.stdout.bsl +++ b/tests/fsharp/core/printing/output.200.stdout.bsl @@ -761,8 +761,8 @@ module Test4343e = val cA: C val cB: C val cAB: C * C * C list = - (FSI_0091+Test4343e+C, FSI_0091+Test4343e+C, - [FSI_0091+Test4343e+C; FSI_0091+Test4343e+C]) + (FSI_0093+Test4343e+C, FSI_0093+Test4343e+C, + [FSI_0093+Test4343e+C; FSI_0093+Test4343e+C]) type D = new: x: int -> D override ToString: unit -> string @@ -775,8 +775,8 @@ module Test4343e = val cA: C val cB: C val cAB: C * C * C list = - (FSI_0091+Test4343e+C, FSI_0091+Test4343e+C, - [FSI_0091+Test4343e+C; FSI_0091+Test4343e+C]) + (FSI_0093+Test4343e+C, FSI_0093+Test4343e+C, + [FSI_0093+Test4343e+C; FSI_0093+Test4343e+C]) type D<'a> = new: x: 'a -> D<'a> override ToString: unit -> string @@ -951,7 +951,7 @@ module Regression5218 = type Regression4469 = new: unit -> Regression4469 member ToString: unit -> string -val r4469: Regression4469 = FSI_0107+Regression4469 +val r4469: Regression4469 = FSI_0109+Regression4469 val it: unit = () > Expect ABC = ABC @@ -2031,7 +2031,7 @@ val ShortName: string = "hi" > val list2: int list = [1] -module FSI_0317. +module FSI_0319. A8a951db8294f99e95ae1d276a7ddaefd93d1548e6bf749bdeae55d2649682b3 {"ImmutableField0":6} @@ -2053,7 +2053,7 @@ val it: unit = () > val it: {| AnonRecordField2: int |} = { AnonRecordField2 = 11 } -module FSI_0324.Project.fsproj +module FSI_0326.Project.fsproj type R3 = { ImmutableField3: int } diff --git a/tests/fsharp/core/printing/output.47.stdout.bsl b/tests/fsharp/core/printing/output.47.stdout.bsl index e9c53795b12..088a6f21e4e 100644 --- a/tests/fsharp/core/printing/output.47.stdout.bsl +++ b/tests/fsharp/core/printing/output.47.stdout.bsl @@ -5061,8 +5061,8 @@ module Test4343e = val cA: C val cB: C val cAB: C * C * C list = - (FSI_0090+Test4343e+C, FSI_0090+Test4343e+C, - [FSI_0090+Test4343e+C; FSI_0090+Test4343e+C]) + (FSI_0092+Test4343e+C, FSI_0092+Test4343e+C, + [FSI_0092+Test4343e+C; FSI_0092+Test4343e+C]) type D = new: x: int -> D override ToString: unit -> string @@ -5075,8 +5075,8 @@ module Test4343e = val cA: C val cB: C val cAB: C * C * C list = - (FSI_0090+Test4343e+C, FSI_0090+Test4343e+C, - [FSI_0090+Test4343e+C; FSI_0090+Test4343e+C]) + (FSI_0092+Test4343e+C, FSI_0092+Test4343e+C, + [FSI_0092+Test4343e+C; FSI_0092+Test4343e+C]) type D<'a> = new: x: 'a -> D<'a> override ToString: unit -> string @@ -5251,7 +5251,7 @@ module Regression5218 = type Regression4469 = new: unit -> Regression4469 member ToString: unit -> string -val r4469: Regression4469 = FSI_0106+Regression4469 +val r4469: Regression4469 = FSI_0108+Regression4469 val it: unit = () > Expect ABC = ABC diff --git a/tests/fsharp/core/printing/output.multiemit.stdout.bsl b/tests/fsharp/core/printing/output.multiemit.stdout.bsl index 3d258a63b74..b2af7d4f2dc 100644 --- a/tests/fsharp/core/printing/output.multiemit.stdout.bsl +++ b/tests/fsharp/core/printing/output.multiemit.stdout.bsl @@ -5063,8 +5063,8 @@ module Test4343e = val cA: C val cB: C val cAB: C * C * C list = - (FSI_0090+Test4343e+C, FSI_0090+Test4343e+C, - [FSI_0090+Test4343e+C; FSI_0090+Test4343e+C]) + (FSI_0092+Test4343e+C, FSI_0092+Test4343e+C, + [FSI_0092+Test4343e+C; FSI_0092+Test4343e+C]) type D = new: x: int -> D override ToString: unit -> string @@ -5077,8 +5077,8 @@ module Test4343e = val cA: C val cB: C val cAB: C * C * C list = - (FSI_0090+Test4343e+C, FSI_0090+Test4343e+C, - [FSI_0090+Test4343e+C; FSI_0090+Test4343e+C]) + (FSI_0092+Test4343e+C, FSI_0092+Test4343e+C, + [FSI_0092+Test4343e+C; FSI_0092+Test4343e+C]) type D<'a> = new: x: 'a -> D<'a> override ToString: unit -> string @@ -5253,7 +5253,7 @@ module Regression5218 = type Regression4469 = new: unit -> Regression4469 member ToString: unit -> string -val r4469: Regression4469 = FSI_0106+Regression4469 +val r4469: Regression4469 = FSI_0108+Regression4469 val it: unit = () > Expect ABC = ABC @@ -6333,7 +6333,7 @@ val ShortName: string = "hi" > val list2: int list = [1] -module FSI_0316. +module FSI_0318. A8a951db8294f99e95ae1d276a7ddaefd93d1548e6bf749bdeae55d2649682b3 {"ImmutableField0":6} @@ -6355,7 +6355,7 @@ val it: unit = () > val it: {| AnonRecordField2: int |} = { AnonRecordField2 = 11 } -module FSI_0323.Project.fsproj +module FSI_0325.Project.fsproj type R3 = { ImmutableField3: int } diff --git a/tests/fsharp/core/printing/output.off.stdout.bsl b/tests/fsharp/core/printing/output.off.stdout.bsl index f29095bd7fd..56edaec8d22 100644 --- a/tests/fsharp/core/printing/output.off.stdout.bsl +++ b/tests/fsharp/core/printing/output.off.stdout.bsl @@ -1800,7 +1800,7 @@ val ShortName: string = "hi" > val list2: int list -module FSI_0317. +module FSI_0319. A8a951db8294f99e95ae1d276a7ddaefd93d1548e6bf749bdeae55d2649682b3 {"ImmutableField0":6} @@ -1822,7 +1822,7 @@ val it: unit = () > val it: {| AnonRecordField2: int |} = { AnonRecordField2 = 11 } -module FSI_0324.Project.fsproj +module FSI_0326.Project.fsproj type R3 = { ImmutableField3: int } diff --git a/tests/fsharp/core/printing/output.stdout.bsl b/tests/fsharp/core/printing/output.stdout.bsl index 3d258a63b74..b2af7d4f2dc 100644 --- a/tests/fsharp/core/printing/output.stdout.bsl +++ b/tests/fsharp/core/printing/output.stdout.bsl @@ -5063,8 +5063,8 @@ module Test4343e = val cA: C val cB: C val cAB: C * C * C list = - (FSI_0090+Test4343e+C, FSI_0090+Test4343e+C, - [FSI_0090+Test4343e+C; FSI_0090+Test4343e+C]) + (FSI_0092+Test4343e+C, FSI_0092+Test4343e+C, + [FSI_0092+Test4343e+C; FSI_0092+Test4343e+C]) type D = new: x: int -> D override ToString: unit -> string @@ -5077,8 +5077,8 @@ module Test4343e = val cA: C val cB: C val cAB: C * C * C list = - (FSI_0090+Test4343e+C, FSI_0090+Test4343e+C, - [FSI_0090+Test4343e+C; FSI_0090+Test4343e+C]) + (FSI_0092+Test4343e+C, FSI_0092+Test4343e+C, + [FSI_0092+Test4343e+C; FSI_0092+Test4343e+C]) type D<'a> = new: x: 'a -> D<'a> override ToString: unit -> string @@ -5253,7 +5253,7 @@ module Regression5218 = type Regression4469 = new: unit -> Regression4469 member ToString: unit -> string -val r4469: Regression4469 = FSI_0106+Regression4469 +val r4469: Regression4469 = FSI_0108+Regression4469 val it: unit = () > Expect ABC = ABC @@ -6333,7 +6333,7 @@ val ShortName: string = "hi" > val list2: int list = [1] -module FSI_0316. +module FSI_0318. A8a951db8294f99e95ae1d276a7ddaefd93d1548e6bf749bdeae55d2649682b3 {"ImmutableField0":6} @@ -6355,7 +6355,7 @@ val it: unit = () > val it: {| AnonRecordField2: int |} = { AnonRecordField2 = 11 } -module FSI_0323.Project.fsproj +module FSI_0325.Project.fsproj type R3 = { ImmutableField3: int } From 01fbdf242047206a7c809405ab28e62a727db07a Mon Sep 17 00:00:00 2001 From: dawe Date: Wed, 12 Jun 2024 12:46:50 +0200 Subject: [PATCH 34/34] update line numbers in err bsl files --- .../core/printing/output.1000.stderr.bsl | 116 +++++++------- .../core/printing/output.200.stderr.bsl | 116 +++++++------- .../fsharp/core/printing/output.47.stderr.bsl | 148 +++++++++--------- .../core/printing/output.multiemit.stderr.bsl | 116 +++++++------- .../core/printing/output.off.stderr.bsl | 116 +++++++------- .../core/printing/output.quiet.stderr.bsl | 116 +++++++------- tests/fsharp/core/printing/output.stderr.bsl | 116 +++++++------- 7 files changed, 422 insertions(+), 422 deletions(-) diff --git a/tests/fsharp/core/printing/output.1000.stderr.bsl b/tests/fsharp/core/printing/output.1000.stderr.bsl index 6926dcc9f34..dae4463d4db 100644 --- a/tests/fsharp/core/printing/output.1000.stderr.bsl +++ b/tests/fsharp/core/printing/output.1000.stderr.bsl @@ -2,347 +2,347 @@ #blaaaaaa // blaaaaaa is not a known command;; ^^^^^^^^^ -stdin(219,1): warning FS3353: Invalid directive '#blaaaaaa ' +stdin(221,1): warning FS3353: Invalid directive '#blaaaaaa ' type Regression4319_T0 = static member (+-+-+) = "0 arguments";; -----------------------------------------^^^^^ -stdin(571,42): warning FS1172: Infix operator member '+-+-+' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(573,42): warning FS1172: Infix operator member '+-+-+' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_T1 = static member (+-+-+) x = "1 argument";; -----------------------------------------^^^^^ -stdin(572,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(574,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_T1b = static member (+-+-+) (x) = "1 (argument) [brackets make no diff]";; -----------------------------------------^^^^^ -stdin(573,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(575,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_T1c = static member (+-+-+) x = let a,b = x in "1 argument, tuple typed from RHS. Still not OK";; -----------------------------------------^^^^^ -stdin(574,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(576,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_T1d = static member (+-+-+) (x:int*int) = "1 argument, tuple typed from LHS. Still not OK";; -----------------------------------------^^^^^ -stdin(575,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(577,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_T3 = static member (+-+-+) (x,y,z) = "3 arguments";; -----------------------------------------^^^^^ -stdin(577,42): warning FS1173: Infix operator member '+-+-+' has 3 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(579,42): warning FS1173: Infix operator member '+-+-+' has 3 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_U1 = static member (+-+-+) x moreArgs = "1 argument and further args";; -----------------------------------------^^^^^ -stdin(578,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(580,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_U1 = static member (+-+-+) x moreArgs = "1 argument and further args";; -----------------------------------------^^^^^ -stdin(578,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(580,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_U1b = static member (+-+-+) (x) moreArgs = "1 (argument) [brackets make no diff] and further args";; -----------------------------------------^^^^^ -stdin(579,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(581,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_U1b = static member (+-+-+) (x) moreArgs = "1 (argument) [brackets make no diff] and further args";; -----------------------------------------^^^^^ -stdin(579,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(581,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_U2 = static member (+-+-+) (x,y) moreArgs = "1 argument and further args";; -----------------------------------------^^^^^ -stdin(580,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(582,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_U3 = static member (+-+-+) (x,y,z) moreArgs = "1 argument and further args";; -----------------------------------------^^^^^ -stdin(581,42): warning FS1173: Infix operator member '+-+-+' has 3 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(583,42): warning FS1173: Infix operator member '+-+-+' has 3 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_U3 = static member (+-+-+) (x,y,z) moreArgs = "1 argument and further args";; -----------------------------------------^^^^^ -stdin(581,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(583,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (:=) = "COLON_EQUALS" -------------------^^ -stdin(584,20): warning FS1172: Infix operator member ':=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(586,20): warning FS1172: Infix operator member ':=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (:=) = "COLON_EQUALS" -------------------^^ -stdin(584,20): warning FS0086: The name '(:=)' should not be used as a member name because it is given a standard definition in the F# library over fixed types +stdin(586,20): warning FS0086: The name '(:=)' should not be used as a member name because it is given a standard definition in the F# library over fixed types static member (&) = "AMP" -------------------^ -stdin(588,20): warning FS1172: Infix operator member '&' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(590,20): warning FS1172: Infix operator member '&' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (&) = "AMP" -------------------^ -stdin(588,20): warning FS0086: The name '(&)' should not be used as a member name. If defining a static member for use from other CLI languages then use the name 'op_Amp' instead. +stdin(590,20): warning FS0086: The name '(&)' should not be used as a member name. If defining a static member for use from other CLI languages then use the name 'op_Amp' instead. static member (&^) = "AMP_AMP" -------------------^^ -stdin(589,20): warning FS1172: Infix operator member '&^' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(591,20): warning FS1172: Infix operator member '&^' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (=) = "EQUALS" -------------------^ -stdin(590,20): warning FS1172: Infix operator member '=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(592,20): warning FS1172: Infix operator member '=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (=) = "EQUALS" -------------------^ -stdin(590,20): warning FS0086: The name '(=)' 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 'op_Equality' instead. +stdin(592,20): warning FS0086: The name '(=)' 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 'op_Equality' instead. static member (!=) = "INFIX_COMPARE_OP" -------------------^^ -stdin(592,20): warning FS1172: Infix operator member '!=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(594,20): warning FS1172: Infix operator member '!=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (...=) = "INFIX_COMPARE_OP" // with $. prefix -------------------^^^^ -stdin(596,20): warning FS1172: Infix operator member '...=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(598,20): warning FS1172: Infix operator member '...=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (...!=) = "INFIX_COMPARE_OP" // with $. prefix -------------------^^^^^ -stdin(597,20): warning FS1172: Infix operator member '...!=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(599,20): warning FS1172: Infix operator member '...!=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (...<) = "INFIX_COMPARE_OP" // with $. prefix -------------------^^^^ -stdin(598,20): warning FS1172: Infix operator member '...<' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(600,20): warning FS1172: Infix operator member '...<' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (...>) = "INFIX_COMPARE_OP" // with $. prefix -------------------^^^^ -stdin(599,20): warning FS1172: Infix operator member '...>' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(601,20): warning FS1172: Infix operator member '...>' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member ($) = "DOLLAR" -------------------^ -stdin(601,20): warning FS1172: Infix operator member '$' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(603,20): warning FS1172: Infix operator member '$' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (<) = "LESS" -------------------^ -stdin(602,20): warning FS1172: Infix operator member '<' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(604,20): warning FS1172: Infix operator member '<' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (<) = "LESS" -------------------^ -stdin(602,20): warning FS0086: The name '(<)' 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 'op_LessThan' instead. +stdin(604,20): warning FS0086: The name '(<)' 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 'op_LessThan' instead. static member (>) = "GREATER" -------------------^ -stdin(603,20): warning FS1172: Infix operator member '>' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(605,20): warning FS1172: Infix operator member '>' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (>) = "GREATER" -------------------^ -stdin(603,20): warning FS0086: The name '(>)' 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 'op_GreaterThan' instead. +stdin(605,20): warning FS0086: The name '(>)' 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 'op_GreaterThan' instead. static member (@) = "INFIX_AT_HAT_OP" -------------------^ -stdin(604,20): warning FS1172: Infix operator member '@' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(606,20): warning FS1172: Infix operator member '@' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (@) = "INFIX_AT_HAT_OP" -------------------^ -stdin(604,20): warning FS0086: The name '(@)' should not be used as a member name because it is given a standard definition in the F# library over fixed types +stdin(606,20): warning FS0086: The name '(@)' should not be used as a member name because it is given a standard definition in the F# library over fixed types static member (^) = "INFIX_AT_HAT_OP" -------------------^ -stdin(605,20): warning FS1172: Infix operator member '^' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(607,20): warning FS1172: Infix operator member '^' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (^) = "INFIX_AT_HAT_OP" -------------------^ -stdin(605,20): warning FS0086: The name '(^)' should not be used as a member name because it is given a standard definition in the F# library over fixed types +stdin(607,20): warning FS0086: The name '(^)' should not be used as a member name because it is given a standard definition in the F# library over fixed types static member (...@) = "INFIX_AT_HAT_OP" // with $. prefix -------------------^^^^ -stdin(606,20): warning FS1172: Infix operator member '...@' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(608,20): warning FS1172: Infix operator member '...@' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (...^) = "INFIX_AT_HAT_OP" // with $. prefix -------------------^^^^ -stdin(607,20): warning FS1172: Infix operator member '...^' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(609,20): warning FS1172: Infix operator member '...^' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (%) = "PERCENT_OP" -------------------^ -stdin(608,20): warning FS1172: Infix operator member '%' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(610,20): warning FS1172: Infix operator member '%' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (-) = "MINUS" -------------------^ -stdin(610,20): warning FS1172: Infix operator member '-' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(612,20): warning FS1172: Infix operator member '-' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member ( * ) = "STAR" --------------------^ -stdin(611,21): warning FS1172: Infix operator member '*' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(613,21): warning FS1172: Infix operator member '*' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (/) = "INFIX_STAR_DIV_MOD_OP" -------------------^ -stdin(613,20): warning FS1172: Infix operator member '/' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(615,20): warning FS1172: Infix operator member '/' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member ( ...* ) = "INFIX_STAR_DIV_MOD_OP" // with $. prefix --------------------^^^^ -stdin(615,21): warning FS1172: Infix operator member '...*' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(617,21): warning FS1172: Infix operator member '...*' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member ( .../ ) = "INFIX_STAR_DIV_MOD_OP" // with $. prefix --------------------^^^^ -stdin(616,21): warning FS1172: Infix operator member '.../' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(618,21): warning FS1172: Infix operator member '.../' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member ( ...% ) = "INFIX_STAR_DIV_MOD_OP" // with $. prefix --------------------^^^^ -stdin(617,21): warning FS1172: Infix operator member '...%' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(619,21): warning FS1172: Infix operator member '...%' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member ( ** ) = "INFIX_STAR_STAR_OP" --------------------^^ -stdin(618,21): warning FS1172: Infix operator member '**' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(620,21): warning FS1172: Infix operator member '**' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... member this.ToString() = "ABC" ----------------^^^^^^^^ -stdin(623,17): warning FS0864: This new member hides the abstract member 'System.Object.ToString() : string'. Rename the member or use 'override' instead. +stdin(625,17): warning FS0864: This new member hides the abstract member 'System.Object.ToString() : string'. Rename the member or use 'override' instead. let x,f = it, (fun () -> !it);; // this will read from the static storage for 'it' -------------------------^ -stdin(643,26): info FS3370: The use of '!' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change '!cell' to 'cell.Value'. +stdin(645,26): info FS3370: The use of '!' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change '!cell' to 'cell.Value'. x := 3;; --^^ -stdin(645,3): info FS3370: The use of ':=' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'cell := expr' to 'cell.Value <- expr'. +stdin(647,3): info FS3370: The use of ':=' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'cell := expr' to 'cell.Value <- expr'. member this.M() = "string" ----------------^ -stdin(764,17): error FS0438: Duplicate method. The method 'M' has the same name and signature as another method in type 'ExpectDupMethod'. +stdin(766,17): error FS0438: Duplicate method. The method 'M' has the same name and signature as another method in type 'ExpectDupMethod'. member this.P = "string" ----------------^ -stdin(771,17): error FS0438: Duplicate method. The method 'get_P' has the same name and signature as another method in type 'ExpectDupProperty'. +stdin(773,17): error FS0438: Duplicate method. The method 'get_P' has the same name and signature as another method in type 'ExpectDupProperty'. type public IBPublic = interface inherit IAPrivate abstract Q : int end ------------------^^^^^^^^ -stdin(778,19): error FS0410: The type 'IAPrivate' is less accessible than the value, member or type 'IBPublic' it is used in. +stdin(780,19): error FS0410: The type 'IAPrivate' is less accessible than the value, member or type 'IBPublic' it is used in. type internal IBInternal = interface inherit IAPrivate abstract Q : int end ------------------^^^^^^^^^^ -stdin(783,19): error FS0410: The type 'IAPrivate' is less accessible than the value, member or type 'IBInternal' it is used in. +stdin(785,19): error FS0410: The type 'IAPrivate' is less accessible than the value, member or type 'IBInternal' it is used in. type public IBPublic = interface inherit IAInternal abstract Q : int end ------------------^^^^^^^^ -stdin(792,19): error FS0410: The type 'IAInternal' is less accessible than the value, member or type 'IBPublic' it is used in. +stdin(794,19): error FS0410: The type 'IAInternal' is less accessible than the value, member or type 'IBPublic' it is used in. override x.M(a:string) = 1 -------------------^ -stdin(824,20): error FS0361: The override 'M: string -> int' implements more than one abstract slot, e.g. 'abstract Regression4232.D.M: 'U -> int' and 'abstract Regression4232.D.M: 'T -> int' +stdin(826,20): error FS0361: The override 'M: string -> int' implements more than one abstract slot, e.g. 'abstract Regression4232.D.M: 'U -> int' and 'abstract Regression4232.D.M: 'T -> int' let (|A|B|) (x:int) = A x;; -----^^^^^ -stdin(832,6): error FS1210: Active pattern '|A|B|' 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' +stdin(834,6): error FS1210: Active pattern '|A|B|' 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' let (|A|B|) (x:'a) = A x;; -----^^^^^ -stdin(835,6): error FS1210: Active pattern '|A|B|' 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' +stdin(837,6): error FS1210: Active pattern '|A|B|' 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' let (|A|B|) (p:'a) (x:int) = A p;; -----^^^^^ -stdin(838,6): error FS1210: Active pattern '|A|B|' 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' +stdin(840,6): error FS1210: Active pattern '|A|B|' 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' let (|A|B|) = failwith "" : Choice;; -----^^^^^ -stdin(844,6): error FS1209: Active pattern '|A|B|' is not a function +stdin(846,6): error FS1209: Active pattern '|A|B|' is not a function diff --git a/tests/fsharp/core/printing/output.200.stderr.bsl b/tests/fsharp/core/printing/output.200.stderr.bsl index 6926dcc9f34..dae4463d4db 100644 --- a/tests/fsharp/core/printing/output.200.stderr.bsl +++ b/tests/fsharp/core/printing/output.200.stderr.bsl @@ -2,347 +2,347 @@ #blaaaaaa // blaaaaaa is not a known command;; ^^^^^^^^^ -stdin(219,1): warning FS3353: Invalid directive '#blaaaaaa ' +stdin(221,1): warning FS3353: Invalid directive '#blaaaaaa ' type Regression4319_T0 = static member (+-+-+) = "0 arguments";; -----------------------------------------^^^^^ -stdin(571,42): warning FS1172: Infix operator member '+-+-+' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(573,42): warning FS1172: Infix operator member '+-+-+' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_T1 = static member (+-+-+) x = "1 argument";; -----------------------------------------^^^^^ -stdin(572,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(574,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_T1b = static member (+-+-+) (x) = "1 (argument) [brackets make no diff]";; -----------------------------------------^^^^^ -stdin(573,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(575,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_T1c = static member (+-+-+) x = let a,b = x in "1 argument, tuple typed from RHS. Still not OK";; -----------------------------------------^^^^^ -stdin(574,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(576,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_T1d = static member (+-+-+) (x:int*int) = "1 argument, tuple typed from LHS. Still not OK";; -----------------------------------------^^^^^ -stdin(575,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(577,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_T3 = static member (+-+-+) (x,y,z) = "3 arguments";; -----------------------------------------^^^^^ -stdin(577,42): warning FS1173: Infix operator member '+-+-+' has 3 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(579,42): warning FS1173: Infix operator member '+-+-+' has 3 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_U1 = static member (+-+-+) x moreArgs = "1 argument and further args";; -----------------------------------------^^^^^ -stdin(578,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(580,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_U1 = static member (+-+-+) x moreArgs = "1 argument and further args";; -----------------------------------------^^^^^ -stdin(578,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(580,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_U1b = static member (+-+-+) (x) moreArgs = "1 (argument) [brackets make no diff] and further args";; -----------------------------------------^^^^^ -stdin(579,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(581,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_U1b = static member (+-+-+) (x) moreArgs = "1 (argument) [brackets make no diff] and further args";; -----------------------------------------^^^^^ -stdin(579,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(581,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_U2 = static member (+-+-+) (x,y) moreArgs = "1 argument and further args";; -----------------------------------------^^^^^ -stdin(580,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(582,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_U3 = static member (+-+-+) (x,y,z) moreArgs = "1 argument and further args";; -----------------------------------------^^^^^ -stdin(581,42): warning FS1173: Infix operator member '+-+-+' has 3 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(583,42): warning FS1173: Infix operator member '+-+-+' has 3 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_U3 = static member (+-+-+) (x,y,z) moreArgs = "1 argument and further args";; -----------------------------------------^^^^^ -stdin(581,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(583,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (:=) = "COLON_EQUALS" -------------------^^ -stdin(584,20): warning FS1172: Infix operator member ':=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(586,20): warning FS1172: Infix operator member ':=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (:=) = "COLON_EQUALS" -------------------^^ -stdin(584,20): warning FS0086: The name '(:=)' should not be used as a member name because it is given a standard definition in the F# library over fixed types +stdin(586,20): warning FS0086: The name '(:=)' should not be used as a member name because it is given a standard definition in the F# library over fixed types static member (&) = "AMP" -------------------^ -stdin(588,20): warning FS1172: Infix operator member '&' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(590,20): warning FS1172: Infix operator member '&' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (&) = "AMP" -------------------^ -stdin(588,20): warning FS0086: The name '(&)' should not be used as a member name. If defining a static member for use from other CLI languages then use the name 'op_Amp' instead. +stdin(590,20): warning FS0086: The name '(&)' should not be used as a member name. If defining a static member for use from other CLI languages then use the name 'op_Amp' instead. static member (&^) = "AMP_AMP" -------------------^^ -stdin(589,20): warning FS1172: Infix operator member '&^' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(591,20): warning FS1172: Infix operator member '&^' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (=) = "EQUALS" -------------------^ -stdin(590,20): warning FS1172: Infix operator member '=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(592,20): warning FS1172: Infix operator member '=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (=) = "EQUALS" -------------------^ -stdin(590,20): warning FS0086: The name '(=)' 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 'op_Equality' instead. +stdin(592,20): warning FS0086: The name '(=)' 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 'op_Equality' instead. static member (!=) = "INFIX_COMPARE_OP" -------------------^^ -stdin(592,20): warning FS1172: Infix operator member '!=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(594,20): warning FS1172: Infix operator member '!=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (...=) = "INFIX_COMPARE_OP" // with $. prefix -------------------^^^^ -stdin(596,20): warning FS1172: Infix operator member '...=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(598,20): warning FS1172: Infix operator member '...=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (...!=) = "INFIX_COMPARE_OP" // with $. prefix -------------------^^^^^ -stdin(597,20): warning FS1172: Infix operator member '...!=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(599,20): warning FS1172: Infix operator member '...!=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (...<) = "INFIX_COMPARE_OP" // with $. prefix -------------------^^^^ -stdin(598,20): warning FS1172: Infix operator member '...<' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(600,20): warning FS1172: Infix operator member '...<' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (...>) = "INFIX_COMPARE_OP" // with $. prefix -------------------^^^^ -stdin(599,20): warning FS1172: Infix operator member '...>' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(601,20): warning FS1172: Infix operator member '...>' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member ($) = "DOLLAR" -------------------^ -stdin(601,20): warning FS1172: Infix operator member '$' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(603,20): warning FS1172: Infix operator member '$' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (<) = "LESS" -------------------^ -stdin(602,20): warning FS1172: Infix operator member '<' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(604,20): warning FS1172: Infix operator member '<' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (<) = "LESS" -------------------^ -stdin(602,20): warning FS0086: The name '(<)' 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 'op_LessThan' instead. +stdin(604,20): warning FS0086: The name '(<)' 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 'op_LessThan' instead. static member (>) = "GREATER" -------------------^ -stdin(603,20): warning FS1172: Infix operator member '>' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(605,20): warning FS1172: Infix operator member '>' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (>) = "GREATER" -------------------^ -stdin(603,20): warning FS0086: The name '(>)' 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 'op_GreaterThan' instead. +stdin(605,20): warning FS0086: The name '(>)' 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 'op_GreaterThan' instead. static member (@) = "INFIX_AT_HAT_OP" -------------------^ -stdin(604,20): warning FS1172: Infix operator member '@' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(606,20): warning FS1172: Infix operator member '@' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (@) = "INFIX_AT_HAT_OP" -------------------^ -stdin(604,20): warning FS0086: The name '(@)' should not be used as a member name because it is given a standard definition in the F# library over fixed types +stdin(606,20): warning FS0086: The name '(@)' should not be used as a member name because it is given a standard definition in the F# library over fixed types static member (^) = "INFIX_AT_HAT_OP" -------------------^ -stdin(605,20): warning FS1172: Infix operator member '^' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(607,20): warning FS1172: Infix operator member '^' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (^) = "INFIX_AT_HAT_OP" -------------------^ -stdin(605,20): warning FS0086: The name '(^)' should not be used as a member name because it is given a standard definition in the F# library over fixed types +stdin(607,20): warning FS0086: The name '(^)' should not be used as a member name because it is given a standard definition in the F# library over fixed types static member (...@) = "INFIX_AT_HAT_OP" // with $. prefix -------------------^^^^ -stdin(606,20): warning FS1172: Infix operator member '...@' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(608,20): warning FS1172: Infix operator member '...@' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (...^) = "INFIX_AT_HAT_OP" // with $. prefix -------------------^^^^ -stdin(607,20): warning FS1172: Infix operator member '...^' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(609,20): warning FS1172: Infix operator member '...^' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (%) = "PERCENT_OP" -------------------^ -stdin(608,20): warning FS1172: Infix operator member '%' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(610,20): warning FS1172: Infix operator member '%' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (-) = "MINUS" -------------------^ -stdin(610,20): warning FS1172: Infix operator member '-' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(612,20): warning FS1172: Infix operator member '-' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member ( * ) = "STAR" --------------------^ -stdin(611,21): warning FS1172: Infix operator member '*' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(613,21): warning FS1172: Infix operator member '*' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (/) = "INFIX_STAR_DIV_MOD_OP" -------------------^ -stdin(613,20): warning FS1172: Infix operator member '/' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(615,20): warning FS1172: Infix operator member '/' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member ( ...* ) = "INFIX_STAR_DIV_MOD_OP" // with $. prefix --------------------^^^^ -stdin(615,21): warning FS1172: Infix operator member '...*' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(617,21): warning FS1172: Infix operator member '...*' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member ( .../ ) = "INFIX_STAR_DIV_MOD_OP" // with $. prefix --------------------^^^^ -stdin(616,21): warning FS1172: Infix operator member '.../' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(618,21): warning FS1172: Infix operator member '.../' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member ( ...% ) = "INFIX_STAR_DIV_MOD_OP" // with $. prefix --------------------^^^^ -stdin(617,21): warning FS1172: Infix operator member '...%' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(619,21): warning FS1172: Infix operator member '...%' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member ( ** ) = "INFIX_STAR_STAR_OP" --------------------^^ -stdin(618,21): warning FS1172: Infix operator member '**' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(620,21): warning FS1172: Infix operator member '**' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... member this.ToString() = "ABC" ----------------^^^^^^^^ -stdin(623,17): warning FS0864: This new member hides the abstract member 'System.Object.ToString() : string'. Rename the member or use 'override' instead. +stdin(625,17): warning FS0864: This new member hides the abstract member 'System.Object.ToString() : string'. Rename the member or use 'override' instead. let x,f = it, (fun () -> !it);; // this will read from the static storage for 'it' -------------------------^ -stdin(643,26): info FS3370: The use of '!' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change '!cell' to 'cell.Value'. +stdin(645,26): info FS3370: The use of '!' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change '!cell' to 'cell.Value'. x := 3;; --^^ -stdin(645,3): info FS3370: The use of ':=' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'cell := expr' to 'cell.Value <- expr'. +stdin(647,3): info FS3370: The use of ':=' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'cell := expr' to 'cell.Value <- expr'. member this.M() = "string" ----------------^ -stdin(764,17): error FS0438: Duplicate method. The method 'M' has the same name and signature as another method in type 'ExpectDupMethod'. +stdin(766,17): error FS0438: Duplicate method. The method 'M' has the same name and signature as another method in type 'ExpectDupMethod'. member this.P = "string" ----------------^ -stdin(771,17): error FS0438: Duplicate method. The method 'get_P' has the same name and signature as another method in type 'ExpectDupProperty'. +stdin(773,17): error FS0438: Duplicate method. The method 'get_P' has the same name and signature as another method in type 'ExpectDupProperty'. type public IBPublic = interface inherit IAPrivate abstract Q : int end ------------------^^^^^^^^ -stdin(778,19): error FS0410: The type 'IAPrivate' is less accessible than the value, member or type 'IBPublic' it is used in. +stdin(780,19): error FS0410: The type 'IAPrivate' is less accessible than the value, member or type 'IBPublic' it is used in. type internal IBInternal = interface inherit IAPrivate abstract Q : int end ------------------^^^^^^^^^^ -stdin(783,19): error FS0410: The type 'IAPrivate' is less accessible than the value, member or type 'IBInternal' it is used in. +stdin(785,19): error FS0410: The type 'IAPrivate' is less accessible than the value, member or type 'IBInternal' it is used in. type public IBPublic = interface inherit IAInternal abstract Q : int end ------------------^^^^^^^^ -stdin(792,19): error FS0410: The type 'IAInternal' is less accessible than the value, member or type 'IBPublic' it is used in. +stdin(794,19): error FS0410: The type 'IAInternal' is less accessible than the value, member or type 'IBPublic' it is used in. override x.M(a:string) = 1 -------------------^ -stdin(824,20): error FS0361: The override 'M: string -> int' implements more than one abstract slot, e.g. 'abstract Regression4232.D.M: 'U -> int' and 'abstract Regression4232.D.M: 'T -> int' +stdin(826,20): error FS0361: The override 'M: string -> int' implements more than one abstract slot, e.g. 'abstract Regression4232.D.M: 'U -> int' and 'abstract Regression4232.D.M: 'T -> int' let (|A|B|) (x:int) = A x;; -----^^^^^ -stdin(832,6): error FS1210: Active pattern '|A|B|' 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' +stdin(834,6): error FS1210: Active pattern '|A|B|' 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' let (|A|B|) (x:'a) = A x;; -----^^^^^ -stdin(835,6): error FS1210: Active pattern '|A|B|' 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' +stdin(837,6): error FS1210: Active pattern '|A|B|' 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' let (|A|B|) (p:'a) (x:int) = A p;; -----^^^^^ -stdin(838,6): error FS1210: Active pattern '|A|B|' 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' +stdin(840,6): error FS1210: Active pattern '|A|B|' 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' let (|A|B|) = failwith "" : Choice;; -----^^^^^ -stdin(844,6): error FS1209: Active pattern '|A|B|' is not a function +stdin(846,6): error FS1209: Active pattern '|A|B|' is not a function diff --git a/tests/fsharp/core/printing/output.47.stderr.bsl b/tests/fsharp/core/printing/output.47.stderr.bsl index 3e98bca2fc4..7ea9b2e9f1b 100644 --- a/tests/fsharp/core/printing/output.47.stderr.bsl +++ b/tests/fsharp/core/printing/output.47.stderr.bsl @@ -2,443 +2,443 @@ #blaaaaaa // blaaaaaa is not a known command;; ^^^^^^^^^ -stdin(219,1): warning FS3353: Invalid directive '#blaaaaaa ' +stdin(221,1): warning FS3353: Invalid directive '#blaaaaaa ' type Regression4319_T0 = static member (+-+-+) = "0 arguments";; -----------------------------------------^^^^^ -stdin(571,42): warning FS1172: Infix operator member '+-+-+' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(573,42): warning FS1172: Infix operator member '+-+-+' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_T1 = static member (+-+-+) x = "1 argument";; -----------------------------------------^^^^^ -stdin(572,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(574,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_T1b = static member (+-+-+) (x) = "1 (argument) [brackets make no diff]";; -----------------------------------------^^^^^ -stdin(573,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(575,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_T1c = static member (+-+-+) x = let a,b = x in "1 argument, tuple typed from RHS. Still not OK";; -----------------------------------------^^^^^ -stdin(574,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(576,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_T1d = static member (+-+-+) (x:int*int) = "1 argument, tuple typed from LHS. Still not OK";; -----------------------------------------^^^^^ -stdin(575,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(577,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_T3 = static member (+-+-+) (x,y,z) = "3 arguments";; -----------------------------------------^^^^^ -stdin(577,42): warning FS1173: Infix operator member '+-+-+' has 3 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(579,42): warning FS1173: Infix operator member '+-+-+' has 3 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_U1 = static member (+-+-+) x moreArgs = "1 argument and further args";; -----------------------------------------^^^^^ -stdin(578,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(580,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_U1 = static member (+-+-+) x moreArgs = "1 argument and further args";; -----------------------------------------^^^^^ -stdin(578,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(580,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_U1b = static member (+-+-+) (x) moreArgs = "1 (argument) [brackets make no diff] and further args";; -----------------------------------------^^^^^ -stdin(579,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(581,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_U1b = static member (+-+-+) (x) moreArgs = "1 (argument) [brackets make no diff] and further args";; -----------------------------------------^^^^^ -stdin(579,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(581,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_U2 = static member (+-+-+) (x,y) moreArgs = "1 argument and further args";; -----------------------------------------^^^^^ -stdin(580,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(582,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_U3 = static member (+-+-+) (x,y,z) moreArgs = "1 argument and further args";; -----------------------------------------^^^^^ -stdin(581,42): warning FS1173: Infix operator member '+-+-+' has 3 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(583,42): warning FS1173: Infix operator member '+-+-+' has 3 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_U3 = static member (+-+-+) (x,y,z) moreArgs = "1 argument and further args";; -----------------------------------------^^^^^ -stdin(581,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(583,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (:=) = "COLON_EQUALS" -------------------^^ -stdin(584,20): warning FS1172: Infix operator member ':=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(586,20): warning FS1172: Infix operator member ':=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (:=) = "COLON_EQUALS" -------------------^^ -stdin(584,20): warning FS0086: The name '(:=)' should not be used as a member name because it is given a standard definition in the F# library over fixed types +stdin(586,20): warning FS0086: The name '(:=)' should not be used as a member name because it is given a standard definition in the F# library over fixed types static member (&) = "AMP" -------------------^ -stdin(588,20): warning FS1172: Infix operator member '&' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(590,20): warning FS1172: Infix operator member '&' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (&) = "AMP" -------------------^ -stdin(588,20): warning FS0086: The name '(&)' should not be used as a member name. If defining a static member for use from other CLI languages then use the name 'op_Amp' instead. +stdin(590,20): warning FS0086: The name '(&)' should not be used as a member name. If defining a static member for use from other CLI languages then use the name 'op_Amp' instead. static member (&^) = "AMP_AMP" -------------------^^ -stdin(589,20): warning FS1172: Infix operator member '&^' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(591,20): warning FS1172: Infix operator member '&^' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (=) = "EQUALS" -------------------^ -stdin(590,20): warning FS1172: Infix operator member '=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(592,20): warning FS1172: Infix operator member '=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (=) = "EQUALS" -------------------^ -stdin(590,20): warning FS0086: The name '(=)' 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 'op_Equality' instead. +stdin(592,20): warning FS0086: The name '(=)' 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 'op_Equality' instead. static member (!=) = "INFIX_COMPARE_OP" -------------------^^ -stdin(592,20): warning FS1172: Infix operator member '!=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(594,20): warning FS1172: Infix operator member '!=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (...=) = "INFIX_COMPARE_OP" // with $. prefix -------------------^^^^ -stdin(596,20): warning FS1172: Infix operator member '...=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(598,20): warning FS1172: Infix operator member '...=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (...!=) = "INFIX_COMPARE_OP" // with $. prefix -------------------^^^^^ -stdin(597,20): warning FS1172: Infix operator member '...!=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(599,20): warning FS1172: Infix operator member '...!=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (...<) = "INFIX_COMPARE_OP" // with $. prefix -------------------^^^^ -stdin(598,20): warning FS1172: Infix operator member '...<' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(600,20): warning FS1172: Infix operator member '...<' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (...>) = "INFIX_COMPARE_OP" // with $. prefix -------------------^^^^ -stdin(599,20): warning FS1172: Infix operator member '...>' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(601,20): warning FS1172: Infix operator member '...>' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member ($) = "DOLLAR" -------------------^ -stdin(601,20): warning FS1172: Infix operator member '$' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(603,20): warning FS1172: Infix operator member '$' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (<) = "LESS" -------------------^ -stdin(602,20): warning FS1172: Infix operator member '<' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(604,20): warning FS1172: Infix operator member '<' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (<) = "LESS" -------------------^ -stdin(602,20): warning FS0086: The name '(<)' 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 'op_LessThan' instead. +stdin(604,20): warning FS0086: The name '(<)' 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 'op_LessThan' instead. static member (>) = "GREATER" -------------------^ -stdin(603,20): warning FS1172: Infix operator member '>' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(605,20): warning FS1172: Infix operator member '>' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (>) = "GREATER" -------------------^ -stdin(603,20): warning FS0086: The name '(>)' 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 'op_GreaterThan' instead. +stdin(605,20): warning FS0086: The name '(>)' 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 'op_GreaterThan' instead. static member (@) = "INFIX_AT_HAT_OP" -------------------^ -stdin(604,20): warning FS1172: Infix operator member '@' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(606,20): warning FS1172: Infix operator member '@' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (@) = "INFIX_AT_HAT_OP" -------------------^ -stdin(604,20): warning FS0086: The name '(@)' should not be used as a member name because it is given a standard definition in the F# library over fixed types +stdin(606,20): warning FS0086: The name '(@)' should not be used as a member name because it is given a standard definition in the F# library over fixed types static member (^) = "INFIX_AT_HAT_OP" -------------------^ -stdin(605,20): warning FS1172: Infix operator member '^' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(607,20): warning FS1172: Infix operator member '^' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (^) = "INFIX_AT_HAT_OP" -------------------^ -stdin(605,20): warning FS0086: The name '(^)' should not be used as a member name because it is given a standard definition in the F# library over fixed types +stdin(607,20): warning FS0086: The name '(^)' should not be used as a member name because it is given a standard definition in the F# library over fixed types static member (...@) = "INFIX_AT_HAT_OP" // with $. prefix -------------------^^^^ -stdin(606,20): warning FS1172: Infix operator member '...@' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(608,20): warning FS1172: Infix operator member '...@' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (...^) = "INFIX_AT_HAT_OP" // with $. prefix -------------------^^^^ -stdin(607,20): warning FS1172: Infix operator member '...^' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(609,20): warning FS1172: Infix operator member '...^' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (%) = "PERCENT_OP" -------------------^ -stdin(608,20): warning FS1172: Infix operator member '%' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(610,20): warning FS1172: Infix operator member '%' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (-) = "MINUS" -------------------^ -stdin(610,20): warning FS1172: Infix operator member '-' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(612,20): warning FS1172: Infix operator member '-' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member ( * ) = "STAR" --------------------^ -stdin(611,21): warning FS1172: Infix operator member '*' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(613,21): warning FS1172: Infix operator member '*' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (/) = "INFIX_STAR_DIV_MOD_OP" -------------------^ -stdin(613,20): warning FS1172: Infix operator member '/' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(615,20): warning FS1172: Infix operator member '/' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member ( ...* ) = "INFIX_STAR_DIV_MOD_OP" // with $. prefix --------------------^^^^ -stdin(615,21): warning FS1172: Infix operator member '...*' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(617,21): warning FS1172: Infix operator member '...*' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member ( .../ ) = "INFIX_STAR_DIV_MOD_OP" // with $. prefix --------------------^^^^ -stdin(616,21): warning FS1172: Infix operator member '.../' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(618,21): warning FS1172: Infix operator member '.../' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member ( ...% ) = "INFIX_STAR_DIV_MOD_OP" // with $. prefix --------------------^^^^ -stdin(617,21): warning FS1172: Infix operator member '...%' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(619,21): warning FS1172: Infix operator member '...%' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member ( ** ) = "INFIX_STAR_STAR_OP" --------------------^^ -stdin(618,21): warning FS1172: Infix operator member '**' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(620,21): warning FS1172: Infix operator member '**' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... member this.ToString() = "ABC" ----------------^^^^^^^^ -stdin(623,17): warning FS0864: This new member hides the abstract member 'System.Object.ToString() : string'. Rename the member or use 'override' instead. +stdin(625,17): warning FS0864: This new member hides the abstract member 'System.Object.ToString() : string'. Rename the member or use 'override' instead. member this.M() = "string" ----------------^ -stdin(764,17): error FS0438: Duplicate method. The method 'M' has the same name and signature as another method in type 'ExpectDupMethod'. +stdin(766,17): error FS0438: Duplicate method. The method 'M' has the same name and signature as another method in type 'ExpectDupMethod'. member this.P = "string" ----------------^ -stdin(771,17): error FS0438: Duplicate method. The method 'get_P' has the same name and signature as another method in type 'ExpectDupProperty'. +stdin(773,17): error FS0438: Duplicate method. The method 'get_P' has the same name and signature as another method in type 'ExpectDupProperty'. type public IBPublic = interface inherit IAPrivate abstract Q : int end ------------------^^^^^^^^ -stdin(778,19): error FS0410: The type 'IAPrivate' is less accessible than the value, member or type 'IBPublic' it is used in. +stdin(780,19): error FS0410: The type 'IAPrivate' is less accessible than the value, member or type 'IBPublic' it is used in. type internal IBInternal = interface inherit IAPrivate abstract Q : int end ------------------^^^^^^^^^^ -stdin(783,19): error FS0410: The type 'IAPrivate' is less accessible than the value, member or type 'IBInternal' it is used in. +stdin(785,19): error FS0410: The type 'IAPrivate' is less accessible than the value, member or type 'IBInternal' it is used in. type public IBPublic = interface inherit IAInternal abstract Q : int end ------------------^^^^^^^^ -stdin(792,19): error FS0410: The type 'IAInternal' is less accessible than the value, member or type 'IBPublic' it is used in. +stdin(794,19): error FS0410: The type 'IAInternal' is less accessible than the value, member or type 'IBPublic' it is used in. override x.M(a:string) = 1 -------------------^ -stdin(824,20): error FS0361: The override 'M: string -> int' implements more than one abstract slot, e.g. 'abstract Regression4232.D.M: 'U -> int' and 'abstract Regression4232.D.M: 'T -> int' +stdin(826,20): error FS0361: The override 'M: string -> int' implements more than one abstract slot, e.g. 'abstract Regression4232.D.M: 'U -> int' and 'abstract Regression4232.D.M: 'T -> int' let (|A|B|) (x:int) = A x;; -----^^^^^ -stdin(832,6): error FS1210: Active pattern '|A|B|' 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' +stdin(834,6): error FS1210: Active pattern '|A|B|' 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' let (|A|B|) (x:'a) = A x;; -----^^^^^ -stdin(835,6): error FS1210: Active pattern '|A|B|' 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' +stdin(837,6): error FS1210: Active pattern '|A|B|' 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' let (|A|B|) (p:'a) (x:int) = A p;; -----^^^^^ -stdin(838,6): error FS1210: Active pattern '|A|B|' 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' +stdin(840,6): error FS1210: Active pattern '|A|B|' 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' let (|A|B|) = failwith "" : Choice;; -----^^^^^ -stdin(844,6): error FS1209: Active pattern '|A|B|' is not a function +stdin(846,6): error FS1209: Active pattern '|A|B|' is not a function #r "nuget:Newtonsoft.Json, 13.0.1" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -stdin(1117,1): error FS3302: The 'package management' feature requires language version 5.0 or above +stdin(1119,1): error FS3302: The 'package management' feature requires language version 5.0 or above JsonConvert.SerializeObject { ImmutableField0 = 7 } ^^^^^^^^^^^ -stdin(1122,1): error FS0039: The value, namespace, type or module 'JsonConvert' is not defined. +stdin(1124,1): error FS0039: The value, namespace, type or module 'JsonConvert' is not defined. JsonConvert.SerializeObject { MutableField1 = 8 } |> printfn "%s";; ^^^^^^^^^^^ -stdin(1126,1): error FS0039: The value, namespace, type or module 'JsonConvert' is not defined. +stdin(1128,1): error FS0039: The value, namespace, type or module 'JsonConvert' is not defined. JsonConvert.SerializeObject { MutableField1 = 9 } ^^^^^^^^^^^ -stdin(1128,1): error FS0039: The value, namespace, type or module 'JsonConvert' is not defined. +stdin(1130,1): error FS0039: The value, namespace, type or module 'JsonConvert' is not defined. JsonConvert.SerializeObject {| AnonRecordField2 = 10 |} |> printfn "%s";; ^^^^^^^^^^^ -stdin(1131,1): error FS0039: The value, namespace, type or module 'JsonConvert' is not defined. +stdin(1133,1): error FS0039: The value, namespace, type or module 'JsonConvert' is not defined. JsonConvert.SerializeObject {| AnonRecordField2 = 11 |} ^^^^^^^^^^^ -stdin(1133,1): error FS0039: The value, namespace, type or module 'JsonConvert' is not defined. +stdin(1135,1): error FS0039: The value, namespace, type or module 'JsonConvert' is not defined. #r "nuget: System.Text.Json" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -stdin(1136,1): error FS3302: The 'package management' feature requires language version 5.0 or above +stdin(1138,1): error FS3302: The 'package management' feature requires language version 5.0 or above let test3b = JsonSerializer.Deserialize test3a;; -------------^^^^^^^^^^^^^^ -stdin(1140,14): error FS0039: The value, namespace, type or module 'JsonSerializer' is not defined. +stdin(1142,14): error FS0039: The value, namespace, type or module 'JsonSerializer' is not defined. let test3c = JsonSerializer.Serialize { ImmutableField3 = 13 };; -------------^^^^^^^^^^^^^^ -stdin(1141,14): error FS0039: The value, namespace, type or module 'JsonSerializer' is not defined. +stdin(1143,14): error FS0039: The value, namespace, type or module 'JsonSerializer' is not defined. let test3d = JsonSerializer.Deserialize test3c;; -------------^^^^^^^^^^^^^^ -stdin(1142,14): error FS0039: The value, namespace, type or module 'JsonSerializer' is not defined. +stdin(1144,14): error FS0039: The value, namespace, type or module 'JsonSerializer' is not defined. let test4a = JsonSerializer.Serialize { MutableField4 = 15 };; -------------^^^^^^^^^^^^^^ -stdin(1145,14): error FS0039: The value, namespace, type or module 'JsonSerializer' is not defined. +stdin(1147,14): error FS0039: The value, namespace, type or module 'JsonSerializer' is not defined. let test4b = JsonSerializer.Deserialize test4a;; -------------^^^^^^^^^^^^^^ -stdin(1146,14): error FS0039: The value, namespace, type or module 'JsonSerializer' is not defined. +stdin(1148,14): error FS0039: The value, namespace, type or module 'JsonSerializer' is not defined. let test4c = JsonSerializer.Serialize { MutableField4 = 16 };; -------------^^^^^^^^^^^^^^ -stdin(1147,14): error FS0039: The value, namespace, type or module 'JsonSerializer' is not defined. +stdin(1149,14): error FS0039: The value, namespace, type or module 'JsonSerializer' is not defined. let test4d = JsonSerializer.Deserialize test4c;; -------------^^^^^^^^^^^^^^ -stdin(1148,14): error FS0039: The value, namespace, type or module 'JsonSerializer' is not defined. +stdin(1150,14): error FS0039: The value, namespace, type or module 'JsonSerializer' is not defined. let test5a = JsonSerializer.Serialize {| AnonRecordField5 = 17 |};; -------------^^^^^^^^^^^^^^ -stdin(1151,14): error FS0039: The value, namespace, type or module 'JsonSerializer' is not defined. +stdin(1153,14): error FS0039: The value, namespace, type or module 'JsonSerializer' is not defined. let test5b = JsonSerializer.Deserialize test5a;; -------------^^^^^^^^^^^^^^ -stdin(1152,14): error FS0039: The value, namespace, type or module 'JsonSerializer' is not defined. +stdin(1154,14): error FS0039: The value, namespace, type or module 'JsonSerializer' is not defined. let test5c = JsonSerializer.Serialize {| AnonRecordField5 = 18 |};; -------------^^^^^^^^^^^^^^ -stdin(1153,14): error FS0039: The value, namespace, type or module 'JsonSerializer' is not defined. +stdin(1155,14): error FS0039: The value, namespace, type or module 'JsonSerializer' is not defined. let test5d = JsonSerializer.Deserialize test5c;; -------------^^^^^^^^^^^^^^ -stdin(1154,14): error FS0039: The value, namespace, type or module 'JsonSerializer' is not defined. +stdin(1156,14): error FS0039: The value, namespace, type or module 'JsonSerializer' is not defined. diff --git a/tests/fsharp/core/printing/output.multiemit.stderr.bsl b/tests/fsharp/core/printing/output.multiemit.stderr.bsl index 6926dcc9f34..dae4463d4db 100644 --- a/tests/fsharp/core/printing/output.multiemit.stderr.bsl +++ b/tests/fsharp/core/printing/output.multiemit.stderr.bsl @@ -2,347 +2,347 @@ #blaaaaaa // blaaaaaa is not a known command;; ^^^^^^^^^ -stdin(219,1): warning FS3353: Invalid directive '#blaaaaaa ' +stdin(221,1): warning FS3353: Invalid directive '#blaaaaaa ' type Regression4319_T0 = static member (+-+-+) = "0 arguments";; -----------------------------------------^^^^^ -stdin(571,42): warning FS1172: Infix operator member '+-+-+' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(573,42): warning FS1172: Infix operator member '+-+-+' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_T1 = static member (+-+-+) x = "1 argument";; -----------------------------------------^^^^^ -stdin(572,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(574,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_T1b = static member (+-+-+) (x) = "1 (argument) [brackets make no diff]";; -----------------------------------------^^^^^ -stdin(573,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(575,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_T1c = static member (+-+-+) x = let a,b = x in "1 argument, tuple typed from RHS. Still not OK";; -----------------------------------------^^^^^ -stdin(574,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(576,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_T1d = static member (+-+-+) (x:int*int) = "1 argument, tuple typed from LHS. Still not OK";; -----------------------------------------^^^^^ -stdin(575,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(577,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_T3 = static member (+-+-+) (x,y,z) = "3 arguments";; -----------------------------------------^^^^^ -stdin(577,42): warning FS1173: Infix operator member '+-+-+' has 3 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(579,42): warning FS1173: Infix operator member '+-+-+' has 3 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_U1 = static member (+-+-+) x moreArgs = "1 argument and further args";; -----------------------------------------^^^^^ -stdin(578,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(580,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_U1 = static member (+-+-+) x moreArgs = "1 argument and further args";; -----------------------------------------^^^^^ -stdin(578,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(580,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_U1b = static member (+-+-+) (x) moreArgs = "1 (argument) [brackets make no diff] and further args";; -----------------------------------------^^^^^ -stdin(579,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(581,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_U1b = static member (+-+-+) (x) moreArgs = "1 (argument) [brackets make no diff] and further args";; -----------------------------------------^^^^^ -stdin(579,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(581,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_U2 = static member (+-+-+) (x,y) moreArgs = "1 argument and further args";; -----------------------------------------^^^^^ -stdin(580,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(582,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_U3 = static member (+-+-+) (x,y,z) moreArgs = "1 argument and further args";; -----------------------------------------^^^^^ -stdin(581,42): warning FS1173: Infix operator member '+-+-+' has 3 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(583,42): warning FS1173: Infix operator member '+-+-+' has 3 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_U3 = static member (+-+-+) (x,y,z) moreArgs = "1 argument and further args";; -----------------------------------------^^^^^ -stdin(581,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(583,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (:=) = "COLON_EQUALS" -------------------^^ -stdin(584,20): warning FS1172: Infix operator member ':=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(586,20): warning FS1172: Infix operator member ':=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (:=) = "COLON_EQUALS" -------------------^^ -stdin(584,20): warning FS0086: The name '(:=)' should not be used as a member name because it is given a standard definition in the F# library over fixed types +stdin(586,20): warning FS0086: The name '(:=)' should not be used as a member name because it is given a standard definition in the F# library over fixed types static member (&) = "AMP" -------------------^ -stdin(588,20): warning FS1172: Infix operator member '&' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(590,20): warning FS1172: Infix operator member '&' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (&) = "AMP" -------------------^ -stdin(588,20): warning FS0086: The name '(&)' should not be used as a member name. If defining a static member for use from other CLI languages then use the name 'op_Amp' instead. +stdin(590,20): warning FS0086: The name '(&)' should not be used as a member name. If defining a static member for use from other CLI languages then use the name 'op_Amp' instead. static member (&^) = "AMP_AMP" -------------------^^ -stdin(589,20): warning FS1172: Infix operator member '&^' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(591,20): warning FS1172: Infix operator member '&^' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (=) = "EQUALS" -------------------^ -stdin(590,20): warning FS1172: Infix operator member '=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(592,20): warning FS1172: Infix operator member '=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (=) = "EQUALS" -------------------^ -stdin(590,20): warning FS0086: The name '(=)' 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 'op_Equality' instead. +stdin(592,20): warning FS0086: The name '(=)' 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 'op_Equality' instead. static member (!=) = "INFIX_COMPARE_OP" -------------------^^ -stdin(592,20): warning FS1172: Infix operator member '!=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(594,20): warning FS1172: Infix operator member '!=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (...=) = "INFIX_COMPARE_OP" // with $. prefix -------------------^^^^ -stdin(596,20): warning FS1172: Infix operator member '...=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(598,20): warning FS1172: Infix operator member '...=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (...!=) = "INFIX_COMPARE_OP" // with $. prefix -------------------^^^^^ -stdin(597,20): warning FS1172: Infix operator member '...!=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(599,20): warning FS1172: Infix operator member '...!=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (...<) = "INFIX_COMPARE_OP" // with $. prefix -------------------^^^^ -stdin(598,20): warning FS1172: Infix operator member '...<' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(600,20): warning FS1172: Infix operator member '...<' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (...>) = "INFIX_COMPARE_OP" // with $. prefix -------------------^^^^ -stdin(599,20): warning FS1172: Infix operator member '...>' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(601,20): warning FS1172: Infix operator member '...>' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member ($) = "DOLLAR" -------------------^ -stdin(601,20): warning FS1172: Infix operator member '$' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(603,20): warning FS1172: Infix operator member '$' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (<) = "LESS" -------------------^ -stdin(602,20): warning FS1172: Infix operator member '<' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(604,20): warning FS1172: Infix operator member '<' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (<) = "LESS" -------------------^ -stdin(602,20): warning FS0086: The name '(<)' 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 'op_LessThan' instead. +stdin(604,20): warning FS0086: The name '(<)' 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 'op_LessThan' instead. static member (>) = "GREATER" -------------------^ -stdin(603,20): warning FS1172: Infix operator member '>' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(605,20): warning FS1172: Infix operator member '>' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (>) = "GREATER" -------------------^ -stdin(603,20): warning FS0086: The name '(>)' 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 'op_GreaterThan' instead. +stdin(605,20): warning FS0086: The name '(>)' 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 'op_GreaterThan' instead. static member (@) = "INFIX_AT_HAT_OP" -------------------^ -stdin(604,20): warning FS1172: Infix operator member '@' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(606,20): warning FS1172: Infix operator member '@' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (@) = "INFIX_AT_HAT_OP" -------------------^ -stdin(604,20): warning FS0086: The name '(@)' should not be used as a member name because it is given a standard definition in the F# library over fixed types +stdin(606,20): warning FS0086: The name '(@)' should not be used as a member name because it is given a standard definition in the F# library over fixed types static member (^) = "INFIX_AT_HAT_OP" -------------------^ -stdin(605,20): warning FS1172: Infix operator member '^' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(607,20): warning FS1172: Infix operator member '^' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (^) = "INFIX_AT_HAT_OP" -------------------^ -stdin(605,20): warning FS0086: The name '(^)' should not be used as a member name because it is given a standard definition in the F# library over fixed types +stdin(607,20): warning FS0086: The name '(^)' should not be used as a member name because it is given a standard definition in the F# library over fixed types static member (...@) = "INFIX_AT_HAT_OP" // with $. prefix -------------------^^^^ -stdin(606,20): warning FS1172: Infix operator member '...@' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(608,20): warning FS1172: Infix operator member '...@' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (...^) = "INFIX_AT_HAT_OP" // with $. prefix -------------------^^^^ -stdin(607,20): warning FS1172: Infix operator member '...^' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(609,20): warning FS1172: Infix operator member '...^' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (%) = "PERCENT_OP" -------------------^ -stdin(608,20): warning FS1172: Infix operator member '%' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(610,20): warning FS1172: Infix operator member '%' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (-) = "MINUS" -------------------^ -stdin(610,20): warning FS1172: Infix operator member '-' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(612,20): warning FS1172: Infix operator member '-' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member ( * ) = "STAR" --------------------^ -stdin(611,21): warning FS1172: Infix operator member '*' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(613,21): warning FS1172: Infix operator member '*' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (/) = "INFIX_STAR_DIV_MOD_OP" -------------------^ -stdin(613,20): warning FS1172: Infix operator member '/' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(615,20): warning FS1172: Infix operator member '/' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member ( ...* ) = "INFIX_STAR_DIV_MOD_OP" // with $. prefix --------------------^^^^ -stdin(615,21): warning FS1172: Infix operator member '...*' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(617,21): warning FS1172: Infix operator member '...*' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member ( .../ ) = "INFIX_STAR_DIV_MOD_OP" // with $. prefix --------------------^^^^ -stdin(616,21): warning FS1172: Infix operator member '.../' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(618,21): warning FS1172: Infix operator member '.../' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member ( ...% ) = "INFIX_STAR_DIV_MOD_OP" // with $. prefix --------------------^^^^ -stdin(617,21): warning FS1172: Infix operator member '...%' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(619,21): warning FS1172: Infix operator member '...%' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member ( ** ) = "INFIX_STAR_STAR_OP" --------------------^^ -stdin(618,21): warning FS1172: Infix operator member '**' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(620,21): warning FS1172: Infix operator member '**' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... member this.ToString() = "ABC" ----------------^^^^^^^^ -stdin(623,17): warning FS0864: This new member hides the abstract member 'System.Object.ToString() : string'. Rename the member or use 'override' instead. +stdin(625,17): warning FS0864: This new member hides the abstract member 'System.Object.ToString() : string'. Rename the member or use 'override' instead. let x,f = it, (fun () -> !it);; // this will read from the static storage for 'it' -------------------------^ -stdin(643,26): info FS3370: The use of '!' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change '!cell' to 'cell.Value'. +stdin(645,26): info FS3370: The use of '!' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change '!cell' to 'cell.Value'. x := 3;; --^^ -stdin(645,3): info FS3370: The use of ':=' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'cell := expr' to 'cell.Value <- expr'. +stdin(647,3): info FS3370: The use of ':=' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'cell := expr' to 'cell.Value <- expr'. member this.M() = "string" ----------------^ -stdin(764,17): error FS0438: Duplicate method. The method 'M' has the same name and signature as another method in type 'ExpectDupMethod'. +stdin(766,17): error FS0438: Duplicate method. The method 'M' has the same name and signature as another method in type 'ExpectDupMethod'. member this.P = "string" ----------------^ -stdin(771,17): error FS0438: Duplicate method. The method 'get_P' has the same name and signature as another method in type 'ExpectDupProperty'. +stdin(773,17): error FS0438: Duplicate method. The method 'get_P' has the same name and signature as another method in type 'ExpectDupProperty'. type public IBPublic = interface inherit IAPrivate abstract Q : int end ------------------^^^^^^^^ -stdin(778,19): error FS0410: The type 'IAPrivate' is less accessible than the value, member or type 'IBPublic' it is used in. +stdin(780,19): error FS0410: The type 'IAPrivate' is less accessible than the value, member or type 'IBPublic' it is used in. type internal IBInternal = interface inherit IAPrivate abstract Q : int end ------------------^^^^^^^^^^ -stdin(783,19): error FS0410: The type 'IAPrivate' is less accessible than the value, member or type 'IBInternal' it is used in. +stdin(785,19): error FS0410: The type 'IAPrivate' is less accessible than the value, member or type 'IBInternal' it is used in. type public IBPublic = interface inherit IAInternal abstract Q : int end ------------------^^^^^^^^ -stdin(792,19): error FS0410: The type 'IAInternal' is less accessible than the value, member or type 'IBPublic' it is used in. +stdin(794,19): error FS0410: The type 'IAInternal' is less accessible than the value, member or type 'IBPublic' it is used in. override x.M(a:string) = 1 -------------------^ -stdin(824,20): error FS0361: The override 'M: string -> int' implements more than one abstract slot, e.g. 'abstract Regression4232.D.M: 'U -> int' and 'abstract Regression4232.D.M: 'T -> int' +stdin(826,20): error FS0361: The override 'M: string -> int' implements more than one abstract slot, e.g. 'abstract Regression4232.D.M: 'U -> int' and 'abstract Regression4232.D.M: 'T -> int' let (|A|B|) (x:int) = A x;; -----^^^^^ -stdin(832,6): error FS1210: Active pattern '|A|B|' 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' +stdin(834,6): error FS1210: Active pattern '|A|B|' 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' let (|A|B|) (x:'a) = A x;; -----^^^^^ -stdin(835,6): error FS1210: Active pattern '|A|B|' 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' +stdin(837,6): error FS1210: Active pattern '|A|B|' 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' let (|A|B|) (p:'a) (x:int) = A p;; -----^^^^^ -stdin(838,6): error FS1210: Active pattern '|A|B|' 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' +stdin(840,6): error FS1210: Active pattern '|A|B|' 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' let (|A|B|) = failwith "" : Choice;; -----^^^^^ -stdin(844,6): error FS1209: Active pattern '|A|B|' is not a function +stdin(846,6): error FS1209: Active pattern '|A|B|' is not a function diff --git a/tests/fsharp/core/printing/output.off.stderr.bsl b/tests/fsharp/core/printing/output.off.stderr.bsl index 6926dcc9f34..dae4463d4db 100644 --- a/tests/fsharp/core/printing/output.off.stderr.bsl +++ b/tests/fsharp/core/printing/output.off.stderr.bsl @@ -2,347 +2,347 @@ #blaaaaaa // blaaaaaa is not a known command;; ^^^^^^^^^ -stdin(219,1): warning FS3353: Invalid directive '#blaaaaaa ' +stdin(221,1): warning FS3353: Invalid directive '#blaaaaaa ' type Regression4319_T0 = static member (+-+-+) = "0 arguments";; -----------------------------------------^^^^^ -stdin(571,42): warning FS1172: Infix operator member '+-+-+' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(573,42): warning FS1172: Infix operator member '+-+-+' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_T1 = static member (+-+-+) x = "1 argument";; -----------------------------------------^^^^^ -stdin(572,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(574,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_T1b = static member (+-+-+) (x) = "1 (argument) [brackets make no diff]";; -----------------------------------------^^^^^ -stdin(573,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(575,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_T1c = static member (+-+-+) x = let a,b = x in "1 argument, tuple typed from RHS. Still not OK";; -----------------------------------------^^^^^ -stdin(574,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(576,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_T1d = static member (+-+-+) (x:int*int) = "1 argument, tuple typed from LHS. Still not OK";; -----------------------------------------^^^^^ -stdin(575,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(577,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_T3 = static member (+-+-+) (x,y,z) = "3 arguments";; -----------------------------------------^^^^^ -stdin(577,42): warning FS1173: Infix operator member '+-+-+' has 3 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(579,42): warning FS1173: Infix operator member '+-+-+' has 3 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_U1 = static member (+-+-+) x moreArgs = "1 argument and further args";; -----------------------------------------^^^^^ -stdin(578,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(580,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_U1 = static member (+-+-+) x moreArgs = "1 argument and further args";; -----------------------------------------^^^^^ -stdin(578,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(580,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_U1b = static member (+-+-+) (x) moreArgs = "1 (argument) [brackets make no diff] and further args";; -----------------------------------------^^^^^ -stdin(579,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(581,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_U1b = static member (+-+-+) (x) moreArgs = "1 (argument) [brackets make no diff] and further args";; -----------------------------------------^^^^^ -stdin(579,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(581,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_U2 = static member (+-+-+) (x,y) moreArgs = "1 argument and further args";; -----------------------------------------^^^^^ -stdin(580,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(582,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_U3 = static member (+-+-+) (x,y,z) moreArgs = "1 argument and further args";; -----------------------------------------^^^^^ -stdin(581,42): warning FS1173: Infix operator member '+-+-+' has 3 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(583,42): warning FS1173: Infix operator member '+-+-+' has 3 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_U3 = static member (+-+-+) (x,y,z) moreArgs = "1 argument and further args";; -----------------------------------------^^^^^ -stdin(581,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(583,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (:=) = "COLON_EQUALS" -------------------^^ -stdin(584,20): warning FS1172: Infix operator member ':=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(586,20): warning FS1172: Infix operator member ':=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (:=) = "COLON_EQUALS" -------------------^^ -stdin(584,20): warning FS0086: The name '(:=)' should not be used as a member name because it is given a standard definition in the F# library over fixed types +stdin(586,20): warning FS0086: The name '(:=)' should not be used as a member name because it is given a standard definition in the F# library over fixed types static member (&) = "AMP" -------------------^ -stdin(588,20): warning FS1172: Infix operator member '&' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(590,20): warning FS1172: Infix operator member '&' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (&) = "AMP" -------------------^ -stdin(588,20): warning FS0086: The name '(&)' should not be used as a member name. If defining a static member for use from other CLI languages then use the name 'op_Amp' instead. +stdin(590,20): warning FS0086: The name '(&)' should not be used as a member name. If defining a static member for use from other CLI languages then use the name 'op_Amp' instead. static member (&^) = "AMP_AMP" -------------------^^ -stdin(589,20): warning FS1172: Infix operator member '&^' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(591,20): warning FS1172: Infix operator member '&^' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (=) = "EQUALS" -------------------^ -stdin(590,20): warning FS1172: Infix operator member '=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(592,20): warning FS1172: Infix operator member '=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (=) = "EQUALS" -------------------^ -stdin(590,20): warning FS0086: The name '(=)' 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 'op_Equality' instead. +stdin(592,20): warning FS0086: The name '(=)' 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 'op_Equality' instead. static member (!=) = "INFIX_COMPARE_OP" -------------------^^ -stdin(592,20): warning FS1172: Infix operator member '!=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(594,20): warning FS1172: Infix operator member '!=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (...=) = "INFIX_COMPARE_OP" // with $. prefix -------------------^^^^ -stdin(596,20): warning FS1172: Infix operator member '...=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(598,20): warning FS1172: Infix operator member '...=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (...!=) = "INFIX_COMPARE_OP" // with $. prefix -------------------^^^^^ -stdin(597,20): warning FS1172: Infix operator member '...!=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(599,20): warning FS1172: Infix operator member '...!=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (...<) = "INFIX_COMPARE_OP" // with $. prefix -------------------^^^^ -stdin(598,20): warning FS1172: Infix operator member '...<' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(600,20): warning FS1172: Infix operator member '...<' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (...>) = "INFIX_COMPARE_OP" // with $. prefix -------------------^^^^ -stdin(599,20): warning FS1172: Infix operator member '...>' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(601,20): warning FS1172: Infix operator member '...>' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member ($) = "DOLLAR" -------------------^ -stdin(601,20): warning FS1172: Infix operator member '$' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(603,20): warning FS1172: Infix operator member '$' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (<) = "LESS" -------------------^ -stdin(602,20): warning FS1172: Infix operator member '<' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(604,20): warning FS1172: Infix operator member '<' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (<) = "LESS" -------------------^ -stdin(602,20): warning FS0086: The name '(<)' 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 'op_LessThan' instead. +stdin(604,20): warning FS0086: The name '(<)' 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 'op_LessThan' instead. static member (>) = "GREATER" -------------------^ -stdin(603,20): warning FS1172: Infix operator member '>' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(605,20): warning FS1172: Infix operator member '>' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (>) = "GREATER" -------------------^ -stdin(603,20): warning FS0086: The name '(>)' 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 'op_GreaterThan' instead. +stdin(605,20): warning FS0086: The name '(>)' 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 'op_GreaterThan' instead. static member (@) = "INFIX_AT_HAT_OP" -------------------^ -stdin(604,20): warning FS1172: Infix operator member '@' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(606,20): warning FS1172: Infix operator member '@' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (@) = "INFIX_AT_HAT_OP" -------------------^ -stdin(604,20): warning FS0086: The name '(@)' should not be used as a member name because it is given a standard definition in the F# library over fixed types +stdin(606,20): warning FS0086: The name '(@)' should not be used as a member name because it is given a standard definition in the F# library over fixed types static member (^) = "INFIX_AT_HAT_OP" -------------------^ -stdin(605,20): warning FS1172: Infix operator member '^' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(607,20): warning FS1172: Infix operator member '^' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (^) = "INFIX_AT_HAT_OP" -------------------^ -stdin(605,20): warning FS0086: The name '(^)' should not be used as a member name because it is given a standard definition in the F# library over fixed types +stdin(607,20): warning FS0086: The name '(^)' should not be used as a member name because it is given a standard definition in the F# library over fixed types static member (...@) = "INFIX_AT_HAT_OP" // with $. prefix -------------------^^^^ -stdin(606,20): warning FS1172: Infix operator member '...@' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(608,20): warning FS1172: Infix operator member '...@' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (...^) = "INFIX_AT_HAT_OP" // with $. prefix -------------------^^^^ -stdin(607,20): warning FS1172: Infix operator member '...^' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(609,20): warning FS1172: Infix operator member '...^' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (%) = "PERCENT_OP" -------------------^ -stdin(608,20): warning FS1172: Infix operator member '%' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(610,20): warning FS1172: Infix operator member '%' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (-) = "MINUS" -------------------^ -stdin(610,20): warning FS1172: Infix operator member '-' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(612,20): warning FS1172: Infix operator member '-' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member ( * ) = "STAR" --------------------^ -stdin(611,21): warning FS1172: Infix operator member '*' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(613,21): warning FS1172: Infix operator member '*' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (/) = "INFIX_STAR_DIV_MOD_OP" -------------------^ -stdin(613,20): warning FS1172: Infix operator member '/' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(615,20): warning FS1172: Infix operator member '/' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member ( ...* ) = "INFIX_STAR_DIV_MOD_OP" // with $. prefix --------------------^^^^ -stdin(615,21): warning FS1172: Infix operator member '...*' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(617,21): warning FS1172: Infix operator member '...*' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member ( .../ ) = "INFIX_STAR_DIV_MOD_OP" // with $. prefix --------------------^^^^ -stdin(616,21): warning FS1172: Infix operator member '.../' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(618,21): warning FS1172: Infix operator member '.../' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member ( ...% ) = "INFIX_STAR_DIV_MOD_OP" // with $. prefix --------------------^^^^ -stdin(617,21): warning FS1172: Infix operator member '...%' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(619,21): warning FS1172: Infix operator member '...%' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member ( ** ) = "INFIX_STAR_STAR_OP" --------------------^^ -stdin(618,21): warning FS1172: Infix operator member '**' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(620,21): warning FS1172: Infix operator member '**' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... member this.ToString() = "ABC" ----------------^^^^^^^^ -stdin(623,17): warning FS0864: This new member hides the abstract member 'System.Object.ToString() : string'. Rename the member or use 'override' instead. +stdin(625,17): warning FS0864: This new member hides the abstract member 'System.Object.ToString() : string'. Rename the member or use 'override' instead. let x,f = it, (fun () -> !it);; // this will read from the static storage for 'it' -------------------------^ -stdin(643,26): info FS3370: The use of '!' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change '!cell' to 'cell.Value'. +stdin(645,26): info FS3370: The use of '!' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change '!cell' to 'cell.Value'. x := 3;; --^^ -stdin(645,3): info FS3370: The use of ':=' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'cell := expr' to 'cell.Value <- expr'. +stdin(647,3): info FS3370: The use of ':=' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'cell := expr' to 'cell.Value <- expr'. member this.M() = "string" ----------------^ -stdin(764,17): error FS0438: Duplicate method. The method 'M' has the same name and signature as another method in type 'ExpectDupMethod'. +stdin(766,17): error FS0438: Duplicate method. The method 'M' has the same name and signature as another method in type 'ExpectDupMethod'. member this.P = "string" ----------------^ -stdin(771,17): error FS0438: Duplicate method. The method 'get_P' has the same name and signature as another method in type 'ExpectDupProperty'. +stdin(773,17): error FS0438: Duplicate method. The method 'get_P' has the same name and signature as another method in type 'ExpectDupProperty'. type public IBPublic = interface inherit IAPrivate abstract Q : int end ------------------^^^^^^^^ -stdin(778,19): error FS0410: The type 'IAPrivate' is less accessible than the value, member or type 'IBPublic' it is used in. +stdin(780,19): error FS0410: The type 'IAPrivate' is less accessible than the value, member or type 'IBPublic' it is used in. type internal IBInternal = interface inherit IAPrivate abstract Q : int end ------------------^^^^^^^^^^ -stdin(783,19): error FS0410: The type 'IAPrivate' is less accessible than the value, member or type 'IBInternal' it is used in. +stdin(785,19): error FS0410: The type 'IAPrivate' is less accessible than the value, member or type 'IBInternal' it is used in. type public IBPublic = interface inherit IAInternal abstract Q : int end ------------------^^^^^^^^ -stdin(792,19): error FS0410: The type 'IAInternal' is less accessible than the value, member or type 'IBPublic' it is used in. +stdin(794,19): error FS0410: The type 'IAInternal' is less accessible than the value, member or type 'IBPublic' it is used in. override x.M(a:string) = 1 -------------------^ -stdin(824,20): error FS0361: The override 'M: string -> int' implements more than one abstract slot, e.g. 'abstract Regression4232.D.M: 'U -> int' and 'abstract Regression4232.D.M: 'T -> int' +stdin(826,20): error FS0361: The override 'M: string -> int' implements more than one abstract slot, e.g. 'abstract Regression4232.D.M: 'U -> int' and 'abstract Regression4232.D.M: 'T -> int' let (|A|B|) (x:int) = A x;; -----^^^^^ -stdin(832,6): error FS1210: Active pattern '|A|B|' 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' +stdin(834,6): error FS1210: Active pattern '|A|B|' 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' let (|A|B|) (x:'a) = A x;; -----^^^^^ -stdin(835,6): error FS1210: Active pattern '|A|B|' 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' +stdin(837,6): error FS1210: Active pattern '|A|B|' 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' let (|A|B|) (p:'a) (x:int) = A p;; -----^^^^^ -stdin(838,6): error FS1210: Active pattern '|A|B|' 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' +stdin(840,6): error FS1210: Active pattern '|A|B|' 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' let (|A|B|) = failwith "" : Choice;; -----^^^^^ -stdin(844,6): error FS1209: Active pattern '|A|B|' is not a function +stdin(846,6): error FS1209: Active pattern '|A|B|' is not a function diff --git a/tests/fsharp/core/printing/output.quiet.stderr.bsl b/tests/fsharp/core/printing/output.quiet.stderr.bsl index 6926dcc9f34..dae4463d4db 100644 --- a/tests/fsharp/core/printing/output.quiet.stderr.bsl +++ b/tests/fsharp/core/printing/output.quiet.stderr.bsl @@ -2,347 +2,347 @@ #blaaaaaa // blaaaaaa is not a known command;; ^^^^^^^^^ -stdin(219,1): warning FS3353: Invalid directive '#blaaaaaa ' +stdin(221,1): warning FS3353: Invalid directive '#blaaaaaa ' type Regression4319_T0 = static member (+-+-+) = "0 arguments";; -----------------------------------------^^^^^ -stdin(571,42): warning FS1172: Infix operator member '+-+-+' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(573,42): warning FS1172: Infix operator member '+-+-+' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_T1 = static member (+-+-+) x = "1 argument";; -----------------------------------------^^^^^ -stdin(572,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(574,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_T1b = static member (+-+-+) (x) = "1 (argument) [brackets make no diff]";; -----------------------------------------^^^^^ -stdin(573,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(575,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_T1c = static member (+-+-+) x = let a,b = x in "1 argument, tuple typed from RHS. Still not OK";; -----------------------------------------^^^^^ -stdin(574,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(576,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_T1d = static member (+-+-+) (x:int*int) = "1 argument, tuple typed from LHS. Still not OK";; -----------------------------------------^^^^^ -stdin(575,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(577,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_T3 = static member (+-+-+) (x,y,z) = "3 arguments";; -----------------------------------------^^^^^ -stdin(577,42): warning FS1173: Infix operator member '+-+-+' has 3 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(579,42): warning FS1173: Infix operator member '+-+-+' has 3 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_U1 = static member (+-+-+) x moreArgs = "1 argument and further args";; -----------------------------------------^^^^^ -stdin(578,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(580,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_U1 = static member (+-+-+) x moreArgs = "1 argument and further args";; -----------------------------------------^^^^^ -stdin(578,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(580,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_U1b = static member (+-+-+) (x) moreArgs = "1 (argument) [brackets make no diff] and further args";; -----------------------------------------^^^^^ -stdin(579,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(581,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_U1b = static member (+-+-+) (x) moreArgs = "1 (argument) [brackets make no diff] and further args";; -----------------------------------------^^^^^ -stdin(579,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(581,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_U2 = static member (+-+-+) (x,y) moreArgs = "1 argument and further args";; -----------------------------------------^^^^^ -stdin(580,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(582,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_U3 = static member (+-+-+) (x,y,z) moreArgs = "1 argument and further args";; -----------------------------------------^^^^^ -stdin(581,42): warning FS1173: Infix operator member '+-+-+' has 3 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(583,42): warning FS1173: Infix operator member '+-+-+' has 3 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_U3 = static member (+-+-+) (x,y,z) moreArgs = "1 argument and further args";; -----------------------------------------^^^^^ -stdin(581,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(583,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (:=) = "COLON_EQUALS" -------------------^^ -stdin(584,20): warning FS1172: Infix operator member ':=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(586,20): warning FS1172: Infix operator member ':=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (:=) = "COLON_EQUALS" -------------------^^ -stdin(584,20): warning FS0086: The name '(:=)' should not be used as a member name because it is given a standard definition in the F# library over fixed types +stdin(586,20): warning FS0086: The name '(:=)' should not be used as a member name because it is given a standard definition in the F# library over fixed types static member (&) = "AMP" -------------------^ -stdin(588,20): warning FS1172: Infix operator member '&' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(590,20): warning FS1172: Infix operator member '&' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (&) = "AMP" -------------------^ -stdin(588,20): warning FS0086: The name '(&)' should not be used as a member name. If defining a static member for use from other CLI languages then use the name 'op_Amp' instead. +stdin(590,20): warning FS0086: The name '(&)' should not be used as a member name. If defining a static member for use from other CLI languages then use the name 'op_Amp' instead. static member (&^) = "AMP_AMP" -------------------^^ -stdin(589,20): warning FS1172: Infix operator member '&^' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(591,20): warning FS1172: Infix operator member '&^' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (=) = "EQUALS" -------------------^ -stdin(590,20): warning FS1172: Infix operator member '=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(592,20): warning FS1172: Infix operator member '=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (=) = "EQUALS" -------------------^ -stdin(590,20): warning FS0086: The name '(=)' 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 'op_Equality' instead. +stdin(592,20): warning FS0086: The name '(=)' 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 'op_Equality' instead. static member (!=) = "INFIX_COMPARE_OP" -------------------^^ -stdin(592,20): warning FS1172: Infix operator member '!=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(594,20): warning FS1172: Infix operator member '!=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (...=) = "INFIX_COMPARE_OP" // with $. prefix -------------------^^^^ -stdin(596,20): warning FS1172: Infix operator member '...=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(598,20): warning FS1172: Infix operator member '...=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (...!=) = "INFIX_COMPARE_OP" // with $. prefix -------------------^^^^^ -stdin(597,20): warning FS1172: Infix operator member '...!=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(599,20): warning FS1172: Infix operator member '...!=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (...<) = "INFIX_COMPARE_OP" // with $. prefix -------------------^^^^ -stdin(598,20): warning FS1172: Infix operator member '...<' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(600,20): warning FS1172: Infix operator member '...<' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (...>) = "INFIX_COMPARE_OP" // with $. prefix -------------------^^^^ -stdin(599,20): warning FS1172: Infix operator member '...>' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(601,20): warning FS1172: Infix operator member '...>' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member ($) = "DOLLAR" -------------------^ -stdin(601,20): warning FS1172: Infix operator member '$' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(603,20): warning FS1172: Infix operator member '$' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (<) = "LESS" -------------------^ -stdin(602,20): warning FS1172: Infix operator member '<' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(604,20): warning FS1172: Infix operator member '<' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (<) = "LESS" -------------------^ -stdin(602,20): warning FS0086: The name '(<)' 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 'op_LessThan' instead. +stdin(604,20): warning FS0086: The name '(<)' 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 'op_LessThan' instead. static member (>) = "GREATER" -------------------^ -stdin(603,20): warning FS1172: Infix operator member '>' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(605,20): warning FS1172: Infix operator member '>' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (>) = "GREATER" -------------------^ -stdin(603,20): warning FS0086: The name '(>)' 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 'op_GreaterThan' instead. +stdin(605,20): warning FS0086: The name '(>)' 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 'op_GreaterThan' instead. static member (@) = "INFIX_AT_HAT_OP" -------------------^ -stdin(604,20): warning FS1172: Infix operator member '@' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(606,20): warning FS1172: Infix operator member '@' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (@) = "INFIX_AT_HAT_OP" -------------------^ -stdin(604,20): warning FS0086: The name '(@)' should not be used as a member name because it is given a standard definition in the F# library over fixed types +stdin(606,20): warning FS0086: The name '(@)' should not be used as a member name because it is given a standard definition in the F# library over fixed types static member (^) = "INFIX_AT_HAT_OP" -------------------^ -stdin(605,20): warning FS1172: Infix operator member '^' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(607,20): warning FS1172: Infix operator member '^' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (^) = "INFIX_AT_HAT_OP" -------------------^ -stdin(605,20): warning FS0086: The name '(^)' should not be used as a member name because it is given a standard definition in the F# library over fixed types +stdin(607,20): warning FS0086: The name '(^)' should not be used as a member name because it is given a standard definition in the F# library over fixed types static member (...@) = "INFIX_AT_HAT_OP" // with $. prefix -------------------^^^^ -stdin(606,20): warning FS1172: Infix operator member '...@' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(608,20): warning FS1172: Infix operator member '...@' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (...^) = "INFIX_AT_HAT_OP" // with $. prefix -------------------^^^^ -stdin(607,20): warning FS1172: Infix operator member '...^' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(609,20): warning FS1172: Infix operator member '...^' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (%) = "PERCENT_OP" -------------------^ -stdin(608,20): warning FS1172: Infix operator member '%' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(610,20): warning FS1172: Infix operator member '%' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (-) = "MINUS" -------------------^ -stdin(610,20): warning FS1172: Infix operator member '-' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(612,20): warning FS1172: Infix operator member '-' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member ( * ) = "STAR" --------------------^ -stdin(611,21): warning FS1172: Infix operator member '*' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(613,21): warning FS1172: Infix operator member '*' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (/) = "INFIX_STAR_DIV_MOD_OP" -------------------^ -stdin(613,20): warning FS1172: Infix operator member '/' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(615,20): warning FS1172: Infix operator member '/' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member ( ...* ) = "INFIX_STAR_DIV_MOD_OP" // with $. prefix --------------------^^^^ -stdin(615,21): warning FS1172: Infix operator member '...*' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(617,21): warning FS1172: Infix operator member '...*' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member ( .../ ) = "INFIX_STAR_DIV_MOD_OP" // with $. prefix --------------------^^^^ -stdin(616,21): warning FS1172: Infix operator member '.../' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(618,21): warning FS1172: Infix operator member '.../' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member ( ...% ) = "INFIX_STAR_DIV_MOD_OP" // with $. prefix --------------------^^^^ -stdin(617,21): warning FS1172: Infix operator member '...%' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(619,21): warning FS1172: Infix operator member '...%' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member ( ** ) = "INFIX_STAR_STAR_OP" --------------------^^ -stdin(618,21): warning FS1172: Infix operator member '**' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(620,21): warning FS1172: Infix operator member '**' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... member this.ToString() = "ABC" ----------------^^^^^^^^ -stdin(623,17): warning FS0864: This new member hides the abstract member 'System.Object.ToString() : string'. Rename the member or use 'override' instead. +stdin(625,17): warning FS0864: This new member hides the abstract member 'System.Object.ToString() : string'. Rename the member or use 'override' instead. let x,f = it, (fun () -> !it);; // this will read from the static storage for 'it' -------------------------^ -stdin(643,26): info FS3370: The use of '!' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change '!cell' to 'cell.Value'. +stdin(645,26): info FS3370: The use of '!' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change '!cell' to 'cell.Value'. x := 3;; --^^ -stdin(645,3): info FS3370: The use of ':=' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'cell := expr' to 'cell.Value <- expr'. +stdin(647,3): info FS3370: The use of ':=' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'cell := expr' to 'cell.Value <- expr'. member this.M() = "string" ----------------^ -stdin(764,17): error FS0438: Duplicate method. The method 'M' has the same name and signature as another method in type 'ExpectDupMethod'. +stdin(766,17): error FS0438: Duplicate method. The method 'M' has the same name and signature as another method in type 'ExpectDupMethod'. member this.P = "string" ----------------^ -stdin(771,17): error FS0438: Duplicate method. The method 'get_P' has the same name and signature as another method in type 'ExpectDupProperty'. +stdin(773,17): error FS0438: Duplicate method. The method 'get_P' has the same name and signature as another method in type 'ExpectDupProperty'. type public IBPublic = interface inherit IAPrivate abstract Q : int end ------------------^^^^^^^^ -stdin(778,19): error FS0410: The type 'IAPrivate' is less accessible than the value, member or type 'IBPublic' it is used in. +stdin(780,19): error FS0410: The type 'IAPrivate' is less accessible than the value, member or type 'IBPublic' it is used in. type internal IBInternal = interface inherit IAPrivate abstract Q : int end ------------------^^^^^^^^^^ -stdin(783,19): error FS0410: The type 'IAPrivate' is less accessible than the value, member or type 'IBInternal' it is used in. +stdin(785,19): error FS0410: The type 'IAPrivate' is less accessible than the value, member or type 'IBInternal' it is used in. type public IBPublic = interface inherit IAInternal abstract Q : int end ------------------^^^^^^^^ -stdin(792,19): error FS0410: The type 'IAInternal' is less accessible than the value, member or type 'IBPublic' it is used in. +stdin(794,19): error FS0410: The type 'IAInternal' is less accessible than the value, member or type 'IBPublic' it is used in. override x.M(a:string) = 1 -------------------^ -stdin(824,20): error FS0361: The override 'M: string -> int' implements more than one abstract slot, e.g. 'abstract Regression4232.D.M: 'U -> int' and 'abstract Regression4232.D.M: 'T -> int' +stdin(826,20): error FS0361: The override 'M: string -> int' implements more than one abstract slot, e.g. 'abstract Regression4232.D.M: 'U -> int' and 'abstract Regression4232.D.M: 'T -> int' let (|A|B|) (x:int) = A x;; -----^^^^^ -stdin(832,6): error FS1210: Active pattern '|A|B|' 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' +stdin(834,6): error FS1210: Active pattern '|A|B|' 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' let (|A|B|) (x:'a) = A x;; -----^^^^^ -stdin(835,6): error FS1210: Active pattern '|A|B|' 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' +stdin(837,6): error FS1210: Active pattern '|A|B|' 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' let (|A|B|) (p:'a) (x:int) = A p;; -----^^^^^ -stdin(838,6): error FS1210: Active pattern '|A|B|' 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' +stdin(840,6): error FS1210: Active pattern '|A|B|' 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' let (|A|B|) = failwith "" : Choice;; -----^^^^^ -stdin(844,6): error FS1209: Active pattern '|A|B|' is not a function +stdin(846,6): error FS1209: Active pattern '|A|B|' is not a function diff --git a/tests/fsharp/core/printing/output.stderr.bsl b/tests/fsharp/core/printing/output.stderr.bsl index 6926dcc9f34..dae4463d4db 100644 --- a/tests/fsharp/core/printing/output.stderr.bsl +++ b/tests/fsharp/core/printing/output.stderr.bsl @@ -2,347 +2,347 @@ #blaaaaaa // blaaaaaa is not a known command;; ^^^^^^^^^ -stdin(219,1): warning FS3353: Invalid directive '#blaaaaaa ' +stdin(221,1): warning FS3353: Invalid directive '#blaaaaaa ' type Regression4319_T0 = static member (+-+-+) = "0 arguments";; -----------------------------------------^^^^^ -stdin(571,42): warning FS1172: Infix operator member '+-+-+' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(573,42): warning FS1172: Infix operator member '+-+-+' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_T1 = static member (+-+-+) x = "1 argument";; -----------------------------------------^^^^^ -stdin(572,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(574,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_T1b = static member (+-+-+) (x) = "1 (argument) [brackets make no diff]";; -----------------------------------------^^^^^ -stdin(573,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(575,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_T1c = static member (+-+-+) x = let a,b = x in "1 argument, tuple typed from RHS. Still not OK";; -----------------------------------------^^^^^ -stdin(574,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(576,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_T1d = static member (+-+-+) (x:int*int) = "1 argument, tuple typed from LHS. Still not OK";; -----------------------------------------^^^^^ -stdin(575,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(577,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_T3 = static member (+-+-+) (x,y,z) = "3 arguments";; -----------------------------------------^^^^^ -stdin(577,42): warning FS1173: Infix operator member '+-+-+' has 3 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(579,42): warning FS1173: Infix operator member '+-+-+' has 3 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_U1 = static member (+-+-+) x moreArgs = "1 argument and further args";; -----------------------------------------^^^^^ -stdin(578,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(580,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_U1 = static member (+-+-+) x moreArgs = "1 argument and further args";; -----------------------------------------^^^^^ -stdin(578,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(580,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_U1b = static member (+-+-+) (x) moreArgs = "1 (argument) [brackets make no diff] and further args";; -----------------------------------------^^^^^ -stdin(579,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(581,42): warning FS1173: Infix operator member '+-+-+' has 1 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_U1b = static member (+-+-+) (x) moreArgs = "1 (argument) [brackets make no diff] and further args";; -----------------------------------------^^^^^ -stdin(579,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(581,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_U2 = static member (+-+-+) (x,y) moreArgs = "1 argument and further args";; -----------------------------------------^^^^^ -stdin(580,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(582,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_U3 = static member (+-+-+) (x,y,z) moreArgs = "1 argument and further args";; -----------------------------------------^^^^^ -stdin(581,42): warning FS1173: Infix operator member '+-+-+' has 3 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(583,42): warning FS1173: Infix operator member '+-+-+' has 3 initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... type Regression4319_U3 = static member (+-+-+) (x,y,z) moreArgs = "1 argument and further args";; -----------------------------------------^^^^^ -stdin(581,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(583,42): warning FS1174: Infix operator member '+-+-+' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (:=) = "COLON_EQUALS" -------------------^^ -stdin(584,20): warning FS1172: Infix operator member ':=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(586,20): warning FS1172: Infix operator member ':=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (:=) = "COLON_EQUALS" -------------------^^ -stdin(584,20): warning FS0086: The name '(:=)' should not be used as a member name because it is given a standard definition in the F# library over fixed types +stdin(586,20): warning FS0086: The name '(:=)' should not be used as a member name because it is given a standard definition in the F# library over fixed types static member (&) = "AMP" -------------------^ -stdin(588,20): warning FS1172: Infix operator member '&' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(590,20): warning FS1172: Infix operator member '&' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (&) = "AMP" -------------------^ -stdin(588,20): warning FS0086: The name '(&)' should not be used as a member name. If defining a static member for use from other CLI languages then use the name 'op_Amp' instead. +stdin(590,20): warning FS0086: The name '(&)' should not be used as a member name. If defining a static member for use from other CLI languages then use the name 'op_Amp' instead. static member (&^) = "AMP_AMP" -------------------^^ -stdin(589,20): warning FS1172: Infix operator member '&^' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(591,20): warning FS1172: Infix operator member '&^' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (=) = "EQUALS" -------------------^ -stdin(590,20): warning FS1172: Infix operator member '=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(592,20): warning FS1172: Infix operator member '=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (=) = "EQUALS" -------------------^ -stdin(590,20): warning FS0086: The name '(=)' 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 'op_Equality' instead. +stdin(592,20): warning FS0086: The name '(=)' 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 'op_Equality' instead. static member (!=) = "INFIX_COMPARE_OP" -------------------^^ -stdin(592,20): warning FS1172: Infix operator member '!=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(594,20): warning FS1172: Infix operator member '!=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (...=) = "INFIX_COMPARE_OP" // with $. prefix -------------------^^^^ -stdin(596,20): warning FS1172: Infix operator member '...=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(598,20): warning FS1172: Infix operator member '...=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (...!=) = "INFIX_COMPARE_OP" // with $. prefix -------------------^^^^^ -stdin(597,20): warning FS1172: Infix operator member '...!=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(599,20): warning FS1172: Infix operator member '...!=' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (...<) = "INFIX_COMPARE_OP" // with $. prefix -------------------^^^^ -stdin(598,20): warning FS1172: Infix operator member '...<' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(600,20): warning FS1172: Infix operator member '...<' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (...>) = "INFIX_COMPARE_OP" // with $. prefix -------------------^^^^ -stdin(599,20): warning FS1172: Infix operator member '...>' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(601,20): warning FS1172: Infix operator member '...>' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member ($) = "DOLLAR" -------------------^ -stdin(601,20): warning FS1172: Infix operator member '$' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(603,20): warning FS1172: Infix operator member '$' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (<) = "LESS" -------------------^ -stdin(602,20): warning FS1172: Infix operator member '<' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(604,20): warning FS1172: Infix operator member '<' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (<) = "LESS" -------------------^ -stdin(602,20): warning FS0086: The name '(<)' 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 'op_LessThan' instead. +stdin(604,20): warning FS0086: The name '(<)' 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 'op_LessThan' instead. static member (>) = "GREATER" -------------------^ -stdin(603,20): warning FS1172: Infix operator member '>' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(605,20): warning FS1172: Infix operator member '>' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (>) = "GREATER" -------------------^ -stdin(603,20): warning FS0086: The name '(>)' 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 'op_GreaterThan' instead. +stdin(605,20): warning FS0086: The name '(>)' 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 'op_GreaterThan' instead. static member (@) = "INFIX_AT_HAT_OP" -------------------^ -stdin(604,20): warning FS1172: Infix operator member '@' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(606,20): warning FS1172: Infix operator member '@' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (@) = "INFIX_AT_HAT_OP" -------------------^ -stdin(604,20): warning FS0086: The name '(@)' should not be used as a member name because it is given a standard definition in the F# library over fixed types +stdin(606,20): warning FS0086: The name '(@)' should not be used as a member name because it is given a standard definition in the F# library over fixed types static member (^) = "INFIX_AT_HAT_OP" -------------------^ -stdin(605,20): warning FS1172: Infix operator member '^' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(607,20): warning FS1172: Infix operator member '^' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (^) = "INFIX_AT_HAT_OP" -------------------^ -stdin(605,20): warning FS0086: The name '(^)' should not be used as a member name because it is given a standard definition in the F# library over fixed types +stdin(607,20): warning FS0086: The name '(^)' should not be used as a member name because it is given a standard definition in the F# library over fixed types static member (...@) = "INFIX_AT_HAT_OP" // with $. prefix -------------------^^^^ -stdin(606,20): warning FS1172: Infix operator member '...@' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(608,20): warning FS1172: Infix operator member '...@' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (...^) = "INFIX_AT_HAT_OP" // with $. prefix -------------------^^^^ -stdin(607,20): warning FS1172: Infix operator member '...^' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(609,20): warning FS1172: Infix operator member '...^' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (%) = "PERCENT_OP" -------------------^ -stdin(608,20): warning FS1172: Infix operator member '%' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(610,20): warning FS1172: Infix operator member '%' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (-) = "MINUS" -------------------^ -stdin(610,20): warning FS1172: Infix operator member '-' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(612,20): warning FS1172: Infix operator member '-' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member ( * ) = "STAR" --------------------^ -stdin(611,21): warning FS1172: Infix operator member '*' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(613,21): warning FS1172: Infix operator member '*' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member (/) = "INFIX_STAR_DIV_MOD_OP" -------------------^ -stdin(613,20): warning FS1172: Infix operator member '/' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(615,20): warning FS1172: Infix operator member '/' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member ( ...* ) = "INFIX_STAR_DIV_MOD_OP" // with $. prefix --------------------^^^^ -stdin(615,21): warning FS1172: Infix operator member '...*' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(617,21): warning FS1172: Infix operator member '...*' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member ( .../ ) = "INFIX_STAR_DIV_MOD_OP" // with $. prefix --------------------^^^^ -stdin(616,21): warning FS1172: Infix operator member '.../' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(618,21): warning FS1172: Infix operator member '.../' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member ( ...% ) = "INFIX_STAR_DIV_MOD_OP" // with $. prefix --------------------^^^^ -stdin(617,21): warning FS1172: Infix operator member '...%' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(619,21): warning FS1172: Infix operator member '...%' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... static member ( ** ) = "INFIX_STAR_STAR_OP" --------------------^^ -stdin(618,21): warning FS1172: Infix operator member '**' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... +stdin(620,21): warning FS1172: Infix operator member '**' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... member this.ToString() = "ABC" ----------------^^^^^^^^ -stdin(623,17): warning FS0864: This new member hides the abstract member 'System.Object.ToString() : string'. Rename the member or use 'override' instead. +stdin(625,17): warning FS0864: This new member hides the abstract member 'System.Object.ToString() : string'. Rename the member or use 'override' instead. let x,f = it, (fun () -> !it);; // this will read from the static storage for 'it' -------------------------^ -stdin(643,26): info FS3370: The use of '!' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change '!cell' to 'cell.Value'. +stdin(645,26): info FS3370: The use of '!' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change '!cell' to 'cell.Value'. x := 3;; --^^ -stdin(645,3): info FS3370: The use of ':=' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'cell := expr' to 'cell.Value <- expr'. +stdin(647,3): info FS3370: The use of ':=' from the F# library is deprecated. See https://aka.ms/fsharp-refcell-ops. For example, please change 'cell := expr' to 'cell.Value <- expr'. member this.M() = "string" ----------------^ -stdin(764,17): error FS0438: Duplicate method. The method 'M' has the same name and signature as another method in type 'ExpectDupMethod'. +stdin(766,17): error FS0438: Duplicate method. The method 'M' has the same name and signature as another method in type 'ExpectDupMethod'. member this.P = "string" ----------------^ -stdin(771,17): error FS0438: Duplicate method. The method 'get_P' has the same name and signature as another method in type 'ExpectDupProperty'. +stdin(773,17): error FS0438: Duplicate method. The method 'get_P' has the same name and signature as another method in type 'ExpectDupProperty'. type public IBPublic = interface inherit IAPrivate abstract Q : int end ------------------^^^^^^^^ -stdin(778,19): error FS0410: The type 'IAPrivate' is less accessible than the value, member or type 'IBPublic' it is used in. +stdin(780,19): error FS0410: The type 'IAPrivate' is less accessible than the value, member or type 'IBPublic' it is used in. type internal IBInternal = interface inherit IAPrivate abstract Q : int end ------------------^^^^^^^^^^ -stdin(783,19): error FS0410: The type 'IAPrivate' is less accessible than the value, member or type 'IBInternal' it is used in. +stdin(785,19): error FS0410: The type 'IAPrivate' is less accessible than the value, member or type 'IBInternal' it is used in. type public IBPublic = interface inherit IAInternal abstract Q : int end ------------------^^^^^^^^ -stdin(792,19): error FS0410: The type 'IAInternal' is less accessible than the value, member or type 'IBPublic' it is used in. +stdin(794,19): error FS0410: The type 'IAInternal' is less accessible than the value, member or type 'IBPublic' it is used in. override x.M(a:string) = 1 -------------------^ -stdin(824,20): error FS0361: The override 'M: string -> int' implements more than one abstract slot, e.g. 'abstract Regression4232.D.M: 'U -> int' and 'abstract Regression4232.D.M: 'T -> int' +stdin(826,20): error FS0361: The override 'M: string -> int' implements more than one abstract slot, e.g. 'abstract Regression4232.D.M: 'U -> int' and 'abstract Regression4232.D.M: 'T -> int' let (|A|B|) (x:int) = A x;; -----^^^^^ -stdin(832,6): error FS1210: Active pattern '|A|B|' 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' +stdin(834,6): error FS1210: Active pattern '|A|B|' 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' let (|A|B|) (x:'a) = A x;; -----^^^^^ -stdin(835,6): error FS1210: Active pattern '|A|B|' 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' +stdin(837,6): error FS1210: Active pattern '|A|B|' 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' let (|A|B|) (p:'a) (x:int) = A p;; -----^^^^^ -stdin(838,6): error FS1210: Active pattern '|A|B|' 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' +stdin(840,6): error FS1210: Active pattern '|A|B|' 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' let (|A|B|) = failwith "" : Choice;; -----^^^^^ -stdin(844,6): error FS1209: Active pattern '|A|B|' is not a function +stdin(846,6): error FS1209: Active pattern '|A|B|' is not a function