From b2700233c4c7a0a08e09d47dc8d2cd8e489be915 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Mon, 3 Apr 2023 14:32:41 +0200 Subject: [PATCH 01/13] Bump versions --- azure-pipelines.yml | 6 +++--- eng/Versions.props | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 07b6477a7e..61ea283f46 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -86,11 +86,11 @@ stages: # Signed build # #-------------------------------------------------------------------------------------------------------------------# - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - - ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/release/dev17.6') }}: + - ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/release/dev17.7') }}: - template: /eng/common/templates/job/onelocbuild.yml parameters: MirrorRepo: fsharp - MirrorBranch: release/dev17.6 + MirrorBranch: release/dev17.7 LclSource: lclFilesfromPackage LclPackageId: 'LCL-JUNO-PROD-FSHARP' - template: /eng/common/templates/jobs/jobs.yml @@ -695,7 +695,7 @@ stages: - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - template: eng/release/insert-into-vs.yml parameters: - componentBranchName: refs/heads/release/dev17.6 + componentBranchName: refs/heads/release/dev17.7 insertTargetBranch: main insertTeamEmail: fsharpteam@microsoft.com insertTeamName: 'F#' diff --git a/eng/Versions.props b/eng/Versions.props index 8cb0ebaf00..4651f0b817 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -15,7 +15,7 @@ 7 0 - 300 + 400 0 @@ -57,7 +57,7 @@ 17 - 6 + 7 $(VSMajorVersion).0 $(VSMajorVersion).$(VSMinorVersion).0 $(VSAssemblyVersionPrefix).0 From fa9e374d121e02a73f9528dc14264b827fc9df77 Mon Sep 17 00:00:00 2001 From: dotnet bot Date: Mon, 3 Apr 2023 05:51:37 -0700 Subject: [PATCH 02/13] Localized file check-in by OneLocBuild Task: Build definition ID 499: Build ID 2149470 --- .../FSharp.Editor/xlf/FSharp.Editor.cs.xlf | 38 ++++++++++--------- .../FSharp.Editor/xlf/FSharp.Editor.es.xlf | 20 +++++----- .../FSharp.Editor/xlf/FSharp.Editor.ja.xlf | 20 +++++----- .../FSharp.Editor/xlf/FSharp.Editor.ko.xlf | 16 ++++---- .../FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf | 36 +++++++++--------- .../FSharp.Editor/xlf/FSharp.Editor.ru.xlf | 20 +++++----- .../FSharp.Editor/xlf/FSharp.Editor.tr.xlf | 16 ++++---- .../xlf/FSharp.Editor.zh-Hans.xlf | 20 +++++----- .../xlf/FSharp.Editor.zh-Hant.xlf | 16 ++++---- 9 files changed, 102 insertions(+), 100 deletions(-) diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf index f8c978123f..e7eae12ba8 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf @@ -38,16 +38,18 @@ Display return type hints (preview); Display inline parameter name hints (preview);Beer; Live Buffers; Use live (unsaved) buffers for checking - Block Structure Guides; -Show structure guidelines for F# code; -Outlining; -Show outlining and collapsible nodes for F# code; -Inline hints; -Display inline type hints (preview); -Display return type hints (preview); -Display inline parameter name hints (preview);Beer; -Live Buffers; -Use live (unsaved) buffers for checking + Vodítka struktury bloků; + +Zobrazit pokyny pro strukturu kódu F#; +Osnova; +Zobrazit sbalitelné a sbalitelné uzly pro kód F#; +Vložené tipy; +Zobrazovat pomocné parametry vloženého typu (Preview); +Zobrazit pomocné parametry návratového typu (Preview); +Zobrazit vložené nápovědy k názvům parametrů (Preview); Pivo; + +Živé vyrovnávací paměti; +Pro kontrolu použijte živé (neuložené) vyrovnávací paměti. @@ -191,14 +193,14 @@ Show navigation links as; Solid underline; Dot underline; Dash underline; - Formatting; -Preferred description width in characters; -Format signature to the given width by adding line breaks conforming with F# syntax rules; -Navigation links; -Show navigation links as; -Solid underline; -Dot underline; -Dash underline; + Formátování; +Upřednostňovaná šířka popisu ve znacích; +Formátování podpisu na danou šířku přidáním konců řádků podle pravidel syntaxe F#; +Navigační odkazy; +Zobrazit navigační odkazy jako; +Plné podtržení; +Tečkované podtržení; +Přerušované podtržení; diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf index 370a86e7b9..c38bd1bc22 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf @@ -38,16 +38,16 @@ Display return type hints (preview); Display inline parameter name hints (preview);Beer; Live Buffers; Use live (unsaved) buffers for checking - Block Structure Guides; -Show structure guidelines for F# code; -Outlining; -Show outlining and collapsible nodes for F# code; -Inline hints; -Display inline type hints (preview); -Display return type hints (preview); -Display inline parameter name hints (preview);Beer; -Live Buffers; -Use live (unsaved) buffers for checking + Guías de estructura de bloques; +Mostrar guías de estructura para código F#; +Esquema; +Mostrar contorno y nodos colapsables para código F#; +Sugerencias inline; +Mostrar sugerencias de tipo en línea (vista previa); +Mostrar sugerencias de tipo retorno (vista previa); +Mostrar sugerencias de nombres de parámetros en línea (vista previa); Beer; +Búferes activos; +Usar buffers vivos (no guardados) para comprobar diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf index 0564a0046d..98fb61af64 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf @@ -38,16 +38,16 @@ Display return type hints (preview); Display inline parameter name hints (preview);Beer; Live Buffers; Use live (unsaved) buffers for checking - Block Structure Guides; -Show structure guidelines for F# code; -Outlining; -Show outlining and collapsible nodes for F# code; -Inline hints; -Display inline type hints (preview); -Display return type hints (preview); -Display inline parameter name hints (preview);Beer; -Live Buffers; -Use live (unsaved) buffers for checking + ブロック構造ガイド; +F# コードの構造ガイドラインを表示します。 +アウトライン; +F# コードのアウトラインと折りたたみ可能なノードを表示します。 +インライン ヒント; +インライン型のヒントを表示する (プレビュー); +戻り値型のヒントを表示する (プレビュー); +インライン パラメーター名のヒントを表示する (プレビュー);ビール; +ライブ バッファー; +ライブ (未保存) バッファーをチェックに使用する diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf index e452c01500..0198c4fa0f 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf @@ -191,14 +191,14 @@ Show navigation links as; Solid underline; Dot underline; Dash underline; - Formatting; -Preferred description width in characters; -Format signature to the given width by adding line breaks conforming with F# syntax rules; -Navigation links; -Show navigation links as; -Solid underline; -Dot underline; -Dash underline; + 서식; +기본 설정 문자 설명 너비; +F# 구문 규칙에 맞는 줄바꿈을 추가하여 지정된 너비에 서명 서식 지정; +탐색 링크; +탐색 링크 표시 형식; +실선 밑줄; +점선 밑줄; +대시 밑줄; diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf index 797903f635..fd3d363df9 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf @@ -38,16 +38,16 @@ Display return type hints (preview); Display inline parameter name hints (preview);Beer; Live Buffers; Use live (unsaved) buffers for checking - Block Structure Guides; -Show structure guidelines for F# code; -Outlining; -Show outlining and collapsible nodes for F# code; -Inline hints; -Display inline type hints (preview); -Display return type hints (preview); -Display inline parameter name hints (preview);Beer; -Live Buffers; -Use live (unsaved) buffers for checking + Guias de Estrutura de Bloco; +Mostrar diretrizes de estrutura para código F#; +Estrutura de tópicos; +Mostrar nós de estrutura de tópicos e recolhíveis para código F#; +Dicas embutidas; +Exibir dicas de tipo embutido (versão prévia); +Exibir dicas de tipo de retorno (versão prévia); +Exibir dicas de nome de parâmetro embutido (versão prévia);Cerveja; +Buffers Dinâmicos; +Usar buffers dinâmicos (não salvos) para verificação @@ -191,14 +191,14 @@ Show navigation links as; Solid underline; Dot underline; Dash underline; - Formatting; -Preferred description width in characters; -Format signature to the given width by adding line breaks conforming with F# syntax rules; -Navigation links; -Show navigation links as; -Solid underline; -Dot underline; -Dash underline; + Formatação; +Largura da descrição preferida em caracteres; +Formate a assinatura para a largura especificada adicionando quebras de linha em conformidade com as regras de sintaxe do F#; +Links de navegação; +Mostrar links de navegação como; +Sublinhado sólido; +Ponto sublinhado; +Traço sublinhado; diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf index 0cc3381e12..d707b9b609 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf @@ -38,16 +38,16 @@ Display return type hints (preview); Display inline parameter name hints (preview);Beer; Live Buffers; Use live (unsaved) buffers for checking - Block Structure Guides; -Show structure guidelines for F# code; -Outlining; -Show outlining and collapsible nodes for F# code; -Inline hints; -Display inline type hints (preview); -Display return type hints (preview); -Display inline parameter name hints (preview);Beer; -Live Buffers; -Use live (unsaved) buffers for checking + Руководства по блочной структуре; +Показать рекомендации по структуре для кода F#; +Структурирование; +Показать структурные и сворачиваемые узлы для кода F#; +Встроенные подсказки; +Отображение подсказок встроенного типа (предварительная версия); +Отображение подсказок типа возвращаемого значения (предварительная версия); +Отображение встроенных подсказок имени параметра (предварительная версия);пиво; +Динамические буферы; +Использовать динамические (несохраненные) буферы для проверки diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf index 0e2fb0750f..64dd8533cf 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf @@ -191,14 +191,14 @@ Show navigation links as; Solid underline; Dot underline; Dash underline; - Formatting; -Preferred description width in characters; -Format signature to the given width by adding line breaks conforming with F# syntax rules; -Navigation links; -Show navigation links as; -Solid underline; -Dot underline; -Dash underline; + Biçimlendirme; +Karakter olarak tercih edilen açıklama genişliği; +F# söz dizimi kurallarına uyan satır sonları ekleyerek imzayı verilen genişliğe biçimlendir; +Gezinti bağlantıları; +Gezinti bağlantılarını şöyle göster; +Düz alt çizgi; +Nokta alt çizgi; +Tire alt çizgisi; diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf index 2429577e7f..d913ee79ed 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf @@ -38,16 +38,16 @@ Display return type hints (preview); Display inline parameter name hints (preview);Beer; Live Buffers; Use live (unsaved) buffers for checking - Block Structure Guides; -Show structure guidelines for F# code; -Outlining; -Show outlining and collapsible nodes for F# code; -Inline hints; -Display inline type hints (preview); -Display return type hints (preview); -Display inline parameter name hints (preview);Beer; -Live Buffers; -Use live (unsaved) buffers for checking + 块结构指南; +显示 F# 代码的结构指南; +大纲; +显示 F# 代码的大纲和可折叠节点; +内联提示; +显示内联类型提示(预览); +显示返回类型提示(预览); +显示内联参数名称提示(预览);啤酒; +实时缓冲区; +使用实时(未保存)缓冲区进行检查 diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf index 01da1d3b88..8dbb07d39e 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf @@ -191,14 +191,14 @@ Show navigation links as; Solid underline; Dot underline; Dash underline; - Formatting; -Preferred description width in characters; -Format signature to the given width by adding line breaks conforming with F# syntax rules; -Navigation links; -Show navigation links as; -Solid underline; -Dot underline; -Dash underline; + 格式化; +慣用描述寬度 (以字元為單位); +透過新增符合 F# 語法規則的分行符號,將簽章格式設定為指定寬度; +瀏覽連結; +將瀏覽連結顯示為; +實心底線; +點底線; +虛線底線; From a641fc82b78ebd299c2cb985d91c8780e9a9ec83 Mon Sep 17 00:00:00 2001 From: dotnet bot Date: Mon, 3 Apr 2023 05:57:09 -0700 Subject: [PATCH 03/13] Localized file check-in by OneLocBuild Task: Build definition ID 499: Build ID 2149470 --- vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf | 2 +- vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf | 2 +- vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf | 2 +- vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf | 2 +- vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf | 2 +- vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf index 82c5077a43..e4a666c1c5 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf @@ -109,7 +109,7 @@ Display return type hints (preview) - Display return type hints (preview) + Zobrazení tipů pro návratový typ (Preview) diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf index 3ea40e7e8e..fa89ad6e58 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf @@ -109,7 +109,7 @@ Display return type hints (preview) - Display return type hints (preview) + Mostrar sugerencias de tipo retorno (vista previa) diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf index 8221f153bc..a050c2f5aa 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf @@ -109,7 +109,7 @@ Display return type hints (preview) - Display return type hints (preview) + 戻り値型のヒントを表示する (プレビュー) diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf index 08f20f7424..298845fc9b 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf @@ -109,7 +109,7 @@ Display return type hints (preview) - Display return type hints (preview) + Exibir dicas de tipo de retorno (versão prévia) diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf index bbdd32d5bd..afa4ade0fc 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf @@ -109,7 +109,7 @@ Display return type hints (preview) - Display return type hints (preview) + Отображение подсказок типа возвращаемого значения (предварительная версия) diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf index 47261aab95..3ffc7b61b1 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf @@ -109,7 +109,7 @@ Display return type hints (preview) - Display return type hints (preview) + 显示返回类型提示(预览) From e54982758dba20e24c326b9bc862b8b792d425d1 Mon Sep 17 00:00:00 2001 From: dotnet bot Date: Thu, 6 Apr 2023 08:41:29 -0700 Subject: [PATCH 04/13] Merge main to release/dev17.7 (#15041) * Make trimmed printf "%A" for F# records work when trimmed (#14941) * Add tests * Embed types * baselines + fsx * Extra telemetry for codefixes (#15035) * BDN config option - ignore that Test.Utilities is not optimized (#15038) * Unignore files for formatting (.fantomasignore) if the underlying Fantomas issue has been resolved (#14960) * SI.fs fantomas'd * unignore .fsi files in Fsharp.Core * Removing commented out files from fantomasignore * Automated command ran: fantomas Co-authored-by: T-Gro <46543583+T-Gro@users.noreply.github.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --------- Co-authored-by: Kevin Ransom (msft) Co-authored-by: Petr Co-authored-by: Tomas Grosup Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .fantomasignore | 8 - src/Compiler/AbstractIL/il.fs | 13 + src/Compiler/AbstractIL/il.fsi | 7 +- src/Compiler/CodeGen/IlxGen.fs | 257 ++- src/Compiler/Driver/CreateILModule.fs | 2 +- src/Compiler/Interactive/fsi.fs | 3 +- src/Compiler/TypedTree/TcGlobals.fs | 51 +- src/FSharp.Core/SI.fs | 60 +- src/FSharp.Core/array.fsi | 539 +++--- src/FSharp.Core/prim-types.fs | 6 +- src/FSharp.Core/prim-types.fsi | 6 +- src/FSharp.Core/seq.fsi | 265 +-- src/FSharp.Core/tasks.fsi | 477 ++--- .../Compare06.fsx.il.net472.bsl | 649 +++++++ ...sx.il.bsl => Compare06.fsx.il.netcore.bsl} | 1051 +++++------ .../Equals05.fsx.il.net472.bsl | 651 +++++++ ...fsx.il.bsl => Equals05.fsx.il.netcore.bsl} | 1055 +++++------ .../Hash08.fsx.il.net472.bsl | 639 +++++++ ...8.fsx.il.bsl => Hash08.fsx.il.netcore.bsl} | 1031 +++++----- .../TestFunction17.fs.il.net472.debug.bsl | 716 +++++++ .../TestFunction17.fs.il.net472.release.bsl | 650 +++++++ ...=> TestFunction17.fs.il.netcore.debug.bsl} | 3 + ... TestFunction17.fs.il.netcore.release.bsl} | 1055 +++++------ .../TestFunction24.fs.il.net472.debug.bsl | 1065 +++++++++++ .../TestFunction24.fs.il.net472.release.bsl | 951 ++++++++++ ...=> TestFunction24.fs.il.netcore.debug.bsl} | 3 + ... TestFunction24.fs.il.netcore.release.bsl} | 1657 +++++++++-------- .../CompilerServiceBenchmarks/Program.fs | 3 +- .../EmittedIL/ReferenceAssemblyTests.fs | 393 +++- .../SelfContained_Trimming_Test/NuGet.Config | 2 +- .../SelfContained_Trimming_Test/Program.fs | 52 +- .../SelfContained_Trimming_Test.fsproj | 2 +- .../SelfContained_Trimming_Test/check.ps1 | 2 +- .../CodeFix/AddInstanceMemberParameter.fs | 3 +- .../AddMissingEqualsToTypeDefinition.fs | 5 +- .../CodeFix/AddMissingFunKeyword.fs | 3 +- ...eywordToDisposableConstructorInvocation.fs | 3 +- .../CodeFix/AddOpenCodeFixProvider.fs | 3 +- .../ChangePrefixNegationToInfixSubtraction.fs | 3 +- .../ChangeRefCellDerefToNotExpression.fs | 9 +- .../FSharp.Editor/CodeFix/ChangeToUpcast.fs | 3 +- .../FSharp.Editor/CodeFix/CodeFixHelpers.fs | 19 +- .../ConvertCSharpLambdaToFSharpLambda.fs | 9 +- .../CodeFix/ConvertCSharpUsingToFSharpOpen.fs | 9 +- .../ConvertToNotEqualsEqualityExpression.fs | 9 +- ...ConvertToSingleEqualsEqualityExpression.fs | 9 +- .../FSharp.Editor/CodeFix/FixIndexerAccess.fs | 9 +- .../CodeFix/MakeDeclarationMutable.fs | 6 +- .../CodeFix/MakeOuterBindingRecursive.fs | 3 +- .../CodeFix/RemoveReturnOrYield.fs | 3 +- ...SuperflousCaptureForUnionCaseWithNoData.fs | 9 +- .../CodeFix/RemoveUnusedBinding.fs | 9 +- .../CodeFix/RemoveUnusedOpens.fs | 4 +- .../CodeFix/RenameParamToMatchSignature.fs | 4 +- .../CodeFix/RenameUnusedValue.fs | 4 +- .../CodeFix/ReplaceWithSuggestion.fs | 3 +- .../src/FSharp.Editor/CodeFix/SimplifyName.fs | 3 +- .../CodeFix/UseMutationWhenValueIsMutable.fs | 6 +- .../CodeFix/UseTripleQuotedInterpolation.fs | 9 +- .../src/FSharp.Editor/Common/Constants.fs | 83 + 60 files changed, 9772 insertions(+), 3794 deletions(-) create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare06.fsx.il.net472.bsl rename tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/{Compare06.fsx.il.bsl => Compare06.fsx.il.netcore.bsl} (95%) create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals05.fsx.il.net472.bsl rename tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/{Equals05.fsx.il.bsl => Equals05.fsx.il.netcore.bsl} (95%) create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash08.fsx.il.net472.bsl rename tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/{Hash08.fsx.il.bsl => Hash08.fsx.il.netcore.bsl} (95%) create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.net472.debug.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.net472.release.bsl rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction17.fs.il.debug.bsl => TestFunction17.fs.il.netcore.debug.bsl} (97%) rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction17.fs.il.release.bsl => TestFunction17.fs.il.netcore.release.bsl} (96%) create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.net472.debug.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.net472.release.bsl rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction24.fs.il.debug.bsl => TestFunction24.fs.il.netcore.debug.bsl} (98%) rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction24.fs.il.release.bsl => TestFunction24.fs.il.netcore.release.bsl} (96%) diff --git a/.fantomasignore b/.fantomasignore index 5abcb43bf4..0bec7ed148 100644 --- a/.fantomasignore +++ b/.fantomasignore @@ -107,9 +107,6 @@ src/FSharp.Core/printf.fs src/FSharp.Core/Query.fs src/FSharp.Core/seqcore.fs -# Fantomas limitation https://github.com/fsprojects/fantomas/issues/2264 - -src/FSharp.Core/SI.fs # Fantomas limitations on implementation files (to investigate) @@ -139,8 +136,3 @@ src/FSharp.Core/Query.fsi src/FSharp.Core/resumable.fsi src/FSharp.Core/async.fsi -# Fantomas limitations on signature files in FSharp.Core (https://github.com/fsprojects/fantomas/issues/2230) - -src/FSharp.Core/array.fsi -src/FSharp.Core/tasks.fsi -src/FSharp.Core/seq.fsi diff --git a/src/Compiler/AbstractIL/il.fs b/src/Compiler/AbstractIL/il.fs index 2a80d40fdc..363004b2ff 100644 --- a/src/Compiler/AbstractIL/il.fs +++ b/src/Compiler/AbstractIL/il.fs @@ -3292,6 +3292,12 @@ let destILArrTy ty = [] let tname_Attribute = "System.Attribute" +[] +let tname_Enum = "System.Enum" + +[] +let tname_SealedAttribute = "System.SealedAttribute" + [] let tname_Object = "System.Object" @@ -3367,6 +3373,10 @@ type ILGlobals(primaryScopeRef: ILScopeRef, equivPrimaryAssemblyRefs: ILAssembly member val typ_Attribute = mkILBoxedType (mkILNonGenericTySpec (mkSysILTypeRef tname_Attribute)) + member val typ_Enum = mkILBoxedType (mkILNonGenericTySpec (mkSysILTypeRef tname_Enum)) + + member val typ_SealedAttribute = mkILBoxedType (mkILNonGenericTySpec (mkSysILTypeRef tname_SealedAttribute)) + member val typ_Object = mkILBoxedType (mkILNonGenericTySpec (mkSysILTypeRef tname_Object)) member val typ_String = mkILBoxedType (mkILNonGenericTySpec (mkSysILTypeRef tname_String)) @@ -3985,6 +3995,9 @@ let mkILInstanceField (nm, ty, init, access) = let mkILStaticField (nm, ty, init, at, access) = mkILField (true, nm, ty, init, at, access, false) +let mkILStaticLiteralField (nm, ty, init, at, access) = + mkILField (true, nm, ty, Some init, at, access, true) + let mkILLiteralField (nm, ty, init, at, access) = mkILField (true, nm, ty, Some init, at, access, true) diff --git a/src/Compiler/AbstractIL/il.fsi b/src/Compiler/AbstractIL/il.fsi index ef467fa973..13ba8e13d8 100644 --- a/src/Compiler/AbstractIL/il.fsi +++ b/src/Compiler/AbstractIL/il.fsi @@ -1815,7 +1815,10 @@ type internal ILGlobals = member primaryAssemblyScopeRef: ILScopeRef member primaryAssemblyRef: ILAssemblyRef member primaryAssemblyName: string + member fsharpCoreAssemblyScopeRef: ILScopeRef + member typ_Attribute: ILType + member typ_Enum: ILType member typ_Object: ILType member typ_String: ILType member typ_Type: ILType @@ -1834,10 +1837,9 @@ type internal ILGlobals = member typ_Double: ILType member typ_Bool: ILType member typ_Char: ILType + member typ_SealedAttribute: ILType member typ_TypedReference: ILType - member fsharpCoreAssemblyScopeRef: ILScopeRef - /// Is the given assembly possibly a primary assembly? /// In practice, a primary assembly is an assembly that contains the System.Object type definition /// and has no referenced assemblies. @@ -2051,6 +2053,7 @@ val internal mkILNonGenericInstanceMethod: /// Make field definitions. val internal mkILInstanceField: string * ILType * ILFieldInit option * ILMemberAccess -> ILFieldDef val internal mkILStaticField: string * ILType * ILFieldInit option * byte[] option * ILMemberAccess -> ILFieldDef +val internal mkILStaticLiteralField: string * ILType * ILFieldInit * byte[] option * ILMemberAccess -> ILFieldDef val internal mkILLiteralField: string * ILType * ILFieldInit * byte[] option * ILMemberAccess -> ILFieldDef /// Make a type definition. diff --git a/src/Compiler/CodeGen/IlxGen.fs b/src/Compiler/CodeGen/IlxGen.fs index 094f9dee50..62125570cf 100644 --- a/src/Compiler/CodeGen/IlxGen.fs +++ b/src/Compiler/CodeGen/IlxGen.fs @@ -73,7 +73,7 @@ let iLdcDouble i = AI_ldc(DT_R8, ILConst.R8 i) let iLdcSingle i = AI_ldc(DT_R4, ILConst.R4 i) /// Make a method that simply loads a field -let mkLdfldMethodDef (ilMethName, reprAccess, isStatic, ilTy, ilFieldName, ilPropType, customAttrs) = +let mkLdfldMethodDef (ilMethName, iLAccess, isStatic, ilTy, ilFieldName, ilPropType, customAttrs) = let ilFieldSpec = mkILFieldSpecInTy (ilTy, ilFieldName, ilPropType) let ilReturn = mkILReturn ilPropType @@ -82,12 +82,33 @@ let mkLdfldMethodDef (ilMethName, reprAccess, isStatic, ilTy, ilFieldName, ilPro let body = mkMethodBody (true, [], 2, nonBranchingInstrsToCode [ mkNormalLdsfld ilFieldSpec ], None, None) - mkILNonGenericStaticMethod (ilMethName, reprAccess, [], ilReturn, body) + mkILNonGenericStaticMethod (ilMethName, iLAccess, [], ilReturn, body) else let body = mkMethodBody (true, [], 2, nonBranchingInstrsToCode [ mkLdarg0; mkNormalLdfld ilFieldSpec ], None, None) - mkILNonGenericInstanceMethod (ilMethName, reprAccess, [], ilReturn, body) + mkILNonGenericInstanceMethod (ilMethName, iLAccess, [], ilReturn, body) + + ilMethodDef.With(customAttrs = mkILCustomAttrs customAttrs).WithSpecialName + +/// Make a method that simply stores a field +let mkStsfldMethodDef (ilMethName, iLAccess, isStatic, ilTy, ilFieldName, ilPropType, customAttrs) = + let ilFieldSpec = mkILFieldSpecInTy (ilTy, ilFieldName, ilPropType) + let ilParams = [ mkILParamNamed ("value", ilPropType) ] + let ilReturn = mkILReturn ILType.Void + + let ilMethodDef = + if isStatic then + let body = + mkMethodBody (true, [], 2, nonBranchingInstrsToCode [ mkLdarg0; mkNormalStsfld ilFieldSpec ], None, None) + + mkILNonGenericStaticMethod (ilMethName, iLAccess, ilParams, ilReturn, body) + + else + let body = + mkMethodBody (true, [], 2, nonBranchingInstrsToCode [ mkLdarg0; mkLdarg 1us; mkNormalStfld ilFieldSpec ], None, None) + + mkILNonGenericInstanceMethod (ilMethName, iLAccess, ilParams, ilReturn, body) ilMethodDef.With(customAttrs = mkILCustomAttrs customAttrs).WithSpecialName @@ -582,6 +603,135 @@ type TypeReprEnv(reprs: Map, count: int, templateReplacement: (Ty /// Get the environment for generating a reference to items within a type definition member eenv.ForTyconRef(tcref: TyconRef) = eenv.ForTycon tcref.Deref +//-------------------------------------------------------------------------- +// Generate Local embeddable versions of framework types when necessary +//-------------------------------------------------------------------------- + +let mkFlagsAttribute cenv = + mkILCustomAttribute (cenv.g.attrib_FlagsAttribute.TypeRef, [], [], []) + +let mkLocalPrivateAttributeWithDefaultConstructor (cenv: cenv, name: string) = + let g = cenv.g + + let ilMethods = + mkILMethods + [ + g.AddMethodGeneratedAttributes(mkILNonGenericEmptyCtor (g.ilg.typ_Attribute, None, None)) + ] + + mkILGenericClass ( + name, + ILTypeDefAccess.Private, + ILGenericParameterDefs.Empty, + g.ilg.typ_Attribute, + ILTypes.Empty, + ilMethods, + emptyILFields, + emptyILTypeDefs, + emptyILProperties, + emptyILEvents, + emptyILCustomAttrs, + ILTypeInit.BeforeField + ) + +let mkILNonGenericInstanceProperty (name, ilTypeRef, ilType, propertyAttribute, customAttributes) = + ILPropertyDef( + name = name, + attributes = propertyAttribute, + setMethod = Some(mkILMethRef (ilTypeRef, ILCallingConv.Instance, "set_" + name, 0, [ ilType ], ILType.Void)), + getMethod = Some(mkILMethRef (ilTypeRef, ILCallingConv.Instance, "get_" + name, 0, [], ilType)), + callingConv = ILThisConvention.Instance, + propertyType = ilType, + init = None, + args = [], + customAttrs = customAttributes + ) + +let mkLocalPrivateAttributeWithPropertyConstructors (cenv, name: string, attrProperties: (string * ILType) list option) = + let ilTypeRef = mkILTyRef (ILScopeRef.Local, name) + let ilTy = mkILFormalNamedTy ILBoxity.AsObject ilTypeRef [] + + let ilElements = + attrProperties + |> Option.defaultValue [] + |> List.map (fun (name, ilType) -> + let fieldName = name + "@" + + (cenv.g.AddFieldGeneratedAttributes(mkILInstanceField (fieldName, ilType, None, ILMemberAccess.Private))), + (cenv.g.AddMethodGeneratedAttributes( + mkLdfldMethodDef ($"get_{name}", ILMemberAccess.Public, false, ilTy, fieldName, ilType, []) + )), + (cenv.g.AddMethodGeneratedAttributes( + mkStsfldMethodDef ($"set_{name}", ILMemberAccess.Private, false, ilTy, fieldName, ilType, []) + )), + (cenv.g.AddPropertyGeneratedAttributes( + mkILNonGenericInstanceProperty (name, ilTypeRef, ilType, PropertyAttributes.None, emptyILCustomAttrs) + )), + (name, fieldName, ilType)) + + // Generate constructor with required arguments + let ilCtorDef = + cenv.g.AddMethodGeneratedAttributes( + mkILSimpleStorageCtorWithParamNames ( + Some cenv.g.ilg.typ_Attribute.TypeSpec, + ilTy, + [], + (ilElements |> List.map (fun (_, _, _, _, fieldInfo) -> fieldInfo)), + ILMemberAccess.Public, + None, + None + ) + ) + + mkILGenericClass ( + name, + ILTypeDefAccess.Private, + ILGenericParameterDefs.Empty, + cenv.g.ilg.typ_Attribute, + ILTypes.Empty, + mkILMethods ( + ilCtorDef + :: (ilElements + |> List.fold (fun acc (_, getter, setter, _, _) -> getter :: (setter :: acc)) []) + ), + mkILFields (ilElements |> List.map (fun (field, _, _, _, _) -> field)), + emptyILTypeDefs, + mkILProperties (ilElements |> List.map (fun (_, _, _, property, _) -> property)), + emptyILEvents, + emptyILCustomAttrs, + ILTypeInit.BeforeField + ) + +let mkLocalPrivateInt32Enum (cenv: cenv, tref: ILTypeRef, values: (string * int32) array) = + let g = cenv.g + let ilType = ILType.Value(mkILNonGenericTySpec (tref)) + + let enumFields = + values + |> Array.map (fun (name, value) -> mkILStaticLiteralField (name, ilType, ILFieldInit.Int32 value, None, ILMemberAccess.Public)) + |> Array.append + [| + (mkILInstanceField ("value__", g.ilg.typ_Int32, Some(ILFieldInit.Int32 0), ILMemberAccess.Public)) + .WithSpecialName(true) + |] + |> Array.toList + + mkILGenericClass( + tref.Name, + ILTypeDefAccess.Private, + ILGenericParameterDefs.Empty, + g.ilg.typ_Enum, + ILTypes.Empty, + mkILMethods [], + mkILFields enumFields, + emptyILTypeDefs, + emptyILProperties, + emptyILEvents, + g.AddGeneratedAttributes(mkILCustomAttrs [ mkFlagsAttribute cenv ]), + ILTypeInit.OnAny + ) + .WithSealed(true) + //-------------------------------------------------------------------------- // Generate type references //-------------------------------------------------------------------------- @@ -609,16 +759,77 @@ type PtrsOK = | PtrTypesOK | PtrTypesNotOK -let GenReadOnlyAttribute (g: TcGlobals) = - g.AddEmbeddableSystemAttribute(g.attrib_IsReadOnlyAttribute.TypeRef, [], [], []) +let GetReadOnlyAttribute cenv = + let g = cenv.g + let tref = g.attrib_IsReadOnlyAttribute.TypeRef + g.TryEmbedILType(tref, (fun () -> mkLocalPrivateAttributeWithDefaultConstructor (cenv, tref.Name))) + mkILCustomAttribute (g.attrib_IsReadOnlyAttribute.TypeRef, [], [], []) -let GenReadOnlyAttributeIfNecessary (g: TcGlobals) ty = - if isInByrefTy g ty then - let attr = GenReadOnlyAttribute g +let GenReadOnlyAttributeIfNecessary cenv ty = + if isInByrefTy cenv.g ty then + let attr = GetReadOnlyAttribute cenv Some attr else None +let GetDynamicallyAccessedMemberTypes cenv = + let tref = cenv.g.enum_DynamicallyAccessedMemberTypes.TypeRef + + if not (cenv.g.compilingFSharpCore) then + cenv.g.TryEmbedILType( + tref, + (fun () -> + let values = + [| + ("All", -1) + ("None", 0) + ("PublicParameterlessConstructor", 1) + ("PublicConstructors", 3) + ("NonPublicConstructors", 4) + ("PublicMethods", 8) + ("NonPublicMethods", 16) + ("PublicFields", 32) + ("NonPublicFields", 64) + ("PublicNestedTypes", 128) + ("NonPublicNestedTypes", 256) + ("PublicProperties", 512) + ("NonPublicProperties", 1024) + ("PublicEvents", 2048) + ("NonPublicEvents", 4096) + ("Interfaces", 8192) + |] + + mkLocalPrivateInt32Enum (cenv, tref, values)) + ) + + ILType.Value(mkILNonGenericTySpec (tref)) + +let GetDynamicDependencyAttribute cenv memberTypes ilType = + let tref = cenv.g.attrib_DynamicDependencyAttribute.TypeRef + + cenv.g.TryEmbedILType( + tref, + (fun () -> + let properties = + Some + [ + "MemberType", GetDynamicallyAccessedMemberTypes cenv + "Type", cenv.g.ilg.typ_Type + ] + + mkLocalPrivateAttributeWithPropertyConstructors (cenv, tref.Name, properties)) + ) + + let typIlMemberTypes = + ILType.Value(mkILNonGenericTySpec (cenv.g.enum_DynamicallyAccessedMemberTypes.TypeRef)) + + mkILCustomAttribute ( + tref, + [ typIlMemberTypes; cenv.g.ilg.typ_Type ], + [ ILAttribElem.Int32 memberTypes; ILAttribElem.Type(Some ilType) ], + [] + ) + /// Generate "modreq([mscorlib]System.Runtime.InteropServices.InAttribute)" on inref types. let GenReadOnlyModReqIfNecessary (g: TcGlobals) ty ilTy = let add = isInByrefTy g ty && g.attrib_InAttribute.TyconRef.CanDeref @@ -2088,7 +2299,7 @@ type AnonTypeGenerationTable() = let ilMethods = [ for propName, fldName, fldTy in flds -> - let attrs = if isStruct then [ GenReadOnlyAttribute g ] else [] + let attrs = if isStruct then [ GetReadOnlyAttribute cenv ] else [] mkLdfldMethodDef ("get_" + propName, ILMemberAccess.Public, false, ilTy, fldName, fldTy, attrs) |> g.AddMethodGeneratedAttributes @@ -5656,7 +5867,7 @@ and GenSlotParam m cenv eenv slotParam : ILParameter = let ilAttribs = GenAttrs cenv eenv attribs let ilAttribs = - match GenReadOnlyAttributeIfNecessary cenv.g ty with + match GenReadOnlyAttributeIfNecessary cenv ty with | Some attr -> ilAttribs @ [ attr ] | None -> ilAttribs @@ -5714,7 +5925,7 @@ and GenFormalReturnType m cenv eenvFormal returnTy : ILReturn = match returnTy with | None -> ilRet | Some ty -> - match GenReadOnlyAttributeIfNecessary cenv.g ty with + match GenReadOnlyAttributeIfNecessary cenv ty with | Some attr -> ilRet.WithCustomAttrs(mkILCustomAttrs (ilRet.CustomAttrs.AsList() @ [ attr ])) | None -> ilRet @@ -8761,7 +8972,7 @@ and GenParams let ilAttribs = GenAttrs cenv eenv attribs let ilAttribs = - match GenReadOnlyAttributeIfNecessary g methodArgTy with + match GenReadOnlyAttributeIfNecessary cenv methodArgTy with | Some attr -> ilAttribs @ [ attr ] | None -> ilAttribs @@ -8790,7 +9001,7 @@ and GenReturnInfo cenv eenv returnTy ilRetTy (retInfo: ArgReprInfo) : ILReturn = let ilAttribs = match returnTy with | Some retTy -> - match GenReadOnlyAttributeIfNecessary cenv.g retTy with + match GenReadOnlyAttributeIfNecessary cenv retTy with | Some attr -> ilAttribs @ [ attr ] | None -> ilAttribs | _ -> ilAttribs @@ -9127,7 +9338,7 @@ and GenMethodForBinding || memberInfo.MemberFlags.MemberKind = SynMemberKind.PropertySet || memberInfo.MemberFlags.MemberKind = SynMemberKind.PropertyGetSet -> - match GenReadOnlyAttributeIfNecessary g returnTy with + match GenReadOnlyAttributeIfNecessary cenv returnTy with | Some ilAttr -> ilAttr | _ -> () | _ -> () @@ -10377,7 +10588,7 @@ and GenAbstractBinding cenv eenv tref (vref: ValRef) = || memberInfo.MemberFlags.MemberKind = SynMemberKind.PropertySet || memberInfo.MemberFlags.MemberKind = SynMemberKind.PropertyGetSet -> - match GenReadOnlyAttributeIfNecessary g returnTy with + match GenReadOnlyAttributeIfNecessary cenv returnTy with | Some ilAttr -> ilAttr | _ -> () | _ -> () @@ -10893,7 +11104,7 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon: Tycon) = let attrs = if isStruct && not isStatic then - [ GenReadOnlyAttribute g ] + [ GetReadOnlyAttribute cenv ] else [] @@ -11039,7 +11250,7 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon: Tycon) = Some(g.ilg.typ_Object.TypeSpec) let ilMethodDef = - mkILSimpleStorageCtorWithParamNames ( + (mkILSimpleStorageCtorWithParamNames ( spec, ilThisTy, [], @@ -11047,7 +11258,17 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon: Tycon) = reprAccess, None, eenv.imports - ) + )) + .With( + customAttrs = + mkILCustomAttrs + [ + GetDynamicDependencyAttribute + cenv + 0x660 (*Public and NonPublic Fields and Properties*) + ilThisTy + ] + ) yield ilMethodDef // FSharp 1.0 bug 1988: Explicitly setting the ComVisible(true) attribute on an F# type causes an F# record to be emitted in a way that enables mutation for COM interop scenarios diff --git a/src/Compiler/Driver/CreateILModule.fs b/src/Compiler/Driver/CreateILModule.fs index 95a60326df..efcf212675 100644 --- a/src/Compiler/Driver/CreateILModule.fs +++ b/src/Compiler/Driver/CreateILModule.fs @@ -304,7 +304,7 @@ module MainModuleBuilder = RequireCompilationThread ctok let ilTypeDefs = - mkILTypeDefs (codegenResults.ilTypeDefs @ tcGlobals.embeddedTypeDefs) + mkILTypeDefs (codegenResults.ilTypeDefs @ tcGlobals.tryRemoveEmbeddedILTypeDefs ()) let mainModule = let hashAlg = diff --git a/src/Compiler/Interactive/fsi.fs b/src/Compiler/Interactive/fsi.fs index c0d03d8474..d4086d2822 100644 --- a/src/Compiler/Interactive/fsi.fs +++ b/src/Compiler/Interactive/fsi.fs @@ -1426,8 +1426,9 @@ type internal FsiDynamicCompiler( /// Generate one assembly using multi-assembly emit let EmitInMemoryAssembly (tcConfig: TcConfig, emEnv: ILMultiInMemoryAssemblyEmitEnv, ilxMainModule: ILModuleDef) = + let embeddedTypes = tcGlobals.tryRemoveEmbeddedILTypeDefs() |> List.filter(fun tdef -> not(emEnv.IsLocalInternalType(mkRefForNestedILTypeDef ILScopeRef.Local ([], tdef)))) + let ilxMainModule = { ilxMainModule with TypeDefs = mkILTypeDefs (ilxMainModule.TypeDefs.AsList() @ embeddedTypes) } let multiAssemblyName = ilxMainModule.ManifestOfAssembly.Name - // Adjust the assembly name of this fragment, and add InternalsVisibleTo attributes to // allow internals access by all future assemblies with the same name (and only differing in version) let manifest = diff --git a/src/Compiler/TypedTree/TcGlobals.fs b/src/Compiler/TypedTree/TcGlobals.fs index b9bb006f31..77ba385c52 100755 --- a/src/Compiler/TypedTree/TcGlobals.fs +++ b/src/Compiler/TypedTree/TcGlobals.fs @@ -25,6 +25,7 @@ open FSharp.Compiler.TypedTree open FSharp.Compiler.TypedTreeBasics open Internal.Utilities +open System.Reflection let internal DummyFileNameForRangesWithoutASpecificLocation = startupFileName let private envRange = rangeN DummyFileNameForRangesWithoutASpecificLocation 0 @@ -162,6 +163,8 @@ let tname_ValueType = "System.ValueType" [] let tname_Enum = "System.Enum" [] +let tname_FlagsAttribute = "System.FlagsAttribute" +[] let tname_Array = "System.Array" [] let tname_RuntimeArgumentHandle = "System.RuntimeArgumentHandle" @@ -185,7 +188,6 @@ let tname_IAsyncResult = "System.IAsyncResult" let tname_IsByRefLikeAttribute = "System.Runtime.CompilerServices.IsByRefLikeAttribute" - //------------------------------------------------------------------------- // Table of all these "globals" //------------------------------------------------------------------------- @@ -860,8 +862,8 @@ type TcGlobals( let v_check_this_info = makeIntrinsicValRef(fslib_MFIntrinsicFunctions_nleref, "CheckThis" , None , None , [vara], ([[varaTy]], varaTy)) let v_quote_to_linq_lambda_info = makeIntrinsicValRef(fslib_MFLinqRuntimeHelpersQuotationConverter_nleref, "QuotationToLambdaExpression" , None , None , [vara], ([[mkQuotedExprTy varaTy]], mkLinqExpressionTy varaTy)) - let tref_DebuggableAttribute = findSysILTypeRef tname_DebuggableAttribute - let tref_CompilerGeneratedAttribute = findSysILTypeRef tname_CompilerGeneratedAttribute + let tref_DebuggableAttribute = findSysILTypeRef tname_DebuggableAttribute + let tref_CompilerGeneratedAttribute = findSysILTypeRef tname_CompilerGeneratedAttribute let tref_InternalsVisibleToAttribute = findSysILTypeRef tname_InternalsVisibleToAttribute let mutable generatedAttribsCache = [] @@ -912,33 +914,6 @@ type TcGlobals( let mkDebuggerTypeProxyAttribute (ty : ILType) = mkILCustomAttribute (findSysILTypeRef tname_DebuggerTypeProxyAttribute, [ilg.typ_Type], [ILAttribElem.TypeRef (Some ty.TypeRef)], []) - // Todo: Review mkILCustomAttribute throughout fsc/fsi/ fcs to ensure that we use embedable attributes where appropriate - let mkLocalPrivateAttributeWithDefaultConstructor (ilg: ILGlobals, name: string) = - - let ctor = addMethodGeneratedAttrs (mkILNonGenericEmptyCtor (ilg.typ_Attribute, None, None)) - - mkILGenericClass ( - name, - ILTypeDefAccess.Private, - ILGenericParameterDefs.Empty, - ilg.typ_Attribute, - ILTypes.Empty, - mkILMethods [ ctor ], - emptyILFields, - emptyILTypeDefs, - emptyILProperties, - emptyILEvents, - emptyILCustomAttrs, - ILTypeInit.BeforeField - ) - - let addEmbeddableCustomAttribute (tref: ILTypeRef, argTys, argvs, propvs) = - - if tref.Scope = ILScopeRef.Local && not(embeddedILTypeDefs.ContainsKey(tref.Name)) then - embeddedILTypeDefs.TryAdd(tref.Name, mkLocalPrivateAttributeWithDefaultConstructor (ilg, tref.Name)) |> ignore - - mkILCustomAttribute (tref, argTys, argvs, propvs) - let betterTyconEntries = [| "Int32" , v_int_tcr "IntPtr" , v_nativeint_tcr @@ -1076,6 +1051,13 @@ type TcGlobals( member _.embeddedTypeDefs = embeddedILTypeDefs.Values |> Seq.toList + member _.tryRemoveEmbeddedILTypeDefs () = [ + for key in embeddedILTypeDefs.Keys do + match (embeddedILTypeDefs.TryRemove(key)) with + | true, ilTypeDef -> yield ilTypeDef + | false, _ -> () + ] + // A table of all intrinsics that the compiler cares about member _.knownIntrinsics = v_knownIntrinsics @@ -1242,7 +1224,9 @@ type TcGlobals( member val ArrayCollector_tcr = mk_MFCompilerServices_tcref fslibCcu "ArrayCollector`1" - member g.AddEmbeddableSystemAttribute (tref: ILTypeRef, argTys, argvs, propvs) = addEmbeddableCustomAttribute (tref, argTys, argvs, propvs) + member _.TryEmbedILType(tref: ILTypeRef, mkEmbeddableType: unit -> ILTypeDef) = + if tref.Scope = ILScopeRef.Local && not(embeddedILTypeDefs.ContainsKey(tref.Name)) then + embeddedILTypeDefs.TryAdd(tref.Name, mkEmbeddableType()) |> ignore member g.mk_GeneratedSequenceBase_ty seqElemTy = TType_app(g.seq_base_tcr,[seqElemTy], v_knownWithoutNull) @@ -1436,6 +1420,9 @@ type TcGlobals( // We use 'findSysAttrib' here because lookup on attribute is done by name comparison, and can proceed // even if the type is not found in a system assembly. member val attrib_IsReadOnlyAttribute = findOrEmbedSysPublicAttribute "System.Runtime.CompilerServices.IsReadOnlyAttribute" + member val attrib_DynamicDependencyAttribute = findOrEmbedSysPublicAttribute "System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute" + member val enum_DynamicallyAccessedMemberTypes = findOrEmbedSysPublicAttribute "System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes" + member val attrib_SystemObsolete = findSysAttrib "System.ObsoleteAttribute" member val attrib_DllImportAttribute = tryFindSysAttrib "System.Runtime.InteropServices.DllImportAttribute" member val attrib_StructLayoutAttribute = findSysAttrib "System.Runtime.InteropServices.StructLayoutAttribute" @@ -1819,6 +1806,8 @@ type TcGlobals( member _.TryFindSysAttrib nm = tryFindSysAttrib nm + member _.AddGeneratedAttributes attrs = addGeneratedAttrs attrs + member _.AddMethodGeneratedAttributes mdef = addMethodGeneratedAttrs mdef member _.AddPropertyGeneratedAttributes mdef = addPropertyGeneratedAttrs mdef diff --git a/src/FSharp.Core/SI.fs b/src/FSharp.Core/SI.fs index bf88a63006..5f94c66503 100644 --- a/src/FSharp.Core/SI.fs +++ b/src/FSharp.Core/SI.fs @@ -7,11 +7,11 @@ open Microsoft.FSharp.Core /// The SI unit of length [] -type metre +type metre /// The SI unit of length [] -type meter = metre +type meter = metre /// The SI unit of mass [] @@ -23,11 +23,11 @@ type second /// The SI unit of electric current [] -type ampere +type ampere /// The SI unit of thermodynamic temperature [] -type kelvin +type kelvin /// The SI unit of amount of substance [] @@ -35,7 +35,7 @@ type mole /// The SI unit of luminous intensity [] -type candela +type candela /// The SI unit of frequency [] @@ -43,7 +43,7 @@ type hertz = / second /// The SI unit of force [] -type newton = kilogram metre / second^2 +type newton = kilogram metre / second^2 /// The SI unit of pressure, stress [] @@ -55,63 +55,63 @@ type joule = newton metre /// The SI unit of power, radiant flux [] -type watt = joule / second +type watt = joule / second /// The SI unit of electric charge, amount of electricity [] -type coulomb = second ampere +type coulomb = second ampere /// The SI unit of electric potential difference, electromotive force [] -type volt = watt/ampere +type volt = watt / ampere /// The SI unit of capacitance [] -type farad = coulomb/volt +type farad = coulomb / volt /// The SI unit of electric resistance [] -type ohm = volt/ampere +type ohm = volt / ampere /// The SI unit of electric conductance [] -type siemens = ampere/volt +type siemens = ampere / volt /// The SI unit of magnetic flux [] -type weber = volt second +type weber = volt second /// The SI unit of magnetic flux density [] -type tesla = weber/metre^2 +type tesla = weber / metre^2 /// The SI unit of inductance [] -type henry = weber/ampere +type henry = weber / ampere /// The SI unit of luminous flux [] -type lumen = candela +type lumen = candela /// The SI unit of illuminance [] -type lux = lumen/metre^2 +type lux = lumen / metre^2 /// The SI unit of activity referred to a radionuclide [] -type becquerel = second^-1 +type becquerel = second^-1 /// The SI unit of absorbed dose [] -type gray = joule/kilogram +type gray = joule / kilogram /// The SI unit of does equivalent [] -type sievert = joule/kilogram +type sievert = joule / kilogram /// The SI unit of catalytic activity [] -type katal = mole/second +type katal = mole / second // Common abbreviations for the International System of Units (SI) namespace Microsoft.FSharp.Data.UnitSystems.SI.UnitSymbols @@ -121,7 +121,7 @@ open Microsoft.FSharp.Data.UnitSystems.SI.UnitNames /// A synonym for Metre, the SI unit of length [] -type m = metre +type m = metre /// A synonym for kilogram, the SI unit of mass [] @@ -133,19 +133,19 @@ type s = second /// A synonym for ampere, the SI unit of electric current [] -type A = ampere +type A = ampere /// A synonym for kelvin, the SI unit of thermodynamic temperature [] -type K = kelvin +type K = kelvin /// A synonym for mole, the SI unit of amount of substance [] -type mol = mole +type mol = mole /// A synonym for candela, the SI unit of luminous intensity [] -type cd = candela +type cd = candela /// A synonym for hertz, the SI unit of frequency [] @@ -165,11 +165,11 @@ type J = joule /// A synonym for watt, the SI unit of power, radiant flux [] -type W = watt +type W = watt /// A synonym for coulomb, the SI unit of electric charge, amount of electricity [] -type C = coulomb +type C = coulomb /// A synonym for volt, the SI unit of electric potential difference, electromotive force [] @@ -181,11 +181,11 @@ type F = farad /// A synonym for siemens, the SI unit of electric conductance [] -type S = siemens +type S = siemens /// A synonym for UnitNames.ohm, the SI unit of electric resistance. [] -type ohm = Microsoft.FSharp.Data.UnitSystems.SI.UnitNames.ohm +type ohm = Microsoft.FSharp.Data.UnitSystems.SI.UnitNames.ohm /// A synonym for weber, the SI unit of magnetic flux [] diff --git a/src/FSharp.Core/array.fsi b/src/FSharp.Core/array.fsi index 2e34d39c26..ec0d228a36 100644 --- a/src/FSharp.Core/array.fsi +++ b/src/FSharp.Core/array.fsi @@ -14,7 +14,7 @@ open System.Collections.Generic /// [] [] -module Array = +module Array = /// Returns a new array that contains all pairings of elements from the first and second arrays. /// @@ -35,7 +35,7 @@ module Array = /// /// [] - val allPairs: array1:'T1[] -> array2:'T2[] -> ('T1 * 'T2)[] + val allPairs: array1: 'T1[] -> array2: 'T2[] -> ('T1 * 'T2)[] /// Builds a new array that contains the elements of the first array followed by the elements of the second array. /// @@ -53,7 +53,7 @@ module Array = /// Evaluates to [| 1; 2; 3; 4 |]. /// [] - val append: array1:'T[] -> array2:'T[] -> 'T[] + val append: array1: 'T[] -> array2: 'T[] -> 'T[] /// Returns the average of the elements in the array. /// @@ -78,10 +78,11 @@ module Array = /// Throws ArgumentException /// [] - val inline average : array:^T[] -> ^T - when ^T : (static member ( + ) : ^T * ^T -> ^T) - and ^T : (static member DivideByInt : ^T*int -> ^T) - and ^T : (static member Zero : ^T) + val inline average: + array: ^T[] -> ^T + when ^T: (static member (+): ^T * ^T -> ^T) + and ^T: (static member DivideByInt: ^T * int -> ^T) + and ^T: (static member Zero: ^T) /// Returns the average of the elements generated by applying the function to each element of the array. /// @@ -116,11 +117,12 @@ module Array = /// Throws ArgumentException /// [] - val inline averageBy : projection:('T -> ^U) -> array:'T[] -> ^U - when ^U : (static member ( + ) : ^U * ^U -> ^U) - and ^U : (static member DivideByInt : ^U*int -> ^U) - and ^U : (static member Zero : ^U) - + val inline averageBy: + projection: ('T -> ^U) -> array: 'T[] -> ^U + when ^U: (static member (+): ^U * ^U -> ^U) + and ^U: (static member DivideByInt: ^U * int -> ^U) + and ^U: (static member Zero: ^U) + /// Reads a range of elements from the first array and write them into the second. /// /// The source array. @@ -152,8 +154,8 @@ module Array = /// After evaluation target contains [| 0; 1; 2; 13; 14; 5 |]. /// [] - val inline blit: source:'T[] -> sourceIndex:int -> target:'T[] -> targetIndex:int -> count:int -> unit - + val inline blit: source: 'T[] -> sourceIndex: int -> target: 'T[] -> targetIndex: int -> count: int -> unit + /// For each element of the array, applies the given function. Concatenates all the results and return the combined array. /// /// The function to create sub-arrays from the input array elements. @@ -183,7 +185,7 @@ module Array = /// Evaluates to [| 1; 2; 3; 4 |] /// [] - val collect : mapping:('T -> 'U[]) -> array:'T[] -> 'U[] + val collect: mapping: ('T -> 'U[]) -> array: 'T[] -> 'U[] /// Compares two arrays using the given comparison function, element by element. /// @@ -192,10 +194,10 @@ module Array = /// The first input array. /// The second input array. /// - /// Returns the first non-zero result from the comparison function. If the first array has - /// a larger element, the return value is always positive. If the second array has a larger - /// element, the return value is always negative. When the elements are equal in the two - /// arrays, 1 is returned if the first array is longer, 0 is returned if they are equal in + /// Returns the first non-zero result from the comparison function. If the first array has + /// a larger element, the return value is always positive. If the second array has a larger + /// element, the return value is always negative. When the elements are equal in the two + /// arrays, 1 is returned if the first array is longer, 0 is returned if they are equal in /// length, and -1 is returned when the second array is longer. /// /// Thrown when either of the input arrays @@ -266,7 +268,7 @@ module Array = /// Evaluates to -1 /// [] - val inline compareWith: comparer:('T -> 'T -> int) -> array1:'T[] -> array2:'T[] -> int + val inline compareWith: comparer: ('T -> 'T -> int) -> array1: 'T[] -> array2: 'T[] -> int /// Builds a new array that contains the elements of each of the given sequence of arrays. /// @@ -285,8 +287,8 @@ module Array = /// Evaluates to [| 1; 2; 3; 4; 5 |] /// [] - val concat: arrays:seq<'T[]> -> 'T[] - + val concat: arrays: seq<'T[]> -> 'T[] + /// Tests if the array contains the specified element. /// /// The value to locate in the input array. @@ -303,7 +305,7 @@ module Array = /// /// [] - val inline contains: value:'T -> array:'T[] -> bool when 'T : equality + val inline contains: value: 'T -> array: 'T[] -> bool when 'T: equality /// Builds a new array that contains the elements of the given array. /// @@ -322,7 +324,7 @@ module Array = /// Evaluates to a new array containing[| 12; 13; 14 |]. /// [] - val copy: array:'T[] -> 'T[] + val copy: array: 'T[] -> 'T[] /// Applies a key-generating function to each element of an array and returns an array yielding unique /// keys and their number of occurrences in the original array. @@ -346,7 +348,7 @@ module Array = /// Evaluates to [| ("a", 2); ("b", 1) |] /// [] - val countBy : projection:('T -> 'Key) -> array:'T[] -> ('Key * int)[] when 'Key : equality + val countBy: projection: ('T -> 'Key) -> array: 'T[] -> ('Key * int)[] when 'Key: equality /// Creates an array whose elements are all initially the given value. /// @@ -376,7 +378,7 @@ module Array = /// Note each entry in the array is the same mutable cell object. /// [] - val create: count:int -> value:'T -> 'T[] + val create: count: int -> value: 'T -> 'T[] /// Returns the first element of the array, or /// None if the array is empty. @@ -405,10 +407,10 @@ module Array = /// Evaluates to None /// [] - val tryHead: array:'T[] -> 'T option - + val tryHead: array: 'T[] -> 'T option + /// Applies the given function to successive elements, returning the first - /// result where the function returns Some(x) for some x. If the function + /// result where the function returns Some(x) for some x. If the function /// never returns Some(x) then None is returned. /// /// The function to transform the array elements into options. @@ -437,7 +439,7 @@ module Array = /// /// [] - val tryPick: chooser:('T -> 'U option) -> array:'T[] -> 'U option + val tryPick: chooser: ('T -> 'U option) -> array: 'T[] -> 'U option /// Fills a range of elements of the array with the given value. /// @@ -458,10 +460,10 @@ module Array = /// After evaluation target contains [| 0; 1; 2; 100; 100; 5 |]. /// [] - val fill: target:'T[] -> targetIndex:int -> count:int -> value:'T -> unit + val fill: target: 'T[] -> targetIndex: int -> count: int -> value: 'T -> unit /// Applies the given function to successive elements, returning the first - /// result where the function returns Some(x) for some x. If the function + /// result where the function returns Some(x) for some x. If the function /// never returns Some(x) then is raised. /// /// The function to generate options from the elements. @@ -492,7 +494,7 @@ module Array = /// /// [] - val pick: chooser:('T -> 'U option) -> array:'T[] -> 'U + val pick: chooser: ('T -> 'U option) -> array: 'T[] -> 'U /// Applies the given function to each element of the array. Returns /// the array comprised of the results x for each element where @@ -523,7 +525,7 @@ module Array = /// Evaluates to [| 2 |] /// [] - val choose: chooser:('T -> 'U option) -> array:'T[] -> 'U[] + val choose: chooser: ('T -> 'U option) -> array: 'T[] -> 'U[] /// Divides the input array into chunks of size at most chunkSize. /// @@ -553,7 +555,7 @@ module Array = /// Throws ArgumentException /// [] - val chunkBySize: chunkSize:int -> array:'T[] -> 'T[][] + val chunkBySize: chunkSize: int -> array: 'T[] -> 'T[][] /// Returns an array that contains no duplicate entries according to generic hash and /// equality comparisons on the entries. @@ -574,9 +576,9 @@ module Array = /// Evaluates to [| 1; 2; 3 |] /// [] - val distinct: array:'T[] -> 'T[] when 'T : equality + val distinct: array: 'T[] -> 'T[] when 'T: equality - /// Returns an array that contains no duplicate entries according to the + /// Returns an array that contains no duplicate entries according to the /// generic hash and equality comparisons on the keys returned by the given key-generating function. /// If an element occurs multiple times in the array then the later occurrences are discarded. /// @@ -596,7 +598,7 @@ module Array = /// Evaluates to [| { Bar = 1 }; { Bar = 2 }; { Bar = 3 } |] /// [] - val distinctBy: projection:('T -> 'Key) -> array:'T[] -> 'T[] when 'Key : equality + val distinctBy: projection: ('T -> 'Key) -> array: 'T[] -> 'T[] when 'Key: equality /// Splits the input array into at most count chunks. /// @@ -626,7 +628,7 @@ module Array = /// Throws ArgumentException /// [] - val splitInto: count:int -> array:'T[] -> 'T[][] + val splitInto: count: int -> array: 'T[] -> 'T[][] /// Returns an empty array of the given type. /// The empty array. @@ -676,7 +678,7 @@ module Array = /// Throws ArgumentException /// [] - val exactlyOne: array:'T[] -> 'T + val exactlyOne: array: 'T[] -> 'T /// Returns the only element of the array or None if array is empty or contains more than one element. /// @@ -713,7 +715,7 @@ module Array = /// Evaluates to None /// [] - val tryExactlyOne: array:'T[] -> 'T option + val tryExactlyOne: array: 'T[] -> 'T option /// Returns a new list with the distinct elements of the input array which do not appear in the itemsToExclude sequence, /// using generic hash and equality comparisons to compare values. @@ -736,12 +738,12 @@ module Array = /// Evaluates to [| 2; 4 |] /// [] - val except: itemsToExclude:seq<'T> -> array:'T[] -> 'T[] when 'T : equality + val except: itemsToExclude: seq<'T> -> array: 'T[] -> 'T[] when 'T: equality /// Tests if any element of the array satisfies the given predicate. /// - /// The predicate is applied to the elements of the input array. If any application - /// returns true then the overall result is true and no further elements are tested. + /// The predicate is applied to the elements of the input array. If any application + /// returns true then the overall result is true and no further elements are tested. /// Otherwise, false is returned. /// /// The function to test the input elements. @@ -769,14 +771,14 @@ module Array = /// Evaluates to false /// [] - val inline exists: predicate:('T -> bool) -> array:'T[] -> bool + val inline exists: predicate: ('T -> bool) -> array: 'T[] -> bool /// Tests if any pair of corresponding elements of the arrays satisfies the given predicate. /// - /// The predicate is applied to matching elements in the two collections up to the lesser of the - /// two lengths of the collections. If any application returns true then the overall result is - /// true and no further elements are tested. Otherwise, if one collections is longer - /// than the other then the ArgumentException exception is raised. + /// The predicate is applied to matching elements in the two collections up to the lesser of the + /// two lengths of the collections. If any application returns true then the overall result is + /// true and no further elements are tested. Otherwise, if one collections is longer + /// than the other then the ArgumentException exception is raised. /// Otherwise, false is returned. /// /// The function to test the input elements. @@ -808,7 +810,7 @@ module Array = /// Evaluates to true /// [] - val exists2: predicate:('T1 -> 'T2 -> bool) -> array1:'T1[] -> array2:'T2[] -> bool + val exists2: predicate: ('T1 -> 'T2 -> bool) -> array1: 'T1[] -> array2: 'T2[] -> bool /// Returns a new collection containing only the elements of the collection /// for which the given predicate returns "true". @@ -829,7 +831,7 @@ module Array = /// Evaluates to [| 2; 4 |] /// [] - val filter: predicate:('T -> bool) -> array:'T[] -> 'T[] + val filter: predicate: ('T -> bool) -> array: 'T[] -> 'T[] /// Returns the first element for which the given function returns 'true'. /// Raise if no such element exists. @@ -861,7 +863,7 @@ module Array = /// Throws KeyNotFoundException /// [] - val find: predicate:('T -> bool) -> array:'T[] -> 'T + val find: predicate: ('T -> bool) -> array: 'T[] -> 'T /// Returns the last element for which the given function returns 'true'. /// Raise if no such element exists. @@ -893,10 +895,10 @@ module Array = /// Throws KeyNotFoundException /// [] - val findBack: predicate:('T -> bool) -> array:'T[] -> 'T + val findBack: predicate: ('T -> bool) -> array: 'T[] -> 'T /// Returns the index of the first element in the array - /// that satisfies the given predicate. Raise if + /// that satisfies the given predicate. Raise if /// none of the elements satisfy the predicate. /// /// The function to test the input elements. @@ -925,7 +927,7 @@ module Array = /// Throws KeyNotFoundException /// [] - val findIndex: predicate:('T -> bool) -> array:'T[] -> int + val findIndex: predicate: ('T -> bool) -> array: 'T[] -> int /// Returns the index of the last element in the array /// that satisfies the given predicate. Raise if @@ -958,12 +960,12 @@ module Array = /// Throws KeyNotFoundException /// [] - val findIndexBack: predicate:('T -> bool) -> array:'T[] -> int + val findIndexBack: predicate: ('T -> bool) -> array: 'T[] -> int /// Tests if all elements of the array satisfy the given predicate. /// - /// The predicate is applied to the elements of the input collection. If any application - /// returns false then the overall result is false and no further elements are tested. + /// The predicate is applied to the elements of the input collection. If any application + /// returns false then the overall result is false and no further elements are tested. /// Otherwise, true is returned. /// /// The function to test the input elements. @@ -983,14 +985,14 @@ module Array = /// /// [] - val forall: predicate:('T -> bool) -> array:'T[] -> bool + val forall: predicate: ('T -> bool) -> array: 'T[] -> bool /// Tests if all corresponding elements of the array satisfy the given predicate pairwise. /// - /// The predicate is applied to matching elements in the two collections up to the lesser of the - /// two lengths of the collections. If any application returns false then the overall result is - /// false and no further elements are tested. Otherwise, if one collection is longer - /// than the other then the ArgumentException exception is raised. + /// The predicate is applied to matching elements in the two collections up to the lesser of the + /// two lengths of the collections. If any application returns false then the overall result is + /// false and no further elements are tested. Otherwise, if one collection is longer + /// than the other then the ArgumentException exception is raised. /// Otherwise, true is returned. /// /// The function to test the input elements. @@ -1032,10 +1034,10 @@ module Array = /// Throws ArgumentException. /// [] - val forall2: predicate:('T1 -> 'T2 -> bool) -> array1:'T1[] -> array2:'T2[] -> bool + val forall2: predicate: ('T1 -> 'T2 -> bool) -> array1: 'T1[] -> array2: 'T2[] -> bool /// Applies a function to each element of the collection, threading an accumulator argument - /// through the computation. If the input function is f and the elements are i0...iN then computes + /// through the computation. If the input function is f and the elements are i0...iN then computes /// f (... (f s i0)...) iN /// /// The function to update the state given the input elements. @@ -1062,10 +1064,10 @@ module Array = /// Evaluates to 2 /// [] - val fold<'T,'State> : folder:('State -> 'T -> 'State) -> state:'State -> array: 'T[] -> 'State + val fold<'T, 'State> : folder: ('State -> 'T -> 'State) -> state: 'State -> array: 'T[] -> 'State /// Applies a function to each element of the array, starting from the end, threading an accumulator argument - /// through the computation. If the input function is f and the elements are i0...iN then computes + /// through the computation. If the input function is f and the elements are i0...iN then computes /// f i0 (...(f iN s)) /// /// The function to update the state given the input elements. @@ -1105,9 +1107,9 @@ module Array = /// /// [] - val foldBack<'T,'State> : folder:('T -> 'State -> 'State) -> array:'T[] -> state:'State -> 'State + val foldBack<'T, 'State> : folder: ('T -> 'State -> 'State) -> array: 'T[] -> state: 'State -> 'State - /// Applies a function to pairs of elements drawn from the two collections, + /// Applies a function to pairs of elements drawn from the two collections, /// left-to-right, threading an accumulator argument /// through the computation. The two input /// arrays must have the same lengths, otherwise an ArgumentException is @@ -1139,9 +1141,10 @@ module Array = /// Evaluates to 1 /// [] - val fold2<'T1,'T2,'State> : folder:('State -> 'T1 -> 'T2 -> 'State) -> state:'State -> array1:'T1[] -> array2:'T2[] -> 'State + val fold2<'T1, 'T2, 'State> : + folder: ('State -> 'T1 -> 'T2 -> 'State) -> state: 'State -> array1: 'T1[] -> array2: 'T2[] -> 'State - /// Apply a function to pairs of elements drawn from the two collections, right-to-left, + /// Apply a function to pairs of elements drawn from the two collections, right-to-left, /// threading an accumulator argument through the computation. The two input /// arrays must have the same lengths, otherwise an ArgumentException is /// raised. @@ -1187,7 +1190,8 @@ module Array = /// /// [] - val foldBack2<'T1,'T2,'State> : folder:('T1 -> 'T2 -> 'State -> 'State) -> array1:'T1[] -> array2:'T2[] -> state:'State -> 'State + val foldBack2<'T1, 'T2, 'State> : + folder: ('T1 -> 'T2 -> 'State -> 'State) -> array1: 'T1[] -> array2: 'T2[] -> state: 'State -> 'State /// Gets an element from an array. /// @@ -1219,7 +1223,7 @@ module Array = /// Throws IndexOutOfRangeException /// [] - val get: array:'T[] -> index:int -> 'T + val get: array: 'T[] -> index: int -> 'T /// Returns the first element of the array. /// @@ -1246,10 +1250,10 @@ module Array = /// Throws ArgumentException /// [] - val head: array:'T[] -> 'T + val head: array: 'T[] -> 'T - /// Applies a key-generating function to each element of an array and yields an array of - /// unique keys. Each unique key contains an array of all elements that match + /// Applies a key-generating function to each element of an array and yields an array of + /// unique keys. Each unique key contains an array of all elements that match /// to this key. /// /// A function that transforms an element of the array into a comparable key. @@ -1268,7 +1272,7 @@ module Array = /// Evaluates to [| (1, [| 1; 3; 5 |]); (0, [| 2; 4 |]) |] /// [] - val groupBy: projection:('T -> 'Key) -> array:'T[] -> ('Key * 'T[])[] when 'Key : equality + val groupBy: projection: ('T -> 'Key) -> array: 'T[] -> ('Key * 'T[])[] when 'Key: equality /// Builds a new array whose elements are the corresponding elements of the input array /// paired with the integer index (from 0) of each element. @@ -1288,7 +1292,7 @@ module Array = /// Evaluates to [| (0, "a"); (1, "b"); (2, "c") |] /// [] - val indexed: array:'T[] -> (int * 'T)[] + val indexed: array: 'T[] -> (int * 'T)[] /// Creates an array given the dimension and a generator function to compute the elements. /// @@ -1313,7 +1317,7 @@ module Array = /// Throws ArgumentException /// [] - val inline init: count:int -> initializer:(int -> 'T) -> 'T[] + val inline init: count: int -> initializer: (int -> 'T) -> 'T[] /// Creates an array where the entries are initially the default value Unchecked.defaultof<'T>. /// @@ -1330,8 +1334,8 @@ module Array = /// Evaluates to [| 0; 0; 0; 0 |] /// [] - val zeroCreate: count:int -> 'T[] - + val zeroCreate: count: int -> 'T[] + /// Returns true if the given array is empty, otherwise false. /// /// The input array. @@ -1354,7 +1358,7 @@ module Array = /// Evaluates to false /// [] - val isEmpty: array:'T[] -> bool + val isEmpty: array: 'T[] -> bool /// Applies the given function to each element of the array. /// @@ -1378,7 +1382,7 @@ module Array = /// in the console. /// [] - val inline iter: action:('T -> unit) -> array:'T[] -> unit + val inline iter: action: ('T -> unit) -> array: 'T[] -> unit /// Applies the given function to pair of elements drawn from matching indices in two arrays. The /// two arrays must have the same lengths, otherwise an ArgumentException is @@ -1407,7 +1411,7 @@ module Array = /// in the console. /// [] - val iter2: action:('T1 -> 'T2 -> unit) -> array1:'T1[] -> array2:'T2[] -> unit + val iter2: action: ('T1 -> 'T2 -> unit) -> array1: 'T1[] -> array2: 'T2[] -> unit /// Applies the given function to each element of the array. The integer passed to the /// function indicates the index of element. @@ -1432,10 +1436,10 @@ module Array = /// in the console. /// [] - val iteri: action:(int -> 'T -> unit) -> array:'T[] -> unit + val iteri: action: (int -> 'T -> unit) -> array: 'T[] -> unit /// Applies the given function to pair of elements drawn from matching indices in two arrays, - /// also passing the index of the elements. The two arrays must have the same lengths, + /// also passing the index of the elements. The two arrays must have the same lengths, /// otherwise an ArgumentException is raised. /// /// The function to apply to each index and pair of elements. @@ -1461,7 +1465,7 @@ module Array = /// in the console. /// [] - val iteri2: action:(int -> 'T1 -> 'T2 -> unit) -> array1:'T1[] -> array2:'T2[] -> unit + val iteri2: action: (int -> 'T1 -> 'T2 -> unit) -> array1: 'T1[] -> array2: 'T2[] -> unit /// Returns the last element of the array. /// @@ -1486,7 +1490,7 @@ module Array = /// Throws ArgumentException /// [] - val inline last: array:'T[] -> 'T + val inline last: array: 'T[] -> 'T /// Gets an element from an array. /// @@ -1518,7 +1522,7 @@ module Array = /// Throws ArgumentException /// [] - val item: index:int -> array:'T[] -> 'T + val item: index: int -> array: 'T[] -> 'T /// Returns the length of an array. You can also use property arr.Length. /// @@ -1539,8 +1543,8 @@ module Array = /// Evaluates to 3 /// [] - val length: array:'T[] -> int - + val length: array: 'T[] -> int + /// Returns the last element of the array. /// Return None if no such element exists. /// @@ -1548,7 +1552,7 @@ module Array = /// /// The last element of the array or None. /// - /// Thrown when the input sequence is null. + /// Thrown when the input sequence is null. /// /// /// @@ -1564,7 +1568,7 @@ module Array = /// Evaluates to None /// [] - val tryLast: array:'T[] -> 'T option + val tryLast: array: 'T[] -> 'T option /// Builds a new array whose elements are the results of applying the given function /// to each of the elements of the array. @@ -1585,7 +1589,7 @@ module Array = /// Evaluates to [| 1; 3; 2 |] /// [] - val inline map: mapping:('T -> 'U) -> array:'T[] -> 'U[] + val inline map: mapping: ('T -> 'U) -> array: 'T[] -> 'U[] /// Builds a new collection whose elements are the results of applying the given function /// to the corresponding elements of the two collections pairwise. The two input @@ -1611,7 +1615,7 @@ module Array = /// Evaluates to [| 'a'; 'd'; 'o' |] /// [] - val map2: mapping:('T1 -> 'T2 -> 'U) -> array1:'T1[] -> array2:'T2[] -> 'U[] + val map2: mapping: ('T1 -> 'T2 -> 'U) -> array1: 'T1[] -> array2: 'T2[] -> 'U[] /// Combines map and fold. Builds a new array whose elements are the results of applying the given function /// to each of the elements of the input array. The function is also used to accumulate a final value. @@ -1641,7 +1645,8 @@ module Array = /// Evaluates newCharges to [|In 2; Out 4; In 6|] and balance to 2. /// [] - val mapFold<'T,'State,'Result> : mapping:('State -> 'T -> 'Result * 'State) -> state:'State -> array:'T[] -> 'Result[] * 'State + val mapFold<'T, 'State, 'Result> : + mapping: ('State -> 'T -> 'Result * 'State) -> state: 'State -> array: 'T[] -> 'Result[] * 'State /// Combines map and foldBack. Builds a new array whose elements are the results of applying the given function /// to each of the elements of the input array. The function is also used to accumulate a final value. @@ -1671,7 +1676,8 @@ module Array = /// Evaluates newCharges to [|In 2; Out 4; In 6|] and balance to 2. /// [] - val mapFoldBack<'T,'State,'Result> : mapping:('T -> 'State -> 'Result * 'State) -> array:'T[] -> state:'State -> 'Result[] * 'State + val mapFoldBack<'T, 'State, 'Result> : + mapping: ('T -> 'State -> 'Result * 'State) -> array: 'T[] -> state: 'State -> 'Result[] * 'State /// Builds a new collection whose elements are the results of applying the given function /// to the corresponding triples from the three collections. The three input @@ -1698,12 +1704,12 @@ module Array = /// /// Evaluates to [| "all"; "the"; "time" |] /// - /// + /// [] - val map3: mapping:('T1 -> 'T2 -> 'T3 -> 'U) -> array1:'T1[] -> array2:'T2[] -> array3:'T3[] -> 'U[] + val map3: mapping: ('T1 -> 'T2 -> 'T3 -> 'U) -> array1: 'T1[] -> array2: 'T2[] -> array3: 'T3[] -> 'U[] /// Builds a new collection whose elements are the results of applying the given function - /// to the corresponding elements of the two collections pairwise, also passing the index of + /// to the corresponding elements of the two collections pairwise, also passing the index of /// the elements. The two input arrays must have the same lengths, otherwise an ArgumentException is /// raised. /// @@ -1726,7 +1732,7 @@ module Array = /// Evaluates to [|(0, 'a'); (1, 'd'); (2, 'o')|] /// [] - val mapi2: mapping:(int -> 'T1 -> 'T2 -> 'U) -> array1:'T1[] -> array2:'T2[] -> 'U[] + val mapi2: mapping: (int -> 'T1 -> 'T2 -> 'U) -> array1: 'T1[] -> array2: 'T2[] -> 'U[] /// Builds a new array whose elements are the results of applying the given function /// to each of the elements of the array. The integer index passed to the @@ -1748,7 +1754,7 @@ module Array = /// Evaluates to [| 10; 11; 12 |] /// [] - val mapi: mapping:(int -> 'T -> 'U) -> array:'T[] -> 'U[] + val mapi: mapping: (int -> 'T -> 'U) -> array: 'T[] -> 'U[] /// Returns the greatest of all elements of the array, compared via Operators.max on the function result. /// @@ -1779,7 +1785,7 @@ module Array = /// Throws System.ArgumentException. /// [] - val inline max: array:'T[] -> 'T when 'T : comparison + val inline max: array: 'T[] -> 'T when 'T: comparison /// Returns the greatest of all elements of the array, compared via Operators.max on the function result. /// @@ -1811,7 +1817,7 @@ module Array = /// Throws System.ArgumentException. /// [] - val inline maxBy : projection:('T -> 'U) -> array:'T[] -> 'T when 'U : comparison + val inline maxBy: projection: ('T -> 'U) -> array: 'T[] -> 'T when 'U: comparison /// Returns the lowest of all elements of the array, compared via Operators.min. /// @@ -1842,7 +1848,7 @@ module Array = /// Throws System.ArgumentException. /// [] - val inline min: array:'T[] -> 'T when 'T : comparison + val inline min: array: 'T[] -> 'T when 'T: comparison /// Returns the lowest of all elements of the array, compared via Operators.min on the function result. /// @@ -1874,14 +1880,14 @@ module Array = /// Throws System.ArgumentException. /// [] - val inline minBy : projection:('T -> 'U) -> array:'T[] -> 'T when 'U : comparison + val inline minBy: projection: ('T -> 'U) -> array: 'T[] -> 'T when 'U: comparison /// Builds an array from the given list. /// /// The input list. /// /// The array of elements from the list. - /// + /// /// /// /// let inputs = [ 1; 2; 5 ] @@ -1891,7 +1897,7 @@ module Array = /// Evaluates to [| 1; 2; 5 |]. /// [] - val ofList: list:'T list -> 'T[] + val ofList: list: 'T list -> 'T[] /// Builds a new array from the given enumerable object. /// @@ -1900,7 +1906,7 @@ module Array = /// The array of elements from the sequence. /// /// Thrown when the input sequence is null. - /// + /// /// /// /// let inputs = seq { 1; 2; 5 } @@ -1910,7 +1916,7 @@ module Array = /// Evaluates to [| 1; 2; 5 |]. /// [] - val ofSeq: source:seq<'T> -> 'T[] + val ofSeq: source: seq<'T> -> 'T[] /// Returns an array of each element in the input array and its predecessor, with the /// exception of the first element which is only returned as the predecessor of the second element. @@ -1920,7 +1926,7 @@ module Array = /// The result array. /// /// Thrown when the input sequence is null. - /// + /// /// /// /// let inputs = [| 1; 2; 3; 4 |] @@ -1930,9 +1936,9 @@ module Array = /// Evaluates to [|(1, 2); (2, 3); (3, 4)|]. /// [] - val pairwise: array:'T[] -> ('T * 'T)[] + val pairwise: array: 'T[] -> ('T * 'T)[] - /// Splits the collection into two collections, containing the + /// Splits the collection into two collections, containing the /// elements for which the given predicate returns "true" and "false" /// respectively. /// @@ -1943,7 +1949,7 @@ module Array = /// and the second containing those evaluated to false. /// /// Thrown when the input array is null. - /// + /// /// /// /// let inputs = [| 1; 2; 3; 4 |] @@ -1953,7 +1959,7 @@ module Array = /// Evaluates to ([|2; 4|], [|1; 3|]). /// [] - val partition: predicate:('T -> bool) -> array:'T[] -> 'T[] * 'T[] + val partition: predicate: ('T -> bool) -> array: 'T[] -> 'T[] * 'T[] /// Returns an array with all elements permuted according to the /// specified permutation. @@ -1965,7 +1971,7 @@ module Array = /// /// Thrown when the input array is null. /// Thrown when indexMap does not produce a valid permutation. - /// + /// /// /// /// let inputs = [| 1; 2; 3; 4 |] @@ -1975,10 +1981,10 @@ module Array = /// Evaluates to [|4; 1; 2; 3|]. /// [] - val permute: indexMap:(int -> int) -> array:'T[] -> 'T[] + val permute: indexMap: (int -> int) -> array: 'T[] -> 'T[] /// Applies a function to each element of the array, threading an accumulator argument - /// through the computation. If the input function is f and the elements are i0...iN + /// through the computation. If the input function is f and the elements are i0...iN /// then computes f (... (f i0 i1)...) iN. /// Raises ArgumentException if the array has size zero. /// @@ -1989,7 +1995,7 @@ module Array = /// Thrown when the input array is empty. /// /// The final result of the reductions. - /// + /// /// /// /// let inputs = [| 1; 3; 4; 2 |] @@ -1999,10 +2005,10 @@ module Array = /// Evaluates to 1342, by computing ((1 * 10 + 3) * 10 + 4) * 10 + 2 /// [] - val reduce: reduction:('T -> 'T -> 'T) -> array:'T[] -> 'T + val reduce: reduction: ('T -> 'T -> 'T) -> array: 'T[] -> 'T /// Applies a function to each element of the array, starting from the end, threading an accumulator argument - /// through the computation. If the input function is f and the elements are i0...iN + /// through the computation. If the input function is f and the elements are i0...iN /// then computes f i0 (...(f iN-1 iN)). /// /// A function that takes in the next-to-last element of the list and the @@ -2013,7 +2019,7 @@ module Array = /// Thrown when the input array is empty. /// /// The final result of the reductions. - /// + /// /// /// /// let inputs = [| 1; 3; 4; 2 |] @@ -2023,7 +2029,7 @@ module Array = /// Evaluates to 2431, by computing 1 + (3 + (4 + 2 * 10) * 10) * 10 /// [] - val reduceBack: reduction:('T -> 'T -> 'T) -> array:'T[] -> 'T + val reduceBack: reduction: ('T -> 'T -> 'T) -> array: 'T[] -> 'T /// Creates an array by replicating the given initial value. /// @@ -2033,7 +2039,7 @@ module Array = /// The generated array. /// /// Thrown when count is negative. - /// + /// /// /// /// Array.replicate 3 "a" @@ -2041,7 +2047,7 @@ module Array = /// Evaluates to [| "a"; "a"; "a" |]. /// [] - val replicate: count:int -> initial:'T -> 'T[] + val replicate: count: int -> initial: 'T -> 'T[] /// Returns a new array with the elements in reverse order. /// @@ -2050,7 +2056,7 @@ module Array = /// The reversed array. /// /// Thrown when the input array is null. - /// + /// /// /// /// Array.rev [| 0; 1; 2 |] @@ -2058,7 +2064,7 @@ module Array = /// Evaluates to [| 2; 1; 0 |]. /// [] - val rev: array:'T[] -> 'T[] + val rev: array: 'T[] -> 'T[] /// Like fold, but return the intermediary and final results. /// @@ -2069,7 +2075,7 @@ module Array = /// The array of state values. /// /// Thrown when the input array is null. - /// + /// /// Apply a list charges and collect the running balances as each is applied: /// /// type Charge = @@ -2087,7 +2093,7 @@ module Array = /// state, 1 the next state, -1 the next state, and 2 the final state. /// [] - val scan<'T,'State> : folder:('State -> 'T -> 'State) -> state:'State -> array:'T[] -> 'State[] + val scan<'T, 'State> : folder: ('State -> 'T -> 'State) -> state: 'State -> array: 'T[] -> 'State[] /// Like foldBack, but return both the intermediary and final results. /// @@ -2098,7 +2104,7 @@ module Array = /// The array of state values. /// /// Thrown when the input array is null. - /// + /// /// Apply a list charges from back to front, and collect the running balances as each is applied: /// /// type Charge = @@ -2116,14 +2122,14 @@ module Array = /// state, 3 the next state, 1 the next state, and 2 the final state. /// [] - val scanBack<'T,'State> : folder:('T -> 'State -> 'State) -> array:'T[] -> state:'State -> 'State[] + val scanBack<'T, 'State> : folder: ('T -> 'State -> 'State) -> array: 'T[] -> state: 'State -> 'State[] /// Returns an array that contains one item only. /// /// The input item. /// /// The result array of one item. - /// + /// /// /// /// Array.singleton 7 @@ -2131,7 +2137,7 @@ module Array = /// Evaluates to [| 7 |]. /// [] - val inline singleton: value:'T -> 'T[] + val inline singleton: value: 'T -> 'T[] /// Sets an element of an array. /// @@ -2160,7 +2166,7 @@ module Array = /// Throws IndexOutOfRangeException /// [] - val set: array:'T[] -> index:int -> value:'T -> unit + val set: array: 'T[] -> index: int -> value: 'T -> unit /// Builds a new array that contains the elements of the given array, excluding the first N elements. /// @@ -2170,7 +2176,7 @@ module Array = /// A copy of the input array, after removing the first N elements. /// /// Thrown when the input array is null. - /// Thrown when count exceeds the number of + /// Thrown when count exceeds the number of /// elements in the array. /// /// @@ -2200,7 +2206,7 @@ module Array = /// Evaluates to [| "a"; "b"; "c"; "d" |]. /// [] - val skip: count:int -> array:'T[] -> 'T[] + val skip: count: int -> array: 'T[] -> 'T[] /// Bypasses elements in an array while the given predicate returns True, and then returns /// the remaining elements in a new array. @@ -2222,7 +2228,7 @@ module Array = /// /// [] - val skipWhile: predicate:('T -> bool) -> array:'T[] -> 'T[] + val skipWhile: predicate: ('T -> bool) -> array: 'T[] -> 'T[] /// Builds a new array that contains the given subrange specified by /// starting index and length. @@ -2255,11 +2261,11 @@ module Array = /// Evaluates to [| 2; 3; 4 |]. /// [] - val sub: array:'T[] -> startIndex:int -> count:int -> 'T[] + val sub: array: 'T[] -> startIndex: int -> count: int -> 'T[] /// Sorts the elements of an array, returning a new array. Elements are compared using . /// - /// This is not a stable sort, i.e. the original order of equal elements is not necessarily preserved. + /// This is not a stable sort, i.e. the original order of equal elements is not necessarily preserved. /// For a stable sort, consider using . /// /// The input array. @@ -2267,7 +2273,7 @@ module Array = /// The sorted array. /// /// Thrown when the input array is null. - /// + /// /// /// /// let input = [| 8; 4; 3; 1; 6; 1 |] @@ -2277,12 +2283,12 @@ module Array = /// Evaluates to [| 1; 1 3; 4; 6; 8 |]. /// [] - val sort: array:'T[] -> 'T[] when 'T : comparison + val sort: array: 'T[] -> 'T[] when 'T: comparison - /// Sorts the elements of an array, using the given projection for the keys and returning a new array. + /// Sorts the elements of an array, using the given projection for the keys and returning a new array. /// Elements are compared using . /// - /// This is not a stable sort, i.e. the original order of equal elements is not necessarily preserved. + /// This is not a stable sort, i.e. the original order of equal elements is not necessarily preserved. /// For a stable sort, consider using . /// /// The function to transform array elements into the type that is compared. @@ -2291,7 +2297,7 @@ module Array = /// The sorted array. /// /// Thrown when the input array is null. - /// + /// /// /// /// let input = [| "a"; "bbb"; "cccc"; "dd" |] @@ -2301,11 +2307,11 @@ module Array = /// Evaluates to [|"a"; "dd"; "bbb"; "cccc"|]. /// [] - val sortBy: projection:('T -> 'Key) -> array:'T[] -> 'T[] when 'Key : comparison + val sortBy: projection: ('T -> 'Key) -> array: 'T[] -> 'T[] when 'Key: comparison /// Sorts the elements of an array, using the given comparison function as the order, returning a new array. /// - /// This is not a stable sort, i.e. the original order of equal elements is not necessarily preserved. + /// This is not a stable sort, i.e. the original order of equal elements is not necessarily preserved. /// For a stable sort, consider using . /// /// The function to compare pairs of array elements. @@ -2314,7 +2320,7 @@ module Array = /// The sorted array. /// /// Thrown when the input array is null. - /// + /// /// Sort an array of pairs using a comparison function that compares string lengths then index numbers: /// /// let compareEntries (n1: int, s1: string) (n2: int, s2: string) = @@ -2329,19 +2335,19 @@ module Array = /// Evaluates to [|(0, "aa"); (2, "cc"); (3, "dd"); (1, "bbb")|]. /// [] - val sortWith: comparer:('T -> 'T -> int) -> array:'T[] -> 'T[] + val sortWith: comparer: ('T -> 'T -> int) -> array: 'T[] -> 'T[] - /// Sorts the elements of an array by mutating the array in-place, using the given projection for the keys. + /// Sorts the elements of an array by mutating the array in-place, using the given projection for the keys. /// Elements are compared using . /// - /// This is not a stable sort, i.e. the original order of equal elements is not necessarily preserved. + /// This is not a stable sort, i.e. the original order of equal elements is not necessarily preserved. /// For a stable sort, consider using . /// /// The function to transform array elements into the type that is compared. /// The input array. /// /// Thrown when the input array is null. - /// + /// /// /// /// let array = [| "a"; "bbb"; "cccc"; "dd" |] @@ -2351,7 +2357,7 @@ module Array = /// After evaluation array contains [|"a"; "dd"; "bbb"; "cccc"|]. /// [] - val sortInPlaceBy: projection:('T -> 'Key) -> array:'T[] -> unit when 'Key : comparison + val sortInPlaceBy: projection: ('T -> 'Key) -> array: 'T[] -> unit when 'Key: comparison /// Sorts the elements of an array by mutating the array in-place, using the given comparison function as the order. /// @@ -2359,7 +2365,7 @@ module Array = /// The input array. /// /// Thrown when the input array is null. - /// + /// /// The following sorts entries using a comparison function that compares string lengths then index numbers: /// /// let compareEntries (n1: int, s1: string) (n2: int, s2: string) = @@ -2374,15 +2380,15 @@ module Array = /// After evaluation array contains [|(0, "aa"); (2, "cc"); (3, "dd"); (1, "bbb")|]. /// [] - val sortInPlaceWith: comparer:('T -> 'T -> int) -> array:'T[] -> unit + val sortInPlaceWith: comparer: ('T -> 'T -> int) -> array: 'T[] -> unit - /// Sorts the elements of an array by mutating the array in-place, using the given comparison function. + /// Sorts the elements of an array by mutating the array in-place, using the given comparison function. /// Elements are compared using . /// /// The input array. /// /// Thrown when the input array is null. - /// + /// /// /// /// let array = [| 8; 4; 3; 1; 6; 1 |] @@ -2392,7 +2398,7 @@ module Array = /// After evaluation array contains [| 1; 1; 3; 4; 6; 8 |]. /// [] - val sortInPlace: array:'T[] -> unit when 'T : comparison + val sortInPlace: array: 'T[] -> unit when 'T: comparison /// Splits an array into two arrays, at the given index. /// @@ -2404,7 +2410,7 @@ module Array = /// Thrown when the input array is null. /// Thrown when split index exceeds the number of elements /// in the array. - /// + /// /// /// /// let input = [| 8; 4; 3; 1; 6; 1 |] @@ -2414,17 +2420,17 @@ module Array = /// Evaluates front to [|8; 4; 3|] and back to [|1; 6; 1|]. /// [] - val splitAt: index:int -> array:'T[] -> ('T[] * 'T[]) + val splitAt: index: int -> array: 'T[] -> ('T[] * 'T[]) /// Sorts the elements of an array, in descending order, returning a new array. Elements are compared using . /// - /// This is not a stable sort, i.e. the original order of equal elements is not necessarily preserved. + /// This is not a stable sort, i.e. the original order of equal elements is not necessarily preserved. /// For a stable sort, consider using . /// /// The input array. /// /// The sorted array. - /// + /// /// /// /// let input = [| 8; 4; 3; 1; 6; 1 |] @@ -2434,19 +2440,19 @@ module Array = /// Evaluates to [| 8; 6; 4; 3; 1; 1 |]. /// [] - val inline sortDescending: array:'T[] -> 'T[] when 'T : comparison + val inline sortDescending: array: 'T[] -> 'T[] when 'T: comparison - /// Sorts the elements of an array, in descending order, using the given projection for the keys and returning a new array. + /// Sorts the elements of an array, in descending order, using the given projection for the keys and returning a new array. /// Elements are compared using . /// - /// This is not a stable sort, i.e. the original order of equal elements is not necessarily preserved. + /// This is not a stable sort, i.e. the original order of equal elements is not necessarily preserved. /// For a stable sort, consider using . /// /// The function to transform array elements into the type that is compared. /// The input array. /// /// The sorted array. - /// + /// /// /// /// let input = [| "a"; "bbb"; "cccc"; "dd" |] @@ -2456,7 +2462,7 @@ module Array = /// Evaluates to [|"cccc"; "bbb"; "dd"; "a"|]. /// [] - val inline sortByDescending: projection:('T -> 'Key) -> array:'T[] -> 'T[] when 'Key : comparison + val inline sortByDescending: projection: ('T -> 'Key) -> array: 'T[] -> 'T[] when 'Key: comparison /// Returns the sum of the elements in the array. /// @@ -2465,7 +2471,7 @@ module Array = /// The resulting sum. /// /// Thrown when the input array is null. - /// + /// /// /// /// let input = [| 1; 5; 3; 2 |] @@ -2475,10 +2481,7 @@ module Array = /// Evaluates to 11. /// [] - val inline sum: array: ^T[] -> ^T - when ^T : (static member ( + ) : ^T * ^T -> ^T) - and ^T : (static member Zero : ^T) - + val inline sum: array: ^T[] -> ^T when ^T: (static member (+): ^T * ^T -> ^T) and ^T: (static member Zero: ^T) /// Returns the sum of the results generated by applying the function to each element of the array. /// @@ -2488,7 +2491,7 @@ module Array = /// The resulting sum. /// /// Thrown when the input array is null. - /// + /// /// /// /// let input = [| "aa"; "bbb"; "cc" |] @@ -2498,9 +2501,9 @@ module Array = /// Evaluates to 7. /// [] - val inline sumBy: projection:('T -> ^U) -> array:'T[] -> ^U - when ^U : (static member ( + ) : ^U * ^U -> ^U) - and ^U : (static member Zero : ^U) + val inline sumBy: + projection: ('T -> ^U) -> array: 'T[] -> ^U + when ^U: (static member (+): ^U * ^U -> ^U) and ^U: (static member Zero: ^U) /// Returns the first N elements of the array. /// Throws InvalidOperationException @@ -2544,9 +2547,9 @@ module Array = /// Evaluates to [| |]. /// [] - val take: count:int -> array:'T[] -> 'T[] + val take: count: int -> array: 'T[] -> 'T[] - /// Returns an array that contains all elements of the original array while the + /// Returns an array that contains all elements of the original array while the /// given predicate returns True, and then returns no further elements. /// /// A function that evaluates to false when no more items should be returned. @@ -2566,7 +2569,7 @@ module Array = /// /// [] - val takeWhile: predicate:('T -> bool) -> array:'T[] -> 'T[] + val takeWhile: predicate: ('T -> bool) -> array: 'T[] -> 'T[] /// Returns a new array containing the elements of the original except the first element. /// @@ -2587,7 +2590,7 @@ module Array = /// /// [] - val tail: array:'T[] -> 'T[] + val tail: array: 'T[] -> 'T[] /// Builds a list from the given array. /// @@ -2606,7 +2609,7 @@ module Array = /// Evaluates to [ 1; 2; 5 ]. /// [] - val toList: array:'T[] -> 'T list + val toList: array: 'T[] -> 'T list /// Views the given array as a sequence. /// @@ -2625,7 +2628,7 @@ module Array = /// Evaluates to seq { 1; 2; 5 }. /// [] - val toSeq: array:'T[] -> seq<'T> + val toSeq: array: 'T[] -> seq<'T> /// Returns the transpose of the given sequence of arrays. /// @@ -2647,7 +2650,7 @@ module Array = /// Evaluates to [|[|10; 11|]; [|20; 21|]; [|30; 31|]|]. /// [] - val transpose: arrays:seq<'T[]> -> 'T[][] + val transpose: arrays: seq<'T[]> -> 'T[][] /// Returns at most N elements in a new array. /// @@ -2685,7 +2688,7 @@ module Array = /// Evaluates to [| |]. /// [] - val truncate: count:int -> array:'T[] -> 'T[] + val truncate: count: int -> array: 'T[] -> 'T[] /// Returns the first element for which the given function returns True. /// Return None if no such element exists. @@ -2715,7 +2718,7 @@ module Array = /// Evaluates to None /// [] - val tryFind: predicate:('T -> bool) -> array:'T[] -> 'T option + val tryFind: predicate: ('T -> bool) -> array: 'T[] -> 'T option /// Returns the last element for which the given function returns True. /// Return None if no such element exists. @@ -2745,7 +2748,7 @@ module Array = /// Evaluates to None /// [] - val tryFindBack: predicate:('T -> bool) -> array:'T[] -> 'T option + val tryFindBack: predicate: ('T -> bool) -> array: 'T[] -> 'T option /// Returns the index of the first element in the array /// that satisfies the given predicate. @@ -2775,7 +2778,7 @@ module Array = /// Evaluates to None /// [] - val tryFindIndex : predicate:('T -> bool) -> array:'T[] -> int option + val tryFindIndex: predicate: ('T -> bool) -> array: 'T[] -> int option /// Tries to find the nth element in the array. /// Returns None if index is negative or the input array does not contain enough elements. @@ -2805,7 +2808,7 @@ module Array = /// Evaluates to None. /// [] - val tryItem: index:int -> array:'T[] -> 'T option + val tryItem: index: int -> array: 'T[] -> 'T option /// Returns the index of the last element in the array /// that satisfies the given predicate. @@ -2835,7 +2838,7 @@ module Array = /// Evaluates to None /// [] - val tryFindIndexBack : predicate:('T -> bool) -> array:'T[] -> int option + val tryFindIndexBack: predicate: ('T -> bool) -> array: 'T[] -> int option /// Returns an array that contains the elements generated by the given computation. /// The generator is repeatedly called to build the list until it returns `None`. @@ -2854,7 +2857,7 @@ module Array = /// Evaluates to [| 1; 2; 4; 8; 16; 32; 64 |] /// [] - val unfold<'T,'State> : generator:('State -> ('T * 'State) option) -> state:'State -> 'T[] + val unfold<'T, 'State> : generator: ('State -> ('T * 'State) option) -> state: 'State -> 'T[] /// Splits an array of pairs into two arrays. /// @@ -2873,7 +2876,7 @@ module Array = /// Evaluates numbers to [|1; 2|] and names to [|"one"; "two"|]. /// [] - val unzip: array:('T1 * 'T2)[] -> ('T1[] * 'T2[]) + val unzip: array: ('T1 * 'T2)[] -> ('T1[] * 'T2[]) /// Splits an array of triples into three arrays. /// @@ -2882,7 +2885,7 @@ module Array = /// The tuple of three arrays. /// /// Thrown when the input array is null. - /// + /// /// /// /// let inputs = [| (1, "one", "I"); (2, "two", "II") |] @@ -2892,7 +2895,7 @@ module Array = /// Evaluates numbers to [|1; 2|], names to [|"one"; "two"|] and roman to [|"I"; "II"|]. /// [] - val unzip3: array:('T1 * 'T2 * 'T3)[] -> ('T1[] * 'T2[] * 'T3[]) + val unzip3: array: ('T1 * 'T2 * 'T3)[] -> ('T1[] * 'T2[] * 'T3[]) /// Returns a new array containing only the elements of the array /// for which the given predicate returns "true". @@ -2915,7 +2918,7 @@ module Array = /// Evaluates to [| 2; 4 |] /// [] - val where: predicate:('T -> bool) -> array:'T[] -> 'T[] + val where: predicate: ('T -> bool) -> array: 'T[] -> 'T[] /// Returns an array of sliding windows containing elements drawn from the input /// array. Each window is returned as a fresh array. @@ -2927,7 +2930,7 @@ module Array = /// /// Thrown when the input array is null. /// Thrown when windowSize is not positive. - /// + /// /// /// /// let inputs = [| 1; 2; 3; 4; 5 |] @@ -2937,7 +2940,7 @@ module Array = /// Evaluates to [|[|1; 2; 3|]; [|2; 3; 4|]; [|3; 4; 5|]|] /// [] - val windowed : windowSize:int -> array:'T[] -> 'T[][] + val windowed: windowSize: int -> array: 'T[] -> 'T[][] /// Combines the two arrays into an array of pairs. The two arrays must have equal lengths, otherwise an ArgumentException is /// raised. @@ -2960,7 +2963,7 @@ module Array = /// Evaluates to [| (1, "one"); (2, "two") |]. /// [] - val zip: array1:'T1[] -> array2:'T2[] -> ('T1 * 'T2)[] + val zip: array1: 'T1[] -> array2: 'T2[] -> ('T1 * 'T2)[] /// Combines three arrays into an array of pairs. The three arrays must have equal lengths, otherwise an ArgumentException is /// raised. @@ -2985,17 +2988,17 @@ module Array = /// Evaluates to [|(1, "one", "I"); (2, "two", "II")|]. /// [] - val zip3: array1:'T1[] -> array2:'T2[] -> array3:'T3[] -> ('T1 * 'T2 * 'T3)[] + val zip3: array1: 'T1[] -> array2: 'T2[] -> array3: 'T3[] -> ('T1 * 'T2 * 'T3)[] /// Return a new array with the item at a given index removed. /// /// The index of the item to be removed. /// The input array. - /// + /// /// The result array. - /// + /// /// Thrown when index is outside 0..source.Length - 1 - /// + /// /// /// /// let inputs = [| 0; 1; 2 |] @@ -3005,14 +3008,14 @@ module Array = /// Evaluates to [| 0; 2 |]. /// [] - val removeAt : index: int -> source: 'T[] -> 'T[] - + val removeAt: index: int -> source: 'T[] -> 'T[] + /// Return a new array with the number of items starting at a given index removed. /// /// The index of the item to be removed. /// The number of items to remove. /// The input array. - /// + /// /// The result array. /// /// Thrown when index is outside 0..source.Length - count @@ -3026,14 +3029,14 @@ module Array = /// Evaluates to [| 0; 3 |]. /// [] - val removeManyAt : index: int -> count: int -> source: 'T[] -> 'T[] - + val removeManyAt: index: int -> count: int -> source: 'T[] -> 'T[] + /// Return a new array with the item at a given index set to the new value. /// /// The index of the item to be replaced. /// The new value. /// The input array. - /// + /// /// The result array. /// /// Thrown when index is outside 0..source.Length - 1 @@ -3047,14 +3050,14 @@ module Array = /// Evaluates to [| 0; 9; 2 |]. /// [] - val updateAt : index: int -> value: 'T -> source: 'T[] -> 'T[] - + val updateAt: index: int -> value: 'T -> source: 'T[] -> 'T[] + /// Return a new array with a new item inserted before the given index. /// /// The index where the item should be inserted. /// The value to insert. /// The input array. - /// + /// /// The result array. /// /// Thrown when index is below 0 or greater than source.Length. @@ -3068,14 +3071,14 @@ module Array = /// Evaluates to [| 0; 9; 1; 2 |]. /// [] - val insertAt : index: int -> value: 'T -> source: 'T[] -> 'T[] - + val insertAt: index: int -> value: 'T -> source: 'T[] -> 'T[] + /// Return a new array with new items inserted before the given index. /// /// The index where the items should be inserted. /// The values to insert. /// The input array. - /// + /// /// The result array. /// /// Thrown when index is below 0 or greater than source.Length. @@ -3089,15 +3092,14 @@ module Array = /// Evaluates to [| 0; 8; 9; 1; 2 |]. /// [] - val insertManyAt : index: int -> values: seq<'T> -> source: 'T[] -> 'T[] + val insertManyAt: index: int -> values: seq<'T> -> source: 'T[] -> 'T[] /// Provides parallel operations on arrays module Parallel = - /// Tests if all elements of the array satisfy the given predicate. /// - /// The predicate is applied to the elements of the input collection in parallel. If any application + /// The predicate is applied to the elements of the input collection in parallel. If any application /// returns false then the overall result is false and testing of other elements in all threads is stopped at system's earliest convenience. /// Otherwise, true is returned. /// @@ -3119,11 +3121,11 @@ module Array = /// [] [] - val forall: predicate:('T -> bool) -> array:'T[] -> bool + val forall: predicate: ('T -> bool) -> array: 'T[] -> bool /// Tests if any element of the array satisfies the given predicate. /// - /// The predicate is applied to the elements of the input array in parallel. If any application + /// The predicate is applied to the elements of the input array in parallel. If any application /// returns true then the overall result is true and testing of other elements in all threads is stopped at system's earliest convenience. /// Otherwise, false is returned. /// @@ -3153,7 +3155,7 @@ module Array = /// [] [] - val exists: predicate:('T -> bool) -> array:'T[] -> bool + val exists: predicate: ('T -> bool) -> array: 'T[] -> bool /// Returns the first element for which the given function returns True. /// Returns None if no such element exists. @@ -3184,8 +3186,7 @@ module Array = /// [] [] - val tryFind: predicate:('T -> bool) -> array:'T[] -> 'T option - + val tryFind: predicate: ('T -> bool) -> array: 'T[] -> 'T option /// Returns the index of the first element in the array /// that satisfies the given predicate. @@ -3216,10 +3217,10 @@ module Array = /// [] [] - val tryFindIndex : predicate:('T -> bool) -> array:'T[] -> int option + val tryFindIndex: predicate: ('T -> bool) -> array: 'T[] -> int option /// Applies the given function to successive elements, returning the first - /// result where the function returns Some(x) for some x. If the function + /// result where the function returns Some(x) for some x. If the function /// never returns Some(x) then None is returned. /// /// The function to transform the array elements into options. @@ -3249,7 +3250,7 @@ module Array = /// [] [] - val tryPick: chooser:('T -> 'U option) -> array:'T[] -> 'U option + val tryPick: chooser: ('T -> 'U option) -> array: 'T[] -> 'U option /// Apply the given function to each element of the array. Return /// the array comprised of the results x for each element where @@ -3283,7 +3284,7 @@ module Array = /// Evaluates to [| 2 |] /// [] - val choose: chooser:('T -> 'U option) -> array:'T[] -> 'U[] + val choose: chooser: ('T -> 'U option) -> array: 'T[] -> 'U[] /// For each element of the array, apply the given function. Concatenate all the results and return the combined array. /// @@ -3317,8 +3318,8 @@ module Array = /// Evaluates to [| 1; 2; 3; 4 |] /// [] - val collect: mapping:('T -> 'U[]) -> array:'T[] -> 'U[] - + val collect: mapping: ('T -> 'U[]) -> array: 'T[] -> 'U[] + /// Build a new array whose elements are the results of applying the given function /// to each of the elements of the array. /// @@ -3341,8 +3342,8 @@ module Array = /// Evaluates to [| 1; 3; 2 |] /// [] - val map: mapping:('T -> 'U) -> array:'T[] -> 'U[] - + val map: mapping: ('T -> 'U) -> array: 'T[] -> 'U[] + /// Build a new array whose elements are the results of applying the given function /// to each of the elements of the array. The integer index passed to the /// function indicates the index of element being transformed. @@ -3366,16 +3367,15 @@ module Array = /// Evaluates to [| 10; 11; 12 |] /// [] - val mapi: mapping:(int -> 'T -> 'U) -> array:'T[] -> 'U[] + val mapi: mapping: (int -> 'T -> 'U) -> array: 'T[] -> 'U[] - /// Applies a key-generating function to each element of an array in parallel and yields an array of - /// unique keys. Each unique key contains an array of all elements that match + /// Applies a key-generating function to each element of an array in parallel and yields an array of + /// unique keys. Each unique key contains an array of all elements that match /// to this key. /// /// Performs the operation in parallel using . /// The order in which the given function is applied to elements of the input array is not specified. /// The order of the keys and values in the result is also not specified - /// A function that transforms an element of the array into a comparable key. /// The input array. /// @@ -3391,9 +3391,10 @@ module Array = /// /// Evaluates to [| (1, [| 1; 3; 5 |]); (0, [| 2; 4 |]) |] /// + [] [] - val groupBy: projection:('T -> 'Key) -> array:'T[] -> ('Key * 'T[])[] when 'Key : equality + val groupBy: projection: ('T -> 'Key) -> array: 'T[] -> ('Key * 'T[])[] when 'Key: equality /// Apply the given function to each element of the array. /// @@ -3419,7 +3420,7 @@ module Array = /// /// [] - val iter: action:('T -> unit) -> array:'T[] -> unit + val iter: action: ('T -> unit) -> array: 'T[] -> unit /// Apply the given function to each element of the array. The integer passed to the /// function indicates the index of element. @@ -3446,8 +3447,8 @@ module Array = /// /// [] - val iteri: action:(int -> 'T -> unit) -> array:'T[] -> unit - + val iteri: action: (int -> 'T -> unit) -> array: 'T[] -> unit + /// Create an array given the dimension and a generator function to compute the elements. /// /// Performs the operation in parallel using . @@ -3465,9 +3466,9 @@ module Array = /// Evaluates to [| 5; 6; 7; 8 |] /// [] - val init: count:int -> initializer:(int -> 'T) -> 'T[] - - /// Split the collection into two collections, containing the + val init: count: int -> initializer: (int -> 'T) -> 'T[] + + /// Split the collection into two collections, containing the /// elements for which the given predicate returns "true" and "false" /// respectively /// @@ -3480,7 +3481,7 @@ module Array = /// The two arrays of results. /// /// Thrown when the input array is null. - /// + /// /// /// /// let inputs = [| 1; 2; 3; 4 |] @@ -3490,11 +3491,11 @@ module Array = /// Evaluates to ([|2; 4|], [|1; 3|]). /// [] - val partition: predicate:('T -> bool) -> array:'T[] -> 'T[] * 'T[] + val partition: predicate: ('T -> bool) -> array: 'T[] -> 'T[] * 'T[] /// Sorts the elements of an array in parallel, returning a new array. Elements are compared using . /// - /// This is not a stable sort, i.e. the original order of equal elements is not necessarily preserved. + /// This is not a stable sort, i.e. the original order of equal elements is not necessarily preserved. /// For a stable sort, consider using . /// /// The input array. @@ -3502,7 +3503,7 @@ module Array = /// The sorted array. /// /// Thrown when the input array is null. - /// + /// /// /// /// let input = [| 8; 4; 3; 1; 6; 1 |] @@ -3513,12 +3514,12 @@ module Array = /// [] [] - val sort: array:'T[] -> 'T[] when 'T : comparison + val sort: array: 'T[] -> 'T[] when 'T: comparison - /// Sorts the elements of an array in parallel, using the given projection for the keys and returning a new array. + /// Sorts the elements of an array in parallel, using the given projection for the keys and returning a new array. /// Elements are compared using . /// - /// This is not a stable sort, i.e. the original order of equal elements is not necessarily preserved. + /// This is not a stable sort, i.e. the original order of equal elements is not necessarily preserved. /// For a stable sort, consider using . /// /// The function to transform array elements into the type that is compared. @@ -3527,7 +3528,7 @@ module Array = /// The sorted array. /// /// Thrown when the input array is null. - /// + /// /// /// /// let input = [| "a"; "bbb"; "cccc"; "dd" |] @@ -3539,11 +3540,11 @@ module Array = [] [] - val sortBy: projection:('T -> 'Key) -> array:'T[] -> 'T[] when 'Key : comparison + val sortBy: projection: ('T -> 'Key) -> array: 'T[] -> 'T[] when 'Key: comparison /// Sorts the elements of an array in parallel, using the given comparison function as the order, returning a new array. /// - /// This is not a stable sort, i.e. the original order of equal elements is not necessarily preserved. + /// This is not a stable sort, i.e. the original order of equal elements is not necessarily preserved. /// For a stable sort, consider using . /// /// The function to compare pairs of array elements. @@ -3552,7 +3553,7 @@ module Array = /// The sorted array. /// /// Thrown when the input array is null. - /// + /// /// Sort an array of pairs using a comparison function that compares string lengths then index numbers: /// /// let compareEntries (n1: int, s1: string) (n2: int, s2: string) = @@ -3568,19 +3569,19 @@ module Array = /// [] [] - val sortWith: comparer:('T -> 'T -> int) -> array:'T[] -> 'T[] + val sortWith: comparer: ('T -> 'T -> int) -> array: 'T[] -> 'T[] - /// Sorts the elements of an array by mutating the array in-place in parallel, using the given projection for the keys. + /// Sorts the elements of an array by mutating the array in-place in parallel, using the given projection for the keys. /// Elements are compared using . /// - /// This is not a stable sort, i.e. the original order of equal elements is not necessarily preserved. + /// This is not a stable sort, i.e. the original order of equal elements is not necessarily preserved. /// For a stable sort, consider using . /// /// The function to transform array elements into the type that is compared. /// The input array. /// /// Thrown when the input array is null. - /// + /// /// /// /// let array = [| "a"; "bbb"; "cccc"; "dd" |] @@ -3591,7 +3592,7 @@ module Array = /// [] [] - val sortInPlaceBy: projection:('T -> 'Key) -> array:'T[] -> unit when 'Key : comparison + val sortInPlaceBy: projection: ('T -> 'Key) -> array: 'T[] -> unit when 'Key: comparison /// Sorts the elements of an array by mutating the array in-place in parallel, using the given comparison function as the order. /// @@ -3599,7 +3600,7 @@ module Array = /// The input array. /// /// Thrown when the input array is null. - /// + /// /// The following sorts entries using a comparison function that compares string lengths then index numbers: /// /// let compareEntries (n1: int, s1: string) (n2: int, s2: string) = @@ -3615,15 +3616,15 @@ module Array = /// [] [] - val sortInPlaceWith: comparer:('T -> 'T -> int) -> array:'T[] -> unit + val sortInPlaceWith: comparer: ('T -> 'T -> int) -> array: 'T[] -> unit - /// Sorts the elements of an array by mutating the array in-place in parallel, using the given comparison function. + /// Sorts the elements of an array by mutating the array in-place in parallel, using the given comparison function. /// Elements are compared using . /// /// The input array. /// /// Thrown when the input array is null. - /// + /// /// /// /// let array = [| 8; 4; 3; 1; 6; 1 |] @@ -3634,17 +3635,17 @@ module Array = /// [] [] - val sortInPlace: array:'T[] -> unit when 'T : comparison + val sortInPlace: array: 'T[] -> unit when 'T: comparison /// Sorts the elements of an array in parallel, in descending order, returning a new array. Elements are compared using . /// - /// This is not a stable sort, i.e. the original order of equal elements is not necessarily preserved. + /// This is not a stable sort, i.e. the original order of equal elements is not necessarily preserved. /// For a stable sort, consider using . /// /// The input array. /// /// The sorted array. - /// + /// /// /// /// let input = [| 8; 4; 3; 1; 6; 1 |] @@ -3655,19 +3656,19 @@ module Array = /// [] [] - val sortDescending: array:'T[] -> 'T[] when 'T : comparison + val sortDescending: array: 'T[] -> 'T[] when 'T: comparison - /// Sorts the elements of an array in parallel, in descending order, using the given projection for the keys and returning a new array. + /// Sorts the elements of an array in parallel, in descending order, using the given projection for the keys and returning a new array. /// Elements are compared using . /// - /// This is not a stable sort, i.e. the original order of equal elements is not necessarily preserved. + /// This is not a stable sort, i.e. the original order of equal elements is not necessarily preserved. /// For a stable sort, consider using . /// /// The function to transform array elements into the type that is compared. /// The input array. /// /// The sorted array. - /// + /// /// /// /// let input = [| "a"; "bbb"; "cccc"; "dd" |] @@ -3678,7 +3679,7 @@ module Array = /// [] [] - val sortByDescending: projection:('T -> 'Key) -> array:'T[] -> 'T[] when 'Key : comparison + val sortByDescending: projection: ('T -> 'Key) -> array: 'T[] -> 'T[] when 'Key: comparison /// Combines the two arrays into an array of pairs. The two arrays must have equal lengths, otherwise an ArgumentException is /// raised. @@ -3702,7 +3703,7 @@ module Array = /// [] [] - val zip: array1:'T1[] -> array2:'T2[] -> ('T1 * 'T2)[] + val zip: array1: 'T1[] -> array2: 'T2[] -> ('T1 * 'T2)[] /// Returns a new collection containing only the elements of the collection /// for which the given predicate returns true. @@ -3724,4 +3725,4 @@ module Array = /// [] [] - val filter: predicate:('T -> bool) -> array:'T[] -> 'T[] \ No newline at end of file + val filter: predicate: ('T -> bool) -> array: 'T[] -> 'T[] diff --git a/src/FSharp.Core/prim-types.fs b/src/FSharp.Core/prim-types.fs index a85d046fd8..c05faec6e9 100644 --- a/src/FSharp.Core/prim-types.fs +++ b/src/FSharp.Core/prim-types.fs @@ -387,7 +387,7 @@ namespace System.Diagnostics.CodeAnalysis /// bitwise combination of its member values. /// [] - type internal DynamicallyAccessedMemberTypes = (* + type internal DynamicallyAccessedMemberTypes = | None = 0 | PublicParameterlessConstructor = 0x0001 | PublicConstructors = 0x0003 @@ -401,7 +401,8 @@ namespace System.Diagnostics.CodeAnalysis | PublicProperties = 0x0200 | NonPublicProperties = 0x0400 | PublicEvents = 0x0800 - | NonPublicEvents = 0x1000 *) + | NonPublicEvents = 0x1000 + | Interfaces = 0x2000 | All = 0xffffffff [ [] - type internal DynamicallyAccessedMemberTypes = (* + type internal DynamicallyAccessedMemberTypes = | None = 0 | PublicParameterlessConstructor = 0x0001 | PublicConstructors = 0x0003 @@ -976,7 +976,8 @@ namespace System.Diagnostics.CodeAnalysis | PublicProperties = 0x0200 | NonPublicProperties = 0x0400 | PublicEvents = 0x0800 - | NonPublicEvents = 0x1000 *) + | NonPublicEvents = 0x1000 + | Interfaces = 0x2000 | All = 0xffffffff [ DynamicallyAccessedMembersAttribute member MemberTypes: DynamicallyAccessedMemberTypes - member DynamicallyAccessedMembersAttribute: DynamicallyAccessedMemberTypes -> unit namespace Microsoft.FSharp.Core diff --git a/src/FSharp.Core/seq.fsi b/src/FSharp.Core/seq.fsi index d4451b6a8a..9ce69ed5ce 100644 --- a/src/FSharp.Core/seq.fsi +++ b/src/FSharp.Core/seq.fsi @@ -6,11 +6,11 @@ open System open System.Collections open Microsoft.FSharp.Core open Microsoft.FSharp.Collections - + /// Contains operations for working with values of type . [] [] -module Seq = +module Seq = /// Returns a new sequence that contains all pairings of elements from the first and second sequences. /// @@ -31,12 +31,12 @@ module Seq = /// /// [] - val allPairs: source1:seq<'T1> -> source2:seq<'T2> -> seq<'T1 * 'T2> + val allPairs: source1: seq<'T1> -> source2: seq<'T2> -> seq<'T1 * 'T2> /// Wraps the two given enumerations as a single concatenated /// enumeration. /// - /// The returned sequence may be passed between threads safely. However, + /// The returned sequence may be passed between threads safely. However, /// individual IEnumerator values generated from the returned sequence should not be accessed /// concurrently. /// @@ -55,7 +55,7 @@ module Seq = /// Evaluates to a sequence yielding the same results as seq { 1; 2; 3; 4 } /// [] - val append: source1:seq<'T> -> source2:seq<'T> -> seq<'T> + val append: source1: seq<'T> -> source2: seq<'T> -> seq<'T> /// Returns the average of the elements in the sequence. /// @@ -83,10 +83,11 @@ module Seq = /// Throws ArgumentException /// [] - val inline average : source:seq<(^T)> -> ^T - when ^T : (static member ( + ) : ^T * ^T -> ^T) - and ^T : (static member DivideByInt : ^T * int -> ^T) - and ^T : (static member Zero : ^T) + val inline average: + source: seq<(^T)> -> ^T + when ^T: (static member (+): ^T * ^T -> ^T) + and ^T: (static member DivideByInt: ^T * int -> ^T) + and ^T: (static member Zero: ^T) /// Returns the average of the results generated by applying the function to each element /// of the sequence. @@ -122,10 +123,11 @@ module Seq = /// Throws ArgumentException /// [] - val inline averageBy : projection:('T -> ^U) -> source:seq<'T> -> ^U - when ^U : (static member ( + ) : ^U * ^U -> ^U) - and ^U : (static member DivideByInt : ^U * int -> ^U) - and ^U : (static member Zero : ^U) + val inline averageBy: + projection: ('T -> ^U) -> source: seq<'T> -> ^U + when ^U: (static member (+): ^U * ^U -> ^U) + and ^U: (static member DivideByInt: ^U * int -> ^U) + and ^U: (static member Zero: ^U) /// Returns a sequence that corresponds to a cached version of the input sequence. /// @@ -168,7 +170,7 @@ module Seq = /// and it will not do the calculation again when called. /// [] - val cache: source:seq<'T> -> seq<'T> + val cache: source: seq<'T> -> seq<'T> /// Wraps a loosely-typed System.Collections sequence as a typed sequence. /// @@ -190,7 +192,7 @@ module Seq = /// Evaluates to a sequence yielding the same results as seq { 1; 2; 3 }, explicitly typed as seq<int>. /// [] - val cast: source:IEnumerable -> seq<'T> + val cast: source: IEnumerable -> seq<'T> /// Applies the given function to each element of the sequence. Returns /// a sequence comprised of the results "x" for each element where @@ -221,7 +223,7 @@ module Seq = /// Evaluates to a sequence yielding the same results as seq { 2 } /// [] - val choose: chooser:('T -> 'U option) -> source:seq<'T> -> seq<'U> + val choose: chooser: ('T -> 'U option) -> source: seq<'T> -> seq<'U> /// Divides the input sequence into chunks of size at most chunkSize. /// @@ -247,7 +249,7 @@ module Seq = /// Throws ArgumentException /// [] - val chunkBySize: chunkSize:int -> source:seq<'T> -> seq<'T[]> + val chunkBySize: chunkSize: int -> source: seq<'T> -> seq<'T[]> /// Applies the given function to each element of the sequence and concatenates all the /// results. @@ -282,7 +284,7 @@ module Seq = /// Evaluates to a sequence yielding the same results as seq { 1; 2; 3; 4 } /// [] - val collect: mapping:('T -> 'Collection) -> source:seq<'T> -> seq<'U> when 'Collection :> seq<'U> + val collect: mapping: ('T -> 'Collection) -> source: seq<'T> -> seq<'U> when 'Collection :> seq<'U> /// Compares two sequences using the given comparison function, element by element. /// @@ -363,7 +365,7 @@ module Seq = /// Evaluates to -1 /// [] - val compareWith: comparer:('T -> 'T -> int) -> source1:seq<'T> -> source2:seq<'T> -> int + val compareWith: comparer: ('T -> 'T -> int) -> source1: seq<'T> -> source2: seq<'T> -> int /// Combines the given enumeration-of-enumerations as a single concatenated /// enumeration. @@ -386,7 +388,7 @@ module Seq = /// Evaluates to a sequence yielding the same results as seq { 1; 2; 3; 4; 5 } /// [] - val concat: sources:seq<'Collection> -> seq<'T> when 'Collection :> seq<'T> + val concat: sources: seq<'Collection> -> seq<'T> when 'Collection :> seq<'T> /// Tests if the sequence contains the specified element. /// @@ -404,7 +406,7 @@ module Seq = /// /// [] - val inline contains: value:'T -> source:seq<'T> -> bool when 'T : equality + val inline contains: value: 'T -> source: seq<'T> -> bool when 'T: equality /// Applies a key-generating function to each element of a sequence and returns a sequence yielding unique /// keys and their number of occurrences in the original sequence. @@ -433,7 +435,7 @@ module Seq = /// Evaluates to a sequence yielding the same results as seq { ("a", 2); ("b", 1) } /// [] - val countBy: projection:('T -> 'Key) -> source:seq<'T> -> seq<'Key * int> when 'Key : equality + val countBy: projection: ('T -> 'Key) -> source: seq<'T> -> seq<'Key * int> when 'Key: equality /// Returns a sequence that is built from the given delayed specification of a /// sequence. @@ -452,7 +454,7 @@ module Seq = /// the generator function every time is consumed. /// [] - val delay: generator:(unit -> seq<'T>) -> seq<'T> + val delay: generator: (unit -> seq<'T>) -> seq<'T> /// Returns a sequence that contains no duplicate entries according to generic hash and /// equality comparisons on the entries. @@ -471,7 +473,7 @@ module Seq = /// Evaluates to a sequence yielding the same results as seq { 1; 2; 3 } /// [] - val distinct: source:seq<'T> -> seq<'T> when 'T : equality + val distinct: source: seq<'T> -> seq<'T> when 'T: equality /// Returns a sequence that contains no duplicate entries according to the /// generic hash and equality comparisons on the keys returned by the given key-generating function. @@ -493,7 +495,7 @@ module Seq = /// Evaluates to a sequence yielding the same results as seq { { Bar = 1 }; { Bar = 2 }; { Bar = 3 } } /// [] - val distinctBy: projection:('T -> 'Key) -> source:seq<'T> -> seq<'T> when 'Key : equality + val distinctBy: projection: ('T -> 'Key) -> source: seq<'T> -> seq<'T> when 'Key: equality /// Splits the input sequence into at most count chunks. /// @@ -528,7 +530,7 @@ module Seq = /// Throws ArgumentException /// [] - val splitInto: count:int -> source:seq<'T> -> seq<'T[]> + val splitInto: count: int -> source: seq<'T> -> seq<'T[]> /// Creates an empty sequence. /// @@ -569,7 +571,7 @@ module Seq = /// Evaluates to a sequence yielding the same results as seq { 2; 4 } /// [] - val except: itemsToExclude:seq<'T> -> source:seq<'T> -> seq<'T> when 'T : equality + val except: itemsToExclude: seq<'T> -> source: seq<'T> -> seq<'T> when 'T: equality /// Tests if any element of the sequence satisfies the given predicate. /// @@ -602,7 +604,7 @@ module Seq = /// Evaluates to false /// [] - val exists: predicate:('T -> bool) -> source:seq<'T> -> bool + val exists: predicate: ('T -> bool) -> source: seq<'T> -> bool /// Tests if any pair of corresponding elements of the input sequences satisfies the given predicate. /// @@ -639,7 +641,7 @@ module Seq = /// Evaluates to true /// [] - val exists2: predicate:('T1 -> 'T2 -> bool) -> source1:seq<'T1> -> source2:seq<'T2> -> bool + val exists2: predicate: ('T1 -> 'T2 -> bool) -> source1: seq<'T1> -> source2: seq<'T2> -> bool /// Returns a new collection containing only the elements of the collection /// for which the given predicate returns "true". This is a synonym for Seq.where. @@ -665,7 +667,7 @@ module Seq = /// Evaluates to a sequence yielding the same results as seq { 2; 4 } /// [] - val filter: predicate:('T -> bool) -> source:seq<'T> -> seq<'T> + val filter: predicate: ('T -> bool) -> source: seq<'T> -> seq<'T> /// Returns a new collection containing only the elements of the collection /// for which the given predicate returns "true". @@ -691,7 +693,7 @@ module Seq = /// Evaluates to a sequence yielding the same results as seq { 2; 4 } /// [] - val where: predicate:('T -> bool) -> source:seq<'T> -> seq<'T> + val where: predicate: ('T -> bool) -> source: seq<'T> -> seq<'T> /// Returns the first element for which the given function returns True. /// @@ -722,7 +724,7 @@ module Seq = /// Throws KeyNotFoundException /// [] - val find: predicate:('T -> bool) -> source:seq<'T> -> 'T + val find: predicate: ('T -> bool) -> source: seq<'T> -> 'T /// Returns the last element for which the given function returns True. /// @@ -756,7 +758,7 @@ module Seq = /// Throws KeyNotFoundException /// [] - val findBack: predicate:('T -> bool) -> source:seq<'T> -> 'T + val findBack: predicate: ('T -> bool) -> source: seq<'T> -> 'T /// Returns the index of the first element for which the given function returns True. /// @@ -786,7 +788,7 @@ module Seq = /// Throws KeyNotFoundException /// [] - val findIndex: predicate:('T -> bool) -> source:seq<'T> -> int + val findIndex: predicate: ('T -> bool) -> source: seq<'T> -> int /// Returns the index of the last element for which the given function returns True. /// @@ -820,7 +822,7 @@ module Seq = /// Throws KeyNotFoundException /// [] - val findIndexBack: predicate:('T -> bool) -> source:seq<'T> -> int + val findIndexBack: predicate: ('T -> bool) -> source: seq<'T> -> int /// Applies a function to each element of the collection, threading an accumulator argument /// through the computation. If the input function is f and the elements are i0...iN @@ -850,7 +852,7 @@ module Seq = /// Evaluates to 2 /// [] - val fold<'T,'State> : folder:('State -> 'T -> 'State) -> state:'State -> source:seq<'T> -> 'State + val fold<'T, 'State> : folder: ('State -> 'T -> 'State) -> state: 'State -> source: seq<'T> -> 'State /// Applies a function to corresponding elements of two collections, threading an accumulator argument /// through the computation. @@ -885,7 +887,8 @@ module Seq = /// Evaluates to 1 /// [] - val fold2<'T1,'T2,'State> : folder:('State -> 'T1 -> 'T2 -> 'State) -> state:'State -> source1:seq<'T1> -> source2:seq<'T2> -> 'State + val fold2<'T1, 'T2, 'State> : + folder: ('State -> 'T1 -> 'T2 -> 'State) -> state: 'State -> source1: seq<'T1> -> source2: seq<'T2> -> 'State /// Applies a function to each element of the collection, starting from the end, threading an accumulator argument /// through the computation. If the input function is f and the elements are i0...iN @@ -930,7 +933,7 @@ module Seq = /// /// [] - val foldBack<'T,'State> : folder:('T -> 'State -> 'State) -> source:seq<'T> -> state:'State -> 'State + val foldBack<'T, 'State> : folder: ('T -> 'State -> 'State) -> source: seq<'T> -> state: 'State -> 'State /// Applies a function to corresponding elements of two collections, starting from the end of the shorter collection, /// threading an accumulator argument through the computation. The two sequences need not have equal lengths. @@ -982,7 +985,8 @@ module Seq = /// /// [] - val foldBack2<'T1,'T2,'State> : folder:('T1 -> 'T2 -> 'State -> 'State) -> source1:seq<'T1> -> source2:seq<'T2> -> state:'State -> 'State + val foldBack2<'T1, 'T2, 'State> : + folder: ('T1 -> 'T2 -> 'State -> 'State) -> source1: seq<'T1> -> source2: seq<'T2> -> state: 'State -> 'State /// Tests if all elements of the sequence satisfy the given predicate. /// @@ -1007,7 +1011,7 @@ module Seq = /// /// [] - val forall: predicate:('T -> bool) -> source:seq<'T> -> bool + val forall: predicate: ('T -> bool) -> source: seq<'T> -> bool /// Tests the all pairs of elements drawn from the two sequences satisfy the /// given predicate. If one sequence is shorter than @@ -1041,7 +1045,7 @@ module Seq = /// Evaluates to false. /// [] - val forall2: predicate:('T1 -> 'T2 -> bool) -> source1:seq<'T1> -> source2:seq<'T2> -> bool + val forall2: predicate: ('T1 -> 'T2 -> bool) -> source1: seq<'T1> -> source2: seq<'T2> -> bool /// Applies a key-generating function to each element of a sequence and yields a sequence of /// unique keys. Each unique key contains a sequence of all elements that match @@ -1066,7 +1070,7 @@ module Seq = /// Evaluates to a sequence yielding the same results as seq { (1, seq { 1; 3; 5 }); (0, seq { 2; 4 }) } /// [] - val groupBy: projection:('T -> 'Key) -> source:seq<'T> -> seq<'Key * seq<'T>> when 'Key : equality + val groupBy: projection: ('T -> 'Key) -> source: seq<'T> -> seq<'Key * seq<'T>> when 'Key: equality /// Returns the first element of the sequence. /// @@ -1093,7 +1097,7 @@ module Seq = /// Throws ArgumentException /// [] - val head: source:seq<'T> -> 'T + val head: source: seq<'T> -> 'T /// Returns the first element of the sequence, or None if the sequence is empty. /// @@ -1117,7 +1121,7 @@ module Seq = /// Evaluates to None /// [] - val tryHead: source:seq<'T> -> 'T option + val tryHead: source: seq<'T> -> 'T option /// Returns the last element of the sequence. /// @@ -1142,7 +1146,7 @@ module Seq = /// Throws ArgumentException /// [] - val last: source:seq<'T> -> 'T + val last: source: seq<'T> -> 'T /// Returns the last element of the sequence. /// Return None if no such element exists. @@ -1167,7 +1171,7 @@ module Seq = /// Evaluates to None /// [] - val tryLast: source:seq<'T> -> 'T option + val tryLast: source: seq<'T> -> 'T option /// Returns the only element of the sequence. /// @@ -1203,7 +1207,7 @@ module Seq = /// Throws ArgumentException /// [] - val exactlyOne: source:seq<'T> -> 'T + val exactlyOne: source: seq<'T> -> 'T /// Returns the only element of the sequence or None if sequence is empty or contains more than one element. /// @@ -1238,7 +1242,7 @@ module Seq = /// Evaluates to None /// [] - val tryExactlyOne: source:seq<'T> -> 'T option + val tryExactlyOne: source: seq<'T> -> 'T option /// Returns true if the sequence contains no elements, false otherwise. /// @@ -1262,7 +1266,7 @@ module Seq = /// Evaluates to false /// [] - val isEmpty: source:seq<'T> -> bool + val isEmpty: source: seq<'T> -> bool /// Builds a new collection whose elements are the corresponding elements of the input collection /// paired with the integer index (from 0) of each element. @@ -1280,7 +1284,7 @@ module Seq = /// Evaluates to a sequence yielding the same results as seq { (0, "a"); (1, "b"); (2, "c") } /// [] - val indexed: source:seq<'T> -> seq + val indexed: source: seq<'T> -> seq /// Generates a new sequence which, when iterated, will return successive /// elements by calling the given function, up to the given count. Each element is saved after its @@ -1311,7 +1315,7 @@ module Seq = /// Throws ArgumentException /// [] - val init: count:int -> initializer:(int -> 'T) -> seq<'T> + val init: count: int -> initializer: (int -> 'T) -> seq<'T> /// Generates a new sequence which, when iterated, will return successive /// elements by calling the given function. The results of calling the function @@ -1334,7 +1338,7 @@ module Seq = /// Evaluates to a sequence yielding the same results as seq { 5; 6; 7; 8; ... } /// [] - val initInfinite: initializer:(int -> 'T) -> seq<'T> + val initInfinite: initializer: (int -> 'T) -> seq<'T> /// Computes the element at the specified index in the collection. /// @@ -1364,7 +1368,7 @@ module Seq = /// Throws ArgumentException /// [] - val item: index:int -> source:seq<'T> -> 'T + val item: index: int -> source: seq<'T> -> 'T /// Applies the given function to each element of the collection. /// @@ -1386,7 +1390,7 @@ module Seq = /// in the console. /// [] - val iter: action:('T -> unit) -> source:seq<'T> -> unit + val iter: action: ('T -> unit) -> source: seq<'T> -> unit /// Applies the given function to each element of the collection. The integer passed to the /// function indicates the index of element. @@ -1412,7 +1416,7 @@ module Seq = /// in the console. /// [] - val iteri: action:(int -> 'T -> unit) -> source:seq<'T> -> unit + val iteri: action: (int -> 'T -> unit) -> source: seq<'T> -> unit /// Applies the given function to two collections simultaneously. If one sequence is shorter than /// the other then the remaining elements of the longer sequence are ignored. @@ -1439,7 +1443,7 @@ module Seq = /// in the console. /// [] - val iter2: action:('T1 -> 'T2 -> unit) -> source1:seq<'T1> -> source2:seq<'T2> -> unit + val iter2: action: ('T1 -> 'T2 -> unit) -> source1: seq<'T1> -> source2: seq<'T2> -> unit /// Applies the given function to two collections simultaneously. If one sequence is shorter than /// the other then the remaining elements of the longer sequence are ignored. The integer passed to the @@ -1467,7 +1471,7 @@ module Seq = /// in the console. /// [] - val iteri2: action:(int -> 'T1 -> 'T2 -> unit) -> source1:seq<'T1> -> source2:seq<'T2> -> unit + val iteri2: action: (int -> 'T1 -> 'T2 -> unit) -> source1: seq<'T1> -> source2: seq<'T2> -> unit /// Returns the length of the sequence /// @@ -1486,7 +1490,7 @@ module Seq = /// Evaluates to 3 /// [] - val length: source:seq<'T> -> int + val length: source: seq<'T> -> int /// Builds a new collection whose elements are the results of applying the given function /// to each of the elements of the collection. The given function will be applied @@ -1512,7 +1516,7 @@ module Seq = /// Evaluates to a sequence yielding the same results as seq { 1; 3; 2 } /// [] - val map: mapping:('T -> 'U) -> source:seq<'T> -> seq<'U> + val map: mapping: ('T -> 'U) -> source: seq<'T> -> seq<'U> /// Builds a new collection whose elements are the results of applying the given function /// to the corresponding pairs of elements from the two sequences. If one input sequence is shorter than @@ -1536,7 +1540,7 @@ module Seq = /// Evaluates to a sequence yielding the same results as seq { 'a'; 'd'; 'o' } /// [] - val map2: mapping:('T1 -> 'T2 -> 'U) -> source1:seq<'T1> -> source2:seq<'T2> -> seq<'U> + val map2: mapping: ('T1 -> 'T2 -> 'U) -> source1: seq<'T1> -> source2: seq<'T2> -> seq<'U> /// Combines map and fold. Builds a new collection whose elements are the results of applying the given function /// to each of the elements of the collection. The function is also used to accumulate a final value. @@ -1569,7 +1573,8 @@ module Seq = /// Evaluates newCharges to seq { In 2; Out 4; In 6 } and balance to 2. /// [] - val mapFold<'T,'State,'Result> : mapping:('State -> 'T -> 'Result * 'State) -> state:'State -> source:seq<'T> -> seq<'Result> * 'State + val mapFold<'T, 'State, 'Result> : + mapping: ('State -> 'T -> 'Result * 'State) -> state: 'State -> source: seq<'T> -> seq<'Result> * 'State /// Combines map and foldBack. Builds a new collection whose elements are the results of applying the given function /// to each of the elements of the collection. The function is also used to accumulate a final value. @@ -1602,7 +1607,8 @@ module Seq = /// Evaluates newCharges to seq { In 2; Out 4; In 6 } and balance to 2. /// [] - val mapFoldBack<'T,'State,'Result> : mapping:('T -> 'State -> 'Result * 'State) -> source:seq<'T> -> state:'State -> seq<'Result> * 'State + val mapFoldBack<'T, 'State, 'Result> : + mapping: ('T -> 'State -> 'Result * 'State) -> source: seq<'T> -> state: 'State -> seq<'Result> * 'State /// Builds a new collection whose elements are the results of applying the given function /// to the corresponding triples of elements from the three sequences. If one input sequence if shorter than @@ -1627,9 +1633,10 @@ module Seq = /// /// Evaluates to a sequence yielding the same results as seq { "all"; "the"; "time" } /// - /// + /// [] - val map3: mapping:('T1 -> 'T2 -> 'T3 -> 'U) -> source1:seq<'T1> -> source2:seq<'T2> -> source3:seq<'T3> -> seq<'U> + val map3: + mapping: ('T1 -> 'T2 -> 'T3 -> 'U) -> source1: seq<'T1> -> source2: seq<'T2> -> source3: seq<'T3> -> seq<'U> /// Builds a new collection whose elements are the results of applying the given function /// to each of the elements of the collection. The integer index passed to the @@ -1651,7 +1658,7 @@ module Seq = /// Evaluates to a sequence yielding the same results as seq { 10; 11; 12 } /// [] - val mapi: mapping:(int -> 'T -> 'U) -> source:seq<'T> -> seq<'U> + val mapi: mapping: (int -> 'T -> 'U) -> source: seq<'T> -> seq<'U> /// Builds a new collection whose elements are the results of applying the given function /// to the corresponding pairs of elements from the two sequences. If one input sequence is shorter than @@ -1676,7 +1683,7 @@ module Seq = /// Evaluates to a sequence yielding the same results as seq { (0, 'a'); (1, 'd'); (2, 'o') } /// [] - val mapi2: mapping:(int -> 'T1 -> 'T2 -> 'U) -> source1:seq<'T1> -> source2:seq<'T2> -> seq<'U> + val mapi2: mapping: (int -> 'T1 -> 'T2 -> 'U) -> source1: seq<'T1> -> source2: seq<'T2> -> seq<'U> /// Returns the greatest of all elements of the sequence, compared via Operators.max /// @@ -1705,7 +1712,7 @@ module Seq = /// Throws System.ArgumentException. /// [] - val inline max: source:seq<'T> -> 'T when 'T : comparison + val inline max: source: seq<'T> -> 'T when 'T: comparison /// Returns the greatest of all elements of the sequence, compared via Operators.max on the function result. /// @@ -1735,7 +1742,7 @@ module Seq = /// Throws System.ArgumentException. /// [] - val inline maxBy : projection:('T -> 'U) -> source:seq<'T> -> 'T when 'U : comparison + val inline maxBy: projection: ('T -> 'U) -> source: seq<'T> -> 'T when 'U: comparison /// Returns the lowest of all elements of the sequence, compared via Operators.min. /// @@ -1764,7 +1771,7 @@ module Seq = /// Throws System.ArgumentException. /// [] - val inline min: source:seq<'T> -> 'T when 'T : comparison + val inline min: source: seq<'T> -> 'T when 'T: comparison /// Returns the lowest of all elements of the sequence, compared via Operators.min on the function result. /// @@ -1794,7 +1801,7 @@ module Seq = /// Throws System.ArgumentException. /// [] - val inline minBy: projection:('T -> 'U) -> source:seq<'T> -> 'T when 'U : comparison + val inline minBy: projection: ('T -> 'U) -> source: seq<'T> -> 'T when 'U: comparison /// Computes the nth element in the collection. /// @@ -1807,7 +1814,7 @@ module Seq = /// Thrown when the index is negative or the input sequence does not contain enough elements. [] [] - val nth: index:int -> source:seq<'T> -> 'T + val nth: index: int -> source: seq<'T> -> 'T /// Views the given array as a sequence. /// @@ -1826,7 +1833,7 @@ module Seq = /// Evaluates to a sequence yielding the same results as seq { 1; 2; 5 }. /// [] - val ofArray: source:'T[] -> seq<'T> + val ofArray: source: 'T[] -> seq<'T> /// Views the given list as a sequence. /// @@ -1843,7 +1850,7 @@ module Seq = /// Evaluates to a sequence yielding the same results as seq { 1; 2; 5 }. /// [] - val ofList: source:'T list -> seq<'T> + val ofList: source: 'T list -> seq<'T> /// Returns a sequence of each element in the input sequence and its predecessor, with the /// exception of the first element which is only returned as the predecessor of the second element. @@ -1853,7 +1860,7 @@ module Seq = /// The result sequence. /// /// Thrown when the input sequence is null. - /// + /// /// /// /// let inputs = seq { 1; 2; 3; 4 } @@ -1863,7 +1870,7 @@ module Seq = /// Evaluates to a sequence yielding the same results as seq { (1, 2); (2, 3); (3, 4) }. /// [] - val pairwise: source:seq<'T> -> seq<'T * 'T> + val pairwise: source: seq<'T> -> seq<'T * 'T> /// Returns a sequence with all elements permuted according to the /// specified permutation. @@ -1877,7 +1884,7 @@ module Seq = /// /// Thrown when the input sequence is null. /// Thrown when indexMap does not produce a valid permutation. - /// + /// /// /// /// let inputs = [1; 2; 3; 4] @@ -1887,7 +1894,7 @@ module Seq = /// Evaluates to a sequence yielding the same results as seq { 4; 1; 2; 3 }. /// [] - val permute: indexMap:(int -> int) -> source:seq<'T> -> seq<'T> + val permute: indexMap: (int -> int) -> source: seq<'T> -> seq<'T> /// Applies the given function to successive elements, returning the first /// x where the function returns "Some(x)". @@ -1920,7 +1927,7 @@ module Seq = /// /// [] - val pick: chooser:('T -> 'U option) -> source:seq<'T> -> 'U + val pick: chooser: ('T -> 'U option) -> source: seq<'T> -> 'U /// Builds a new sequence object that delegates to the given sequence object. This ensures /// the original sequence cannot be rediscovered and mutated by a type cast. For example, @@ -1953,7 +1960,7 @@ module Seq = /// Throws an InvalidCastException. /// [] - val readonly: source:seq<'T> -> seq<'T> + val readonly: source: seq<'T> -> seq<'T> /// Applies a function to each element of the sequence, threading an accumulator argument /// through the computation. Begin by applying the function to the first two elements. @@ -1968,7 +1975,7 @@ module Seq = /// /// Thrown when the input sequence is null. /// Thrown when the input sequence is empty. - /// + /// /// /// /// let inputs = [1; 3; 4; 2] @@ -1978,7 +1985,7 @@ module Seq = /// Evaluates to 1342, by computing ((1 * 10 + 3) * 10 + 4) * 10 + 2 /// [] - val reduce: reduction:('T -> 'T -> 'T) -> source:seq<'T> -> 'T + val reduce: reduction: ('T -> 'T -> 'T) -> source: seq<'T> -> 'T /// Creates a sequence by replicating the given initial value. /// @@ -1986,7 +1993,7 @@ module Seq = /// The value to replicate /// /// The generated sequence. - /// + /// /// /// /// Seq.replicate 3 "a" @@ -1994,7 +2001,7 @@ module Seq = /// Evaluates to a sequence yielding the same results as seq { "a"; "a"; "a" }. /// [] - val replicate: count:int -> initial:'T -> seq<'T> + val replicate: count: int -> initial: 'T -> seq<'T> /// Applies a function to each element of the sequence, starting from the end, threading an accumulator argument /// through the computation. If the input function is f and the elements are i0...iN @@ -2010,7 +2017,7 @@ module Seq = /// Thrown when the input sequence is empty. /// /// This function consumes the whole input sequence before returning the result. - /// + /// /// /// /// let inputs = [1; 3; 4; 2] @@ -2020,7 +2027,7 @@ module Seq = /// Evaluates to 2431, by computing 1 + (3 + (4 + 2 * 10) * 10) * 10 /// [] - val reduceBack: reduction:('T -> 'T -> 'T) -> source:seq<'T> -> 'T + val reduceBack: reduction: ('T -> 'T -> 'T) -> source: seq<'T> -> 'T /// Returns a new sequence with the elements in reverse order. /// @@ -2031,7 +2038,7 @@ module Seq = /// Thrown when the input sequence is null. /// /// This function consumes the whole input sequence before yielding the first element of the reversed sequence. - /// + /// /// /// /// let input = seq { 0; 1; 2 } @@ -2041,7 +2048,7 @@ module Seq = /// Evaluates to a sequence yielding the same results as seq { 2; 1; 0 }. /// [] - val rev: source:seq<'T> -> seq<'T> + val rev: source: seq<'T> -> seq<'T> /// Like fold, but computes on-demand and returns the sequence of intermediary and final results. /// @@ -2052,7 +2059,7 @@ module Seq = /// The resulting sequence of computed states. /// /// Thrown when the input sequence is null. - /// + /// /// Apply a list charges and collect the running balances as each is applied: /// /// type Charge = @@ -2070,7 +2077,7 @@ module Seq = /// state, 1 the next state, -1 the next state, and 2 the final state. /// [] - val scan<'T,'State> : folder:('State -> 'T -> 'State) -> state:'State -> source:seq<'T> -> seq<'State> + val scan<'T, 'State> : folder: ('State -> 'T -> 'State) -> state: 'State -> source: seq<'T> -> seq<'State> /// Like foldBack, but returns the sequence of intermediary and final results. /// @@ -2085,7 +2092,7 @@ module Seq = /// The resulting sequence of computed states. /// /// Thrown when the input sequence is null. - /// + /// /// Apply a list charges from back to front, and collect the running balances as each is applied: /// /// type Charge = @@ -2104,14 +2111,14 @@ module Seq = /// are produced from back to front. /// [] - val scanBack<'T,'State> : folder:('T -> 'State -> 'State) -> source:seq<'T> -> state:'State -> seq<'State> + val scanBack<'T, 'State> : folder: ('T -> 'State -> 'State) -> source: seq<'T> -> state: 'State -> seq<'State> /// Returns a sequence yielding one item only. /// /// The input item. /// /// The result sequence of one item. - /// + /// /// /// /// Seq.singleton 7 @@ -2119,7 +2126,7 @@ module Seq = /// Evaluates to a sequence yielding the same results as seq { 7 }. /// [] - val singleton: value:'T -> seq<'T> + val singleton: value: 'T -> seq<'T> /// Returns a sequence that skips N elements of the underlying sequence and then yields the /// remaining elements of the sequence. @@ -2160,7 +2167,7 @@ module Seq = /// Evaluates a sequence yielding the same results as seq { "a"; "b"; "c"; "d" }. /// [] - val skip: count:int -> source:seq<'T> -> seq<'T> + val skip: count: int -> source: seq<'T> -> seq<'T> /// Returns a sequence that, when iterated, skips elements of the underlying sequence while the /// given predicate returns True, and then yields the remaining elements of the sequence. @@ -2181,7 +2188,7 @@ module Seq = /// Evaluates a sequence yielding the same results as seq { "bbb"; "cc"; "d" } /// [] - val skipWhile: predicate:('T -> bool) -> source:seq<'T> -> seq<'T> + val skipWhile: predicate: ('T -> bool) -> source: seq<'T> -> seq<'T> /// Yields a sequence ordered by keys. /// @@ -2197,7 +2204,7 @@ module Seq = /// The result sequence. /// /// Thrown when the input sequence is null. - /// + /// /// /// /// let input = seq { 8; 4; 3; 1; 6; 1 } @@ -2207,7 +2214,7 @@ module Seq = /// Evaluates to a sequence yielding the same results as seq { 1; 1 3; 4; 6; 8 }. /// [] - val sort: source:seq<'T> -> seq<'T> when 'T : comparison + val sort: source: seq<'T> -> seq<'T> when 'T: comparison /// Yields a sequence ordered using the given comparison function. /// @@ -2237,7 +2244,7 @@ module Seq = /// Evaluates to a sequence yielding the same results as seq { (0, "aa"); (2, "cc"); (3, "dd"); (1, "bbb") }. /// [] - val sortWith: comparer:('T -> 'T -> int) -> source:seq<'T> -> seq<'T> + val sortWith: comparer: ('T -> 'T -> int) -> source: seq<'T> -> seq<'T> /// Applies a key-generating function to each element of a sequence and yield a sequence ordered /// by keys. The keys are compared using generic comparison as implemented by . @@ -2255,7 +2262,7 @@ module Seq = /// The result sequence. /// /// Thrown when the input sequence is null. - /// + /// /// /// /// let input = [ "a"; "bbb"; "cccc"; "dd" ] @@ -2265,7 +2272,7 @@ module Seq = /// Evaluates to a sequence yielding the same results as seq { "a"; "dd"; "bbb"; "cccc" }. /// [] - val sortBy: projection:('T -> 'Key) -> source:seq<'T> -> seq<'T> when 'Key : comparison + val sortBy: projection: ('T -> 'Key) -> source: seq<'T> -> seq<'T> when 'Key: comparison /// Yields a sequence ordered descending by keys. /// @@ -2281,7 +2288,7 @@ module Seq = /// The result sequence. /// /// Thrown when the input sequence is null. - /// + /// /// /// /// let input = seq { 8; 4; 3; 1; 6; 1 } @@ -2291,7 +2298,7 @@ module Seq = /// Evaluates to a sequence yielding the same results as seq { 8; 6; 4; 3; 1; 1 }. /// [] - val inline sortDescending: source:seq<'T> -> seq<'T> when 'T : comparison + val inline sortDescending: source: seq<'T> -> seq<'T> when 'T: comparison /// Applies a key-generating function to each element of a sequence and yield a sequence ordered /// descending by keys. The keys are compared using generic comparison as implemented by . @@ -2309,7 +2316,7 @@ module Seq = /// The result sequence. /// /// Thrown when the input sequence is null. - /// + /// /// /// /// let input = ["a"; "bbb"; "cccc"; "dd"] @@ -2319,7 +2326,7 @@ module Seq = /// Evaluates to a sequence yielding the same results as seq { "cccc"; "bbb"; "dd"; "a" }. /// [] - val inline sortByDescending : projection:('T -> 'Key) -> source:seq<'T> -> seq<'T> when 'Key : comparison + val inline sortByDescending: projection: ('T -> 'Key) -> source: seq<'T> -> seq<'T> when 'Key: comparison /// Returns the sum of the elements in the sequence. /// @@ -2328,7 +2335,7 @@ module Seq = /// The input sequence. /// /// The computed sum. - /// + /// /// /// /// let input = [ 1; 5; 3; 2 ] @@ -2338,9 +2345,7 @@ module Seq = /// Evaluates to 11. /// [] - val inline sum: source:seq<(^T)> -> ^T - when ^T : (static member ( + ) : ^T * ^T -> ^T) - and ^T : (static member Zero : ^T) + val inline sum: source: seq<(^T)> -> ^T when ^T: (static member (+): ^T * ^T -> ^T) and ^T: (static member Zero: ^T) /// Returns the sum of the results generated by applying the function to each element of the sequence. /// @@ -2350,7 +2355,7 @@ module Seq = /// The input sequence. /// /// The computed sum. - /// + /// /// /// /// let input = [ "aa"; "bbb"; "cc" ] @@ -2360,9 +2365,9 @@ module Seq = /// Evaluates to 7. /// [] - val inline sumBy: projection:('T -> ^U) -> source:seq<'T> -> ^U - when ^U : (static member ( + ) : ^U * ^U -> ^U) - and ^U : (static member Zero : ^U) + val inline sumBy: + projection: ('T -> ^U) -> source: seq<'T> -> ^U + when ^U: (static member (+): ^U * ^U -> ^U) and ^U: (static member Zero: ^U) /// Returns a sequence that skips 1 element of the underlying sequence and then yields the /// remaining elements of the sequence. @@ -2384,7 +2389,7 @@ module Seq = /// /// [] - val tail: source:seq<'T> -> seq<'T> + val tail: source: seq<'T> -> seq<'T> /// Returns the first N elements of the sequence. /// @@ -2429,7 +2434,7 @@ module Seq = /// Evaluates to a sequence yielding no results. /// [] - val take: count:int -> source:seq<'T> -> seq<'T> + val take: count: int -> source: seq<'T> -> seq<'T> /// Returns a sequence that, when iterated, yields elements of the underlying sequence while the /// given predicate returns True, and then returns no further elements. @@ -2450,7 +2455,7 @@ module Seq = /// Evaluates to a sequence yielding the same results as seq { "a"; "bb" } /// [] - val takeWhile: predicate:('T -> bool) -> source:seq<'T> -> seq<'T> + val takeWhile: predicate: ('T -> bool) -> source: seq<'T> -> seq<'T> /// Builds an array from the given collection. /// @@ -2469,7 +2474,7 @@ module Seq = /// Evaluates to [| 1; 2; 5 |]. /// [] - val toArray: source:seq<'T> -> 'T[] + val toArray: source: seq<'T> -> 'T[] /// Builds a list from the given collection. /// @@ -2488,7 +2493,7 @@ module Seq = /// Evaluates to [ 1; 2; 5 ]. /// [] - val toList: source:seq<'T> -> 'T list + val toList: source: seq<'T> -> 'T list /// Returns the first element for which the given function returns True. /// Return None if no such element exists. @@ -2518,7 +2523,7 @@ module Seq = /// Evaluates to None /// [] - val tryFind: predicate:('T -> bool) -> source:seq<'T> -> 'T option + val tryFind: predicate: ('T -> bool) -> source: seq<'T> -> 'T option /// Returns the last element for which the given function returns True. /// Return None if no such element exists. @@ -2551,7 +2556,7 @@ module Seq = /// Evaluates to None /// [] - val tryFindBack: predicate:('T -> bool) -> source:seq<'T> -> 'T option + val tryFindBack: predicate: ('T -> bool) -> source: seq<'T> -> 'T option /// Returns the index of the first element in the sequence /// that satisfies the given predicate. Return None if no such element exists. @@ -2581,7 +2586,7 @@ module Seq = /// Evaluates to None /// [] - val tryFindIndex : predicate:('T -> bool) -> source:seq<'T> -> int option + val tryFindIndex: predicate: ('T -> bool) -> source: seq<'T> -> int option /// Tries to find the nth element in the sequence. /// Returns None if index is negative or the input sequence does not contain enough elements. @@ -2610,7 +2615,7 @@ module Seq = /// Evaluates to None. /// [] - val tryItem: index:int -> source:seq<'T> -> 'T option + val tryItem: index: int -> source: seq<'T> -> 'T option /// Returns the index of the last element in the sequence /// that satisfies the given predicate. Return None if no such element exists. @@ -2643,7 +2648,7 @@ module Seq = /// Evaluates to None /// [] - val tryFindIndexBack : predicate:('T -> bool) -> source:seq<'T> -> int option + val tryFindIndexBack: predicate: ('T -> bool) -> source: seq<'T> -> int option /// Applies the given function to successive elements, returning the first /// result where the function returns "Some(x)". @@ -2673,7 +2678,7 @@ module Seq = /// Evaluates to None. /// [] - val tryPick: chooser:('T -> 'U option) -> source:seq<'T> -> 'U option + val tryPick: chooser: ('T -> 'U option) -> source: seq<'T> -> 'U option /// Returns the transpose of the given sequence of sequences. /// @@ -2698,7 +2703,7 @@ module Seq = /// Evaluates to a sequence of sequences yielding the same results as [ [10; 11]; [20; 21]; [30; 31] ]. /// [] - val transpose: source:seq<'Collection> -> seq> when 'Collection :> seq<'T> + val transpose: source: seq<'Collection> -> seq> when 'Collection :> seq<'T> /// Returns a sequence that when enumerated returns at most N elements. /// @@ -2736,7 +2741,7 @@ module Seq = /// Evaluates to the empty sequence. /// [] - val truncate: count:int -> source:seq<'T> -> seq<'T> + val truncate: count: int -> source: seq<'T> -> seq<'T> /// Returns a sequence that contains the elements generated by the given computation. /// The given initial state argument is passed to the element generator. @@ -2766,7 +2771,7 @@ module Seq = /// Evaluates to an infinite sequence yielding the results seq { 1I; 2I; 4I; 8I; ... } /// [] - val unfold: generator:('State -> ('T * 'State) option) -> state:'State -> seq<'T> + val unfold: generator: ('State -> ('T * 'State) option) -> state: 'State -> seq<'T> /// Returns a sequence yielding sliding windows containing elements drawn from the input /// sequence. Each window is returned as a fresh array. @@ -2777,7 +2782,7 @@ module Seq = /// The result sequence. /// Thrown when the input sequence is null. /// Thrown when windowSize is not positive. - /// + /// /// /// /// let inputs = [1; 2; 3; 4; 5] @@ -2787,7 +2792,7 @@ module Seq = /// Evaluates to a sequence of arrays yielding the results seq { [| 1; 2; 3 |]; [| 2; 3; 4 |]; [| 3; 4; 5 |] } /// [] - val windowed: windowSize:int -> source:seq<'T> -> seq<'T[]> + val windowed: windowSize: int -> source: seq<'T> -> seq<'T[]> /// Combines the two sequences into a sequence of pairs. The two sequences need not have equal lengths: /// when one sequence is exhausted any remaining elements in the other @@ -2810,7 +2815,7 @@ module Seq = /// Evaluates to a sequence yielding the same results as seq { (1, "one"); (2, "two") }. /// [] - val zip: source1:seq<'T1> -> source2:seq<'T2> -> seq<'T1 * 'T2> + val zip: source1: seq<'T1> -> source2: seq<'T2> -> seq<'T1 * 'T2> /// Combines the three sequences into a sequence of triples. The sequences need not have equal lengths: /// when one sequence is exhausted any remaining elements in the other @@ -2835,7 +2840,7 @@ module Seq = /// Evaluates to a sequence yielding the same results as seq { (1, "one", "I"); (2, "two", "II") }. /// [] - val zip3: source1:seq<'T1> -> source2:seq<'T2> -> source3:seq<'T3> -> seq<'T1 * 'T2 * 'T3> + val zip3: source1: seq<'T1> -> source2: seq<'T2> -> source3: seq<'T3> -> seq<'T1 * 'T2 * 'T3> /// Return a new sequence with the item at a given index removed. /// diff --git a/src/FSharp.Core/tasks.fsi b/src/FSharp.Core/tasks.fsi index 8a13212d51..665041067d 100644 --- a/src/FSharp.Core/tasks.fsi +++ b/src/FSharp.Core/tasks.fsi @@ -4,283 +4,284 @@ namespace Microsoft.FSharp.Control - open System - open System.Runtime.CompilerServices - open System.Threading.Tasks - open Microsoft.FSharp.Core - open Microsoft.FSharp.Core.CompilerServices - open Microsoft.FSharp.Collections +open System +open System.Runtime.CompilerServices +open System.Threading.Tasks +open Microsoft.FSharp.Core +open Microsoft.FSharp.Core.CompilerServices +open Microsoft.FSharp.Collections + +/// +/// The extra data stored in ResumableStateMachine for tasks +/// +[] +[] +type TaskStateMachineData<'T> = /// - /// The extra data stored in ResumableStateMachine for tasks + /// Holds the final result of the state machine /// - [] - [] - type TaskStateMachineData<'T> = - - /// - /// Holds the final result of the state machine - /// - [] - val mutable Result: 'T - - /// - /// Holds the MethodBuilder for the state machine - /// - [] - val mutable MethodBuilder: AsyncTaskMethodBuilder<'T> + [] + val mutable Result: 'T /// - /// This is used by the compiler as a template for creating state machine structs + /// Holds the MethodBuilder for the state machine /// - and [] - TaskStateMachine<'TOverall> = ResumableStateMachine> + [] + val mutable MethodBuilder: AsyncTaskMethodBuilder<'T> + +/// +/// This is used by the compiler as a template for creating state machine structs +/// +and [] TaskStateMachine<'TOverall> = + ResumableStateMachine> + +/// +/// Represents the runtime continuation of a task state machine created dynamically +/// +and [] TaskResumptionFunc<'TOverall> = ResumptionFunc> + +/// +/// A special compiler-recognised delegate type for specifying blocks of task code +/// with access to the state machine. +/// +and [] TaskCode<'TOverall, 'T> = ResumableCode, 'T> + +/// +/// Contains methods to build tasks using the F# computation expression syntax +/// +[] +type TaskBuilderBase = /// - /// Represents the runtime continuation of a task state machine created dynamically + /// Specifies the sequential composition of two units of task code. /// - and [] - TaskResumptionFunc<'TOverall> = ResumptionFunc> + member inline Combine: task1: TaskCode<'TOverall, unit> * task2: TaskCode<'TOverall, 'T> -> TaskCode<'TOverall, 'T> /// - /// A special compiler-recognised delegate type for specifying blocks of task code - /// with access to the state machine. + /// Specifies the delayed execution of a unit of task code. /// - and [] - TaskCode<'TOverall, 'T> = ResumableCode, 'T> + member inline Delay: generator: (unit -> TaskCode<'TOverall, 'T>) -> TaskCode<'TOverall, 'T> /// - /// Contains methods to build tasks using the F# computation expression syntax + /// Specifies the iterative execution of a unit of task code. /// - [] - type TaskBuilderBase = - - /// - /// Specifies the sequential composition of two units of task code. - /// - member inline Combine: task1: TaskCode<'TOverall, unit> * task2: TaskCode<'TOverall, 'T> -> TaskCode<'TOverall, 'T> - - /// - /// Specifies the delayed execution of a unit of task code. - /// - member inline Delay: generator: (unit -> TaskCode<'TOverall, 'T>) -> TaskCode<'TOverall, 'T> - - /// - /// Specifies the iterative execution of a unit of task code. - /// - member inline For: sequence: seq<'T> * body: ('T -> TaskCode<'TOverall, unit>) -> TaskCode<'TOverall, unit> - - /// - /// Specifies a unit of task code which returns a value - /// - member inline Return: value: 'T -> TaskCode<'T, 'T> - - /// - /// Specifies a unit of task code which excuted using try/finally semantics - /// - member inline TryFinally: body: TaskCode<'TOverall, 'T> * [] compensation: (unit -> unit) -> TaskCode<'TOverall, 'T> - - /// - /// Specifies a unit of task code which excuted using try/with semantics - /// - member inline TryWith: body: TaskCode<'TOverall, 'T> * catch: (exn -> TaskCode<'TOverall, 'T>) -> TaskCode<'TOverall, 'T> - - #if NETSTANDARD2_1 - /// - /// Specifies a unit of task code which binds to the resource implementing IAsyncDisposable and disposes it asynchronously - /// - member inline Using<'Resource, 'TOverall, 'T when 'Resource :> IAsyncDisposable> : resource: 'Resource * body: ('Resource -> TaskCode<'TOverall, 'T>) -> TaskCode<'TOverall, 'T> - #endif - - /// - /// Specifies the iterative execution of a unit of task code. - /// - member inline While: condition: (unit -> bool) * body: TaskCode<'TOverall, unit> -> TaskCode<'TOverall, unit> - - /// - /// Specifies a unit of task code which produces no result - /// - [] - member inline Zero: unit -> TaskCode<'TOverall, unit> + member inline For: sequence: seq<'T> * body: ('T -> TaskCode<'TOverall, unit>) -> TaskCode<'TOverall, unit> /// - /// Contains methods to build tasks using the F# computation expression syntax + /// Specifies a unit of task code which returns a value /// - [] - type TaskBuilder = - inherit TaskBuilderBase - - /// - /// The entry point for the dynamic implementation of the corresponding operation. Do not use directly, only used when executing quotations that involve tasks or other reflective execution of F# code. - /// - static member RunDynamic: code: TaskCode<'T, 'T> -> Task<'T> - - /// Hosts the task code in a state machine and starts the task. - member inline Run: code: TaskCode<'T, 'T> -> Task<'T> + member inline Return: value: 'T -> TaskCode<'T, 'T> /// - /// Contains methods to build tasks using the F# computation expression syntax + /// Specifies a unit of task code which excuted using try/finally semantics /// - [] - type BackgroundTaskBuilder = - inherit TaskBuilderBase + member inline TryFinally: + body: TaskCode<'TOverall, 'T> * [] compensation: (unit -> unit) -> TaskCode<'TOverall, 'T> - /// - /// The entry point for the dynamic implementation of the corresponding operation. Do not use directly, only used when executing quotations that involve tasks or other reflective execution of F# code. - /// - static member RunDynamic: code: TaskCode<'T, 'T> -> Task<'T> + /// + /// Specifies a unit of task code which excuted using try/with semantics + /// + member inline TryWith: + body: TaskCode<'TOverall, 'T> * catch: (exn -> TaskCode<'TOverall, 'T>) -> TaskCode<'TOverall, 'T> - /// - /// Hosts the task code in a state machine and starts the task, executing in the threadpool using Task.Run - /// - member inline Run: code: TaskCode<'T, 'T> -> Task<'T> +#if NETSTANDARD2_1 + /// + /// Specifies a unit of task code which binds to the resource implementing IAsyncDisposable and disposes it asynchronously + /// + member inline Using<'Resource, 'TOverall, 'T when 'Resource :> IAsyncDisposable> : + resource: 'Resource * body: ('Resource -> TaskCode<'TOverall, 'T>) -> TaskCode<'TOverall, 'T> +#endif - /// Contains the `task` computation expression builder. - [] - module TaskBuilder = + /// + /// Specifies the iterative execution of a unit of task code. + /// + member inline While: condition: (unit -> bool) * body: TaskCode<'TOverall, unit> -> TaskCode<'TOverall, unit> - /// - /// Builds a task using computation expression syntax. - /// - /// - /// - val task: TaskBuilder + /// + /// Specifies a unit of task code which produces no result + /// + [] + member inline Zero: unit -> TaskCode<'TOverall, unit> - /// - /// Builds a task using computation expression syntax which switches to execute on a background thread if not - /// already doing so. - /// - /// - /// - /// If the task is created on a foreground thread (where is non-null) - /// its body is executed on a background thread using . - /// If created on a background thread (where is null) it is executed immeidately - /// immediately on that thread. - /// - /// - /// - val backgroundTask: BackgroundTaskBuilder - +/// +/// Contains methods to build tasks using the F# computation expression syntax +/// +[] +type TaskBuilder = + inherit TaskBuilderBase + + /// + /// The entry point for the dynamic implementation of the corresponding operation. Do not use directly, only used when executing quotations that involve tasks or other reflective execution of F# code. + /// + static member RunDynamic: code: TaskCode<'T, 'T> -> Task<'T> + + /// Hosts the task code in a state machine and starts the task. + member inline Run: code: TaskCode<'T, 'T> -> Task<'T> + +/// +/// Contains methods to build tasks using the F# computation expression syntax +/// +[] +type BackgroundTaskBuilder = + inherit TaskBuilderBase + + /// + /// The entry point for the dynamic implementation of the corresponding operation. Do not use directly, only used when executing quotations that involve tasks or other reflective execution of F# code. + /// + static member RunDynamic: code: TaskCode<'T, 'T> -> Task<'T> + + /// + /// Hosts the task code in a state machine and starts the task, executing in the threadpool using Task.Run + /// + member inline Run: code: TaskCode<'T, 'T> -> Task<'T> + +/// Contains the `task` computation expression builder. +[] +module TaskBuilder = + + /// + /// Builds a task using computation expression syntax. + /// + /// + /// + val task: TaskBuilder + + /// + /// Builds a task using computation expression syntax which switches to execute on a background thread if not + /// already doing so. + /// + /// + /// + /// If the task is created on a foreground thread (where is non-null) + /// its body is executed on a background thread using . + /// If created on a background thread (where is null) it is executed immeidately + /// immediately on that thread. + /// + /// + /// + val backgroundTask: BackgroundTaskBuilder // Contains the `task` computation expression builder. -namespace Microsoft.FSharp.Control.TaskBuilderExtensions +namespace Microsoft.FSharp.Control.TaskBuilderExtensions - open System - open System.Runtime.CompilerServices - open System.Threading.Tasks - open Microsoft.FSharp.Core - open Microsoft.FSharp.Control - open Microsoft.FSharp.Core.CompilerServices +open System +open System.Runtime.CompilerServices +open System.Threading.Tasks +open Microsoft.FSharp.Core +open Microsoft.FSharp.Control +open Microsoft.FSharp.Core.CompilerServices - /// - /// Contains low-priority overloads for the `task` computation expression builder. - /// - // - // Note: they are low priority because they are auto-opened first, and F# has a rule - // that extension method opened later in sequence get higher priority - // - // AutoOpen is by assembly attribute to get sequencing of AutoOpen correct and - // so each gives different priority - module LowPriority = +/// +/// Contains low-priority overloads for the `task` computation expression builder. +/// +// +// Note: they are low priority because they are auto-opened first, and F# has a rule +// that extension method opened later in sequence get higher priority +// +// AutoOpen is by assembly attribute to get sequencing of AutoOpen correct and +// so each gives different priority +module LowPriority = - type TaskBuilderBase with - /// - /// Specifies a unit of task code which draws a result from a task-like value - /// satisfying the GetAwaiter pattern and calls a continuation. - /// - [] - member inline Bind< ^TaskLike, 'TResult1, 'TResult2, ^Awaiter, 'TOverall > : - task: ^TaskLike * - continuation: ( 'TResult1 -> TaskCode<'TOverall, 'TResult2>) - -> TaskCode<'TOverall, 'TResult2> - when ^TaskLike: (member GetAwaiter: unit -> ^Awaiter) - and ^Awaiter :> ICriticalNotifyCompletion - and ^Awaiter: (member get_IsCompleted: unit -> bool) - and ^Awaiter: (member GetResult: unit -> 'TResult1) + type TaskBuilderBase with - /// - /// Specifies a unit of task code which draws its result from a task-like value - /// satisfying the GetAwaiter pattern. - /// - [] - member inline ReturnFrom< ^TaskLike, ^Awaiter, 'T> : - task: ^TaskLike - -> TaskCode< 'T, 'T > - when ^TaskLike: (member GetAwaiter: unit -> ^Awaiter) - and ^Awaiter :> ICriticalNotifyCompletion - and ^Awaiter: (member get_IsCompleted: unit -> bool) - and ^Awaiter: (member GetResult: unit -> 'T) + /// + /// Specifies a unit of task code which draws a result from a task-like value + /// satisfying the GetAwaiter pattern and calls a continuation. + /// + [] + member inline Bind< ^TaskLike, 'TResult1, 'TResult2, ^Awaiter, 'TOverall> : + task: ^TaskLike * continuation: ('TResult1 -> TaskCode<'TOverall, 'TResult2>) -> + TaskCode<'TOverall, 'TResult2> + when ^TaskLike: (member GetAwaiter: unit -> ^Awaiter) + and ^Awaiter :> ICriticalNotifyCompletion + and ^Awaiter: (member get_IsCompleted: unit -> bool) + and ^Awaiter: (member GetResult: unit -> 'TResult1) - /// - /// The entry point for the dynamic implementation of the corresponding operation. Do not use directly, only used when executing quotations that involve tasks or other reflective execution of F# code. - /// - [] - static member inline BindDynamic< ^TaskLike, 'TResult1, 'TResult2, ^Awaiter, 'TOverall > : - sm: byref> * - task: ^TaskLike * - continuation: ( 'TResult1 -> TaskCode<'TOverall, 'TResult2>) - -> bool - when ^TaskLike: (member GetAwaiter: unit -> ^Awaiter) - and ^Awaiter :> ICriticalNotifyCompletion - and ^Awaiter: (member get_IsCompleted: unit -> bool) - and ^Awaiter: (member GetResult: unit -> 'TResult1) + /// + /// Specifies a unit of task code which draws its result from a task-like value + /// satisfying the GetAwaiter pattern. + /// + [] + member inline ReturnFrom< ^TaskLike, ^Awaiter, 'T> : + task: ^TaskLike -> TaskCode<'T, 'T> + when ^TaskLike: (member GetAwaiter: unit -> ^Awaiter) + and ^Awaiter :> ICriticalNotifyCompletion + and ^Awaiter: (member get_IsCompleted: unit -> bool) + and ^Awaiter: (member GetResult: unit -> 'T) - /// - /// Specifies a unit of task code which binds to the resource implementing IDisposable and disposes it synchronously - /// - member inline Using: - resource: 'Resource * - body: ('Resource -> TaskCode<'TOverall, 'T>) - -> TaskCode<'TOverall, 'T> when 'Resource :> IDisposable + /// + /// The entry point for the dynamic implementation of the corresponding operation. Do not use directly, only used when executing quotations that involve tasks or other reflective execution of F# code. + /// + [] + static member inline BindDynamic< ^TaskLike, 'TResult1, 'TResult2, ^Awaiter, 'TOverall> : + sm: byref> * + task: ^TaskLike * + continuation: ('TResult1 -> TaskCode<'TOverall, 'TResult2>) -> + bool + when ^TaskLike: (member GetAwaiter: unit -> ^Awaiter) + and ^Awaiter :> ICriticalNotifyCompletion + and ^Awaiter: (member get_IsCompleted: unit -> bool) + and ^Awaiter: (member GetResult: unit -> 'TResult1) - /// - /// Contains medium-priority overloads for the `task` computation expression builder. - /// - module MediumPriority = + /// + /// Specifies a unit of task code which binds to the resource implementing IDisposable and disposes it synchronously + /// + member inline Using: + resource: 'Resource * body: ('Resource -> TaskCode<'TOverall, 'T>) -> TaskCode<'TOverall, 'T> + when 'Resource :> IDisposable - type TaskBuilderBase with +/// +/// Contains medium-priority overloads for the `task` computation expression builder. +/// +module MediumPriority = - /// - /// Specifies a unit of task code which draws a result from an F# async value then calls a continuation. - /// - member inline Bind: - computation: Async<'TResult1> * - continuation: ('TResult1 -> TaskCode<'TOverall, 'TResult2>) - -> TaskCode<'TOverall, 'TResult2> + type TaskBuilderBase with - /// - /// Specifies a unit of task code which draws a result from an F# async value. - /// - member inline ReturnFrom: - computation: Async<'T> - -> TaskCode<'T, 'T> + /// + /// Specifies a unit of task code which draws a result from an F# async value then calls a continuation. + /// + member inline Bind: + computation: Async<'TResult1> * continuation: ('TResult1 -> TaskCode<'TOverall, 'TResult2>) -> + TaskCode<'TOverall, 'TResult2> - /// - /// Contains high-priority overloads for the `task` computation expression builder. - /// - module HighPriority = + /// + /// Specifies a unit of task code which draws a result from an F# async value. + /// + member inline ReturnFrom: computation: Async<'T> -> TaskCode<'T, 'T> - type TaskBuilderBase with - /// - /// Specifies a unit of task code which draws a result from a task then calls a continuation. - /// - member inline Bind: - task: Task<'TResult1> * - continuation: ('TResult1 -> TaskCode<'TOverall, 'TResult2>) - -> TaskCode<'TOverall, 'TResult2> +/// +/// Contains high-priority overloads for the `task` computation expression builder. +/// +module HighPriority = - /// - /// Specifies a unit of task code which draws a result from a task. - /// - member inline ReturnFrom: - task: Task<'T> - -> TaskCode<'T, 'T> + type TaskBuilderBase with - /// - /// The entry point for the dynamic implementation of the corresponding operation. Do not use directly, only used when executing quotations that involve tasks or other reflective execution of F# code. - /// - static member BindDynamic: - sm: byref> * - task: Task<'TResult1> * - continuation: ('TResult1 -> TaskCode<'TOverall, 'TResult2>) - -> bool + /// + /// Specifies a unit of task code which draws a result from a task then calls a continuation. + /// + member inline Bind: + task: Task<'TResult1> * continuation: ('TResult1 -> TaskCode<'TOverall, 'TResult2>) -> + TaskCode<'TOverall, 'TResult2> + + /// + /// Specifies a unit of task code which draws a result from a task. + /// + member inline ReturnFrom: task: Task<'T> -> TaskCode<'T, 'T> + + /// + /// The entry point for the dynamic implementation of the corresponding operation. Do not use directly, only used when executing quotations that involve tasks or other reflective execution of F# code. + /// + static member BindDynamic: + sm: byref> * + task: Task<'TResult1> * + continuation: ('TResult1 -> TaskCode<'TOverall, 'TResult2>) -> + bool diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare06.fsx.il.net472.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare06.fsx.il.net472.bsl new file mode 100644 index 0000000000..2c11296dbe --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare06.fsx.il.net472.bsl @@ -0,0 +1,649 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly assembly +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32, + int32, + int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 ) + + + + + .hash algorithm 0x00008004 + .ver 0:0:0:0 +} +.mresource public FSharpSignatureData.assembly +{ + + +} +.mresource public FSharpOptimizationData.assembly +{ + + +} +.module assembly.exe + +.imagebase {value} +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 +.corflags 0x00000001 + + + + + +.class public abstract auto ansi sealed assembly + extends [runtime]System.Object +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .class abstract auto ansi sealed nested public CompareMicroPerfAndCodeGenerationTests + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .class auto ansi serializable sealed nested public KeyR + extends [runtime]System.Object + implements class [runtime]System.IEquatable`1, + [runtime]System.Collections.IStructuralEquatable, + class [runtime]System.IComparable`1, + [runtime]System.IComparable, + [runtime]System.Collections.IStructuralComparable + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 02 00 00 00 00 00 ) + .field assembly int32 key1@ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .field assembly int32 key2@ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .method public hidebysig specialname + instance int32 get_key1() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_0006: ret + } + + .method public hidebysig specialname + instance int32 get_key2() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_0006: ret + } + + .method public specialname rtspecialname + instance void .ctor(int32 key1, + int32 key2) cil managed + { + .custom instance void System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::.ctor(valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes, + class [runtime]System.Type) = ( 01 00 60 06 00 00 35 43 6F 6D 70 61 72 65 30 36 + 2B 43 6F 6D 70 61 72 65 4D 69 63 72 6F 50 65 72 + 66 41 6E 64 43 6F 64 65 47 65 6E 65 72 61 74 69 + 6F 6E 54 65 73 74 73 2B 4B 65 79 52 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void [runtime]System.Object::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_000d: ldarg.0 + IL_000e: ldarg.2 + IL_000f: stfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_0014: ret + } + + .method public strict virtual instance string + ToString() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldstr "%+A" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,class assembly/CompareMicroPerfAndCodeGenerationTests/KeyR>::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_000f: ldarg.0 + IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0015: ret + } + + .method public hidebysig virtual final + instance int32 CompareTo(class assembly/CompareMicroPerfAndCodeGenerationTests/KeyR obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 5 + .locals init (int32 V_0, + class [runtime]System.Collections.IComparer V_1, + int32 V_2, + int32 V_3) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0050 + + IL_0003: ldarg.1 + IL_0004: brfalse.s IL_004e + + IL_0006: call class [runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() + IL_000b: stloc.1 + IL_000c: ldarg.0 + IL_000d: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_0012: stloc.2 + IL_0013: ldarg.1 + IL_0014: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_0019: stloc.3 + IL_001a: ldloc.2 + IL_001b: ldloc.3 + IL_001c: cgt + IL_001e: ldloc.2 + IL_001f: ldloc.3 + IL_0020: clt + IL_0022: sub + IL_0023: stloc.0 + IL_0024: ldloc.0 + IL_0025: ldc.i4.0 + IL_0026: bge.s IL_002a + + IL_0028: ldloc.0 + IL_0029: ret + + IL_002a: ldloc.0 + IL_002b: ldc.i4.0 + IL_002c: ble.s IL_0030 + + IL_002e: ldloc.0 + IL_002f: ret + + IL_0030: call class [runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() + IL_0035: stloc.1 + IL_0036: ldarg.0 + IL_0037: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_003c: stloc.2 + IL_003d: ldarg.1 + IL_003e: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_0043: stloc.3 + IL_0044: ldloc.2 + IL_0045: ldloc.3 + IL_0046: cgt + IL_0048: ldloc.2 + IL_0049: ldloc.3 + IL_004a: clt + IL_004c: sub + IL_004d: ret + + IL_004e: ldc.i4.1 + IL_004f: ret + + IL_0050: ldarg.1 + IL_0051: brfalse.s IL_0055 + + IL_0053: ldc.i4.m1 + IL_0054: ret + + IL_0055: ldc.i4.0 + IL_0056: ret + } + + .method public hidebysig virtual final + instance int32 CompareTo(object obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: unbox.any assembly/CompareMicroPerfAndCodeGenerationTests/KeyR + IL_0007: callvirt instance int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::CompareTo(class assembly/CompareMicroPerfAndCodeGenerationTests/KeyR) + IL_000c: ret + } + + .method public hidebysig virtual final + instance int32 CompareTo(object obj, + class [runtime]System.Collections.IComparer comp) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 5 + .locals init (class assembly/CompareMicroPerfAndCodeGenerationTests/KeyR V_0, + int32 V_1, + int32 V_2, + int32 V_3) + IL_0000: ldarg.1 + IL_0001: unbox.any assembly/CompareMicroPerfAndCodeGenerationTests/KeyR + IL_0006: stloc.0 + IL_0007: ldarg.0 + IL_0008: brfalse.s IL_0050 + + IL_000a: ldarg.1 + IL_000b: unbox.any assembly/CompareMicroPerfAndCodeGenerationTests/KeyR + IL_0010: brfalse.s IL_004e + + IL_0012: ldarg.0 + IL_0013: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_0018: stloc.2 + IL_0019: ldloc.0 + IL_001a: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_001f: stloc.3 + IL_0020: ldloc.2 + IL_0021: ldloc.3 + IL_0022: cgt + IL_0024: ldloc.2 + IL_0025: ldloc.3 + IL_0026: clt + IL_0028: sub + IL_0029: stloc.1 + IL_002a: ldloc.1 + IL_002b: ldc.i4.0 + IL_002c: bge.s IL_0030 + + IL_002e: ldloc.1 + IL_002f: ret + + IL_0030: ldloc.1 + IL_0031: ldc.i4.0 + IL_0032: ble.s IL_0036 + + IL_0034: ldloc.1 + IL_0035: ret + + IL_0036: ldarg.0 + IL_0037: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_003c: stloc.2 + IL_003d: ldloc.0 + IL_003e: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_0043: stloc.3 + IL_0044: ldloc.2 + IL_0045: ldloc.3 + IL_0046: cgt + IL_0048: ldloc.2 + IL_0049: ldloc.3 + IL_004a: clt + IL_004c: sub + IL_004d: ret + + IL_004e: ldc.i4.1 + IL_004f: ret + + IL_0050: ldarg.1 + IL_0051: unbox.any assembly/CompareMicroPerfAndCodeGenerationTests/KeyR + IL_0056: brfalse.s IL_005a + + IL_0058: ldc.i4.m1 + IL_0059: ret + + IL_005a: ldc.i4.0 + IL_005b: ret + } + + .method public hidebysig virtual final + instance int32 GetHashCode(class [runtime]System.Collections.IEqualityComparer comp) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 7 + .locals init (int32 V_0) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0031 + + IL_0003: ldc.i4.0 + IL_0004: stloc.0 + IL_0005: ldc.i4 0x9e3779b9 + IL_000a: ldarg.0 + IL_000b: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_0010: ldloc.0 + IL_0011: ldc.i4.6 + IL_0012: shl + IL_0013: ldloc.0 + IL_0014: ldc.i4.2 + IL_0015: shr + IL_0016: add + IL_0017: add + IL_0018: add + IL_0019: stloc.0 + IL_001a: ldc.i4 0x9e3779b9 + IL_001f: ldarg.0 + IL_0020: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_0025: ldloc.0 + IL_0026: ldc.i4.6 + IL_0027: shl + IL_0028: ldloc.0 + IL_0029: ldc.i4.2 + IL_002a: shr + IL_002b: add + IL_002c: add + IL_002d: add + IL_002e: stloc.0 + IL_002f: ldloc.0 + IL_0030: ret + + IL_0031: ldc.i4.0 + IL_0032: ret + } + + .method public hidebysig virtual final + instance int32 GetHashCode() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call class [runtime]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer() + IL_0006: callvirt instance int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::GetHashCode(class [runtime]System.Collections.IEqualityComparer) + IL_000b: ret + } + + .method public hidebysig virtual final + instance bool Equals(object obj, + class [runtime]System.Collections.IEqualityComparer comp) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 4 + .locals init (class assembly/CompareMicroPerfAndCodeGenerationTests/KeyR V_0) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_002e + + IL_0003: ldarg.1 + IL_0004: isinst assembly/CompareMicroPerfAndCodeGenerationTests/KeyR + IL_0009: stloc.0 + IL_000a: ldloc.0 + IL_000b: brfalse.s IL_002c + + IL_000d: ldarg.0 + IL_000e: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_0013: ldloc.0 + IL_0014: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_0019: bne.un.s IL_002a + + IL_001b: ldarg.0 + IL_001c: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_0021: ldloc.0 + IL_0022: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_0027: ceq + IL_0029: ret + + IL_002a: ldc.i4.0 + IL_002b: ret + + IL_002c: ldc.i4.0 + IL_002d: ret + + IL_002e: ldarg.1 + IL_002f: ldnull + IL_0030: cgt.un + IL_0032: ldc.i4.0 + IL_0033: ceq + IL_0035: ret + } + + .method public hidebysig virtual final + instance bool Equals(class assembly/CompareMicroPerfAndCodeGenerationTests/KeyR obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0027 + + IL_0003: ldarg.1 + IL_0004: brfalse.s IL_0025 + + IL_0006: ldarg.0 + IL_0007: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_000c: ldarg.1 + IL_000d: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_0012: bne.un.s IL_0023 + + IL_0014: ldarg.0 + IL_0015: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_001a: ldarg.1 + IL_001b: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_0020: ceq + IL_0022: ret + + IL_0023: ldc.i4.0 + IL_0024: ret + + IL_0025: ldc.i4.0 + IL_0026: ret + + IL_0027: ldarg.1 + IL_0028: ldnull + IL_0029: cgt.un + IL_002b: ldc.i4.0 + IL_002c: ceq + IL_002e: ret + } + + .method public hidebysig virtual final + instance bool Equals(object obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 4 + .locals init (class assembly/CompareMicroPerfAndCodeGenerationTests/KeyR V_0) + IL_0000: ldarg.1 + IL_0001: isinst assembly/CompareMicroPerfAndCodeGenerationTests/KeyR + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: brfalse.s IL_0012 + + IL_000a: ldarg.0 + IL_000b: ldloc.0 + IL_000c: callvirt instance bool assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::Equals(class assembly/CompareMicroPerfAndCodeGenerationTests/KeyR) + IL_0011: ret + + IL_0012: ldc.i4.0 + IL_0013: ret + } + + .property instance int32 key1() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32) = ( 01 00 04 00 00 00 00 00 00 00 00 00 ) + .get instance int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::get_key1() + } + .property instance int32 key2() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32) = ( 01 00 04 00 00 00 01 00 00 00 00 00 ) + .get instance int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::get_key2() + } + } + + .method public static void f5c() cil managed + { + + .maxstack 4 + .locals init (int32 V_0, + class assembly/CompareMicroPerfAndCodeGenerationTests/KeyR V_1, + class assembly/CompareMicroPerfAndCodeGenerationTests/KeyR V_2, + int32 V_3) + IL_0000: ldc.i4.1 + IL_0001: stloc.0 + IL_0002: ldc.i4.1 + IL_0003: ldc.i4.2 + IL_0004: newobj instance void assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::.ctor(int32, + int32) + IL_0009: stloc.1 + IL_000a: ldc.i4.1 + IL_000b: ldc.i4.3 + IL_000c: newobj instance void assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::.ctor(int32, + int32) + IL_0011: stloc.2 + IL_0012: ldc.i4.0 + IL_0013: stloc.3 + IL_0014: br.s IL_0022 + + IL_0016: ldloc.1 + IL_0017: ldloc.2 + IL_0018: callvirt instance int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::CompareTo(class assembly/CompareMicroPerfAndCodeGenerationTests/KeyR) + IL_001d: stloc.0 + IL_001e: ldloc.3 + IL_001f: ldc.i4.1 + IL_0020: add + IL_0021: stloc.3 + IL_0022: ldloc.3 + IL_0023: ldc.i4 0x989681 + IL_0028: blt.s IL_0016 + + IL_002a: ret + } + + } + +} + +.class private abstract auto ansi sealed ''.$assembly$fsx + extends [runtime]System.Object +{ + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: ret + } + +} + +.class private auto ansi sealed System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes + extends [runtime]System.Enum +{ + .custom instance void [runtime]System.FlagsAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .field public specialname rtspecialname int32 value__ = int32(0x00000000) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes All = int32(0xFFFFFFFF) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes None = int32(0x00000000) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicParameterlessConstructor = int32(0x00000001) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicConstructors = int32(0x00000003) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicConstructors = int32(0x00000004) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicMethods = int32(0x00000008) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicMethods = int32(0x00000010) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicFields = int32(0x00000020) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicFields = int32(0x00000040) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicNestedTypes = int32(0x00000080) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicNestedTypes = int32(0x00000100) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicProperties = int32(0x00000200) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicProperties = int32(0x00000400) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicEvents = int32(0x00000800) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicEvents = int32(0x00001000) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes Interfaces = int32(0x00002000) +} + +.class private auto ansi beforefieldinit System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute + extends [runtime]System.Attribute +{ + .field private valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes MemberType@ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .field private class [runtime]System.Type Type@ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method public specialname rtspecialname + instance void .ctor(valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes MemberType, + class [runtime]System.Type Type) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void [runtime]System.Attribute::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::MemberType@ + IL_000d: ldarg.0 + IL_000e: ldarg.2 + IL_000f: stfld class [runtime]System.Type System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::Type@ + IL_0014: ret + } + + .method public hidebysig specialname instance class [runtime]System.Type + get_Type() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld class [runtime]System.Type System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::Type@ + IL_0006: ret + } + + .method private hidebysig specialname instance void + set_Type(class [runtime]System.Type 'value') cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: stfld class [runtime]System.Type System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::Type@ + IL_0007: ret + } + + .method public hidebysig specialname instance valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes + get_MemberType() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::MemberType@ + IL_0006: ret + } + + .method private hidebysig specialname instance void + set_MemberType(valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes 'value') cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: stfld valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::MemberType@ + IL_0007: ret + } + + .property instance valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes + MemberType() + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .set instance void System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::set_MemberType(valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes) + .get instance valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::get_MemberType() + } + .property instance class [runtime]System.Type + Type() + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .set instance void System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::set_Type(class [runtime]System.Type) + .get instance class [runtime]System.Type System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::get_Type() + } +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare06.fsx.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare06.fsx.il.netcore.bsl similarity index 95% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare06.fsx.il.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare06.fsx.il.netcore.bsl index b5c57d4ef6..7a405133e0 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare06.fsx.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare06.fsx.il.netcore.bsl @@ -1,523 +1,528 @@ - - - - - -.assembly extern runtime { } -.assembly extern FSharp.Core { } -.assembly assembly -{ - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32, - int32, - int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 ) - - - - - .hash algorithm 0x00008004 - .ver 0:0:0:0 -} -.mresource public FSharpSignatureData.assembly -{ - - -} -.mresource public FSharpOptimizationData.assembly -{ - - -} -.module assembly.exe - -.imagebase {value} -.file alignment 0x00000200 -.stackreserve 0x00100000 -.subsystem 0x0003 -.corflags 0x00000001 - - - - - -.class public abstract auto ansi sealed assembly - extends [runtime]System.Object -{ - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) - .class abstract auto ansi sealed nested public CompareMicroPerfAndCodeGenerationTests - extends [runtime]System.Object - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) - .class auto ansi serializable sealed nested public KeyR - extends [runtime]System.Object - implements class [runtime]System.IEquatable`1, - [runtime]System.Collections.IStructuralEquatable, - class [runtime]System.IComparable`1, - [runtime]System.IComparable, - [runtime]System.Collections.IStructuralComparable - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 02 00 00 00 00 00 ) - .field assembly int32 key1@ - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) - .field assembly int32 key2@ - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) - .method public hidebysig specialname - instance int32 get_key1() cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key1@ - IL_0006: ret - } - - .method public hidebysig specialname - instance int32 get_key2() cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key2@ - IL_0006: ret - } - - .method public specialname rtspecialname - instance void .ctor(int32 key1, - int32 key2) cil managed - { - - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: call instance void [runtime]System.Object::.ctor() - IL_0006: ldarg.0 - IL_0007: ldarg.1 - IL_0008: stfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key1@ - IL_000d: ldarg.0 - IL_000e: ldarg.2 - IL_000f: stfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key2@ - IL_0014: ret - } - - .method public strict virtual instance string - ToString() cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 8 - IL_0000: ldstr "%+A" - IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,class assembly/CompareMicroPerfAndCodeGenerationTests/KeyR>::.ctor(string) - IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) - IL_000f: ldarg.0 - IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) - IL_0015: ret - } - - .method public hidebysig virtual final - instance int32 CompareTo(class assembly/CompareMicroPerfAndCodeGenerationTests/KeyR obj) cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 5 - .locals init (int32 V_0, - class [runtime]System.Collections.IComparer V_1, - int32 V_2, - int32 V_3) - IL_0000: ldarg.0 - IL_0001: brfalse.s IL_0050 - - IL_0003: ldarg.1 - IL_0004: brfalse.s IL_004e - - IL_0006: call class [runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() - IL_000b: stloc.1 - IL_000c: ldarg.0 - IL_000d: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key1@ - IL_0012: stloc.2 - IL_0013: ldarg.1 - IL_0014: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key1@ - IL_0019: stloc.3 - IL_001a: ldloc.2 - IL_001b: ldloc.3 - IL_001c: cgt - IL_001e: ldloc.2 - IL_001f: ldloc.3 - IL_0020: clt - IL_0022: sub - IL_0023: stloc.0 - IL_0024: ldloc.0 - IL_0025: ldc.i4.0 - IL_0026: bge.s IL_002a - - IL_0028: ldloc.0 - IL_0029: ret - - IL_002a: ldloc.0 - IL_002b: ldc.i4.0 - IL_002c: ble.s IL_0030 - - IL_002e: ldloc.0 - IL_002f: ret - - IL_0030: call class [runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() - IL_0035: stloc.1 - IL_0036: ldarg.0 - IL_0037: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key2@ - IL_003c: stloc.2 - IL_003d: ldarg.1 - IL_003e: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key2@ - IL_0043: stloc.3 - IL_0044: ldloc.2 - IL_0045: ldloc.3 - IL_0046: cgt - IL_0048: ldloc.2 - IL_0049: ldloc.3 - IL_004a: clt - IL_004c: sub - IL_004d: ret - - IL_004e: ldc.i4.1 - IL_004f: ret - - IL_0050: ldarg.1 - IL_0051: brfalse.s IL_0055 - - IL_0053: ldc.i4.m1 - IL_0054: ret - - IL_0055: ldc.i4.0 - IL_0056: ret - } - - .method public hidebysig virtual final - instance int32 CompareTo(object obj) cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: ldarg.1 - IL_0002: unbox.any assembly/CompareMicroPerfAndCodeGenerationTests/KeyR - IL_0007: callvirt instance int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::CompareTo(class assembly/CompareMicroPerfAndCodeGenerationTests/KeyR) - IL_000c: ret - } - - .method public hidebysig virtual final - instance int32 CompareTo(object obj, - class [runtime]System.Collections.IComparer comp) cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 5 - .locals init (class assembly/CompareMicroPerfAndCodeGenerationTests/KeyR V_0, - int32 V_1, - int32 V_2, - int32 V_3) - IL_0000: ldarg.1 - IL_0001: unbox.any assembly/CompareMicroPerfAndCodeGenerationTests/KeyR - IL_0006: stloc.0 - IL_0007: ldarg.0 - IL_0008: brfalse.s IL_0050 - - IL_000a: ldarg.1 - IL_000b: unbox.any assembly/CompareMicroPerfAndCodeGenerationTests/KeyR - IL_0010: brfalse.s IL_004e - - IL_0012: ldarg.0 - IL_0013: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key1@ - IL_0018: stloc.2 - IL_0019: ldloc.0 - IL_001a: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key1@ - IL_001f: stloc.3 - IL_0020: ldloc.2 - IL_0021: ldloc.3 - IL_0022: cgt - IL_0024: ldloc.2 - IL_0025: ldloc.3 - IL_0026: clt - IL_0028: sub - IL_0029: stloc.1 - IL_002a: ldloc.1 - IL_002b: ldc.i4.0 - IL_002c: bge.s IL_0030 - - IL_002e: ldloc.1 - IL_002f: ret - - IL_0030: ldloc.1 - IL_0031: ldc.i4.0 - IL_0032: ble.s IL_0036 - - IL_0034: ldloc.1 - IL_0035: ret - - IL_0036: ldarg.0 - IL_0037: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key2@ - IL_003c: stloc.2 - IL_003d: ldloc.0 - IL_003e: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key2@ - IL_0043: stloc.3 - IL_0044: ldloc.2 - IL_0045: ldloc.3 - IL_0046: cgt - IL_0048: ldloc.2 - IL_0049: ldloc.3 - IL_004a: clt - IL_004c: sub - IL_004d: ret - - IL_004e: ldc.i4.1 - IL_004f: ret - - IL_0050: ldarg.1 - IL_0051: unbox.any assembly/CompareMicroPerfAndCodeGenerationTests/KeyR - IL_0056: brfalse.s IL_005a - - IL_0058: ldc.i4.m1 - IL_0059: ret - - IL_005a: ldc.i4.0 - IL_005b: ret - } - - .method public hidebysig virtual final - instance int32 GetHashCode(class [runtime]System.Collections.IEqualityComparer comp) cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 7 - .locals init (int32 V_0) - IL_0000: ldarg.0 - IL_0001: brfalse.s IL_0031 - - IL_0003: ldc.i4.0 - IL_0004: stloc.0 - IL_0005: ldc.i4 0x9e3779b9 - IL_000a: ldarg.0 - IL_000b: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key2@ - IL_0010: ldloc.0 - IL_0011: ldc.i4.6 - IL_0012: shl - IL_0013: ldloc.0 - IL_0014: ldc.i4.2 - IL_0015: shr - IL_0016: add - IL_0017: add - IL_0018: add - IL_0019: stloc.0 - IL_001a: ldc.i4 0x9e3779b9 - IL_001f: ldarg.0 - IL_0020: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key1@ - IL_0025: ldloc.0 - IL_0026: ldc.i4.6 - IL_0027: shl - IL_0028: ldloc.0 - IL_0029: ldc.i4.2 - IL_002a: shr - IL_002b: add - IL_002c: add - IL_002d: add - IL_002e: stloc.0 - IL_002f: ldloc.0 - IL_0030: ret - - IL_0031: ldc.i4.0 - IL_0032: ret - } - - .method public hidebysig virtual final - instance int32 GetHashCode() cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: call class [runtime]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer() - IL_0006: callvirt instance int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::GetHashCode(class [runtime]System.Collections.IEqualityComparer) - IL_000b: ret - } - - .method public hidebysig virtual final - instance bool Equals(object obj, - class [runtime]System.Collections.IEqualityComparer comp) cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 4 - .locals init (class assembly/CompareMicroPerfAndCodeGenerationTests/KeyR V_0) - IL_0000: ldarg.0 - IL_0001: brfalse.s IL_002e - - IL_0003: ldarg.1 - IL_0004: isinst assembly/CompareMicroPerfAndCodeGenerationTests/KeyR - IL_0009: stloc.0 - IL_000a: ldloc.0 - IL_000b: brfalse.s IL_002c - - IL_000d: ldarg.0 - IL_000e: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key1@ - IL_0013: ldloc.0 - IL_0014: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key1@ - IL_0019: bne.un.s IL_002a - - IL_001b: ldarg.0 - IL_001c: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key2@ - IL_0021: ldloc.0 - IL_0022: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key2@ - IL_0027: ceq - IL_0029: ret - - IL_002a: ldc.i4.0 - IL_002b: ret - - IL_002c: ldc.i4.0 - IL_002d: ret - - IL_002e: ldarg.1 - IL_002f: ldnull - IL_0030: cgt.un - IL_0032: ldc.i4.0 - IL_0033: ceq - IL_0035: ret - } - - .method public hidebysig virtual final - instance bool Equals(class assembly/CompareMicroPerfAndCodeGenerationTests/KeyR obj) cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: brfalse.s IL_0027 - - IL_0003: ldarg.1 - IL_0004: brfalse.s IL_0025 - - IL_0006: ldarg.0 - IL_0007: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key1@ - IL_000c: ldarg.1 - IL_000d: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key1@ - IL_0012: bne.un.s IL_0023 - - IL_0014: ldarg.0 - IL_0015: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key2@ - IL_001a: ldarg.1 - IL_001b: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key2@ - IL_0020: ceq - IL_0022: ret - - IL_0023: ldc.i4.0 - IL_0024: ret - - IL_0025: ldc.i4.0 - IL_0026: ret - - IL_0027: ldarg.1 - IL_0028: ldnull - IL_0029: cgt.un - IL_002b: ldc.i4.0 - IL_002c: ceq - IL_002e: ret - } - - .method public hidebysig virtual final - instance bool Equals(object obj) cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 4 - .locals init (class assembly/CompareMicroPerfAndCodeGenerationTests/KeyR V_0) - IL_0000: ldarg.1 - IL_0001: isinst assembly/CompareMicroPerfAndCodeGenerationTests/KeyR - IL_0006: stloc.0 - IL_0007: ldloc.0 - IL_0008: brfalse.s IL_0012 - - IL_000a: ldarg.0 - IL_000b: ldloc.0 - IL_000c: callvirt instance bool assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::Equals(class assembly/CompareMicroPerfAndCodeGenerationTests/KeyR) - IL_0011: ret - - IL_0012: ldc.i4.0 - IL_0013: ret - } - - .property instance int32 key1() - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, - int32) = ( 01 00 04 00 00 00 00 00 00 00 00 00 ) - .get instance int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::get_key1() - } - .property instance int32 key2() - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, - int32) = ( 01 00 04 00 00 00 01 00 00 00 00 00 ) - .get instance int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::get_key2() - } - } - - .method public static void f5c() cil managed - { - - .maxstack 4 - .locals init (int32 V_0, - class assembly/CompareMicroPerfAndCodeGenerationTests/KeyR V_1, - class assembly/CompareMicroPerfAndCodeGenerationTests/KeyR V_2, - int32 V_3) - IL_0000: ldc.i4.1 - IL_0001: stloc.0 - IL_0002: ldc.i4.1 - IL_0003: ldc.i4.2 - IL_0004: newobj instance void assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::.ctor(int32, - int32) - IL_0009: stloc.1 - IL_000a: ldc.i4.1 - IL_000b: ldc.i4.3 - IL_000c: newobj instance void assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::.ctor(int32, - int32) - IL_0011: stloc.2 - IL_0012: ldc.i4.0 - IL_0013: stloc.3 - IL_0014: br.s IL_0022 - - IL_0016: ldloc.1 - IL_0017: ldloc.2 - IL_0018: callvirt instance int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::CompareTo(class assembly/CompareMicroPerfAndCodeGenerationTests/KeyR) - IL_001d: stloc.0 - IL_001e: ldloc.3 - IL_001f: ldc.i4.1 - IL_0020: add - IL_0021: stloc.3 - IL_0022: ldloc.3 - IL_0023: ldc.i4 0x989681 - IL_0028: blt.s IL_0016 - - IL_002a: ret - } - - } - -} - -.class private abstract auto ansi sealed ''.$assembly$fsx - extends [runtime]System.Object -{ - .method public static void main@() cil managed - { - .entrypoint - - .maxstack 8 - IL_0000: ret - } - -} - - - - - - + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly assembly +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32, + int32, + int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 ) + + + + + .hash algorithm 0x00008004 + .ver 0:0:0:0 +} +.mresource public FSharpSignatureData.assembly +{ + + +} +.mresource public FSharpOptimizationData.assembly +{ + + +} +.module assembly.exe + +.imagebase {value} +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 +.corflags 0x00000001 + + + + + +.class public abstract auto ansi sealed assembly + extends [runtime]System.Object +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .class abstract auto ansi sealed nested public CompareMicroPerfAndCodeGenerationTests + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .class auto ansi serializable sealed nested public KeyR + extends [runtime]System.Object + implements class [runtime]System.IEquatable`1, + [runtime]System.Collections.IStructuralEquatable, + class [runtime]System.IComparable`1, + [runtime]System.IComparable, + [runtime]System.Collections.IStructuralComparable + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 02 00 00 00 00 00 ) + .field assembly int32 key1@ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .field assembly int32 key2@ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .method public hidebysig specialname + instance int32 get_key1() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_0006: ret + } + + .method public hidebysig specialname + instance int32 get_key2() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_0006: ret + } + + .method public specialname rtspecialname + instance void .ctor(int32 key1, + int32 key2) cil managed + { + .custom instance void [runtime]System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::.ctor(valuetype [runtime]System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes, + class [runtime]System.Type) = ( 01 00 60 06 00 00 35 43 6F 6D 70 61 72 65 30 36 + 2B 43 6F 6D 70 61 72 65 4D 69 63 72 6F 50 65 72 + 66 41 6E 64 43 6F 64 65 47 65 6E 65 72 61 74 69 + 6F 6E 54 65 73 74 73 2B 4B 65 79 52 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void [runtime]System.Object::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_000d: ldarg.0 + IL_000e: ldarg.2 + IL_000f: stfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_0014: ret + } + + .method public strict virtual instance string + ToString() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldstr "%+A" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,class assembly/CompareMicroPerfAndCodeGenerationTests/KeyR>::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_000f: ldarg.0 + IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0015: ret + } + + .method public hidebysig virtual final + instance int32 CompareTo(class assembly/CompareMicroPerfAndCodeGenerationTests/KeyR obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 5 + .locals init (int32 V_0, + class [runtime]System.Collections.IComparer V_1, + int32 V_2, + int32 V_3) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0050 + + IL_0003: ldarg.1 + IL_0004: brfalse.s IL_004e + + IL_0006: call class [runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() + IL_000b: stloc.1 + IL_000c: ldarg.0 + IL_000d: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_0012: stloc.2 + IL_0013: ldarg.1 + IL_0014: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_0019: stloc.3 + IL_001a: ldloc.2 + IL_001b: ldloc.3 + IL_001c: cgt + IL_001e: ldloc.2 + IL_001f: ldloc.3 + IL_0020: clt + IL_0022: sub + IL_0023: stloc.0 + IL_0024: ldloc.0 + IL_0025: ldc.i4.0 + IL_0026: bge.s IL_002a + + IL_0028: ldloc.0 + IL_0029: ret + + IL_002a: ldloc.0 + IL_002b: ldc.i4.0 + IL_002c: ble.s IL_0030 + + IL_002e: ldloc.0 + IL_002f: ret + + IL_0030: call class [runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() + IL_0035: stloc.1 + IL_0036: ldarg.0 + IL_0037: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_003c: stloc.2 + IL_003d: ldarg.1 + IL_003e: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_0043: stloc.3 + IL_0044: ldloc.2 + IL_0045: ldloc.3 + IL_0046: cgt + IL_0048: ldloc.2 + IL_0049: ldloc.3 + IL_004a: clt + IL_004c: sub + IL_004d: ret + + IL_004e: ldc.i4.1 + IL_004f: ret + + IL_0050: ldarg.1 + IL_0051: brfalse.s IL_0055 + + IL_0053: ldc.i4.m1 + IL_0054: ret + + IL_0055: ldc.i4.0 + IL_0056: ret + } + + .method public hidebysig virtual final + instance int32 CompareTo(object obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: unbox.any assembly/CompareMicroPerfAndCodeGenerationTests/KeyR + IL_0007: callvirt instance int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::CompareTo(class assembly/CompareMicroPerfAndCodeGenerationTests/KeyR) + IL_000c: ret + } + + .method public hidebysig virtual final + instance int32 CompareTo(object obj, + class [runtime]System.Collections.IComparer comp) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 5 + .locals init (class assembly/CompareMicroPerfAndCodeGenerationTests/KeyR V_0, + int32 V_1, + int32 V_2, + int32 V_3) + IL_0000: ldarg.1 + IL_0001: unbox.any assembly/CompareMicroPerfAndCodeGenerationTests/KeyR + IL_0006: stloc.0 + IL_0007: ldarg.0 + IL_0008: brfalse.s IL_0050 + + IL_000a: ldarg.1 + IL_000b: unbox.any assembly/CompareMicroPerfAndCodeGenerationTests/KeyR + IL_0010: brfalse.s IL_004e + + IL_0012: ldarg.0 + IL_0013: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_0018: stloc.2 + IL_0019: ldloc.0 + IL_001a: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_001f: stloc.3 + IL_0020: ldloc.2 + IL_0021: ldloc.3 + IL_0022: cgt + IL_0024: ldloc.2 + IL_0025: ldloc.3 + IL_0026: clt + IL_0028: sub + IL_0029: stloc.1 + IL_002a: ldloc.1 + IL_002b: ldc.i4.0 + IL_002c: bge.s IL_0030 + + IL_002e: ldloc.1 + IL_002f: ret + + IL_0030: ldloc.1 + IL_0031: ldc.i4.0 + IL_0032: ble.s IL_0036 + + IL_0034: ldloc.1 + IL_0035: ret + + IL_0036: ldarg.0 + IL_0037: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_003c: stloc.2 + IL_003d: ldloc.0 + IL_003e: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_0043: stloc.3 + IL_0044: ldloc.2 + IL_0045: ldloc.3 + IL_0046: cgt + IL_0048: ldloc.2 + IL_0049: ldloc.3 + IL_004a: clt + IL_004c: sub + IL_004d: ret + + IL_004e: ldc.i4.1 + IL_004f: ret + + IL_0050: ldarg.1 + IL_0051: unbox.any assembly/CompareMicroPerfAndCodeGenerationTests/KeyR + IL_0056: brfalse.s IL_005a + + IL_0058: ldc.i4.m1 + IL_0059: ret + + IL_005a: ldc.i4.0 + IL_005b: ret + } + + .method public hidebysig virtual final + instance int32 GetHashCode(class [runtime]System.Collections.IEqualityComparer comp) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 7 + .locals init (int32 V_0) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0031 + + IL_0003: ldc.i4.0 + IL_0004: stloc.0 + IL_0005: ldc.i4 0x9e3779b9 + IL_000a: ldarg.0 + IL_000b: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_0010: ldloc.0 + IL_0011: ldc.i4.6 + IL_0012: shl + IL_0013: ldloc.0 + IL_0014: ldc.i4.2 + IL_0015: shr + IL_0016: add + IL_0017: add + IL_0018: add + IL_0019: stloc.0 + IL_001a: ldc.i4 0x9e3779b9 + IL_001f: ldarg.0 + IL_0020: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_0025: ldloc.0 + IL_0026: ldc.i4.6 + IL_0027: shl + IL_0028: ldloc.0 + IL_0029: ldc.i4.2 + IL_002a: shr + IL_002b: add + IL_002c: add + IL_002d: add + IL_002e: stloc.0 + IL_002f: ldloc.0 + IL_0030: ret + + IL_0031: ldc.i4.0 + IL_0032: ret + } + + .method public hidebysig virtual final + instance int32 GetHashCode() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call class [runtime]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer() + IL_0006: callvirt instance int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::GetHashCode(class [runtime]System.Collections.IEqualityComparer) + IL_000b: ret + } + + .method public hidebysig virtual final + instance bool Equals(object obj, + class [runtime]System.Collections.IEqualityComparer comp) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 4 + .locals init (class assembly/CompareMicroPerfAndCodeGenerationTests/KeyR V_0) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_002e + + IL_0003: ldarg.1 + IL_0004: isinst assembly/CompareMicroPerfAndCodeGenerationTests/KeyR + IL_0009: stloc.0 + IL_000a: ldloc.0 + IL_000b: brfalse.s IL_002c + + IL_000d: ldarg.0 + IL_000e: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_0013: ldloc.0 + IL_0014: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_0019: bne.un.s IL_002a + + IL_001b: ldarg.0 + IL_001c: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_0021: ldloc.0 + IL_0022: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_0027: ceq + IL_0029: ret + + IL_002a: ldc.i4.0 + IL_002b: ret + + IL_002c: ldc.i4.0 + IL_002d: ret + + IL_002e: ldarg.1 + IL_002f: ldnull + IL_0030: cgt.un + IL_0032: ldc.i4.0 + IL_0033: ceq + IL_0035: ret + } + + .method public hidebysig virtual final + instance bool Equals(class assembly/CompareMicroPerfAndCodeGenerationTests/KeyR obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0027 + + IL_0003: ldarg.1 + IL_0004: brfalse.s IL_0025 + + IL_0006: ldarg.0 + IL_0007: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_000c: ldarg.1 + IL_000d: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_0012: bne.un.s IL_0023 + + IL_0014: ldarg.0 + IL_0015: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_001a: ldarg.1 + IL_001b: ldfld int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_0020: ceq + IL_0022: ret + + IL_0023: ldc.i4.0 + IL_0024: ret + + IL_0025: ldc.i4.0 + IL_0026: ret + + IL_0027: ldarg.1 + IL_0028: ldnull + IL_0029: cgt.un + IL_002b: ldc.i4.0 + IL_002c: ceq + IL_002e: ret + } + + .method public hidebysig virtual final + instance bool Equals(object obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 4 + .locals init (class assembly/CompareMicroPerfAndCodeGenerationTests/KeyR V_0) + IL_0000: ldarg.1 + IL_0001: isinst assembly/CompareMicroPerfAndCodeGenerationTests/KeyR + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: brfalse.s IL_0012 + + IL_000a: ldarg.0 + IL_000b: ldloc.0 + IL_000c: callvirt instance bool assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::Equals(class assembly/CompareMicroPerfAndCodeGenerationTests/KeyR) + IL_0011: ret + + IL_0012: ldc.i4.0 + IL_0013: ret + } + + .property instance int32 key1() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32) = ( 01 00 04 00 00 00 00 00 00 00 00 00 ) + .get instance int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::get_key1() + } + .property instance int32 key2() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32) = ( 01 00 04 00 00 00 01 00 00 00 00 00 ) + .get instance int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::get_key2() + } + } + + .method public static void f5c() cil managed + { + + .maxstack 4 + .locals init (int32 V_0, + class assembly/CompareMicroPerfAndCodeGenerationTests/KeyR V_1, + class assembly/CompareMicroPerfAndCodeGenerationTests/KeyR V_2, + int32 V_3) + IL_0000: ldc.i4.1 + IL_0001: stloc.0 + IL_0002: ldc.i4.1 + IL_0003: ldc.i4.2 + IL_0004: newobj instance void assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::.ctor(int32, + int32) + IL_0009: stloc.1 + IL_000a: ldc.i4.1 + IL_000b: ldc.i4.3 + IL_000c: newobj instance void assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::.ctor(int32, + int32) + IL_0011: stloc.2 + IL_0012: ldc.i4.0 + IL_0013: stloc.3 + IL_0014: br.s IL_0022 + + IL_0016: ldloc.1 + IL_0017: ldloc.2 + IL_0018: callvirt instance int32 assembly/CompareMicroPerfAndCodeGenerationTests/KeyR::CompareTo(class assembly/CompareMicroPerfAndCodeGenerationTests/KeyR) + IL_001d: stloc.0 + IL_001e: ldloc.3 + IL_001f: ldc.i4.1 + IL_0020: add + IL_0021: stloc.3 + IL_0022: ldloc.3 + IL_0023: ldc.i4 0x989681 + IL_0028: blt.s IL_0016 + + IL_002a: ret + } + + } + +} + +.class private abstract auto ansi sealed ''.$assembly$fsx + extends [runtime]System.Object +{ + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals05.fsx.il.net472.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals05.fsx.il.net472.bsl new file mode 100644 index 0000000000..c626341997 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals05.fsx.il.net472.bsl @@ -0,0 +1,651 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly assembly +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32, + int32, + int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 ) + + + + + .hash algorithm 0x00008004 + .ver 0:0:0:0 +} +.mresource public FSharpSignatureData.assembly +{ + + +} +.mresource public FSharpOptimizationData.assembly +{ + + +} +.module assembly.exe + +.imagebase {value} +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 +.corflags 0x00000001 + + + + + +.class public abstract auto ansi sealed assembly + extends [runtime]System.Object +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .class abstract auto ansi sealed nested public EqualsMicroPerfAndCodeGenerationTests + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .class auto ansi serializable sealed nested public KeyR + extends [runtime]System.Object + implements class [runtime]System.IEquatable`1, + [runtime]System.Collections.IStructuralEquatable, + class [runtime]System.IComparable`1, + [runtime]System.IComparable, + [runtime]System.Collections.IStructuralComparable + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 02 00 00 00 00 00 ) + .field assembly int32 key1@ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .field assembly int32 key2@ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .method public hidebysig specialname + instance int32 get_key1() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_0006: ret + } + + .method public hidebysig specialname + instance int32 get_key2() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_0006: ret + } + + .method public specialname rtspecialname + instance void .ctor(int32 key1, + int32 key2) cil managed + { + .custom instance void System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::.ctor(valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes, + class [runtime]System.Type) = ( 01 00 60 06 00 00 33 45 71 75 61 6C 73 30 35 2B + 45 71 75 61 6C 73 4D 69 63 72 6F 50 65 72 66 41 + 6E 64 43 6F 64 65 47 65 6E 65 72 61 74 69 6F 6E + 54 65 73 74 73 2B 4B 65 79 52 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void [runtime]System.Object::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_000d: ldarg.0 + IL_000e: ldarg.2 + IL_000f: stfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_0014: ret + } + + .method public strict virtual instance string + ToString() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldstr "%+A" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,class assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR>::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_000f: ldarg.0 + IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0015: ret + } + + .method public hidebysig virtual final + instance int32 CompareTo(class assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 5 + .locals init (int32 V_0, + class [runtime]System.Collections.IComparer V_1, + int32 V_2, + int32 V_3) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0050 + + IL_0003: ldarg.1 + IL_0004: brfalse.s IL_004e + + IL_0006: call class [runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() + IL_000b: stloc.1 + IL_000c: ldarg.0 + IL_000d: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_0012: stloc.2 + IL_0013: ldarg.1 + IL_0014: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_0019: stloc.3 + IL_001a: ldloc.2 + IL_001b: ldloc.3 + IL_001c: cgt + IL_001e: ldloc.2 + IL_001f: ldloc.3 + IL_0020: clt + IL_0022: sub + IL_0023: stloc.0 + IL_0024: ldloc.0 + IL_0025: ldc.i4.0 + IL_0026: bge.s IL_002a + + IL_0028: ldloc.0 + IL_0029: ret + + IL_002a: ldloc.0 + IL_002b: ldc.i4.0 + IL_002c: ble.s IL_0030 + + IL_002e: ldloc.0 + IL_002f: ret + + IL_0030: call class [runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() + IL_0035: stloc.1 + IL_0036: ldarg.0 + IL_0037: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_003c: stloc.2 + IL_003d: ldarg.1 + IL_003e: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_0043: stloc.3 + IL_0044: ldloc.2 + IL_0045: ldloc.3 + IL_0046: cgt + IL_0048: ldloc.2 + IL_0049: ldloc.3 + IL_004a: clt + IL_004c: sub + IL_004d: ret + + IL_004e: ldc.i4.1 + IL_004f: ret + + IL_0050: ldarg.1 + IL_0051: brfalse.s IL_0055 + + IL_0053: ldc.i4.m1 + IL_0054: ret + + IL_0055: ldc.i4.0 + IL_0056: ret + } + + .method public hidebysig virtual final + instance int32 CompareTo(object obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: unbox.any assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR + IL_0007: callvirt instance int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::CompareTo(class assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR) + IL_000c: ret + } + + .method public hidebysig virtual final + instance int32 CompareTo(object obj, + class [runtime]System.Collections.IComparer comp) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 5 + .locals init (class assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR V_0, + int32 V_1, + int32 V_2, + int32 V_3) + IL_0000: ldarg.1 + IL_0001: unbox.any assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR + IL_0006: stloc.0 + IL_0007: ldarg.0 + IL_0008: brfalse.s IL_0050 + + IL_000a: ldarg.1 + IL_000b: unbox.any assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR + IL_0010: brfalse.s IL_004e + + IL_0012: ldarg.0 + IL_0013: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_0018: stloc.2 + IL_0019: ldloc.0 + IL_001a: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_001f: stloc.3 + IL_0020: ldloc.2 + IL_0021: ldloc.3 + IL_0022: cgt + IL_0024: ldloc.2 + IL_0025: ldloc.3 + IL_0026: clt + IL_0028: sub + IL_0029: stloc.1 + IL_002a: ldloc.1 + IL_002b: ldc.i4.0 + IL_002c: bge.s IL_0030 + + IL_002e: ldloc.1 + IL_002f: ret + + IL_0030: ldloc.1 + IL_0031: ldc.i4.0 + IL_0032: ble.s IL_0036 + + IL_0034: ldloc.1 + IL_0035: ret + + IL_0036: ldarg.0 + IL_0037: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_003c: stloc.2 + IL_003d: ldloc.0 + IL_003e: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_0043: stloc.3 + IL_0044: ldloc.2 + IL_0045: ldloc.3 + IL_0046: cgt + IL_0048: ldloc.2 + IL_0049: ldloc.3 + IL_004a: clt + IL_004c: sub + IL_004d: ret + + IL_004e: ldc.i4.1 + IL_004f: ret + + IL_0050: ldarg.1 + IL_0051: unbox.any assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR + IL_0056: brfalse.s IL_005a + + IL_0058: ldc.i4.m1 + IL_0059: ret + + IL_005a: ldc.i4.0 + IL_005b: ret + } + + .method public hidebysig virtual final + instance int32 GetHashCode(class [runtime]System.Collections.IEqualityComparer comp) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 7 + .locals init (int32 V_0) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0031 + + IL_0003: ldc.i4.0 + IL_0004: stloc.0 + IL_0005: ldc.i4 0x9e3779b9 + IL_000a: ldarg.0 + IL_000b: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_0010: ldloc.0 + IL_0011: ldc.i4.6 + IL_0012: shl + IL_0013: ldloc.0 + IL_0014: ldc.i4.2 + IL_0015: shr + IL_0016: add + IL_0017: add + IL_0018: add + IL_0019: stloc.0 + IL_001a: ldc.i4 0x9e3779b9 + IL_001f: ldarg.0 + IL_0020: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_0025: ldloc.0 + IL_0026: ldc.i4.6 + IL_0027: shl + IL_0028: ldloc.0 + IL_0029: ldc.i4.2 + IL_002a: shr + IL_002b: add + IL_002c: add + IL_002d: add + IL_002e: stloc.0 + IL_002f: ldloc.0 + IL_0030: ret + + IL_0031: ldc.i4.0 + IL_0032: ret + } + + .method public hidebysig virtual final + instance int32 GetHashCode() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call class [runtime]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer() + IL_0006: callvirt instance int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::GetHashCode(class [runtime]System.Collections.IEqualityComparer) + IL_000b: ret + } + + .method public hidebysig virtual final + instance bool Equals(object obj, + class [runtime]System.Collections.IEqualityComparer comp) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 4 + .locals init (class assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR V_0) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_002e + + IL_0003: ldarg.1 + IL_0004: isinst assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR + IL_0009: stloc.0 + IL_000a: ldloc.0 + IL_000b: brfalse.s IL_002c + + IL_000d: ldarg.0 + IL_000e: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_0013: ldloc.0 + IL_0014: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_0019: bne.un.s IL_002a + + IL_001b: ldarg.0 + IL_001c: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_0021: ldloc.0 + IL_0022: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_0027: ceq + IL_0029: ret + + IL_002a: ldc.i4.0 + IL_002b: ret + + IL_002c: ldc.i4.0 + IL_002d: ret + + IL_002e: ldarg.1 + IL_002f: ldnull + IL_0030: cgt.un + IL_0032: ldc.i4.0 + IL_0033: ceq + IL_0035: ret + } + + .method public hidebysig virtual final + instance bool Equals(class assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0027 + + IL_0003: ldarg.1 + IL_0004: brfalse.s IL_0025 + + IL_0006: ldarg.0 + IL_0007: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_000c: ldarg.1 + IL_000d: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_0012: bne.un.s IL_0023 + + IL_0014: ldarg.0 + IL_0015: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_001a: ldarg.1 + IL_001b: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_0020: ceq + IL_0022: ret + + IL_0023: ldc.i4.0 + IL_0024: ret + + IL_0025: ldc.i4.0 + IL_0026: ret + + IL_0027: ldarg.1 + IL_0028: ldnull + IL_0029: cgt.un + IL_002b: ldc.i4.0 + IL_002c: ceq + IL_002e: ret + } + + .method public hidebysig virtual final + instance bool Equals(object obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 4 + .locals init (class assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR V_0) + IL_0000: ldarg.1 + IL_0001: isinst assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: brfalse.s IL_0012 + + IL_000a: ldarg.0 + IL_000b: ldloc.0 + IL_000c: callvirt instance bool assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::Equals(class assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR) + IL_0011: ret + + IL_0012: ldc.i4.0 + IL_0013: ret + } + + .property instance int32 key1() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32) = ( 01 00 04 00 00 00 00 00 00 00 00 00 ) + .get instance int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::get_key1() + } + .property instance int32 key2() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32) = ( 01 00 04 00 00 00 01 00 00 00 00 00 ) + .get instance int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::get_key2() + } + } + + .method public static void f5c() cil managed + { + + .maxstack 5 + .locals init (bool V_0, + class assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR V_1, + class assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR V_2, + int32 V_3) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.1 + IL_0003: ldc.i4.2 + IL_0004: newobj instance void assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::.ctor(int32, + int32) + IL_0009: stloc.1 + IL_000a: ldc.i4.1 + IL_000b: ldc.i4.3 + IL_000c: newobj instance void assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::.ctor(int32, + int32) + IL_0011: stloc.2 + IL_0012: ldc.i4.0 + IL_0013: stloc.3 + IL_0014: br.s IL_0027 + + IL_0016: ldloc.1 + IL_0017: ldloc.2 + IL_0018: call class [runtime]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer() + IL_001d: callvirt instance bool assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::Equals(object, + class [runtime]System.Collections.IEqualityComparer) + IL_0022: stloc.0 + IL_0023: ldloc.3 + IL_0024: ldc.i4.1 + IL_0025: add + IL_0026: stloc.3 + IL_0027: ldloc.3 + IL_0028: ldc.i4 0x989681 + IL_002d: blt.s IL_0016 + + IL_002f: ret + } + + } + +} + +.class private abstract auto ansi sealed ''.$assembly$fsx + extends [runtime]System.Object +{ + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: ret + } + +} + +.class private auto ansi sealed System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes + extends [runtime]System.Enum +{ + .custom instance void [runtime]System.FlagsAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .field public specialname rtspecialname int32 value__ = int32(0x00000000) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes All = int32(0xFFFFFFFF) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes None = int32(0x00000000) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicParameterlessConstructor = int32(0x00000001) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicConstructors = int32(0x00000003) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicConstructors = int32(0x00000004) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicMethods = int32(0x00000008) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicMethods = int32(0x00000010) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicFields = int32(0x00000020) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicFields = int32(0x00000040) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicNestedTypes = int32(0x00000080) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicNestedTypes = int32(0x00000100) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicProperties = int32(0x00000200) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicProperties = int32(0x00000400) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicEvents = int32(0x00000800) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicEvents = int32(0x00001000) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes Interfaces = int32(0x00002000) +} + +.class private auto ansi beforefieldinit System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute + extends [runtime]System.Attribute +{ + .field private valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes MemberType@ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .field private class [runtime]System.Type Type@ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method public specialname rtspecialname + instance void .ctor(valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes MemberType, + class [runtime]System.Type Type) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void [runtime]System.Attribute::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::MemberType@ + IL_000d: ldarg.0 + IL_000e: ldarg.2 + IL_000f: stfld class [runtime]System.Type System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::Type@ + IL_0014: ret + } + + .method public hidebysig specialname instance class [runtime]System.Type + get_Type() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld class [runtime]System.Type System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::Type@ + IL_0006: ret + } + + .method private hidebysig specialname instance void + set_Type(class [runtime]System.Type 'value') cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: stfld class [runtime]System.Type System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::Type@ + IL_0007: ret + } + + .method public hidebysig specialname instance valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes + get_MemberType() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::MemberType@ + IL_0006: ret + } + + .method private hidebysig specialname instance void + set_MemberType(valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes 'value') cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: stfld valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::MemberType@ + IL_0007: ret + } + + .property instance valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes + MemberType() + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .set instance void System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::set_MemberType(valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes) + .get instance valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::get_MemberType() + } + .property instance class [runtime]System.Type + Type() + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .set instance void System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::set_Type(class [runtime]System.Type) + .get instance class [runtime]System.Type System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::get_Type() + } +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals05.fsx.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals05.fsx.il.netcore.bsl similarity index 95% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals05.fsx.il.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals05.fsx.il.netcore.bsl index c89cc78089..0b2be0a040 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals05.fsx.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals05.fsx.il.netcore.bsl @@ -1,525 +1,530 @@ - - - - - -.assembly extern runtime { } -.assembly extern FSharp.Core { } -.assembly assembly -{ - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32, - int32, - int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 ) - - - - - .hash algorithm 0x00008004 - .ver 0:0:0:0 -} -.mresource public FSharpSignatureData.assembly -{ - - -} -.mresource public FSharpOptimizationData.assembly -{ - - -} -.module assembly.exe - -.imagebase {value} -.file alignment 0x00000200 -.stackreserve 0x00100000 -.subsystem 0x0003 -.corflags 0x00000001 - - - - - -.class public abstract auto ansi sealed assembly - extends [runtime]System.Object -{ - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) - .class abstract auto ansi sealed nested public EqualsMicroPerfAndCodeGenerationTests - extends [runtime]System.Object - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) - .class auto ansi serializable sealed nested public KeyR - extends [runtime]System.Object - implements class [runtime]System.IEquatable`1, - [runtime]System.Collections.IStructuralEquatable, - class [runtime]System.IComparable`1, - [runtime]System.IComparable, - [runtime]System.Collections.IStructuralComparable - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 02 00 00 00 00 00 ) - .field assembly int32 key1@ - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) - .field assembly int32 key2@ - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) - .method public hidebysig specialname - instance int32 get_key1() cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key1@ - IL_0006: ret - } - - .method public hidebysig specialname - instance int32 get_key2() cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key2@ - IL_0006: ret - } - - .method public specialname rtspecialname - instance void .ctor(int32 key1, - int32 key2) cil managed - { - - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: call instance void [runtime]System.Object::.ctor() - IL_0006: ldarg.0 - IL_0007: ldarg.1 - IL_0008: stfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key1@ - IL_000d: ldarg.0 - IL_000e: ldarg.2 - IL_000f: stfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key2@ - IL_0014: ret - } - - .method public strict virtual instance string - ToString() cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 8 - IL_0000: ldstr "%+A" - IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,class assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR>::.ctor(string) - IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) - IL_000f: ldarg.0 - IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) - IL_0015: ret - } - - .method public hidebysig virtual final - instance int32 CompareTo(class assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR obj) cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 5 - .locals init (int32 V_0, - class [runtime]System.Collections.IComparer V_1, - int32 V_2, - int32 V_3) - IL_0000: ldarg.0 - IL_0001: brfalse.s IL_0050 - - IL_0003: ldarg.1 - IL_0004: brfalse.s IL_004e - - IL_0006: call class [runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() - IL_000b: stloc.1 - IL_000c: ldarg.0 - IL_000d: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key1@ - IL_0012: stloc.2 - IL_0013: ldarg.1 - IL_0014: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key1@ - IL_0019: stloc.3 - IL_001a: ldloc.2 - IL_001b: ldloc.3 - IL_001c: cgt - IL_001e: ldloc.2 - IL_001f: ldloc.3 - IL_0020: clt - IL_0022: sub - IL_0023: stloc.0 - IL_0024: ldloc.0 - IL_0025: ldc.i4.0 - IL_0026: bge.s IL_002a - - IL_0028: ldloc.0 - IL_0029: ret - - IL_002a: ldloc.0 - IL_002b: ldc.i4.0 - IL_002c: ble.s IL_0030 - - IL_002e: ldloc.0 - IL_002f: ret - - IL_0030: call class [runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() - IL_0035: stloc.1 - IL_0036: ldarg.0 - IL_0037: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key2@ - IL_003c: stloc.2 - IL_003d: ldarg.1 - IL_003e: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key2@ - IL_0043: stloc.3 - IL_0044: ldloc.2 - IL_0045: ldloc.3 - IL_0046: cgt - IL_0048: ldloc.2 - IL_0049: ldloc.3 - IL_004a: clt - IL_004c: sub - IL_004d: ret - - IL_004e: ldc.i4.1 - IL_004f: ret - - IL_0050: ldarg.1 - IL_0051: brfalse.s IL_0055 - - IL_0053: ldc.i4.m1 - IL_0054: ret - - IL_0055: ldc.i4.0 - IL_0056: ret - } - - .method public hidebysig virtual final - instance int32 CompareTo(object obj) cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: ldarg.1 - IL_0002: unbox.any assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR - IL_0007: callvirt instance int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::CompareTo(class assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR) - IL_000c: ret - } - - .method public hidebysig virtual final - instance int32 CompareTo(object obj, - class [runtime]System.Collections.IComparer comp) cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 5 - .locals init (class assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR V_0, - int32 V_1, - int32 V_2, - int32 V_3) - IL_0000: ldarg.1 - IL_0001: unbox.any assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR - IL_0006: stloc.0 - IL_0007: ldarg.0 - IL_0008: brfalse.s IL_0050 - - IL_000a: ldarg.1 - IL_000b: unbox.any assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR - IL_0010: brfalse.s IL_004e - - IL_0012: ldarg.0 - IL_0013: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key1@ - IL_0018: stloc.2 - IL_0019: ldloc.0 - IL_001a: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key1@ - IL_001f: stloc.3 - IL_0020: ldloc.2 - IL_0021: ldloc.3 - IL_0022: cgt - IL_0024: ldloc.2 - IL_0025: ldloc.3 - IL_0026: clt - IL_0028: sub - IL_0029: stloc.1 - IL_002a: ldloc.1 - IL_002b: ldc.i4.0 - IL_002c: bge.s IL_0030 - - IL_002e: ldloc.1 - IL_002f: ret - - IL_0030: ldloc.1 - IL_0031: ldc.i4.0 - IL_0032: ble.s IL_0036 - - IL_0034: ldloc.1 - IL_0035: ret - - IL_0036: ldarg.0 - IL_0037: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key2@ - IL_003c: stloc.2 - IL_003d: ldloc.0 - IL_003e: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key2@ - IL_0043: stloc.3 - IL_0044: ldloc.2 - IL_0045: ldloc.3 - IL_0046: cgt - IL_0048: ldloc.2 - IL_0049: ldloc.3 - IL_004a: clt - IL_004c: sub - IL_004d: ret - - IL_004e: ldc.i4.1 - IL_004f: ret - - IL_0050: ldarg.1 - IL_0051: unbox.any assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR - IL_0056: brfalse.s IL_005a - - IL_0058: ldc.i4.m1 - IL_0059: ret - - IL_005a: ldc.i4.0 - IL_005b: ret - } - - .method public hidebysig virtual final - instance int32 GetHashCode(class [runtime]System.Collections.IEqualityComparer comp) cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 7 - .locals init (int32 V_0) - IL_0000: ldarg.0 - IL_0001: brfalse.s IL_0031 - - IL_0003: ldc.i4.0 - IL_0004: stloc.0 - IL_0005: ldc.i4 0x9e3779b9 - IL_000a: ldarg.0 - IL_000b: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key2@ - IL_0010: ldloc.0 - IL_0011: ldc.i4.6 - IL_0012: shl - IL_0013: ldloc.0 - IL_0014: ldc.i4.2 - IL_0015: shr - IL_0016: add - IL_0017: add - IL_0018: add - IL_0019: stloc.0 - IL_001a: ldc.i4 0x9e3779b9 - IL_001f: ldarg.0 - IL_0020: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key1@ - IL_0025: ldloc.0 - IL_0026: ldc.i4.6 - IL_0027: shl - IL_0028: ldloc.0 - IL_0029: ldc.i4.2 - IL_002a: shr - IL_002b: add - IL_002c: add - IL_002d: add - IL_002e: stloc.0 - IL_002f: ldloc.0 - IL_0030: ret - - IL_0031: ldc.i4.0 - IL_0032: ret - } - - .method public hidebysig virtual final - instance int32 GetHashCode() cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: call class [runtime]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer() - IL_0006: callvirt instance int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::GetHashCode(class [runtime]System.Collections.IEqualityComparer) - IL_000b: ret - } - - .method public hidebysig virtual final - instance bool Equals(object obj, - class [runtime]System.Collections.IEqualityComparer comp) cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 4 - .locals init (class assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR V_0) - IL_0000: ldarg.0 - IL_0001: brfalse.s IL_002e - - IL_0003: ldarg.1 - IL_0004: isinst assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR - IL_0009: stloc.0 - IL_000a: ldloc.0 - IL_000b: brfalse.s IL_002c - - IL_000d: ldarg.0 - IL_000e: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key1@ - IL_0013: ldloc.0 - IL_0014: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key1@ - IL_0019: bne.un.s IL_002a - - IL_001b: ldarg.0 - IL_001c: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key2@ - IL_0021: ldloc.0 - IL_0022: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key2@ - IL_0027: ceq - IL_0029: ret - - IL_002a: ldc.i4.0 - IL_002b: ret - - IL_002c: ldc.i4.0 - IL_002d: ret - - IL_002e: ldarg.1 - IL_002f: ldnull - IL_0030: cgt.un - IL_0032: ldc.i4.0 - IL_0033: ceq - IL_0035: ret - } - - .method public hidebysig virtual final - instance bool Equals(class assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR obj) cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: brfalse.s IL_0027 - - IL_0003: ldarg.1 - IL_0004: brfalse.s IL_0025 - - IL_0006: ldarg.0 - IL_0007: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key1@ - IL_000c: ldarg.1 - IL_000d: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key1@ - IL_0012: bne.un.s IL_0023 - - IL_0014: ldarg.0 - IL_0015: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key2@ - IL_001a: ldarg.1 - IL_001b: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key2@ - IL_0020: ceq - IL_0022: ret - - IL_0023: ldc.i4.0 - IL_0024: ret - - IL_0025: ldc.i4.0 - IL_0026: ret - - IL_0027: ldarg.1 - IL_0028: ldnull - IL_0029: cgt.un - IL_002b: ldc.i4.0 - IL_002c: ceq - IL_002e: ret - } - - .method public hidebysig virtual final - instance bool Equals(object obj) cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 4 - .locals init (class assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR V_0) - IL_0000: ldarg.1 - IL_0001: isinst assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR - IL_0006: stloc.0 - IL_0007: ldloc.0 - IL_0008: brfalse.s IL_0012 - - IL_000a: ldarg.0 - IL_000b: ldloc.0 - IL_000c: callvirt instance bool assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::Equals(class assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR) - IL_0011: ret - - IL_0012: ldc.i4.0 - IL_0013: ret - } - - .property instance int32 key1() - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, - int32) = ( 01 00 04 00 00 00 00 00 00 00 00 00 ) - .get instance int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::get_key1() - } - .property instance int32 key2() - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, - int32) = ( 01 00 04 00 00 00 01 00 00 00 00 00 ) - .get instance int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::get_key2() - } - } - - .method public static void f5c() cil managed - { - - .maxstack 5 - .locals init (bool V_0, - class assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR V_1, - class assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR V_2, - int32 V_3) - IL_0000: ldc.i4.0 - IL_0001: stloc.0 - IL_0002: ldc.i4.1 - IL_0003: ldc.i4.2 - IL_0004: newobj instance void assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::.ctor(int32, - int32) - IL_0009: stloc.1 - IL_000a: ldc.i4.1 - IL_000b: ldc.i4.3 - IL_000c: newobj instance void assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::.ctor(int32, - int32) - IL_0011: stloc.2 - IL_0012: ldc.i4.0 - IL_0013: stloc.3 - IL_0014: br.s IL_0027 - - IL_0016: ldloc.1 - IL_0017: ldloc.2 - IL_0018: call class [runtime]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer() - IL_001d: callvirt instance bool assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::Equals(object, - class [runtime]System.Collections.IEqualityComparer) - IL_0022: stloc.0 - IL_0023: ldloc.3 - IL_0024: ldc.i4.1 - IL_0025: add - IL_0026: stloc.3 - IL_0027: ldloc.3 - IL_0028: ldc.i4 0x989681 - IL_002d: blt.s IL_0016 - - IL_002f: ret - } - - } - -} - -.class private abstract auto ansi sealed ''.$assembly$fsx - extends [runtime]System.Object -{ - .method public static void main@() cil managed - { - .entrypoint - - .maxstack 8 - IL_0000: ret - } - -} - - - - - - + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly assembly +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32, + int32, + int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 ) + + + + + .hash algorithm 0x00008004 + .ver 0:0:0:0 +} +.mresource public FSharpSignatureData.assembly +{ + + +} +.mresource public FSharpOptimizationData.assembly +{ + + +} +.module assembly.exe + +.imagebase {value} +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 +.corflags 0x00000001 + + + + + +.class public abstract auto ansi sealed assembly + extends [runtime]System.Object +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .class abstract auto ansi sealed nested public EqualsMicroPerfAndCodeGenerationTests + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .class auto ansi serializable sealed nested public KeyR + extends [runtime]System.Object + implements class [runtime]System.IEquatable`1, + [runtime]System.Collections.IStructuralEquatable, + class [runtime]System.IComparable`1, + [runtime]System.IComparable, + [runtime]System.Collections.IStructuralComparable + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 02 00 00 00 00 00 ) + .field assembly int32 key1@ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .field assembly int32 key2@ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .method public hidebysig specialname + instance int32 get_key1() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_0006: ret + } + + .method public hidebysig specialname + instance int32 get_key2() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_0006: ret + } + + .method public specialname rtspecialname + instance void .ctor(int32 key1, + int32 key2) cil managed + { + .custom instance void [runtime]System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::.ctor(valuetype [runtime]System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes, + class [runtime]System.Type) = ( 01 00 60 06 00 00 33 45 71 75 61 6C 73 30 35 2B + 45 71 75 61 6C 73 4D 69 63 72 6F 50 65 72 66 41 + 6E 64 43 6F 64 65 47 65 6E 65 72 61 74 69 6F 6E + 54 65 73 74 73 2B 4B 65 79 52 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void [runtime]System.Object::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_000d: ldarg.0 + IL_000e: ldarg.2 + IL_000f: stfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_0014: ret + } + + .method public strict virtual instance string + ToString() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldstr "%+A" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,class assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR>::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_000f: ldarg.0 + IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0015: ret + } + + .method public hidebysig virtual final + instance int32 CompareTo(class assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 5 + .locals init (int32 V_0, + class [runtime]System.Collections.IComparer V_1, + int32 V_2, + int32 V_3) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0050 + + IL_0003: ldarg.1 + IL_0004: brfalse.s IL_004e + + IL_0006: call class [runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() + IL_000b: stloc.1 + IL_000c: ldarg.0 + IL_000d: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_0012: stloc.2 + IL_0013: ldarg.1 + IL_0014: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_0019: stloc.3 + IL_001a: ldloc.2 + IL_001b: ldloc.3 + IL_001c: cgt + IL_001e: ldloc.2 + IL_001f: ldloc.3 + IL_0020: clt + IL_0022: sub + IL_0023: stloc.0 + IL_0024: ldloc.0 + IL_0025: ldc.i4.0 + IL_0026: bge.s IL_002a + + IL_0028: ldloc.0 + IL_0029: ret + + IL_002a: ldloc.0 + IL_002b: ldc.i4.0 + IL_002c: ble.s IL_0030 + + IL_002e: ldloc.0 + IL_002f: ret + + IL_0030: call class [runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() + IL_0035: stloc.1 + IL_0036: ldarg.0 + IL_0037: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_003c: stloc.2 + IL_003d: ldarg.1 + IL_003e: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_0043: stloc.3 + IL_0044: ldloc.2 + IL_0045: ldloc.3 + IL_0046: cgt + IL_0048: ldloc.2 + IL_0049: ldloc.3 + IL_004a: clt + IL_004c: sub + IL_004d: ret + + IL_004e: ldc.i4.1 + IL_004f: ret + + IL_0050: ldarg.1 + IL_0051: brfalse.s IL_0055 + + IL_0053: ldc.i4.m1 + IL_0054: ret + + IL_0055: ldc.i4.0 + IL_0056: ret + } + + .method public hidebysig virtual final + instance int32 CompareTo(object obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: unbox.any assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR + IL_0007: callvirt instance int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::CompareTo(class assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR) + IL_000c: ret + } + + .method public hidebysig virtual final + instance int32 CompareTo(object obj, + class [runtime]System.Collections.IComparer comp) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 5 + .locals init (class assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR V_0, + int32 V_1, + int32 V_2, + int32 V_3) + IL_0000: ldarg.1 + IL_0001: unbox.any assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR + IL_0006: stloc.0 + IL_0007: ldarg.0 + IL_0008: brfalse.s IL_0050 + + IL_000a: ldarg.1 + IL_000b: unbox.any assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR + IL_0010: brfalse.s IL_004e + + IL_0012: ldarg.0 + IL_0013: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_0018: stloc.2 + IL_0019: ldloc.0 + IL_001a: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_001f: stloc.3 + IL_0020: ldloc.2 + IL_0021: ldloc.3 + IL_0022: cgt + IL_0024: ldloc.2 + IL_0025: ldloc.3 + IL_0026: clt + IL_0028: sub + IL_0029: stloc.1 + IL_002a: ldloc.1 + IL_002b: ldc.i4.0 + IL_002c: bge.s IL_0030 + + IL_002e: ldloc.1 + IL_002f: ret + + IL_0030: ldloc.1 + IL_0031: ldc.i4.0 + IL_0032: ble.s IL_0036 + + IL_0034: ldloc.1 + IL_0035: ret + + IL_0036: ldarg.0 + IL_0037: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_003c: stloc.2 + IL_003d: ldloc.0 + IL_003e: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_0043: stloc.3 + IL_0044: ldloc.2 + IL_0045: ldloc.3 + IL_0046: cgt + IL_0048: ldloc.2 + IL_0049: ldloc.3 + IL_004a: clt + IL_004c: sub + IL_004d: ret + + IL_004e: ldc.i4.1 + IL_004f: ret + + IL_0050: ldarg.1 + IL_0051: unbox.any assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR + IL_0056: brfalse.s IL_005a + + IL_0058: ldc.i4.m1 + IL_0059: ret + + IL_005a: ldc.i4.0 + IL_005b: ret + } + + .method public hidebysig virtual final + instance int32 GetHashCode(class [runtime]System.Collections.IEqualityComparer comp) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 7 + .locals init (int32 V_0) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0031 + + IL_0003: ldc.i4.0 + IL_0004: stloc.0 + IL_0005: ldc.i4 0x9e3779b9 + IL_000a: ldarg.0 + IL_000b: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_0010: ldloc.0 + IL_0011: ldc.i4.6 + IL_0012: shl + IL_0013: ldloc.0 + IL_0014: ldc.i4.2 + IL_0015: shr + IL_0016: add + IL_0017: add + IL_0018: add + IL_0019: stloc.0 + IL_001a: ldc.i4 0x9e3779b9 + IL_001f: ldarg.0 + IL_0020: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_0025: ldloc.0 + IL_0026: ldc.i4.6 + IL_0027: shl + IL_0028: ldloc.0 + IL_0029: ldc.i4.2 + IL_002a: shr + IL_002b: add + IL_002c: add + IL_002d: add + IL_002e: stloc.0 + IL_002f: ldloc.0 + IL_0030: ret + + IL_0031: ldc.i4.0 + IL_0032: ret + } + + .method public hidebysig virtual final + instance int32 GetHashCode() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call class [runtime]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer() + IL_0006: callvirt instance int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::GetHashCode(class [runtime]System.Collections.IEqualityComparer) + IL_000b: ret + } + + .method public hidebysig virtual final + instance bool Equals(object obj, + class [runtime]System.Collections.IEqualityComparer comp) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 4 + .locals init (class assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR V_0) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_002e + + IL_0003: ldarg.1 + IL_0004: isinst assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR + IL_0009: stloc.0 + IL_000a: ldloc.0 + IL_000b: brfalse.s IL_002c + + IL_000d: ldarg.0 + IL_000e: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_0013: ldloc.0 + IL_0014: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_0019: bne.un.s IL_002a + + IL_001b: ldarg.0 + IL_001c: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_0021: ldloc.0 + IL_0022: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_0027: ceq + IL_0029: ret + + IL_002a: ldc.i4.0 + IL_002b: ret + + IL_002c: ldc.i4.0 + IL_002d: ret + + IL_002e: ldarg.1 + IL_002f: ldnull + IL_0030: cgt.un + IL_0032: ldc.i4.0 + IL_0033: ceq + IL_0035: ret + } + + .method public hidebysig virtual final + instance bool Equals(class assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0027 + + IL_0003: ldarg.1 + IL_0004: brfalse.s IL_0025 + + IL_0006: ldarg.0 + IL_0007: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_000c: ldarg.1 + IL_000d: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_0012: bne.un.s IL_0023 + + IL_0014: ldarg.0 + IL_0015: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_001a: ldarg.1 + IL_001b: ldfld int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_0020: ceq + IL_0022: ret + + IL_0023: ldc.i4.0 + IL_0024: ret + + IL_0025: ldc.i4.0 + IL_0026: ret + + IL_0027: ldarg.1 + IL_0028: ldnull + IL_0029: cgt.un + IL_002b: ldc.i4.0 + IL_002c: ceq + IL_002e: ret + } + + .method public hidebysig virtual final + instance bool Equals(object obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 4 + .locals init (class assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR V_0) + IL_0000: ldarg.1 + IL_0001: isinst assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: brfalse.s IL_0012 + + IL_000a: ldarg.0 + IL_000b: ldloc.0 + IL_000c: callvirt instance bool assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::Equals(class assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR) + IL_0011: ret + + IL_0012: ldc.i4.0 + IL_0013: ret + } + + .property instance int32 key1() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32) = ( 01 00 04 00 00 00 00 00 00 00 00 00 ) + .get instance int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::get_key1() + } + .property instance int32 key2() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32) = ( 01 00 04 00 00 00 01 00 00 00 00 00 ) + .get instance int32 assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::get_key2() + } + } + + .method public static void f5c() cil managed + { + + .maxstack 5 + .locals init (bool V_0, + class assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR V_1, + class assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR V_2, + int32 V_3) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.1 + IL_0003: ldc.i4.2 + IL_0004: newobj instance void assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::.ctor(int32, + int32) + IL_0009: stloc.1 + IL_000a: ldc.i4.1 + IL_000b: ldc.i4.3 + IL_000c: newobj instance void assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::.ctor(int32, + int32) + IL_0011: stloc.2 + IL_0012: ldc.i4.0 + IL_0013: stloc.3 + IL_0014: br.s IL_0027 + + IL_0016: ldloc.1 + IL_0017: ldloc.2 + IL_0018: call class [runtime]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer() + IL_001d: callvirt instance bool assembly/EqualsMicroPerfAndCodeGenerationTests/KeyR::Equals(object, + class [runtime]System.Collections.IEqualityComparer) + IL_0022: stloc.0 + IL_0023: ldloc.3 + IL_0024: ldc.i4.1 + IL_0025: add + IL_0026: stloc.3 + IL_0027: ldloc.3 + IL_0028: ldc.i4 0x989681 + IL_002d: blt.s IL_0016 + + IL_002f: ret + } + + } + +} + +.class private abstract auto ansi sealed ''.$assembly$fsx + extends [runtime]System.Object +{ + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash08.fsx.il.net472.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash08.fsx.il.net472.bsl new file mode 100644 index 0000000000..ce74f3ca8f --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash08.fsx.il.net472.bsl @@ -0,0 +1,639 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly assembly +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32, + int32, + int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 ) + + + + + .hash algorithm 0x00008004 + .ver 0:0:0:0 +} +.mresource public FSharpSignatureData.assembly +{ + + +} +.mresource public FSharpOptimizationData.assembly +{ + + +} +.module assembly.exe + +.imagebase {value} +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 +.corflags 0x00000001 + + + + + +.class public abstract auto ansi sealed assembly + extends [runtime]System.Object +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .class abstract auto ansi sealed nested public HashMicroPerfAndCodeGenerationTests + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .class auto ansi serializable sealed nested public KeyR + extends [runtime]System.Object + implements class [runtime]System.IEquatable`1, + [runtime]System.Collections.IStructuralEquatable, + class [runtime]System.IComparable`1, + [runtime]System.IComparable, + [runtime]System.Collections.IStructuralComparable + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 02 00 00 00 00 00 ) + .field assembly int32 key1@ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .field assembly int32 key2@ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .method public hidebysig specialname + instance int32 get_key1() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_0006: ret + } + + .method public hidebysig specialname + instance int32 get_key2() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_0006: ret + } + + .method public specialname rtspecialname + instance void .ctor(int32 key1, + int32 key2) cil managed + { + .custom instance void System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::.ctor(valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes, + class [runtime]System.Type) = ( 01 00 60 06 00 00 2F 48 61 73 68 30 38 2B 48 61 + 73 68 4D 69 63 72 6F 50 65 72 66 41 6E 64 43 6F + 64 65 47 65 6E 65 72 61 74 69 6F 6E 54 65 73 74 + 73 2B 4B 65 79 52 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void [runtime]System.Object::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_000d: ldarg.0 + IL_000e: ldarg.2 + IL_000f: stfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_0014: ret + } + + .method public strict virtual instance string + ToString() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldstr "%+A" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,class assembly/HashMicroPerfAndCodeGenerationTests/KeyR>::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_000f: ldarg.0 + IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0015: ret + } + + .method public hidebysig virtual final + instance int32 CompareTo(class assembly/HashMicroPerfAndCodeGenerationTests/KeyR obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 5 + .locals init (int32 V_0, + class [runtime]System.Collections.IComparer V_1, + int32 V_2, + int32 V_3) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0050 + + IL_0003: ldarg.1 + IL_0004: brfalse.s IL_004e + + IL_0006: call class [runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() + IL_000b: stloc.1 + IL_000c: ldarg.0 + IL_000d: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_0012: stloc.2 + IL_0013: ldarg.1 + IL_0014: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_0019: stloc.3 + IL_001a: ldloc.2 + IL_001b: ldloc.3 + IL_001c: cgt + IL_001e: ldloc.2 + IL_001f: ldloc.3 + IL_0020: clt + IL_0022: sub + IL_0023: stloc.0 + IL_0024: ldloc.0 + IL_0025: ldc.i4.0 + IL_0026: bge.s IL_002a + + IL_0028: ldloc.0 + IL_0029: ret + + IL_002a: ldloc.0 + IL_002b: ldc.i4.0 + IL_002c: ble.s IL_0030 + + IL_002e: ldloc.0 + IL_002f: ret + + IL_0030: call class [runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() + IL_0035: stloc.1 + IL_0036: ldarg.0 + IL_0037: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_003c: stloc.2 + IL_003d: ldarg.1 + IL_003e: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_0043: stloc.3 + IL_0044: ldloc.2 + IL_0045: ldloc.3 + IL_0046: cgt + IL_0048: ldloc.2 + IL_0049: ldloc.3 + IL_004a: clt + IL_004c: sub + IL_004d: ret + + IL_004e: ldc.i4.1 + IL_004f: ret + + IL_0050: ldarg.1 + IL_0051: brfalse.s IL_0055 + + IL_0053: ldc.i4.m1 + IL_0054: ret + + IL_0055: ldc.i4.0 + IL_0056: ret + } + + .method public hidebysig virtual final + instance int32 CompareTo(object obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: unbox.any assembly/HashMicroPerfAndCodeGenerationTests/KeyR + IL_0007: callvirt instance int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::CompareTo(class assembly/HashMicroPerfAndCodeGenerationTests/KeyR) + IL_000c: ret + } + + .method public hidebysig virtual final + instance int32 CompareTo(object obj, + class [runtime]System.Collections.IComparer comp) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 5 + .locals init (class assembly/HashMicroPerfAndCodeGenerationTests/KeyR V_0, + int32 V_1, + int32 V_2, + int32 V_3) + IL_0000: ldarg.1 + IL_0001: unbox.any assembly/HashMicroPerfAndCodeGenerationTests/KeyR + IL_0006: stloc.0 + IL_0007: ldarg.0 + IL_0008: brfalse.s IL_0050 + + IL_000a: ldarg.1 + IL_000b: unbox.any assembly/HashMicroPerfAndCodeGenerationTests/KeyR + IL_0010: brfalse.s IL_004e + + IL_0012: ldarg.0 + IL_0013: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_0018: stloc.2 + IL_0019: ldloc.0 + IL_001a: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_001f: stloc.3 + IL_0020: ldloc.2 + IL_0021: ldloc.3 + IL_0022: cgt + IL_0024: ldloc.2 + IL_0025: ldloc.3 + IL_0026: clt + IL_0028: sub + IL_0029: stloc.1 + IL_002a: ldloc.1 + IL_002b: ldc.i4.0 + IL_002c: bge.s IL_0030 + + IL_002e: ldloc.1 + IL_002f: ret + + IL_0030: ldloc.1 + IL_0031: ldc.i4.0 + IL_0032: ble.s IL_0036 + + IL_0034: ldloc.1 + IL_0035: ret + + IL_0036: ldarg.0 + IL_0037: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_003c: stloc.2 + IL_003d: ldloc.0 + IL_003e: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_0043: stloc.3 + IL_0044: ldloc.2 + IL_0045: ldloc.3 + IL_0046: cgt + IL_0048: ldloc.2 + IL_0049: ldloc.3 + IL_004a: clt + IL_004c: sub + IL_004d: ret + + IL_004e: ldc.i4.1 + IL_004f: ret + + IL_0050: ldarg.1 + IL_0051: unbox.any assembly/HashMicroPerfAndCodeGenerationTests/KeyR + IL_0056: brfalse.s IL_005a + + IL_0058: ldc.i4.m1 + IL_0059: ret + + IL_005a: ldc.i4.0 + IL_005b: ret + } + + .method public hidebysig virtual final + instance int32 GetHashCode(class [runtime]System.Collections.IEqualityComparer comp) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 7 + .locals init (int32 V_0) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0031 + + IL_0003: ldc.i4.0 + IL_0004: stloc.0 + IL_0005: ldc.i4 0x9e3779b9 + IL_000a: ldarg.0 + IL_000b: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_0010: ldloc.0 + IL_0011: ldc.i4.6 + IL_0012: shl + IL_0013: ldloc.0 + IL_0014: ldc.i4.2 + IL_0015: shr + IL_0016: add + IL_0017: add + IL_0018: add + IL_0019: stloc.0 + IL_001a: ldc.i4 0x9e3779b9 + IL_001f: ldarg.0 + IL_0020: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_0025: ldloc.0 + IL_0026: ldc.i4.6 + IL_0027: shl + IL_0028: ldloc.0 + IL_0029: ldc.i4.2 + IL_002a: shr + IL_002b: add + IL_002c: add + IL_002d: add + IL_002e: stloc.0 + IL_002f: ldloc.0 + IL_0030: ret + + IL_0031: ldc.i4.0 + IL_0032: ret + } + + .method public hidebysig virtual final + instance int32 GetHashCode() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call class [runtime]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer() + IL_0006: callvirt instance int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::GetHashCode(class [runtime]System.Collections.IEqualityComparer) + IL_000b: ret + } + + .method public hidebysig virtual final + instance bool Equals(object obj, + class [runtime]System.Collections.IEqualityComparer comp) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 4 + .locals init (class assembly/HashMicroPerfAndCodeGenerationTests/KeyR V_0) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_002e + + IL_0003: ldarg.1 + IL_0004: isinst assembly/HashMicroPerfAndCodeGenerationTests/KeyR + IL_0009: stloc.0 + IL_000a: ldloc.0 + IL_000b: brfalse.s IL_002c + + IL_000d: ldarg.0 + IL_000e: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_0013: ldloc.0 + IL_0014: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_0019: bne.un.s IL_002a + + IL_001b: ldarg.0 + IL_001c: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_0021: ldloc.0 + IL_0022: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_0027: ceq + IL_0029: ret + + IL_002a: ldc.i4.0 + IL_002b: ret + + IL_002c: ldc.i4.0 + IL_002d: ret + + IL_002e: ldarg.1 + IL_002f: ldnull + IL_0030: cgt.un + IL_0032: ldc.i4.0 + IL_0033: ceq + IL_0035: ret + } + + .method public hidebysig virtual final + instance bool Equals(class assembly/HashMicroPerfAndCodeGenerationTests/KeyR obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0027 + + IL_0003: ldarg.1 + IL_0004: brfalse.s IL_0025 + + IL_0006: ldarg.0 + IL_0007: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_000c: ldarg.1 + IL_000d: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_0012: bne.un.s IL_0023 + + IL_0014: ldarg.0 + IL_0015: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_001a: ldarg.1 + IL_001b: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_0020: ceq + IL_0022: ret + + IL_0023: ldc.i4.0 + IL_0024: ret + + IL_0025: ldc.i4.0 + IL_0026: ret + + IL_0027: ldarg.1 + IL_0028: ldnull + IL_0029: cgt.un + IL_002b: ldc.i4.0 + IL_002c: ceq + IL_002e: ret + } + + .method public hidebysig virtual final + instance bool Equals(object obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 4 + .locals init (class assembly/HashMicroPerfAndCodeGenerationTests/KeyR V_0) + IL_0000: ldarg.1 + IL_0001: isinst assembly/HashMicroPerfAndCodeGenerationTests/KeyR + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: brfalse.s IL_0012 + + IL_000a: ldarg.0 + IL_000b: ldloc.0 + IL_000c: callvirt instance bool assembly/HashMicroPerfAndCodeGenerationTests/KeyR::Equals(class assembly/HashMicroPerfAndCodeGenerationTests/KeyR) + IL_0011: ret + + IL_0012: ldc.i4.0 + IL_0013: ret + } + + .property instance int32 key1() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32) = ( 01 00 04 00 00 00 00 00 00 00 00 00 ) + .get instance int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::get_key1() + } + .property instance int32 key2() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32) = ( 01 00 04 00 00 00 01 00 00 00 00 00 ) + .get instance int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::get_key2() + } + } + + .method public static void f5c() cil managed + { + + .maxstack 4 + .locals init (int32 V_0, + int32 V_1) + IL_0000: nop + IL_0001: ldc.i4.0 + IL_0002: stloc.0 + IL_0003: br.s IL_001b + + IL_0005: ldc.i4.1 + IL_0006: ldc.i4.2 + IL_0007: newobj instance void assembly/HashMicroPerfAndCodeGenerationTests/KeyR::.ctor(int32, + int32) + IL_000c: call class [runtime]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityERComparer() + IL_0011: callvirt instance int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::GetHashCode(class [runtime]System.Collections.IEqualityComparer) + IL_0016: stloc.1 + IL_0017: ldloc.0 + IL_0018: ldc.i4.1 + IL_0019: add + IL_001a: stloc.0 + IL_001b: ldloc.0 + IL_001c: ldc.i4 0x989681 + IL_0021: blt.s IL_0005 + + IL_0023: ret + } + + } + +} + +.class private abstract auto ansi sealed ''.$assembly$fsx + extends [runtime]System.Object +{ + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: ret + } + +} + +.class private auto ansi sealed System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes + extends [runtime]System.Enum +{ + .custom instance void [runtime]System.FlagsAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .field public specialname rtspecialname int32 value__ = int32(0x00000000) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes All = int32(0xFFFFFFFF) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes None = int32(0x00000000) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicParameterlessConstructor = int32(0x00000001) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicConstructors = int32(0x00000003) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicConstructors = int32(0x00000004) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicMethods = int32(0x00000008) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicMethods = int32(0x00000010) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicFields = int32(0x00000020) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicFields = int32(0x00000040) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicNestedTypes = int32(0x00000080) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicNestedTypes = int32(0x00000100) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicProperties = int32(0x00000200) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicProperties = int32(0x00000400) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicEvents = int32(0x00000800) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicEvents = int32(0x00001000) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes Interfaces = int32(0x00002000) +} + +.class private auto ansi beforefieldinit System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute + extends [runtime]System.Attribute +{ + .field private valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes MemberType@ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .field private class [runtime]System.Type Type@ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method public specialname rtspecialname + instance void .ctor(valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes MemberType, + class [runtime]System.Type Type) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void [runtime]System.Attribute::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::MemberType@ + IL_000d: ldarg.0 + IL_000e: ldarg.2 + IL_000f: stfld class [runtime]System.Type System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::Type@ + IL_0014: ret + } + + .method public hidebysig specialname instance class [runtime]System.Type + get_Type() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld class [runtime]System.Type System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::Type@ + IL_0006: ret + } + + .method private hidebysig specialname instance void + set_Type(class [runtime]System.Type 'value') cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: stfld class [runtime]System.Type System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::Type@ + IL_0007: ret + } + + .method public hidebysig specialname instance valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes + get_MemberType() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::MemberType@ + IL_0006: ret + } + + .method private hidebysig specialname instance void + set_MemberType(valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes 'value') cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: stfld valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::MemberType@ + IL_0007: ret + } + + .property instance valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes + MemberType() + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .set instance void System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::set_MemberType(valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes) + .get instance valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::get_MemberType() + } + .property instance class [runtime]System.Type + Type() + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .set instance void System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::set_Type(class [runtime]System.Type) + .get instance class [runtime]System.Type System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::get_Type() + } +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash08.fsx.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash08.fsx.il.netcore.bsl similarity index 95% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash08.fsx.il.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash08.fsx.il.netcore.bsl index cc47d29e1d..1762a69421 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash08.fsx.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash08.fsx.il.netcore.bsl @@ -1,513 +1,518 @@ - - - - - -.assembly extern runtime { } -.assembly extern FSharp.Core { } -.assembly assembly -{ - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32, - int32, - int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 ) - - - - - .hash algorithm 0x00008004 - .ver 0:0:0:0 -} -.mresource public FSharpSignatureData.assembly -{ - - -} -.mresource public FSharpOptimizationData.assembly -{ - - -} -.module assembly.exe - -.imagebase {value} -.file alignment 0x00000200 -.stackreserve 0x00100000 -.subsystem 0x0003 -.corflags 0x00000001 - - - - - -.class public abstract auto ansi sealed assembly - extends [runtime]System.Object -{ - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) - .class abstract auto ansi sealed nested public HashMicroPerfAndCodeGenerationTests - extends [runtime]System.Object - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) - .class auto ansi serializable sealed nested public KeyR - extends [runtime]System.Object - implements class [runtime]System.IEquatable`1, - [runtime]System.Collections.IStructuralEquatable, - class [runtime]System.IComparable`1, - [runtime]System.IComparable, - [runtime]System.Collections.IStructuralComparable - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 02 00 00 00 00 00 ) - .field assembly int32 key1@ - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) - .field assembly int32 key2@ - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) - .method public hidebysig specialname - instance int32 get_key1() cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key1@ - IL_0006: ret - } - - .method public hidebysig specialname - instance int32 get_key2() cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key2@ - IL_0006: ret - } - - .method public specialname rtspecialname - instance void .ctor(int32 key1, - int32 key2) cil managed - { - - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: call instance void [runtime]System.Object::.ctor() - IL_0006: ldarg.0 - IL_0007: ldarg.1 - IL_0008: stfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key1@ - IL_000d: ldarg.0 - IL_000e: ldarg.2 - IL_000f: stfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key2@ - IL_0014: ret - } - - .method public strict virtual instance string - ToString() cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 8 - IL_0000: ldstr "%+A" - IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,class assembly/HashMicroPerfAndCodeGenerationTests/KeyR>::.ctor(string) - IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) - IL_000f: ldarg.0 - IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) - IL_0015: ret - } - - .method public hidebysig virtual final - instance int32 CompareTo(class assembly/HashMicroPerfAndCodeGenerationTests/KeyR obj) cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 5 - .locals init (int32 V_0, - class [runtime]System.Collections.IComparer V_1, - int32 V_2, - int32 V_3) - IL_0000: ldarg.0 - IL_0001: brfalse.s IL_0050 - - IL_0003: ldarg.1 - IL_0004: brfalse.s IL_004e - - IL_0006: call class [runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() - IL_000b: stloc.1 - IL_000c: ldarg.0 - IL_000d: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key1@ - IL_0012: stloc.2 - IL_0013: ldarg.1 - IL_0014: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key1@ - IL_0019: stloc.3 - IL_001a: ldloc.2 - IL_001b: ldloc.3 - IL_001c: cgt - IL_001e: ldloc.2 - IL_001f: ldloc.3 - IL_0020: clt - IL_0022: sub - IL_0023: stloc.0 - IL_0024: ldloc.0 - IL_0025: ldc.i4.0 - IL_0026: bge.s IL_002a - - IL_0028: ldloc.0 - IL_0029: ret - - IL_002a: ldloc.0 - IL_002b: ldc.i4.0 - IL_002c: ble.s IL_0030 - - IL_002e: ldloc.0 - IL_002f: ret - - IL_0030: call class [runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() - IL_0035: stloc.1 - IL_0036: ldarg.0 - IL_0037: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key2@ - IL_003c: stloc.2 - IL_003d: ldarg.1 - IL_003e: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key2@ - IL_0043: stloc.3 - IL_0044: ldloc.2 - IL_0045: ldloc.3 - IL_0046: cgt - IL_0048: ldloc.2 - IL_0049: ldloc.3 - IL_004a: clt - IL_004c: sub - IL_004d: ret - - IL_004e: ldc.i4.1 - IL_004f: ret - - IL_0050: ldarg.1 - IL_0051: brfalse.s IL_0055 - - IL_0053: ldc.i4.m1 - IL_0054: ret - - IL_0055: ldc.i4.0 - IL_0056: ret - } - - .method public hidebysig virtual final - instance int32 CompareTo(object obj) cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: ldarg.1 - IL_0002: unbox.any assembly/HashMicroPerfAndCodeGenerationTests/KeyR - IL_0007: callvirt instance int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::CompareTo(class assembly/HashMicroPerfAndCodeGenerationTests/KeyR) - IL_000c: ret - } - - .method public hidebysig virtual final - instance int32 CompareTo(object obj, - class [runtime]System.Collections.IComparer comp) cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 5 - .locals init (class assembly/HashMicroPerfAndCodeGenerationTests/KeyR V_0, - int32 V_1, - int32 V_2, - int32 V_3) - IL_0000: ldarg.1 - IL_0001: unbox.any assembly/HashMicroPerfAndCodeGenerationTests/KeyR - IL_0006: stloc.0 - IL_0007: ldarg.0 - IL_0008: brfalse.s IL_0050 - - IL_000a: ldarg.1 - IL_000b: unbox.any assembly/HashMicroPerfAndCodeGenerationTests/KeyR - IL_0010: brfalse.s IL_004e - - IL_0012: ldarg.0 - IL_0013: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key1@ - IL_0018: stloc.2 - IL_0019: ldloc.0 - IL_001a: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key1@ - IL_001f: stloc.3 - IL_0020: ldloc.2 - IL_0021: ldloc.3 - IL_0022: cgt - IL_0024: ldloc.2 - IL_0025: ldloc.3 - IL_0026: clt - IL_0028: sub - IL_0029: stloc.1 - IL_002a: ldloc.1 - IL_002b: ldc.i4.0 - IL_002c: bge.s IL_0030 - - IL_002e: ldloc.1 - IL_002f: ret - - IL_0030: ldloc.1 - IL_0031: ldc.i4.0 - IL_0032: ble.s IL_0036 - - IL_0034: ldloc.1 - IL_0035: ret - - IL_0036: ldarg.0 - IL_0037: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key2@ - IL_003c: stloc.2 - IL_003d: ldloc.0 - IL_003e: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key2@ - IL_0043: stloc.3 - IL_0044: ldloc.2 - IL_0045: ldloc.3 - IL_0046: cgt - IL_0048: ldloc.2 - IL_0049: ldloc.3 - IL_004a: clt - IL_004c: sub - IL_004d: ret - - IL_004e: ldc.i4.1 - IL_004f: ret - - IL_0050: ldarg.1 - IL_0051: unbox.any assembly/HashMicroPerfAndCodeGenerationTests/KeyR - IL_0056: brfalse.s IL_005a - - IL_0058: ldc.i4.m1 - IL_0059: ret - - IL_005a: ldc.i4.0 - IL_005b: ret - } - - .method public hidebysig virtual final - instance int32 GetHashCode(class [runtime]System.Collections.IEqualityComparer comp) cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 7 - .locals init (int32 V_0) - IL_0000: ldarg.0 - IL_0001: brfalse.s IL_0031 - - IL_0003: ldc.i4.0 - IL_0004: stloc.0 - IL_0005: ldc.i4 0x9e3779b9 - IL_000a: ldarg.0 - IL_000b: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key2@ - IL_0010: ldloc.0 - IL_0011: ldc.i4.6 - IL_0012: shl - IL_0013: ldloc.0 - IL_0014: ldc.i4.2 - IL_0015: shr - IL_0016: add - IL_0017: add - IL_0018: add - IL_0019: stloc.0 - IL_001a: ldc.i4 0x9e3779b9 - IL_001f: ldarg.0 - IL_0020: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key1@ - IL_0025: ldloc.0 - IL_0026: ldc.i4.6 - IL_0027: shl - IL_0028: ldloc.0 - IL_0029: ldc.i4.2 - IL_002a: shr - IL_002b: add - IL_002c: add - IL_002d: add - IL_002e: stloc.0 - IL_002f: ldloc.0 - IL_0030: ret - - IL_0031: ldc.i4.0 - IL_0032: ret - } - - .method public hidebysig virtual final - instance int32 GetHashCode() cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: call class [runtime]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer() - IL_0006: callvirt instance int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::GetHashCode(class [runtime]System.Collections.IEqualityComparer) - IL_000b: ret - } - - .method public hidebysig virtual final - instance bool Equals(object obj, - class [runtime]System.Collections.IEqualityComparer comp) cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 4 - .locals init (class assembly/HashMicroPerfAndCodeGenerationTests/KeyR V_0) - IL_0000: ldarg.0 - IL_0001: brfalse.s IL_002e - - IL_0003: ldarg.1 - IL_0004: isinst assembly/HashMicroPerfAndCodeGenerationTests/KeyR - IL_0009: stloc.0 - IL_000a: ldloc.0 - IL_000b: brfalse.s IL_002c - - IL_000d: ldarg.0 - IL_000e: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key1@ - IL_0013: ldloc.0 - IL_0014: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key1@ - IL_0019: bne.un.s IL_002a - - IL_001b: ldarg.0 - IL_001c: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key2@ - IL_0021: ldloc.0 - IL_0022: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key2@ - IL_0027: ceq - IL_0029: ret - - IL_002a: ldc.i4.0 - IL_002b: ret - - IL_002c: ldc.i4.0 - IL_002d: ret - - IL_002e: ldarg.1 - IL_002f: ldnull - IL_0030: cgt.un - IL_0032: ldc.i4.0 - IL_0033: ceq - IL_0035: ret - } - - .method public hidebysig virtual final - instance bool Equals(class assembly/HashMicroPerfAndCodeGenerationTests/KeyR obj) cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: brfalse.s IL_0027 - - IL_0003: ldarg.1 - IL_0004: brfalse.s IL_0025 - - IL_0006: ldarg.0 - IL_0007: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key1@ - IL_000c: ldarg.1 - IL_000d: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key1@ - IL_0012: bne.un.s IL_0023 - - IL_0014: ldarg.0 - IL_0015: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key2@ - IL_001a: ldarg.1 - IL_001b: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key2@ - IL_0020: ceq - IL_0022: ret - - IL_0023: ldc.i4.0 - IL_0024: ret - - IL_0025: ldc.i4.0 - IL_0026: ret - - IL_0027: ldarg.1 - IL_0028: ldnull - IL_0029: cgt.un - IL_002b: ldc.i4.0 - IL_002c: ceq - IL_002e: ret - } - - .method public hidebysig virtual final - instance bool Equals(object obj) cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 4 - .locals init (class assembly/HashMicroPerfAndCodeGenerationTests/KeyR V_0) - IL_0000: ldarg.1 - IL_0001: isinst assembly/HashMicroPerfAndCodeGenerationTests/KeyR - IL_0006: stloc.0 - IL_0007: ldloc.0 - IL_0008: brfalse.s IL_0012 - - IL_000a: ldarg.0 - IL_000b: ldloc.0 - IL_000c: callvirt instance bool assembly/HashMicroPerfAndCodeGenerationTests/KeyR::Equals(class assembly/HashMicroPerfAndCodeGenerationTests/KeyR) - IL_0011: ret - - IL_0012: ldc.i4.0 - IL_0013: ret - } - - .property instance int32 key1() - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, - int32) = ( 01 00 04 00 00 00 00 00 00 00 00 00 ) - .get instance int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::get_key1() - } - .property instance int32 key2() - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, - int32) = ( 01 00 04 00 00 00 01 00 00 00 00 00 ) - .get instance int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::get_key2() - } - } - - .method public static void f5c() cil managed - { - - .maxstack 4 - .locals init (int32 V_0, - int32 V_1) - IL_0000: nop - IL_0001: ldc.i4.0 - IL_0002: stloc.0 - IL_0003: br.s IL_001b - - IL_0005: ldc.i4.1 - IL_0006: ldc.i4.2 - IL_0007: newobj instance void assembly/HashMicroPerfAndCodeGenerationTests/KeyR::.ctor(int32, - int32) - IL_000c: call class [runtime]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityERComparer() - IL_0011: callvirt instance int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::GetHashCode(class [runtime]System.Collections.IEqualityComparer) - IL_0016: stloc.1 - IL_0017: ldloc.0 - IL_0018: ldc.i4.1 - IL_0019: add - IL_001a: stloc.0 - IL_001b: ldloc.0 - IL_001c: ldc.i4 0x989681 - IL_0021: blt.s IL_0005 - - IL_0023: ret - } - - } - -} - -.class private abstract auto ansi sealed ''.$assembly$fsx - extends [runtime]System.Object -{ - .method public static void main@() cil managed - { - .entrypoint - - .maxstack 8 - IL_0000: ret - } - -} - - - - - - + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly assembly +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32, + int32, + int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 ) + + + + + .hash algorithm 0x00008004 + .ver 0:0:0:0 +} +.mresource public FSharpSignatureData.assembly +{ + + +} +.mresource public FSharpOptimizationData.assembly +{ + + +} +.module assembly.exe + +.imagebase {value} +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 +.corflags 0x00000001 + + + + + +.class public abstract auto ansi sealed assembly + extends [runtime]System.Object +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .class abstract auto ansi sealed nested public HashMicroPerfAndCodeGenerationTests + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .class auto ansi serializable sealed nested public KeyR + extends [runtime]System.Object + implements class [runtime]System.IEquatable`1, + [runtime]System.Collections.IStructuralEquatable, + class [runtime]System.IComparable`1, + [runtime]System.IComparable, + [runtime]System.Collections.IStructuralComparable + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 02 00 00 00 00 00 ) + .field assembly int32 key1@ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .field assembly int32 key2@ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .method public hidebysig specialname + instance int32 get_key1() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_0006: ret + } + + .method public hidebysig specialname + instance int32 get_key2() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_0006: ret + } + + .method public specialname rtspecialname + instance void .ctor(int32 key1, + int32 key2) cil managed + { + .custom instance void [runtime]System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::.ctor(valuetype [runtime]System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes, + class [runtime]System.Type) = ( 01 00 60 06 00 00 2F 48 61 73 68 30 38 2B 48 61 + 73 68 4D 69 63 72 6F 50 65 72 66 41 6E 64 43 6F + 64 65 47 65 6E 65 72 61 74 69 6F 6E 54 65 73 74 + 73 2B 4B 65 79 52 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void [runtime]System.Object::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_000d: ldarg.0 + IL_000e: ldarg.2 + IL_000f: stfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_0014: ret + } + + .method public strict virtual instance string + ToString() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldstr "%+A" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,class assembly/HashMicroPerfAndCodeGenerationTests/KeyR>::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_000f: ldarg.0 + IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0015: ret + } + + .method public hidebysig virtual final + instance int32 CompareTo(class assembly/HashMicroPerfAndCodeGenerationTests/KeyR obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 5 + .locals init (int32 V_0, + class [runtime]System.Collections.IComparer V_1, + int32 V_2, + int32 V_3) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0050 + + IL_0003: ldarg.1 + IL_0004: brfalse.s IL_004e + + IL_0006: call class [runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() + IL_000b: stloc.1 + IL_000c: ldarg.0 + IL_000d: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_0012: stloc.2 + IL_0013: ldarg.1 + IL_0014: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_0019: stloc.3 + IL_001a: ldloc.2 + IL_001b: ldloc.3 + IL_001c: cgt + IL_001e: ldloc.2 + IL_001f: ldloc.3 + IL_0020: clt + IL_0022: sub + IL_0023: stloc.0 + IL_0024: ldloc.0 + IL_0025: ldc.i4.0 + IL_0026: bge.s IL_002a + + IL_0028: ldloc.0 + IL_0029: ret + + IL_002a: ldloc.0 + IL_002b: ldc.i4.0 + IL_002c: ble.s IL_0030 + + IL_002e: ldloc.0 + IL_002f: ret + + IL_0030: call class [runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() + IL_0035: stloc.1 + IL_0036: ldarg.0 + IL_0037: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_003c: stloc.2 + IL_003d: ldarg.1 + IL_003e: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_0043: stloc.3 + IL_0044: ldloc.2 + IL_0045: ldloc.3 + IL_0046: cgt + IL_0048: ldloc.2 + IL_0049: ldloc.3 + IL_004a: clt + IL_004c: sub + IL_004d: ret + + IL_004e: ldc.i4.1 + IL_004f: ret + + IL_0050: ldarg.1 + IL_0051: brfalse.s IL_0055 + + IL_0053: ldc.i4.m1 + IL_0054: ret + + IL_0055: ldc.i4.0 + IL_0056: ret + } + + .method public hidebysig virtual final + instance int32 CompareTo(object obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: unbox.any assembly/HashMicroPerfAndCodeGenerationTests/KeyR + IL_0007: callvirt instance int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::CompareTo(class assembly/HashMicroPerfAndCodeGenerationTests/KeyR) + IL_000c: ret + } + + .method public hidebysig virtual final + instance int32 CompareTo(object obj, + class [runtime]System.Collections.IComparer comp) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 5 + .locals init (class assembly/HashMicroPerfAndCodeGenerationTests/KeyR V_0, + int32 V_1, + int32 V_2, + int32 V_3) + IL_0000: ldarg.1 + IL_0001: unbox.any assembly/HashMicroPerfAndCodeGenerationTests/KeyR + IL_0006: stloc.0 + IL_0007: ldarg.0 + IL_0008: brfalse.s IL_0050 + + IL_000a: ldarg.1 + IL_000b: unbox.any assembly/HashMicroPerfAndCodeGenerationTests/KeyR + IL_0010: brfalse.s IL_004e + + IL_0012: ldarg.0 + IL_0013: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_0018: stloc.2 + IL_0019: ldloc.0 + IL_001a: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_001f: stloc.3 + IL_0020: ldloc.2 + IL_0021: ldloc.3 + IL_0022: cgt + IL_0024: ldloc.2 + IL_0025: ldloc.3 + IL_0026: clt + IL_0028: sub + IL_0029: stloc.1 + IL_002a: ldloc.1 + IL_002b: ldc.i4.0 + IL_002c: bge.s IL_0030 + + IL_002e: ldloc.1 + IL_002f: ret + + IL_0030: ldloc.1 + IL_0031: ldc.i4.0 + IL_0032: ble.s IL_0036 + + IL_0034: ldloc.1 + IL_0035: ret + + IL_0036: ldarg.0 + IL_0037: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_003c: stloc.2 + IL_003d: ldloc.0 + IL_003e: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_0043: stloc.3 + IL_0044: ldloc.2 + IL_0045: ldloc.3 + IL_0046: cgt + IL_0048: ldloc.2 + IL_0049: ldloc.3 + IL_004a: clt + IL_004c: sub + IL_004d: ret + + IL_004e: ldc.i4.1 + IL_004f: ret + + IL_0050: ldarg.1 + IL_0051: unbox.any assembly/HashMicroPerfAndCodeGenerationTests/KeyR + IL_0056: brfalse.s IL_005a + + IL_0058: ldc.i4.m1 + IL_0059: ret + + IL_005a: ldc.i4.0 + IL_005b: ret + } + + .method public hidebysig virtual final + instance int32 GetHashCode(class [runtime]System.Collections.IEqualityComparer comp) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 7 + .locals init (int32 V_0) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0031 + + IL_0003: ldc.i4.0 + IL_0004: stloc.0 + IL_0005: ldc.i4 0x9e3779b9 + IL_000a: ldarg.0 + IL_000b: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_0010: ldloc.0 + IL_0011: ldc.i4.6 + IL_0012: shl + IL_0013: ldloc.0 + IL_0014: ldc.i4.2 + IL_0015: shr + IL_0016: add + IL_0017: add + IL_0018: add + IL_0019: stloc.0 + IL_001a: ldc.i4 0x9e3779b9 + IL_001f: ldarg.0 + IL_0020: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_0025: ldloc.0 + IL_0026: ldc.i4.6 + IL_0027: shl + IL_0028: ldloc.0 + IL_0029: ldc.i4.2 + IL_002a: shr + IL_002b: add + IL_002c: add + IL_002d: add + IL_002e: stloc.0 + IL_002f: ldloc.0 + IL_0030: ret + + IL_0031: ldc.i4.0 + IL_0032: ret + } + + .method public hidebysig virtual final + instance int32 GetHashCode() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call class [runtime]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer() + IL_0006: callvirt instance int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::GetHashCode(class [runtime]System.Collections.IEqualityComparer) + IL_000b: ret + } + + .method public hidebysig virtual final + instance bool Equals(object obj, + class [runtime]System.Collections.IEqualityComparer comp) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 4 + .locals init (class assembly/HashMicroPerfAndCodeGenerationTests/KeyR V_0) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_002e + + IL_0003: ldarg.1 + IL_0004: isinst assembly/HashMicroPerfAndCodeGenerationTests/KeyR + IL_0009: stloc.0 + IL_000a: ldloc.0 + IL_000b: brfalse.s IL_002c + + IL_000d: ldarg.0 + IL_000e: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_0013: ldloc.0 + IL_0014: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_0019: bne.un.s IL_002a + + IL_001b: ldarg.0 + IL_001c: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_0021: ldloc.0 + IL_0022: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_0027: ceq + IL_0029: ret + + IL_002a: ldc.i4.0 + IL_002b: ret + + IL_002c: ldc.i4.0 + IL_002d: ret + + IL_002e: ldarg.1 + IL_002f: ldnull + IL_0030: cgt.un + IL_0032: ldc.i4.0 + IL_0033: ceq + IL_0035: ret + } + + .method public hidebysig virtual final + instance bool Equals(class assembly/HashMicroPerfAndCodeGenerationTests/KeyR obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0027 + + IL_0003: ldarg.1 + IL_0004: brfalse.s IL_0025 + + IL_0006: ldarg.0 + IL_0007: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_000c: ldarg.1 + IL_000d: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key1@ + IL_0012: bne.un.s IL_0023 + + IL_0014: ldarg.0 + IL_0015: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_001a: ldarg.1 + IL_001b: ldfld int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::key2@ + IL_0020: ceq + IL_0022: ret + + IL_0023: ldc.i4.0 + IL_0024: ret + + IL_0025: ldc.i4.0 + IL_0026: ret + + IL_0027: ldarg.1 + IL_0028: ldnull + IL_0029: cgt.un + IL_002b: ldc.i4.0 + IL_002c: ceq + IL_002e: ret + } + + .method public hidebysig virtual final + instance bool Equals(object obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 4 + .locals init (class assembly/HashMicroPerfAndCodeGenerationTests/KeyR V_0) + IL_0000: ldarg.1 + IL_0001: isinst assembly/HashMicroPerfAndCodeGenerationTests/KeyR + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: brfalse.s IL_0012 + + IL_000a: ldarg.0 + IL_000b: ldloc.0 + IL_000c: callvirt instance bool assembly/HashMicroPerfAndCodeGenerationTests/KeyR::Equals(class assembly/HashMicroPerfAndCodeGenerationTests/KeyR) + IL_0011: ret + + IL_0012: ldc.i4.0 + IL_0013: ret + } + + .property instance int32 key1() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32) = ( 01 00 04 00 00 00 00 00 00 00 00 00 ) + .get instance int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::get_key1() + } + .property instance int32 key2() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32) = ( 01 00 04 00 00 00 01 00 00 00 00 00 ) + .get instance int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::get_key2() + } + } + + .method public static void f5c() cil managed + { + + .maxstack 4 + .locals init (int32 V_0, + int32 V_1) + IL_0000: nop + IL_0001: ldc.i4.0 + IL_0002: stloc.0 + IL_0003: br.s IL_001b + + IL_0005: ldc.i4.1 + IL_0006: ldc.i4.2 + IL_0007: newobj instance void assembly/HashMicroPerfAndCodeGenerationTests/KeyR::.ctor(int32, + int32) + IL_000c: call class [runtime]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityERComparer() + IL_0011: callvirt instance int32 assembly/HashMicroPerfAndCodeGenerationTests/KeyR::GetHashCode(class [runtime]System.Collections.IEqualityComparer) + IL_0016: stloc.1 + IL_0017: ldloc.0 + IL_0018: ldc.i4.1 + IL_0019: add + IL_001a: stloc.0 + IL_001b: ldloc.0 + IL_001c: ldc.i4 0x989681 + IL_0021: blt.s IL_0005 + + IL_0023: ret + } + + } + +} + +.class private abstract auto ansi sealed ''.$assembly$fsx + extends [runtime]System.Object +{ + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.net472.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.net472.debug.bsl new file mode 100644 index 0000000000..8da825a750 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.net472.debug.bsl @@ -0,0 +1,716 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly assembly +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32, + int32, + int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 ) + + + + + .hash algorithm 0x00008004 + .ver 0:0:0:0 +} +.mresource public FSharpSignatureData.assembly +{ + + +} +.mresource public FSharpOptimizationData.assembly +{ + + +} +.module assembly.exe + +.imagebase {value} +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 +.corflags 0x00000001 + + + + + +.class public abstract auto ansi sealed assembly + extends [runtime]System.Object +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .class auto ansi serializable sealed nested public R + extends [runtime]System.Object + implements class [runtime]System.IEquatable`1, + [runtime]System.Collections.IStructuralEquatable, + class [runtime]System.IComparable`1, + [runtime]System.IComparable, + [runtime]System.Collections.IStructuralComparable + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 02 00 00 00 00 00 ) + .field assembly int32 x@ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .field assembly int32 y@ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .method public hidebysig specialname + instance int32 get_x() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 assembly/R::x@ + IL_0006: ret + } + + .method public hidebysig specialname + instance int32 get_y() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 assembly/R::y@ + IL_0006: ret + } + + .method public specialname rtspecialname + instance void .ctor(int32 x, + int32 y) cil managed + { + .custom instance void System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::.ctor(valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes, + class [runtime]System.Type) = ( 01 00 60 06 00 00 10 54 65 73 74 46 75 6E 63 74 + 69 6F 6E 31 37 2B 52 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void [runtime]System.Object::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld int32 assembly/R::x@ + IL_000d: ldarg.0 + IL_000e: ldarg.2 + IL_000f: stfld int32 assembly/R::y@ + IL_0014: ret + } + + .method public strict virtual instance string + ToString() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldstr "%+A" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,class assembly/R>::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_000f: ldarg.0 + IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0015: ret + } + + .method public hidebysig virtual final + instance int32 CompareTo(class assembly/R obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 5 + .locals init (int32 V_0, + class [runtime]System.Collections.IComparer V_1, + int32 V_2, + int32 V_3, + class [runtime]System.Collections.IComparer V_4, + int32 V_5, + int32 V_6, + class [runtime]System.Collections.IComparer V_7, + int32 V_8, + int32 V_9, + class [runtime]System.Collections.IComparer V_10, + int32 V_11, + int32 V_12) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0070 + + IL_0003: ldarg.1 + IL_0004: brfalse.s IL_006e + + IL_0006: call class [runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() + IL_000b: stloc.1 + IL_000c: ldarg.0 + IL_000d: ldfld int32 assembly/R::x@ + IL_0012: stloc.2 + IL_0013: ldarg.1 + IL_0014: ldfld int32 assembly/R::x@ + IL_0019: stloc.3 + IL_001a: ldloc.1 + IL_001b: stloc.s V_4 + IL_001d: ldloc.2 + IL_001e: stloc.s V_5 + IL_0020: ldloc.3 + IL_0021: stloc.s V_6 + IL_0023: ldloc.s V_5 + IL_0025: ldloc.s V_6 + IL_0027: cgt + IL_0029: ldloc.s V_5 + IL_002b: ldloc.s V_6 + IL_002d: clt + IL_002f: sub + IL_0030: stloc.0 + IL_0031: ldloc.0 + IL_0032: ldc.i4.0 + IL_0033: bge.s IL_0037 + + IL_0035: ldloc.0 + IL_0036: ret + + IL_0037: ldloc.0 + IL_0038: ldc.i4.0 + IL_0039: ble.s IL_003d + + IL_003b: ldloc.0 + IL_003c: ret + + IL_003d: call class [runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() + IL_0042: stloc.s V_7 + IL_0044: ldarg.0 + IL_0045: ldfld int32 assembly/R::y@ + IL_004a: stloc.s V_8 + IL_004c: ldarg.1 + IL_004d: ldfld int32 assembly/R::y@ + IL_0052: stloc.s V_9 + IL_0054: ldloc.s V_7 + IL_0056: stloc.s V_10 + IL_0058: ldloc.s V_8 + IL_005a: stloc.s V_11 + IL_005c: ldloc.s V_9 + IL_005e: stloc.s V_12 + IL_0060: ldloc.s V_11 + IL_0062: ldloc.s V_12 + IL_0064: cgt + IL_0066: ldloc.s V_11 + IL_0068: ldloc.s V_12 + IL_006a: clt + IL_006c: sub + IL_006d: ret + + IL_006e: ldc.i4.1 + IL_006f: ret + + IL_0070: ldarg.1 + IL_0071: brfalse.s IL_0075 + + IL_0073: ldc.i4.m1 + IL_0074: ret + + IL_0075: ldc.i4.0 + IL_0076: ret + } + + .method public hidebysig virtual final + instance int32 CompareTo(object obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: unbox.any assembly/R + IL_0007: callvirt instance int32 assembly/R::CompareTo(class assembly/R) + IL_000c: ret + } + + .method public hidebysig virtual final + instance int32 CompareTo(object obj, + class [runtime]System.Collections.IComparer comp) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 5 + .locals init (class assembly/R V_0, + class assembly/R V_1, + int32 V_2, + class [runtime]System.Collections.IComparer V_3, + int32 V_4, + int32 V_5, + class [runtime]System.Collections.IComparer V_6, + int32 V_7, + int32 V_8, + class [runtime]System.Collections.IComparer V_9, + int32 V_10, + int32 V_11, + class [runtime]System.Collections.IComparer V_12, + int32 V_13, + int32 V_14) + IL_0000: ldarg.1 + IL_0001: unbox.any assembly/R + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: stloc.1 + IL_0009: ldarg.0 + IL_000a: brfalse.s IL_007a + + IL_000c: ldarg.1 + IL_000d: unbox.any assembly/R + IL_0012: brfalse.s IL_0078 + + IL_0014: ldarg.2 + IL_0015: stloc.3 + IL_0016: ldarg.0 + IL_0017: ldfld int32 assembly/R::x@ + IL_001c: stloc.s V_4 + IL_001e: ldloc.1 + IL_001f: ldfld int32 assembly/R::x@ + IL_0024: stloc.s V_5 + IL_0026: ldloc.3 + IL_0027: stloc.s V_6 + IL_0029: ldloc.s V_4 + IL_002b: stloc.s V_7 + IL_002d: ldloc.s V_5 + IL_002f: stloc.s V_8 + IL_0031: ldloc.s V_7 + IL_0033: ldloc.s V_8 + IL_0035: cgt + IL_0037: ldloc.s V_7 + IL_0039: ldloc.s V_8 + IL_003b: clt + IL_003d: sub + IL_003e: stloc.2 + IL_003f: ldloc.2 + IL_0040: ldc.i4.0 + IL_0041: bge.s IL_0045 + + IL_0043: ldloc.2 + IL_0044: ret + + IL_0045: ldloc.2 + IL_0046: ldc.i4.0 + IL_0047: ble.s IL_004b + + IL_0049: ldloc.2 + IL_004a: ret + + IL_004b: ldarg.2 + IL_004c: stloc.s V_9 + IL_004e: ldarg.0 + IL_004f: ldfld int32 assembly/R::y@ + IL_0054: stloc.s V_10 + IL_0056: ldloc.1 + IL_0057: ldfld int32 assembly/R::y@ + IL_005c: stloc.s V_11 + IL_005e: ldloc.s V_9 + IL_0060: stloc.s V_12 + IL_0062: ldloc.s V_10 + IL_0064: stloc.s V_13 + IL_0066: ldloc.s V_11 + IL_0068: stloc.s V_14 + IL_006a: ldloc.s V_13 + IL_006c: ldloc.s V_14 + IL_006e: cgt + IL_0070: ldloc.s V_13 + IL_0072: ldloc.s V_14 + IL_0074: clt + IL_0076: sub + IL_0077: ret + + IL_0078: ldc.i4.1 + IL_0079: ret + + IL_007a: ldarg.1 + IL_007b: unbox.any assembly/R + IL_0080: brfalse.s IL_0084 + + IL_0082: ldc.i4.m1 + IL_0083: ret + + IL_0084: ldc.i4.0 + IL_0085: ret + } + + .method public hidebysig virtual final + instance int32 GetHashCode(class [runtime]System.Collections.IEqualityComparer comp) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 7 + .locals init (int32 V_0, + class [runtime]System.Collections.IEqualityComparer V_1, + int32 V_2, + class [runtime]System.Collections.IEqualityComparer V_3, + class [runtime]System.Collections.IEqualityComparer V_4, + int32 V_5, + class [runtime]System.Collections.IEqualityComparer V_6) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0042 + + IL_0003: ldc.i4.0 + IL_0004: stloc.0 + IL_0005: ldc.i4 0x9e3779b9 + IL_000a: ldarg.1 + IL_000b: stloc.1 + IL_000c: ldarg.0 + IL_000d: ldfld int32 assembly/R::y@ + IL_0012: stloc.2 + IL_0013: ldloc.1 + IL_0014: stloc.3 + IL_0015: ldloc.2 + IL_0016: ldloc.0 + IL_0017: ldc.i4.6 + IL_0018: shl + IL_0019: ldloc.0 + IL_001a: ldc.i4.2 + IL_001b: shr + IL_001c: add + IL_001d: add + IL_001e: add + IL_001f: stloc.0 + IL_0020: ldc.i4 0x9e3779b9 + IL_0025: ldarg.1 + IL_0026: stloc.s V_4 + IL_0028: ldarg.0 + IL_0029: ldfld int32 assembly/R::x@ + IL_002e: stloc.s V_5 + IL_0030: ldloc.s V_4 + IL_0032: stloc.s V_6 + IL_0034: ldloc.s V_5 + IL_0036: ldloc.0 + IL_0037: ldc.i4.6 + IL_0038: shl + IL_0039: ldloc.0 + IL_003a: ldc.i4.2 + IL_003b: shr + IL_003c: add + IL_003d: add + IL_003e: add + IL_003f: stloc.0 + IL_0040: ldloc.0 + IL_0041: ret + + IL_0042: ldc.i4.0 + IL_0043: ret + } + + .method public hidebysig virtual final + instance int32 GetHashCode() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call class [runtime]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer() + IL_0006: callvirt instance int32 assembly/R::GetHashCode(class [runtime]System.Collections.IEqualityComparer) + IL_000b: ret + } + + .method public hidebysig virtual final + instance bool Equals(object obj, + class [runtime]System.Collections.IEqualityComparer comp) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 4 + .locals init (class assembly/R V_0, + class assembly/R V_1, + class [runtime]System.Collections.IEqualityComparer V_2, + int32 V_3, + int32 V_4, + class [runtime]System.Collections.IEqualityComparer V_5, + class [runtime]System.Collections.IEqualityComparer V_6, + int32 V_7, + int32 V_8, + class [runtime]System.Collections.IEqualityComparer V_9) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_004c + + IL_0003: ldarg.1 + IL_0004: isinst assembly/R + IL_0009: stloc.0 + IL_000a: ldloc.0 + IL_000b: brfalse.s IL_004a + + IL_000d: ldloc.0 + IL_000e: stloc.1 + IL_000f: ldarg.2 + IL_0010: stloc.2 + IL_0011: ldarg.0 + IL_0012: ldfld int32 assembly/R::x@ + IL_0017: stloc.3 + IL_0018: ldloc.1 + IL_0019: ldfld int32 assembly/R::x@ + IL_001e: stloc.s V_4 + IL_0020: ldloc.2 + IL_0021: stloc.s V_5 + IL_0023: ldloc.3 + IL_0024: ldloc.s V_4 + IL_0026: ceq + IL_0028: brfalse.s IL_0048 + + IL_002a: ldarg.2 + IL_002b: stloc.s V_6 + IL_002d: ldarg.0 + IL_002e: ldfld int32 assembly/R::y@ + IL_0033: stloc.s V_7 + IL_0035: ldloc.1 + IL_0036: ldfld int32 assembly/R::y@ + IL_003b: stloc.s V_8 + IL_003d: ldloc.s V_6 + IL_003f: stloc.s V_9 + IL_0041: ldloc.s V_7 + IL_0043: ldloc.s V_8 + IL_0045: ceq + IL_0047: ret + + IL_0048: ldc.i4.0 + IL_0049: ret + + IL_004a: ldc.i4.0 + IL_004b: ret + + IL_004c: ldarg.1 + IL_004d: ldnull + IL_004e: cgt.un + IL_0050: ldc.i4.0 + IL_0051: ceq + IL_0053: ret + } + + .method public hidebysig virtual final + instance bool Equals(class assembly/R obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0027 + + IL_0003: ldarg.1 + IL_0004: brfalse.s IL_0025 + + IL_0006: ldarg.0 + IL_0007: ldfld int32 assembly/R::x@ + IL_000c: ldarg.1 + IL_000d: ldfld int32 assembly/R::x@ + IL_0012: bne.un.s IL_0023 + + IL_0014: ldarg.0 + IL_0015: ldfld int32 assembly/R::y@ + IL_001a: ldarg.1 + IL_001b: ldfld int32 assembly/R::y@ + IL_0020: ceq + IL_0022: ret + + IL_0023: ldc.i4.0 + IL_0024: ret + + IL_0025: ldc.i4.0 + IL_0026: ret + + IL_0027: ldarg.1 + IL_0028: ldnull + IL_0029: cgt.un + IL_002b: ldc.i4.0 + IL_002c: ceq + IL_002e: ret + } + + .method public hidebysig virtual final + instance bool Equals(object obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 4 + .locals init (class assembly/R V_0) + IL_0000: ldarg.1 + IL_0001: isinst assembly/R + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: brfalse.s IL_0012 + + IL_000a: ldarg.0 + IL_000b: ldloc.0 + IL_000c: callvirt instance bool assembly/R::Equals(class assembly/R) + IL_0011: ret + + IL_0012: ldc.i4.0 + IL_0013: ret + } + + .property instance int32 x() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32) = ( 01 00 04 00 00 00 00 00 00 00 00 00 ) + .get instance int32 assembly/R::get_x() + } + .property instance int32 y() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32) = ( 01 00 04 00 00 00 01 00 00 00 00 00 ) + .get instance int32 assembly/R::get_y() + } + } + + .method public static class [runtime]System.Tuple`2 + assembly(int32 inp) cil managed + { + + .maxstack 4 + .locals init (class assembly/R V_0) + IL_0000: ldc.i4.3 + IL_0001: ldarg.0 + IL_0002: newobj instance void assembly/R::.ctor(int32, + int32) + IL_0007: stloc.0 + IL_0008: ldloc.0 + IL_0009: ldloc.0 + IL_000a: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, + !1) + IL_000f: ret + } + +} + +.class private abstract auto ansi sealed ''.$assembly + extends [runtime]System.Object +{ + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: ret + } + +} + +.class private auto ansi sealed System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes + extends [runtime]System.Enum +{ + .custom instance void [runtime]System.FlagsAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .field public specialname rtspecialname int32 value__ = int32(0x00000000) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes All = int32(0xFFFFFFFF) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes None = int32(0x00000000) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicParameterlessConstructor = int32(0x00000001) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicConstructors = int32(0x00000003) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicConstructors = int32(0x00000004) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicMethods = int32(0x00000008) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicMethods = int32(0x00000010) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicFields = int32(0x00000020) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicFields = int32(0x00000040) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicNestedTypes = int32(0x00000080) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicNestedTypes = int32(0x00000100) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicProperties = int32(0x00000200) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicProperties = int32(0x00000400) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicEvents = int32(0x00000800) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicEvents = int32(0x00001000) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes Interfaces = int32(0x00002000) +} + +.class private auto ansi beforefieldinit System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute + extends [runtime]System.Attribute +{ + .field private valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes MemberType@ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .field private class [runtime]System.Type Type@ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method public specialname rtspecialname + instance void .ctor(valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes MemberType, + class [runtime]System.Type Type) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void [runtime]System.Attribute::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::MemberType@ + IL_000d: ldarg.0 + IL_000e: ldarg.2 + IL_000f: stfld class [runtime]System.Type System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::Type@ + IL_0014: ret + } + + .method public hidebysig specialname instance class [runtime]System.Type + get_Type() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld class [runtime]System.Type System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::Type@ + IL_0006: ret + } + + .method private hidebysig specialname instance void + set_Type(class [runtime]System.Type 'value') cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: stfld class [runtime]System.Type System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::Type@ + IL_0007: ret + } + + .method public hidebysig specialname instance valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes + get_MemberType() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::MemberType@ + IL_0006: ret + } + + .method private hidebysig specialname instance void + set_MemberType(valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes 'value') cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: stfld valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::MemberType@ + IL_0007: ret + } + + .property instance valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes + MemberType() + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .set instance void System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::set_MemberType(valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes) + .get instance valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::get_MemberType() + } + .property instance class [runtime]System.Type + Type() + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .set instance void System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::set_Type(class [runtime]System.Type) + .get instance class [runtime]System.Type System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::get_Type() + } +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.net472.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.net472.release.bsl new file mode 100644 index 0000000000..2798b0c326 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.net472.release.bsl @@ -0,0 +1,650 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly assembly +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32, + int32, + int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 ) + + + + + .hash algorithm 0x00008004 + .ver 0:0:0:0 +} +.mresource public FSharpSignatureData.assembly +{ + + +} +.mresource public FSharpOptimizationData.assembly +{ + + +} +.module assembly.exe + +.imagebase {value} +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 +.corflags 0x00000001 + + + + + +.class public abstract auto ansi sealed assembly + extends [runtime]System.Object +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .class auto ansi serializable sealed nested public R + extends [runtime]System.Object + implements class [runtime]System.IEquatable`1, + [runtime]System.Collections.IStructuralEquatable, + class [runtime]System.IComparable`1, + [runtime]System.IComparable, + [runtime]System.Collections.IStructuralComparable + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 02 00 00 00 00 00 ) + .field assembly int32 x@ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .field assembly int32 y@ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .method public hidebysig specialname + instance int32 get_x() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 assembly/R::x@ + IL_0006: ret + } + + .method public hidebysig specialname + instance int32 get_y() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 assembly/R::y@ + IL_0006: ret + } + + .method public specialname rtspecialname + instance void .ctor(int32 x, + int32 y) cil managed + { + .custom instance void System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::.ctor(valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes, + class [runtime]System.Type) = ( 01 00 60 06 00 00 10 54 65 73 74 46 75 6E 63 74 + 69 6F 6E 31 37 2B 52 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void [runtime]System.Object::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld int32 assembly/R::x@ + IL_000d: ldarg.0 + IL_000e: ldarg.2 + IL_000f: stfld int32 assembly/R::y@ + IL_0014: ret + } + + .method public strict virtual instance string + ToString() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldstr "%+A" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,class assembly/R>::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_000f: ldarg.0 + IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0015: ret + } + + .method public hidebysig virtual final + instance int32 CompareTo(class assembly/R obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 5 + .locals init (int32 V_0, + class [runtime]System.Collections.IComparer V_1, + int32 V_2, + int32 V_3, + class [runtime]System.Collections.IComparer V_4, + int32 V_5, + int32 V_6) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0057 + + IL_0003: ldarg.1 + IL_0004: brfalse.s IL_0055 + + IL_0006: call class [runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() + IL_000b: stloc.1 + IL_000c: ldarg.0 + IL_000d: ldfld int32 assembly/R::x@ + IL_0012: stloc.2 + IL_0013: ldarg.1 + IL_0014: ldfld int32 assembly/R::x@ + IL_0019: stloc.3 + IL_001a: ldloc.2 + IL_001b: ldloc.3 + IL_001c: cgt + IL_001e: ldloc.2 + IL_001f: ldloc.3 + IL_0020: clt + IL_0022: sub + IL_0023: stloc.0 + IL_0024: ldloc.0 + IL_0025: ldc.i4.0 + IL_0026: bge.s IL_002a + + IL_0028: ldloc.0 + IL_0029: ret + + IL_002a: ldloc.0 + IL_002b: ldc.i4.0 + IL_002c: ble.s IL_0030 + + IL_002e: ldloc.0 + IL_002f: ret + + IL_0030: call class [runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() + IL_0035: stloc.s V_4 + IL_0037: ldarg.0 + IL_0038: ldfld int32 assembly/R::y@ + IL_003d: stloc.s V_5 + IL_003f: ldarg.1 + IL_0040: ldfld int32 assembly/R::y@ + IL_0045: stloc.s V_6 + IL_0047: ldloc.s V_5 + IL_0049: ldloc.s V_6 + IL_004b: cgt + IL_004d: ldloc.s V_5 + IL_004f: ldloc.s V_6 + IL_0051: clt + IL_0053: sub + IL_0054: ret + + IL_0055: ldc.i4.1 + IL_0056: ret + + IL_0057: ldarg.1 + IL_0058: brfalse.s IL_005c + + IL_005a: ldc.i4.m1 + IL_005b: ret + + IL_005c: ldc.i4.0 + IL_005d: ret + } + + .method public hidebysig virtual final + instance int32 CompareTo(object obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: unbox.any assembly/R + IL_0007: callvirt instance int32 assembly/R::CompareTo(class assembly/R) + IL_000c: ret + } + + .method public hidebysig virtual final + instance int32 CompareTo(object obj, + class [runtime]System.Collections.IComparer comp) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 5 + .locals init (class assembly/R V_0, + class assembly/R V_1, + int32 V_2, + class [runtime]System.Collections.IComparer V_3, + int32 V_4, + int32 V_5, + class [runtime]System.Collections.IComparer V_6, + int32 V_7, + int32 V_8) + IL_0000: ldarg.1 + IL_0001: unbox.any assembly/R + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: stloc.1 + IL_0009: ldarg.0 + IL_000a: brfalse.s IL_0063 + + IL_000c: ldarg.1 + IL_000d: unbox.any assembly/R + IL_0012: brfalse.s IL_0061 + + IL_0014: ldarg.2 + IL_0015: stloc.3 + IL_0016: ldarg.0 + IL_0017: ldfld int32 assembly/R::x@ + IL_001c: stloc.s V_4 + IL_001e: ldloc.1 + IL_001f: ldfld int32 assembly/R::x@ + IL_0024: stloc.s V_5 + IL_0026: ldloc.s V_4 + IL_0028: ldloc.s V_5 + IL_002a: cgt + IL_002c: ldloc.s V_4 + IL_002e: ldloc.s V_5 + IL_0030: clt + IL_0032: sub + IL_0033: stloc.2 + IL_0034: ldloc.2 + IL_0035: ldc.i4.0 + IL_0036: bge.s IL_003a + + IL_0038: ldloc.2 + IL_0039: ret + + IL_003a: ldloc.2 + IL_003b: ldc.i4.0 + IL_003c: ble.s IL_0040 + + IL_003e: ldloc.2 + IL_003f: ret + + IL_0040: ldarg.2 + IL_0041: stloc.s V_6 + IL_0043: ldarg.0 + IL_0044: ldfld int32 assembly/R::y@ + IL_0049: stloc.s V_7 + IL_004b: ldloc.1 + IL_004c: ldfld int32 assembly/R::y@ + IL_0051: stloc.s V_8 + IL_0053: ldloc.s V_7 + IL_0055: ldloc.s V_8 + IL_0057: cgt + IL_0059: ldloc.s V_7 + IL_005b: ldloc.s V_8 + IL_005d: clt + IL_005f: sub + IL_0060: ret + + IL_0061: ldc.i4.1 + IL_0062: ret + + IL_0063: ldarg.1 + IL_0064: unbox.any assembly/R + IL_0069: brfalse.s IL_006d + + IL_006b: ldc.i4.m1 + IL_006c: ret + + IL_006d: ldc.i4.0 + IL_006e: ret + } + + .method public hidebysig virtual final + instance int32 GetHashCode(class [runtime]System.Collections.IEqualityComparer comp) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 7 + .locals init (int32 V_0, + class [runtime]System.Collections.IEqualityComparer V_1, + class [runtime]System.Collections.IEqualityComparer V_2) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0035 + + IL_0003: ldc.i4.0 + IL_0004: stloc.0 + IL_0005: ldc.i4 0x9e3779b9 + IL_000a: ldarg.1 + IL_000b: stloc.1 + IL_000c: ldarg.0 + IL_000d: ldfld int32 assembly/R::y@ + IL_0012: ldloc.0 + IL_0013: ldc.i4.6 + IL_0014: shl + IL_0015: ldloc.0 + IL_0016: ldc.i4.2 + IL_0017: shr + IL_0018: add + IL_0019: add + IL_001a: add + IL_001b: stloc.0 + IL_001c: ldc.i4 0x9e3779b9 + IL_0021: ldarg.1 + IL_0022: stloc.2 + IL_0023: ldarg.0 + IL_0024: ldfld int32 assembly/R::x@ + IL_0029: ldloc.0 + IL_002a: ldc.i4.6 + IL_002b: shl + IL_002c: ldloc.0 + IL_002d: ldc.i4.2 + IL_002e: shr + IL_002f: add + IL_0030: add + IL_0031: add + IL_0032: stloc.0 + IL_0033: ldloc.0 + IL_0034: ret + + IL_0035: ldc.i4.0 + IL_0036: ret + } + + .method public hidebysig virtual final + instance int32 GetHashCode() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call class [runtime]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer() + IL_0006: callvirt instance int32 assembly/R::GetHashCode(class [runtime]System.Collections.IEqualityComparer) + IL_000b: ret + } + + .method public hidebysig virtual final + instance bool Equals(object obj, + class [runtime]System.Collections.IEqualityComparer comp) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 4 + .locals init (class assembly/R V_0, + class assembly/R V_1, + class [runtime]System.Collections.IEqualityComparer V_2, + class [runtime]System.Collections.IEqualityComparer V_3) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0036 + + IL_0003: ldarg.1 + IL_0004: isinst assembly/R + IL_0009: stloc.0 + IL_000a: ldloc.0 + IL_000b: brfalse.s IL_0034 + + IL_000d: ldloc.0 + IL_000e: stloc.1 + IL_000f: ldarg.2 + IL_0010: stloc.2 + IL_0011: ldarg.0 + IL_0012: ldfld int32 assembly/R::x@ + IL_0017: ldloc.1 + IL_0018: ldfld int32 assembly/R::x@ + IL_001d: ceq + IL_001f: brfalse.s IL_0032 + + IL_0021: ldarg.2 + IL_0022: stloc.3 + IL_0023: ldarg.0 + IL_0024: ldfld int32 assembly/R::y@ + IL_0029: ldloc.1 + IL_002a: ldfld int32 assembly/R::y@ + IL_002f: ceq + IL_0031: ret + + IL_0032: ldc.i4.0 + IL_0033: ret + + IL_0034: ldc.i4.0 + IL_0035: ret + + IL_0036: ldarg.1 + IL_0037: ldnull + IL_0038: cgt.un + IL_003a: ldc.i4.0 + IL_003b: ceq + IL_003d: ret + } + + .method public hidebysig virtual final + instance bool Equals(class assembly/R obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0027 + + IL_0003: ldarg.1 + IL_0004: brfalse.s IL_0025 + + IL_0006: ldarg.0 + IL_0007: ldfld int32 assembly/R::x@ + IL_000c: ldarg.1 + IL_000d: ldfld int32 assembly/R::x@ + IL_0012: bne.un.s IL_0023 + + IL_0014: ldarg.0 + IL_0015: ldfld int32 assembly/R::y@ + IL_001a: ldarg.1 + IL_001b: ldfld int32 assembly/R::y@ + IL_0020: ceq + IL_0022: ret + + IL_0023: ldc.i4.0 + IL_0024: ret + + IL_0025: ldc.i4.0 + IL_0026: ret + + IL_0027: ldarg.1 + IL_0028: ldnull + IL_0029: cgt.un + IL_002b: ldc.i4.0 + IL_002c: ceq + IL_002e: ret + } + + .method public hidebysig virtual final + instance bool Equals(object obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 4 + .locals init (class assembly/R V_0) + IL_0000: ldarg.1 + IL_0001: isinst assembly/R + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: brfalse.s IL_0012 + + IL_000a: ldarg.0 + IL_000b: ldloc.0 + IL_000c: callvirt instance bool assembly/R::Equals(class assembly/R) + IL_0011: ret + + IL_0012: ldc.i4.0 + IL_0013: ret + } + + .property instance int32 x() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32) = ( 01 00 04 00 00 00 00 00 00 00 00 00 ) + .get instance int32 assembly/R::get_x() + } + .property instance int32 y() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32) = ( 01 00 04 00 00 00 01 00 00 00 00 00 ) + .get instance int32 assembly/R::get_y() + } + } + + .method public static class [runtime]System.Tuple`2 + assembly(int32 inp) cil managed + { + + .maxstack 4 + .locals init (class assembly/R V_0) + IL_0000: ldc.i4.3 + IL_0001: ldarg.0 + IL_0002: newobj instance void assembly/R::.ctor(int32, + int32) + IL_0007: stloc.0 + IL_0008: ldloc.0 + IL_0009: ldloc.0 + IL_000a: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, + !1) + IL_000f: ret + } + +} + +.class private abstract auto ansi sealed ''.$assembly + extends [runtime]System.Object +{ + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: ret + } + +} + +.class private auto ansi sealed System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes + extends [runtime]System.Enum +{ + .custom instance void [runtime]System.FlagsAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .field public specialname rtspecialname int32 value__ = int32(0x00000000) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes All = int32(0xFFFFFFFF) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes None = int32(0x00000000) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicParameterlessConstructor = int32(0x00000001) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicConstructors = int32(0x00000003) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicConstructors = int32(0x00000004) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicMethods = int32(0x00000008) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicMethods = int32(0x00000010) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicFields = int32(0x00000020) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicFields = int32(0x00000040) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicNestedTypes = int32(0x00000080) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicNestedTypes = int32(0x00000100) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicProperties = int32(0x00000200) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicProperties = int32(0x00000400) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicEvents = int32(0x00000800) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicEvents = int32(0x00001000) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes Interfaces = int32(0x00002000) +} + +.class private auto ansi beforefieldinit System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute + extends [runtime]System.Attribute +{ + .field private valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes MemberType@ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .field private class [runtime]System.Type Type@ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method public specialname rtspecialname + instance void .ctor(valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes MemberType, + class [runtime]System.Type Type) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void [runtime]System.Attribute::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::MemberType@ + IL_000d: ldarg.0 + IL_000e: ldarg.2 + IL_000f: stfld class [runtime]System.Type System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::Type@ + IL_0014: ret + } + + .method public hidebysig specialname instance class [runtime]System.Type + get_Type() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld class [runtime]System.Type System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::Type@ + IL_0006: ret + } + + .method private hidebysig specialname instance void + set_Type(class [runtime]System.Type 'value') cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: stfld class [runtime]System.Type System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::Type@ + IL_0007: ret + } + + .method public hidebysig specialname instance valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes + get_MemberType() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::MemberType@ + IL_0006: ret + } + + .method private hidebysig specialname instance void + set_MemberType(valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes 'value') cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: stfld valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::MemberType@ + IL_0007: ret + } + + .property instance valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes + MemberType() + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .set instance void System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::set_MemberType(valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes) + .get instance valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::get_MemberType() + } + .property instance class [runtime]System.Type + Type() + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .set instance void System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::set_Type(class [runtime]System.Type) + .get instance class [runtime]System.Type System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::get_Type() + } +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.netcore.debug.bsl similarity index 97% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.debug.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.netcore.debug.bsl index 16b6f6bb5f..9d2e9c744c 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.debug.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.netcore.debug.bsl @@ -86,6 +86,9 @@ instance void .ctor(int32 x, int32 y) cil managed { + .custom instance void [runtime]System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::.ctor(valuetype [runtime]System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes, + class [runtime]System.Type) = ( 01 00 60 06 00 00 10 54 65 73 74 46 75 6E 63 74 + 69 6F 6E 31 37 2B 52 00 00 ) .maxstack 8 IL_0000: ldarg.0 diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.netcore.release.bsl similarity index 96% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.release.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.netcore.release.bsl index 1a692222b1..374ac9d2bb 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.netcore.release.bsl @@ -1,526 +1,529 @@ - - - - - -.assembly extern runtime { } -.assembly extern FSharp.Core { } -.assembly assembly -{ - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32, - int32, - int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 ) - - - - - .hash algorithm 0x00008004 - .ver 0:0:0:0 -} -.mresource public FSharpSignatureData.assembly -{ - - -} -.mresource public FSharpOptimizationData.assembly -{ - - -} -.module assembly.exe - -.imagebase {value} -.file alignment 0x00000200 -.stackreserve 0x00100000 -.subsystem 0x0003 -.corflags 0x00000001 - - - - - -.class public abstract auto ansi sealed assembly - extends [runtime]System.Object -{ - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) - .class auto ansi serializable sealed nested public R - extends [runtime]System.Object - implements class [runtime]System.IEquatable`1, - [runtime]System.Collections.IStructuralEquatable, - class [runtime]System.IComparable`1, - [runtime]System.IComparable, - [runtime]System.Collections.IStructuralComparable - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 02 00 00 00 00 00 ) - .field assembly int32 x@ - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) - .field assembly int32 y@ - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) - .method public hidebysig specialname - instance int32 get_x() cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: ldfld int32 assembly/R::x@ - IL_0006: ret - } - - .method public hidebysig specialname - instance int32 get_y() cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: ldfld int32 assembly/R::y@ - IL_0006: ret - } - - .method public specialname rtspecialname - instance void .ctor(int32 x, - int32 y) cil managed - { - - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: call instance void [runtime]System.Object::.ctor() - IL_0006: ldarg.0 - IL_0007: ldarg.1 - IL_0008: stfld int32 assembly/R::x@ - IL_000d: ldarg.0 - IL_000e: ldarg.2 - IL_000f: stfld int32 assembly/R::y@ - IL_0014: ret - } - - .method public strict virtual instance string - ToString() cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 8 - IL_0000: ldstr "%+A" - IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,class assembly/R>::.ctor(string) - IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) - IL_000f: ldarg.0 - IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) - IL_0015: ret - } - - .method public hidebysig virtual final - instance int32 CompareTo(class assembly/R obj) cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 5 - .locals init (int32 V_0, - class [runtime]System.Collections.IComparer V_1, - int32 V_2, - int32 V_3, - class [runtime]System.Collections.IComparer V_4, - int32 V_5, - int32 V_6) - IL_0000: ldarg.0 - IL_0001: brfalse.s IL_0057 - - IL_0003: ldarg.1 - IL_0004: brfalse.s IL_0055 - - IL_0006: call class [runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() - IL_000b: stloc.1 - IL_000c: ldarg.0 - IL_000d: ldfld int32 assembly/R::x@ - IL_0012: stloc.2 - IL_0013: ldarg.1 - IL_0014: ldfld int32 assembly/R::x@ - IL_0019: stloc.3 - IL_001a: ldloc.2 - IL_001b: ldloc.3 - IL_001c: cgt - IL_001e: ldloc.2 - IL_001f: ldloc.3 - IL_0020: clt - IL_0022: sub - IL_0023: stloc.0 - IL_0024: ldloc.0 - IL_0025: ldc.i4.0 - IL_0026: bge.s IL_002a - - IL_0028: ldloc.0 - IL_0029: ret - - IL_002a: ldloc.0 - IL_002b: ldc.i4.0 - IL_002c: ble.s IL_0030 - - IL_002e: ldloc.0 - IL_002f: ret - - IL_0030: call class [runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() - IL_0035: stloc.s V_4 - IL_0037: ldarg.0 - IL_0038: ldfld int32 assembly/R::y@ - IL_003d: stloc.s V_5 - IL_003f: ldarg.1 - IL_0040: ldfld int32 assembly/R::y@ - IL_0045: stloc.s V_6 - IL_0047: ldloc.s V_5 - IL_0049: ldloc.s V_6 - IL_004b: cgt - IL_004d: ldloc.s V_5 - IL_004f: ldloc.s V_6 - IL_0051: clt - IL_0053: sub - IL_0054: ret - - IL_0055: ldc.i4.1 - IL_0056: ret - - IL_0057: ldarg.1 - IL_0058: brfalse.s IL_005c - - IL_005a: ldc.i4.m1 - IL_005b: ret - - IL_005c: ldc.i4.0 - IL_005d: ret - } - - .method public hidebysig virtual final - instance int32 CompareTo(object obj) cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: ldarg.1 - IL_0002: unbox.any assembly/R - IL_0007: callvirt instance int32 assembly/R::CompareTo(class assembly/R) - IL_000c: ret - } - - .method public hidebysig virtual final - instance int32 CompareTo(object obj, - class [runtime]System.Collections.IComparer comp) cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 5 - .locals init (class assembly/R V_0, - class assembly/R V_1, - int32 V_2, - class [runtime]System.Collections.IComparer V_3, - int32 V_4, - int32 V_5, - class [runtime]System.Collections.IComparer V_6, - int32 V_7, - int32 V_8) - IL_0000: ldarg.1 - IL_0001: unbox.any assembly/R - IL_0006: stloc.0 - IL_0007: ldloc.0 - IL_0008: stloc.1 - IL_0009: ldarg.0 - IL_000a: brfalse.s IL_0063 - - IL_000c: ldarg.1 - IL_000d: unbox.any assembly/R - IL_0012: brfalse.s IL_0061 - - IL_0014: ldarg.2 - IL_0015: stloc.3 - IL_0016: ldarg.0 - IL_0017: ldfld int32 assembly/R::x@ - IL_001c: stloc.s V_4 - IL_001e: ldloc.1 - IL_001f: ldfld int32 assembly/R::x@ - IL_0024: stloc.s V_5 - IL_0026: ldloc.s V_4 - IL_0028: ldloc.s V_5 - IL_002a: cgt - IL_002c: ldloc.s V_4 - IL_002e: ldloc.s V_5 - IL_0030: clt - IL_0032: sub - IL_0033: stloc.2 - IL_0034: ldloc.2 - IL_0035: ldc.i4.0 - IL_0036: bge.s IL_003a - - IL_0038: ldloc.2 - IL_0039: ret - - IL_003a: ldloc.2 - IL_003b: ldc.i4.0 - IL_003c: ble.s IL_0040 - - IL_003e: ldloc.2 - IL_003f: ret - - IL_0040: ldarg.2 - IL_0041: stloc.s V_6 - IL_0043: ldarg.0 - IL_0044: ldfld int32 assembly/R::y@ - IL_0049: stloc.s V_7 - IL_004b: ldloc.1 - IL_004c: ldfld int32 assembly/R::y@ - IL_0051: stloc.s V_8 - IL_0053: ldloc.s V_7 - IL_0055: ldloc.s V_8 - IL_0057: cgt - IL_0059: ldloc.s V_7 - IL_005b: ldloc.s V_8 - IL_005d: clt - IL_005f: sub - IL_0060: ret - - IL_0061: ldc.i4.1 - IL_0062: ret - - IL_0063: ldarg.1 - IL_0064: unbox.any assembly/R - IL_0069: brfalse.s IL_006d - - IL_006b: ldc.i4.m1 - IL_006c: ret - - IL_006d: ldc.i4.0 - IL_006e: ret - } - - .method public hidebysig virtual final - instance int32 GetHashCode(class [runtime]System.Collections.IEqualityComparer comp) cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 7 - .locals init (int32 V_0, - class [runtime]System.Collections.IEqualityComparer V_1, - class [runtime]System.Collections.IEqualityComparer V_2) - IL_0000: ldarg.0 - IL_0001: brfalse.s IL_0035 - - IL_0003: ldc.i4.0 - IL_0004: stloc.0 - IL_0005: ldc.i4 0x9e3779b9 - IL_000a: ldarg.1 - IL_000b: stloc.1 - IL_000c: ldarg.0 - IL_000d: ldfld int32 assembly/R::y@ - IL_0012: ldloc.0 - IL_0013: ldc.i4.6 - IL_0014: shl - IL_0015: ldloc.0 - IL_0016: ldc.i4.2 - IL_0017: shr - IL_0018: add - IL_0019: add - IL_001a: add - IL_001b: stloc.0 - IL_001c: ldc.i4 0x9e3779b9 - IL_0021: ldarg.1 - IL_0022: stloc.2 - IL_0023: ldarg.0 - IL_0024: ldfld int32 assembly/R::x@ - IL_0029: ldloc.0 - IL_002a: ldc.i4.6 - IL_002b: shl - IL_002c: ldloc.0 - IL_002d: ldc.i4.2 - IL_002e: shr - IL_002f: add - IL_0030: add - IL_0031: add - IL_0032: stloc.0 - IL_0033: ldloc.0 - IL_0034: ret - - IL_0035: ldc.i4.0 - IL_0036: ret - } - - .method public hidebysig virtual final - instance int32 GetHashCode() cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: call class [runtime]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer() - IL_0006: callvirt instance int32 assembly/R::GetHashCode(class [runtime]System.Collections.IEqualityComparer) - IL_000b: ret - } - - .method public hidebysig virtual final - instance bool Equals(object obj, - class [runtime]System.Collections.IEqualityComparer comp) cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 4 - .locals init (class assembly/R V_0, - class assembly/R V_1, - class [runtime]System.Collections.IEqualityComparer V_2, - class [runtime]System.Collections.IEqualityComparer V_3) - IL_0000: ldarg.0 - IL_0001: brfalse.s IL_0036 - - IL_0003: ldarg.1 - IL_0004: isinst assembly/R - IL_0009: stloc.0 - IL_000a: ldloc.0 - IL_000b: brfalse.s IL_0034 - - IL_000d: ldloc.0 - IL_000e: stloc.1 - IL_000f: ldarg.2 - IL_0010: stloc.2 - IL_0011: ldarg.0 - IL_0012: ldfld int32 assembly/R::x@ - IL_0017: ldloc.1 - IL_0018: ldfld int32 assembly/R::x@ - IL_001d: ceq - IL_001f: brfalse.s IL_0032 - - IL_0021: ldarg.2 - IL_0022: stloc.3 - IL_0023: ldarg.0 - IL_0024: ldfld int32 assembly/R::y@ - IL_0029: ldloc.1 - IL_002a: ldfld int32 assembly/R::y@ - IL_002f: ceq - IL_0031: ret - - IL_0032: ldc.i4.0 - IL_0033: ret - - IL_0034: ldc.i4.0 - IL_0035: ret - - IL_0036: ldarg.1 - IL_0037: ldnull - IL_0038: cgt.un - IL_003a: ldc.i4.0 - IL_003b: ceq - IL_003d: ret - } - - .method public hidebysig virtual final - instance bool Equals(class assembly/R obj) cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: brfalse.s IL_0027 - - IL_0003: ldarg.1 - IL_0004: brfalse.s IL_0025 - - IL_0006: ldarg.0 - IL_0007: ldfld int32 assembly/R::x@ - IL_000c: ldarg.1 - IL_000d: ldfld int32 assembly/R::x@ - IL_0012: bne.un.s IL_0023 - - IL_0014: ldarg.0 - IL_0015: ldfld int32 assembly/R::y@ - IL_001a: ldarg.1 - IL_001b: ldfld int32 assembly/R::y@ - IL_0020: ceq - IL_0022: ret - - IL_0023: ldc.i4.0 - IL_0024: ret - - IL_0025: ldc.i4.0 - IL_0026: ret - - IL_0027: ldarg.1 - IL_0028: ldnull - IL_0029: cgt.un - IL_002b: ldc.i4.0 - IL_002c: ceq - IL_002e: ret - } - - .method public hidebysig virtual final - instance bool Equals(object obj) cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 4 - .locals init (class assembly/R V_0) - IL_0000: ldarg.1 - IL_0001: isinst assembly/R - IL_0006: stloc.0 - IL_0007: ldloc.0 - IL_0008: brfalse.s IL_0012 - - IL_000a: ldarg.0 - IL_000b: ldloc.0 - IL_000c: callvirt instance bool assembly/R::Equals(class assembly/R) - IL_0011: ret - - IL_0012: ldc.i4.0 - IL_0013: ret - } - - .property instance int32 x() - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, - int32) = ( 01 00 04 00 00 00 00 00 00 00 00 00 ) - .get instance int32 assembly/R::get_x() - } - .property instance int32 y() - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, - int32) = ( 01 00 04 00 00 00 01 00 00 00 00 00 ) - .get instance int32 assembly/R::get_y() - } - } - - .method public static class [runtime]System.Tuple`2 - assembly(int32 inp) cil managed - { - - .maxstack 4 - .locals init (class assembly/R V_0) - IL_0000: ldc.i4.3 - IL_0001: ldarg.0 - IL_0002: newobj instance void assembly/R::.ctor(int32, - int32) - IL_0007: stloc.0 - IL_0008: ldloc.0 - IL_0009: ldloc.0 - IL_000a: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, - !1) - IL_000f: ret - } - -} - -.class private abstract auto ansi sealed ''.$assembly - extends [runtime]System.Object -{ - .method public static void main@() cil managed - { - .entrypoint - - .maxstack 8 - IL_0000: ret - } - -} - - - - - - + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly assembly +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32, + int32, + int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 ) + + + + + .hash algorithm 0x00008004 + .ver 0:0:0:0 +} +.mresource public FSharpSignatureData.assembly +{ + + +} +.mresource public FSharpOptimizationData.assembly +{ + + +} +.module assembly.exe + +.imagebase {value} +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 +.corflags 0x00000001 + + + + + +.class public abstract auto ansi sealed assembly + extends [runtime]System.Object +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .class auto ansi serializable sealed nested public R + extends [runtime]System.Object + implements class [runtime]System.IEquatable`1, + [runtime]System.Collections.IStructuralEquatable, + class [runtime]System.IComparable`1, + [runtime]System.IComparable, + [runtime]System.Collections.IStructuralComparable + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 02 00 00 00 00 00 ) + .field assembly int32 x@ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .field assembly int32 y@ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .method public hidebysig specialname + instance int32 get_x() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 assembly/R::x@ + IL_0006: ret + } + + .method public hidebysig specialname + instance int32 get_y() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 assembly/R::y@ + IL_0006: ret + } + + .method public specialname rtspecialname + instance void .ctor(int32 x, + int32 y) cil managed + { + .custom instance void [runtime]System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::.ctor(valuetype [runtime]System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes, + class [runtime]System.Type) = ( 01 00 60 06 00 00 10 54 65 73 74 46 75 6E 63 74 + 69 6F 6E 31 37 2B 52 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void [runtime]System.Object::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld int32 assembly/R::x@ + IL_000d: ldarg.0 + IL_000e: ldarg.2 + IL_000f: stfld int32 assembly/R::y@ + IL_0014: ret + } + + .method public strict virtual instance string + ToString() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldstr "%+A" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,class assembly/R>::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_000f: ldarg.0 + IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0015: ret + } + + .method public hidebysig virtual final + instance int32 CompareTo(class assembly/R obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 5 + .locals init (int32 V_0, + class [runtime]System.Collections.IComparer V_1, + int32 V_2, + int32 V_3, + class [runtime]System.Collections.IComparer V_4, + int32 V_5, + int32 V_6) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0057 + + IL_0003: ldarg.1 + IL_0004: brfalse.s IL_0055 + + IL_0006: call class [runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() + IL_000b: stloc.1 + IL_000c: ldarg.0 + IL_000d: ldfld int32 assembly/R::x@ + IL_0012: stloc.2 + IL_0013: ldarg.1 + IL_0014: ldfld int32 assembly/R::x@ + IL_0019: stloc.3 + IL_001a: ldloc.2 + IL_001b: ldloc.3 + IL_001c: cgt + IL_001e: ldloc.2 + IL_001f: ldloc.3 + IL_0020: clt + IL_0022: sub + IL_0023: stloc.0 + IL_0024: ldloc.0 + IL_0025: ldc.i4.0 + IL_0026: bge.s IL_002a + + IL_0028: ldloc.0 + IL_0029: ret + + IL_002a: ldloc.0 + IL_002b: ldc.i4.0 + IL_002c: ble.s IL_0030 + + IL_002e: ldloc.0 + IL_002f: ret + + IL_0030: call class [runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() + IL_0035: stloc.s V_4 + IL_0037: ldarg.0 + IL_0038: ldfld int32 assembly/R::y@ + IL_003d: stloc.s V_5 + IL_003f: ldarg.1 + IL_0040: ldfld int32 assembly/R::y@ + IL_0045: stloc.s V_6 + IL_0047: ldloc.s V_5 + IL_0049: ldloc.s V_6 + IL_004b: cgt + IL_004d: ldloc.s V_5 + IL_004f: ldloc.s V_6 + IL_0051: clt + IL_0053: sub + IL_0054: ret + + IL_0055: ldc.i4.1 + IL_0056: ret + + IL_0057: ldarg.1 + IL_0058: brfalse.s IL_005c + + IL_005a: ldc.i4.m1 + IL_005b: ret + + IL_005c: ldc.i4.0 + IL_005d: ret + } + + .method public hidebysig virtual final + instance int32 CompareTo(object obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: unbox.any assembly/R + IL_0007: callvirt instance int32 assembly/R::CompareTo(class assembly/R) + IL_000c: ret + } + + .method public hidebysig virtual final + instance int32 CompareTo(object obj, + class [runtime]System.Collections.IComparer comp) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 5 + .locals init (class assembly/R V_0, + class assembly/R V_1, + int32 V_2, + class [runtime]System.Collections.IComparer V_3, + int32 V_4, + int32 V_5, + class [runtime]System.Collections.IComparer V_6, + int32 V_7, + int32 V_8) + IL_0000: ldarg.1 + IL_0001: unbox.any assembly/R + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: stloc.1 + IL_0009: ldarg.0 + IL_000a: brfalse.s IL_0063 + + IL_000c: ldarg.1 + IL_000d: unbox.any assembly/R + IL_0012: brfalse.s IL_0061 + + IL_0014: ldarg.2 + IL_0015: stloc.3 + IL_0016: ldarg.0 + IL_0017: ldfld int32 assembly/R::x@ + IL_001c: stloc.s V_4 + IL_001e: ldloc.1 + IL_001f: ldfld int32 assembly/R::x@ + IL_0024: stloc.s V_5 + IL_0026: ldloc.s V_4 + IL_0028: ldloc.s V_5 + IL_002a: cgt + IL_002c: ldloc.s V_4 + IL_002e: ldloc.s V_5 + IL_0030: clt + IL_0032: sub + IL_0033: stloc.2 + IL_0034: ldloc.2 + IL_0035: ldc.i4.0 + IL_0036: bge.s IL_003a + + IL_0038: ldloc.2 + IL_0039: ret + + IL_003a: ldloc.2 + IL_003b: ldc.i4.0 + IL_003c: ble.s IL_0040 + + IL_003e: ldloc.2 + IL_003f: ret + + IL_0040: ldarg.2 + IL_0041: stloc.s V_6 + IL_0043: ldarg.0 + IL_0044: ldfld int32 assembly/R::y@ + IL_0049: stloc.s V_7 + IL_004b: ldloc.1 + IL_004c: ldfld int32 assembly/R::y@ + IL_0051: stloc.s V_8 + IL_0053: ldloc.s V_7 + IL_0055: ldloc.s V_8 + IL_0057: cgt + IL_0059: ldloc.s V_7 + IL_005b: ldloc.s V_8 + IL_005d: clt + IL_005f: sub + IL_0060: ret + + IL_0061: ldc.i4.1 + IL_0062: ret + + IL_0063: ldarg.1 + IL_0064: unbox.any assembly/R + IL_0069: brfalse.s IL_006d + + IL_006b: ldc.i4.m1 + IL_006c: ret + + IL_006d: ldc.i4.0 + IL_006e: ret + } + + .method public hidebysig virtual final + instance int32 GetHashCode(class [runtime]System.Collections.IEqualityComparer comp) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 7 + .locals init (int32 V_0, + class [runtime]System.Collections.IEqualityComparer V_1, + class [runtime]System.Collections.IEqualityComparer V_2) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0035 + + IL_0003: ldc.i4.0 + IL_0004: stloc.0 + IL_0005: ldc.i4 0x9e3779b9 + IL_000a: ldarg.1 + IL_000b: stloc.1 + IL_000c: ldarg.0 + IL_000d: ldfld int32 assembly/R::y@ + IL_0012: ldloc.0 + IL_0013: ldc.i4.6 + IL_0014: shl + IL_0015: ldloc.0 + IL_0016: ldc.i4.2 + IL_0017: shr + IL_0018: add + IL_0019: add + IL_001a: add + IL_001b: stloc.0 + IL_001c: ldc.i4 0x9e3779b9 + IL_0021: ldarg.1 + IL_0022: stloc.2 + IL_0023: ldarg.0 + IL_0024: ldfld int32 assembly/R::x@ + IL_0029: ldloc.0 + IL_002a: ldc.i4.6 + IL_002b: shl + IL_002c: ldloc.0 + IL_002d: ldc.i4.2 + IL_002e: shr + IL_002f: add + IL_0030: add + IL_0031: add + IL_0032: stloc.0 + IL_0033: ldloc.0 + IL_0034: ret + + IL_0035: ldc.i4.0 + IL_0036: ret + } + + .method public hidebysig virtual final + instance int32 GetHashCode() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call class [runtime]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer() + IL_0006: callvirt instance int32 assembly/R::GetHashCode(class [runtime]System.Collections.IEqualityComparer) + IL_000b: ret + } + + .method public hidebysig virtual final + instance bool Equals(object obj, + class [runtime]System.Collections.IEqualityComparer comp) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 4 + .locals init (class assembly/R V_0, + class assembly/R V_1, + class [runtime]System.Collections.IEqualityComparer V_2, + class [runtime]System.Collections.IEqualityComparer V_3) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0036 + + IL_0003: ldarg.1 + IL_0004: isinst assembly/R + IL_0009: stloc.0 + IL_000a: ldloc.0 + IL_000b: brfalse.s IL_0034 + + IL_000d: ldloc.0 + IL_000e: stloc.1 + IL_000f: ldarg.2 + IL_0010: stloc.2 + IL_0011: ldarg.0 + IL_0012: ldfld int32 assembly/R::x@ + IL_0017: ldloc.1 + IL_0018: ldfld int32 assembly/R::x@ + IL_001d: ceq + IL_001f: brfalse.s IL_0032 + + IL_0021: ldarg.2 + IL_0022: stloc.3 + IL_0023: ldarg.0 + IL_0024: ldfld int32 assembly/R::y@ + IL_0029: ldloc.1 + IL_002a: ldfld int32 assembly/R::y@ + IL_002f: ceq + IL_0031: ret + + IL_0032: ldc.i4.0 + IL_0033: ret + + IL_0034: ldc.i4.0 + IL_0035: ret + + IL_0036: ldarg.1 + IL_0037: ldnull + IL_0038: cgt.un + IL_003a: ldc.i4.0 + IL_003b: ceq + IL_003d: ret + } + + .method public hidebysig virtual final + instance bool Equals(class assembly/R obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0027 + + IL_0003: ldarg.1 + IL_0004: brfalse.s IL_0025 + + IL_0006: ldarg.0 + IL_0007: ldfld int32 assembly/R::x@ + IL_000c: ldarg.1 + IL_000d: ldfld int32 assembly/R::x@ + IL_0012: bne.un.s IL_0023 + + IL_0014: ldarg.0 + IL_0015: ldfld int32 assembly/R::y@ + IL_001a: ldarg.1 + IL_001b: ldfld int32 assembly/R::y@ + IL_0020: ceq + IL_0022: ret + + IL_0023: ldc.i4.0 + IL_0024: ret + + IL_0025: ldc.i4.0 + IL_0026: ret + + IL_0027: ldarg.1 + IL_0028: ldnull + IL_0029: cgt.un + IL_002b: ldc.i4.0 + IL_002c: ceq + IL_002e: ret + } + + .method public hidebysig virtual final + instance bool Equals(object obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 4 + .locals init (class assembly/R V_0) + IL_0000: ldarg.1 + IL_0001: isinst assembly/R + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: brfalse.s IL_0012 + + IL_000a: ldarg.0 + IL_000b: ldloc.0 + IL_000c: callvirt instance bool assembly/R::Equals(class assembly/R) + IL_0011: ret + + IL_0012: ldc.i4.0 + IL_0013: ret + } + + .property instance int32 x() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32) = ( 01 00 04 00 00 00 00 00 00 00 00 00 ) + .get instance int32 assembly/R::get_x() + } + .property instance int32 y() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32) = ( 01 00 04 00 00 00 01 00 00 00 00 00 ) + .get instance int32 assembly/R::get_y() + } + } + + .method public static class [runtime]System.Tuple`2 + assembly(int32 inp) cil managed + { + + .maxstack 4 + .locals init (class assembly/R V_0) + IL_0000: ldc.i4.3 + IL_0001: ldarg.0 + IL_0002: newobj instance void assembly/R::.ctor(int32, + int32) + IL_0007: stloc.0 + IL_0008: ldloc.0 + IL_0009: ldloc.0 + IL_000a: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, + !1) + IL_000f: ret + } + +} + +.class private abstract auto ansi sealed ''.$assembly + extends [runtime]System.Object +{ + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.net472.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.net472.debug.bsl new file mode 100644 index 0000000000..4e97b29887 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.net472.debug.bsl @@ -0,0 +1,1065 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly assembly +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32, + int32, + int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 ) + + + + + .hash algorithm 0x00008004 + .ver 0:0:0:0 +} +.mresource public FSharpSignatureData.assembly +{ + + +} +.mresource public FSharpOptimizationData.assembly +{ + + +} +.module assembly.exe + +.imagebase {value} +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 +.corflags 0x00000001 + + + + + +.class public abstract auto ansi sealed assembly + extends [runtime]System.Object +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .class auto ansi serializable sealed nested public Point + extends [runtime]System.Object + implements class [runtime]System.IEquatable`1, + [runtime]System.Collections.IStructuralEquatable, + class [runtime]System.IComparable`1, + [runtime]System.IComparable, + [runtime]System.Collections.IStructuralComparable + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 02 00 00 00 00 00 ) + .field public int32 x@ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .field public int32 y@ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .method public hidebysig specialname + instance int32 get_x() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 assembly/Point::x@ + IL_0006: ret + } + + .method public hidebysig specialname + instance int32 get_y() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 assembly/Point::y@ + IL_0006: ret + } + + .method public hidebysig specialname + instance void set_x(int32 'value') cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: stfld int32 assembly/Point::x@ + IL_0007: ret + } + + .method public hidebysig specialname + instance void set_y(int32 'value') cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: stfld int32 assembly/Point::y@ + IL_0007: ret + } + + .method public specialname rtspecialname + instance void .ctor(int32 x, + int32 y) cil managed + { + .custom instance void System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::.ctor(valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes, + class [runtime]System.Type) = ( 01 00 60 06 00 00 14 54 65 73 74 46 75 6E 63 74 + 69 6F 6E 32 34 2B 50 6F 69 6E 74 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void [runtime]System.Object::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld int32 assembly/Point::x@ + IL_000d: ldarg.0 + IL_000e: ldarg.2 + IL_000f: stfld int32 assembly/Point::y@ + IL_0014: ret + } + + .method public strict virtual instance string + ToString() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldstr "%+A" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,class assembly/Point>::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_000f: ldarg.0 + IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0015: ret + } + + .method public hidebysig virtual final + instance int32 CompareTo(class assembly/Point obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 5 + .locals init (int32 V_0, + class [runtime]System.Collections.IComparer V_1, + int32 V_2, + int32 V_3, + class [runtime]System.Collections.IComparer V_4, + int32 V_5, + int32 V_6, + class [runtime]System.Collections.IComparer V_7, + int32 V_8, + int32 V_9, + class [runtime]System.Collections.IComparer V_10, + int32 V_11, + int32 V_12) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0070 + + IL_0003: ldarg.1 + IL_0004: brfalse.s IL_006e + + IL_0006: call class [runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() + IL_000b: stloc.1 + IL_000c: ldarg.0 + IL_000d: ldfld int32 assembly/Point::x@ + IL_0012: stloc.2 + IL_0013: ldarg.1 + IL_0014: ldfld int32 assembly/Point::x@ + IL_0019: stloc.3 + IL_001a: ldloc.1 + IL_001b: stloc.s V_4 + IL_001d: ldloc.2 + IL_001e: stloc.s V_5 + IL_0020: ldloc.3 + IL_0021: stloc.s V_6 + IL_0023: ldloc.s V_5 + IL_0025: ldloc.s V_6 + IL_0027: cgt + IL_0029: ldloc.s V_5 + IL_002b: ldloc.s V_6 + IL_002d: clt + IL_002f: sub + IL_0030: stloc.0 + IL_0031: ldloc.0 + IL_0032: ldc.i4.0 + IL_0033: bge.s IL_0037 + + IL_0035: ldloc.0 + IL_0036: ret + + IL_0037: ldloc.0 + IL_0038: ldc.i4.0 + IL_0039: ble.s IL_003d + + IL_003b: ldloc.0 + IL_003c: ret + + IL_003d: call class [runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() + IL_0042: stloc.s V_7 + IL_0044: ldarg.0 + IL_0045: ldfld int32 assembly/Point::y@ + IL_004a: stloc.s V_8 + IL_004c: ldarg.1 + IL_004d: ldfld int32 assembly/Point::y@ + IL_0052: stloc.s V_9 + IL_0054: ldloc.s V_7 + IL_0056: stloc.s V_10 + IL_0058: ldloc.s V_8 + IL_005a: stloc.s V_11 + IL_005c: ldloc.s V_9 + IL_005e: stloc.s V_12 + IL_0060: ldloc.s V_11 + IL_0062: ldloc.s V_12 + IL_0064: cgt + IL_0066: ldloc.s V_11 + IL_0068: ldloc.s V_12 + IL_006a: clt + IL_006c: sub + IL_006d: ret + + IL_006e: ldc.i4.1 + IL_006f: ret + + IL_0070: ldarg.1 + IL_0071: brfalse.s IL_0075 + + IL_0073: ldc.i4.m1 + IL_0074: ret + + IL_0075: ldc.i4.0 + IL_0076: ret + } + + .method public hidebysig virtual final + instance int32 CompareTo(object obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: unbox.any assembly/Point + IL_0007: callvirt instance int32 assembly/Point::CompareTo(class assembly/Point) + IL_000c: ret + } + + .method public hidebysig virtual final + instance int32 CompareTo(object obj, + class [runtime]System.Collections.IComparer comp) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 5 + .locals init (class assembly/Point V_0, + class assembly/Point V_1, + int32 V_2, + class [runtime]System.Collections.IComparer V_3, + int32 V_4, + int32 V_5, + class [runtime]System.Collections.IComparer V_6, + int32 V_7, + int32 V_8, + class [runtime]System.Collections.IComparer V_9, + int32 V_10, + int32 V_11, + class [runtime]System.Collections.IComparer V_12, + int32 V_13, + int32 V_14) + IL_0000: ldarg.1 + IL_0001: unbox.any assembly/Point + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: stloc.1 + IL_0009: ldarg.0 + IL_000a: brfalse.s IL_007a + + IL_000c: ldarg.1 + IL_000d: unbox.any assembly/Point + IL_0012: brfalse.s IL_0078 + + IL_0014: ldarg.2 + IL_0015: stloc.3 + IL_0016: ldarg.0 + IL_0017: ldfld int32 assembly/Point::x@ + IL_001c: stloc.s V_4 + IL_001e: ldloc.1 + IL_001f: ldfld int32 assembly/Point::x@ + IL_0024: stloc.s V_5 + IL_0026: ldloc.3 + IL_0027: stloc.s V_6 + IL_0029: ldloc.s V_4 + IL_002b: stloc.s V_7 + IL_002d: ldloc.s V_5 + IL_002f: stloc.s V_8 + IL_0031: ldloc.s V_7 + IL_0033: ldloc.s V_8 + IL_0035: cgt + IL_0037: ldloc.s V_7 + IL_0039: ldloc.s V_8 + IL_003b: clt + IL_003d: sub + IL_003e: stloc.2 + IL_003f: ldloc.2 + IL_0040: ldc.i4.0 + IL_0041: bge.s IL_0045 + + IL_0043: ldloc.2 + IL_0044: ret + + IL_0045: ldloc.2 + IL_0046: ldc.i4.0 + IL_0047: ble.s IL_004b + + IL_0049: ldloc.2 + IL_004a: ret + + IL_004b: ldarg.2 + IL_004c: stloc.s V_9 + IL_004e: ldarg.0 + IL_004f: ldfld int32 assembly/Point::y@ + IL_0054: stloc.s V_10 + IL_0056: ldloc.1 + IL_0057: ldfld int32 assembly/Point::y@ + IL_005c: stloc.s V_11 + IL_005e: ldloc.s V_9 + IL_0060: stloc.s V_12 + IL_0062: ldloc.s V_10 + IL_0064: stloc.s V_13 + IL_0066: ldloc.s V_11 + IL_0068: stloc.s V_14 + IL_006a: ldloc.s V_13 + IL_006c: ldloc.s V_14 + IL_006e: cgt + IL_0070: ldloc.s V_13 + IL_0072: ldloc.s V_14 + IL_0074: clt + IL_0076: sub + IL_0077: ret + + IL_0078: ldc.i4.1 + IL_0079: ret + + IL_007a: ldarg.1 + IL_007b: unbox.any assembly/Point + IL_0080: brfalse.s IL_0084 + + IL_0082: ldc.i4.m1 + IL_0083: ret + + IL_0084: ldc.i4.0 + IL_0085: ret + } + + .method public hidebysig virtual final + instance int32 GetHashCode(class [runtime]System.Collections.IEqualityComparer comp) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 7 + .locals init (int32 V_0, + class [runtime]System.Collections.IEqualityComparer V_1, + int32 V_2, + class [runtime]System.Collections.IEqualityComparer V_3, + class [runtime]System.Collections.IEqualityComparer V_4, + int32 V_5, + class [runtime]System.Collections.IEqualityComparer V_6) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0042 + + IL_0003: ldc.i4.0 + IL_0004: stloc.0 + IL_0005: ldc.i4 0x9e3779b9 + IL_000a: ldarg.1 + IL_000b: stloc.1 + IL_000c: ldarg.0 + IL_000d: ldfld int32 assembly/Point::y@ + IL_0012: stloc.2 + IL_0013: ldloc.1 + IL_0014: stloc.3 + IL_0015: ldloc.2 + IL_0016: ldloc.0 + IL_0017: ldc.i4.6 + IL_0018: shl + IL_0019: ldloc.0 + IL_001a: ldc.i4.2 + IL_001b: shr + IL_001c: add + IL_001d: add + IL_001e: add + IL_001f: stloc.0 + IL_0020: ldc.i4 0x9e3779b9 + IL_0025: ldarg.1 + IL_0026: stloc.s V_4 + IL_0028: ldarg.0 + IL_0029: ldfld int32 assembly/Point::x@ + IL_002e: stloc.s V_5 + IL_0030: ldloc.s V_4 + IL_0032: stloc.s V_6 + IL_0034: ldloc.s V_5 + IL_0036: ldloc.0 + IL_0037: ldc.i4.6 + IL_0038: shl + IL_0039: ldloc.0 + IL_003a: ldc.i4.2 + IL_003b: shr + IL_003c: add + IL_003d: add + IL_003e: add + IL_003f: stloc.0 + IL_0040: ldloc.0 + IL_0041: ret + + IL_0042: ldc.i4.0 + IL_0043: ret + } + + .method public hidebysig virtual final + instance int32 GetHashCode() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call class [runtime]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer() + IL_0006: callvirt instance int32 assembly/Point::GetHashCode(class [runtime]System.Collections.IEqualityComparer) + IL_000b: ret + } + + .method public hidebysig virtual final + instance bool Equals(object obj, + class [runtime]System.Collections.IEqualityComparer comp) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 4 + .locals init (class assembly/Point V_0, + class assembly/Point V_1, + class [runtime]System.Collections.IEqualityComparer V_2, + int32 V_3, + int32 V_4, + class [runtime]System.Collections.IEqualityComparer V_5, + class [runtime]System.Collections.IEqualityComparer V_6, + int32 V_7, + int32 V_8, + class [runtime]System.Collections.IEqualityComparer V_9) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_004c + + IL_0003: ldarg.1 + IL_0004: isinst assembly/Point + IL_0009: stloc.0 + IL_000a: ldloc.0 + IL_000b: brfalse.s IL_004a + + IL_000d: ldloc.0 + IL_000e: stloc.1 + IL_000f: ldarg.2 + IL_0010: stloc.2 + IL_0011: ldarg.0 + IL_0012: ldfld int32 assembly/Point::x@ + IL_0017: stloc.3 + IL_0018: ldloc.1 + IL_0019: ldfld int32 assembly/Point::x@ + IL_001e: stloc.s V_4 + IL_0020: ldloc.2 + IL_0021: stloc.s V_5 + IL_0023: ldloc.3 + IL_0024: ldloc.s V_4 + IL_0026: ceq + IL_0028: brfalse.s IL_0048 + + IL_002a: ldarg.2 + IL_002b: stloc.s V_6 + IL_002d: ldarg.0 + IL_002e: ldfld int32 assembly/Point::y@ + IL_0033: stloc.s V_7 + IL_0035: ldloc.1 + IL_0036: ldfld int32 assembly/Point::y@ + IL_003b: stloc.s V_8 + IL_003d: ldloc.s V_6 + IL_003f: stloc.s V_9 + IL_0041: ldloc.s V_7 + IL_0043: ldloc.s V_8 + IL_0045: ceq + IL_0047: ret + + IL_0048: ldc.i4.0 + IL_0049: ret + + IL_004a: ldc.i4.0 + IL_004b: ret + + IL_004c: ldarg.1 + IL_004d: ldnull + IL_004e: cgt.un + IL_0050: ldc.i4.0 + IL_0051: ceq + IL_0053: ret + } + + .method public hidebysig virtual final + instance bool Equals(class assembly/Point obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0027 + + IL_0003: ldarg.1 + IL_0004: brfalse.s IL_0025 + + IL_0006: ldarg.0 + IL_0007: ldfld int32 assembly/Point::x@ + IL_000c: ldarg.1 + IL_000d: ldfld int32 assembly/Point::x@ + IL_0012: bne.un.s IL_0023 + + IL_0014: ldarg.0 + IL_0015: ldfld int32 assembly/Point::y@ + IL_001a: ldarg.1 + IL_001b: ldfld int32 assembly/Point::y@ + IL_0020: ceq + IL_0022: ret + + IL_0023: ldc.i4.0 + IL_0024: ret + + IL_0025: ldc.i4.0 + IL_0026: ret + + IL_0027: ldarg.1 + IL_0028: ldnull + IL_0029: cgt.un + IL_002b: ldc.i4.0 + IL_002c: ceq + IL_002e: ret + } + + .method public hidebysig virtual final + instance bool Equals(object obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 4 + .locals init (class assembly/Point V_0) + IL_0000: ldarg.1 + IL_0001: isinst assembly/Point + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: brfalse.s IL_0012 + + IL_000a: ldarg.0 + IL_000b: ldloc.0 + IL_000c: callvirt instance bool assembly/Point::Equals(class assembly/Point) + IL_0011: ret + + IL_0012: ldc.i4.0 + IL_0013: ret + } + + .property instance int32 x() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32) = ( 01 00 04 00 00 00 00 00 00 00 00 00 ) + .set instance void assembly/Point::set_x(int32) + .get instance int32 assembly/Point::get_x() + } + .property instance int32 y() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32) = ( 01 00 04 00 00 00 01 00 00 00 00 00 ) + .set instance void assembly/Point::set_y(int32) + .get instance int32 assembly/Point::get_y() + } + } + + .method public static int32 pinObject() cil managed + { + + .maxstack 6 + .locals init (class assembly/Point V_0, + native int V_1, + int32& pinned V_2, + native int V_3, + int32 V_4, + native int V_5, + int32 V_6, + native int V_7, + int32 V_8, + native int V_9, + int32 V_10) + IL_0000: ldc.i4.1 + IL_0001: ldc.i4.2 + IL_0002: newobj instance void assembly/Point::.ctor(int32, + int32) + IL_0007: stloc.0 + IL_0008: ldloc.0 + IL_0009: ldflda int32 assembly/Point::x@ + IL_000e: stloc.2 + IL_000f: ldloc.2 + IL_0010: conv.i + IL_0011: stloc.1 + IL_0012: ldloc.1 + IL_0013: stloc.3 + IL_0014: ldc.i4.0 + IL_0015: stloc.s V_4 + IL_0017: ldloc.3 + IL_0018: stloc.s V_5 + IL_001a: ldloc.s V_4 + IL_001c: stloc.s V_6 + IL_001e: ldloc.s V_5 + IL_0020: ldloc.s V_6 + IL_0022: conv.i + IL_0023: sizeof [runtime]System.Int32 + IL_0029: mul + IL_002a: add + IL_002b: ldobj [runtime]System.Int32 + IL_0030: ldloc.1 + IL_0031: stloc.s V_7 + IL_0033: ldc.i4.1 + IL_0034: stloc.s V_8 + IL_0036: ldloc.s V_7 + IL_0038: stloc.s V_9 + IL_003a: ldloc.s V_8 + IL_003c: stloc.s V_10 + IL_003e: ldloc.s V_9 + IL_0040: ldloc.s V_10 + IL_0042: conv.i + IL_0043: sizeof [runtime]System.Int32 + IL_0049: mul + IL_004a: add + IL_004b: ldobj [runtime]System.Int32 + IL_0050: add + IL_0051: ret + } + + .method public static int32 pinRef() cil managed + { + + .maxstack 4 + .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 V_0, + native int V_1, + int32& pinned V_2) + IL_0000: ldc.i4.s 17 + IL_0002: call class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::Ref(!!0) + IL_0007: stloc.0 + IL_0008: ldloc.0 + IL_0009: ldflda !0 class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1::contents@ + IL_000e: stloc.2 + IL_000f: ldloc.2 + IL_0010: conv.i + IL_0011: stloc.1 + IL_0012: ldloc.1 + IL_0013: ldobj [runtime]System.Int32 + IL_0018: ldloc.1 + IL_0019: ldobj [runtime]System.Int32 + IL_001e: add + IL_001f: ret + } + + .method public static float64 pinArray1() cil managed + { + + .maxstack 6 + .locals init (float64[] V_0, + native int V_1, + float64[] V_2, + float64& pinned V_3, + native int V_4, + int32 V_5, + native int V_6, + int32 V_7, + native int V_8, + int32 V_9, + native int V_10, + int32 V_11) + IL_0000: ldc.i4.6 + IL_0001: newarr [runtime]System.Double + IL_0006: dup + IL_0007: ldc.i4.0 + IL_0008: ldc.r8 0.0 + IL_0011: stelem [runtime]System.Double + IL_0016: dup + IL_0017: ldc.i4.1 + IL_0018: ldc.r8 1.5 + IL_0021: stelem [runtime]System.Double + IL_0026: dup + IL_0027: ldc.i4.2 + IL_0028: ldc.r8 2.2999999999999998 + IL_0031: stelem [runtime]System.Double + IL_0036: dup + IL_0037: ldc.i4.3 + IL_0038: ldc.r8 3.3999999999999999 + IL_0041: stelem [runtime]System.Double + IL_0046: dup + IL_0047: ldc.i4.4 + IL_0048: ldc.r8 4.0999999999999996 + IL_0051: stelem [runtime]System.Double + IL_0056: dup + IL_0057: ldc.i4.5 + IL_0058: ldc.r8 5.9000000000000004 + IL_0061: stelem [runtime]System.Double + IL_0066: stloc.0 + IL_0067: ldloc.0 + IL_0068: stloc.2 + IL_0069: ldloc.2 + IL_006a: brfalse.s IL_0086 + + IL_006c: ldloc.2 + IL_006d: call int32 [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Length(!!0[]) + IL_0072: brfalse.s IL_0081 + + IL_0074: ldloc.2 + IL_0075: ldc.i4.0 + IL_0076: ldelema [runtime]System.Double + IL_007b: stloc.3 + IL_007c: ldloc.3 + IL_007d: conv.i + IL_007e: nop + IL_007f: br.s IL_0089 + + IL_0081: ldc.i4.0 + IL_0082: conv.i + IL_0083: nop + IL_0084: br.s IL_0089 + + IL_0086: ldc.i4.0 + IL_0087: conv.i + IL_0088: nop + IL_0089: stloc.1 + IL_008a: ldloc.1 + IL_008b: stloc.s V_4 + IL_008d: ldc.i4.0 + IL_008e: stloc.s V_5 + IL_0090: ldloc.s V_4 + IL_0092: stloc.s V_6 + IL_0094: ldloc.s V_5 + IL_0096: stloc.s V_7 + IL_0098: ldloc.s V_6 + IL_009a: ldloc.s V_7 + IL_009c: conv.i + IL_009d: sizeof [runtime]System.Double + IL_00a3: mul + IL_00a4: add + IL_00a5: ldobj [runtime]System.Double + IL_00aa: ldloc.1 + IL_00ab: stloc.s V_8 + IL_00ad: ldc.i4.1 + IL_00ae: stloc.s V_9 + IL_00b0: ldloc.s V_8 + IL_00b2: stloc.s V_10 + IL_00b4: ldloc.s V_9 + IL_00b6: stloc.s V_11 + IL_00b8: ldloc.s V_10 + IL_00ba: ldloc.s V_11 + IL_00bc: conv.i + IL_00bd: sizeof [runtime]System.Double + IL_00c3: mul + IL_00c4: add + IL_00c5: ldobj [runtime]System.Double + IL_00ca: add + IL_00cb: ret + } + + .method public static float64 pinArray2() cil managed + { + + .maxstack 6 + .locals init (float64[] V_0, + native int V_1, + float64& pinned V_2, + native int V_3, + int32 V_4, + native int V_5, + int32 V_6, + native int V_7, + int32 V_8, + native int V_9, + int32 V_10) + IL_0000: ldc.i4.6 + IL_0001: newarr [runtime]System.Double + IL_0006: dup + IL_0007: ldc.i4.0 + IL_0008: ldc.r8 0.0 + IL_0011: stelem [runtime]System.Double + IL_0016: dup + IL_0017: ldc.i4.1 + IL_0018: ldc.r8 1.5 + IL_0021: stelem [runtime]System.Double + IL_0026: dup + IL_0027: ldc.i4.2 + IL_0028: ldc.r8 2.2999999999999998 + IL_0031: stelem [runtime]System.Double + IL_0036: dup + IL_0037: ldc.i4.3 + IL_0038: ldc.r8 3.3999999999999999 + IL_0041: stelem [runtime]System.Double + IL_0046: dup + IL_0047: ldc.i4.4 + IL_0048: ldc.r8 4.0999999999999996 + IL_0051: stelem [runtime]System.Double + IL_0056: dup + IL_0057: ldc.i4.5 + IL_0058: ldc.r8 5.9000000000000004 + IL_0061: stelem [runtime]System.Double + IL_0066: stloc.0 + IL_0067: ldloc.0 + IL_0068: ldc.i4.0 + IL_0069: ldelema [runtime]System.Double + IL_006e: stloc.2 + IL_006f: ldloc.2 + IL_0070: conv.i + IL_0071: stloc.1 + IL_0072: ldloc.1 + IL_0073: stloc.3 + IL_0074: ldc.i4.0 + IL_0075: stloc.s V_4 + IL_0077: ldloc.3 + IL_0078: stloc.s V_5 + IL_007a: ldloc.s V_4 + IL_007c: stloc.s V_6 + IL_007e: ldloc.s V_5 + IL_0080: ldloc.s V_6 + IL_0082: conv.i + IL_0083: sizeof [runtime]System.Double + IL_0089: mul + IL_008a: add + IL_008b: ldobj [runtime]System.Double + IL_0090: ldloc.1 + IL_0091: stloc.s V_7 + IL_0093: ldc.i4.1 + IL_0094: stloc.s V_8 + IL_0096: ldloc.s V_7 + IL_0098: stloc.s V_9 + IL_009a: ldloc.s V_8 + IL_009c: stloc.s V_10 + IL_009e: ldloc.s V_9 + IL_00a0: ldloc.s V_10 + IL_00a2: conv.i + IL_00a3: sizeof [runtime]System.Double + IL_00a9: mul + IL_00aa: add + IL_00ab: ldobj [runtime]System.Double + IL_00b0: add + IL_00b1: ret + } + + .method public static class [runtime]System.Tuple`2 + pinString() cil managed + { + + .maxstack 6 + .locals init (string V_0, + native int V_1, + string pinned V_2, + native int V_3, + int32 V_4, + native int V_5, + int32 V_6, + native int V_7, + int32 V_8, + native int V_9, + int32 V_10) + IL_0000: ldstr "Hello World" + IL_0005: stloc.0 + IL_0006: ldloc.0 + IL_0007: stloc.2 + IL_0008: ldloc.2 + IL_0009: brfalse.s IL_0016 + + IL_000b: ldloc.2 + IL_000c: conv.i + IL_000d: call int32 [runtime]System.Runtime.CompilerServices.RuntimeHelpers::get_OffsetToStringData() + IL_0012: add + IL_0013: nop + IL_0014: br.s IL_0018 + + IL_0016: ldloc.2 + IL_0017: nop + IL_0018: stloc.1 + IL_0019: ldloc.1 + IL_001a: stloc.3 + IL_001b: ldc.i4.0 + IL_001c: stloc.s V_4 + IL_001e: ldloc.3 + IL_001f: stloc.s V_5 + IL_0021: ldloc.s V_4 + IL_0023: stloc.s V_6 + IL_0025: ldloc.s V_5 + IL_0027: ldloc.s V_6 + IL_0029: conv.i + IL_002a: sizeof [runtime]System.Char + IL_0030: mul + IL_0031: add + IL_0032: ldobj [runtime]System.Char + IL_0037: ldloc.1 + IL_0038: stloc.s V_7 + IL_003a: ldc.i4.1 + IL_003b: stloc.s V_8 + IL_003d: ldloc.s V_7 + IL_003f: stloc.s V_9 + IL_0041: ldloc.s V_8 + IL_0043: stloc.s V_10 + IL_0045: ldloc.s V_9 + IL_0047: ldloc.s V_10 + IL_0049: conv.i + IL_004a: sizeof [runtime]System.Char + IL_0050: mul + IL_0051: add + IL_0052: ldobj [runtime]System.Char + IL_0057: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, + !1) + IL_005c: ret + } + +} + +.class private abstract auto ansi sealed ''.$assembly + extends [runtime]System.Object +{ + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: ret + } + +} + +.class private auto ansi sealed System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes + extends [runtime]System.Enum +{ + .custom instance void [runtime]System.FlagsAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .field public specialname rtspecialname int32 value__ = int32(0x00000000) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes All = int32(0xFFFFFFFF) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes None = int32(0x00000000) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicParameterlessConstructor = int32(0x00000001) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicConstructors = int32(0x00000003) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicConstructors = int32(0x00000004) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicMethods = int32(0x00000008) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicMethods = int32(0x00000010) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicFields = int32(0x00000020) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicFields = int32(0x00000040) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicNestedTypes = int32(0x00000080) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicNestedTypes = int32(0x00000100) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicProperties = int32(0x00000200) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicProperties = int32(0x00000400) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicEvents = int32(0x00000800) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicEvents = int32(0x00001000) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes Interfaces = int32(0x00002000) +} + +.class private auto ansi beforefieldinit System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute + extends [runtime]System.Attribute +{ + .field private valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes MemberType@ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .field private class [runtime]System.Type Type@ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method public specialname rtspecialname + instance void .ctor(valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes MemberType, + class [runtime]System.Type Type) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void [runtime]System.Attribute::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::MemberType@ + IL_000d: ldarg.0 + IL_000e: ldarg.2 + IL_000f: stfld class [runtime]System.Type System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::Type@ + IL_0014: ret + } + + .method public hidebysig specialname instance class [runtime]System.Type + get_Type() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld class [runtime]System.Type System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::Type@ + IL_0006: ret + } + + .method private hidebysig specialname instance void + set_Type(class [runtime]System.Type 'value') cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: stfld class [runtime]System.Type System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::Type@ + IL_0007: ret + } + + .method public hidebysig specialname instance valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes + get_MemberType() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::MemberType@ + IL_0006: ret + } + + .method private hidebysig specialname instance void + set_MemberType(valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes 'value') cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: stfld valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::MemberType@ + IL_0007: ret + } + + .property instance valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes + MemberType() + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .set instance void System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::set_MemberType(valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes) + .get instance valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::get_MemberType() + } + .property instance class [runtime]System.Type + Type() + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .set instance void System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::set_Type(class [runtime]System.Type) + .get instance class [runtime]System.Type System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::get_Type() + } +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.net472.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.net472.release.bsl new file mode 100644 index 0000000000..ae1c94ba85 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.net472.release.bsl @@ -0,0 +1,951 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly assembly +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32, + int32, + int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 ) + + + + + .hash algorithm 0x00008004 + .ver 0:0:0:0 +} +.mresource public FSharpSignatureData.assembly +{ + + +} +.mresource public FSharpOptimizationData.assembly +{ + + +} +.module assembly.exe + +.imagebase {value} +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 +.corflags 0x00000001 + + + + + +.class public abstract auto ansi sealed assembly + extends [runtime]System.Object +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .class auto ansi serializable sealed nested public Point + extends [runtime]System.Object + implements class [runtime]System.IEquatable`1, + [runtime]System.Collections.IStructuralEquatable, + class [runtime]System.IComparable`1, + [runtime]System.IComparable, + [runtime]System.Collections.IStructuralComparable + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 02 00 00 00 00 00 ) + .field public int32 x@ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .field public int32 y@ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .method public hidebysig specialname + instance int32 get_x() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 assembly/Point::x@ + IL_0006: ret + } + + .method public hidebysig specialname + instance int32 get_y() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 assembly/Point::y@ + IL_0006: ret + } + + .method public hidebysig specialname + instance void set_x(int32 'value') cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: stfld int32 assembly/Point::x@ + IL_0007: ret + } + + .method public hidebysig specialname + instance void set_y(int32 'value') cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: stfld int32 assembly/Point::y@ + IL_0007: ret + } + + .method public specialname rtspecialname + instance void .ctor(int32 x, + int32 y) cil managed + { + .custom instance void System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::.ctor(valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes, + class [runtime]System.Type) = ( 01 00 60 06 00 00 14 54 65 73 74 46 75 6E 63 74 + 69 6F 6E 32 34 2B 50 6F 69 6E 74 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void [runtime]System.Object::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld int32 assembly/Point::x@ + IL_000d: ldarg.0 + IL_000e: ldarg.2 + IL_000f: stfld int32 assembly/Point::y@ + IL_0014: ret + } + + .method public strict virtual instance string + ToString() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldstr "%+A" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,class assembly/Point>::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_000f: ldarg.0 + IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0015: ret + } + + .method public hidebysig virtual final + instance int32 CompareTo(class assembly/Point obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 5 + .locals init (int32 V_0, + class [runtime]System.Collections.IComparer V_1, + int32 V_2, + int32 V_3, + class [runtime]System.Collections.IComparer V_4, + int32 V_5, + int32 V_6) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0057 + + IL_0003: ldarg.1 + IL_0004: brfalse.s IL_0055 + + IL_0006: call class [runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() + IL_000b: stloc.1 + IL_000c: ldarg.0 + IL_000d: ldfld int32 assembly/Point::x@ + IL_0012: stloc.2 + IL_0013: ldarg.1 + IL_0014: ldfld int32 assembly/Point::x@ + IL_0019: stloc.3 + IL_001a: ldloc.2 + IL_001b: ldloc.3 + IL_001c: cgt + IL_001e: ldloc.2 + IL_001f: ldloc.3 + IL_0020: clt + IL_0022: sub + IL_0023: stloc.0 + IL_0024: ldloc.0 + IL_0025: ldc.i4.0 + IL_0026: bge.s IL_002a + + IL_0028: ldloc.0 + IL_0029: ret + + IL_002a: ldloc.0 + IL_002b: ldc.i4.0 + IL_002c: ble.s IL_0030 + + IL_002e: ldloc.0 + IL_002f: ret + + IL_0030: call class [runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() + IL_0035: stloc.s V_4 + IL_0037: ldarg.0 + IL_0038: ldfld int32 assembly/Point::y@ + IL_003d: stloc.s V_5 + IL_003f: ldarg.1 + IL_0040: ldfld int32 assembly/Point::y@ + IL_0045: stloc.s V_6 + IL_0047: ldloc.s V_5 + IL_0049: ldloc.s V_6 + IL_004b: cgt + IL_004d: ldloc.s V_5 + IL_004f: ldloc.s V_6 + IL_0051: clt + IL_0053: sub + IL_0054: ret + + IL_0055: ldc.i4.1 + IL_0056: ret + + IL_0057: ldarg.1 + IL_0058: brfalse.s IL_005c + + IL_005a: ldc.i4.m1 + IL_005b: ret + + IL_005c: ldc.i4.0 + IL_005d: ret + } + + .method public hidebysig virtual final + instance int32 CompareTo(object obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: unbox.any assembly/Point + IL_0007: callvirt instance int32 assembly/Point::CompareTo(class assembly/Point) + IL_000c: ret + } + + .method public hidebysig virtual final + instance int32 CompareTo(object obj, + class [runtime]System.Collections.IComparer comp) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 5 + .locals init (class assembly/Point V_0, + class assembly/Point V_1, + int32 V_2, + class [runtime]System.Collections.IComparer V_3, + int32 V_4, + int32 V_5, + class [runtime]System.Collections.IComparer V_6, + int32 V_7, + int32 V_8) + IL_0000: ldarg.1 + IL_0001: unbox.any assembly/Point + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: stloc.1 + IL_0009: ldarg.0 + IL_000a: brfalse.s IL_0063 + + IL_000c: ldarg.1 + IL_000d: unbox.any assembly/Point + IL_0012: brfalse.s IL_0061 + + IL_0014: ldarg.2 + IL_0015: stloc.3 + IL_0016: ldarg.0 + IL_0017: ldfld int32 assembly/Point::x@ + IL_001c: stloc.s V_4 + IL_001e: ldloc.1 + IL_001f: ldfld int32 assembly/Point::x@ + IL_0024: stloc.s V_5 + IL_0026: ldloc.s V_4 + IL_0028: ldloc.s V_5 + IL_002a: cgt + IL_002c: ldloc.s V_4 + IL_002e: ldloc.s V_5 + IL_0030: clt + IL_0032: sub + IL_0033: stloc.2 + IL_0034: ldloc.2 + IL_0035: ldc.i4.0 + IL_0036: bge.s IL_003a + + IL_0038: ldloc.2 + IL_0039: ret + + IL_003a: ldloc.2 + IL_003b: ldc.i4.0 + IL_003c: ble.s IL_0040 + + IL_003e: ldloc.2 + IL_003f: ret + + IL_0040: ldarg.2 + IL_0041: stloc.s V_6 + IL_0043: ldarg.0 + IL_0044: ldfld int32 assembly/Point::y@ + IL_0049: stloc.s V_7 + IL_004b: ldloc.1 + IL_004c: ldfld int32 assembly/Point::y@ + IL_0051: stloc.s V_8 + IL_0053: ldloc.s V_7 + IL_0055: ldloc.s V_8 + IL_0057: cgt + IL_0059: ldloc.s V_7 + IL_005b: ldloc.s V_8 + IL_005d: clt + IL_005f: sub + IL_0060: ret + + IL_0061: ldc.i4.1 + IL_0062: ret + + IL_0063: ldarg.1 + IL_0064: unbox.any assembly/Point + IL_0069: brfalse.s IL_006d + + IL_006b: ldc.i4.m1 + IL_006c: ret + + IL_006d: ldc.i4.0 + IL_006e: ret + } + + .method public hidebysig virtual final + instance int32 GetHashCode(class [runtime]System.Collections.IEqualityComparer comp) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 7 + .locals init (int32 V_0, + class [runtime]System.Collections.IEqualityComparer V_1, + class [runtime]System.Collections.IEqualityComparer V_2) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0035 + + IL_0003: ldc.i4.0 + IL_0004: stloc.0 + IL_0005: ldc.i4 0x9e3779b9 + IL_000a: ldarg.1 + IL_000b: stloc.1 + IL_000c: ldarg.0 + IL_000d: ldfld int32 assembly/Point::y@ + IL_0012: ldloc.0 + IL_0013: ldc.i4.6 + IL_0014: shl + IL_0015: ldloc.0 + IL_0016: ldc.i4.2 + IL_0017: shr + IL_0018: add + IL_0019: add + IL_001a: add + IL_001b: stloc.0 + IL_001c: ldc.i4 0x9e3779b9 + IL_0021: ldarg.1 + IL_0022: stloc.2 + IL_0023: ldarg.0 + IL_0024: ldfld int32 assembly/Point::x@ + IL_0029: ldloc.0 + IL_002a: ldc.i4.6 + IL_002b: shl + IL_002c: ldloc.0 + IL_002d: ldc.i4.2 + IL_002e: shr + IL_002f: add + IL_0030: add + IL_0031: add + IL_0032: stloc.0 + IL_0033: ldloc.0 + IL_0034: ret + + IL_0035: ldc.i4.0 + IL_0036: ret + } + + .method public hidebysig virtual final + instance int32 GetHashCode() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call class [runtime]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer() + IL_0006: callvirt instance int32 assembly/Point::GetHashCode(class [runtime]System.Collections.IEqualityComparer) + IL_000b: ret + } + + .method public hidebysig virtual final + instance bool Equals(object obj, + class [runtime]System.Collections.IEqualityComparer comp) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 4 + .locals init (class assembly/Point V_0, + class assembly/Point V_1, + class [runtime]System.Collections.IEqualityComparer V_2, + class [runtime]System.Collections.IEqualityComparer V_3) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0036 + + IL_0003: ldarg.1 + IL_0004: isinst assembly/Point + IL_0009: stloc.0 + IL_000a: ldloc.0 + IL_000b: brfalse.s IL_0034 + + IL_000d: ldloc.0 + IL_000e: stloc.1 + IL_000f: ldarg.2 + IL_0010: stloc.2 + IL_0011: ldarg.0 + IL_0012: ldfld int32 assembly/Point::x@ + IL_0017: ldloc.1 + IL_0018: ldfld int32 assembly/Point::x@ + IL_001d: ceq + IL_001f: brfalse.s IL_0032 + + IL_0021: ldarg.2 + IL_0022: stloc.3 + IL_0023: ldarg.0 + IL_0024: ldfld int32 assembly/Point::y@ + IL_0029: ldloc.1 + IL_002a: ldfld int32 assembly/Point::y@ + IL_002f: ceq + IL_0031: ret + + IL_0032: ldc.i4.0 + IL_0033: ret + + IL_0034: ldc.i4.0 + IL_0035: ret + + IL_0036: ldarg.1 + IL_0037: ldnull + IL_0038: cgt.un + IL_003a: ldc.i4.0 + IL_003b: ceq + IL_003d: ret + } + + .method public hidebysig virtual final + instance bool Equals(class assembly/Point obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0027 + + IL_0003: ldarg.1 + IL_0004: brfalse.s IL_0025 + + IL_0006: ldarg.0 + IL_0007: ldfld int32 assembly/Point::x@ + IL_000c: ldarg.1 + IL_000d: ldfld int32 assembly/Point::x@ + IL_0012: bne.un.s IL_0023 + + IL_0014: ldarg.0 + IL_0015: ldfld int32 assembly/Point::y@ + IL_001a: ldarg.1 + IL_001b: ldfld int32 assembly/Point::y@ + IL_0020: ceq + IL_0022: ret + + IL_0023: ldc.i4.0 + IL_0024: ret + + IL_0025: ldc.i4.0 + IL_0026: ret + + IL_0027: ldarg.1 + IL_0028: ldnull + IL_0029: cgt.un + IL_002b: ldc.i4.0 + IL_002c: ceq + IL_002e: ret + } + + .method public hidebysig virtual final + instance bool Equals(object obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 4 + .locals init (class assembly/Point V_0) + IL_0000: ldarg.1 + IL_0001: isinst assembly/Point + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: brfalse.s IL_0012 + + IL_000a: ldarg.0 + IL_000b: ldloc.0 + IL_000c: callvirt instance bool assembly/Point::Equals(class assembly/Point) + IL_0011: ret + + IL_0012: ldc.i4.0 + IL_0013: ret + } + + .property instance int32 x() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32) = ( 01 00 04 00 00 00 00 00 00 00 00 00 ) + .set instance void assembly/Point::set_x(int32) + .get instance int32 assembly/Point::get_x() + } + .property instance int32 y() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32) = ( 01 00 04 00 00 00 01 00 00 00 00 00 ) + .set instance void assembly/Point::set_y(int32) + .get instance int32 assembly/Point::get_y() + } + } + + .method public static int32 pinObject() cil managed + { + + .maxstack 6 + .locals init (class assembly/Point V_0, + native int V_1, + int32& pinned V_2, + native int V_3, + int32 V_4, + native int V_5, + int32 V_6) + IL_0000: ldc.i4.1 + IL_0001: ldc.i4.2 + IL_0002: newobj instance void assembly/Point::.ctor(int32, + int32) + IL_0007: stloc.0 + IL_0008: ldloc.0 + IL_0009: ldflda int32 assembly/Point::x@ + IL_000e: stloc.2 + IL_000f: ldloc.2 + IL_0010: conv.i + IL_0011: stloc.1 + IL_0012: ldloc.1 + IL_0013: stloc.3 + IL_0014: ldc.i4.0 + IL_0015: stloc.s V_4 + IL_0017: ldloc.3 + IL_0018: ldloc.s V_4 + IL_001a: conv.i + IL_001b: sizeof [runtime]System.Int32 + IL_0021: mul + IL_0022: add + IL_0023: ldobj [runtime]System.Int32 + IL_0028: ldloc.1 + IL_0029: stloc.s V_5 + IL_002b: ldc.i4.1 + IL_002c: stloc.s V_6 + IL_002e: ldloc.s V_5 + IL_0030: ldloc.s V_6 + IL_0032: conv.i + IL_0033: sizeof [runtime]System.Int32 + IL_0039: mul + IL_003a: add + IL_003b: ldobj [runtime]System.Int32 + IL_0040: add + IL_0041: ret + } + + .method public static int32 pinRef() cil managed + { + + .maxstack 4 + .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 V_0, + native int V_1, + int32& pinned V_2) + IL_0000: ldc.i4.s 17 + IL_0002: call class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::Ref(!!0) + IL_0007: stloc.0 + IL_0008: ldloc.0 + IL_0009: ldflda !0 class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1::contents@ + IL_000e: stloc.2 + IL_000f: ldloc.2 + IL_0010: conv.i + IL_0011: stloc.1 + IL_0012: ldloc.1 + IL_0013: ldobj [runtime]System.Int32 + IL_0018: ldloc.1 + IL_0019: ldobj [runtime]System.Int32 + IL_001e: add + IL_001f: ret + } + + .method public static float64 pinArray1() cil managed + { + + .maxstack 6 + .locals init (float64[] V_0, + native int V_1, + float64[] V_2, + float64& pinned V_3, + native int V_4, + int32 V_5, + native int V_6, + int32 V_7) + IL_0000: ldc.i4.6 + IL_0001: newarr [runtime]System.Double + IL_0006: dup + IL_0007: ldc.i4.0 + IL_0008: ldc.r8 0.0 + IL_0011: stelem [runtime]System.Double + IL_0016: dup + IL_0017: ldc.i4.1 + IL_0018: ldc.r8 1.5 + IL_0021: stelem [runtime]System.Double + IL_0026: dup + IL_0027: ldc.i4.2 + IL_0028: ldc.r8 2.2999999999999998 + IL_0031: stelem [runtime]System.Double + IL_0036: dup + IL_0037: ldc.i4.3 + IL_0038: ldc.r8 3.3999999999999999 + IL_0041: stelem [runtime]System.Double + IL_0046: dup + IL_0047: ldc.i4.4 + IL_0048: ldc.r8 4.0999999999999996 + IL_0051: stelem [runtime]System.Double + IL_0056: dup + IL_0057: ldc.i4.5 + IL_0058: ldc.r8 5.9000000000000004 + IL_0061: stelem [runtime]System.Double + IL_0066: stloc.0 + IL_0067: ldloc.0 + IL_0068: stloc.2 + IL_0069: ldloc.2 + IL_006a: brfalse.s IL_0086 + + IL_006c: ldloc.2 + IL_006d: call int32 [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Length(!!0[]) + IL_0072: brfalse.s IL_0081 + + IL_0074: ldloc.2 + IL_0075: ldc.i4.0 + IL_0076: ldelema [runtime]System.Double + IL_007b: stloc.3 + IL_007c: ldloc.3 + IL_007d: conv.i + IL_007e: nop + IL_007f: br.s IL_0089 + + IL_0081: ldc.i4.0 + IL_0082: conv.i + IL_0083: nop + IL_0084: br.s IL_0089 + + IL_0086: ldc.i4.0 + IL_0087: conv.i + IL_0088: nop + IL_0089: stloc.1 + IL_008a: ldloc.1 + IL_008b: stloc.s V_4 + IL_008d: ldc.i4.0 + IL_008e: stloc.s V_5 + IL_0090: ldloc.s V_4 + IL_0092: ldloc.s V_5 + IL_0094: conv.i + IL_0095: sizeof [runtime]System.Double + IL_009b: mul + IL_009c: add + IL_009d: ldobj [runtime]System.Double + IL_00a2: ldloc.1 + IL_00a3: stloc.s V_6 + IL_00a5: ldc.i4.1 + IL_00a6: stloc.s V_7 + IL_00a8: ldloc.s V_6 + IL_00aa: ldloc.s V_7 + IL_00ac: conv.i + IL_00ad: sizeof [runtime]System.Double + IL_00b3: mul + IL_00b4: add + IL_00b5: ldobj [runtime]System.Double + IL_00ba: add + IL_00bb: ret + } + + .method public static float64 pinArray2() cil managed + { + + .maxstack 6 + .locals init (float64[] V_0, + native int V_1, + float64& pinned V_2, + native int V_3, + int32 V_4, + native int V_5, + int32 V_6) + IL_0000: ldc.i4.6 + IL_0001: newarr [runtime]System.Double + IL_0006: dup + IL_0007: ldc.i4.0 + IL_0008: ldc.r8 0.0 + IL_0011: stelem [runtime]System.Double + IL_0016: dup + IL_0017: ldc.i4.1 + IL_0018: ldc.r8 1.5 + IL_0021: stelem [runtime]System.Double + IL_0026: dup + IL_0027: ldc.i4.2 + IL_0028: ldc.r8 2.2999999999999998 + IL_0031: stelem [runtime]System.Double + IL_0036: dup + IL_0037: ldc.i4.3 + IL_0038: ldc.r8 3.3999999999999999 + IL_0041: stelem [runtime]System.Double + IL_0046: dup + IL_0047: ldc.i4.4 + IL_0048: ldc.r8 4.0999999999999996 + IL_0051: stelem [runtime]System.Double + IL_0056: dup + IL_0057: ldc.i4.5 + IL_0058: ldc.r8 5.9000000000000004 + IL_0061: stelem [runtime]System.Double + IL_0066: stloc.0 + IL_0067: ldloc.0 + IL_0068: ldc.i4.0 + IL_0069: ldelema [runtime]System.Double + IL_006e: stloc.2 + IL_006f: ldloc.2 + IL_0070: conv.i + IL_0071: stloc.1 + IL_0072: ldloc.1 + IL_0073: stloc.3 + IL_0074: ldc.i4.0 + IL_0075: stloc.s V_4 + IL_0077: ldloc.3 + IL_0078: ldloc.s V_4 + IL_007a: conv.i + IL_007b: sizeof [runtime]System.Double + IL_0081: mul + IL_0082: add + IL_0083: ldobj [runtime]System.Double + IL_0088: ldloc.1 + IL_0089: stloc.s V_5 + IL_008b: ldc.i4.1 + IL_008c: stloc.s V_6 + IL_008e: ldloc.s V_5 + IL_0090: ldloc.s V_6 + IL_0092: conv.i + IL_0093: sizeof [runtime]System.Double + IL_0099: mul + IL_009a: add + IL_009b: ldobj [runtime]System.Double + IL_00a0: add + IL_00a1: ret + } + + .method public static class [runtime]System.Tuple`2 + pinString() cil managed + { + + .maxstack 6 + .locals init (string V_0, + native int V_1, + string pinned V_2, + native int V_3, + int32 V_4, + native int V_5, + int32 V_6) + IL_0000: ldstr "Hello World" + IL_0005: stloc.0 + IL_0006: ldloc.0 + IL_0007: stloc.2 + IL_0008: ldloc.2 + IL_0009: brfalse.s IL_0016 + + IL_000b: ldloc.2 + IL_000c: conv.i + IL_000d: call int32 [runtime]System.Runtime.CompilerServices.RuntimeHelpers::get_OffsetToStringData() + IL_0012: add + IL_0013: nop + IL_0014: br.s IL_0018 + + IL_0016: ldloc.2 + IL_0017: nop + IL_0018: stloc.1 + IL_0019: ldloc.1 + IL_001a: stloc.3 + IL_001b: ldc.i4.0 + IL_001c: stloc.s V_4 + IL_001e: ldloc.3 + IL_001f: ldloc.s V_4 + IL_0021: conv.i + IL_0022: sizeof [runtime]System.Char + IL_0028: mul + IL_0029: add + IL_002a: ldobj [runtime]System.Char + IL_002f: ldloc.1 + IL_0030: stloc.s V_5 + IL_0032: ldc.i4.1 + IL_0033: stloc.s V_6 + IL_0035: ldloc.s V_5 + IL_0037: ldloc.s V_6 + IL_0039: conv.i + IL_003a: sizeof [runtime]System.Char + IL_0040: mul + IL_0041: add + IL_0042: ldobj [runtime]System.Char + IL_0047: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, + !1) + IL_004c: ret + } + +} + +.class private abstract auto ansi sealed ''.$assembly + extends [runtime]System.Object +{ + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: ret + } + +} + +.class private auto ansi sealed System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes + extends [runtime]System.Enum +{ + .custom instance void [runtime]System.FlagsAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .field public specialname rtspecialname int32 value__ = int32(0x00000000) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes All = int32(0xFFFFFFFF) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes None = int32(0x00000000) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicParameterlessConstructor = int32(0x00000001) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicConstructors = int32(0x00000003) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicConstructors = int32(0x00000004) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicMethods = int32(0x00000008) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicMethods = int32(0x00000010) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicFields = int32(0x00000020) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicFields = int32(0x00000040) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicNestedTypes = int32(0x00000080) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicNestedTypes = int32(0x00000100) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicProperties = int32(0x00000200) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicProperties = int32(0x00000400) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicEvents = int32(0x00000800) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicEvents = int32(0x00001000) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes Interfaces = int32(0x00002000) +} + +.class private auto ansi beforefieldinit System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute + extends [runtime]System.Attribute +{ + .field private valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes MemberType@ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .field private class [runtime]System.Type Type@ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method public specialname rtspecialname + instance void .ctor(valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes MemberType, + class [runtime]System.Type Type) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void [runtime]System.Attribute::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::MemberType@ + IL_000d: ldarg.0 + IL_000e: ldarg.2 + IL_000f: stfld class [runtime]System.Type System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::Type@ + IL_0014: ret + } + + .method public hidebysig specialname instance class [runtime]System.Type + get_Type() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld class [runtime]System.Type System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::Type@ + IL_0006: ret + } + + .method private hidebysig specialname instance void + set_Type(class [runtime]System.Type 'value') cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: stfld class [runtime]System.Type System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::Type@ + IL_0007: ret + } + + .method public hidebysig specialname instance valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes + get_MemberType() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::MemberType@ + IL_0006: ret + } + + .method private hidebysig specialname instance void + set_MemberType(valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes 'value') cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: stfld valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::MemberType@ + IL_0007: ret + } + + .property instance valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes + MemberType() + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .set instance void System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::set_MemberType(valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes) + .get instance valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::get_MemberType() + } + .property instance class [runtime]System.Type + Type() + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .set instance void System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::set_Type(class [runtime]System.Type) + .get instance class [runtime]System.Type System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::get_Type() + } +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.netcore.debug.bsl similarity index 98% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.debug.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.netcore.debug.bsl index f907620104..0d1379d849 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.debug.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.netcore.debug.bsl @@ -112,6 +112,9 @@ instance void .ctor(int32 x, int32 y) cil managed { + .custom instance void [runtime]System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::.ctor(valuetype [runtime]System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes, + class [runtime]System.Type) = ( 01 00 60 06 00 00 14 54 65 73 74 46 75 6E 63 74 + 69 6F 6E 32 34 2B 50 6F 69 6E 74 00 00 ) .maxstack 8 IL_0000: ldarg.0 diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.netcore.release.bsl similarity index 96% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.release.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.netcore.release.bsl index 00c889ed8b..b020e9a326 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.netcore.release.bsl @@ -1,827 +1,830 @@ - - - - - -.assembly extern runtime { } -.assembly extern FSharp.Core { } -.assembly assembly -{ - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32, - int32, - int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 ) - - - - - .hash algorithm 0x00008004 - .ver 0:0:0:0 -} -.mresource public FSharpSignatureData.assembly -{ - - -} -.mresource public FSharpOptimizationData.assembly -{ - - -} -.module assembly.exe - -.imagebase {value} -.file alignment 0x00000200 -.stackreserve 0x00100000 -.subsystem 0x0003 -.corflags 0x00000001 - - - - - -.class public abstract auto ansi sealed assembly - extends [runtime]System.Object -{ - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) - .class auto ansi serializable sealed nested public Point - extends [runtime]System.Object - implements class [runtime]System.IEquatable`1, - [runtime]System.Collections.IStructuralEquatable, - class [runtime]System.IComparable`1, - [runtime]System.IComparable, - [runtime]System.Collections.IStructuralComparable - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 02 00 00 00 00 00 ) - .field public int32 x@ - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) - .field public int32 y@ - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) - .method public hidebysig specialname - instance int32 get_x() cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: ldfld int32 assembly/Point::x@ - IL_0006: ret - } - - .method public hidebysig specialname - instance int32 get_y() cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: ldfld int32 assembly/Point::y@ - IL_0006: ret - } - - .method public hidebysig specialname - instance void set_x(int32 'value') cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: ldarg.1 - IL_0002: stfld int32 assembly/Point::x@ - IL_0007: ret - } - - .method public hidebysig specialname - instance void set_y(int32 'value') cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: ldarg.1 - IL_0002: stfld int32 assembly/Point::y@ - IL_0007: ret - } - - .method public specialname rtspecialname - instance void .ctor(int32 x, - int32 y) cil managed - { - - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: call instance void [runtime]System.Object::.ctor() - IL_0006: ldarg.0 - IL_0007: ldarg.1 - IL_0008: stfld int32 assembly/Point::x@ - IL_000d: ldarg.0 - IL_000e: ldarg.2 - IL_000f: stfld int32 assembly/Point::y@ - IL_0014: ret - } - - .method public strict virtual instance string - ToString() cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 8 - IL_0000: ldstr "%+A" - IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,class assembly/Point>::.ctor(string) - IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) - IL_000f: ldarg.0 - IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) - IL_0015: ret - } - - .method public hidebysig virtual final - instance int32 CompareTo(class assembly/Point obj) cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 5 - .locals init (int32 V_0, - class [runtime]System.Collections.IComparer V_1, - int32 V_2, - int32 V_3, - class [runtime]System.Collections.IComparer V_4, - int32 V_5, - int32 V_6) - IL_0000: ldarg.0 - IL_0001: brfalse.s IL_0057 - - IL_0003: ldarg.1 - IL_0004: brfalse.s IL_0055 - - IL_0006: call class [runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() - IL_000b: stloc.1 - IL_000c: ldarg.0 - IL_000d: ldfld int32 assembly/Point::x@ - IL_0012: stloc.2 - IL_0013: ldarg.1 - IL_0014: ldfld int32 assembly/Point::x@ - IL_0019: stloc.3 - IL_001a: ldloc.2 - IL_001b: ldloc.3 - IL_001c: cgt - IL_001e: ldloc.2 - IL_001f: ldloc.3 - IL_0020: clt - IL_0022: sub - IL_0023: stloc.0 - IL_0024: ldloc.0 - IL_0025: ldc.i4.0 - IL_0026: bge.s IL_002a - - IL_0028: ldloc.0 - IL_0029: ret - - IL_002a: ldloc.0 - IL_002b: ldc.i4.0 - IL_002c: ble.s IL_0030 - - IL_002e: ldloc.0 - IL_002f: ret - - IL_0030: call class [runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() - IL_0035: stloc.s V_4 - IL_0037: ldarg.0 - IL_0038: ldfld int32 assembly/Point::y@ - IL_003d: stloc.s V_5 - IL_003f: ldarg.1 - IL_0040: ldfld int32 assembly/Point::y@ - IL_0045: stloc.s V_6 - IL_0047: ldloc.s V_5 - IL_0049: ldloc.s V_6 - IL_004b: cgt - IL_004d: ldloc.s V_5 - IL_004f: ldloc.s V_6 - IL_0051: clt - IL_0053: sub - IL_0054: ret - - IL_0055: ldc.i4.1 - IL_0056: ret - - IL_0057: ldarg.1 - IL_0058: brfalse.s IL_005c - - IL_005a: ldc.i4.m1 - IL_005b: ret - - IL_005c: ldc.i4.0 - IL_005d: ret - } - - .method public hidebysig virtual final - instance int32 CompareTo(object obj) cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: ldarg.1 - IL_0002: unbox.any assembly/Point - IL_0007: callvirt instance int32 assembly/Point::CompareTo(class assembly/Point) - IL_000c: ret - } - - .method public hidebysig virtual final - instance int32 CompareTo(object obj, - class [runtime]System.Collections.IComparer comp) cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 5 - .locals init (class assembly/Point V_0, - class assembly/Point V_1, - int32 V_2, - class [runtime]System.Collections.IComparer V_3, - int32 V_4, - int32 V_5, - class [runtime]System.Collections.IComparer V_6, - int32 V_7, - int32 V_8) - IL_0000: ldarg.1 - IL_0001: unbox.any assembly/Point - IL_0006: stloc.0 - IL_0007: ldloc.0 - IL_0008: stloc.1 - IL_0009: ldarg.0 - IL_000a: brfalse.s IL_0063 - - IL_000c: ldarg.1 - IL_000d: unbox.any assembly/Point - IL_0012: brfalse.s IL_0061 - - IL_0014: ldarg.2 - IL_0015: stloc.3 - IL_0016: ldarg.0 - IL_0017: ldfld int32 assembly/Point::x@ - IL_001c: stloc.s V_4 - IL_001e: ldloc.1 - IL_001f: ldfld int32 assembly/Point::x@ - IL_0024: stloc.s V_5 - IL_0026: ldloc.s V_4 - IL_0028: ldloc.s V_5 - IL_002a: cgt - IL_002c: ldloc.s V_4 - IL_002e: ldloc.s V_5 - IL_0030: clt - IL_0032: sub - IL_0033: stloc.2 - IL_0034: ldloc.2 - IL_0035: ldc.i4.0 - IL_0036: bge.s IL_003a - - IL_0038: ldloc.2 - IL_0039: ret - - IL_003a: ldloc.2 - IL_003b: ldc.i4.0 - IL_003c: ble.s IL_0040 - - IL_003e: ldloc.2 - IL_003f: ret - - IL_0040: ldarg.2 - IL_0041: stloc.s V_6 - IL_0043: ldarg.0 - IL_0044: ldfld int32 assembly/Point::y@ - IL_0049: stloc.s V_7 - IL_004b: ldloc.1 - IL_004c: ldfld int32 assembly/Point::y@ - IL_0051: stloc.s V_8 - IL_0053: ldloc.s V_7 - IL_0055: ldloc.s V_8 - IL_0057: cgt - IL_0059: ldloc.s V_7 - IL_005b: ldloc.s V_8 - IL_005d: clt - IL_005f: sub - IL_0060: ret - - IL_0061: ldc.i4.1 - IL_0062: ret - - IL_0063: ldarg.1 - IL_0064: unbox.any assembly/Point - IL_0069: brfalse.s IL_006d - - IL_006b: ldc.i4.m1 - IL_006c: ret - - IL_006d: ldc.i4.0 - IL_006e: ret - } - - .method public hidebysig virtual final - instance int32 GetHashCode(class [runtime]System.Collections.IEqualityComparer comp) cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 7 - .locals init (int32 V_0, - class [runtime]System.Collections.IEqualityComparer V_1, - class [runtime]System.Collections.IEqualityComparer V_2) - IL_0000: ldarg.0 - IL_0001: brfalse.s IL_0035 - - IL_0003: ldc.i4.0 - IL_0004: stloc.0 - IL_0005: ldc.i4 0x9e3779b9 - IL_000a: ldarg.1 - IL_000b: stloc.1 - IL_000c: ldarg.0 - IL_000d: ldfld int32 assembly/Point::y@ - IL_0012: ldloc.0 - IL_0013: ldc.i4.6 - IL_0014: shl - IL_0015: ldloc.0 - IL_0016: ldc.i4.2 - IL_0017: shr - IL_0018: add - IL_0019: add - IL_001a: add - IL_001b: stloc.0 - IL_001c: ldc.i4 0x9e3779b9 - IL_0021: ldarg.1 - IL_0022: stloc.2 - IL_0023: ldarg.0 - IL_0024: ldfld int32 assembly/Point::x@ - IL_0029: ldloc.0 - IL_002a: ldc.i4.6 - IL_002b: shl - IL_002c: ldloc.0 - IL_002d: ldc.i4.2 - IL_002e: shr - IL_002f: add - IL_0030: add - IL_0031: add - IL_0032: stloc.0 - IL_0033: ldloc.0 - IL_0034: ret - - IL_0035: ldc.i4.0 - IL_0036: ret - } - - .method public hidebysig virtual final - instance int32 GetHashCode() cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: call class [runtime]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer() - IL_0006: callvirt instance int32 assembly/Point::GetHashCode(class [runtime]System.Collections.IEqualityComparer) - IL_000b: ret - } - - .method public hidebysig virtual final - instance bool Equals(object obj, - class [runtime]System.Collections.IEqualityComparer comp) cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 4 - .locals init (class assembly/Point V_0, - class assembly/Point V_1, - class [runtime]System.Collections.IEqualityComparer V_2, - class [runtime]System.Collections.IEqualityComparer V_3) - IL_0000: ldarg.0 - IL_0001: brfalse.s IL_0036 - - IL_0003: ldarg.1 - IL_0004: isinst assembly/Point - IL_0009: stloc.0 - IL_000a: ldloc.0 - IL_000b: brfalse.s IL_0034 - - IL_000d: ldloc.0 - IL_000e: stloc.1 - IL_000f: ldarg.2 - IL_0010: stloc.2 - IL_0011: ldarg.0 - IL_0012: ldfld int32 assembly/Point::x@ - IL_0017: ldloc.1 - IL_0018: ldfld int32 assembly/Point::x@ - IL_001d: ceq - IL_001f: brfalse.s IL_0032 - - IL_0021: ldarg.2 - IL_0022: stloc.3 - IL_0023: ldarg.0 - IL_0024: ldfld int32 assembly/Point::y@ - IL_0029: ldloc.1 - IL_002a: ldfld int32 assembly/Point::y@ - IL_002f: ceq - IL_0031: ret - - IL_0032: ldc.i4.0 - IL_0033: ret - - IL_0034: ldc.i4.0 - IL_0035: ret - - IL_0036: ldarg.1 - IL_0037: ldnull - IL_0038: cgt.un - IL_003a: ldc.i4.0 - IL_003b: ceq - IL_003d: ret - } - - .method public hidebysig virtual final - instance bool Equals(class assembly/Point obj) cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: brfalse.s IL_0027 - - IL_0003: ldarg.1 - IL_0004: brfalse.s IL_0025 - - IL_0006: ldarg.0 - IL_0007: ldfld int32 assembly/Point::x@ - IL_000c: ldarg.1 - IL_000d: ldfld int32 assembly/Point::x@ - IL_0012: bne.un.s IL_0023 - - IL_0014: ldarg.0 - IL_0015: ldfld int32 assembly/Point::y@ - IL_001a: ldarg.1 - IL_001b: ldfld int32 assembly/Point::y@ - IL_0020: ceq - IL_0022: ret - - IL_0023: ldc.i4.0 - IL_0024: ret - - IL_0025: ldc.i4.0 - IL_0026: ret - - IL_0027: ldarg.1 - IL_0028: ldnull - IL_0029: cgt.un - IL_002b: ldc.i4.0 - IL_002c: ceq - IL_002e: ret - } - - .method public hidebysig virtual final - instance bool Equals(object obj) cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 4 - .locals init (class assembly/Point V_0) - IL_0000: ldarg.1 - IL_0001: isinst assembly/Point - IL_0006: stloc.0 - IL_0007: ldloc.0 - IL_0008: brfalse.s IL_0012 - - IL_000a: ldarg.0 - IL_000b: ldloc.0 - IL_000c: callvirt instance bool assembly/Point::Equals(class assembly/Point) - IL_0011: ret - - IL_0012: ldc.i4.0 - IL_0013: ret - } - - .property instance int32 x() - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, - int32) = ( 01 00 04 00 00 00 00 00 00 00 00 00 ) - .set instance void assembly/Point::set_x(int32) - .get instance int32 assembly/Point::get_x() - } - .property instance int32 y() - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, - int32) = ( 01 00 04 00 00 00 01 00 00 00 00 00 ) - .set instance void assembly/Point::set_y(int32) - .get instance int32 assembly/Point::get_y() - } - } - - .method public static int32 pinObject() cil managed - { - - .maxstack 6 - .locals init (class assembly/Point V_0, - native int V_1, - int32& pinned V_2, - native int V_3, - int32 V_4, - native int V_5, - int32 V_6) - IL_0000: ldc.i4.1 - IL_0001: ldc.i4.2 - IL_0002: newobj instance void assembly/Point::.ctor(int32, - int32) - IL_0007: stloc.0 - IL_0008: ldloc.0 - IL_0009: ldflda int32 assembly/Point::x@ - IL_000e: stloc.2 - IL_000f: ldloc.2 - IL_0010: conv.i - IL_0011: stloc.1 - IL_0012: ldloc.1 - IL_0013: stloc.3 - IL_0014: ldc.i4.0 - IL_0015: stloc.s V_4 - IL_0017: ldloc.3 - IL_0018: ldloc.s V_4 - IL_001a: conv.i - IL_001b: sizeof [runtime]System.Int32 - IL_0021: mul - IL_0022: add - IL_0023: ldobj [runtime]System.Int32 - IL_0028: ldloc.1 - IL_0029: stloc.s V_5 - IL_002b: ldc.i4.1 - IL_002c: stloc.s V_6 - IL_002e: ldloc.s V_5 - IL_0030: ldloc.s V_6 - IL_0032: conv.i - IL_0033: sizeof [runtime]System.Int32 - IL_0039: mul - IL_003a: add - IL_003b: ldobj [runtime]System.Int32 - IL_0040: add - IL_0041: ret - } - - .method public static int32 pinRef() cil managed - { - - .maxstack 4 - .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 V_0, - native int V_1, - int32& pinned V_2) - IL_0000: ldc.i4.s 17 - IL_0002: call class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::Ref(!!0) - IL_0007: stloc.0 - IL_0008: ldloc.0 - IL_0009: ldflda !0 class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1::contents@ - IL_000e: stloc.2 - IL_000f: ldloc.2 - IL_0010: conv.i - IL_0011: stloc.1 - IL_0012: ldloc.1 - IL_0013: ldobj [runtime]System.Int32 - IL_0018: ldloc.1 - IL_0019: ldobj [runtime]System.Int32 - IL_001e: add - IL_001f: ret - } - - .method public static float64 pinArray1() cil managed - { - - .maxstack 6 - .locals init (float64[] V_0, - native int V_1, - float64[] V_2, - float64& pinned V_3, - native int V_4, - int32 V_5, - native int V_6, - int32 V_7) - IL_0000: ldc.i4.6 - IL_0001: newarr [runtime]System.Double - IL_0006: dup - IL_0007: ldc.i4.0 - IL_0008: ldc.r8 0.0 - IL_0011: stelem [runtime]System.Double - IL_0016: dup - IL_0017: ldc.i4.1 - IL_0018: ldc.r8 1.5 - IL_0021: stelem [runtime]System.Double - IL_0026: dup - IL_0027: ldc.i4.2 - IL_0028: ldc.r8 2.2999999999999998 - IL_0031: stelem [runtime]System.Double - IL_0036: dup - IL_0037: ldc.i4.3 - IL_0038: ldc.r8 3.3999999999999999 - IL_0041: stelem [runtime]System.Double - IL_0046: dup - IL_0047: ldc.i4.4 - IL_0048: ldc.r8 4.0999999999999996 - IL_0051: stelem [runtime]System.Double - IL_0056: dup - IL_0057: ldc.i4.5 - IL_0058: ldc.r8 5.9000000000000004 - IL_0061: stelem [runtime]System.Double - IL_0066: stloc.0 - IL_0067: ldloc.0 - IL_0068: stloc.2 - IL_0069: ldloc.2 - IL_006a: brfalse.s IL_0086 - - IL_006c: ldloc.2 - IL_006d: call int32 [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Length(!!0[]) - IL_0072: brfalse.s IL_0081 - - IL_0074: ldloc.2 - IL_0075: ldc.i4.0 - IL_0076: ldelema [runtime]System.Double - IL_007b: stloc.3 - IL_007c: ldloc.3 - IL_007d: conv.i - IL_007e: nop - IL_007f: br.s IL_0089 - - IL_0081: ldc.i4.0 - IL_0082: conv.i - IL_0083: nop - IL_0084: br.s IL_0089 - - IL_0086: ldc.i4.0 - IL_0087: conv.i - IL_0088: nop - IL_0089: stloc.1 - IL_008a: ldloc.1 - IL_008b: stloc.s V_4 - IL_008d: ldc.i4.0 - IL_008e: stloc.s V_5 - IL_0090: ldloc.s V_4 - IL_0092: ldloc.s V_5 - IL_0094: conv.i - IL_0095: sizeof [runtime]System.Double - IL_009b: mul - IL_009c: add - IL_009d: ldobj [runtime]System.Double - IL_00a2: ldloc.1 - IL_00a3: stloc.s V_6 - IL_00a5: ldc.i4.1 - IL_00a6: stloc.s V_7 - IL_00a8: ldloc.s V_6 - IL_00aa: ldloc.s V_7 - IL_00ac: conv.i - IL_00ad: sizeof [runtime]System.Double - IL_00b3: mul - IL_00b4: add - IL_00b5: ldobj [runtime]System.Double - IL_00ba: add - IL_00bb: ret - } - - .method public static float64 pinArray2() cil managed - { - - .maxstack 6 - .locals init (float64[] V_0, - native int V_1, - float64& pinned V_2, - native int V_3, - int32 V_4, - native int V_5, - int32 V_6) - IL_0000: ldc.i4.6 - IL_0001: newarr [runtime]System.Double - IL_0006: dup - IL_0007: ldc.i4.0 - IL_0008: ldc.r8 0.0 - IL_0011: stelem [runtime]System.Double - IL_0016: dup - IL_0017: ldc.i4.1 - IL_0018: ldc.r8 1.5 - IL_0021: stelem [runtime]System.Double - IL_0026: dup - IL_0027: ldc.i4.2 - IL_0028: ldc.r8 2.2999999999999998 - IL_0031: stelem [runtime]System.Double - IL_0036: dup - IL_0037: ldc.i4.3 - IL_0038: ldc.r8 3.3999999999999999 - IL_0041: stelem [runtime]System.Double - IL_0046: dup - IL_0047: ldc.i4.4 - IL_0048: ldc.r8 4.0999999999999996 - IL_0051: stelem [runtime]System.Double - IL_0056: dup - IL_0057: ldc.i4.5 - IL_0058: ldc.r8 5.9000000000000004 - IL_0061: stelem [runtime]System.Double - IL_0066: stloc.0 - IL_0067: ldloc.0 - IL_0068: ldc.i4.0 - IL_0069: ldelema [runtime]System.Double - IL_006e: stloc.2 - IL_006f: ldloc.2 - IL_0070: conv.i - IL_0071: stloc.1 - IL_0072: ldloc.1 - IL_0073: stloc.3 - IL_0074: ldc.i4.0 - IL_0075: stloc.s V_4 - IL_0077: ldloc.3 - IL_0078: ldloc.s V_4 - IL_007a: conv.i - IL_007b: sizeof [runtime]System.Double - IL_0081: mul - IL_0082: add - IL_0083: ldobj [runtime]System.Double - IL_0088: ldloc.1 - IL_0089: stloc.s V_5 - IL_008b: ldc.i4.1 - IL_008c: stloc.s V_6 - IL_008e: ldloc.s V_5 - IL_0090: ldloc.s V_6 - IL_0092: conv.i - IL_0093: sizeof [runtime]System.Double - IL_0099: mul - IL_009a: add - IL_009b: ldobj [runtime]System.Double - IL_00a0: add - IL_00a1: ret - } - - .method public static class [runtime]System.Tuple`2 - pinString() cil managed - { - - .maxstack 6 - .locals init (string V_0, - native int V_1, - string pinned V_2, - native int V_3, - int32 V_4, - native int V_5, - int32 V_6) - IL_0000: ldstr "Hello World" - IL_0005: stloc.0 - IL_0006: ldloc.0 - IL_0007: stloc.2 - IL_0008: ldloc.2 - IL_0009: brfalse.s IL_0016 - - IL_000b: ldloc.2 - IL_000c: conv.i - IL_000d: call int32 [runtime]System.Runtime.CompilerServices.RuntimeHelpers::get_OffsetToStringData() - IL_0012: add - IL_0013: nop - IL_0014: br.s IL_0018 - - IL_0016: ldloc.2 - IL_0017: nop - IL_0018: stloc.1 - IL_0019: ldloc.1 - IL_001a: stloc.3 - IL_001b: ldc.i4.0 - IL_001c: stloc.s V_4 - IL_001e: ldloc.3 - IL_001f: ldloc.s V_4 - IL_0021: conv.i - IL_0022: sizeof [runtime]System.Char - IL_0028: mul - IL_0029: add - IL_002a: ldobj [runtime]System.Char - IL_002f: ldloc.1 - IL_0030: stloc.s V_5 - IL_0032: ldc.i4.1 - IL_0033: stloc.s V_6 - IL_0035: ldloc.s V_5 - IL_0037: ldloc.s V_6 - IL_0039: conv.i - IL_003a: sizeof [runtime]System.Char - IL_0040: mul - IL_0041: add - IL_0042: ldobj [runtime]System.Char - IL_0047: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, - !1) - IL_004c: ret - } - -} - -.class private abstract auto ansi sealed ''.$assembly - extends [runtime]System.Object -{ - .method public static void main@() cil managed - { - .entrypoint - - .maxstack 8 - IL_0000: ret - } - -} - - - - - - + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly assembly +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32, + int32, + int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 ) + + + + + .hash algorithm 0x00008004 + .ver 0:0:0:0 +} +.mresource public FSharpSignatureData.assembly +{ + + +} +.mresource public FSharpOptimizationData.assembly +{ + + +} +.module assembly.exe + +.imagebase {value} +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 +.corflags 0x00000001 + + + + + +.class public abstract auto ansi sealed assembly + extends [runtime]System.Object +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .class auto ansi serializable sealed nested public Point + extends [runtime]System.Object + implements class [runtime]System.IEquatable`1, + [runtime]System.Collections.IStructuralEquatable, + class [runtime]System.IComparable`1, + [runtime]System.IComparable, + [runtime]System.Collections.IStructuralComparable + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 02 00 00 00 00 00 ) + .field public int32 x@ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .field public int32 y@ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .method public hidebysig specialname + instance int32 get_x() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 assembly/Point::x@ + IL_0006: ret + } + + .method public hidebysig specialname + instance int32 get_y() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 assembly/Point::y@ + IL_0006: ret + } + + .method public hidebysig specialname + instance void set_x(int32 'value') cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: stfld int32 assembly/Point::x@ + IL_0007: ret + } + + .method public hidebysig specialname + instance void set_y(int32 'value') cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: stfld int32 assembly/Point::y@ + IL_0007: ret + } + + .method public specialname rtspecialname + instance void .ctor(int32 x, + int32 y) cil managed + { + .custom instance void [runtime]System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::.ctor(valuetype [runtime]System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes, + class [runtime]System.Type) = ( 01 00 60 06 00 00 14 54 65 73 74 46 75 6E 63 74 + 69 6F 6E 32 34 2B 50 6F 69 6E 74 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void [runtime]System.Object::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld int32 assembly/Point::x@ + IL_000d: ldarg.0 + IL_000e: ldarg.2 + IL_000f: stfld int32 assembly/Point::y@ + IL_0014: ret + } + + .method public strict virtual instance string + ToString() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldstr "%+A" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,class assembly/Point>::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_000f: ldarg.0 + IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0015: ret + } + + .method public hidebysig virtual final + instance int32 CompareTo(class assembly/Point obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 5 + .locals init (int32 V_0, + class [runtime]System.Collections.IComparer V_1, + int32 V_2, + int32 V_3, + class [runtime]System.Collections.IComparer V_4, + int32 V_5, + int32 V_6) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0057 + + IL_0003: ldarg.1 + IL_0004: brfalse.s IL_0055 + + IL_0006: call class [runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() + IL_000b: stloc.1 + IL_000c: ldarg.0 + IL_000d: ldfld int32 assembly/Point::x@ + IL_0012: stloc.2 + IL_0013: ldarg.1 + IL_0014: ldfld int32 assembly/Point::x@ + IL_0019: stloc.3 + IL_001a: ldloc.2 + IL_001b: ldloc.3 + IL_001c: cgt + IL_001e: ldloc.2 + IL_001f: ldloc.3 + IL_0020: clt + IL_0022: sub + IL_0023: stloc.0 + IL_0024: ldloc.0 + IL_0025: ldc.i4.0 + IL_0026: bge.s IL_002a + + IL_0028: ldloc.0 + IL_0029: ret + + IL_002a: ldloc.0 + IL_002b: ldc.i4.0 + IL_002c: ble.s IL_0030 + + IL_002e: ldloc.0 + IL_002f: ret + + IL_0030: call class [runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() + IL_0035: stloc.s V_4 + IL_0037: ldarg.0 + IL_0038: ldfld int32 assembly/Point::y@ + IL_003d: stloc.s V_5 + IL_003f: ldarg.1 + IL_0040: ldfld int32 assembly/Point::y@ + IL_0045: stloc.s V_6 + IL_0047: ldloc.s V_5 + IL_0049: ldloc.s V_6 + IL_004b: cgt + IL_004d: ldloc.s V_5 + IL_004f: ldloc.s V_6 + IL_0051: clt + IL_0053: sub + IL_0054: ret + + IL_0055: ldc.i4.1 + IL_0056: ret + + IL_0057: ldarg.1 + IL_0058: brfalse.s IL_005c + + IL_005a: ldc.i4.m1 + IL_005b: ret + + IL_005c: ldc.i4.0 + IL_005d: ret + } + + .method public hidebysig virtual final + instance int32 CompareTo(object obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: unbox.any assembly/Point + IL_0007: callvirt instance int32 assembly/Point::CompareTo(class assembly/Point) + IL_000c: ret + } + + .method public hidebysig virtual final + instance int32 CompareTo(object obj, + class [runtime]System.Collections.IComparer comp) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 5 + .locals init (class assembly/Point V_0, + class assembly/Point V_1, + int32 V_2, + class [runtime]System.Collections.IComparer V_3, + int32 V_4, + int32 V_5, + class [runtime]System.Collections.IComparer V_6, + int32 V_7, + int32 V_8) + IL_0000: ldarg.1 + IL_0001: unbox.any assembly/Point + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: stloc.1 + IL_0009: ldarg.0 + IL_000a: brfalse.s IL_0063 + + IL_000c: ldarg.1 + IL_000d: unbox.any assembly/Point + IL_0012: brfalse.s IL_0061 + + IL_0014: ldarg.2 + IL_0015: stloc.3 + IL_0016: ldarg.0 + IL_0017: ldfld int32 assembly/Point::x@ + IL_001c: stloc.s V_4 + IL_001e: ldloc.1 + IL_001f: ldfld int32 assembly/Point::x@ + IL_0024: stloc.s V_5 + IL_0026: ldloc.s V_4 + IL_0028: ldloc.s V_5 + IL_002a: cgt + IL_002c: ldloc.s V_4 + IL_002e: ldloc.s V_5 + IL_0030: clt + IL_0032: sub + IL_0033: stloc.2 + IL_0034: ldloc.2 + IL_0035: ldc.i4.0 + IL_0036: bge.s IL_003a + + IL_0038: ldloc.2 + IL_0039: ret + + IL_003a: ldloc.2 + IL_003b: ldc.i4.0 + IL_003c: ble.s IL_0040 + + IL_003e: ldloc.2 + IL_003f: ret + + IL_0040: ldarg.2 + IL_0041: stloc.s V_6 + IL_0043: ldarg.0 + IL_0044: ldfld int32 assembly/Point::y@ + IL_0049: stloc.s V_7 + IL_004b: ldloc.1 + IL_004c: ldfld int32 assembly/Point::y@ + IL_0051: stloc.s V_8 + IL_0053: ldloc.s V_7 + IL_0055: ldloc.s V_8 + IL_0057: cgt + IL_0059: ldloc.s V_7 + IL_005b: ldloc.s V_8 + IL_005d: clt + IL_005f: sub + IL_0060: ret + + IL_0061: ldc.i4.1 + IL_0062: ret + + IL_0063: ldarg.1 + IL_0064: unbox.any assembly/Point + IL_0069: brfalse.s IL_006d + + IL_006b: ldc.i4.m1 + IL_006c: ret + + IL_006d: ldc.i4.0 + IL_006e: ret + } + + .method public hidebysig virtual final + instance int32 GetHashCode(class [runtime]System.Collections.IEqualityComparer comp) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 7 + .locals init (int32 V_0, + class [runtime]System.Collections.IEqualityComparer V_1, + class [runtime]System.Collections.IEqualityComparer V_2) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0035 + + IL_0003: ldc.i4.0 + IL_0004: stloc.0 + IL_0005: ldc.i4 0x9e3779b9 + IL_000a: ldarg.1 + IL_000b: stloc.1 + IL_000c: ldarg.0 + IL_000d: ldfld int32 assembly/Point::y@ + IL_0012: ldloc.0 + IL_0013: ldc.i4.6 + IL_0014: shl + IL_0015: ldloc.0 + IL_0016: ldc.i4.2 + IL_0017: shr + IL_0018: add + IL_0019: add + IL_001a: add + IL_001b: stloc.0 + IL_001c: ldc.i4 0x9e3779b9 + IL_0021: ldarg.1 + IL_0022: stloc.2 + IL_0023: ldarg.0 + IL_0024: ldfld int32 assembly/Point::x@ + IL_0029: ldloc.0 + IL_002a: ldc.i4.6 + IL_002b: shl + IL_002c: ldloc.0 + IL_002d: ldc.i4.2 + IL_002e: shr + IL_002f: add + IL_0030: add + IL_0031: add + IL_0032: stloc.0 + IL_0033: ldloc.0 + IL_0034: ret + + IL_0035: ldc.i4.0 + IL_0036: ret + } + + .method public hidebysig virtual final + instance int32 GetHashCode() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call class [runtime]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer() + IL_0006: callvirt instance int32 assembly/Point::GetHashCode(class [runtime]System.Collections.IEqualityComparer) + IL_000b: ret + } + + .method public hidebysig virtual final + instance bool Equals(object obj, + class [runtime]System.Collections.IEqualityComparer comp) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 4 + .locals init (class assembly/Point V_0, + class assembly/Point V_1, + class [runtime]System.Collections.IEqualityComparer V_2, + class [runtime]System.Collections.IEqualityComparer V_3) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0036 + + IL_0003: ldarg.1 + IL_0004: isinst assembly/Point + IL_0009: stloc.0 + IL_000a: ldloc.0 + IL_000b: brfalse.s IL_0034 + + IL_000d: ldloc.0 + IL_000e: stloc.1 + IL_000f: ldarg.2 + IL_0010: stloc.2 + IL_0011: ldarg.0 + IL_0012: ldfld int32 assembly/Point::x@ + IL_0017: ldloc.1 + IL_0018: ldfld int32 assembly/Point::x@ + IL_001d: ceq + IL_001f: brfalse.s IL_0032 + + IL_0021: ldarg.2 + IL_0022: stloc.3 + IL_0023: ldarg.0 + IL_0024: ldfld int32 assembly/Point::y@ + IL_0029: ldloc.1 + IL_002a: ldfld int32 assembly/Point::y@ + IL_002f: ceq + IL_0031: ret + + IL_0032: ldc.i4.0 + IL_0033: ret + + IL_0034: ldc.i4.0 + IL_0035: ret + + IL_0036: ldarg.1 + IL_0037: ldnull + IL_0038: cgt.un + IL_003a: ldc.i4.0 + IL_003b: ceq + IL_003d: ret + } + + .method public hidebysig virtual final + instance bool Equals(class assembly/Point obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0027 + + IL_0003: ldarg.1 + IL_0004: brfalse.s IL_0025 + + IL_0006: ldarg.0 + IL_0007: ldfld int32 assembly/Point::x@ + IL_000c: ldarg.1 + IL_000d: ldfld int32 assembly/Point::x@ + IL_0012: bne.un.s IL_0023 + + IL_0014: ldarg.0 + IL_0015: ldfld int32 assembly/Point::y@ + IL_001a: ldarg.1 + IL_001b: ldfld int32 assembly/Point::y@ + IL_0020: ceq + IL_0022: ret + + IL_0023: ldc.i4.0 + IL_0024: ret + + IL_0025: ldc.i4.0 + IL_0026: ret + + IL_0027: ldarg.1 + IL_0028: ldnull + IL_0029: cgt.un + IL_002b: ldc.i4.0 + IL_002c: ceq + IL_002e: ret + } + + .method public hidebysig virtual final + instance bool Equals(object obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 4 + .locals init (class assembly/Point V_0) + IL_0000: ldarg.1 + IL_0001: isinst assembly/Point + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: brfalse.s IL_0012 + + IL_000a: ldarg.0 + IL_000b: ldloc.0 + IL_000c: callvirt instance bool assembly/Point::Equals(class assembly/Point) + IL_0011: ret + + IL_0012: ldc.i4.0 + IL_0013: ret + } + + .property instance int32 x() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32) = ( 01 00 04 00 00 00 00 00 00 00 00 00 ) + .set instance void assembly/Point::set_x(int32) + .get instance int32 assembly/Point::get_x() + } + .property instance int32 y() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32) = ( 01 00 04 00 00 00 01 00 00 00 00 00 ) + .set instance void assembly/Point::set_y(int32) + .get instance int32 assembly/Point::get_y() + } + } + + .method public static int32 pinObject() cil managed + { + + .maxstack 6 + .locals init (class assembly/Point V_0, + native int V_1, + int32& pinned V_2, + native int V_3, + int32 V_4, + native int V_5, + int32 V_6) + IL_0000: ldc.i4.1 + IL_0001: ldc.i4.2 + IL_0002: newobj instance void assembly/Point::.ctor(int32, + int32) + IL_0007: stloc.0 + IL_0008: ldloc.0 + IL_0009: ldflda int32 assembly/Point::x@ + IL_000e: stloc.2 + IL_000f: ldloc.2 + IL_0010: conv.i + IL_0011: stloc.1 + IL_0012: ldloc.1 + IL_0013: stloc.3 + IL_0014: ldc.i4.0 + IL_0015: stloc.s V_4 + IL_0017: ldloc.3 + IL_0018: ldloc.s V_4 + IL_001a: conv.i + IL_001b: sizeof [runtime]System.Int32 + IL_0021: mul + IL_0022: add + IL_0023: ldobj [runtime]System.Int32 + IL_0028: ldloc.1 + IL_0029: stloc.s V_5 + IL_002b: ldc.i4.1 + IL_002c: stloc.s V_6 + IL_002e: ldloc.s V_5 + IL_0030: ldloc.s V_6 + IL_0032: conv.i + IL_0033: sizeof [runtime]System.Int32 + IL_0039: mul + IL_003a: add + IL_003b: ldobj [runtime]System.Int32 + IL_0040: add + IL_0041: ret + } + + .method public static int32 pinRef() cil managed + { + + .maxstack 4 + .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 V_0, + native int V_1, + int32& pinned V_2) + IL_0000: ldc.i4.s 17 + IL_0002: call class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::Ref(!!0) + IL_0007: stloc.0 + IL_0008: ldloc.0 + IL_0009: ldflda !0 class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1::contents@ + IL_000e: stloc.2 + IL_000f: ldloc.2 + IL_0010: conv.i + IL_0011: stloc.1 + IL_0012: ldloc.1 + IL_0013: ldobj [runtime]System.Int32 + IL_0018: ldloc.1 + IL_0019: ldobj [runtime]System.Int32 + IL_001e: add + IL_001f: ret + } + + .method public static float64 pinArray1() cil managed + { + + .maxstack 6 + .locals init (float64[] V_0, + native int V_1, + float64[] V_2, + float64& pinned V_3, + native int V_4, + int32 V_5, + native int V_6, + int32 V_7) + IL_0000: ldc.i4.6 + IL_0001: newarr [runtime]System.Double + IL_0006: dup + IL_0007: ldc.i4.0 + IL_0008: ldc.r8 0.0 + IL_0011: stelem [runtime]System.Double + IL_0016: dup + IL_0017: ldc.i4.1 + IL_0018: ldc.r8 1.5 + IL_0021: stelem [runtime]System.Double + IL_0026: dup + IL_0027: ldc.i4.2 + IL_0028: ldc.r8 2.2999999999999998 + IL_0031: stelem [runtime]System.Double + IL_0036: dup + IL_0037: ldc.i4.3 + IL_0038: ldc.r8 3.3999999999999999 + IL_0041: stelem [runtime]System.Double + IL_0046: dup + IL_0047: ldc.i4.4 + IL_0048: ldc.r8 4.0999999999999996 + IL_0051: stelem [runtime]System.Double + IL_0056: dup + IL_0057: ldc.i4.5 + IL_0058: ldc.r8 5.9000000000000004 + IL_0061: stelem [runtime]System.Double + IL_0066: stloc.0 + IL_0067: ldloc.0 + IL_0068: stloc.2 + IL_0069: ldloc.2 + IL_006a: brfalse.s IL_0086 + + IL_006c: ldloc.2 + IL_006d: call int32 [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Length(!!0[]) + IL_0072: brfalse.s IL_0081 + + IL_0074: ldloc.2 + IL_0075: ldc.i4.0 + IL_0076: ldelema [runtime]System.Double + IL_007b: stloc.3 + IL_007c: ldloc.3 + IL_007d: conv.i + IL_007e: nop + IL_007f: br.s IL_0089 + + IL_0081: ldc.i4.0 + IL_0082: conv.i + IL_0083: nop + IL_0084: br.s IL_0089 + + IL_0086: ldc.i4.0 + IL_0087: conv.i + IL_0088: nop + IL_0089: stloc.1 + IL_008a: ldloc.1 + IL_008b: stloc.s V_4 + IL_008d: ldc.i4.0 + IL_008e: stloc.s V_5 + IL_0090: ldloc.s V_4 + IL_0092: ldloc.s V_5 + IL_0094: conv.i + IL_0095: sizeof [runtime]System.Double + IL_009b: mul + IL_009c: add + IL_009d: ldobj [runtime]System.Double + IL_00a2: ldloc.1 + IL_00a3: stloc.s V_6 + IL_00a5: ldc.i4.1 + IL_00a6: stloc.s V_7 + IL_00a8: ldloc.s V_6 + IL_00aa: ldloc.s V_7 + IL_00ac: conv.i + IL_00ad: sizeof [runtime]System.Double + IL_00b3: mul + IL_00b4: add + IL_00b5: ldobj [runtime]System.Double + IL_00ba: add + IL_00bb: ret + } + + .method public static float64 pinArray2() cil managed + { + + .maxstack 6 + .locals init (float64[] V_0, + native int V_1, + float64& pinned V_2, + native int V_3, + int32 V_4, + native int V_5, + int32 V_6) + IL_0000: ldc.i4.6 + IL_0001: newarr [runtime]System.Double + IL_0006: dup + IL_0007: ldc.i4.0 + IL_0008: ldc.r8 0.0 + IL_0011: stelem [runtime]System.Double + IL_0016: dup + IL_0017: ldc.i4.1 + IL_0018: ldc.r8 1.5 + IL_0021: stelem [runtime]System.Double + IL_0026: dup + IL_0027: ldc.i4.2 + IL_0028: ldc.r8 2.2999999999999998 + IL_0031: stelem [runtime]System.Double + IL_0036: dup + IL_0037: ldc.i4.3 + IL_0038: ldc.r8 3.3999999999999999 + IL_0041: stelem [runtime]System.Double + IL_0046: dup + IL_0047: ldc.i4.4 + IL_0048: ldc.r8 4.0999999999999996 + IL_0051: stelem [runtime]System.Double + IL_0056: dup + IL_0057: ldc.i4.5 + IL_0058: ldc.r8 5.9000000000000004 + IL_0061: stelem [runtime]System.Double + IL_0066: stloc.0 + IL_0067: ldloc.0 + IL_0068: ldc.i4.0 + IL_0069: ldelema [runtime]System.Double + IL_006e: stloc.2 + IL_006f: ldloc.2 + IL_0070: conv.i + IL_0071: stloc.1 + IL_0072: ldloc.1 + IL_0073: stloc.3 + IL_0074: ldc.i4.0 + IL_0075: stloc.s V_4 + IL_0077: ldloc.3 + IL_0078: ldloc.s V_4 + IL_007a: conv.i + IL_007b: sizeof [runtime]System.Double + IL_0081: mul + IL_0082: add + IL_0083: ldobj [runtime]System.Double + IL_0088: ldloc.1 + IL_0089: stloc.s V_5 + IL_008b: ldc.i4.1 + IL_008c: stloc.s V_6 + IL_008e: ldloc.s V_5 + IL_0090: ldloc.s V_6 + IL_0092: conv.i + IL_0093: sizeof [runtime]System.Double + IL_0099: mul + IL_009a: add + IL_009b: ldobj [runtime]System.Double + IL_00a0: add + IL_00a1: ret + } + + .method public static class [runtime]System.Tuple`2 + pinString() cil managed + { + + .maxstack 6 + .locals init (string V_0, + native int V_1, + string pinned V_2, + native int V_3, + int32 V_4, + native int V_5, + int32 V_6) + IL_0000: ldstr "Hello World" + IL_0005: stloc.0 + IL_0006: ldloc.0 + IL_0007: stloc.2 + IL_0008: ldloc.2 + IL_0009: brfalse.s IL_0016 + + IL_000b: ldloc.2 + IL_000c: conv.i + IL_000d: call int32 [runtime]System.Runtime.CompilerServices.RuntimeHelpers::get_OffsetToStringData() + IL_0012: add + IL_0013: nop + IL_0014: br.s IL_0018 + + IL_0016: ldloc.2 + IL_0017: nop + IL_0018: stloc.1 + IL_0019: ldloc.1 + IL_001a: stloc.3 + IL_001b: ldc.i4.0 + IL_001c: stloc.s V_4 + IL_001e: ldloc.3 + IL_001f: ldloc.s V_4 + IL_0021: conv.i + IL_0022: sizeof [runtime]System.Char + IL_0028: mul + IL_0029: add + IL_002a: ldobj [runtime]System.Char + IL_002f: ldloc.1 + IL_0030: stloc.s V_5 + IL_0032: ldc.i4.1 + IL_0033: stloc.s V_6 + IL_0035: ldloc.s V_5 + IL_0037: ldloc.s V_6 + IL_0039: conv.i + IL_003a: sizeof [runtime]System.Char + IL_0040: mul + IL_0041: add + IL_0042: ldobj [runtime]System.Char + IL_0047: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, + !1) + IL_004c: ret + } + +} + +.class private abstract auto ansi sealed ''.$assembly + extends [runtime]System.Object +{ + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: ret + } + +} + + + + + + diff --git a/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/Program.fs b/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/Program.fs index 9aa05c3558..c0883da14e 100644 --- a/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/Program.fs +++ b/tests/benchmarks/FCSBenchmarks/CompilerServiceBenchmarks/Program.fs @@ -4,5 +4,6 @@ open BenchmarkDotNet.Configs [] let main args = - BenchmarkSwitcher.FromAssembly(typeof.Assembly).Run(args) |> ignore + let cfg = ManualConfig.Create(DefaultConfig.Instance).WithOptions(ConfigOptions.DisableOptimizationsValidator) + BenchmarkSwitcher.FromAssembly(typeof.Assembly).Run(args,cfg) |> ignore 0 diff --git a/tests/fsharp/Compiler/CodeGen/EmittedIL/ReferenceAssemblyTests.fs b/tests/fsharp/Compiler/CodeGen/EmittedIL/ReferenceAssemblyTests.fs index 85ae70d25e..6857564db0 100644 --- a/tests/fsharp/Compiler/CodeGen/EmittedIL/ReferenceAssemblyTests.fs +++ b/tests/fsharp/Compiler/CodeGen/EmittedIL/ReferenceAssemblyTests.fs @@ -178,33 +178,38 @@ module Nested = |> shouldSucceed |> verifyIL [ referenceAssemblyAttributeExpectedIL - """.class abstract auto ansi sealed nested public Nested - extends [runtime]System.Object +#if NETCOREAPP + """ .class abstract auto ansi sealed nested public Nested + extends [runtime]System.Object { .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) .class auto ansi serializable sealed nested public Test - extends [runtime]System.Object - implements class [runtime]System.IEquatable`1, - [runtime]System.Collections.IStructuralEquatable, - class [runtime]System.IComparable`1, - [runtime]System.IComparable, - [runtime]System.Collections.IStructuralComparable + extends [runtime]System.Object + implements class [runtime]System.IEquatable`1, + [runtime]System.Collections.IStructuralEquatable, + class [runtime]System.IComparable`1, + [runtime]System.IComparable, + [runtime]System.Collections.IStructuralComparable { .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 02 00 00 00 00 00 ) .method public hidebysig specialname - instance int32 get_x() cil managed + instance int32 get_x() cil managed { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .maxstack 8 IL_0000: ldnull IL_0001: throw } .method public specialname rtspecialname - instance void .ctor(int32 x) cil managed + instance void .ctor(int32 x) cil managed { + .custom instance void [runtime]System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::.ctor(valuetype [runtime]System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes, + class [runtime]System.Type) = ( 01 00 60 06 00 00 1D 52 65 66 65 72 65 6E 63 65 + 41 73 73 65 6D 62 6C 79 2B 4E 65 73 74 65 64 2B + 54 65 73 74 00 00 ) .maxstack 8 IL_0000: ldnull @@ -212,7 +217,7 @@ module Nested = } .method public strict virtual instance string - ToString() cil managed + ToString() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) @@ -222,9 +227,9 @@ module Nested = } .method public hidebysig virtual final - instance int32 CompareTo(class ReferenceAssembly/Nested/Test obj) cil managed + instance int32 CompareTo(class ReferenceAssembly/Nested/Test obj) cil managed { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .maxstack 8 IL_0000: ldnull @@ -232,9 +237,9 @@ module Nested = } .method public hidebysig virtual final - instance int32 CompareTo(object obj) cil managed + instance int32 CompareTo(object obj) cil managed { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .maxstack 8 IL_0000: ldnull @@ -242,10 +247,10 @@ module Nested = } .method public hidebysig virtual final - instance int32 CompareTo(object obj, - class [runtime]System.Collections.IComparer comp) cil managed + instance int32 CompareTo(object obj, + class [runtime]System.Collections.IComparer comp) cil managed { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .maxstack 8 IL_0000: ldnull @@ -253,9 +258,9 @@ module Nested = } .method public hidebysig virtual final - instance int32 GetHashCode(class [runtime]System.Collections.IEqualityComparer comp) cil managed + instance int32 GetHashCode(class [runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .maxstack 8 IL_0000: ldnull @@ -263,9 +268,9 @@ module Nested = } .method public hidebysig virtual final - instance int32 GetHashCode() cil managed + instance int32 GetHashCode() cil managed { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .maxstack 8 IL_0000: ldnull @@ -273,10 +278,10 @@ module Nested = } .method public hidebysig virtual final - instance bool Equals(object obj, - class [runtime]System.Collections.IEqualityComparer comp) cil managed + instance bool Equals(object obj, + class [runtime]System.Collections.IEqualityComparer comp) cil managed { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .maxstack 8 IL_0000: ldnull @@ -284,9 +289,9 @@ module Nested = } .method public hidebysig virtual final - instance bool Equals(class ReferenceAssembly/Nested/Test obj) cil managed + instance bool Equals(class ReferenceAssembly/Nested/Test obj) cil managed { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .maxstack 8 IL_0000: ldnull @@ -294,9 +299,9 @@ module Nested = } .method public hidebysig virtual final - instance bool Equals(object obj) cil managed + instance bool Equals(object obj) cil managed { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .maxstack 8 IL_0000: ldnull @@ -306,7 +311,7 @@ module Nested = .property instance int32 x() { .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, - int32) = ( 01 00 04 00 00 00 00 00 00 00 00 00 ) + int32) = ( 01 00 04 00 00 00 00 00 00 00 00 00 ) .get instance int32 ReferenceAssembly/Nested/Test::get_x() } } @@ -320,8 +325,155 @@ module Nested = } } """ - ] - |> ignore +#else + """ .class abstract auto ansi sealed nested public Nested + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .class auto ansi serializable sealed nested public Test + extends [runtime]System.Object + implements class [runtime]System.IEquatable`1, + [runtime]System.Collections.IStructuralEquatable, + class [runtime]System.IComparable`1, + [runtime]System.IComparable, + [runtime]System.Collections.IStructuralComparable + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 02 00 00 00 00 00 ) + .method public hidebysig specialname + instance int32 get_x() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldnull + IL_0001: throw + } + + .method public specialname rtspecialname + instance void .ctor(int32 x) cil managed + { + .custom instance void System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::.ctor(valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes, + class [runtime]System.Type) = ( 01 00 60 06 00 00 1D 52 65 66 65 72 65 6E 63 65 + 41 73 73 65 6D 62 6C 79 2B 4E 65 73 74 65 64 2B + 54 65 73 74 00 00 ) + + .maxstack 8 + IL_0000: ldnull + IL_0001: throw + } + + .method public strict virtual instance string + ToString() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldnull + IL_0001: throw + } + + .method public hidebysig virtual final + instance int32 CompareTo(class ReferenceAssembly/Nested/Test obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldnull + IL_0001: throw + } + + .method public hidebysig virtual final + instance int32 CompareTo(object obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldnull + IL_0001: throw + } + + .method public hidebysig virtual final + instance int32 CompareTo(object obj, + class [runtime]System.Collections.IComparer comp) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldnull + IL_0001: throw + } + + .method public hidebysig virtual final + instance int32 GetHashCode(class [runtime]System.Collections.IEqualityComparer comp) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldnull + IL_0001: throw + } + + .method public hidebysig virtual final + instance int32 GetHashCode() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldnull + IL_0001: throw + } + + .method public hidebysig virtual final + instance bool Equals(object obj, + class [runtime]System.Collections.IEqualityComparer comp) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldnull + IL_0001: throw + } + + .method public hidebysig virtual final + instance bool Equals(class ReferenceAssembly/Nested/Test obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldnull + IL_0001: throw + } + + .method public hidebysig virtual final + instance bool Equals(object obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldnull + IL_0001: throw + } + + .property instance int32 x() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32) = ( 01 00 04 00 00 00 00 00 00 00 00 00 ) + .get instance int32 ReferenceAssembly/Nested/Test::get_x() + } + } + + .method public static void test(class ReferenceAssembly/Nested/Test _x) cil managed + { + + .maxstack 8 + IL_0000: ldnull + IL_0001: throw + } + + } """ +#endif + ] |> ignore [] let ``--refout should produce both normal and reference assemblies``() = @@ -498,54 +650,60 @@ type [] MySecondRecord = { Name: string } |> withOptions ["--refonly"] |> compile |> shouldSucceed - |> verifyIL [""" .class public auto ansi serializable sealed Net7FSharpSnafu.Library.MyRecord - extends [runtime]System.Object - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CLIMutableAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.NoComparisonAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.NoEqualityAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 02 00 00 00 00 00 ) - .method public hidebysig specialname instance string - get_Name() cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 8 - IL_0000: ldnull - IL_0001: throw - } + |> verifyIL [ +#if NETCOREAPP + """.class public auto ansi serializable sealed Net7FSharpSnafu.Library.MyRecord + extends [runtime]System.Object +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CLIMutableAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.NoComparisonAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.NoEqualityAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 02 00 00 00 00 00 ) + .method public hidebysig specialname instance string + get_Name() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method public hidebysig specialname instance void - set_Name(string 'value') cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 8 - IL_0000: ldnull - IL_0001: throw - } + .maxstack 8 + IL_0000: ldnull + IL_0001: throw + } + + .method public hidebysig specialname instance void + set_Name(string 'value') cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method public specialname rtspecialname - instance void .ctor(string name) cil managed - { - - .maxstack 8 - IL_0000: ldnull - IL_0001: throw - } + .maxstack 8 + IL_0000: ldnull + IL_0001: throw + } + + .method public specialname rtspecialname + instance void .ctor(string name) cil managed + { + .custom instance void [runtime]System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::.ctor(valuetype [runtime]System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes, + class [runtime]System.Type) = ( 01 00 60 06 00 00 20 4E 65 74 37 46 53 68 61 72 + 70 53 6E 61 66 75 2E 4C 69 62 72 61 72 79 2E 4D + 79 52 65 63 6F 72 64 00 00 ) - .method public specialname rtspecialname - instance void .ctor() cil managed - { - - .maxstack 8 - IL_0000: ldnull - IL_0001: throw - } + .maxstack 8 + IL_0000: ldnull + IL_0001: throw + } + + .method public specialname rtspecialname + instance void .ctor() cil managed + { - .method public strict virtual instance string + .maxstack 8 + IL_0000: ldnull + IL_0001: throw + } + + .method public strict virtual instance string ToString() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) @@ -555,14 +713,87 @@ type [] MySecondRecord = { Name: string } IL_0001: throw } - .property instance string Name() + .property instance string Name() { .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, int32) = ( 01 00 04 00 00 00 00 00 00 00 00 00 ) .set instance void Net7FSharpSnafu.Library.MyRecord::set_Name(string) .get instance string Net7FSharpSnafu.Library.MyRecord::get_Name() } -} """] +} """ +#else + """.class public auto ansi serializable sealed Net7FSharpSnafu.Library.MyRecord + extends [runtime]System.Object +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CLIMutableAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.NoComparisonAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.NoEqualityAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 02 00 00 00 00 00 ) + .method public hidebysig specialname instance string + get_Name() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldnull + IL_0001: throw + } + + .method public hidebysig specialname instance void + set_Name(string 'value') cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldnull + IL_0001: throw + } + + .method public specialname rtspecialname + instance void .ctor(string name) cil managed + { + .custom instance void System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::.ctor(valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes, + class [runtime]System.Type) = ( 01 00 60 06 00 00 20 4E 65 74 37 46 53 68 61 72 + 70 53 6E 61 66 75 2E 4C 69 62 72 61 72 79 2E 4D + 79 52 65 63 6F 72 64 00 00 ) + + .maxstack 8 + IL_0000: ldnull + IL_0001: throw + } + + .method public specialname rtspecialname + instance void .ctor() cil managed + { + + .maxstack 8 + IL_0000: ldnull + IL_0001: throw + } + + .method public strict virtual instance string + ToString() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldnull + IL_0001: throw + } + + .property instance string Name() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32) = ( 01 00 04 00 00 00 00 00 00 00 00 00 ) + .set instance void Net7FSharpSnafu.Library.MyRecord::set_Name(string) + .get instance string Net7FSharpSnafu.Library.MyRecord::get_Name() + } +} """ +#endif + + ] [] let ``Properties, getters, setters are emitted for internal properties`` () = diff --git a/tests/projects/SelfContained_Trimming_Test/NuGet.Config b/tests/projects/SelfContained_Trimming_Test/NuGet.Config index ed5be2d5fc..2a97bd3b1c 100644 --- a/tests/projects/SelfContained_Trimming_Test/NuGet.Config +++ b/tests/projects/SelfContained_Trimming_Test/NuGet.Config @@ -5,7 +5,7 @@ - + diff --git a/tests/projects/SelfContained_Trimming_Test/Program.fs b/tests/projects/SelfContained_Trimming_Test/Program.fs index 7799113a78..bc4e4d54c6 100644 --- a/tests/projects/SelfContained_Trimming_Test/Program.fs +++ b/tests/projects/SelfContained_Trimming_Test/Program.fs @@ -9059,14 +9059,48 @@ let func8000()= test "test8736" (lazy(sprintf "09-00%d09-01%d09-02%d09-03%d09-04%d09-05%d09-06%d09-07%d09-08%d09-09%a19-10%d19-11%d19-12%d19-13%d19-14%d19-15%d19-16%d19-17%d19-18%d19-19%a29-20%d29-21%d29-22%d29-23%d29-24%d29-25%d29-26%d29-27%d29-28%d29-29%a39-30%d39-31%d39-32%d39-33%d39-34%d39-35%d39-36%d39-37%d39-38%d39-39%a49-40%d49-41%d49-42%d49-43%d49-44%d49-45%d49-46%d49-47%d49-48%d49-49%a59-50%d59-51%d59-52%d59-53%d59-54%d59-55%d59-56%d59-57%d59-58%d59-59%a69-60%d69-61%d69-62%d69-63%d69-64%d69-65%d69-66%d69-67%d69-68%d69-69%a79-70%d79-71%d79-72%d79-73%d79-74%d79-75%d79-76%d79-77%d79-78%d79-79%a89-80%d89-81%d89-82%d89-83%d89-84%d89-85%d89-86%d89-87%d89-88%d89-89%a99-90%d99-91%d99-92%d99-93%d99-94%d99-95%d99-96%d99-97%d99-98%d99-99" 0 1 2 3 4 5 6 7 8 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 15 16 17 18 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 25 26 27 28 (fun _ v -> (string v) + "X") 3 30 31 32 33 34 35 36 37 38 (fun _ v -> (string v) + "X") 4 40 41 42 43 44 45 46 47 48 (fun _ v -> (string v) + "X") 5 50 51 52 53 54 55 56 57 58 (fun _ v -> (string v) + "X") 6 60 61 62 63 64 65 66 67 68 (fun _ v -> (string v) + "X") 7 70 71 72 73 74 75 76 77 78 (fun _ v -> (string v) + "X") 8 80 81 82 83 84 85 86 87 88 (fun _ v -> (string v) + "X") 9 90 91 92 93 94 95 96 97 98 )) "09-00009-01109-02209-03309-04409-05509-06609-07709-08809-091X19-101019-111119-121219-131319-141419-151519-161619-171719-181819-192X29-202029-212129-222229-232329-242429-252529-262629-272729-282829-293X39-303039-313139-323239-333339-343439-353539-363639-373739-383839-394X49-404049-414149-424249-434349-444449-454549-464649-474749-484849-495X59-505059-515159-525259-535359-545459-555559-565659-575759-585859-596X69-606069-616169-626269-636369-646469-656569-666669-676769-686869-697X79-707079-717179-727279-737379-747479-757579-767679-777779-787879-798X89-808089-818189-828289-838389-848489-858589-868689-878789-888889-899X99-909099-919199-929299-939399-949499-959599-969699-979799-989899-99" test "test8737" (lazy(sprintf "09-00%d09-01%d09-02%d09-03%d09-04%d09-05%d09-06%d09-07%d09-08%d09-09%a19-10%d19-11%d19-12%d19-13%d19-14%d19-15%d19-16%d19-17%d19-18%d19-19%a29-20%d29-21%d29-22%d29-23%d29-24%d29-25%d29-26%d29-27%d29-28%d29-29%a39-30%d39-31%d39-32%d39-33%d39-34%d39-35%d39-36%d39-37%d39-38%d39-39%a49-40%d49-41%d49-42%d49-43%d49-44%d49-45%d49-46%d49-47%d49-48%d49-49%a59-50%d59-51%d59-52%d59-53%d59-54%d59-55%d59-56%d59-57%d59-58%d59-59%a69-60%d69-61%d69-62%d69-63%d69-64%d69-65%d69-66%d69-67%d69-68%d69-69%a79-70%d79-71%d79-72%d79-73%d79-74%d79-75%d79-76%d79-77%d79-78%d79-79%a89-80%d89-81%d89-82%d89-83%d89-84%d89-85%d89-86%d89-87%d89-88%d89-89%a99-90%d99-91%d99-92%d99-93%d99-94%d99-95%d99-96%d99-97%d99-98%d99-99%a_TAIL" 0 1 2 3 4 5 6 7 8 (fun _ v -> (string v) + "X") 1 10 11 12 13 14 15 16 17 18 (fun _ v -> (string v) + "X") 2 20 21 22 23 24 25 26 27 28 (fun _ v -> (string v) + "X") 3 30 31 32 33 34 35 36 37 38 (fun _ v -> (string v) + "X") 4 40 41 42 43 44 45 46 47 48 (fun _ v -> (string v) + "X") 5 50 51 52 53 54 55 56 57 58 (fun _ v -> (string v) + "X") 6 60 61 62 63 64 65 66 67 68 (fun _ v -> (string v) + "X") 7 70 71 72 73 74 75 76 77 78 (fun _ v -> (string v) + "X") 8 80 81 82 83 84 85 86 87 88 (fun _ v -> (string v) + "X") 9 90 91 92 93 94 95 96 97 98 (fun _ v -> (string v) + "X") System.IO.FileShare.Read )) "09-00009-01109-02209-03309-04409-05509-06609-07709-08809-091X19-101019-111119-121219-131319-141419-151519-161619-171719-181819-192X29-202029-212129-222229-232329-242429-252529-262629-272729-282829-293X39-303039-313139-323239-333339-343439-353539-363639-373739-383839-394X49-404049-414149-424249-434349-444449-454549-464649-474749-484849-495X59-505059-515159-525259-535359-545459-555559-565659-575759-585859-596X69-606069-616169-626269-636369-646469-656569-666669-676769-686869-697X79-707079-717179-727279-737379-747479-757579-767679-777779-787879-798X89-808089-818189-828289-838389-848489-858589-868689-878789-888889-899X99-909099-919199-929299-939399-949499-959599-969699-979799-989899-99ReadX_TAIL" +module PresenceOfReflectionApi = + type MyRecord = { + A: string + B: decimal + } -type MyRecord = { - A: string - B: string -} + let testPresenceOfReflectionApi () = + test "test8800" (lazy(Microsoft.FSharp.Reflection.FSharpValue.PreComputeRecordConstructorInfo typeof |> ignore; "Done")) "Done" -let testPresenceOfReflectionApi () = - test "test8737" (lazy(Microsoft.FSharp.Reflection.FSharpValue.PreComputeRecordConstructorInfo typeof |> ignore; "Done")) "Done" +module PercentaPublicTests = + type MyRecord = + { + A: string + B: decimal + C: int + D: float + } + + let testPercentA () = + let data = { A = "Hello, World!"; B = 1.027m; C = 1028; D = 1.029 } + test "test8900" (lazy (sprintf "%A" data).Replace("\n", ";")) """{ A = "Hello, World!"; B = 1.027M; C = 1028; D = 1.029 }""" + +module PercentaInternalTests = + + type internal MyInternalRecord = + { + A: string + B: decimal + C: int + D: float + } + override this.ToString() = $"Hidden by ToString()" + + let testPercentA () = + + let data = { A = "Hello, World!"; B = 1.027m; C = 1028; D = 1.029 } + test "test9000" (lazy (sprintf "%A" data).Replace("\n", ";")) "Hidden by ToString()" + + let testPercentPlusA () = + + let data = { A = "Hello, World!"; B = 1.027m; C = 1028; D = 1.029 } + test "test9100" (lazy (sprintf "%+A" data).Replace("\n", ";")) """{ A = "Hello, World!"; B = 1.027M; C = 1028; D = 1.029 }""" [] let main _ = @@ -9080,7 +9114,11 @@ let main _ = func6000() func7000() func8000() - testPresenceOfReflectionApi () + PresenceOfReflectionApi.testPresenceOfReflectionApi () + PercentaPublicTests.testPercentA () + PercentaInternalTests.testPercentA () + PercentaInternalTests.testPercentPlusA () + match !failures with | [] -> stdout.WriteLine "All tests passed" diff --git a/tests/projects/SelfContained_Trimming_Test/SelfContained_Trimming_Test.fsproj b/tests/projects/SelfContained_Trimming_Test/SelfContained_Trimming_Test.fsproj index 72feceb7d8..06b29764ab 100644 --- a/tests/projects/SelfContained_Trimming_Test/SelfContained_Trimming_Test.fsproj +++ b/tests/projects/SelfContained_Trimming_Test/SelfContained_Trimming_Test.fsproj @@ -30,7 +30,7 @@ - + diff --git a/tests/projects/SelfContained_Trimming_Test/check.ps1 b/tests/projects/SelfContained_Trimming_Test/check.ps1 index 2f1bb61b16..901aa952c8 100644 --- a/tests/projects/SelfContained_Trimming_Test/check.ps1 +++ b/tests/projects/SelfContained_Trimming_Test/check.ps1 @@ -14,7 +14,7 @@ if (-not ($output -eq $expected)) } # Checking that FSharp.Core binary is of expected size (needs adjustments if test is updated). -$expected_len = 249344 # In bytes +$expected_len = 251904 # In bytes $file = Get-Item .\bin\Release\net7.0\win-x64\publish\FSharp.Core.dll $file_len = $file.Length if (-not ($file_len -eq $expected_len)) diff --git a/vsintegration/src/FSharp.Editor/CodeFix/AddInstanceMemberParameter.fs b/vsintegration/src/FSharp.Editor/CodeFix/AddInstanceMemberParameter.fs index 292fbc1592..e3180651f9 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/AddInstanceMemberParameter.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/AddInstanceMemberParameter.fs @@ -8,7 +8,7 @@ open System.Threading.Tasks open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.CodeFixes -[] +[] type internal FSharpAddInstanceMemberParameterCodeFixProvider() = inherit CodeFixProvider() @@ -27,6 +27,7 @@ type internal FSharpAddInstanceMemberParameterCodeFixProvider() = let codeFix = CodeFixHelpers.createTextChangeCodeFix ( + CodeFix.AddInstanceMemberParameter, title, context, (fun () -> asyncMaybe.Return [| TextChange(TextSpan(context.Span.Start, 0), "x.") |]) diff --git a/vsintegration/src/FSharp.Editor/CodeFix/AddMissingEqualsToTypeDefinition.fs b/vsintegration/src/FSharp.Editor/CodeFix/AddMissingEqualsToTypeDefinition.fs index 5b7360320e..f667c624e3 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/AddMissingEqualsToTypeDefinition.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/AddMissingEqualsToTypeDefinition.fs @@ -6,12 +6,10 @@ open System open System.Composition open System.Threading.Tasks -open Microsoft.VisualStudio.FSharp.Editor.Logging - open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.CodeFixes -[] +[] type internal FSharpAddMissingEqualsToTypeDefinitionCodeFixProvider() = inherit CodeFixProvider() @@ -43,6 +41,7 @@ type internal FSharpAddMissingEqualsToTypeDefinitionCodeFixProvider() = let codeFix = CodeFixHelpers.createTextChangeCodeFix ( + CodeFix.AddMissingEqualsToTypeDefinition, title, context, // 'pos + 1' is here because 'pos' is now the position of the first non-whitespace character. diff --git a/vsintegration/src/FSharp.Editor/CodeFix/AddMissingFunKeyword.fs b/vsintegration/src/FSharp.Editor/CodeFix/AddMissingFunKeyword.fs index 8f1a286f1a..234c4bd059 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/AddMissingFunKeyword.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/AddMissingFunKeyword.fs @@ -11,7 +11,7 @@ open Microsoft.CodeAnalysis.CodeFixes open FSharp.Compiler open FSharp.Compiler.CodeAnalysis -[] +[] type internal FSharpAddMissingFunKeywordCodeFixProvider [] () = inherit CodeFixProvider() @@ -65,6 +65,7 @@ type internal FSharpAddMissingFunKeywordCodeFixProvider [] let codeFix = CodeFixHelpers.createTextChangeCodeFix ( + CodeFix.AddMissingFunKeyword, title, context, (fun () -> asyncMaybe.Return [| TextChange(TextSpan(intendedArgSpan.Start, 0), "fun ") |]) diff --git a/vsintegration/src/FSharp.Editor/CodeFix/AddNewKeywordToDisposableConstructorInvocation.fs b/vsintegration/src/FSharp.Editor/CodeFix/AddNewKeywordToDisposableConstructorInvocation.fs index adbb5290f9..d6dcfd30d3 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/AddNewKeywordToDisposableConstructorInvocation.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/AddNewKeywordToDisposableConstructorInvocation.fs @@ -8,7 +8,7 @@ open System.Threading.Tasks open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.CodeFixes -[] +[] type internal FSharpAddNewKeywordCodeFixProvider() = inherit CodeFixProvider() @@ -27,6 +27,7 @@ type internal FSharpAddNewKeywordCodeFixProvider() = let codeFix = CodeFixHelpers.createTextChangeCodeFix ( + CodeFix.AddNewKeyword, title, context, (fun () -> asyncMaybe.Return [| TextChange(TextSpan(context.Span.Start, 0), "new ") |]) diff --git a/vsintegration/src/FSharp.Editor/CodeFix/AddOpenCodeFixProvider.fs b/vsintegration/src/FSharp.Editor/CodeFix/AddOpenCodeFixProvider.fs index cf709d695c..dcb40c4cb6 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/AddOpenCodeFixProvider.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/AddOpenCodeFixProvider.fs @@ -17,7 +17,7 @@ open FSharp.Compiler.CodeAnalysis open FSharp.Compiler.EditorServices open FSharp.Compiler.Text -[] +[] type internal FSharpAddOpenCodeFixProvider [] (assemblyContentProvider: AssemblyContentProvider) = inherit CodeFixProvider() @@ -27,6 +27,7 @@ type internal FSharpAddOpenCodeFixProvider [] (assemblyCon let qualifySymbolFix (context: CodeFixContext) (fullName, qualifier) = CodeFixHelpers.createTextChangeCodeFix ( + CodeFix.AddOpen, fixUnderscoresInMenuText fullName, context, (fun () -> asyncMaybe.Return [| TextChange(context.Span, qualifier) |]) diff --git a/vsintegration/src/FSharp.Editor/CodeFix/ChangePrefixNegationToInfixSubtraction.fs b/vsintegration/src/FSharp.Editor/CodeFix/ChangePrefixNegationToInfixSubtraction.fs index b734cdc0ae..12296f0bd6 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/ChangePrefixNegationToInfixSubtraction.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/ChangePrefixNegationToInfixSubtraction.fs @@ -9,7 +9,7 @@ open System.Threading.Tasks open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.CodeFixes -[] +[] type internal FSharpChangePrefixNegationToInfixSubtractionodeFixProvider() = inherit CodeFixProvider() @@ -44,6 +44,7 @@ type internal FSharpChangePrefixNegationToInfixSubtractionodeFixProvider() = let codeFix = CodeFixHelpers.createTextChangeCodeFix ( + CodeFix.ChangePrefixNegationToInfixSubtraction, title, context, (fun () -> asyncMaybe.Return [| TextChange(TextSpan(pos, 1), "- ") |]) diff --git a/vsintegration/src/FSharp.Editor/CodeFix/ChangeRefCellDerefToNotExpression.fs b/vsintegration/src/FSharp.Editor/CodeFix/ChangeRefCellDerefToNotExpression.fs index f8019fe16a..04b40ec52b 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/ChangeRefCellDerefToNotExpression.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/ChangeRefCellDerefToNotExpression.fs @@ -8,7 +8,7 @@ open System.Threading.Tasks open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.CodeFixes -[] +[] type internal FSharpChangeRefCellDerefToNotExpressionCodeFixProvider [] () = inherit CodeFixProvider() @@ -40,7 +40,12 @@ type internal FSharpChangeRefCellDerefToNotExpressionCodeFixProvider [ Seq.toImmutableArray let codeFix = - CodeFixHelpers.createTextChangeCodeFix (title, context, (fun () -> asyncMaybe.Return [| TextChange(derefSpan, "not ") |])) + CodeFixHelpers.createTextChangeCodeFix ( + CodeFix.ChangeRefCellDerefToNotExpression, + title, + context, + (fun () -> asyncMaybe.Return [| TextChange(derefSpan, "not ") |]) + ) context.RegisterCodeFix(codeFix, diagnostics) } diff --git a/vsintegration/src/FSharp.Editor/CodeFix/ChangeToUpcast.fs b/vsintegration/src/FSharp.Editor/CodeFix/ChangeToUpcast.fs index d205d320a6..d2e7faedc3 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/ChangeToUpcast.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/ChangeToUpcast.fs @@ -8,7 +8,7 @@ open System.Threading.Tasks open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.CodeFixes -[] +[] type internal FSharpChangeToUpcastCodeFixProvider() = inherit CodeFixProvider() @@ -50,6 +50,7 @@ type internal FSharpChangeToUpcastCodeFixProvider() = let codeFix = CodeFixHelpers.createTextChangeCodeFix ( + CodeFix.ChangeToUpcast, title, context, (fun () -> asyncMaybe.Return [| TextChange(context.Span, replacement) |]) diff --git a/vsintegration/src/FSharp.Editor/CodeFix/CodeFixHelpers.fs b/vsintegration/src/FSharp.Editor/CodeFix/CodeFixHelpers.fs index 643b48a30e..10c9f760ad 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/CodeFixHelpers.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/CodeFixHelpers.fs @@ -11,9 +11,22 @@ open Microsoft.VisualStudio.FSharp.Editor.Telemetry [] module internal CodeFixHelpers = - let createTextChangeCodeFix (title: string, context: CodeFixContext, computeTextChanges: unit -> Async) = + let createTextChangeCodeFix + ( + name: string, + title: string, + context: CodeFixContext, + computeTextChanges: unit -> Async + ) = + + // I don't understand how we can get anything but a single diagnostic here - as we get a single "title" here. + // But since we don't have proper testing yet, keeping it like this to verify this theory in telemetry. + let ids = context.Diagnostics |> Seq.map (fun d -> d.Id) |> String.concat "," + let props: (string * obj) list = [ + "name", name + "ids", ids "title", title // The following can help building a unique but anonymized codefix target: @@ -53,8 +66,8 @@ module internal CodeFixExtensions = member this.GetPrunedDiagnostics(context: CodeFixContext) = context.Diagnostics.RemoveAll(fun x -> this.FixableDiagnosticIds.Contains(x.Id) |> not) - member this.RegisterFix(context: CodeFixContext, fixName, fixChange) = + member this.RegisterFix(name, title, context: CodeFixContext, fixChange) = let replaceCodeFix = - CodeFixHelpers.createTextChangeCodeFix (fixName, context, (fun () -> asyncMaybe.Return [| fixChange |])) + CodeFixHelpers.createTextChangeCodeFix (name, title, context, (fun () -> asyncMaybe.Return [| fixChange |])) context.RegisterCodeFix(replaceCodeFix, this.GetPrunedDiagnostics(context)) diff --git a/vsintegration/src/FSharp.Editor/CodeFix/ConvertCSharpLambdaToFSharpLambda.fs b/vsintegration/src/FSharp.Editor/CodeFix/ConvertCSharpLambdaToFSharpLambda.fs index 7f88b123aa..1c38dc2e02 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/ConvertCSharpLambdaToFSharpLambda.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/ConvertCSharpLambdaToFSharpLambda.fs @@ -7,7 +7,7 @@ open System.Composition open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.CodeFixes -[] +[] type internal FSharpConvertCSharpLambdaToFSharpLambdaCodeFixProvider [] () = inherit CodeFixProvider() @@ -46,7 +46,12 @@ type internal FSharpConvertCSharpLambdaToFSharpLambdaCodeFixProvider [ asyncMaybe.Return [| replacement |])) + CodeFixHelpers.createTextChangeCodeFix ( + CodeFix.ConvertCSharpLambdaToFSharpLambda, + title, + context, + (fun () -> asyncMaybe.Return [| replacement |]) + ) context.RegisterCodeFix(codeFix, diagnostics) } diff --git a/vsintegration/src/FSharp.Editor/CodeFix/ConvertCSharpUsingToFSharpOpen.fs b/vsintegration/src/FSharp.Editor/CodeFix/ConvertCSharpUsingToFSharpOpen.fs index 9181d6b5cd..d92eea460a 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/ConvertCSharpUsingToFSharpOpen.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/ConvertCSharpUsingToFSharpOpen.fs @@ -10,7 +10,7 @@ open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.CodeFixes -[] +[] type internal FSharpConvertCSharpUsingToFSharpOpen [] () = inherit CodeFixProvider() @@ -47,7 +47,12 @@ type internal FSharpConvertCSharpUsingToFSharpOpen [] () = let title = SR.ConvertCSharpUsingToFSharpOpen() let codeFix = - CodeFixHelpers.createTextChangeCodeFix (title, context, (fun () -> asyncMaybe.Return [| replacement |])) + CodeFixHelpers.createTextChangeCodeFix ( + CodeFix.ConvertCSharpUsingToFSharpOpen, + title, + context, + (fun () -> asyncMaybe.Return [| replacement |]) + ) context.RegisterCodeFix(codeFix, diagnostics) diff --git a/vsintegration/src/FSharp.Editor/CodeFix/ConvertToNotEqualsEqualityExpression.fs b/vsintegration/src/FSharp.Editor/CodeFix/ConvertToNotEqualsEqualityExpression.fs index 58ec9348d4..f1304f3996 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/ConvertToNotEqualsEqualityExpression.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/ConvertToNotEqualsEqualityExpression.fs @@ -8,7 +8,7 @@ open System.Threading.Tasks open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.CodeFixes -[] +[] type internal FSharpConvertToNotEqualsEqualityExpressionCodeFixProvider() = inherit CodeFixProvider() @@ -33,7 +33,12 @@ type internal FSharpConvertToNotEqualsEqualityExpressionCodeFixProvider() = |> Seq.toImmutableArray let codeFix = - CodeFixHelpers.createTextChangeCodeFix (title, context, (fun () -> asyncMaybe.Return [| TextChange(context.Span, "<>") |])) + CodeFixHelpers.createTextChangeCodeFix ( + CodeFix.ConvertToNotEqualsEqualityExpression, + title, + context, + (fun () -> asyncMaybe.Return [| TextChange(context.Span, "<>") |]) + ) context.RegisterCodeFix(codeFix, diagnostics) } diff --git a/vsintegration/src/FSharp.Editor/CodeFix/ConvertToSingleEqualsEqualityExpression.fs b/vsintegration/src/FSharp.Editor/CodeFix/ConvertToSingleEqualsEqualityExpression.fs index c06b6e5bbd..6832851a18 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/ConvertToSingleEqualsEqualityExpression.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/ConvertToSingleEqualsEqualityExpression.fs @@ -8,7 +8,7 @@ open System.Threading.Tasks open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.CodeFixes -[] +[] type internal FSharpConvertToSingleEqualsEqualityExpressionCodeFixProvider() = inherit CodeFixProvider() @@ -33,7 +33,12 @@ type internal FSharpConvertToSingleEqualsEqualityExpressionCodeFixProvider() = |> Seq.toImmutableArray let codeFix = - CodeFixHelpers.createTextChangeCodeFix (title, context, (fun () -> asyncMaybe.Return [| TextChange(context.Span, "=") |])) + CodeFixHelpers.createTextChangeCodeFix ( + CodeFix.ConvertToSingleEqualsEqualityExpression, + title, + context, + (fun () -> asyncMaybe.Return [| TextChange(context.Span, "=") |]) + ) context.RegisterCodeFix(codeFix, diagnostics) } diff --git a/vsintegration/src/FSharp.Editor/CodeFix/FixIndexerAccess.fs b/vsintegration/src/FSharp.Editor/CodeFix/FixIndexerAccess.fs index bc6d1bfb82..c594e86afd 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/FixIndexerAccess.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/FixIndexerAccess.fs @@ -10,7 +10,7 @@ open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.CodeFixes open FSharp.Compiler.Diagnostics -[] +[] type internal LegacyFsharpFixAddDotToIndexerAccess() = inherit CodeFixProvider() let fixableDiagnosticIds = set [ "FS3217" ] @@ -49,6 +49,7 @@ type internal LegacyFsharpFixAddDotToIndexerAccess() = let codefix = CodeFixHelpers.createTextChangeCodeFix ( + CodeFix.FixIndexerAccess, CompilerDiagnostics.GetErrorMessage FSharpDiagnosticKind.AddIndexerDot, context, (fun () -> asyncMaybe.Return [| TextChange(span, replacement.TrimEnd() + ".") |]) @@ -58,12 +59,12 @@ type internal LegacyFsharpFixAddDotToIndexerAccess() = } |> RoslynHelpers.StartAsyncUnitAsTask(context.CancellationToken) -[] +[] type internal FsharpFixRemoveDotFromIndexerAccessOptIn() as this = inherit CodeFixProvider() let fixableDiagnosticIds = set [ "FS3366" ] - static let fixName = + static let title = CompilerDiagnostics.GetErrorMessage FSharpDiagnosticKind.RemoveIndexerDot override _.FixableDiagnosticIds = Seq.toImmutableArray fixableDiagnosticIds @@ -73,5 +74,5 @@ type internal FsharpFixRemoveDotFromIndexerAccessOptIn() as this = let relevantDiagnostics = this.GetPrunedDiagnostics(context) if not relevantDiagnostics.IsEmpty then - this.RegisterFix(context, fixName, TextChange(context.Span, "")) + this.RegisterFix(CodeFix.RemoveIndexerDotBeforeBracket, title, context, TextChange(context.Span, "")) } diff --git a/vsintegration/src/FSharp.Editor/CodeFix/MakeDeclarationMutable.fs b/vsintegration/src/FSharp.Editor/CodeFix/MakeDeclarationMutable.fs index 2095a91762..aefbc74be7 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/MakeDeclarationMutable.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/MakeDeclarationMutable.fs @@ -3,18 +3,15 @@ namespace Microsoft.VisualStudio.FSharp.Editor open System.Composition -open System.Threading open System.Threading.Tasks open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.CodeFixes -open FSharp.Compiler -open FSharp.Compiler.CodeAnalysis open FSharp.Compiler.EditorServices open FSharp.Compiler.Text -[] +[] type internal FSharpMakeDeclarationMutableFixProvider [] () = inherit CodeFixProvider() @@ -73,6 +70,7 @@ type internal FSharpMakeDeclarationMutableFixProvider [] ( let codeFix = CodeFixHelpers.createTextChangeCodeFix ( + CodeFix.MakeDeclarationMutable, title, context, (fun () -> asyncMaybe.Return [| TextChange(TextSpan(span.Start, 0), "mutable ") |]) diff --git a/vsintegration/src/FSharp.Editor/CodeFix/MakeOuterBindingRecursive.fs b/vsintegration/src/FSharp.Editor/CodeFix/MakeOuterBindingRecursive.fs index dd64ca93fa..bae864afeb 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/MakeOuterBindingRecursive.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/MakeOuterBindingRecursive.fs @@ -8,7 +8,7 @@ open System.Composition open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.CodeFixes -[] +[] type internal FSharpMakeOuterBindingRecursiveCodeFixProvider [] () = inherit CodeFixProvider() @@ -50,6 +50,7 @@ type internal FSharpMakeOuterBindingRecursiveCodeFixProvider [ asyncMaybe.Return [| TextChange(TextSpan(outerBindingNameSpan.Start, 0), "rec ") |]) diff --git a/vsintegration/src/FSharp.Editor/CodeFix/RemoveReturnOrYield.fs b/vsintegration/src/FSharp.Editor/CodeFix/RemoveReturnOrYield.fs index 04c8d8e2fe..a002916639 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/RemoveReturnOrYield.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/RemoveReturnOrYield.fs @@ -7,7 +7,7 @@ open System.Composition open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.CodeFixes -[] +[] type internal FSharpRemoveReturnOrYieldCodeFixProvider [] () = inherit CodeFixProvider() @@ -44,6 +44,7 @@ type internal FSharpRemoveReturnOrYieldCodeFixProvider [] let codeFix = CodeFixHelpers.createTextChangeCodeFix ( + CodeFix.RemoveReturnOrYield, title, context, (fun () -> asyncMaybe.Return [| TextChange(context.Span, sourceText.GetSubText(exprSpan).ToString()) |]) diff --git a/vsintegration/src/FSharp.Editor/CodeFix/RemoveSuperflousCaptureForUnionCaseWithNoData.fs b/vsintegration/src/FSharp.Editor/CodeFix/RemoveSuperflousCaptureForUnionCaseWithNoData.fs index 2de05866fe..bc49d1f13d 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/RemoveSuperflousCaptureForUnionCaseWithNoData.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/RemoveSuperflousCaptureForUnionCaseWithNoData.fs @@ -2,20 +2,15 @@ namespace Microsoft.VisualStudio.FSharp.Editor -open System open System.Composition open System.Threading.Tasks open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.CodeFixes -open FSharp.Compiler -open FSharp.Compiler.CodeAnalysis -open FSharp.Compiler.Symbols -open FSharp.Compiler.Syntax open FSharp.Compiler.EditorServices -[] +[] type internal RemoveSuperflousCaptureForUnionCaseWithNoDataProvider [] () = inherit CodeFixProvider() @@ -51,7 +46,7 @@ type internal RemoveSuperflousCaptureForUnionCaseWithNoDataProvider [ Async.Ignore |> RoslynHelpers.StartAsyncUnitAsTask(context.CancellationToken) diff --git a/vsintegration/src/FSharp.Editor/CodeFix/RemoveUnusedBinding.fs b/vsintegration/src/FSharp.Editor/CodeFix/RemoveUnusedBinding.fs index ff900a049d..e290cb7173 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/RemoveUnusedBinding.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/RemoveUnusedBinding.fs @@ -9,7 +9,7 @@ open System.Threading.Tasks open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.CodeFixes -[] +[] type internal FSharpRemoveUnusedBindingCodeFixProvider [] () = inherit CodeFixProvider() @@ -57,7 +57,12 @@ type internal FSharpRemoveUnusedBindingCodeFixProvider [] let prefixTitle = SR.RemoveUnusedBinding() let removalCodeFix = - CodeFixHelpers.createTextChangeCodeFix (prefixTitle, context, (fun () -> asyncMaybe.Return [| TextChange(fullSpan, "") |])) + CodeFixHelpers.createTextChangeCodeFix ( + CodeFix.RemoveUnusedBinding, + prefixTitle, + context, + (fun () -> asyncMaybe.Return [| TextChange(fullSpan, "") |]) + ) context.RegisterCodeFix(removalCodeFix, diagnostics) } diff --git a/vsintegration/src/FSharp.Editor/CodeFix/RemoveUnusedOpens.fs b/vsintegration/src/FSharp.Editor/CodeFix/RemoveUnusedOpens.fs index e748c3e168..f46e1018f4 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/RemoveUnusedOpens.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/RemoveUnusedOpens.fs @@ -11,7 +11,7 @@ open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Diagnostics open FSharp.Compiler.Text -[] +[] type internal FSharpRemoveUnusedOpensCodeFixProvider [] () = inherit CodeFixProvider() @@ -41,7 +41,7 @@ type internal FSharpRemoveUnusedOpensCodeFixProvider [] () let title = SR.RemoveUnusedOpens() let codefix = - CodeFixHelpers.createTextChangeCodeFix (title, context, (fun () -> asyncMaybe.Return changes)) + CodeFixHelpers.createTextChangeCodeFix (CodeFix.RemoveUnusedOpens, title, context, (fun () -> asyncMaybe.Return changes)) context.RegisterCodeFix(codefix, diagnostics) } diff --git a/vsintegration/src/FSharp.Editor/CodeFix/RenameParamToMatchSignature.fs b/vsintegration/src/FSharp.Editor/CodeFix/RenameParamToMatchSignature.fs index f7429fe99d..68ca143aef 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/RenameParamToMatchSignature.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/RenameParamToMatchSignature.fs @@ -13,7 +13,7 @@ open Microsoft.VisualStudio.FSharp.Editor.SymbolHelpers open FSharp.Compiler.Diagnostics open FSharp.Compiler.Tokenization.FSharpKeywords -[] +[] type internal FSharpRenameParamToMatchSignature [] () = inherit CodeFixProvider() @@ -65,7 +65,7 @@ type internal FSharpRenameParamToMatchSignature [] () = CompilerDiagnostics.GetErrorMessage(FSharpDiagnosticKind.ReplaceWithSuggestion suggestion) let codefix = - CodeFixHelpers.createTextChangeCodeFix (title, context, computeChanges) + CodeFixHelpers.createTextChangeCodeFix (CodeFix.FSharpRenameParamToMatchSignature, title, context, computeChanges) context.RegisterCodeFix(codefix, diagnostics) | _ -> () diff --git a/vsintegration/src/FSharp.Editor/CodeFix/RenameUnusedValue.fs b/vsintegration/src/FSharp.Editor/CodeFix/RenameUnusedValue.fs index acbdf900dc..06a99d9538 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/RenameUnusedValue.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/RenameUnusedValue.fs @@ -14,7 +14,7 @@ open FSharp.Compiler.CodeAnalysis open FSharp.Compiler.Symbols open FSharp.Compiler.Syntax -[] +[] type internal FSharpRenameUnusedValueCodeFixProvider [] () = inherit CodeFixProvider() @@ -67,6 +67,7 @@ type internal FSharpRenameUnusedValueCodeFixProvider [] () let prefixCodeFix = CodeFixHelpers.createTextChangeCodeFix ( + CodeFix.RenameUnusedValue, prefixTitle, context, (fun () -> asyncMaybe.Return [| TextChange(TextSpan(context.Span.Start, 0), "_") |]) @@ -79,6 +80,7 @@ type internal FSharpRenameUnusedValueCodeFixProvider [] () let replaceCodeFix = CodeFixHelpers.createTextChangeCodeFix ( + CodeFix.RenameUnusedValue, replaceTitle, context, (fun () -> asyncMaybe.Return [| TextChange(context.Span, "_") |]) diff --git a/vsintegration/src/FSharp.Editor/CodeFix/ReplaceWithSuggestion.fs b/vsintegration/src/FSharp.Editor/CodeFix/ReplaceWithSuggestion.fs index a01869b9cf..b6c5399915 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/ReplaceWithSuggestion.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/ReplaceWithSuggestion.fs @@ -14,7 +14,7 @@ open FSharp.Compiler.Syntax open FSharp.Compiler.Text open FSharp.Compiler.Tokenization -[] +[] type internal FSharpReplaceWithSuggestionCodeFixProvider [] (settings: EditorOptions) = inherit CodeFixProvider() @@ -61,6 +61,7 @@ type internal FSharpReplaceWithSuggestionCodeFixProvider [ let codeFix = CodeFixHelpers.createTextChangeCodeFix ( + CodeFix.ReplaceWithSuggestion, CompilerDiagnostics.GetErrorMessage(FSharpDiagnosticKind.ReplaceWithSuggestion suggestion), context, (fun () -> asyncMaybe.Return [| TextChange(context.Span, replacement) |]) diff --git a/vsintegration/src/FSharp.Editor/CodeFix/SimplifyName.fs b/vsintegration/src/FSharp.Editor/CodeFix/SimplifyName.fs index ee613f4171..34bbfab9d9 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/SimplifyName.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/SimplifyName.fs @@ -10,7 +10,7 @@ open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.CodeFixes open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Diagnostics -[] +[] type internal FSharpSimplifyNameCodeFixProvider() = inherit CodeFixProvider() let fixableDiagnosticId = FSharpIDEDiagnosticIds.SimplifyNamesDiagnosticId @@ -27,6 +27,7 @@ type internal FSharpSimplifyNameCodeFixProvider() = let codefix = CodeFixHelpers.createTextChangeCodeFix ( + CodeFix.SimplifyName, title, context, (fun () -> asyncMaybe.Return [| TextChange(context.Span, "") |]) diff --git a/vsintegration/src/FSharp.Editor/CodeFix/UseMutationWhenValueIsMutable.fs b/vsintegration/src/FSharp.Editor/CodeFix/UseMutationWhenValueIsMutable.fs index 71d2ab27ad..f1358f569d 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/UseMutationWhenValueIsMutable.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/UseMutationWhenValueIsMutable.fs @@ -4,18 +4,15 @@ namespace Microsoft.VisualStudio.FSharp.Editor open System open System.Composition -open System.Threading open System.Threading.Tasks open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.CodeFixes -open FSharp.Compiler -open FSharp.Compiler.CodeAnalysis open FSharp.Compiler.Symbols open FSharp.Compiler.Text -[] +[] type internal FSharpUseMutationWhenValueIsMutableFixProvider [] () = inherit CodeFixProvider() @@ -83,6 +80,7 @@ type internal FSharpUseMutationWhenValueIsMutableFixProvider [ asyncMaybe.Return [| TextChange(TextSpan(pos + 1, 1), "<-") |]) diff --git a/vsintegration/src/FSharp.Editor/CodeFix/UseTripleQuotedInterpolation.fs b/vsintegration/src/FSharp.Editor/CodeFix/UseTripleQuotedInterpolation.fs index 4dca06ea3b..9249c01088 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/UseTripleQuotedInterpolation.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/UseTripleQuotedInterpolation.fs @@ -7,7 +7,7 @@ open System.Composition open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.CodeFixes -[] +[] type internal FSharpUseTripleQuotedInterpolationCodeFixProvider [] () = inherit CodeFixProvider() @@ -41,7 +41,12 @@ type internal FSharpUseTripleQuotedInterpolationCodeFixProvider [ asyncMaybe.Return [| replacement |])) + CodeFixHelpers.createTextChangeCodeFix ( + CodeFix.UseTripleQuotedInterpolation, + title, + context, + (fun () -> asyncMaybe.Return [| replacement |]) + ) context.RegisterCodeFix(codeFix, diagnostics) } diff --git a/vsintegration/src/FSharp.Editor/Common/Constants.fs b/vsintegration/src/FSharp.Editor/Common/Constants.fs index f1bacf63cc..b2585dc327 100644 --- a/vsintegration/src/FSharp.Editor/Common/Constants.fs +++ b/vsintegration/src/FSharp.Editor/Common/Constants.fs @@ -94,3 +94,86 @@ module internal Guids = let formattingOptionPageIdString = "9EBEBCE8-A79B-46B0-A8C5-A9818AEED17D" let blueHighContrastThemeId = Guid "{ce94d289-8481-498b-8ca9-9b6191a315b9}" + +[] +module internal CodeFix = + + [] + let AddInstanceMemberParameter = "AddInstanceMemberParameter" + + [] + let ConvertCSharpLambdaToFSharpLambda = "ConvertCSharpLambdaToFSharpLambda" + + [] + let ConvertToNotEqualsEqualityExpression = "ConvertToNotEqualsEqualityExpression" + + [] + let UseTripleQuotedInterpolation = "UseTripleQuotedInterpolation" + + [] + let SimplifyName = "SimplifyName" + + [] + let RemoveUnusedBinding = "RemoveUnusedBinding" + + [] + let ChangeToUpcast = "ChangeToUpcast" + + [] + let UseMutationWhenValueIsMutable = "UseMutationWhenValueIsMutable" + + [] + let RenameUnusedValue = "RenameUnusedValue" + + [] + let FixIndexerAccess = "FixIndexerAccess" + + [] + let RemoveReturnOrYield = "RemoveReturnOrYield" + + [] + let ReplaceWithSuggestion = "ReplaceWithSuggestion" + + [] + let MakeOuterBindingRecursive = "MakeOuterBindingRecursive" + + [] + let ConvertToSingleEqualsEqualityExpression = + "ConvertToSingleEqualsEqualityExpression" + + [] + let MakeDeclarationMutable = "MakeDeclarationMutable" + + [] + let ChangePrefixNegationToInfixSubtraction = + "ChangePrefixNegationToInfixSubtraction" + + [] + let AddMissingFunKeyword = "AddMissingFunKeyword" + + [] + let AddNewKeyword = "AddNewKeyword" + + [] + let RemoveUnusedOpens = "RemoveUnusedOpens" + + [] + let AddOpen = "AddOpen" + + [] + let ConvertCSharpUsingToFSharpOpen = "ConvertCSharpUsingToFSharpOpen" + + [] + let ChangeRefCellDerefToNotExpression = "ChangeRefCellDerefToNotExpression" + + [] + let AddMissingEqualsToTypeDefinition = "AddMissingEqualsToTypeDefinition" + + [] + let FSharpRenameParamToMatchSignature = "FSharpRenameParamToMatchSignature" + + [] + let RemoveIndexerDotBeforeBracket = "RemoveIndexerDotBeforeBracket" + + [] + let RemoveSuperfluousCapture = "RemoveSuperfluousCapture" From 6913862cdd0399bef31e200e05d2fcf167edc930 Mon Sep 17 00:00:00 2001 From: dotnet bot Date: Wed, 12 Apr 2023 07:22:13 -0700 Subject: [PATCH 05/13] Localized file check-in by OneLocBuild Task: Build definition ID 499: Build ID 2156455 (#15071) --- .../FSharp.Editor/xlf/FSharp.Editor.cs.xlf | 22 +++++++++---------- .../FSharp.Editor/xlf/FSharp.Editor.es.xlf | 20 ++++++++--------- .../FSharp.Editor/xlf/FSharp.Editor.ja.xlf | 20 ++++++++--------- .../FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf | 20 ++++++++--------- .../FSharp.Editor/xlf/FSharp.Editor.ru.xlf | 20 ++++++++--------- .../xlf/FSharp.Editor.zh-Hans.xlf | 20 ++++++++--------- .../src/FSharp.UIResources/xlf/Strings.de.xlf | 2 +- .../src/FSharp.UIResources/xlf/Strings.fr.xlf | 2 +- .../src/FSharp.UIResources/xlf/Strings.it.xlf | 2 +- .../src/FSharp.UIResources/xlf/Strings.ko.xlf | 2 +- .../src/FSharp.UIResources/xlf/Strings.pl.xlf | 2 +- .../src/FSharp.UIResources/xlf/Strings.tr.xlf | 2 +- .../xlf/Strings.zh-Hant.xlf | 2 +- 13 files changed, 67 insertions(+), 69 deletions(-) diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf index 24c8cc476e..aa400d2f56 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf @@ -38,18 +38,16 @@ Display return type hints (preview); Display inline parameter name hints (preview); Live Buffers; Use live (unsaved) buffers for checking - Vodítka struktury bloků; - -Zobrazit pokyny pro strukturu kódu F#; -Osnova; -Zobrazit sbalitelné a sbalitelné uzly pro kód F#; -Vložené tipy; -Zobrazovat pomocné parametry vloženého typu (Preview); -Zobrazit pomocné parametry návratového typu (Preview); -Zobrazit vložené nápovědy k názvům parametrů (Preview); Pivo; - -Živé vyrovnávací paměti; -Pro kontrolu použijte živé (neuložené) vyrovnávací paměti. + Block Structure Guides; +Show structure guidelines for F# code; +Outlining; +Show outlining and collapsible nodes for F# code; +Inline hints; +Display inline type hints (preview); +Display return type hints (preview); +Display inline parameter name hints (preview); +Live Buffers; +Use live (unsaved) buffers for checking diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf index 461c87cf36..e7a15db663 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf @@ -38,16 +38,16 @@ Display return type hints (preview); Display inline parameter name hints (preview); Live Buffers; Use live (unsaved) buffers for checking - Guías de estructura de bloques; -Mostrar guías de estructura para código F#; -Esquema; -Mostrar contorno y nodos colapsables para código F#; -Sugerencias inline; -Mostrar sugerencias de tipo en línea (vista previa); -Mostrar sugerencias de tipo retorno (vista previa); -Mostrar sugerencias de nombres de parámetros en línea (vista previa); Beer; -Búferes activos; -Usar buffers vivos (no guardados) para comprobar + Block Structure Guides; +Show structure guidelines for F# code; +Outlining; +Show outlining and collapsible nodes for F# code; +Inline hints; +Display inline type hints (preview); +Display return type hints (preview); +Display inline parameter name hints (preview); +Live Buffers; +Use live (unsaved) buffers for checking diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf index 08bc5e4924..5906f7efc5 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf @@ -38,16 +38,16 @@ Display return type hints (preview); Display inline parameter name hints (preview); Live Buffers; Use live (unsaved) buffers for checking - ブロック構造ガイド; -F# コードの構造ガイドラインを表示します。 -アウトライン; -F# コードのアウトラインと折りたたみ可能なノードを表示します。 -インライン ヒント; -インライン型のヒントを表示する (プレビュー); -戻り値型のヒントを表示する (プレビュー); -インライン パラメーター名のヒントを表示する (プレビュー);ビール; -ライブ バッファー; -ライブ (未保存) バッファーをチェックに使用する + Block Structure Guides; +Show structure guidelines for F# code; +Outlining; +Show outlining and collapsible nodes for F# code; +Inline hints; +Display inline type hints (preview); +Display return type hints (preview); +Display inline parameter name hints (preview); +Live Buffers; +Use live (unsaved) buffers for checking diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf index 6e04034691..f4371880ee 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf @@ -38,16 +38,16 @@ Display return type hints (preview); Display inline parameter name hints (preview); Live Buffers; Use live (unsaved) buffers for checking - Guias de Estrutura de Bloco; -Mostrar diretrizes de estrutura para código F#; -Estrutura de tópicos; -Mostrar nós de estrutura de tópicos e recolhíveis para código F#; -Dicas embutidas; -Exibir dicas de tipo embutido (versão prévia); -Exibir dicas de tipo de retorno (versão prévia); -Exibir dicas de nome de parâmetro embutido (versão prévia);Cerveja; -Buffers Dinâmicos; -Usar buffers dinâmicos (não salvos) para verificação + Block Structure Guides; +Show structure guidelines for F# code; +Outlining; +Show outlining and collapsible nodes for F# code; +Inline hints; +Display inline type hints (preview); +Display return type hints (preview); +Display inline parameter name hints (preview); +Live Buffers; +Use live (unsaved) buffers for checking diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf index 3a6236f20e..110c6b15ff 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf @@ -38,16 +38,16 @@ Display return type hints (preview); Display inline parameter name hints (preview); Live Buffers; Use live (unsaved) buffers for checking - Руководства по блочной структуре; -Показать рекомендации по структуре для кода F#; -Структурирование; -Показать структурные и сворачиваемые узлы для кода F#; -Встроенные подсказки; -Отображение подсказок встроенного типа (предварительная версия); -Отображение подсказок типа возвращаемого значения (предварительная версия); -Отображение встроенных подсказок имени параметра (предварительная версия);пиво; -Динамические буферы; -Использовать динамические (несохраненные) буферы для проверки + Block Structure Guides; +Show structure guidelines for F# code; +Outlining; +Show outlining and collapsible nodes for F# code; +Inline hints; +Display inline type hints (preview); +Display return type hints (preview); +Display inline parameter name hints (preview); +Live Buffers; +Use live (unsaved) buffers for checking diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf index fb08ab98d1..26f84c9b28 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf @@ -38,16 +38,16 @@ Display return type hints (preview); Display inline parameter name hints (preview); Live Buffers; Use live (unsaved) buffers for checking - 块结构指南; -显示 F# 代码的结构指南; -大纲; -显示 F# 代码的大纲和可折叠节点; -内联提示; -显示内联类型提示(预览); -显示返回类型提示(预览); -显示内联参数名称提示(预览);啤酒; -实时缓冲区; -使用实时(未保存)缓冲区进行检查 + Block Structure Guides; +Show structure guidelines for F# code; +Outlining; +Show outlining and collapsible nodes for F# code; +Inline hints; +Display inline type hints (preview); +Display return type hints (preview); +Display inline parameter name hints (preview); +Live Buffers; +Use live (unsaved) buffers for checking diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf index a5242f6b03..79a87ce35f 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf @@ -109,7 +109,7 @@ Display return type hints (preview) - Display return type hints (preview) + Hinweise zum Rückgabetyp anzeigen (Vorschau) diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf index 1947b681c1..784e9e02ee 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf @@ -109,7 +109,7 @@ Display return type hints (preview) - Display return type hints (preview) + Afficher les conseils de type de retour en ligne (préversion) diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf index b10835d5a0..5bc66e016f 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf @@ -109,7 +109,7 @@ Display return type hints (preview) - Display return type hints (preview) + Visualizza suggerimenti di tipo restituito (anteprima) diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf index 4f70ec137f..8d94e9b5da 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf @@ -109,7 +109,7 @@ Display return type hints (preview) - Display return type hints (preview) + 반환 형식 힌트 표시(미리 보기) diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf index 3a0047883c..ffbc8e72b8 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf @@ -109,7 +109,7 @@ Display return type hints (preview) - Display return type hints (preview) + Wyświetlaj wskazówki dotyczące typu zwrotu (wersja zapoznawcza) diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf index 5216125925..520b8780e3 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf @@ -109,7 +109,7 @@ Display return type hints (preview) - Display return type hints (preview) + Dönüş türü ipuçlarını görüntüle (önizleme) diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf index 80c95f5ecd..12a26f2e64 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf @@ -109,7 +109,7 @@ Display return type hints (preview) - Display return type hints (preview) + 顯示傳回類型提示 (預覽) From 4ac535c84c636b9fe5a91b88957152f75692b017 Mon Sep 17 00:00:00 2001 From: dotnet bot Date: Thu, 13 Apr 2023 01:59:02 -0700 Subject: [PATCH 06/13] Update .NET and devcontainer settings (#15073) (#15076) * Update .NET and devcontainer * Update .NET and devcontainer Co-authored-by: Vlad Zarytovskii Co-authored-by: Kevin Ransom (msft) --- .devcontainer/Dockerfile | 2 +- .devcontainer/devcontainer.json | 26 ++++++++++++-------------- .vscode/settings.json | 4 ++-- global.json | 4 ++-- 4 files changed, 17 insertions(+), 19 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 0d31aa0f1d..82df3d1aea 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -3,7 +3,7 @@ # Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information. #------------------------------------------------------------------------------------------------------------- -ARG VARIANT=7.0.202-bullseye-slim-amd64 +ARG VARIANT=7.0.203-bullseye-slim-amd64 FROM mcr.microsoft.com/dotnet/sdk:${VARIANT} # Avoid warnings by switching to noninteractive diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index cfba72ce23..b1e0e82b52 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -6,7 +6,7 @@ "args": { // Update 'VARIANT' to pick a .NET Core version: 3.1, 5.0, 6.0, 7.0 // Append -bullseye(-slim), -focal, or -jammy to pin to an OS version. - "VARIANT": "7.0.202-bullseye-slim-amd64" + "VARIANT": "7.0.203-bullseye-slim-amd64" } }, "hostRequirements": { @@ -14,19 +14,17 @@ "memory": "4gb", "storage": "32gb" }, + "customizations": { + "vscode": { + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + "ms-dotnettools.csharp", + "Ionide.Ionide-fsharp", + "tintoy.msbuild-project-tools" + ] + } + }, - // Add the IDs of extensions you want installed when the container is created. - "extensions": [ - "ms-dotnettools.csharp", - "Ionide.Ionide-fsharp", - "tintoy.msbuild-project-tools" - ], - //"onCreateCommand": [ // It is a bit buggy in codespaces, so for now, need to run it manually. - // "/bin/bash", - // "-c", - // "./build.sh", - // "-c", - // "Debug" - //], + "onCreateCommand": [ "dotnet", "build", "FSharp.Compiler.Service.sln"], "waitFor": "onCreateCommand" } diff --git a/.vscode/settings.json b/.vscode/settings.json index f1629c99e8..9cc57c917b 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -16,13 +16,13 @@ "*.fs": "${capture}.fsi" }, "FSharp.suggestGitignore": false, - "FSharp.enableMSBuildProjectGraph": false, + "FSharp.enableMSBuildProjectGraph": true, "FSharp.enableAdaptiveLspServer": true, "FSharp.workspacePath": "FSharp.Compiler.Service.sln", "FSharp.workspaceModePeekDeepLevel": 1, - "FSharp.enableBackgroundServices": false, "FSharp.excludeProjectDirectories": [ ".git", + ".vscode", "eng", "artifacts", "fcs-samples", diff --git a/global.json b/global.json index b7b566d711..59f2a3742c 100644 --- a/global.json +++ b/global.json @@ -1,11 +1,11 @@ { "sdk": { - "version": "7.0.202", + "version": "7.0.203", "allowPrerelease": true, "rollForward": "latestPatch" }, "tools": { - "dotnet": "7.0.202", + "dotnet": "7.0.203", "vs": { "version": "17.5", "components": ["Microsoft.VisualStudio.Component.FSharp"] From 8c6666568d4fcf68c58840b30584d882daf60a3c Mon Sep 17 00:00:00 2001 From: Jakub Majocha <1760221+majocha@users.noreply.github.com> Date: Mon, 17 Apr 2023 13:40:28 +0200 Subject: [PATCH 07/13] VS: Use IViewElementFactory as intended (#15098) Co-authored-by: Vlad Zarytovskii --- .../src/FSharp.Editor/QuickInfo/Views.fs | 24 ++-- .../FSharp.Editor/QuickInfo/WpfFactories.fs | 109 ++++++++---------- .../src/FSharp.UIResources/NavStyles.xaml | 6 +- 3 files changed, 58 insertions(+), 81 deletions(-) diff --git a/vsintegration/src/FSharp.Editor/QuickInfo/Views.fs b/vsintegration/src/FSharp.Editor/QuickInfo/Views.fs index 415b38798b..ab8ae82eff 100644 --- a/vsintegration/src/FSharp.Editor/QuickInfo/Views.fs +++ b/vsintegration/src/FSharp.Editor/QuickInfo/Views.fs @@ -55,14 +55,13 @@ module internal QuickInfoViewProvider = | TaggedText (TextTag.LineBreak, _) -> Some() | _ -> None - let wrapContent (elements: obj list) = - ContainerElement(ContainerElementStyle.Wrapped, elements |> Seq.map box) + let wrapContent (elements: obj seq) = + ContainerElement(ContainerElementStyle.Wrapped, elements) - let stackContent (elements: obj list) = - ContainerElement(ContainerElementStyle.Stacked, elements |> Seq.map box) + let stackContent (elements: obj seq) = + ContainerElement(ContainerElementStyle.Stacked, elements) - let encloseRuns runs = - ClassifiedTextElement(runs |> List.rev) |> box + let encloseRuns runs : obj = ClassifiedTextElement(runs |> List.rev) let provideContent ( @@ -78,8 +77,8 @@ module internal QuickInfoViewProvider = match (text: TaggedText list) with | [] when runs |> List.isEmpty -> stackContent (stack |> List.rev) | [] -> stackContent (encloseRuns runs :: stack |> List.rev) - // smaller gap instead of huge double line break - | LineBreak :: rest when runs |> List.isEmpty -> loop rest [] (box (Separator false) :: stack) + // smaller paragraph spacing instead of huge double line break + | LineBreak :: rest when runs |> List.isEmpty -> loop rest [] (Paragraph :: stack) | LineBreak :: rest -> loop rest [] (encloseRuns runs :: stack) | :? NavigableTaggedText as item :: rest when navigation.IsTargetValid item.Range -> let classificationTag = layoutTagToClassificationTag item.Tag @@ -93,17 +92,14 @@ module internal QuickInfoViewProvider = let run = ClassifiedTextRun(layoutTagToClassificationTag item.Tag, item.Text) loop rest (run :: runs) stack - loop text [] [] |> box + loop text [] [] let innerElement = match imageId with | Some imageId -> wrapContent [ stackContent [ ImageElement(imageId) ]; encloseText description ] | None -> ContainerElement(ContainerElementStyle.Wrapped, encloseText description) - wrapContent [ stackContent [ innerElement; encloseText documentation ] ] + wrapContent [ stackContent [ innerElement; encloseText documentation ]; CustomLinkStyle ] let stackWithSeparators elements = - elements - |> List.map box - |> List.intersperse (box (Separator true)) - |> stackContent + elements |> List.map box |> List.intersperse Separator |> stackContent diff --git a/vsintegration/src/FSharp.Editor/QuickInfo/WpfFactories.fs b/vsintegration/src/FSharp.Editor/QuickInfo/WpfFactories.fs index 84f157edc6..1abf13001a 100644 --- a/vsintegration/src/FSharp.Editor/QuickInfo/WpfFactories.fs +++ b/vsintegration/src/FSharp.Editor/QuickInfo/WpfFactories.fs @@ -7,83 +7,64 @@ open System.Windows open System.Windows.Controls open Microsoft.VisualStudio.Text.Adornments -open Microsoft.VisualStudio.Text.Editor open Microsoft.VisualStudio.Utilities -open Microsoft.VisualStudio.FSharp.Editor -open Microsoft.VisualStudio.Text.Classification +open Microsoft.VisualStudio.FSharp -type Separator = - | Separator of visible: bool - // preserve old behavior on mac +type internal FSharpStyle = + | Separator + | Paragraph + | CustomLinkStyle + + // Render as strings for cross platform look. override this.ToString() = match this with - | Separator true -> XmlDocumentation.separatorText - | _ -> System.Environment.NewLine + | Separator -> Editor.XmlDocumentation.separatorText + | Paragraph -> System.Environment.NewLine + | CustomLinkStyle -> "" +// Provide nicer look for the QuickInfo on Windows. [)>] -[] -[, typeof)>] -type WpfClassifiedTextElementFactory [] - ( - classificationformatMapService: IClassificationFormatMapService, - classificationTypeRegistry: IClassificationTypeRegistryService, - settings: EditorOptions - ) = - let resources = Microsoft.VisualStudio.FSharp.UIResources.NavStyles().Resources - let formatMap = classificationformatMapService.GetClassificationFormatMap("tooltip") +[] +[, typeof)>] +type internal WpfFSharpStyleFactory [] (settings: Editor.EditorOptions) = + let linkStyleUpdater () = + let key = + if settings.QuickInfo.DisplayLinks then + $"{settings.QuickInfo.UnderlineStyle.ToString().ToLower()}_underline" + else + "no_underline" - interface IViewElementFactory with - member _.CreateViewElement(_textView: ITextView, model: obj) = - match model with - | :? ClassifiedTextElement as text -> - let tb = TextBlock() - tb.FontSize <- formatMap.DefaultTextProperties.FontRenderingEmSize - tb.FontFamily <- formatMap.DefaultTextProperties.Typeface.FontFamily - tb.TextWrapping <- TextWrapping.Wrap + let style = UIResources.NavStyles().Resources[key] :?> Style - for run in text.Runs do - let ctype = - classificationTypeRegistry.GetClassificationType(run.ClassificationTypeName) + // Some assumptions are made here about the shape of QuickInfo visual tree rendered by VS. + // If some future VS update were to render QuickInfo with different WPF elements + // the links will still work, just without their custom styling. + let rec styleLinks (element: DependencyObject) = + match element with + | :? TextBlock as t -> + for run in t.Inlines do + if run :? Documents.Hyperlink then + run.Style <- style + | :? Panel as p -> + for e in p.Children do + styleLinks e + | _ -> () - let props = formatMap.GetTextProperties(ctype) - let inl = Documents.Run(run.Text, Foreground = props.ForegroundBrush) + // Return an invisible FrameworkElement which will traverse it's siblings + // to find HyperLinks and update their style, when inserted into the visual tree. + { new FrameworkElement() with + override this.OnVisualParentChanged _ = styleLinks this.Parent + } - match run.NavigationAction |> Option.ofObj with - | Some action -> - let link = - { new Documents.Hyperlink(inl, ToolTip = run.Tooltip) with - override _.OnClick() = action.Invoke() - } - - let key = - match settings.QuickInfo.UnderlineStyle with - | QuickInfoUnderlineStyle.Solid -> "solid_underline" - | QuickInfoUnderlineStyle.Dash -> "dash_underline" - | QuickInfoUnderlineStyle.Dot -> "dot_underline" - - link.Style <- downcast resources[key] - link.Foreground <- props.ForegroundBrush - tb.Inlines.Add(link) - | _ -> tb.Inlines.Add(inl) - - box tb :?> _ - | _ -> - failwith - $"Invalid type conversion. Supported conversion is {typeof.Name} to {typeof.Name}." - -[)>] -[] -[, typeof)>] -type WpfSeparatorFactory() = interface IViewElementFactory with member _.CreateViewElement(_, model: obj) = match model with - | :? Separator as Separator visible -> - if visible then - Controls.Separator(Opacity = 0.3, Margin = Thickness(0, 8, 0, 8)) - else - Controls.Separator(Opacity = 0) + | :? FSharpStyle as fSharpStyle -> + match fSharpStyle with + | CustomLinkStyle -> linkStyleUpdater () + | Separator -> Controls.Separator(Opacity = 0.3, Margin = Thickness(0, 8, 0, 8)) + | Paragraph -> Controls.Separator(Opacity = 0) |> box :?> _ - | _ -> failwith $"Invalid type conversion. Supported conversion is {typeof.Name} to {typeof.Name}." + | _ -> failwith $"Invalid type conversion. Supported conversion is {typeof.Name} to {typeof.Name}." diff --git a/vsintegration/src/FSharp.UIResources/NavStyles.xaml b/vsintegration/src/FSharp.UIResources/NavStyles.xaml index a800818ee5..6421aeee9c 100644 --- a/vsintegration/src/FSharp.UIResources/NavStyles.xaml +++ b/vsintegration/src/FSharp.UIResources/NavStyles.xaml @@ -8,8 +8,8 @@ mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800"> - - + + @@ -26,7 +26,7 @@ - +