From 52c06493c68deb692065e13718f8c658dba43a8c Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Tue, 8 Oct 2024 14:46:53 +0200 Subject: [PATCH 01/49] Update azure-pipelines.yml --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a8155022e68..b4f235359af 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -35,7 +35,7 @@ variables: # (since for all *new* release branches we insert into VS main and for all *previous* releases we insert into corresponding VS release), # i.e. 'rel/d17.9' *or* 'main' in dotnet/fsharp/refs/heads/main and 'main' in F# dotnet/fsharp/refs/heads/release/dev17.10 (latest release branch) - name: VSInsertionTargetBranchName - value: rel/d17.12 + value: main - name: _TeamName value: FSharp - name: TeamName From 1827c9be74391abec506d37fb659f28fde47641b Mon Sep 17 00:00:00 2001 From: dotnet bot Date: Wed, 9 Oct 2024 04:47:49 -0700 Subject: [PATCH 02/49] Localized file check-in by OneLocBuild Task: Build definition ID 499: Build ID 2555417 (#17854) --- .../FSharp.Editor/xlf/FSharp.Editor.cs.xlf | 21 +++++++++---------- .../FSharp.Editor/xlf/FSharp.Editor.de.xlf | 21 +++++++++---------- .../FSharp.Editor/xlf/FSharp.Editor.es.xlf | 19 ++++++++--------- .../FSharp.Editor/xlf/FSharp.Editor.fr.xlf | 19 ++++++++--------- .../FSharp.Editor/xlf/FSharp.Editor.it.xlf | 21 +++++++++---------- .../FSharp.Editor/xlf/FSharp.Editor.ja.xlf | 19 ++++++++--------- .../FSharp.Editor/xlf/FSharp.Editor.ko.xlf | 19 ++++++++--------- .../FSharp.Editor/xlf/FSharp.Editor.pl.xlf | 21 +++++++++---------- .../FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf | 21 +++++++++---------- .../FSharp.Editor/xlf/FSharp.Editor.ru.xlf | 21 +++++++++---------- .../FSharp.Editor/xlf/FSharp.Editor.tr.xlf | 21 +++++++++---------- .../xlf/FSharp.Editor.zh-Hans.xlf | 19 ++++++++--------- .../xlf/FSharp.Editor.zh-Hant.xlf | 21 +++++++++---------- 13 files changed, 125 insertions(+), 138 deletions(-) diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf index 421cc037111..ab212d44291 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf @@ -175,17 +175,16 @@ Parallelization (requires restart); Enable parallel type checking with signature files; Enable parallel reference resolution; Enable fast find references & rename (restart required) - Možnosti výkonu pro ukládání do mezipaměti a projekt F#; -Povolit odkazy mezi projekty v paměti; -Povolit_částečnou_kontrolu_typu; -Možnosti výkonu pro IntelliSense; -Povolit zastaralá data pro funkce IntelliSense; -Doba, do kdy se budou používat zastaralé výsledky (v milisekundách); -Paralelizace (vyžaduje restartování); -Povolit paralelní kontrolu typů pomocí souborů podpisu; -Povolit paralelní referenční rozlišení; -Povolit odkazy rychlého hledání a přejmenování (vyžaduje se restartování); -Výsledky analýzy mezipaměti (experimentální) + F# Project and Caching Performance Options; +Enable in-memory cross project references; +Enable_partial_type_checking; +IntelliSense Performance Options; +Enable stale data for IntelliSense features; +Time until stale results are used (in milliseconds); +Parallelization (requires restart); +Enable parallel type checking with signature files; +Enable parallel reference resolution; +Enable fast find references & rename (restart required) diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf index ff2a415b3a0..631ae04fdba 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf @@ -175,17 +175,16 @@ Parallelization (requires restart); Enable parallel type checking with signature files; Enable parallel reference resolution; Enable fast find references & rename (restart required) - Optionen zur F#-Projekt- und Cacheleistung; -Proj_ektübergreifende Verweise im Arbeitsspeicher aktivieren; -Aktivieren der partiellen Typüberprüfung; -Optionen zur IntelliSense-Leistung; -Veraltete Daten für IntelliSense-Features aktivieren; -Zeit bis zur Verwendung veralteter Ergebnisse (in Millisekunden); -Parallelisierung (Neustart erforderlich); -Parallele Typüberprüfung mit Signaturdateien aktivieren; -Parallele Verweisauflösung aktivieren; -Schnellsuche und Umbenennen von Verweisen aktivieren (Neustart erforderlich); -Cacheanalyseergebnisse (experimentell) + F# Project and Caching Performance Options; +Enable in-memory cross project references; +Enable_partial_type_checking; +IntelliSense Performance Options; +Enable stale data for IntelliSense features; +Time until stale results are used (in milliseconds); +Parallelization (requires restart); +Enable parallel type checking with signature files; +Enable parallel reference resolution; +Enable fast find references & rename (restart required) diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf index 5df84b54acc..f992a8c96c1 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf @@ -175,17 +175,16 @@ Parallelization (requires restart); Enable parallel type checking with signature files; Enable parallel reference resolution; Enable fast find references & rename (restart required) - Opciones de rendimiento de almacenamiento en caché y proyectos de F#; -Habilitar referencias entre proyectos en memoria; + F# Project and Caching Performance Options; +Enable in-memory cross project references; Enable_partial_type_checking; -Opciones de rendimiento de IntelliSense; -Habilitar datos obsoletos para características de IntelliSense; -Tiempo hasta que se utilizan los resultados obsoletos (en milisegundos); -Paralelización (requiere reiniciar); -Habilitar la comprobación de tipos paralelos con archivos de firma; -Habilitar resolución de referencias paralelas; -Habilitar referencias de búsqueda rápida y cambio de nombre (es necesario reiniciar); -Resultados del análisis de la caché (experimental) +IntelliSense Performance Options; +Enable stale data for IntelliSense features; +Time until stale results are used (in milliseconds); +Parallelization (requires restart); +Enable parallel type checking with signature files; +Enable parallel reference resolution; +Enable fast find references & rename (restart required) diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf index efe15d65037..d9d1bc001e9 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf @@ -175,17 +175,16 @@ Parallelization (requires restart); Enable parallel type checking with signature files; Enable parallel reference resolution; Enable fast find references & rename (restart required) - Options relatives aux performances de la mise en cache et des projets F#; -Activer les références de projet croisé en mémoire; + F# Project and Caching Performance Options; +Enable in-memory cross project references; Enable_partial_type_checking; -Options relatives aux performances d’IntelliSense; -Activer les données périmées pour les fonctionnalités IntelliSense; -Délai avant l’utilisation des résultats périmés (en millisecondes); -Parallélisation (Nécessite un redémarrage); -Activer la vérification de type parallèle avec les fichiers de signature; -Activer la résolution de référence parallèle; -Activer la recherche rapide de références et le renommage (redémarrage requis); -Résultats de l’analyse du cache (expérimental) +IntelliSense Performance Options; +Enable stale data for IntelliSense features; +Time until stale results are used (in milliseconds); +Parallelization (requires restart); +Enable parallel type checking with signature files; +Enable parallel reference resolution; +Enable fast find references & rename (restart required) diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf index ca32c029946..cc9ed2b2272 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf @@ -175,17 +175,16 @@ Parallelization (requires restart); Enable parallel type checking with signature files; Enable parallel reference resolution; Enable fast find references & rename (restart required) - Opzioni per le prestazioni di memorizzazione nella cache e progetti F#; -_Abilita i riferimenti tra progetti in memoria; -Abilita il controllo parziale dei tipi; -Opzioni per le prestazioni IntelliSense; -Abilita dati non aggiornati per le funzionalità IntelliSense; -Intervallo di utilizzo dei risultati non aggiornati (in millisecondi); -Parallelizzazione (richiede il riavvio); -Abilitare il controllo dei tipi paralleli con i file di firma; -Abilitare risoluzione riferimenti paralleli; -Abilitare i riferimenti di ricerca rapida > ridenominazione (riavvio necessario); -Risultati dell'analisi della cache (sperimentale) + F# Project and Caching Performance Options; +Enable in-memory cross project references; +Enable_partial_type_checking; +IntelliSense Performance Options; +Enable stale data for IntelliSense features; +Time until stale results are used (in milliseconds); +Parallelization (requires restart); +Enable parallel type checking with signature files; +Enable parallel reference resolution; +Enable fast find references & rename (restart required) diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf index 44ca609e1cd..0adc031ebe8 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf @@ -175,17 +175,16 @@ Parallelization (requires restart); Enable parallel type checking with signature files; Enable parallel reference resolution; Enable fast find references & rename (restart required) - F# プロジェクトとキャッシュのパフォーマンス オプション; -メモリ内のプロジェクト間参照を有効にする; + F# Project and Caching Performance Options; +Enable in-memory cross project references; Enable_partial_type_checking; -IntelliSense のパフォーマンス オプション; -IntelliSense 機能に対して古いデータを有効にする; -古い結果が使用されるまでの時間 (ミリ秒); -並列化 (再起動が必要); -署名ファイルを使用して並列型チェックを有効にする; -並列参照解決を有効にする; -高速検索参照と名前の変更を有効にする (再起動が必要); -キャッシュ解析の結果 (試験段階) +IntelliSense Performance Options; +Enable stale data for IntelliSense features; +Time until stale results are used (in milliseconds); +Parallelization (requires restart); +Enable parallel type checking with signature files; +Enable parallel reference resolution; +Enable fast find references & rename (restart required) diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf index 66cfbeed575..652fddc41ce 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf @@ -175,17 +175,16 @@ Parallelization (requires restart); Enable parallel type checking with signature files; Enable parallel reference resolution; Enable fast find references & rename (restart required) - F# 프로젝트 및 캐싱 성능 옵션; -메모리 내 크로스 프로젝트 참조 사용; + F# Project and Caching Performance Options; +Enable in-memory cross project references; Enable_partial_type_checking; -IntelliSense 성능 옵션; -IntelliSense 기능에 대해 부실 데이터 사용; -부실 결과가 사용될 때까지의 시간(밀리초); -병렬화(다시 시작 필요); -서명 파일로 병렬 유형 검사 사용; -병렬 참조 해상도 사용; -빠른 찾기 참조 및 이름 바꾸기 사용(다시 시작 필요); -캐시 구문 분석 결과(실험적) +IntelliSense Performance Options; +Enable stale data for IntelliSense features; +Time until stale results are used (in milliseconds); +Parallelization (requires restart); +Enable parallel type checking with signature files; +Enable parallel reference resolution; +Enable fast find references & rename (restart required) diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf index 1675887bd6d..eeac9d3b2bb 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf @@ -175,17 +175,16 @@ Parallelization (requires restart); Enable parallel type checking with signature files; Enable parallel reference resolution; Enable fast find references & rename (restart required) - Opcje wydajności projektu i buforowania języka F#; -Włącz odwołania między projektami w pamięci; -Włącz_częściową_kontrolę_typu; -Opcje wydajności funkcji IntelliSense; -Włącz nieaktualne dane na potrzeby funkcji IntelliSense; -Czas do użycia nieaktualnych wyników (w milisekundach); -Równoległość (wymaga ponownego uruchomienia); -Włącz równoległą kontrolę typu za pomocą plików sygnatury; -Włącz równoległe rozpoznawanie odwołań; -Włącz szybkie znajdowanie odwołań i zmień nazwę (wymagane ponowne uruchomienie); -Wyniki analizy pamięci podręcznej (eksperymentalne) + F# Project and Caching Performance Options; +Enable in-memory cross project references; +Enable_partial_type_checking; +IntelliSense Performance Options; +Enable stale data for IntelliSense features; +Time until stale results are used (in milliseconds); +Parallelization (requires restart); +Enable parallel type checking with signature files; +Enable parallel reference resolution; +Enable fast find references & rename (restart required) 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 f6770d970de..9683ea413cf 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf @@ -175,17 +175,16 @@ Parallelization (requires restart); Enable parallel type checking with signature files; Enable parallel reference resolution; Enable fast find references & rename (restart required) - Projeto em F# e opções de desempenho em cache; -_Habilitar referências de projeto cruzado na memória; -Habilitar verificação parcial de tipo; -Opções de desempenho do IntelliSense; -Habilitar dados obsoletos para os recursos do IntelliSense; -Tempo até que os resultados obsoletos sejam utilizados (em milissegundos); -Paralelização (requer reinicialização); -Habilitar a verificação de tipo paralelo com arquivos de assinatura; -Habilitar a resolução de referência paralela; -Habilitar referências de localização rápida e renomear (reinicialização necessária); -Resultados da análise de cache (experimental) + F# Project and Caching Performance Options; +Enable in-memory cross project references; +Enable_partial_type_checking; +IntelliSense Performance Options; +Enable stale data for IntelliSense features; +Time until stale results are used (in milliseconds); +Parallelization (requires restart); +Enable parallel type checking with signature files; +Enable parallel reference resolution; +Enable fast find references & rename (restart required) diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf index bc8554237a8..3bebb1c9b5d 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf @@ -175,17 +175,16 @@ Parallelization (requires restart); Enable parallel type checking with signature files; Enable parallel reference resolution; Enable fast find references & rename (restart required) - Параметры производительности проекта и кэширования F#; -Включить перекрестные ссылки проектов в памяти; -Enable_partial_type_checking; -Параметры производительности IntelliSense; -Включите устаревшие данные для функций IntelliSense; -Время до использования устаревших результатов (в миллисекундах); -Распараллеливание (требуется перезагрузка); -Включить параллельную проверку типов с файлами сигнатур; -Включить параллельное разрешение ссылок; -Включить быстрый поиск ссылок и переименование (требуется перезагрузка); -Результаты анализа кэша (экспериментальная функция) + F# Project and Caching Performance Options; +Enable in-memory cross project references; +Enable_partial_type_checking; +IntelliSense Performance Options; +Enable stale data for IntelliSense features; +Time until stale results are used (in milliseconds); +Parallelization (requires restart); +Enable parallel type checking with signature files; +Enable parallel reference resolution; +Enable fast find references & rename (restart required) diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf index cf2198ba7d3..eb1b210d3b9 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf @@ -175,17 +175,16 @@ Parallelization (requires restart); Enable parallel type checking with signature files; Enable parallel reference resolution; Enable fast find references & rename (restart required) - F# Proje ve Önbelleğe Alma Performansı Seçenekleri; -Bellek içi çapraz proje başvurularını etkinleştir; -Kısmi_tür_denetlemeyi_etkinleştir; -IntelliSense Performans Seçenekleri; -IntelliSense özellikleri için eski verileri etkinleştir; -Eski sonuçların kullanılması için geçecek süre (milisaniye cinsinden); -Paralelleştirme (yeniden başlatma gerektirir); -İmza dosyalarıyla paralel tür denetlemeyi etkinleştir; -Paralel başvuru çözümlemeyi etkinleştir; -Başvuruları hızlı bulmayı ve yeniden adlandırmayı etkinleştir (yeniden başlatma gerektirir); -Ayrıştırma sonuçlarını önbelleğe al (deneysel) + F# Project and Caching Performance Options; +Enable in-memory cross project references; +Enable_partial_type_checking; +IntelliSense Performance Options; +Enable stale data for IntelliSense features; +Time until stale results are used (in milliseconds); +Parallelization (requires restart); +Enable parallel type checking with signature files; +Enable parallel reference resolution; +Enable fast find references & rename (restart required) 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 16a89acc021..ea215c62094 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf @@ -175,17 +175,16 @@ Parallelization (requires restart); Enable parallel type checking with signature files; Enable parallel reference resolution; Enable fast find references & rename (restart required) - F# 项目和缓存性能选项; -启用内存中跨项目引用; + F# Project and Caching Performance Options; +Enable in-memory cross project references; Enable_partial_type_checking; -IntelliSense 性能选项; -为 IntelliSense 功能启用过时数据; -使用过时结果前等待的时间(以毫秒计); -并行化(需要重启); -使用签名文件启用并行类型检查; -启用并行引用解析; -启用快速查找引用和重命名(需要重新启动); -缓存分析结果(实验性) +IntelliSense Performance Options; +Enable stale data for IntelliSense features; +Time until stale results are used (in milliseconds); +Parallelization (requires restart); +Enable parallel type checking with signature files; +Enable parallel reference resolution; +Enable fast find references & rename (restart required) 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 932d4de3e61..de00bd4aaf3 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf @@ -175,17 +175,16 @@ Parallelization (requires restart); Enable parallel type checking with signature files; Enable parallel reference resolution; Enable fast find references & rename (restart required) - F# 專案與快取效能選項; -允許記憶體內跨專案參考; -啟用部分型別檢查; -IntelliSense 效能選項; -為 IntelliSense 功能啟用過時資料; -使用過時結果前等待的時間 (毫秒); -平行處理 (需要重新啟動); -啟用簽章檔案的平行類型檢查; -啟用平行參考解析; -啟用快速尋找參考和重新命名 (需要重新啟動); -快取剖析結果 (實驗性) + F# Project and Caching Performance Options; +Enable in-memory cross project references; +Enable_partial_type_checking; +IntelliSense Performance Options; +Enable stale data for IntelliSense features; +Time until stale results are used (in milliseconds); +Parallelization (requires restart); +Enable parallel type checking with signature files; +Enable parallel reference resolution; +Enable fast find references & rename (restart required) From 4c6860a2c10259dd462e6a7fc5968fdc2cea5b83 Mon Sep 17 00:00:00 2001 From: dotnet bot Date: Wed, 23 Oct 2024 08:17:45 -0700 Subject: [PATCH 03/49] Localized file check-in by OneLocBuild Task: Build definition ID 499: Build ID 2567162 (#17912) * Localized file check-in by OneLocBuild Task: Build definition ID 499: Build ID 2567162 * Localized file check-in by OneLocBuild Task: Build definition ID 499: Build ID 2567162 --- src/Compiler/xlf/FSComp.txt.cs.xlf | 2 +- src/Compiler/xlf/FSComp.txt.de.xlf | 2 +- src/Compiler/xlf/FSComp.txt.es.xlf | 2 +- src/Compiler/xlf/FSComp.txt.fr.xlf | 2 +- src/Compiler/xlf/FSComp.txt.it.xlf | 2 +- src/Compiler/xlf/FSComp.txt.ja.xlf | 2 +- src/Compiler/xlf/FSComp.txt.ko.xlf | 2 +- src/Compiler/xlf/FSComp.txt.pl.xlf | 2 +- src/Compiler/xlf/FSComp.txt.pt-BR.xlf | 2 +- src/Compiler/xlf/FSComp.txt.ru.xlf | 2 +- src/Compiler/xlf/FSComp.txt.tr.xlf | 2 +- src/Compiler/xlf/FSComp.txt.zh-Hans.xlf | 2 +- src/Compiler/xlf/FSComp.txt.zh-Hant.xlf | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index 4a6bbf58d2f..9b2ffab9f29 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -4534,7 +4534,7 @@ Invalid record, sequence or computation expression. Sequence expressions should be of the form 'seq {{ ... }}' - Neplatný výraz záznamu, pořadí nebo výpočtu. Výrazy pořadí by měly mít notaci seq {{ ... }}. + Neplatný výraz záznamu, pořadí nebo výpočtu. Výrazy pořadí by měly mít notaci seq {{ ... }}. diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index 1546541aee7..5f13e448790 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -4534,7 +4534,7 @@ Invalid record, sequence or computation expression. Sequence expressions should be of the form 'seq {{ ... }}' - Ungültiger Datensatz-, Sequenz- oder Berechnungsausdruck. Sequenzausdrücke müssen das Format "seq {{ ... }}" besitzen. + Ungültiger Datensatz-, Sequenz- oder Berechnungsausdruck. Sequenzausdrücke müssen das Format "seq {{ ... }}" besitzen. diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index db357235565..b0dad7f5a49 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -4534,7 +4534,7 @@ Invalid record, sequence or computation expression. Sequence expressions should be of the form 'seq {{ ... }}' - Expresión de registro, secuencia o cómputo no válida. Las expresiones de secuencia deben tener el formato 'seq {{ ... }}'. + Expresión de registro, secuencia o cómputo no válida. Las expresiones de secuencia deben tener el formato 'seq {{ ... }}'. diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index dca6fe2b78d..27dcef8fed2 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -4534,7 +4534,7 @@ Invalid record, sequence or computation expression. Sequence expressions should be of the form 'seq {{ ... }}' - Expression d'enregistrement, de séquence ou de calcul non valide. Les expressions de séquence doivent avoir le format 'seq {{ ... }}' + Expression d'enregistrement, de séquence ou de calcul non valide. Les expressions de séquence doivent avoir le format 'seq {{ ... }}' diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index 0d2815aa9b2..a33315b7e24 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -4534,7 +4534,7 @@ Invalid record, sequence or computation expression. Sequence expressions should be of the form 'seq {{ ... }}' - Espressione di calcolo, sequenza o record non valida. Il formato delle espressioni sequenza deve essere 'seq {{ ... }}' + Espressione di calcolo, sequenza o record non valida. Il formato delle espressioni sequenza deve essere 'seq {{ ... }}' diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index d660cf6768b..a237ca44974 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -4534,7 +4534,7 @@ Invalid record, sequence or computation expression. Sequence expressions should be of the form 'seq {{ ... }}' - 無効なレコード、シーケンス式、またはコンピュテーション式です。シーケンス式は 'seq {{ ... }}' という形式にしてください。 + 無効なレコード、シーケンス式、またはコンピュテーション式です。シーケンス式は 'seq {{ ... }}' という形式にしてください。 diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index a0f3d1411b4..91cbc9d876d 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -4534,7 +4534,7 @@ Invalid record, sequence or computation expression. Sequence expressions should be of the form 'seq {{ ... }}' - 레코드, 시퀀스 또는 계산 식이 잘못되었습니다. 시퀀스 식의 형식은 'seq {{ ... }}'여야 합니다. + 레코드, 시퀀스 또는 계산 식이 잘못되었습니다. 시퀀스 식의 형식은 'seq {{ ... }}'여야 합니다. diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index fcb2638d5a2..f68b13a24f0 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -4534,7 +4534,7 @@ Invalid record, sequence or computation expression. Sequence expressions should be of the form 'seq {{ ... }}' - Nieprawidłowe wyrażenie rekordu, sekwencji lub obliczenia. Wyrażenia sekwencji powinny mieć postać „seq {{ ... }}” + Nieprawidłowe wyrażenie rekordu, sekwencji lub obliczenia. Wyrażenia sekwencji powinny mieć postać „seq {{ ... }}” diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index a27487e1c20..464bcbdd957 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -4534,7 +4534,7 @@ Invalid record, sequence or computation expression. Sequence expressions should be of the form 'seq {{ ... }}' - Expressão de registro, sequência ou computação inválida. Expressões de sequência devem estar na forma 'seq {{ ... }}' + Expressão de registro, sequência ou computação inválida. Expressões de sequência devem estar na forma 'seq {{ ... }}' diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index 18c6c501759..2879f5abd34 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -4534,7 +4534,7 @@ Invalid record, sequence or computation expression. Sequence expressions should be of the form 'seq {{ ... }}' - Недопустимая запись, выражение последовательности или вычислительное выражение. Выражения последовательностей должны иметь форму "seq {{ ... }}' + Недопустимая запись, выражение последовательности или вычислительное выражение. Выражения последовательностей должны иметь форму "seq {{ ... }}' diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index 94a7a284470..ebf62e5469e 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -4534,7 +4534,7 @@ Invalid record, sequence or computation expression. Sequence expressions should be of the form 'seq {{ ... }}' - Geçersiz kayıt, dizi veya hesaplama ifadesi. Dizi ifadeleri 'seq {{ ... }}' biçiminde olmalıdır + Geçersiz kayıt, dizi veya hesaplama ifadesi. Dizi ifadeleri 'seq {{ ... }}' biçiminde olmalıdır diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index ba5826eb686..397a6066139 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -4534,7 +4534,7 @@ Invalid record, sequence or computation expression. Sequence expressions should be of the form 'seq {{ ... }}' - 记录、序列或计算表达式无效。序列表达式的格式应为“seq {{ ... }}” + 记录、序列或计算表达式无效。序列表达式的格式应为“seq {{ ... }}” diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index b039caf9e93..4fd20e12e57 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -4534,7 +4534,7 @@ Invalid record, sequence or computation expression. Sequence expressions should be of the form 'seq {{ ... }}' - 無效的記錄、循序項或計算運算式。循序項運算式應該是 'seq {{ ... }}' 形式。 + 無效的記錄、循序項或計算運算式。循序項運算式應該是 'seq {{ ... }}' 形式。 From 005de12e29fb6ccf48c57eb5026d629458322d34 Mon Sep 17 00:00:00 2001 From: dotnet bot Date: Fri, 8 Nov 2024 09:39:37 +0100 Subject: [PATCH 04/49] Localized file check-in by OneLocBuild Task: Build definition ID 499: Build ID 2577103 (#17970) --- src/Compiler/xlf/FSStrings.cs.xlf | 2 +- src/Compiler/xlf/FSStrings.de.xlf | 2 +- src/Compiler/xlf/FSStrings.es.xlf | 2 +- src/Compiler/xlf/FSStrings.fr.xlf | 2 +- src/Compiler/xlf/FSStrings.it.xlf | 2 +- src/Compiler/xlf/FSStrings.ja.xlf | 2 +- src/Compiler/xlf/FSStrings.ko.xlf | 2 +- src/Compiler/xlf/FSStrings.pl.xlf | 2 +- src/Compiler/xlf/FSStrings.pt-BR.xlf | 2 +- src/Compiler/xlf/FSStrings.ru.xlf | 2 +- src/Compiler/xlf/FSStrings.tr.xlf | 2 +- src/Compiler/xlf/FSStrings.zh-Hans.xlf | 2 +- src/Compiler/xlf/FSStrings.zh-Hant.xlf | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/Compiler/xlf/FSStrings.cs.xlf b/src/Compiler/xlf/FSStrings.cs.xlf index 20b53f76f45..86a6be9d7e0 100644 --- a/src/Compiler/xlf/FSStrings.cs.xlf +++ b/src/Compiler/xlf/FSStrings.cs.xlf @@ -154,7 +154,7 @@ Uppercase variable identifiers should not generally be used in patterns, and may indicate a missing open declaration or a misspelt pattern name. - Identifikátory proměnných psané velkými písmeny se ve vzorech obecně nedoporučují. Můžou označovat chybějící otevřenou deklaraci nebo špatně napsaný název vzoru. + Identifikátory proměnných psané velkými písmeny se ve vzorech obecně nedoporučují. Můžou označovat chybějící otevřenou deklaraci nebo špatně napsaný název vzoru. diff --git a/src/Compiler/xlf/FSStrings.de.xlf b/src/Compiler/xlf/FSStrings.de.xlf index f58d3a4711d..3b7f46a9769 100644 --- a/src/Compiler/xlf/FSStrings.de.xlf +++ b/src/Compiler/xlf/FSStrings.de.xlf @@ -154,7 +154,7 @@ Uppercase variable identifiers should not generally be used in patterns, and may indicate a missing open declaration or a misspelt pattern name. - Variablenbezeichner in Großbuchstaben sollten im Allgemeinen nicht in Mustern verwendet werden und können ein Hinweis auf eine fehlende open-Deklaration oder einen falsch geschriebenen Musternamen sein. + Variablenbezeichner in Großbuchstaben sollten im Allgemeinen nicht in Mustern verwendet werden und können ein Hinweis auf eine fehlende open-Deklaration oder einen falsch geschriebenen Musternamen sein. diff --git a/src/Compiler/xlf/FSStrings.es.xlf b/src/Compiler/xlf/FSStrings.es.xlf index 88a130d699d..f2b6d8ed1ca 100644 --- a/src/Compiler/xlf/FSStrings.es.xlf +++ b/src/Compiler/xlf/FSStrings.es.xlf @@ -154,7 +154,7 @@ Uppercase variable identifiers should not generally be used in patterns, and may indicate a missing open declaration or a misspelt pattern name. - En general, los identificadores de variables en mayúscula no deben usarse en patrones y pueden indicar una declaración abierta que falta o un nombre de patrón mal escrito. + En general, los identificadores de variables en mayúscula no deben usarse en patrones y pueden indicar una declaración abierta que falta o un nombre de patrón mal escrito. diff --git a/src/Compiler/xlf/FSStrings.fr.xlf b/src/Compiler/xlf/FSStrings.fr.xlf index 7d7badde4ed..f3621e55e63 100644 --- a/src/Compiler/xlf/FSStrings.fr.xlf +++ b/src/Compiler/xlf/FSStrings.fr.xlf @@ -154,7 +154,7 @@ Uppercase variable identifiers should not generally be used in patterns, and may indicate a missing open declaration or a misspelt pattern name. - Les identificateurs de variables en majuscules ne doivent généralement pas être utilisés dans les modèles. Ils peuvent indiquer une absence de déclaration open ou un nom de modèle mal orthographié. + Les identificateurs de variables en majuscules ne doivent généralement pas être utilisés dans les modèles. Ils peuvent indiquer une absence de déclaration open ou un nom de modèle mal orthographié. diff --git a/src/Compiler/xlf/FSStrings.it.xlf b/src/Compiler/xlf/FSStrings.it.xlf index f43c8e77851..d67bbd27dca 100644 --- a/src/Compiler/xlf/FSStrings.it.xlf +++ b/src/Compiler/xlf/FSStrings.it.xlf @@ -154,7 +154,7 @@ Uppercase variable identifiers should not generally be used in patterns, and may indicate a missing open declaration or a misspelt pattern name. - In genere è consigliabile non usare identificatori di variabili scritti in maiuscolo nei criteri perché potrebbero indicare una dichiarazione OPEN mancante o un nome di criterio con ortografia errata. + In genere è consigliabile non usare identificatori di variabili scritti in maiuscolo nei criteri perché potrebbero indicare una dichiarazione OPEN mancante o un nome di criterio con ortografia errata. diff --git a/src/Compiler/xlf/FSStrings.ja.xlf b/src/Compiler/xlf/FSStrings.ja.xlf index 6f0a3a978e9..486c2fac349 100644 --- a/src/Compiler/xlf/FSStrings.ja.xlf +++ b/src/Compiler/xlf/FSStrings.ja.xlf @@ -154,7 +154,7 @@ Uppercase variable identifiers should not generally be used in patterns, and may indicate a missing open declaration or a misspelt pattern name. - 通常、大文字の変数識別子はパターンに使用できません。また、欠落している open 宣言か、つづりが間違っているパターン名を示す可能性があります。 + 通常、大文字の変数識別子はパターンに使用できません。また、欠落している open 宣言か、つづりが間違っているパターン名を示す可能性があります。 diff --git a/src/Compiler/xlf/FSStrings.ko.xlf b/src/Compiler/xlf/FSStrings.ko.xlf index 43e0a0f1739..506b9b9e2de 100644 --- a/src/Compiler/xlf/FSStrings.ko.xlf +++ b/src/Compiler/xlf/FSStrings.ko.xlf @@ -154,7 +154,7 @@ Uppercase variable identifiers should not generally be used in patterns, and may indicate a missing open declaration or a misspelt pattern name. - 일반적으로 대문자 변수 식별자는 패턴에 사용하지 말아야 합니다. 이러한 식별자는 열려 있는 선언이 없거나 철자가 잘못된 패턴 이름을 나타낼 수 있습니다. + 일반적으로 대문자 변수 식별자는 패턴에 사용하지 말아야 합니다. 이러한 식별자는 열려 있는 선언이 없거나 철자가 잘못된 패턴 이름을 나타낼 수 있습니다. diff --git a/src/Compiler/xlf/FSStrings.pl.xlf b/src/Compiler/xlf/FSStrings.pl.xlf index 3096fca8dbf..30f8155bfc8 100644 --- a/src/Compiler/xlf/FSStrings.pl.xlf +++ b/src/Compiler/xlf/FSStrings.pl.xlf @@ -154,7 +154,7 @@ Uppercase variable identifiers should not generally be used in patterns, and may indicate a missing open declaration or a misspelt pattern name. - Identyfikatory zmiennych pisane wielkimi literami nie powinny być na ogół używane we wzorcach i mogą oznaczać brak deklaracji otwierającej lub błąd pisowni w nazwie wzorca. + Identyfikatory zmiennych pisane wielkimi literami nie powinny być na ogół używane we wzorcach i mogą oznaczać brak deklaracji otwierającej lub błąd pisowni w nazwie wzorca. diff --git a/src/Compiler/xlf/FSStrings.pt-BR.xlf b/src/Compiler/xlf/FSStrings.pt-BR.xlf index ea48f4c3545..cf7e3a94822 100644 --- a/src/Compiler/xlf/FSStrings.pt-BR.xlf +++ b/src/Compiler/xlf/FSStrings.pt-BR.xlf @@ -154,7 +154,7 @@ Uppercase variable identifiers should not generally be used in patterns, and may indicate a missing open declaration or a misspelt pattern name. - Identificadores de variáveis em maiúsculas geralmente não devem ser usados em padrões, podendo indicar uma declaração aberta ausente ou um nome de padrão escrito incorretamente. + Identificadores de variáveis em maiúsculas geralmente não devem ser usados em padrões, podendo indicar uma declaração aberta ausente ou um nome de padrão escrito incorretamente. diff --git a/src/Compiler/xlf/FSStrings.ru.xlf b/src/Compiler/xlf/FSStrings.ru.xlf index 7cb20b5e8de..34278a4b234 100644 --- a/src/Compiler/xlf/FSStrings.ru.xlf +++ b/src/Compiler/xlf/FSStrings.ru.xlf @@ -154,7 +154,7 @@ Uppercase variable identifiers should not generally be used in patterns, and may indicate a missing open declaration or a misspelt pattern name. - Идентификаторы переменных в верхнем регистре обычно не должны использоваться в шаблонах, и могут указывать на отсутствующую открытую декларацию или неправильно написанное имя шаблона. + Идентификаторы переменных в верхнем регистре обычно не должны использоваться в шаблонах, и могут указывать на отсутствующую открытую декларацию или неправильно написанное имя шаблона. diff --git a/src/Compiler/xlf/FSStrings.tr.xlf b/src/Compiler/xlf/FSStrings.tr.xlf index 9c65fabe248..a2601885c52 100644 --- a/src/Compiler/xlf/FSStrings.tr.xlf +++ b/src/Compiler/xlf/FSStrings.tr.xlf @@ -154,7 +154,7 @@ Uppercase variable identifiers should not generally be used in patterns, and may indicate a missing open declaration or a misspelt pattern name. - Büyük harfli değişken tanımlayıcıları desenlerde genel olarak kullanılmamalıdır. Bunlar, eksik bir açık bildirimin veya yanlış yazılmış bir desen adının göstergesi olabilirler. + Büyük harfli değişken tanımlayıcıları desenlerde genel olarak kullanılmamalıdır. Bunlar, eksik bir açık bildirimin veya yanlış yazılmış bir desen adının göstergesi olabilirler. diff --git a/src/Compiler/xlf/FSStrings.zh-Hans.xlf b/src/Compiler/xlf/FSStrings.zh-Hans.xlf index c895f08ec60..66a54f3d2bb 100644 --- a/src/Compiler/xlf/FSStrings.zh-Hans.xlf +++ b/src/Compiler/xlf/FSStrings.zh-Hans.xlf @@ -154,7 +154,7 @@ Uppercase variable identifiers should not generally be used in patterns, and may indicate a missing open declaration or a misspelt pattern name. - 通常不得在模式中使用大写的变量标识符,存在它们可能表示缺少某个开放声明或某个模式名称拼写错误。 + 通常不得在模式中使用大写的变量标识符,存在它们可能表示缺少某个开放声明或某个模式名称拼写错误。 diff --git a/src/Compiler/xlf/FSStrings.zh-Hant.xlf b/src/Compiler/xlf/FSStrings.zh-Hant.xlf index d81a539866e..35280cee60f 100644 --- a/src/Compiler/xlf/FSStrings.zh-Hant.xlf +++ b/src/Compiler/xlf/FSStrings.zh-Hant.xlf @@ -154,7 +154,7 @@ Uppercase variable identifiers should not generally be used in patterns, and may indicate a missing open declaration or a misspelt pattern name. - 通常不應在樣式中使用大寫的變數識別碼。這可能表示缺少公開宣告或樣式名稱拼字錯誤。 + 通常不應在樣式中使用大寫的變數識別碼。這可能表示缺少公開宣告或樣式名稱拼字錯誤。 From 3dc980eeb06dd912f1e6fe5d06a23a67a4b659e7 Mon Sep 17 00:00:00 2001 From: dotnet bot Date: Thu, 28 Nov 2024 03:20:05 -0800 Subject: [PATCH 05/49] Merge main to release/dev17.13 (#18080) * Add -sign to build.sh (#18024) * Fix singing problems (#18040) * Skip flaky test (#18051) * Remove support for `System.AggressiveAttributeTrimming` feature switch. (#18039) Co-authored-by: Kevin Ransom (msft) Co-authored-by: Petr * Update some internal guidelines (#18052) * simplify temp dirs in service (#18046) Co-authored-by: Kevin Ransom (msft) * Add Contributing.md (#18043) * contributing * Update CONTRIBUTING.md * Update CONTRIBUTING.md Co-authored-by: Tomas Grosup * Update CONTRIBUTING.md Co-authored-by: Vlad Zarytovskii * Update CONTRIBUTING.md Co-authored-by: Petr * Update CONTRIBUTING.md --------- Co-authored-by: Tomas Grosup Co-authored-by: Vlad Zarytovskii Co-authored-by: Petr * [main] Update dependencies from dotnet/arcade (#17729) * Update dependencies from https://github.com/dotnet/arcade build 20240913.2 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.24462.3 -> To Version 9.0.0-beta.24463.2 * Update dependencies from https://github.com/dotnet/arcade build 20240916.2 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.24463.2 -> To Version 9.0.0-beta.24466.2 * Update dependencies from https://github.com/dotnet/arcade build 20240923.1 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.24466.2 -> To Version 9.0.0-beta.24473.1 * Update dependencies from https://github.com/dotnet/arcade build 20241001.3 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.24473.1 -> To Version 9.0.0-beta.24501.3 * Update dependencies from https://github.com/dotnet/arcade build 20241003.2 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.24501.3 -> To Version 9.0.0-beta.24503.2 * Update dependencies from https://github.com/dotnet/arcade build 20241008.3 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.24503.2 -> To Version 9.0.0-beta.24508.3 * Update dependencies from https://github.com/dotnet/arcade build 20241009.3 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.24508.3 -> To Version 9.0.0-beta.24509.3 * Update dependencies from https://github.com/dotnet/arcade build 20241016.2 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.24509.3 -> To Version 9.0.0-beta.24516.2 * Update dependencies from https://github.com/dotnet/arcade build 20241112.13 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.24462.3 -> To Version 9.0.0-beta.24562.13 * Update dependencies from https://github.com/dotnet/arcade build 20241122.2 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.24462.3 -> To Version 9.0.0-beta.24572.2 --------- Co-authored-by: dotnet-maestro[bot] Co-authored-by: Vlad Zarytovskii * Refactor AsyncMemoize, introduce AsyncLazy (#18002) * refactor AsyncMemoize, introduce AsyncLazy * use lock free mb in tests * remove unnecessary prop * update il baselines * rename * add requestCount name Co-authored-by: Petr Pokorny * improve as reviewed * lock for TryGet * more locks * ilverify * deallocate computation when completed * ilverify * style * typo --------- Co-authored-by: Petr Pokorny * Fix crashdump paths in CI (#18065) * Various updates to ILVerify (#18060) * Update azure-pipelines-PR.yml * Add null annotation to Async.SwitchToContext (#18059) --------- Co-authored-by: Ella Hathaway <67609881+ellahathaway@users.noreply.github.com> Co-authored-by: Petr Co-authored-by: Petr Pokorny Co-authored-by: Theodore Tsirpanis Co-authored-by: Kevin Ransom (msft) Co-authored-by: Jakub Majocha <1760221+majocha@users.noreply.github.com> Co-authored-by: Tomas Grosup Co-authored-by: Vlad Zarytovskii Co-authored-by: dotnet-maestro[bot] <42748379+dotnet-maestro[bot]@users.noreply.github.com> Co-authored-by: dotnet-maestro[bot] Co-authored-by: Petr Pokorny Co-authored-by: Ch13 --- CONTRIBUTING.md | 106 +++ DEVGUIDE.md | 8 +- INTERNAL.md | 24 +- azure-pipelines-PR.yml | 32 +- docs/release-notes/.FSharp.Core/9.0.200.md | 1 + eng/Version.Details.xml | 8 +- eng/build.sh | 6 + .../steps/get-delegation-sas.yml | 11 +- eng/common/internal/Tools.csproj | 25 - eng/common/sdk-task.ps1 | 2 +- eng/common/templates-official/job/job.yml | 1 + eng/common/templates/job/job.yml | 1 + eng/common/tools.ps1 | 6 +- global.json | 4 +- src/Compiler/Facilities/AsyncMemoize.fs | 686 +++++------------- src/Compiler/Facilities/AsyncMemoize.fsi | 17 +- src/Compiler/Service/TransparentCompiler.fs | 4 +- src/FSharp.Core/FSharp.Core.fsproj | 1 - src/FSharp.Core/ILLink.LinkAttributes.xml | 179 ----- src/FSharp.Core/async.fs | 4 - src/FSharp.Core/async.fsi | 2 +- .../CompilerService/AsyncLock.fs | 26 - .../CompilerService/AsyncMemoize.fs | 340 +++++---- .../FSharp.Compiler.ComponentTests.fsproj | 1 - .../FSharpChecker/TransparentCompiler.fs | 60 +- tests/FSharp.Compiler.Service.Tests/Common.fs | 73 +- .../ExprTests.fs | 59 +- .../GeneratedCodeSymbolsTests.fs | 12 +- .../ScriptOptionsTests.fs | 6 +- tests/FSharp.Test.Utilities/CompilerAssert.fs | 17 +- tests/FSharp.Test.Utilities/TestFramework.fs | 6 +- {eng => tests/ILVerify}/ilverify.ps1 | 40 +- ...y_FSharp.Compiler.Service_Debug_net9.0.bsl | 12 +- ....Compiler.Service_Debug_netstandard2.0.bsl | 12 +- ...FSharp.Compiler.Service_Release_net9.0.bsl | 12 +- ...ompiler.Service_Release_netstandard2.0.bsl | 12 +- ...erify_FSharp.Core_Debug_netstandard2.0.bsl | 0 ...erify_FSharp.Core_Debug_netstandard2.1.bsl | 0 ...ify_FSharp.Core_Release_netstandard2.0.bsl | 0 ...ify_FSharp.Core_Release_netstandard2.1.bsl | 0 40 files changed, 684 insertions(+), 1132 deletions(-) create mode 100644 CONTRIBUTING.md delete mode 100644 src/FSharp.Core/ILLink.LinkAttributes.xml delete mode 100644 tests/FSharp.Compiler.ComponentTests/CompilerService/AsyncLock.fs rename {eng => tests/ILVerify}/ilverify.ps1 (80%) rename {eng => tests/ILVerify}/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl (98%) rename {eng => tests/ILVerify}/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl (98%) rename {eng => tests/ILVerify}/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl (98%) rename {eng => tests/ILVerify}/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl (98%) rename {eng => tests/ILVerify}/ilverify_FSharp.Core_Debug_netstandard2.0.bsl (100%) rename {eng => tests/ILVerify}/ilverify_FSharp.Core_Debug_netstandard2.1.bsl (100%) rename {eng => tests/ILVerify}/ilverify_FSharp.Core_Release_netstandard2.0.bsl (100%) rename {eng => tests/ILVerify}/ilverify_FSharp.Core_Release_netstandard2.1.bsl (100%) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000000..b8c7c63108a --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,106 @@ +# Contributing to F# + +One of the easiest ways to contribute is to participate in discussions on GitHub issues. You can also contribute by submitting pull requests with code changes. + +## General feedback and discussions? + +Start a [discussion](https://github.com/dotnet/fsharp/discussions) on the [repository issue tracker](https://github.com/dotnet/fsharp/issues). + +## Bugs and feature requests? + +❗ **IMPORTANT: If you want to report a security-related issue, please see the `Reporting security issues and bugs` section below.** + +Before reporting a new issue, try to find an existing issue if one already exists. If it already exists, upvote (👍) it. Also, consider adding a comment with your unique scenarios and requirements related to that issue. Upvotes and clear details on the issue's impact help us prioritize the most important issues to be worked on sooner rather than later. If you can't find one, that's okay, we'd rather get a duplicate report than none. + +If you can't find an existing issue, log a new issue in this GitHub repository. + +## Creating Issues + +- **DO** use a descriptive title that identifies the issue to be addressed or the requested feature. For example, when describing an issue where the compiler is not behaving as expected, write your bug title in terms of what the compiler should do rather than what it is doing – “F# compiler should report FS1234 when Xyz is used in Abcd.” +- **DO** specify a detailed description of the issue or requested feature. +- **DO** provide the following for bug reports + - Describe the expected behavior and the actual behavior. If it is not self-evident such as in the case of a crash, provide an explanation for why the expected behavior is expected. + - Provide an example with source code / projects that reproduce the issue. + - Specify any relevant exception messages and stack traces. +- **DO** subscribe to notifications for the created issue in case there are any follow up questions. + +## Reporting security issues and bugs + +Security issues and bugs should be reported privately, via email, to the Microsoft Security Response Center (MSRC) secure@microsoft.com. You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Further information, including the MSRC PGP key, can be found in the [Security TechCenter](https://technet.microsoft.com/security/ff852094.aspx). + +## Writing Code + +### Finding an issue to work on + + Over the years we've seen many PRs targeting areas, which we didn't plan to expand further at the time. In many of these these cases we had to say `no` to those PRs and close them. That, obviously, is not a great outcome for us. And it's especially bad for the contributor, as they've spent a lot of effort preparing the change. + To resolve this problem, we've decided to separate a bucket of issues, which would be great candidates for community members to contribute to. We mark these issues with the `help wanted` label. [help wanted](https://github.com/dotnet/fsharp/labels/help%20wanted) + + Within that set, we have additionally marked issues that are good candidates for first-time contributors. Here: [Good first issue](https://github.com/dotnet/fsharp/labels/good%20first%20issue) + + If you would like to make a contribution to an area not documented here, first open an issue with a description of the change you would like to make and the problem it solves so it can be discussed before a pull request is submitted. + +### The primary customers of the F# repository are users of the dotnet SDK, Visual Studio, Rider and Ionide. At all times their experience is paramount in our mind. + + We are very accepting of community pull requests, there are however, a set of firm considerations that we hold to when reviewing PRs and determining what to merge. These have been developed over the years to maintain the quality of the product and the experience that F# developers have when installing and upgrading the dotnet SDK and Visual Studio. + +- Does the change fix something that needs fixing, is there an issue, does the issue indicate a real problem? +- Does the change improve the readability of something that needs improvement? +- Does the change add a feature that is approved for adding? +- Does the code match or improve of the existing codebase? +- Is the performance improvement measured and can regressions be identified? +- Will our existing customers be able to without effort upgrading the **Major** release of an SDK or VS? +- Will our existing customers be able to without effort upgrading the **Minor** release of an SDK or VS? +- This change is not binary breaking (i.e. does not break VS, Rider or Ionide)? +- Does it have adequate testing? +- Do all existing tests run unmodified? + +In general answers to the above should be **Yes**. A **No** to any of them is not disqualifying of the PR, however a no answer will need an explanation and a discussion. + +There are additional considerations +- Is the risk of accepting this change High or even Medium, these really refer to how much of the existing user or codebase is impacted. How likely do we feel we are to revert the changes later. + For an acceptable PR with a high risk, we will definitely need to discuss mitigations for the risk. A decision to upgrade the SDK or VS needs to be always low risk for our customers, they have businesses to run, they don't want to have to deal with our - risky behavior. We may defer or delay risky PRs into a later release or abandon it. +- Is the change as small as possible +- Should it be chopped up into smaller, yet independently valuable and releasable to production, chunks +- Is the cost of reviewing the change worth the improvement made by the change +Again, some PR’s are too big or provide too little value to merge. + + +### Resources to help you get started + +Here are some resources to help you get started on how to contribute code or new content. + +- [Developers Guide](https://github.com/dotnet/fsharp/blob/main/DEVGUIDE.md) to get started on building the source code on your own. +- [Test Guide](https://github.com/dotnet/fsharp/blob/main/TESTGUIDE.md) how to build run and work with test cases. +- [F# compiler guide](https://github.com/dotnet/fsharp/blob/main/docs/index.md) +- [F# language specification](https://fsharp.org/specs/language-spec/) +- [F# language design](https://github.com/fsharp/fslang-design/) +- [F# language suggestions](https://github.com/fsharp/fslang-suggestions/) +- [help wanted](https://github.com/dotnet/fsharp/labels/help%20wanted) where to start + +### Submitting a pull request + +You will need to sign a [Contributor License Agreement](https://cla.dotnetfoundation.org/) when submitting your pull request. To complete the Contributor License Agreement (CLA), you will need to follow the instructions provided by the CLA bot when you send the pull request. This needs to only be done once for any .NET Foundation OSS project. + +If you don't know what a pull request is read this article: . Make sure the repository can build and all tests pass. Familiarize yourself with the project workflow and our coding conventions. + +- **DO** ensure submissions pass all Azure DevOps legs and are merge conflict free. +- **DO** submit language feature requests as issues in the [F# language](https://github.com/fsharp/fslang-suggestions) repos. Please note: approved in principle does not guarantee acceptance. +- **DO NOT** submit language features as PRs to this repo first, or they will likely be declined. +- **DO** submit issues for other features. This facilitates discussion of a feature separately from its implementation, and increases the acceptance rates for pull requests. +- **DO NOT** submit large code formatting changes without discussing with the team first. + +### Reviewing pull requests + +Our repository gets a high volume of pull requests and reviewing each of them is a significant time commitment. Our team priorities often force us to focus on reviewing a subset of the active pull requests at a given time. + +### Feedback + +Contributors will review your pull request and provide feedback. + +## Merging pull requests + +When your pull request has had the feedback addressed, and it has been signed off by two or more core team reviewers with commit access, and all checks are green, we will commit it. + +## Code of conduct + +See [CODE-OF-CONDUCT.md](./CODE-OF-CONDUCT.md) diff --git a/DEVGUIDE.md b/DEVGUIDE.md index b3ed65611c4..cf3a9419481 100644 --- a/DEVGUIDE.md +++ b/DEVGUIDE.md @@ -228,7 +228,8 @@ dotnet test tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fs ### Updating ILVerify baselines -These control IL for the core modules of the compiler. The baselines are located in the `eng` folder and look like: +These are IL baseline tests for the core assemblies of the compiler (FSharp.Core and FSharp.Compiler.Service). The baselines are located in the `tests/ILVerify` folder and look like: + ``` ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl @@ -240,7 +241,10 @@ ilverify_FSharp.Core_Release_netstandard2.0.bsl ilverify_FSharp.Core_Release_netstandard2.1.bsl ``` -If you want to update them, run the [ilverify.ps1]([url](https://github.com/dotnet/fsharp/blob/main/eng/ilverify.ps1)) script in PowerShell. The script will create `.actual` files. If the differences make sense, replace the original baselines with the actual files. +If you want to update them, either + +1. Run the [ilverify.ps1]([url](https://github.com/dotnet/fsharp/blob/main/tests/ILVerify/ilverify.ps1)) script in PowerShell. The script will create `.actual` files. If the differences make sense, replace the original baselines with the actual files. +2. Set the `TEST_UPDATE_BSL` to `1` (please refer to "Updating baselines in tests" section in this file) **and** run `ilverify.ps1` - this will automatically replace baselines. After that, please carefully review the change and push it to your branch if it makes sense. ## Automated Source Code Formatting diff --git a/INTERNAL.md b/INTERNAL.md index 6207180fd31..51cb12efd57 100644 --- a/INTERNAL.md +++ b/INTERNAL.md @@ -38,7 +38,7 @@ their respective branches. [VS 16.1](https://dev.azure.com/devdiv/DevDiv/_release?definitionId=1669&_a=releases) -VS 16.0 and prior were done manually +VS 16.0 and prior were done manually. ## VS Insertions as part of the build definition @@ -64,6 +64,7 @@ it's a good idea to check the previous link for any old or stalled insertions in Update the `insertTargetBranch` value at the bottom of `azure-pipelines.yml` in the appropriate release branch. E.g., when VS 17.3 snapped and switched to ask mode, [this PR](https://github.com/dotnet/fsharp/pull/13456/files) correctly updates the insertion target so that future builds from that F# branch will get auto-inserted to VS. ### When VS `main` is open for insertions for preview releases of VS: + 0. Disable auto-merges from `main` to **current** release branch, please make a change for the following file and create a pull request: https://github.com/dotnet/roslyn-tools/blob/6d7c182c46f8319d7922561e2c1586c7aadce19e/src/GitHubCreateMergePRs/config.xml#L52-L74 > You should comment out the `main -> release/devXX.X` flow until step #4 is completed (``) @@ -131,6 +132,23 @@ Since github issue filtering is currently not flexible enough, that query was ge Invoke-WebRequest -Uri "https://api.github.com/repos/dotnet/fsharp/labels?per_page=100" | ConvertFrom-Json | % { $_.name } | ? { $_.StartsWith("Area-") } | % { Write-Host -NoNewLine ('-label:"' + $_ + '" ') } ``` -## Other links +## Fix problems with the internal source mirror + +The repo is [here](https://dev.azure.com/dnceng/internal/_git/dotnet-fsharp), the CI is [here](https://dnceng.visualstudio.com/internal/_build?definitionId=499). + +If something breaks in the CI there and you want to experiment, the general workflow is the following: +1. Make a branch +2. Make a change +3. Run the build from your branch. If needed, set the "skipTests" variable to "true" - can save time at this stage. +4. Once the problem and the fix is identified, make a PR to THIS (dotnet/fsharp) repo - it will propagate to the internal mirror just afterwards. +5. Delete all your work in the internal repo. + +**DO NOT** try to push to the internal repo - this will mess up the flows. **DO NOT** create PRs to not confuse anyone. + +You need the following permissions to do the above investigations: +- "Generic contribute" +- "Create branch" +- "Queue builds" +- "Edit queue build configuration" -[Internal source mirror](https://dev.azure.com/dnceng/internal/_git/dotnet-fsharp). +If anything, reach out to the "First Responders" team. \ No newline at end of file diff --git a/azure-pipelines-PR.yml b/azure-pipelines-PR.yml index 7d11a931c24..75d0484cac9 100644 --- a/azure-pipelines-PR.yml +++ b/azure-pipelines-PR.yml @@ -229,7 +229,7 @@ stages: env: DOTNET_DbgEnableMiniDump: 1 DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing. - DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\$(_configuration)\$(Build.BuildId)-%e-%p-%t.dmp + DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\Release\$(Build.BuildId)-%e-%p-%t.dmp NativeToolsOnMachine: true displayName: Build @@ -247,8 +247,8 @@ stages: condition: failed() continueOnError: true inputs: - PathToPublish: '$(Build.SourcesDirectory)\artifacts\log\$(_configuration)' - ArtifactName: 'Windows $(_configuration) $(_testKind) process dumps' + PathToPublish: '$(Build.SourcesDirectory)\artifacts\log\Release' + ArtifactName: 'Windows Release WindowsLangVersionPreview process dumps' ArtifactType: Container parallel: true @@ -269,7 +269,7 @@ stages: env: DOTNET_DbgEnableMiniDump: 1 DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing. - DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\$(_configuration)\$(Build.BuildId)-%e-%p-%t.dmp + DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\Release\$(Build.BuildId)-%e-%p-%t.dmp NativeToolsOnMachine: true displayName: Build @@ -287,8 +287,8 @@ stages: condition: failed() continueOnError: true inputs: - PathToPublish: '$(Build.SourcesDirectory)\artifacts\log\$(_configuration)' - ArtifactName: 'Windows $(_configuration) $(_testKind) process dumps' + PathToPublish: '$(Build.SourcesDirectory)\artifacts\log\Release' + ArtifactName: 'Windows Release WindowsNoRealsig_testCoreclr process dumps' ArtifactType: Container parallel: true @@ -309,7 +309,7 @@ stages: env: DOTNET_DbgEnableMiniDump: 1 DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing. - DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\$(_configuration)\$(Build.BuildId)-%e-%p-%t.dmp + DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\Release\$(Build.BuildId)-%e-%p-%t.dmp NativeToolsOnMachine: true displayName: Build @@ -327,8 +327,8 @@ stages: condition: failed() continueOnError: true inputs: - PathToPublish: '$(Build.SourcesDirectory)\artifacts\log\$(_configuration)' - ArtifactName: 'Windows $(_configuration) $(_testKind) process dumps' + PathToPublish: '$(Build.SourcesDirectory)\artifacts\log\Release' + ArtifactName: 'Windows Release WindowsNoRealsig_testDesktop process dumps' ArtifactType: Container parallel: true @@ -349,7 +349,7 @@ stages: env: DOTNET_DbgEnableMiniDump: 1 DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing. - DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\$(_configuration)\$(Build.BuildId)-%e-%p-%t.dmp + DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\Release\$(Build.BuildId)-%e-%p-%t.dmp NativeToolsOnMachine: true displayName: Build @@ -367,8 +367,8 @@ stages: condition: failed() continueOnError: true inputs: - PathToPublish: '$(Build.SourcesDirectory)\artifacts\log\$(_configuration)' - ArtifactName: 'Windows $(_configuration) $(_testKind) process dumps' + PathToPublish: '$(Build.SourcesDirectory)\artifacts\log\Release' + ArtifactName: 'Windows Release WindowsStrictIndentation process dumps' ArtifactType: Container parallel: true @@ -385,7 +385,7 @@ stages: env: DOTNET_DbgEnableMiniDump: 1 DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing. - DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\$(_configuration)\$(Build.BuildId)-%e-%p-%t.dmp + DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\Release\$(Build.BuildId)-%e-%p-%t.dmp NativeToolsOnMachine: true displayName: Build @@ -403,8 +403,8 @@ stages: condition: failed() continueOnError: true inputs: - PathToPublish: '$(Build.SourcesDirectory)\artifacts\log\$(_configuration)' - ArtifactName: 'Windows $(_configuration) $(_testKind) process dumps' + PathToPublish: '$(Build.SourcesDirectory)\artifacts\log\Release' + ArtifactName: 'Windows Release WindowsNoStrictIndentation process dumps' ArtifactType: Container parallel: true @@ -825,6 +825,6 @@ stages: installationPath: $(Agent.ToolsDirectory)/dotnet - script: dotnet tool restore displayName: Restore dotnet tools - - pwsh: .\eng\ilverify.ps1 + - pwsh: .\tests\ILVerify\ilverify.ps1 displayName: Run ILVerify workingDirectory: $(Build.SourcesDirectory) diff --git a/docs/release-notes/.FSharp.Core/9.0.200.md b/docs/release-notes/.FSharp.Core/9.0.200.md index 2ea077abe4b..fdcc65f5537 100644 --- a/docs/release-notes/.FSharp.Core/9.0.200.md +++ b/docs/release-notes/.FSharp.Core/9.0.200.md @@ -1,6 +1,7 @@ ### Fixed * Fix exception on Post after MailboxProcessor was disposed ([Issue #17849](https://github.com/dotnet/fsharp/issues/17849), [PR #17922](https://github.com/dotnet/fsharp/pull/17922)) +* Fix missing null annotation in Async.SwitchToContext ([Issue #18055](https://github.com/dotnet/fsharp/issues/18055), [PR #18059](https://github.com/dotnet/fsharp/pull/18059)) ### Added diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index dc43fb9cd4e..888e3f23f89 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -42,14 +42,14 @@ - + https://github.com/dotnet/arcade - 91b9734abbad751d575c002b30778c88d978993c + b41381d5cd633471265e9cd72e933a7048e03062 - + https://github.com/dotnet/arcade - 91b9734abbad751d575c002b30778c88d978993c + b41381d5cd633471265e9cd72e933a7048e03062 diff --git a/eng/build.sh b/eng/build.sh index c4abb23f6f1..e6e27732c8f 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -20,6 +20,7 @@ usage() echo " --rebuild Rebuild all projects" echo " --pack Build nuget packages" echo " --publish Publish build artifacts" + echo " --sign Sign build artifacts" echo " --help Print help and exit" echo "" echo "Test actions:" @@ -58,6 +59,7 @@ build=false rebuild=false pack=false publish=false +sign=false test_core_clr=false test_compilercomponent_tests=false test_benchmarks=false @@ -129,6 +131,9 @@ while [[ $# > 0 ]]; do --publish) publish=true ;; + --sign) + sign=true + ;; --testcoreclr|--test|-t) test_core_clr=true ;; @@ -297,6 +302,7 @@ function BuildSolution { /p:Rebuild=$rebuild \ /p:Pack=$pack \ /p:Publish=$publish \ + /p:Sign=$sign \ /p:UseRoslynAnalyzers=$enable_analyzers \ /p:ContinuousIntegrationBuild=$ci \ /p:QuietRestore=$quiet_restore \ diff --git a/eng/common/core-templates/steps/get-delegation-sas.yml b/eng/common/core-templates/steps/get-delegation-sas.yml index d2901470a7f..9db5617ea7d 100644 --- a/eng/common/core-templates/steps/get-delegation-sas.yml +++ b/eng/common/core-templates/steps/get-delegation-sas.yml @@ -31,7 +31,16 @@ steps: # Calculate the expiration of the SAS token and convert to UTC $expiry = (Get-Date).AddHours(${{ parameters.expiryInHours }}).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ") - $sas = az storage container generate-sas --account-name ${{ parameters.storageAccount }} --name ${{ parameters.container }} --permissions ${{ parameters.permissions }} --expiry $expiry --auth-mode login --as-user -o tsv + # Temporarily work around a helix issue where SAS tokens with / in them will cause incorrect downloads + # of correlation payloads. https://github.com/dotnet/dnceng/issues/3484 + $sas = "" + do { + $sas = az storage container generate-sas --account-name ${{ parameters.storageAccount }} --name ${{ parameters.container }} --permissions ${{ parameters.permissions }} --expiry $expiry --auth-mode login --as-user -o tsv + if ($LASTEXITCODE -ne 0) { + Write-Error "Failed to generate SAS token." + exit 1 + } + } while($sas.IndexOf('/') -ne -1) if ($LASTEXITCODE -ne 0) { Write-Error "Failed to generate SAS token." diff --git a/eng/common/internal/Tools.csproj b/eng/common/internal/Tools.csproj index db46d5582eb..32f79dfb340 100644 --- a/eng/common/internal/Tools.csproj +++ b/eng/common/internal/Tools.csproj @@ -6,31 +6,6 @@ false false - - - - - - - - - - - - - diff --git a/eng/common/sdk-task.ps1 b/eng/common/sdk-task.ps1 index aab40de3fd9..4f0546dce12 100644 --- a/eng/common/sdk-task.ps1 +++ b/eng/common/sdk-task.ps1 @@ -64,7 +64,7 @@ try { $GlobalJson.tools | Add-Member -Name "vs" -Value (ConvertFrom-Json "{ `"version`": `"16.5`" }") -MemberType NoteProperty } if( -not ($GlobalJson.tools.PSObject.Properties.Name -match "xcopy-msbuild" )) { - $GlobalJson.tools | Add-Member -Name "xcopy-msbuild" -Value "17.10.0-pre.4.0" -MemberType NoteProperty + $GlobalJson.tools | Add-Member -Name "xcopy-msbuild" -Value "17.12.0" -MemberType NoteProperty } if ($GlobalJson.tools."xcopy-msbuild".Trim() -ine "none") { $xcopyMSBuildToolsFolder = InitializeXCopyMSBuild $GlobalJson.tools."xcopy-msbuild" -install $true diff --git a/eng/common/templates-official/job/job.yml b/eng/common/templates-official/job/job.yml index 3d16b41c78c..605692d2fb7 100644 --- a/eng/common/templates-official/job/job.yml +++ b/eng/common/templates-official/job/job.yml @@ -1,6 +1,7 @@ parameters: # Sbom related params enableSbom: true + runAsPublic: false PackageVersion: 9.0.0 BuildDropPath: '$(Build.SourcesDirectory)/artifacts' diff --git a/eng/common/templates/job/job.yml b/eng/common/templates/job/job.yml index 07d317bf8f9..d1aeb92fcea 100644 --- a/eng/common/templates/job/job.yml +++ b/eng/common/templates/job/job.yml @@ -4,6 +4,7 @@ parameters: componentGovernanceIgnoreDirectories: '' # Sbom related params enableSbom: true + runAsPublic: false PackageVersion: 9.0.0 BuildDropPath: '$(Build.SourcesDirectory)/artifacts' diff --git a/eng/common/tools.ps1 b/eng/common/tools.ps1 index 9574f4eb9df..aa94fb17459 100644 --- a/eng/common/tools.ps1 +++ b/eng/common/tools.ps1 @@ -383,8 +383,8 @@ function InitializeVisualStudioMSBuild([bool]$install, [object]$vsRequirements = # If the version of msbuild is going to be xcopied, # use this version. Version matches a package here: - # https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet-eng/NuGet/Microsoft.DotNet.Arcade.MSBuild.Xcopy/versions/17.10.0-pre.4.0 - $defaultXCopyMSBuildVersion = '17.10.0-pre.4.0' + # https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet-eng/NuGet/Microsoft.DotNet.Arcade.MSBuild.Xcopy/versions/17.12.0 + $defaultXCopyMSBuildVersion = '17.12.0' if (!$vsRequirements) { if (Get-Member -InputObject $GlobalJson.tools -Name 'vs') { @@ -900,7 +900,7 @@ function IsWindowsPlatform() { } function Get-Darc($version) { - $darcPath = "$TempDir\darc\$(New-Guid)" + $darcPath = "$TempDir\darc\$([guid]::NewGuid())" if ($version -ne $null) { & $PSScriptRoot\darc-init.ps1 -toolpath $darcPath -darcVersion $version | Out-Host } else { diff --git a/global.json b/global.json index 6d23934c7ed..9a3de25e397 100644 --- a/global.json +++ b/global.json @@ -11,13 +11,13 @@ "Microsoft.VisualStudio.Component.FSharp" ] }, - "xcopy-msbuild": "17.8.5" + "xcopy-msbuild": "17.12.0" }, "native-tools": { "perl": "5.38.2.2" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24462.3", + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24572.2", "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.23255.2" } } diff --git a/src/Compiler/Facilities/AsyncMemoize.fs b/src/Compiler/Facilities/AsyncMemoize.fs index af1a52e5e5d..88b0b84bb8c 100644 --- a/src/Compiler/Facilities/AsyncMemoize.fs +++ b/src/Compiler/Facilities/AsyncMemoize.fs @@ -1,18 +1,101 @@ namespace Internal.Utilities.Collections open System -open System.Collections.Generic open System.Diagnostics open System.IO open System.Threading open System.Threading.Tasks +open System.Runtime.CompilerServices +open System.Runtime.ExceptionServices -open FSharp.Compiler -open FSharp.Compiler.BuildGraph -open FSharp.Compiler.Diagnostics open FSharp.Compiler.DiagnosticsLogger open Internal.Utilities.Library -open System.Runtime.CompilerServices + +type AsyncLazyState<'t> = + | Initial of computation: Async<'t> + | Running of initialComputation: Async<'t> * work: Task<'t> * CancellationTokenSource * requestCount: int + | Completed of result: 't + | Faulted of exn + +/// Represents a computation that will execute only once but can be requested by multiple clients. +/// It keeps track of the number of requests. When all clients cancel their requests, the underlying computation will also cancel and can be restarted. +/// If cancelUnawaited is set to false, the computation will run to completion even when all requests are canceled. +type AsyncLazy<'t> private (initial: AsyncLazyState<'t>, cancelUnawaited: bool, cacheException: bool) = + + let stateUpdateSync = obj() + let mutable state = initial + + let cancelIfUnawaited () = + match state with + | Running(computation, _, cts, 0) -> + cts.Cancel() + state <- Initial computation + | _ -> () + + let afterRequest () = + match state with + | Running(computation, work, _, _) when work.IsCompleted -> + state <- + try + Completed work.Result + with + | exn -> + if cacheException then Faulted exn else Initial computation + | Running(c, work, cts, count) -> + state <- Running(c, work, cts, count - 1) + if cancelUnawaited then cancelIfUnawaited () + | _ -> () // Nothing more to do if another request already transitioned the state. + + let detachable (work: Task<'t>) = + async { + try + let! ct = Async.CancellationToken + let options = TaskContinuationOptions.ExecuteSynchronously + try + return! + // Using ContinueWith with a CancellationToken allows detaching from the running 'work' task. + // This ensures the lazy 'work' and its awaiting requests can be independently managed + // by separate CancellationTokenSources, enabling individual cancellation. + // Essentially, if this async computation is canceled, it won't wait for the 'work' to complete + // but will immediately proceed to the finally block. + work.ContinueWith((fun (t: Task<_>) -> t.Result), ct, options, TaskScheduler.Current) + |> Async.AwaitTask + // Cancellation check before entering the `with` ensures TaskCanceledException coming from the ContinueWith task will never be raised here. + // The cancellation continuation will always be called in case of cancellation. + with exn -> return raise exn + finally + lock stateUpdateSync afterRequest + } + + let request () = + match state with + | Initial computation -> + let cts = new CancellationTokenSource() + let work = Async.StartAsTask(computation, cancellationToken = cts.Token) + state <- Running (computation, work, cts, 1) + detachable work + | Running (c, work, cts, count) -> + state <- Running (c, work, cts, count + 1) + detachable work + | Completed result -> + async { return result } + | Faulted exn -> + async { return raise exn } + + // computation will deallocate after state transition to Completed ot Faulted. + new (computation, ?cancelUnawaited: bool, ?cacheException) = + AsyncLazy(Initial computation, defaultArg cancelUnawaited true, defaultArg cacheException false) + + member _.Request() = lock stateUpdateSync request + + member _.CancelIfUnawaited() = lock stateUpdateSync cancelIfUnawaited + + member _.State = state + + member this.TryResult = + match state with + | Completed result -> Some result + | _ -> None [] module internal Utils = @@ -29,52 +112,6 @@ module internal Utils = $"{dir}{Path.GetFileName path}" - let replayDiagnostics (logger: DiagnosticsLogger) = Seq.iter ((<|) logger.DiagnosticSink) - - [] - let (|TaskCancelled|_|) (ex: exn) = - match ex with - | :? System.Threading.Tasks.TaskCanceledException as tce -> ValueSome tce - //| :? System.AggregateException as ae -> - // if ae.InnerExceptions |> Seq.forall (fun e -> e :? System.Threading.Tasks.TaskCanceledException) then - // ae.InnerExceptions |> Seq.tryHead |> Option.map (fun e -> e :?> System.Threading.Tasks.TaskCanceledException) - // else - // None - | _ -> ValueNone - -type internal StateUpdate<'TValue> = - | CancelRequest - | OriginatorCanceled - | JobCompleted of 'TValue * (PhasedDiagnostic * FSharpDiagnosticSeverity) list - | JobFailed of exn * (PhasedDiagnostic * FSharpDiagnosticSeverity) list - -type internal MemoizeReply<'TValue> = - | New of CancellationToken - | Existing of Task<'TValue> - -type internal MemoizeRequest<'TValue> = GetOrCompute of Async<'TValue> * CancellationToken - -[] -type internal Job<'TValue> = - | Running of TaskCompletionSource<'TValue> * CancellationTokenSource * Async<'TValue> * DateTime * ResizeArray - | Completed of 'TValue * (PhasedDiagnostic * FSharpDiagnosticSeverity) list - | Canceled of DateTime - | Failed of DateTime * exn // TODO: probably we don't need to keep this - - member this.DebuggerDisplay = - match this with - | Running(_, cts, _, ts, _) -> - let cancellation = - if cts.IsCancellationRequested then - " ! Cancellation Requested" - else - "" - - $"Running since {ts.ToShortTimeString()}{cancellation}" - | Completed(value, diags) -> $"Completed {value}" + (if diags.Length > 0 then $" ({diags.Length})" else "") - | Canceled _ -> "Canceled" - | Failed(_, ex) -> $"Failed {ex}" - type internal JobEvent = | Requested | Started @@ -87,6 +124,7 @@ type internal JobEvent = | Strengthened | Failed | Cleared + static member AllEvents = [Requested; Started; Restarted; Finished; Canceled; Evicted; Collected; Weakened; Strengthened; Failed; Cleared] type internal ICacheKey<'TKey, 'TVersion> = abstract member GetKey: unit -> 'TKey @@ -111,40 +149,7 @@ type private KeyData<'TKey, 'TVersion> = Version: 'TVersion } -type internal AsyncLock() = - - let semaphore = new SemaphoreSlim(1, 1) - - member _.Semaphore = semaphore - - member _.Do(f) = - task { - do! semaphore.WaitAsync() - - try - return! f () - finally - semaphore.Release() |> ignore - } - - interface IDisposable with - member _.Dispose() = semaphore.Dispose() - -type internal CachingDiagnosticsLogger(originalLogger: DiagnosticsLogger option) = - inherit DiagnosticsLogger($"CachingDiagnosticsLogger") - - let capturedDiagnostics = ResizeArray() - - override _.ErrorCount = - originalLogger - |> Option.map (fun x -> x.ErrorCount) - |> Option.defaultValue capturedDiagnostics.Count - - override _.DiagnosticSink(diagnostic: PhasedDiagnostic, severity: FSharpDiagnosticSeverity) = - originalLogger |> Option.iter (fun x -> x.DiagnosticSink(diagnostic, severity)) - capturedDiagnostics.Add(diagnostic, severity) - - member _.CapturedDiagnostics = capturedDiagnostics |> Seq.toList +type Job<'t> = AsyncLazy * CapturingDiagnosticsLogger> [] type internal AsyncMemoize<'TKey, 'TVersion, 'TValue when 'TKey: equality and 'TVersion: equality @@ -153,342 +158,39 @@ type internal AsyncMemoize<'TKey, 'TVersion, 'TValue when 'TKey: equality and 'T and 'TVersion:not null #endif > - (?keepStrongly, ?keepWeakly, ?name: string, ?cancelDuplicateRunningJobs: bool) = + (?keepStrongly, ?keepWeakly, ?name: string, ?cancelUnawaitedJobs: bool, ?cancelDuplicateRunningJobs: bool) = let name = defaultArg name "N/A" + let cancelUnawaitedJobs = defaultArg cancelUnawaitedJobs true let cancelDuplicateRunningJobs = defaultArg cancelDuplicateRunningJobs false let event = Event<_>() - let mutable errors = 0 + let eventCounts = [for j in JobEvent.AllEvents -> j, ref 0] |> dict let mutable hits = 0 - let mutable started = 0 - let mutable completed = 0 - let mutable canceled = 0 - let mutable restarted = 0 - let mutable failed = 0 - let mutable evicted = 0 - let mutable collected = 0 - let mutable strengthened = 0 - let mutable cleared = 0 - - let mutable updates_in_flight = 0 - - let mutable cancel_ct_registration_original = 0 - let mutable cancel_exception_original = 0 - let mutable cancel_original_processed = 0 - let mutable cancel_ct_registration_subsequent = 0 - let mutable cancel_exception_subsequent = 0 - let mutable cancel_subsequent_processed = 0 - - let failures = ResizeArray() - let mutable avgDurationMs = 0.0 + let mutable duration = 0L + + let keyTuple (keyData: KeyData<_, _>) = keyData.Label, keyData.Key, keyData.Version + + let logK (eventType: JobEvent) key = + Interlocked.Increment(eventCounts[eventType]) |> ignore + event.Trigger(eventType, key) + + let log eventType keyData = logK eventType (keyTuple keyData) let cache = LruCache<'TKey, 'TVersion, Job<'TValue>>( keepStrongly = defaultArg keepStrongly 100, keepWeakly = defaultArg keepWeakly 200, - requiredToKeep = - (function - | Running _ -> true - | Job.Canceled at when at > DateTime.Now.AddMinutes -5.0 -> true - | Job.Failed(at, _) when at > DateTime.Now.AddMinutes -5.0 -> true - | _ -> false), event = (function - | CacheEvent.Evicted -> - (fun k -> - Interlocked.Increment &evicted |> ignore - event.Trigger(JobEvent.Evicted, k)) - | CacheEvent.Collected -> - (fun k -> - Interlocked.Increment &collected |> ignore - event.Trigger(JobEvent.Collected, k)) - | CacheEvent.Weakened -> (fun k -> event.Trigger(JobEvent.Weakened, k)) - | CacheEvent.Strengthened -> - (fun k -> - Interlocked.Increment &strengthened |> ignore - event.Trigger(JobEvent.Strengthened, k)) - | CacheEvent.Cleared -> - (fun k -> - Interlocked.Increment &cleared |> ignore - event.Trigger(JobEvent.Cleared, k))) - ) - - let requestCounts = Dictionary, int>() - let cancellationRegistrations = Dictionary<_, _>() - - let saveRegistration key registration = - cancellationRegistrations[key] <- - match cancellationRegistrations.TryGetValue key with - | true, registrations -> registration :: registrations - | _ -> [ registration ] - - let cancelRegistration key = - match cancellationRegistrations.TryGetValue key with - | true, registrations -> - for r: CancellationTokenRegistration in registrations do - r.Dispose() - - cancellationRegistrations.Remove key |> ignore - | _ -> () - - let incrRequestCount key = - requestCounts[key] <- - if requestCounts.ContainsKey key then - requestCounts[key] + 1 - else - 1 - - let decrRequestCount key = - if requestCounts.ContainsKey key then - requestCounts[key] <- requestCounts[key] - 1 - - let log (eventType, keyData: KeyData<_, _>) = - event.Trigger(eventType, (keyData.Label, keyData.Key, keyData.Version)) - - let lock = new AsyncLock() - - let processRequest post (key: KeyData<_, _>, msg) diagnosticLogger = - - lock.Do(fun () -> - task { - - let cached, otherVersions = cache.GetAll(key.Key, key.Version) - - let result = - match msg, cached with - | GetOrCompute _, Some(Completed(result, diags)) -> - Interlocked.Increment &hits |> ignore - diags |> replayDiagnostics diagnosticLogger - Existing(Task.FromResult result) - | GetOrCompute(_, ct), Some(Running(tcs, _, _, _, loggers)) -> - Interlocked.Increment &hits |> ignore - incrRequestCount key - - ct.Register(fun _ -> - let _name = name - Interlocked.Increment &cancel_ct_registration_subsequent |> ignore - post (key, CancelRequest)) - |> saveRegistration key - - loggers.Add diagnosticLogger - - Existing tcs.Task - - | GetOrCompute(computation, ct), None - | GetOrCompute(computation, ct), Some(Job.Canceled _) - | GetOrCompute(computation, ct), Some(Job.Failed _) -> - Interlocked.Increment &started |> ignore - incrRequestCount key - - ct.Register(fun _ -> - let _name = name - Interlocked.Increment &cancel_ct_registration_original |> ignore - post (key, OriginatorCanceled)) - |> saveRegistration key - - let cts = new CancellationTokenSource() - - cache.Set( - key.Key, - key.Version, - key.Label, - (Running( - TaskCompletionSource<'TValue>(TaskCreationOptions.RunContinuationsAsynchronously), - cts, - computation, - DateTime.Now, - ResizeArray() - )) - ) - - otherVersions - |> Seq.choose (function - | v, Running(_tcs, cts, _, _, _) -> Some(v, cts) - | _ -> None) - |> Seq.iter (fun (_v, cts) -> - use _ = Activity.start $"{name}: Duplicate running job" [| "key", key.Label |] - //System.Diagnostics.Trace.TraceWarning($"{name} Duplicate {key.Label}") - if cancelDuplicateRunningJobs then - //System.Diagnostics.Trace.TraceWarning("Canceling") - cts.Cancel()) - - New cts.Token - - log (Requested, key) - return result - }) - - let internalError key message = - let ex = exn (message) - failures.Add(key, ex) - Interlocked.Increment &errors |> ignore - // raise ex -- Suppose there's no need to raise here - where does it even go? - - let processStateUpdate post (key: KeyData<_, _>, action: StateUpdate<_>) = - lock.Do(fun () -> - task { - - let cached = cache.TryGet(key.Key, key.Version) - - match action, cached with - - | OriginatorCanceled, Some(Running(tcs, cts, computation, _, _)) -> - - Interlocked.Increment &cancel_original_processed |> ignore - - decrRequestCount key - - if requestCounts[key] < 1 then - cancelRegistration key - cts.Cancel() - tcs.TrySetCanceled() |> ignore - // Remember the job in case it completes after cancellation - cache.Set(key.Key, key.Version, key.Label, Job.Canceled DateTime.Now) - requestCounts.Remove key |> ignore - log (Canceled, key) - Interlocked.Increment &canceled |> ignore - use _ = Activity.start $"{name}: Canceled job" [| "key", key.Label |] - () - - else - // We need to restart the computation - Task.Run(fun () -> - Async.StartAsTask( - async { - - let cachingLogger = new CachingDiagnosticsLogger(None) - - try - // TODO: Should unify starting and restarting - log (Restarted, key) - Interlocked.Increment &restarted |> ignore - System.Diagnostics.Trace.TraceInformation $"{name} Restarted {key.Label}" - let currentLogger = DiagnosticsThreadStatics.DiagnosticsLogger - DiagnosticsThreadStatics.DiagnosticsLogger <- cachingLogger - - try - let! result = computation - post (key, (JobCompleted(result, cachingLogger.CapturedDiagnostics))) - return () - finally - DiagnosticsThreadStatics.DiagnosticsLogger <- currentLogger - with - | TaskCancelled _ -> - Interlocked.Increment &cancel_exception_subsequent |> ignore - post (key, CancelRequest) - () - | ex -> post (key, (JobFailed(ex, cachingLogger.CapturedDiagnostics))) - } - ), - cts.Token) - |> ignore - - | CancelRequest, Some(Running(tcs, cts, _c, _, _)) -> - - Interlocked.Increment &cancel_subsequent_processed |> ignore - - decrRequestCount key - - if requestCounts[key] < 1 then - cancelRegistration key - cts.Cancel() - tcs.TrySetCanceled() |> ignore - // Remember the job in case it completes after cancellation - cache.Set(key.Key, key.Version, key.Label, Job.Canceled DateTime.Now) - requestCounts.Remove key |> ignore - log (Canceled, key) - Interlocked.Increment &canceled |> ignore - use _ = Activity.start $"{name}: Canceled job" [| "key", key.Label |] - () - - // Probably in some cases cancellation can be fired off even after we just unregistered it - | CancelRequest, None - | CancelRequest, Some(Completed _) - | CancelRequest, Some(Job.Canceled _) - | CancelRequest, Some(Job.Failed _) - | OriginatorCanceled, None - | OriginatorCanceled, Some(Completed _) - | OriginatorCanceled, Some(Job.Canceled _) - | OriginatorCanceled, Some(Job.Failed _) -> () - - | JobFailed(ex, diags), Some(Running(tcs, _cts, _c, _ts, loggers)) -> - cancelRegistration key - cache.Set(key.Key, key.Version, key.Label, Job.Failed(DateTime.Now, ex)) - requestCounts.Remove key |> ignore - log (Failed, key) - Interlocked.Increment &failed |> ignore - failures.Add(key.Label, ex) - - for logger in loggers do - diags |> replayDiagnostics logger - - tcs.TrySetException ex |> ignore - - | JobCompleted(result, diags), Some(Running(tcs, _cts, _c, started, loggers)) -> - cancelRegistration key - cache.Set(key.Key, key.Version, key.Label, (Completed(result, diags))) - requestCounts.Remove key |> ignore - log (Finished, key) - Interlocked.Increment &completed |> ignore - let duration = float (DateTime.Now - started).Milliseconds - - avgDurationMs <- - if completed < 2 then - duration - else - avgDurationMs + (duration - avgDurationMs) / float completed - - for logger in loggers do - diags |> replayDiagnostics logger - - if tcs.TrySetResult result = false then - internalError key.Label "Invalid state: Completed job already completed" - - // Sometimes job can be canceled but it still manages to complete (or fail) - | JobFailed _, Some(Job.Canceled _) - | JobCompleted _, Some(Job.Canceled _) -> () - - // Job can't be evicted from cache while it's running because then subsequent requesters would be waiting forever - | JobFailed _, None -> internalError key.Label "Invalid state: Running job missing in cache (failed)" - - | JobCompleted _, None -> internalError key.Label "Invalid state: Running job missing in cache (completed)" - - | JobFailed(ex, _diags), Some(Completed(_job, _diags2)) -> - internalError key.Label $"Invalid state: Failed Completed job \n%A{ex}" - - | JobCompleted(_result, _diags), Some(Completed(_job, _diags2)) -> - internalError key.Label "Invalid state: Double-Completed job" - - | JobFailed(ex, _diags), Some(Job.Failed(_, ex2)) -> - internalError key.Label $"Invalid state: Double-Failed job \n%A{ex} \n%A{ex2}" - - | JobCompleted(_result, _diags), Some(Job.Failed(_, ex2)) -> - internalError key.Label $"Invalid state: Completed Failed job \n%A{ex2}" - }) - - let rec post msg = - Interlocked.Increment &updates_in_flight |> ignore - backgroundTask { - do! processStateUpdate post msg - Interlocked.Decrement &updates_in_flight |> ignore - } - |> ignore - - member this.Get'(key, computation) = - - let wrappedKey = - { new ICacheKey<_, _> with - member _.GetKey() = key - member _.GetVersion() = Unchecked.defaultof<_> - member _.GetLabel() = match key.ToString() with | null -> "" | s -> s - } - - this.Get(wrappedKey, computation) + | CacheEvent.Evicted -> logK JobEvent.Evicted + | CacheEvent.Collected -> logK JobEvent.Collected + | CacheEvent.Weakened -> logK JobEvent.Weakened + | CacheEvent.Strengthened -> logK JobEvent.Strengthened + | CacheEvent.Cleared -> logK JobEvent.Cleared)) member _.Get(key: ICacheKey<_, _>, computation) = - let key = { Label = key.GetLabel() @@ -496,136 +198,114 @@ type internal AsyncMemoize<'TKey, 'TVersion, 'TValue when 'TKey: equality and 'T Version = key.GetVersion() } - async { - let! ct = Async.CancellationToken + let wrappedComputation = + async { + use! _handler = Async.OnCancel (fun () -> log Canceled key) + let sw = Stopwatch.StartNew() + log Started key + let logger = CapturingDiagnosticsLogger "cache" + SetThreadDiagnosticsLoggerNoUnwind logger + + match! computation |> Async.Catch with + | Choice1Of2 result -> + log Finished key + Interlocked.Add(&duration, sw.ElapsedMilliseconds) |> ignore + return Result.Ok result, logger + | Choice2Of2 exn -> + log Failed key + return Result.Error exn, logger + } - let callerDiagnosticLogger = DiagnosticsThreadStatics.DiagnosticsLogger + let getOrAdd () = + let cached, otherVersions = cache.GetAll(key.Key, key.Version) - match! - processRequest post (key, GetOrCompute(computation, ct)) callerDiagnosticLogger - |> Async.AwaitTask - with - | New internalCt -> + let countHit v = Interlocked.Increment &hits |> ignore; v + let cacheSetNewJob () = + let job = Job(wrappedComputation, cancelUnawaited = cancelUnawaitedJobs) + cache.Set(key.Key, key.Version, key.Label, job) + job - let linkedCtSource = CancellationTokenSource.CreateLinkedTokenSource(ct, internalCt) - let cachingLogger = new CachingDiagnosticsLogger(Some callerDiagnosticLogger) + otherVersions, - try - return! - Async.StartAsTask( - async { - // TODO: Should unify starting and restarting - let currentLogger = DiagnosticsThreadStatics.DiagnosticsLogger - DiagnosticsThreadStatics.DiagnosticsLogger <- cachingLogger - - log (Started, key) - - try - let! result = computation - post (key, (JobCompleted(result, cachingLogger.CapturedDiagnostics))) - return result - finally - DiagnosticsThreadStatics.DiagnosticsLogger <- currentLogger - }, - cancellationToken = linkedCtSource.Token - ) - |> Async.AwaitTask - with - | TaskCancelled ex -> - // TODO: do we need to do anything else here? Presumably it should be done by the registration on - // the cancellation token or before we triggered our own cancellation + cached + |> Option.map countHit + |> Option.defaultWith cacheSetNewJob - // Let's send this again just in case. It seems sometimes it's not triggered from the registration? + async { + let otherVersions, job = lock cache getOrAdd - Interlocked.Increment &cancel_exception_original |> ignore + log Requested key - post (key, (OriginatorCanceled)) - return raise ex - | ex -> - post (key, (JobFailed(ex, cachingLogger.CapturedDiagnostics))) - return raise ex + if cancelDuplicateRunningJobs && not cancelUnawaitedJobs then + otherVersions |> Seq.map snd |> Seq.iter _.CancelIfUnawaited() - | Existing job -> return! job |> Async.AwaitTask + use _ = new CompilationGlobalsScope() + let! result, logger = job.Request() + logger.CommitDelayedDiagnostics DiagnosticsThreadStatics.DiagnosticsLogger + match result with + | Ok result -> + return result + | Error exn -> + return raise exn } member _.TryGet(key: 'TKey, predicate: 'TVersion -> bool) : 'TValue option = - let versionsAndJobs = cache.GetAll(key) - - versionsAndJobs - |> Seq.tryPick (fun (version, job) -> - match predicate version, job with - | true, Completed(completed, _) -> Some completed - | _ -> None) + lock cache <| fun () -> + cache.GetAll(key) + |> Seq.tryPick (fun (version, job) -> + match predicate version, job.TryResult with + | true, Some(Ok result, _) -> Some result + | _ -> None) - member _.Clear() = cache.Clear() + member _.Clear() = lock cache cache.Clear - member _.Clear predicate = cache.Clear predicate + member _.Clear predicate = lock cache <| fun () -> cache.Clear predicate member val Event = event.Publish member this.OnEvent = this.Event.Add - member _.Count = lock.Do(fun () -> Task.FromResult cache.Count).Result + member this.Count = lock cache <| fun () -> cache.Count - member _.Updating = updates_in_flight > 0 - - member _.Locked = lock.Semaphore.CurrentCount < 1 + member this.DebuggerDisplay = - member _.Running = - cache.GetValues() - |> Seq.filter (function - | _, _, Running _ -> true - | _ -> false) - |> Seq.toArray + let cachedJobs = cache.GetValues() |> Seq.map (fun (_,_,job) -> job) - member this.DebuggerDisplay = - let locked = if this.Locked then " [LOCKED]" else "" + let jobStateName = function + | Initial _ -> nameof Initial + | Running _ -> nameof Running + | Completed _ -> nameof Completed + | Faulted _ -> nameof Faulted - let valueStats = - cache.GetValues() - |> Seq.countBy (function - | _, _, Running _ -> "Running" - | _, _, Completed _ -> "Completed" - | _, _, Job.Canceled _ -> "Canceled" - | _, _, Job.Failed _ -> "Failed") - |> Map + let valueStats = cachedJobs |> Seq.countBy (_.State >> jobStateName) |> Map + let getStat key = valueStats.TryFind key |> Option.defaultValue 0 let running = - valueStats.TryFind "Running" - |> Option.map (sprintf " Running: %d ") - |> Option.defaultValue "" + let count = getStat "Running" + if count > 0 then $" Running {count}" else "" - let avgDuration = avgDurationMs |> sprintf "| Avg: %.0f ms" + let finished = eventCounts[Finished].Value + let avgDuration = if finished = 0 then "" else $"| Avg: %.0f{float duration / float finished} ms" - let hitRatio = - if started > 0 then - $" (%.0f{float hits / (float (started + hits)) * 100.0} %%)" - else - "" + let requests = eventCounts[Requested].Value + let hitRatio = if requests = 0 then "" else $" (%.0f{float hits / (float (requests)) * 100.0} %%)" + + let faulted = getStat "Faulted" + let failed = eventCounts[Failed].Value let stats = - [| - if errors + failed > 0 then + seq { + if faulted + failed > 0 then " (_!_) " - if errors > 0 then $"| ERRORS: {errors} " else "" - if failed > 0 then $"| FAILED: {failed} " else "" + for j in eventCounts.Keys do + let count = eventCounts[j].Value + if count > 0 then $"| {j}: {count}" else "" $"| hits: {hits}{hitRatio} " - if started > 0 then $"| started: {started} " else "" - if completed > 0 then $"| completed: {completed} " else "" - if canceled > 0 then $"| canceled: {canceled} " else "" - if restarted > 0 then $"| restarted: {restarted} " else "" - if evicted > 0 then $"| evicted: {evicted} " else "" - if collected > 0 then $"| collected: {collected} " else "" - if cleared > 0 then $"| cleared: {cleared} " else "" - if strengthened > 0 then - $"| strengthened: {strengthened} " - else - "" - |] + } |> String.concat "" - $"{locked}{running}{cache.DebuggerDisplay} {stats}{avgDuration}" + $"{running} {cache.DebuggerDisplay} {stats}{avgDuration}" /// A drop-in replacement for AsyncMemoize that disables caching and just runs the computation every time. [] @@ -640,4 +320,4 @@ type internal AsyncMemoizeDisabled<'TKey, 'TVersion, 'TValue when 'TKey: equalit Interlocked.Increment &requests |> ignore computation - member _.DebuggerDisplay = $"(disabled) requests: {requests}" + member _.DebuggerDisplay = $"(disabled) requests: {requests}" \ No newline at end of file diff --git a/src/Compiler/Facilities/AsyncMemoize.fsi b/src/Compiler/Facilities/AsyncMemoize.fsi index d86352d9987..37d2d397fe2 100644 --- a/src/Compiler/Facilities/AsyncMemoize.fsi +++ b/src/Compiler/Facilities/AsyncMemoize.fsi @@ -9,9 +9,6 @@ module internal Utils = /// Return file name with one directory above it val shortPath: path: string -> string - [] - val (|TaskCancelled|_|): ex: exn -> TaskCanceledException voption - type internal JobEvent = | Requested | Started @@ -39,13 +36,6 @@ type Extensions = [] static member internal WithExtraVersion: cacheKey: ICacheKey<'a, 'b> * extraVersion: 'c -> ICacheKey<'a, ('b * 'c)> -type internal AsyncLock = - interface System.IDisposable - - new: unit -> AsyncLock - - member Do: f: (unit -> #Task<'b>) -> Task<'b> - /// /// A cache/memoization for computations that makes sure that the same computation will only be computed once even if it's needed /// at multiple places/times. @@ -62,9 +52,10 @@ type internal AsyncMemoize<'TKey, 'TVersion, 'TValue when 'TKey: equality and 'T /// Maximum number of strongly held results to keep in the cache /// Maximum number of weakly held results to keep in the cache /// Name of the cache - used in tracing messages + /// Cancels a job when all the awaiting requests are canceled. If set to false, unawaited job will run to completion and it's result will be cached. /// If true, when a job is started, all other jobs with the same key will be canceled. new: - ?keepStrongly: int * ?keepWeakly: int * ?name: string * ?cancelDuplicateRunningJobs: bool -> + ?keepStrongly: int * ?keepWeakly: int * ?name: string * ?cancelUnawaitedJobs: bool * ?cancelDuplicateRunningJobs: bool -> AsyncMemoize<'TKey, 'TVersion, 'TValue> member Clear: unit -> unit @@ -73,8 +64,6 @@ type internal AsyncMemoize<'TKey, 'TVersion, 'TValue when 'TKey: equality and 'T member Get: key: ICacheKey<'TKey, 'TVersion> * computation: Async<'TValue> -> Async<'TValue> - member Get': key: 'TKey * computation: Async<'TValue> -> Async<'TValue> - member TryGet: key: 'TKey * predicate: ('TVersion -> bool) -> 'TValue option member Event: IEvent @@ -83,8 +72,6 @@ type internal AsyncMemoize<'TKey, 'TVersion, 'TValue when 'TKey: equality and 'T member Count: int - member Updating: bool - /// A drop-in replacement for AsyncMemoize that disables caching and just runs the computation every time. type internal AsyncMemoizeDisabled<'TKey, 'TVersion, 'TValue when 'TKey: equality and 'TVersion: equality> = diff --git a/src/Compiler/Service/TransparentCompiler.fs b/src/Compiler/Service/TransparentCompiler.fs index 5158ac7f25c..d0fb6b63768 100644 --- a/src/Compiler/Service/TransparentCompiler.fs +++ b/src/Compiler/Service/TransparentCompiler.fs @@ -1821,9 +1821,7 @@ type internal TransparentCompiler Trace.TraceInformation($"Using in-memory project reference: {name}") return assemblyDataResult - with - | TaskCancelled ex -> return raise ex - | ex -> + with ex -> errorR (exn ($"Error while computing assembly data for project {projectSnapshot.Label}: {ex}")) return ProjectAssemblyDataResult.Unavailable true } diff --git a/src/FSharp.Core/FSharp.Core.fsproj b/src/FSharp.Core/FSharp.Core.fsproj index 97a02162fa4..b0abd5048bd 100644 --- a/src/FSharp.Core/FSharp.Core.fsproj +++ b/src/FSharp.Core/FSharp.Core.fsproj @@ -64,7 +64,6 @@ Microsoft.FSharp.Core.SR FSCore.resx - diff --git a/src/FSharp.Core/ILLink.LinkAttributes.xml b/src/FSharp.Core/ILLink.LinkAttributes.xml deleted file mode 100644 index 47a3ff01f02..00000000000 --- a/src/FSharp.Core/ILLink.LinkAttributes.xml +++ /dev/null @@ -1,179 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/FSharp.Core/async.fs b/src/FSharp.Core/async.fs index 1c5138b93dc..959d47d0aab 100644 --- a/src/FSharp.Core/async.fs +++ b/src/FSharp.Core/async.fs @@ -868,11 +868,7 @@ module AsyncPrimitives = /// - Initial cancellation check /// - Call syncCtxt.Post with exception protection. This may fail as it is arbitrary user code -#if BUILDING_WITH_LKG || NO_NULLCHECKING_LIB_SUPPORT let CreateSwitchToAsync (syncCtxt: SynchronizationContext) = -#else - let CreateSwitchToAsync (syncCtxt: SynchronizationContext | null) = -#endif MakeAsyncWithCancelCheck(fun ctxt -> ctxt.PostWithTrampoline syncCtxt ctxt.cont) /// - Initial cancellation check diff --git a/src/FSharp.Core/async.fsi b/src/FSharp.Core/async.fsi index 1cd02f9694b..e01ba0d8d75 100644 --- a/src/FSharp.Core/async.fsi +++ b/src/FSharp.Core/async.fsi @@ -647,7 +647,7 @@ namespace Microsoft.FSharp.Control /// Threads and Contexts /// /// - static member SwitchToContext : syncContext:System.Threading.SynchronizationContext -> Async + static member SwitchToContext : syncContext:(System.Threading.SynchronizationContext | null) -> Async /// Creates an asynchronous computation that captures the current /// success, exception and cancellation continuations. The callback must diff --git a/tests/FSharp.Compiler.ComponentTests/CompilerService/AsyncLock.fs b/tests/FSharp.Compiler.ComponentTests/CompilerService/AsyncLock.fs deleted file mode 100644 index ef4b69a3910..00000000000 --- a/tests/FSharp.Compiler.ComponentTests/CompilerService/AsyncLock.fs +++ /dev/null @@ -1,26 +0,0 @@ -module CompilerService.AsyncLock - -open Internal.Utilities.Collections - -open Xunit -open System.Threading.Tasks - - -[] -let ``Async lock works`` () = - task { - use lock = new AsyncLock() - - let mutable x = 0 - - let job () = task { - let y = x - do! Task.Delay(10) - x <- y + 1 - } - - let jobs = [ for _ in 1..100 -> lock.Do job ] - let! _ = Task.WhenAll(jobs) - - Assert.Equal(100, x) - } \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/CompilerService/AsyncMemoize.fs b/tests/FSharp.Compiler.ComponentTests/CompilerService/AsyncMemoize.fs index e178ccaa911..2c0b6c311be 100644 --- a/tests/FSharp.Compiler.ComponentTests/CompilerService/AsyncMemoize.fs +++ b/tests/FSharp.Compiler.ComponentTests/CompilerService/AsyncMemoize.fs @@ -11,40 +11,58 @@ open FSharp.Compiler.Diagnostics open Xunit -let tap f x = f x; x +let internal observe (cache: AsyncMemoize<_,_,_>) = -let internal record (cache: AsyncMemoize<_,_,_>) = + let collected = new MailboxProcessor<_>(fun _ -> async {}) - let events = Collections.Concurrent.ConcurrentQueue() + let arrivals = MailboxProcessor.Start(fun inbox -> + let rec loop events = async { + let! (e, (_, k, _)) = inbox.Receive() + let events = (e, k) :: events + printfn $"{k}: {e}" + collected.Post events + do! loop events + } + loop [] + ) + + cache.Event.Add arrivals.Post - let waitForIdle() = SpinWait.SpinUntil(fun () -> not cache.Updating) + let next () = collected.Receive(10_000) - waitForIdle() - cache.Event - |> Event.map (fun (e, (_, k, _)) -> e, k) - |> Event.add events.Enqueue + next + +let rec awaitEvents next condition = + async { + match! next () with + | events when condition events -> return events + | _ -> return! awaitEvents next condition + } - let getEvents () = - waitForIdle() - events |> List.ofSeq |> tap (printfn "events: %A") +let rec eventsWhen next condition = + awaitEvents next condition |> Async.RunSynchronously - getEvents +let waitUntil next condition = + eventsWhen next condition |> ignore -let check getEvents assertFunction = - let actual = getEvents() - assertFunction actual +let expect next (expected: 't list) = + let actual = eventsWhen next (List.length >> (=) expected.Length) + Assert.Equal<'t list>(expected, actual |> List.rev) -let waitUntil getEvents condition = - while getEvents() |> condition |> not do () +let countOf value events = + events |> Seq.filter (fst >> (=) value) |> Seq.length -let recorded (expected: 't list) (actual: 't list) = - Assert.Equal<'t>(expected, actual) +let received event = function (a, _) :: _ when a = event -> true | _ -> false -let countOf value count events = - events |> Seq.filter (fst >> (=) value) |> Seq.length |> (=) count +let internal wrapKey key = + { new ICacheKey<_, _> with + member _.GetKey() = key + member _.GetVersion() = Unchecked.defaultof<_> + member _.GetLabel() = match key.ToString() with | null -> "" | s -> s + } -let received value events = - events |> List.tryLast |> Option.map (fst >> (=) value) |> Option.defaultValue false +let assertTaskCanceled (task: Task<_>) = + Assert.ThrowsAnyAsync(fun () -> task).Result |> ignore [] let ``Basics``() = @@ -54,16 +72,16 @@ let ``Basics``() = } let memoize = AsyncMemoize() - let events = record memoize + let events = observe memoize let result = seq { - memoize.Get'(5, computation 5) - memoize.Get'(5, computation 5) - memoize.Get'(2, computation 2) - memoize.Get'(5, computation 5) - memoize.Get'(3, computation 3) - memoize.Get'(2, computation 2) + memoize.Get(wrapKey 5, computation 5) + memoize.Get(wrapKey 5, computation 5) + memoize.Get(wrapKey 2, computation 2) + memoize.Get(wrapKey 5, computation 5) + memoize.Get(wrapKey 3, computation 3) + memoize.Get(wrapKey 2, computation 2) } |> Async.Parallel |> Async.RunSynchronously @@ -72,138 +90,148 @@ let ``Basics``() = Assert.Equal(expected, result) - check events <| fun events -> - let groups = events |> Seq.groupBy snd |> Seq.toList - Assert.Equal(3, groups.Length) - for key, events in groups do - Assert.Equal>(Set [ Requested, key; Started, key; Finished, key ], Set events) + let events = eventsWhen events (countOf Finished >> (=) 3) + + let groups = events |> Seq.groupBy snd |> Seq.toList + Assert.Equal(3, groups.Length) + for key, events in groups do + Assert.Equal>(Set [ Requested, key; Started, key; Finished, key ], Set events) [] -let ``We can cancel a job`` () = - task { +let ``We can disconnect a request from a running job`` () = - let jobStarted = new ManualResetEventSlim(false) - let cts = new CancellationTokenSource() - let ctsCancelled = new ManualResetEventSlim(false) + let cts = new CancellationTokenSource() + let canFinish = new ManualResetEventSlim(false) - let computation = async { - use! _catch = Async.OnCancel ignore - jobStarted.Set() - ctsCancelled.Wait() - do! async { } - failwith "Should be canceled before it gets here" - } + let computation = async { + canFinish.Wait() + } + + let memoize = AsyncMemoize<_, int, _>(cancelUnawaitedJobs = false, cancelDuplicateRunningJobs = true) + let events = observe memoize + + let key = 1 - let memoize = AsyncMemoize<_, int, _>() - let events = record memoize + let task1 = Async.StartAsTask( memoize.Get(wrapKey 1, computation), cancellationToken = cts.Token) - let key = 1 + waitUntil events (received Started) + cts.Cancel() - let _task1 = Async.StartAsTask( memoize.Get'(1, computation), cancellationToken = cts.Token) + assertTaskCanceled task1 - jobStarted.Wait() - cts.Cancel() - ctsCancelled.Set() + canFinish.Set() |> ignore - check events recorded - [ Requested, key - Started, key - Canceled, key ] + expect events + [ Requested, key + Started, key + Finished, key ] + +[] +let ``We can cancel a job`` () = + + let cts = new CancellationTokenSource() + + let computation = async { + while true do + do! Async.Sleep 1000 } + let memoize = AsyncMemoize<_, int, _>() + let events = observe memoize + + let key = 1 + + let task1 = Async.StartAsTask( memoize.Get(wrapKey 1, computation), cancellationToken = cts.Token) + + waitUntil events (received Started) + + cts.Cancel() + + assertTaskCanceled task1 + + expect events + [ Requested, key + Started, key + Canceled, key ] + [] let ``Job is restarted if first requestor cancels`` () = - let jobStarted = new SemaphoreSlim(0) + let jobCanComplete = new ManualResetEventSlim(false) - let jobCanComplete = new ManualResetEventSlim(false) + let computation key = async { + jobCanComplete.Wait() + return key * 2 + } - let computation key = async { - jobStarted.Release() |> ignore + let memoize = AsyncMemoize<_, int, _>() + let events = observe memoize - jobCanComplete.Wait() - return key * 2 - } + use cts1 = new CancellationTokenSource() - let memoize = AsyncMemoize<_, int, _>() - let events = record memoize + let key = 1 - use cts1 = new CancellationTokenSource() + let _task1 = Async.StartAsTask( memoize.Get(wrapKey key, computation key), cancellationToken = cts1.Token) - let key = 1 + waitUntil events (received Started) + cts1.Cancel() - let _task1 = Async.StartAsTask( memoize.Get'(key, computation key), cancellationToken = cts1.Token) + waitUntil events (received Canceled) - jobStarted.Wait() - let task2 = Async.StartAsTask( memoize.Get'(key, computation key)) - let task3 = Async.StartAsTask( memoize.Get'(key, computation key)) + let task2 = Async.StartAsTask( memoize.Get(wrapKey key, computation key)) - waitUntil events (countOf Requested 3) + waitUntil events (countOf Started >> (=) 2) - cts1.Cancel() + jobCanComplete.Set() |> ignore - jobCanComplete.Set() |> ignore + Assert.Equal(2, task2.Result) - jobStarted.Wait() + expect events + [ Requested, key + Started, key + Canceled, key + Requested, key + Started, key + Finished, key ] - Assert.Equal(2, task2.Result) - Assert.Equal(2, task3.Result) - - check events recorded - [ Requested, key - Started, key - Requested, key - Requested, key - Restarted, key - Finished, key ] [] -let ``Job is restarted if first requestor cancels but keeps running if second requestor cancels`` () = - let jobStarted = new ManualResetEventSlim(false) +let ``Job keeps running if only one requestor cancels`` () = - let jobCanComplete = new ManualResetEventSlim(false) + let jobCanComplete = new ManualResetEventSlim(false) - let computation key = async { - jobStarted.Set() |> ignore - jobCanComplete.Wait() - return key * 2 - } + let computation key = async { + jobCanComplete.Wait() + return key * 2 + } - let memoize = AsyncMemoize<_, int, _>() - let events = record memoize - - use cts1 = new CancellationTokenSource() - use cts2 = new CancellationTokenSource() - - let key = 1 + let memoize = AsyncMemoize<_, int, _>() + let events = observe memoize - let _task1 = Async.StartAsTask( memoize.Get'(key, computation key), cancellationToken = cts1.Token) + use cts = new CancellationTokenSource() - jobStarted.Wait() - jobStarted.Reset() |> ignore + let key = 1 - let _task2 = Async.StartAsTask( memoize.Get'(key, computation key), cancellationToken = cts2.Token) - let task3 = Async.StartAsTask( memoize.Get'(key, computation key)) + let task1 = Async.StartAsTask( memoize.Get(wrapKey key, computation key)) - waitUntil events (countOf Requested 3) + waitUntil events (received Started) - cts1.Cancel() + let task2 = Async.StartAsTask( memoize.Get(wrapKey key, computation key) |> Async.Ignore, cancellationToken = cts.Token) - jobStarted.Wait() + waitUntil events (countOf Requested >> (=) 2) - cts2.Cancel() + cts.Cancel() - jobCanComplete.Set() |> ignore + assertTaskCanceled task2 - Assert.Equal(2, task3.Result) + jobCanComplete.Set() |> ignore - check events recorded - [ Requested, key - Started, key - Requested, key - Requested, key - Restarted, key - Finished, key ] + Assert.Equal(2, task1.Result) + expect events + [ Requested, key + Started, key + Requested, key + Finished, key ] type ExpectedException() = inherit Exception() @@ -290,7 +318,7 @@ let ``Stress test`` () = let timeoutMs = rng.Next(minTimeout, maxTimeout) let key = keys[rng.Next keys.Length] let result = key * 2 - let job = cache.Get'(key, computation durationMs result) + let job = cache.Get(wrapKey key, computation durationMs result) let cts = new CancellationTokenSource() let runningJob = Async.StartAsTask(job, cancellationToken = cts.Token) cts.CancelAfter timeoutMs @@ -328,60 +356,56 @@ let ``Stress test`` () = Assert.True ((float completed) > ((float started) * 0.1), "Less than 10 % completed jobs") -[] -[] -[] -let ``Cancel running jobs with the same key`` cancelDuplicate expectFinished = - let cache = AsyncMemoize(cancelDuplicateRunningJobs=cancelDuplicate) - - let mutable started = 0 - let mutable finished = 0 +[] +let ``Cancel running jobs with the same key`` () = + let cache = AsyncMemoize(cancelUnawaitedJobs = false, cancelDuplicateRunningJobs = true) - let job1started = new ManualResetEventSlim(false) - let job1finished = new ManualResetEventSlim(false) + let events = observe cache let jobCanContinue = new ManualResetEventSlim(false) - let job2started = new ManualResetEventSlim(false) - let job2finished = new ManualResetEventSlim(false) - - let work onStart onFinish = async { - Interlocked.Increment &started |> ignore - onStart() |> ignore + let work = async { jobCanContinue.Wait() - do! Async.Sleep 100 - Interlocked.Increment &finished |> ignore - onFinish() |> ignore } - let key1 = + let key version = { new ICacheKey<_, _> with member _.GetKey() = 1 - member _.GetVersion() = 1 - member _.GetLabel() = "key1" } + member _.GetVersion() = version + member _.GetLabel() = $"key1 {version}" } - cache.Get(key1, work job1started.Set job1finished.Set) |> Async.Catch |> Async.Ignore |> Async.Start + let cts = new CancellationTokenSource() - job1started.Wait() + let jobsToCancel = + [ for i in 1 .. 10 -> Async.StartAsTask(cache.Get(key i , work), cancellationToken = cts.Token) ] - let key2 = - { new ICacheKey<_, _> with - member _.GetKey() = key1.GetKey() - member _.GetVersion() = key1.GetVersion() + 1 - member _.GetLabel() = "key2" } + waitUntil events (countOf Started >> (=) 10) + + // detach requests from their running computations + cts.Cancel() + + for job in jobsToCancel do assertTaskCanceled job - cache.Get(key2, work job2started.Set job2finished.Set ) |> Async.Catch |> Async.Ignore |> Async.Start + let job = cache.Get(key 11, work) |> Async.StartAsTask - job2started.Wait() + // up til now the jobs should have been running unobserved + let current = eventsWhen events (received Requested) + Assert.Equal(0, current |> countOf Canceled) + + // new request should cancel the unobserved jobs + waitUntil events (received Started) jobCanContinue.Set() |> ignore - - job2finished.Wait() - - if not cancelDuplicate then - job1finished.Wait() - Assert.Equal((2, expectFinished), (started, finished)) + job.Wait() + + let events = eventsWhen events (received Finished) + + Assert.Equal(0, events |> countOf Failed) + + Assert.Equal(10, events |> countOf Canceled) + + Assert.Equal(1, events |> countOf Finished) type DummyException(msg) = inherit Exception(msg) diff --git a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj index ffc935a2075..a1a46d7a99e 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj +++ b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj @@ -300,7 +300,6 @@ - diff --git a/tests/FSharp.Compiler.ComponentTests/FSharpChecker/TransparentCompiler.fs b/tests/FSharp.Compiler.ComponentTests/FSharpChecker/TransparentCompiler.fs index b05096303d4..4b5987f65e5 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharpChecker/TransparentCompiler.fs +++ b/tests/FSharp.Compiler.ComponentTests/FSharpChecker/TransparentCompiler.fs @@ -33,17 +33,13 @@ let internal recordAllEvents groupBy = let mutable cache : AsyncMemoize<_,_,_> option = None let events = ConcurrentQueue() - let waitForIdle() = SpinWait.SpinUntil(fun () -> not cache.Value.Updating) - let observe (getCache: CompilerCaches -> AsyncMemoize<_,_,_>) (checker: FSharpChecker) = cache <- Some (getCache checker.Caches) - waitForIdle() cache.Value.Event |> Event.map (fun (e, k) -> groupBy k, e) |> Event.add events.Enqueue let getEvents () = - waitForIdle() events |> List.ofSeq observe, getEvents @@ -51,7 +47,7 @@ let internal recordAllEvents groupBy = let getFileNameKey (_l, (f: string, _p), _) = Path.GetFileName f // TODO: currently the label for DependecyGraph cache is $"%d{fileSnapshots.Length} files ending with {lastFile}" -let getDependecyGraphKey (_l, _, _) = failwith "not implemented" +let getDependecyGraphKey (_l, _, _) = failwith "not implemented" let internal recordEvents groupBy = let observe, getEvents = recordAllEvents groupBy @@ -293,7 +289,7 @@ let ``We don't check files that are not depended on`` () = let observe, check = recordEvents getFileNameKey - ProjectWorkflowBuilder(project, useTransparentCompiler = true) { + ProjectWorkflowBuilder(project, useTransparentCompiler = true) { withChecker (observe _.TcIntermediate) updateFile "First" updatePublicSurface checkFile "Last" expectOk @@ -448,7 +444,7 @@ let fuzzingTest seed (project: SyntheticProject) = task { let builder = ProjectWorkflowBuilder(project, useTransparentCompiler = true, autoStart = false) let checker = builder.Checker - + // Force creation and caching of options do! SaveAndCheckProject project checker false |> Async.Ignore @@ -600,7 +596,7 @@ let fuzzingTest seed (project: SyntheticProject) = task { builder.DeleteProjectDir() } -[] +[] [] [] [] @@ -712,7 +708,7 @@ let ``What happens if bootstrapInfoStatic needs to be recomputed`` _ = giraffeProject.Workflow { updateFile "Helpers" (fun f -> { f with SignatureFile = Custom (f.SignatureFile.CustomText + "\n") }) checkFile "EndpointRouting" expectOk - withChecker (fun checker -> + withChecker (fun checker -> async { checker.Caches.BootstrapInfoStatic.Clear() checker.Caches.BootstrapInfo.Clear() @@ -722,7 +718,7 @@ let ``What happens if bootstrapInfoStatic needs to be recomputed`` _ = }) updateFile "Core" (fun f -> { f with SignatureFile = Custom (f.SignatureFile.CustomText + "\n") }) checkFile "EndpointRouting" expectOk - } + } module ParsedInputHashing = @@ -776,7 +772,7 @@ let ``TypeCheck last file in project with transparent compiler`` useTransparentC let responseFile = FileInfo responseFile let syntheticProject = mkSyntheticProjectForResponseFile responseFile - let workflow = + let workflow = ProjectWorkflowBuilder( syntheticProject, isExistingProject = true, @@ -793,7 +789,7 @@ let ``TypeCheck last file in project with transparent compiler`` useTransparentC | Some lastFile -> workflow { - clearCache + clearCache checkFile lastFile expectOk } @@ -803,13 +799,13 @@ let ``LoadClosure for script is computed once`` () = sourceFile "First" []) let observe, getEvents = recordAllEvents getFileNameKey - + ProjectWorkflowBuilder(project, useTransparentCompiler = true) { withChecker (observe _.ScriptClosure) checkFile "First" expectOk } |> ignore - + Assert.Empty(getEvents()) [] @@ -819,7 +815,7 @@ let ``LoadClosure for script is recomputed after changes`` () = sourceFile "First" []) let observe, check = recordEvents getFileNameKey - + ProjectWorkflowBuilder(project, useTransparentCompiler = true) { withChecker (observe _.ScriptClosure) checkFile "First" expectOk @@ -830,12 +826,12 @@ let ``LoadClosure for script is recomputed after changes`` () = } |> ignore check (fileName "First") [Weakened; Requested; Started; Finished; Weakened; Requested; Started; Finished] - + [] let ``TryGetRecentCheckResultsForFile returns None before first call to ParseAndCheckFileInProject`` () = let project = SyntheticProject.Create( sourceFile "First" []) - + ProjectWorkflowBuilder(project) { clearCache tryGetRecentCheckResults "First" expectNone @@ -845,7 +841,7 @@ let ``TryGetRecentCheckResultsForFile returns None before first call to ParseAnd let ``TryGetRecentCheckResultsForFile returns result after first call to ParseAndCheckFileInProject`` () = let project = SyntheticProject.Create( sourceFile "First" [] ) - + ProjectWorkflowBuilder(project) { tryGetRecentCheckResults "First" expectSome } |> ignore @@ -854,7 +850,7 @@ let ``TryGetRecentCheckResultsForFile returns result after first call to ParseAn let ``TryGetRecentCheckResultsForFile returns no result after edit`` () = let project = SyntheticProject.Create( sourceFile "First" []) - + ProjectWorkflowBuilder(project) { tryGetRecentCheckResults "First" expectSome updateFile "First" updatePublicSurface @@ -862,13 +858,13 @@ let ``TryGetRecentCheckResultsForFile returns no result after edit`` () = checkFile "First" expectOk tryGetRecentCheckResults "First" expectSome } |> ignore - + [] let ``TryGetRecentCheckResultsForFile returns result after edit of other file`` () = let project = SyntheticProject.Create( sourceFile "First" [], sourceFile "Second" ["First"]) - + ProjectWorkflowBuilder(project) { tryGetRecentCheckResults "First" expectSome tryGetRecentCheckResults "Second" expectSome @@ -901,7 +897,7 @@ let ``Unused warning should still produce after parse warning`` useTransparentCo // There should be parse warning because of the space in the file name: // warning FS0221: The declarations in this file will be placed in an implicit module 'As 01' based on the file name 'As 01.fs'. // However this is not a valid F# identifier, so the contents will not be accessible from other files. Consider renaming the file or adding a 'module' or 'namespace' declaration at the top of the file. - + let project = { SyntheticProject.Create( { sourceFile "As 01" [] with @@ -914,7 +910,7 @@ do printfn "Hello from F#" """ SignatureFile = No - + }) with AutoAddModules = false OtherOptions = [ @@ -939,7 +935,7 @@ printfn "Hello from F#" checkResults.Diagnostics |> Array.exists (fun diag -> diag.Severity = FSharpDiagnosticSeverity.Warning && diag.ErrorNumber = 1182) Assert.True(hasCheckWarning, "Expected post inference warning FS1182") - + ProjectWorkflowBuilder(project, useTransparentCompiler = useTransparentCompiler) { checkFile "As 01" expectTwoWarnings } @@ -959,12 +955,12 @@ type private LoadClosureTestShim(currentFileSystem: IFileSystem) = let mutable bDidUpdate = false let asStream (v:string) = new MemoryStream(System.Text.Encoding.UTF8.GetBytes v) let knownFiles = set [ "a.fsx"; "b.fsx"; "c.fsx" ] - + member val aFsx = "#load \"b.fsx\"" member val bFsxInitial = "" member val bFsxUpdate = "#load \"c.fsx\"" member val cFsx = "" - + member x.DocumentSource (fileName: string) = async { if not (knownFiles.Contains fileName) then @@ -978,7 +974,7 @@ type private LoadClosureTestShim(currentFileSystem: IFileSystem) = } member x.UpdateB () = bDidUpdate <- true - + override _.FileExistsShim(path) = if knownFiles.Contains path then true else currentFileSystem.FileExistsShim(path) override _.GetFullPathShim(fileName) = @@ -996,7 +992,7 @@ type private LoadClosureTestShim(currentFileSystem: IFileSystem) = ) module TestsMutatingFileSystem = - + [] [] [] @@ -1010,7 +1006,7 @@ module TestsMutatingFileSystem = if System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription.StartsWith(".NET Framework") then None else - Some false + Some false try let checker = FSharpChecker.Create(useTransparentCompiler = useTransparentCompiler) @@ -1034,7 +1030,7 @@ module TestsMutatingFileSystem = match snd checkResults with | FSharpCheckFileAnswer.Aborted -> failwith "Did not expected FSharpCheckFileAnswer.Aborted" | FSharpCheckFileAnswer.Succeeded checkFileResults -> Assert.Equal(0, checkFileResults.Diagnostics.Length) - + // Update b.fsx, it should now load c.fsx fileSystemShim.UpdateB() @@ -1081,7 +1077,7 @@ let ``Parsing with cache and without project snapshot`` () = async { let checker = FSharpChecker.Create(useTransparentCompiler = true) let fileName = "B.fs" - let parsingOptions = { FSharpParsingOptions.Default with SourceFiles = [| "A.fs"; fileName; "C.fs" |] } + let parsingOptions = { FSharpParsingOptions.Default with SourceFiles = [| "A.fs"; fileName; "C.fs" |] } let sourceText = SourceText.ofString """ module B @@ -1091,7 +1087,7 @@ let b : int = ExtraIdentUserNeverWroteRulezzz let! parseResult = checker.ParseFile(fileName, sourceText, parsingOptions, cache = true) Assert.False(parseResult.ParseHadErrors) Assert.True(Array.isEmpty parseResult.Diagnostics) - + let! parseAgainResult = checker.ParseFile(fileName, sourceText, parsingOptions, cache = true) Assert.False(parseAgainResult.ParseHadErrors) Assert.True(Array.isEmpty parseAgainResult.Diagnostics) diff --git a/tests/FSharp.Compiler.Service.Tests/Common.fs b/tests/FSharp.Compiler.Service.Tests/Common.fs index 986e2be5132..18276ae39a9 100644 --- a/tests/FSharp.Compiler.Service.Tests/Common.fs +++ b/tests/FSharp.Compiler.Service.Tests/Common.fs @@ -473,63 +473,16 @@ let assertRange Assert.Equal(Position.mkPos expectedStartLine expectedStartColumn, actualRange.Start) Assert.Equal(Position.mkPos expectedEndLine expectedEndColumn, actualRange.End) -[] -module TempDirUtils = - let getTempPath dir = - Path.Combine(tempDirectoryOfThisTestRun.Value.FullName, dir) - - /// Returns the file name part of a temp file name created with tryCreateTemporaryFileName () - /// and an added process id and thread id to ensure uniqueness between threads. - let getTempFileName() = - let tempFileName = getTemporaryFileName () - try - let tempFile, tempExt = Path.GetFileNameWithoutExtension tempFileName, Path.GetExtension tempFileName - let procId, threadId = Process.GetCurrentProcess().Id, Thread.CurrentThread.ManagedThreadId - String.concat "" [tempFile; "_"; string procId; "_"; string threadId; tempExt] // ext includes dot - finally - try - FileSystem.FileDeleteShim tempFileName - with _ -> () - - /// Given just a file name, returns it with changed extension located in %TEMP%\ExprTests - let getTempFilePathChangeExt dir tmp ext = - Path.Combine(getTempPath dir, Path.ChangeExtension(tmp, ext)) - - /// If it doesn't exists, create a folder 'ExprTests' in local user's %TEMP% folder - let createTempDir dirName = - let tempPath = getTempPath dirName - do - if Directory.Exists tempPath then () - else Directory.CreateDirectory tempPath |> ignore - - /// Clean up after a test is run. If you need to inspect the create *.fs files, change this function to do nothing, or just break here. - let cleanupTempFiles dirName files = - { new IDisposable with - member _.Dispose() = - for fileName in files do - try - // cleanup: only the source file is written to the temp dir. - FileSystem.FileDeleteShim fileName - with _ -> () - - try - // remove the dir when empty - let tempPath = getTempPath dirName - if Directory.GetFiles tempPath |> Array.isEmpty then - Directory.Delete tempPath - with _ -> () } - - let createProjectOptions dirName fileSources extraArgs = - let fileNames = fileSources |> List.map (fun _ -> getTempFileName()) - let temp2 = getTempFileName() - let fileNames = fileNames |> List.map (fun temp1 -> getTempFilePathChangeExt dirName temp1 ".fs") - let dllName = getTempFilePathChangeExt dirName temp2 ".dll" - let projFileName = getTempFilePathChangeExt dirName temp2 ".fsproj" - - createTempDir dirName - for fileSource: string, fileName in List.zip fileSources fileNames do - FileSystem.OpenFileForWriteShim(fileName).Write(fileSource) - let args = [| yield! extraArgs; yield! mkProjectCommandLineArgs (dllName, []) |] - let options = { checker.GetProjectOptionsFromCommandLineArgs (projFileName, args) with SourceFiles = fileNames |> List.toArray } - - cleanupTempFiles dirName (fileNames @ [dllName; projFileName]), options +let createProjectOptions fileSources extraArgs = + let tempDir = createTemporaryDirectory() + let temp2 = getTemporaryFileNameInDirectory tempDir + let dllName = changeExtension temp2 ".dll" + let projFileName = changeExtension temp2 ".fsproj" + + let sourceFiles = + [| for fileSource: string in fileSources do + let fileName = changeExtension (getTemporaryFileNameInDirectory tempDir) ".fs" + FileSystem.OpenFileForWriteShim(fileName).Write(fileSource) + fileName |] + let args = [| yield! extraArgs; yield! mkProjectCommandLineArgs (dllName, []) |] + { checker.GetProjectOptionsFromCommandLineArgs (projFileName, args) with SourceFiles = sourceFiles } diff --git a/tests/FSharp.Compiler.Service.Tests/ExprTests.fs b/tests/FSharp.Compiler.Service.Tests/ExprTests.fs index 251e1fc3a91..7a594db1e38 100644 --- a/tests/FSharp.Compiler.Service.Tests/ExprTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/ExprTests.fs @@ -13,6 +13,8 @@ open FSharp.Compiler.Service.Tests.Common open FSharp.Compiler.Symbols open FSharp.Compiler.Symbols.FSharpExprPatterns +open TestFramework + type FSharpCore = | FC45 | FC46 @@ -593,7 +595,7 @@ let testMutableVar = mutableVar 1 let testMutableConst = mutableConst () """ - let createOptionsWithArgs args = createProjectOptions dirName [ fileSource1; fileSource2 ] args + let createOptionsWithArgs args = createProjectOptions [ fileSource1; fileSource2 ] args let createOptions() = createOptionsWithArgs [] @@ -659,8 +661,7 @@ let test{0}ToStringOperator (e1:{1}) = string e1 /// This test is run in unison with its optimized counterpart below [] let ``Test Unoptimized Declarations Project1`` () = - let cleanup, options = Project1.createOptionsWithArgs [ "--langversion:preview" ] - use _holder = cleanup + let options = Project1.createOptionsWithArgs [ "--langversion:preview" ] let exprChecker = FSharpChecker.Create(keepAssemblyContents=true, useTransparentCompiler=CompilerAssertHelpers.UseTransparentCompiler) let wholeProjectResults = exprChecker.ParseAndCheckProject(options) |> Async.RunImmediate @@ -798,8 +799,7 @@ let ``Test Unoptimized Declarations Project1`` () = [] let ``Test Optimized Declarations Project1`` () = - let cleanup, options = Project1.createOptionsWithArgs [ "--langversion:preview" ] - use _holder = cleanup + let options = Project1.createOptionsWithArgs [ "--langversion:preview" ] let exprChecker = FSharpChecker.Create(keepAssemblyContents=true, useTransparentCompiler=CompilerAssertHelpers.UseTransparentCompiler) let wholeProjectResults = exprChecker.ParseAndCheckProject(options) |> Async.RunImmediate @@ -938,15 +938,13 @@ let ``Test Optimized Declarations Project1`` () = let testOperators dnName fsName excludedTests expectedUnoptimized expectedOptimized = - let tempFileName = getTempFileName() - let filePath = getTempFilePathChangeExt dirName tempFileName ".fs" - let dllPath =getTempFilePathChangeExt dirName tempFileName ".dll" - let projFilePath = getTempFilePathChangeExt dirName tempFileName ".fsproj" + let tempFileName = getTemporaryFileName() + let filePath = changeExtension tempFileName ".fs" + let dllPath =changeExtension tempFileName ".dll" + let projFilePath = changeExtension tempFileName ".fsproj" let exprChecker = FSharpChecker.Create(keepAssemblyContents=true, useTransparentCompiler=true) begin - use _cleanup = cleanupTempFiles dirName [filePath; dllPath; projFilePath] - createTempDir dirName let source = String.Format(Project1.operatorTests, dnName, fsName) let replace (s:string) r = s.Replace("let " + r, "// let " + r) let fileSource = excludedTests |> List.fold replace source @@ -3128,7 +3126,7 @@ let BigSequenceExpression(outFileOpt,docFileOpt,baseAddressOpt) = """ - let createOptions() = createProjectOptions dirName [fileSource1] [] + let createOptions() = createProjectOptions [fileSource1] [] #if !NETFRAMEWORK && DEBUG [] @@ -3136,8 +3134,7 @@ let BigSequenceExpression(outFileOpt,docFileOpt,baseAddressOpt) = [] #endif let ``Test expressions of declarations stress big expressions`` () = - let cleanup, options = ProjectStressBigExpressions.createOptions() - use _holder = cleanup + let options = ProjectStressBigExpressions.createOptions() let exprChecker = FSharpChecker.Create(keepAssemblyContents=true, useTransparentCompiler=CompilerAssertHelpers.UseTransparentCompiler) let wholeProjectResults = exprChecker.ParseAndCheckProject(options) |> Async.RunImmediate @@ -3155,8 +3152,7 @@ let ``Test expressions of declarations stress big expressions`` () = [] #endif let ``Test expressions of optimized declarations stress big expressions`` () = - let cleanup, options = ProjectStressBigExpressions.createOptions() - use _holder = cleanup + let options = ProjectStressBigExpressions.createOptions() let exprChecker = FSharpChecker.Create(keepAssemblyContents=true, useTransparentCompiler=CompilerAssertHelpers.UseTransparentCompiler) let wholeProjectResults = exprChecker.ParseAndCheckProject(options) |> Async.RunImmediate @@ -3211,12 +3207,11 @@ let f7() = callXY (C()) (D()) let f8() = callXY (D()) (C()) """ - let createOptions() = createProjectOptions dirName [fileSource1] ["--langversion:7.0"] + let createOptions() = createProjectOptions [fileSource1] ["--langversion:7.0"] [] let ``Test ProjectForWitnesses1`` () = - let cleanup, options = ProjectForWitnesses1.createOptions() - use _holder = cleanup + let options = ProjectForWitnesses1.createOptions() let exprChecker = FSharpChecker.Create(keepAssemblyContents=true, useTransparentCompiler=CompilerAssertHelpers.UseTransparentCompiler) let wholeProjectResults = exprChecker.ParseAndCheckProject(options) |> Async.RunImmediate @@ -3259,8 +3254,7 @@ let ``Test ProjectForWitnesses1`` () = [] let ``Test ProjectForWitnesses1 GetWitnessPassingInfo`` () = - let cleanup, options = ProjectForWitnesses1.createOptions() - use _holder = cleanup + let options = ProjectForWitnesses1.createOptions() let exprChecker = FSharpChecker.Create(keepAssemblyContents=true, useTransparentCompiler=CompilerAssertHelpers.UseTransparentCompiler) let wholeProjectResults = exprChecker.ParseAndCheckProject(options) |> Async.RunImmediate @@ -3335,12 +3329,11 @@ type MyNumberWrapper = { MyNumber: MyNumber } """ - let createOptions() = createProjectOptions dirName [fileSource1] ["--langversion:7.0"] + let createOptions() = createProjectOptions [fileSource1] ["--langversion:7.0"] [] let ``Test ProjectForWitnesses2`` () = - let cleanup, options = ProjectForWitnesses2.createOptions() - use _holder = cleanup + let options = ProjectForWitnesses2.createOptions() let exprChecker = FSharpChecker.Create(keepAssemblyContents=true, useTransparentCompiler=CompilerAssertHelpers.UseTransparentCompiler) let wholeProjectResults = exprChecker.ParseAndCheckProject(options) |> Async.RunImmediate @@ -3391,12 +3384,11 @@ let s2 = sign p1 """ - let createOptions() = createProjectOptions dirName [fileSource1] ["--langversion:7.0"] + let createOptions() = createProjectOptions [fileSource1] ["--langversion:7.0"] [] let ``Test ProjectForWitnesses3`` () = - let cleanup, options = createProjectOptions dirName [ ProjectForWitnesses3.fileSource1 ] ["--langversion:7.0"] - use _holder = cleanup + let options = createProjectOptions [ ProjectForWitnesses3.fileSource1 ] ["--langversion:7.0"] let exprChecker = FSharpChecker.Create(keepAssemblyContents=true, useTransparentCompiler=CompilerAssertHelpers.UseTransparentCompiler) let wholeProjectResults = exprChecker.ParseAndCheckProject(options) |> Async.RunImmediate @@ -3426,8 +3418,7 @@ let ``Test ProjectForWitnesses3`` () = [] let ``Test ProjectForWitnesses3 GetWitnessPassingInfo`` () = - let cleanup, options = ProjectForWitnesses3.createOptions() - use _holder = cleanup + let options = ProjectForWitnesses3.createOptions() let exprChecker = FSharpChecker.Create(keepAssemblyContents=true, useTransparentCompiler=CompilerAssertHelpers.UseTransparentCompiler) let wholeProjectResults = exprChecker.ParseAndCheckProject(options) |> Async.RunImmediate @@ -3485,12 +3476,11 @@ let isNullQuoted (ts : 't[]) = """ - let createOptions() = createProjectOptions dirName [fileSource1] ["--langversion:7.0"] + let createOptions() = createProjectOptions [fileSource1] ["--langversion:7.0"] [] let ``Test ProjectForWitnesses4 GetWitnessPassingInfo`` () = - let cleanup, options = ProjectForWitnesses4.createOptions() - use _holder = cleanup + let options = ProjectForWitnesses4.createOptions() let exprChecker = FSharpChecker.Create(keepAssemblyContents=true, useTransparentCompiler=CompilerAssertHelpers.UseTransparentCompiler) let wholeProjectResults = exprChecker.ParseAndCheckProject(options) |> Async.RunImmediate @@ -3523,12 +3513,11 @@ module N.M let rec f = new System.EventHandler(fun _ _ -> f.Invoke(null,null)) """ - let createOptions() = createProjectOptions dirName [fileSource1] [] + let createOptions() = createProjectOptions [fileSource1] [] [] let ``Test NoWarn HashDirective`` () = - let cleanup, options = ProjectForNoWarnHashDirective.createOptions() - use _holder = cleanup + let options = ProjectForNoWarnHashDirective.createOptions() let exprChecker = FSharpChecker.Create(keepAssemblyContents=true, useTransparentCompiler=CompilerAssertHelpers.UseTransparentCompiler) let wholeProjectResults = exprChecker.ParseAndCheckProject(options) |> Async.RunImmediate diff --git a/tests/FSharp.Compiler.Service.Tests/GeneratedCodeSymbolsTests.fs b/tests/FSharp.Compiler.Service.Tests/GeneratedCodeSymbolsTests.fs index 66b9782fb29..5fac752952c 100644 --- a/tests/FSharp.Compiler.Service.Tests/GeneratedCodeSymbolsTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/GeneratedCodeSymbolsTests.fs @@ -5,9 +5,6 @@ open FSharp.Compiler.CodeAnalysis open FSharp.Compiler.Service.Tests.Common open FSharp.Compiler.Symbols -[] -let dirName = "GeneratedCodeSymbolsTests" - [] let ``IsUnionCaseTester for Is* member in a class`` () = let source = """ @@ -16,8 +13,7 @@ module Lib type T () = member x.IsM = 1 """ - let cleanup, options = createProjectOptions dirName [ source ] [ "--langversion:preview" ] - use _holder = cleanup + let options = createProjectOptions [ source ] [ "--langversion:preview" ] let exprChecker = FSharpChecker.Create(keepAssemblyContents=true, useTransparentCompiler=false) let wholeProjectResults = exprChecker.ParseAndCheckProject(options) |> Async.RunImmediate @@ -46,8 +42,7 @@ module Lib type T = A | B """ - let cleanup, options = createProjectOptions dirName [ source ] [ "--langversion:preview" ] - use _holder = cleanup + let options = createProjectOptions [ source ] [ "--langversion:preview" ] let exprChecker = FSharpChecker.Create(keepAssemblyContents=true, useTransparentCompiler=false) let wholeProjectResults = exprChecker.ParseAndCheckProject(options) |> Async.RunImmediate @@ -80,8 +75,7 @@ type T = member x.IsC with get () = false """ - let cleanup, options = createProjectOptions dirName [ source ] [ "--langversion:preview" ] - use _holder = cleanup + let options = createProjectOptions [ source ] [ "--langversion:preview" ] let exprChecker = FSharpChecker.Create(keepAssemblyContents=true, useTransparentCompiler=false) let wholeProjectResults = exprChecker.ParseAndCheckProject(options) |> Async.RunImmediate diff --git a/tests/FSharp.Compiler.Service.Tests/ScriptOptionsTests.fs b/tests/FSharp.Compiler.Service.Tests/ScriptOptionsTests.fs index 2d197af0398..328272defb8 100644 --- a/tests/FSharp.Compiler.Service.Tests/ScriptOptionsTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/ScriptOptionsTests.fs @@ -41,9 +41,9 @@ let ``can generate options for different frameworks regardless of execution envi [] [] let ``can resolve nuget packages to right target framework for different frameworks regardless of execution environment``(flag) = - let path = DirectoryInfo(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location)).FullName - let file = (getTemporaryFileNameInDirectory path) + ".fsx" - let scriptFullPath = Path.Combine(path, file) + let dir = DirectoryInfo(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location)) + let file = (getTemporaryFileNameInDirectory dir) + ".fsx" + let scriptFullPath = Path.Combine(dir.FullName, file) let scriptSource = """ #r "nuget: FSharp.Data, 3.3.3" open System diff --git a/tests/FSharp.Test.Utilities/CompilerAssert.fs b/tests/FSharp.Test.Utilities/CompilerAssert.fs index 202f7704a9d..5253ef16934 100644 --- a/tests/FSharp.Test.Utilities/CompilerAssert.fs +++ b/tests/FSharp.Test.Utilities/CompilerAssert.fs @@ -444,7 +444,7 @@ module CompilerAssertHelpers = let name = match nameOpt with | Some name -> name - | _ -> getTemporaryFileNameInDirectory outputDirectory.FullName + | _ -> getTemporaryFileNameInDirectory outputDirectory let outputFilePath = Path.ChangeExtension (Path.Combine(outputDirectory.FullName, name), if isExe then ".exe" else ".dll") let sources = @@ -508,7 +508,7 @@ module CompilerAssertHelpers = let compile isExe options (source:SourceCodeFileKind) f = let outputFilePath = Path.ChangeExtension (getTemporaryFileName (), if isExe then ".exe" else ".dll") - let tempDir = Path.GetDirectoryName outputFilePath + let tempDir = Directory.GetParent outputFilePath let sourceFile = match source.GetSourceText with @@ -521,10 +521,7 @@ module CompilerAssertHelpers = // On Disk file source - try - f (rawCompile outputFilePath isExe options TargetFramework.Current [sourceFile]) - finally - try Directory.Delete(tempDir, true) with | _ -> () + f (rawCompile outputFilePath isExe options TargetFramework.Current [sourceFile]) let rec compileCompilationAux outputDirectory ignoreWarnings (cmpl: Compilation) : (FSharpDiagnostic[] * exn option * string) * string list = @@ -548,7 +545,7 @@ module CompilerAssertHelpers = res, (deps @ deps2) - and evaluateReferences (outputPath:DirectoryInfo) ignoreWarnings (cmpl: Compilation) : string[] * string list = + and evaluateReferences (outputDir:DirectoryInfo) ignoreWarnings (cmpl: Compilation) : string[] * string list = match cmpl with | Compilation(_, _, _, _, cmpls, _, _) -> let compiledRefs = @@ -556,13 +553,13 @@ module CompilerAssertHelpers = |> List.map (fun cmpl -> match cmpl with | CompilationReference (cmpl, staticLink) -> - compileCompilationAux outputPath ignoreWarnings cmpl, staticLink + compileCompilationAux outputDir ignoreWarnings cmpl, staticLink | TestCompilationReference (cmpl) -> let fileName = match cmpl with | TestCompilation.CSharp c when not (String.IsNullOrWhiteSpace c.AssemblyName) -> c.AssemblyName - | _ -> getTemporaryFileNameInDirectory outputPath.FullName - let tmp = Path.Combine(outputPath.FullName, Path.ChangeExtension(fileName, ".dll")) + | _ -> getTemporaryFileNameInDirectory outputDir + let tmp = Path.Combine(outputDir.FullName, Path.ChangeExtension(fileName, ".dll")) cmpl.EmitAsFile tmp (([||], None, tmp), []), false) diff --git a/tests/FSharp.Test.Utilities/TestFramework.fs b/tests/FSharp.Test.Utilities/TestFramework.fs index ada5bf3363e..f50452eff9e 100644 --- a/tests/FSharp.Test.Utilities/TestFramework.fs +++ b/tests/FSharp.Test.Utilities/TestFramework.fs @@ -29,8 +29,10 @@ let createTemporaryDirectory () = let getTemporaryFileName () = createTemporaryDirectory().FullName ++ getShortId() -let getTemporaryFileNameInDirectory (directory: string) = - directory ++ getShortId() +let changeExtension path extension = Path.ChangeExtension(path, extension) + +let getTemporaryFileNameInDirectory (directory: DirectoryInfo) = + directory.FullName ++ getShortId() // Well, this function is AI generated. let rec copyDirectory (sourceDir: string) (destinationDir: string) (recursive: bool) = diff --git a/eng/ilverify.ps1 b/tests/ILVerify/ilverify.ps1 similarity index 80% rename from eng/ilverify.ps1 rename to tests/ILVerify/ilverify.ps1 index 3fd8f9eda64..760724c27c6 100644 --- a/eng/ilverify.ps1 +++ b/tests/ILVerify/ilverify.ps1 @@ -4,11 +4,12 @@ Write-Host "Checking whether running on Windows: $IsWindows" -[string] $repo_path = (Get-Item -Path $PSScriptRoot).Parent +[string] $repo_path = (Get-Item -Path $PSScriptRoot).Parent.Parent Write-Host "Repository path: $repo_path" [string] $script = if ($IsWindows) { Join-Path $repo_path "build.cmd" } else { Join-Path $repo_path "build.sh" } +[string] $additional_arguments = if ($IsWindows) { "-noVisualStudio" } else { "" } # Set configurations to build [string[]] $configurations = @("Debug", "Release") @@ -29,7 +30,7 @@ $projects = @{ # Run build script for each configuration (NOTE: We don't build Proto) foreach ($configuration in $configurations) { Write-Host "Building $configuration configuration..." - & $script -c $configuration + & $script -c $configuration $additional_arguments if ($LASTEXITCODE -ne 0 -And $LASTEXITCODE -ne '') { Write-Host "Build failed for $configuration configuration (last exit code: $LASTEXITCODE)." exit 1 @@ -111,14 +112,20 @@ foreach ($project in $projects.Keys) { } } - $baseline_file = Join-Path $repo_path "eng" "ilverify_${project}_${configuration}_${tfm}.bsl" + $baseline_file = Join-Path $repo_path "tests/ILVerify" "ilverify_${project}_${configuration}_${tfm}.bsl" $baseline_actual_file = [System.IO.Path]::ChangeExtension($baseline_file, 'bsl.actual') if (-not (Test-Path $baseline_file)) { Write-Host "Baseline file not found: $baseline_file" - $ilverify_output | Set-Content $baseline_actual_file - $failed = $true + if ($env:TEST_UPDATE_BSL -eq "1") { + Write-Host "Creating initial baseline file: $baseline_file" + $ilverify_output | Set-Content $baseline_file + } else { + Write-Host "Creating .actual baseline file: $baseline_actual_file" + $ilverify_output | Set-Content $baseline_actual_file + $failed = $true + } continue } @@ -127,8 +134,14 @@ foreach ($project in $projects.Keys) { if ($baseline.Length -eq 0) { Write-Host "Baseline file is empty: $baseline_file" - $ilverify_output | Set-Content $baseline_actual_file - $failed = $true + if ($env:TEST_UPDATE_BSL -eq "1") { + Write-Host "Updating empty baseline file: $baseline_file" + $ilverify_output | Set-Content $baseline_file + } else { + Write-Host "Creating initial .actual baseline file: $baseline_actual_file" + $ilverify_output | Set-Content $baseline_actual_file + $failed = $true + } continue } @@ -142,10 +155,19 @@ foreach ($project in $projects.Keys) { Write-Host "ILverify output does not match baseline, differences:" $cmp | Format-Table | Out-String | Write-Host - $ilverify_output | Set-Content $baseline_actual_file + + # Update baselines if TEST_UPDATE_BSL is set to 1 + if ($env:TEST_UPDATE_BSL -eq "1") { + Write-Host "Updating baseline file: $baseline_file" + $ilverify_output | Set-Content $baseline_file + } else { + $ilverify_output | Set-Content $baseline_actual_file + } $failed = $true continue } + + } } } @@ -155,4 +177,4 @@ if ($failed) { exit 1 } -exit 0 +exit 0 \ No newline at end of file diff --git a/eng/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl similarity index 98% rename from eng/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl rename to tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl index 527bb371db2..d59c7d2adda 100644 --- a/eng/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl @@ -21,14 +21,14 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x00000082][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x0000008B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+MagicAssemblyResolution::ResolveAssemblyCore([FSharp.Compiler.Service]Internal.Utilities.Library.CompilationThreadToken, [FSharp.Compiler.Service]FSharp.Compiler.Text.Range, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, [FSharp.Compiler.Service]FSharp.Compiler.CompilerImports+TcImports, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompiler, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiConsoleOutput, string)][offset 0x00000015][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3510-779::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001E5][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3510-791::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001E5][found Char] Unexpected type on the stack. [IL]: Error [UnmanagedPointer]: : FSharp.Compiler.Interactive.Shell+Utilities+pointerToNativeInt@110::Invoke(object)][offset 0x00000007] Unmanaged pointers are not a verifiable type. [IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+dataTipOfReferences@2205::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000084][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-491::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-491::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-491::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000082][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-491::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000008B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-491::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000094][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-504::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-504::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-504::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000082][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-504::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000008B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-504::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000094][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.StaticLinking+TypeForwarding::followTypeForwardForILTypeRef([FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.IL+ILTypeRef)][offset 0x00000010][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions::getCompilerOption([FSharp.Compiler.Service]FSharp.Compiler.CompilerOptions+CompilerOption, [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1)][offset 0x000000E6][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions::AddPathMapping([FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, string)][offset 0x0000000B][found Char] Unexpected type on the stack. diff --git a/eng/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl similarity index 98% rename from eng/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl rename to tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl index 164060143d0..be76953ef7d 100644 --- a/eng/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl @@ -28,18 +28,18 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x0000008B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+FsiStdinSyphon::GetLine(string, int32)][offset 0x00000039][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+MagicAssemblyResolution::ResolveAssemblyCore([FSharp.Compiler.Service]Internal.Utilities.Library.CompilationThreadToken, [FSharp.Compiler.Service]FSharp.Compiler.Text.Range, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, [FSharp.Compiler.Service]FSharp.Compiler.CompilerImports+TcImports, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompiler, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiConsoleOutput, string)][offset 0x00000015][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3510-779::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001E5][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3510-791::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001E5][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+FsiInteractionProcessor::CompletionsForPartialLID([FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompilerState, string)][offset 0x0000001B][found Char] Unexpected type on the stack. [IL]: Error [UnmanagedPointer]: : FSharp.Compiler.Interactive.Shell+Utilities+pointerToNativeInt@110::Invoke(object)][offset 0x00000007] Unmanaged pointers are not a verifiable type. [IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+dataTipOfReferences@2205::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000084][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseMemberFunctionAndValues@176::Invoke([FSharp.Compiler.Service]FSharp.Compiler.Symbols.FSharpMemberOrFunctionOrValue)][offset 0x00000059][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseEntity@218::GenerateNext([S.P.CoreLib]System.Collections.Generic.IEnumerable`1&)][offset 0x000000DA][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.ParsedInput+visitor@1423-6::VisitExpr([FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Compiler.Service]FSharp.Compiler.Syntax.SynExpr)][offset 0x00000605][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-491::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-491::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-491::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000082][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-491::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000008B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-491::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000094][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-504::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-504::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-504::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000082][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-504::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000008B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-504::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000094][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$Symbols+fullName@2490-1::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000015][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CreateILModule+MainModuleBuilder::ConvertProductVersionToILVersionInfo(string)][offset 0x00000011][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.StaticLinking+TypeForwarding::followTypeForwardForILTypeRef([FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.IL+ILTypeRef)][offset 0x00000010][found Char] Unexpected type on the stack. diff --git a/eng/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl similarity index 98% rename from eng/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl rename to tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl index 7de0bcd6baf..1c6248ec60a 100644 --- a/eng/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl @@ -21,13 +21,13 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x00000082][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x0000008B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+MagicAssemblyResolution::ResolveAssemblyCore([FSharp.Compiler.Service]Internal.Utilities.Library.CompilationThreadToken, [FSharp.Compiler.Service]FSharp.Compiler.Text.Range, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, [FSharp.Compiler.Service]FSharp.Compiler.CompilerImports+TcImports, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompiler, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiConsoleOutput, string)][offset 0x00000015][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3510-835::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001C7][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3510-831::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001C7][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+GetReferenceResolutionStructuredToolTipText@2205::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000076][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-528::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-528::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-528::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000064][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-528::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000006D][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-528::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000076][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-525::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-525::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-525::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000064][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-525::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000006D][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-525::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000076][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Driver+ProcessCommandLineFlags@301-1::Invoke(string)][offset 0x0000000B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Driver+ProcessCommandLineFlags@301-1::Invoke(string)][offset 0x00000014][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.StaticLinking+TypeForwarding::followTypeForwardForILTypeRef([FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.IL+ILTypeRef)][offset 0x00000010][found Char] Unexpected type on the stack. diff --git a/eng/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl similarity index 98% rename from eng/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl rename to tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl index 21b484b426d..c358adc7976 100644 --- a/eng/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl @@ -28,17 +28,17 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x0000008B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+FsiStdinSyphon::GetLine(string, int32)][offset 0x00000032][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+MagicAssemblyResolution::ResolveAssemblyCore([FSharp.Compiler.Service]Internal.Utilities.Library.CompilationThreadToken, [FSharp.Compiler.Service]FSharp.Compiler.Text.Range, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, [FSharp.Compiler.Service]FSharp.Compiler.CompilerImports+TcImports, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompiler, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiConsoleOutput, string)][offset 0x00000015][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3510-835::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001C7][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3510-831::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001C7][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+FsiInteractionProcessor::CompletionsForPartialLID([FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompilerState, string)][offset 0x00000024][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+GetReferenceResolutionStructuredToolTipText@2205::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000076][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseMemberFunctionAndValues@176::Invoke([FSharp.Compiler.Service]FSharp.Compiler.Symbols.FSharpMemberOrFunctionOrValue)][offset 0x0000002B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseEntity@218::GenerateNext([S.P.CoreLib]System.Collections.Generic.IEnumerable`1&)][offset 0x000000BB][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.ParsedInput+visitor@1423-11::VisitExpr([FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Compiler.Service]FSharp.Compiler.Syntax.SynExpr)][offset 0x00000618][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-528::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-528::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-528::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000064][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-528::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000006D][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-528::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000076][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-525::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-525::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-525::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000064][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-525::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000006D][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-525::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000076][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$Symbols+fullName@2490-3::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000030][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Driver+ProcessCommandLineFlags@301-1::Invoke(string)][offset 0x0000000B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Driver+ProcessCommandLineFlags@301-1::Invoke(string)][offset 0x00000014][found Char] Unexpected type on the stack. diff --git a/eng/ilverify_FSharp.Core_Debug_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Core_Debug_netstandard2.0.bsl similarity index 100% rename from eng/ilverify_FSharp.Core_Debug_netstandard2.0.bsl rename to tests/ILVerify/ilverify_FSharp.Core_Debug_netstandard2.0.bsl diff --git a/eng/ilverify_FSharp.Core_Debug_netstandard2.1.bsl b/tests/ILVerify/ilverify_FSharp.Core_Debug_netstandard2.1.bsl similarity index 100% rename from eng/ilverify_FSharp.Core_Debug_netstandard2.1.bsl rename to tests/ILVerify/ilverify_FSharp.Core_Debug_netstandard2.1.bsl diff --git a/eng/ilverify_FSharp.Core_Release_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Core_Release_netstandard2.0.bsl similarity index 100% rename from eng/ilverify_FSharp.Core_Release_netstandard2.0.bsl rename to tests/ILVerify/ilverify_FSharp.Core_Release_netstandard2.0.bsl diff --git a/eng/ilverify_FSharp.Core_Release_netstandard2.1.bsl b/tests/ILVerify/ilverify_FSharp.Core_Release_netstandard2.1.bsl similarity index 100% rename from eng/ilverify_FSharp.Core_Release_netstandard2.1.bsl rename to tests/ILVerify/ilverify_FSharp.Core_Release_netstandard2.1.bsl From 6a93b9976d7f98673428ab5a4e2af96e02118d33 Mon Sep 17 00:00:00 2001 From: dotnet bot Date: Thu, 12 Dec 2024 07:32:19 -0800 Subject: [PATCH 06/49] Merge main to release/dev17.13 (#18131) * Backport :: Bugfix :: Support `ldelem.u8`, `ldelem.u` opcode aliases (#18081) (#18096) * Streamlining test deps a bit (#18022) * Streamlining test deps a bit * up * Format ILVerify output a bit (#18120) * fix for race condition in FileIndex.fileIndexOfFile (#18008) * fix for race condition in FileIndex.fileIndexOfFile * fantomas * fixed ilverify baselines (just a single line number changed) * add release notes entry * FileToIndex: Added unlocked read so that lock is entered for new files only * update ilverify baselines (changed line numbers only) * Fix ILVerify --------- Co-authored-by: Petr Co-authored-by: Vlad Zarytovskii * Update F# build version to 200 * Fix how much is trimmed from an interp string part (#18123) * Fix how much is trimmed from an interp string part Only trim last 2 characters if they are "%s" and the '%' is not escaped * Add release note --------- Co-authored-by: Adam Boniecki * Sink: report SynPat.ArrayOrList type (#18127) --------- Co-authored-by: Tomas Grosup Co-authored-by: Petr Co-authored-by: Martin <29605222+Martin521@users.noreply.github.com> Co-authored-by: Vlad Zarytovskii Co-authored-by: Adam Boniecki <20281641+abonie@users.noreply.github.com> Co-authored-by: Adam Boniecki Co-authored-by: Alex Berezhnykh Co-authored-by: Kevin Ransom (msft) --- .../.FSharp.Compiler.Service/9.0.200.md | 4 +- eng/Versions.props | 2 +- src/Compiler/Checking/CheckPatterns.fs | 1 + .../Checking/Expressions/CheckExpressions.fs | 2 +- src/Compiler/Utilities/range.fs | 69 ++++++++++--------- .../BasicProvider.Tests.fsproj | 1 - .../ComboProvider.Tests.fsproj | 1 - .../FSharp.Compiler.ComponentTests.fsproj | 1 + .../Language/InterpolatedStringsTests.fs | 11 +++ .../Miscellaneous/FileIndex.fs | 21 ++++++ tests/ILVerify/ilverify.ps1 | 4 +- ...y_FSharp.Compiler.Service_Debug_net9.0.bsl | 2 +- ....Compiler.Service_Debug_netstandard2.0.bsl | 2 +- ...FSharp.Compiler.Service_Release_net9.0.bsl | 2 +- ...ompiler.Service_Release_netstandard2.0.bsl | 2 +- 15 files changed, 82 insertions(+), 43 deletions(-) create mode 100644 tests/FSharp.Compiler.ComponentTests/Miscellaneous/FileIndex.fs diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.200.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.200.md index 7c7f9652b19..33125ff07ed 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.200.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.200.md @@ -15,7 +15,8 @@ * Fix locals allocating for the special `copyOfStruct` defensive copy ([PR #18025](https://github.com/dotnet/fsharp/pull/18025)) * Fix lowering of computed array expressions when the expression consists of a simple mapping from a `uint64` or `unativeint` array. [PR #18081](https://github.com/dotnet/fsharp/pull/18081) * Add missing nullable-metadata for C# consumers of records,exceptions and DU subtypes generated from F# code. [PR #18079](https://github.com/dotnet/fsharp/pull/18079) - +* Fix a race condition in file book keeping in the compiler service ([#18008](https://github.com/dotnet/fsharp/pull/18008)) +* Fix trimming '%' characters when lowering interpolated string to a concat call [PR #18123](https://github.com/dotnet/fsharp/pull/18123) ### Added @@ -25,6 +26,7 @@ * Added type conversions cache, only enabled for compiler runs, guarded by language version preview ([PR #17668](https://github.com/dotnet/fsharp/pull/17668)) * Added project property ParallelCompilation which turns on graph based type checking, parallel ILXGen and parallel optimization. By default on for users of langversion=preview ([PR #17948](https://github.com/dotnet/fsharp/pull/17948)) * Adding warning when consuming generic method returning T|null for types not supporting nullness (structs,anons,tuples) ([PR #18057](https://github.com/dotnet/fsharp/pull/18057)) +* Sink: report SynPat.ArrayOrList type ([PR #18127](https://github.com/dotnet/fsharp/pull/18127)) ### Changed diff --git a/eng/Versions.props b/eng/Versions.props index 0245a0d620c..cd72f859965 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -184,7 +184,7 @@ 3.1.0 5.0.0-preview.7.20364.11 5.0.0-preview.7.20364.11 - 17.4.0 + 17.11.1 13.0.3 1.0.0-beta2-dev3 2.18.48 diff --git a/src/Compiler/Checking/CheckPatterns.fs b/src/Compiler/Checking/CheckPatterns.fs index 3f97cf81780..0c496517fd4 100644 --- a/src/Compiler/Checking/CheckPatterns.fs +++ b/src/Compiler/Checking/CheckPatterns.fs @@ -313,6 +313,7 @@ and TcPat warnOnUpper (cenv: cenv) env valReprInfo vFlags (patEnv: TcPatLinearEn TcPat warnOnUpper cenv env None vFlags patEnv ty p | SynPat.ArrayOrList (isArray, args, m) -> + CallExprHasTypeSink cenv.tcSink (m, env.NameEnv, ty, env.AccessRights) TcPatArrayOrList warnOnUpper cenv env vFlags patEnv ty isArray args m | SynPat.Record (flds, m) -> diff --git a/src/Compiler/Checking/Expressions/CheckExpressions.fs b/src/Compiler/Checking/Expressions/CheckExpressions.fs index b13e3d01d12..16dc49c1a61 100644 --- a/src/Compiler/Checking/Expressions/CheckExpressions.fs +++ b/src/Compiler/Checking/Expressions/CheckExpressions.fs @@ -174,7 +174,7 @@ let (|WithTrailingStringSpecifierRemoved|) (s: string) = let i = s.AsSpan(0, s.Length - 2).LastIndexOfAnyExcept '%' let diff = s.Length - 2 - i if diff &&& 1 <> 0 then - s[..i] + s[..s.Length - 3] else s else diff --git a/src/Compiler/Utilities/range.fs b/src/Compiler/Utilities/range.fs index 6d0002a97ba..09633136dbe 100755 --- a/src/Compiler/Utilities/range.fs +++ b/src/Compiler/Utilities/range.fs @@ -196,38 +196,43 @@ type FileIndexTable() = match fileToIndexTable.TryGetValue filePath with | true, idx -> idx | _ -> - - // Try again looking for a normalized entry. - let normalizedFilePath = - if normalize then - FileSystem.NormalizePathShim filePath - else - filePath - - match fileToIndexTable.TryGetValue normalizedFilePath with - | true, idx -> - // Record the non-normalized entry if necessary - if filePath <> normalizedFilePath then - lock fileToIndexTable (fun () -> fileToIndexTable[filePath] <- idx) - - // Return the index - idx - - | _ -> - lock fileToIndexTable (fun () -> - // Get the new index - let idx = indexToFileTable.Count - - // Record the normalized entry - indexToFileTable.Add normalizedFilePath - fileToIndexTable[normalizedFilePath] <- idx - - // Record the non-normalized entry if necessary - if filePath <> normalizedFilePath then - fileToIndexTable[filePath] <- idx - - // Return the index - idx) + // If a write operation can happen, we have to lock the whole read-check-write to avoid race conditions + lock fileToIndexTable + <| fun () -> + match fileToIndexTable.TryGetValue filePath with + | true, idx -> idx + | _ -> + + // Try again looking for a normalized entry. + let normalizedFilePath = + if normalize then + FileSystem.NormalizePathShim filePath + else + filePath + + match fileToIndexTable.TryGetValue normalizedFilePath with + | true, idx -> + // Record the non-normalized entry if necessary + if filePath <> normalizedFilePath then + fileToIndexTable[filePath] <- idx + + // Return the index + idx + + | _ -> + // Get the new index + let idx = indexToFileTable.Count + + // Record the normalized entry + indexToFileTable.Add normalizedFilePath + fileToIndexTable[normalizedFilePath] <- idx + + // Record the non-normalized entry if necessary + if filePath <> normalizedFilePath then + fileToIndexTable[filePath] <- idx + + // Return the index + idx member t.IndexToFile n = if n < 0 then diff --git a/tests/EndToEndBuildTests/BasicProvider/BasicProvider.Tests/BasicProvider.Tests.fsproj b/tests/EndToEndBuildTests/BasicProvider/BasicProvider.Tests/BasicProvider.Tests.fsproj index 4e4aef01856..4bc1b805799 100644 --- a/tests/EndToEndBuildTests/BasicProvider/BasicProvider.Tests/BasicProvider.Tests.fsproj +++ b/tests/EndToEndBuildTests/BasicProvider/BasicProvider.Tests/BasicProvider.Tests.fsproj @@ -21,7 +21,6 @@ content\myfiles\ - diff --git a/tests/EndToEndBuildTests/ComboProvider/ComboProvider.Tests/ComboProvider.Tests.fsproj b/tests/EndToEndBuildTests/ComboProvider/ComboProvider.Tests/ComboProvider.Tests.fsproj index d4d410bacd4..69a4cd8855d 100644 --- a/tests/EndToEndBuildTests/ComboProvider/ComboProvider.Tests/ComboProvider.Tests.fsproj +++ b/tests/EndToEndBuildTests/ComboProvider/ComboProvider.Tests/ComboProvider.Tests.fsproj @@ -18,7 +18,6 @@ - diff --git a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj index 4338fbd807b..e8f044ed2f4 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj +++ b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj @@ -317,6 +317,7 @@ + diff --git a/tests/FSharp.Compiler.ComponentTests/Language/InterpolatedStringsTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/InterpolatedStringsTests.fs index b4e2cc8eab9..e7c18f0d679 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/InterpolatedStringsTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/InterpolatedStringsTests.fs @@ -130,6 +130,17 @@ type Foo () = |> compile |> shouldSucceed + [] + let ``Percent signs and format specifiers with string expression`` () = + Fsx """ +let x = "abc" +let s = $"%%%s{x}%%" +printfn "%s" s + """ + |> compileExeAndRun + |> shouldSucceed + |> withStdOutContains "%abc%" + [] // Test different number of interpolated string parts [] diff --git a/tests/FSharp.Compiler.ComponentTests/Miscellaneous/FileIndex.fs b/tests/FSharp.Compiler.ComponentTests/Miscellaneous/FileIndex.fs new file mode 100644 index 00000000000..0d5caabb982 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Miscellaneous/FileIndex.fs @@ -0,0 +1,21 @@ +module Miscellaneous.FileIndex + +open FSharp.Compiler.Text +open System.Threading.Tasks +open Xunit + +// This is a regression test for a bug that existed in FileIndex.fileIndexOfFile +[] +let NoRaceCondition() = + let parallelOptions = ParallelOptions() + let mutable count = 10000 + while count > 0 do + let file = $"test{count}.fs" + let files = Array.create 2 file + let indices = Array.create 2 -1 + let getFileIndex i = indices[i] <- FileIndex.fileIndexOfFile files[i] + Parallel.For(0, files.Length, parallelOptions, getFileIndex) |> ignore + if indices[0] <> indices[1] then + Assert.Fail $"Found different indices: {indices[0]} and {indices[1]}" + count <- count - 1 + \ No newline at end of file diff --git a/tests/ILVerify/ilverify.ps1 b/tests/ILVerify/ilverify.ps1 index 23618d1a1b1..ab1e2d316c2 100644 --- a/tests/ILVerify/ilverify.ps1 +++ b/tests/ILVerify/ilverify.ps1 @@ -162,7 +162,7 @@ foreach ($project in $projects.Keys) { } else { Write-Host "ILverify output does not match baseline, differences:" - $cmp | Format-Table | Out-String | Write-Host + $cmp | Format-Table -AutoSize -Wrap | Out-String | Write-Host # Update baselines if TEST_UPDATE_BSL is set to 1 if ($env:TEST_UPDATE_BSL -eq "1") { @@ -185,4 +185,4 @@ if ($failed) { exit 1 } -exit 0 \ No newline at end of file +exit 0 diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl index c527d99ccf5..03328728f4c 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl @@ -59,7 +59,7 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.IL::parseILVersion(string)][offset 0x0000000B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.IL::parseILVersion(string)][offset 0x00000021][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$FSharp.Compiler.DiagnosticsLogger::.cctor()][offset 0x000000CD][found Char] Unexpected type on the stack. -[IL]: Error [CallVirtOnValueType]: : FSharp.Compiler.Text.RangeModule+comparer@543::System.Collections.Generic.IEqualityComparer.GetHashCode([FSharp.Compiler.Service]FSharp.Compiler.Text.Range)][offset 0x00000002] Callvirt on a value type method. +[IL]: Error [CallVirtOnValueType]: : FSharp.Compiler.Text.RangeModule+comparer@548::System.Collections.Generic.IEqualityComparer.GetHashCode([FSharp.Compiler.Service]FSharp.Compiler.Text.Range)][offset 0x00000002] Callvirt on a value type method. [IL]: Error [StackUnexpected]: : Internal.Utilities.PathMapModule::applyDir([FSharp.Compiler.Service]Internal.Utilities.PathMap, string)][offset 0x00000037][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Internal.Utilities.PathMapModule::applyDir([FSharp.Compiler.Service]Internal.Utilities.PathMap, string)][offset 0x00000043][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$Internal.Utilities.XmlAdapters::.cctor()][offset 0x0000000A][found Char] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl index 7d4eff968ac..a863787a54e 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl @@ -84,7 +84,7 @@ [IL]: Error [StackUnexpected]: : Internal.Utilities.FSharpEnvironment+probePathForDotnetHost@321::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000028][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.SimulatedMSBuildReferenceResolver+Pipe #6 input at line 68@68::FSharp.Compiler.CodeAnalysis.ILegacyReferenceResolver.Resolve([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyResolutionEnvironment, [S.P.CoreLib]System.Tuple`2[], string, [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, string, string, [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, string, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>>)][offset 0x0000034D][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$FSharp.Compiler.DiagnosticsLogger::.cctor()][offset 0x000000CD][found Char] Unexpected type on the stack. -[IL]: Error [CallVirtOnValueType]: : FSharp.Compiler.Text.RangeModule+comparer@543::System.Collections.Generic.IEqualityComparer.GetHashCode([FSharp.Compiler.Service]FSharp.Compiler.Text.Range)][offset 0x00000002] Callvirt on a value type method. +[IL]: Error [CallVirtOnValueType]: : FSharp.Compiler.Text.RangeModule+comparer@548::System.Collections.Generic.IEqualityComparer.GetHashCode([FSharp.Compiler.Service]FSharp.Compiler.Text.Range)][offset 0x00000002] Callvirt on a value type method. [IL]: Error [StackUnexpected]: : Internal.Utilities.PathMapModule::applyDir([FSharp.Compiler.Service]Internal.Utilities.PathMap, string)][offset 0x00000037][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Internal.Utilities.PathMapModule::applyDir([FSharp.Compiler.Service]Internal.Utilities.PathMap, string)][offset 0x00000043][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$Internal.Utilities.XmlAdapters::.cctor()][offset 0x0000000A][found Char] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl index a930478a45e..d1f7525cef2 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl @@ -85,7 +85,7 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.IL::parseILVersion(string)][offset 0x0000000B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.IL::parseILVersion(string)][offset 0x00000021][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$FSharp.Compiler.DiagnosticsLogger::.cctor()][offset 0x000000B6][found Char] Unexpected type on the stack. -[IL]: Error [CallVirtOnValueType]: : FSharp.Compiler.Text.RangeModule+comparer@543::System.Collections.Generic.IEqualityComparer.GetHashCode([FSharp.Compiler.Service]FSharp.Compiler.Text.Range)][offset 0x00000002] Callvirt on a value type method. +[IL]: Error [CallVirtOnValueType]: : FSharp.Compiler.Text.RangeModule+comparer@548::System.Collections.Generic.IEqualityComparer.GetHashCode([FSharp.Compiler.Service]FSharp.Compiler.Text.Range)][offset 0x00000002] Callvirt on a value type method. [IL]: Error [StackUnexpected]: : Internal.Utilities.PathMapModule::applyDir([FSharp.Compiler.Service]Internal.Utilities.PathMap, string)][offset 0x00000035][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Internal.Utilities.PathMapModule::applyDir([FSharp.Compiler.Service]Internal.Utilities.PathMap, string)][offset 0x00000041][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$Internal.Utilities.XmlAdapters::.cctor()][offset 0x0000000A][found Char] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl index b97ede137b1..9de22b5cd79 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl @@ -111,7 +111,7 @@ [IL]: Error [StackUnexpected]: : Internal.Utilities.FSharpEnvironment::probePathForDotnetHost@320([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x0000002A][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.SimulatedMSBuildReferenceResolver+SimulatedMSBuildResolver@68::FSharp.Compiler.CodeAnalysis.ILegacyReferenceResolver.Resolve([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyResolutionEnvironment, [S.P.CoreLib]System.Tuple`2[], string, [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, string, string, [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, string, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>>)][offset 0x000002F5][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$FSharp.Compiler.DiagnosticsLogger::.cctor()][offset 0x000000B6][found Char] Unexpected type on the stack. -[IL]: Error [CallVirtOnValueType]: : FSharp.Compiler.Text.RangeModule+comparer@543::System.Collections.Generic.IEqualityComparer.GetHashCode([FSharp.Compiler.Service]FSharp.Compiler.Text.Range)][offset 0x00000002] Callvirt on a value type method. +[IL]: Error [CallVirtOnValueType]: : FSharp.Compiler.Text.RangeModule+comparer@548::System.Collections.Generic.IEqualityComparer.GetHashCode([FSharp.Compiler.Service]FSharp.Compiler.Text.Range)][offset 0x00000002] Callvirt on a value type method. [IL]: Error [StackUnexpected]: : Internal.Utilities.PathMapModule::applyDir([FSharp.Compiler.Service]Internal.Utilities.PathMap, string)][offset 0x00000035][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Internal.Utilities.PathMapModule::applyDir([FSharp.Compiler.Service]Internal.Utilities.PathMap, string)][offset 0x00000041][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$Internal.Utilities.XmlAdapters::.cctor()][offset 0x0000000A][found Char] Unexpected type on the stack. From 9ac324d1dddc724beae75dd11a933b2212fcf975 Mon Sep 17 00:00:00 2001 From: Edgar Gonzalez Date: Thu, 9 Jan 2025 12:26:48 +0000 Subject: [PATCH 07/49] Show obsolete warnings/errors when used with unit of measure (#18182) --- .../.FSharp.Compiler.Service/9.0.200.md | 1 + src/Compiler/Checking/AttributeChecking.fs | 22 +- src/Compiler/Checking/AttributeChecking.fsi | 2 + src/Compiler/Checking/CheckDeclarations.fs | 13 +- src/Compiler/Checking/CheckPatterns.fs | 2 +- src/Compiler/Checking/ConstraintSolver.fs | 29 +- .../Checking/Expressions/CheckExpressions.fs | 69 ++-- .../Checking/Expressions/CheckExpressions.fsi | 1 - src/Compiler/Checking/TypeRelations.fs | 6 +- src/Compiler/Checking/import.fs | 14 +- src/Compiler/Service/ItemKey.fs | 2 +- src/Compiler/Symbols/Exprs.fs | 3 +- src/Compiler/Symbols/Symbols.fs | 14 +- src/Compiler/SyntaxTree/SyntaxTree.fs | 12 + src/Compiler/SyntaxTree/SyntaxTree.fsi | 2 + src/Compiler/TypedTree/TypedTree.fs | 17 +- src/Compiler/TypedTree/TypedTree.fsi | 8 +- src/Compiler/TypedTree/TypedTreeOps.fs | 82 +++-- src/Compiler/TypedTree/TypedTreeOps.fsi | 2 + src/Compiler/TypedTree/TypedTreePickle.fs | 18 +- .../ObsoleteAttributeCheckingTests.fs | 345 +++++++++++++++++- ...ervice.SurfaceArea.netstandard20.debug.bsl | 2 + ...vice.SurfaceArea.netstandard20.release.bsl | 2 + 23 files changed, 554 insertions(+), 114 deletions(-) diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.200.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.200.md index b9046b9f446..8edf6f814d1 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.200.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.200.md @@ -21,6 +21,7 @@ * Completion: fix qualified completion in sequence expressions [PR #18111](https://github.com/dotnet/fsharp/pull/18111) * Symbols: try to use ValReprInfoForDisplay in Mfv.CurriedParameterGroups ([PR #18124](https://github.com/dotnet/fsharp/pull/18124)) * Shim/file system: fix leaks of the shim [PR #18144](https://github.com/dotnet/fsharp/pull/18144) +* Fix for `Obsolete` attribute warning/error not taken into account when used with a unit of measure [PR #18182](https://github.com/dotnet/fsharp/pull/18182) ### Added diff --git a/src/Compiler/Checking/AttributeChecking.fs b/src/Compiler/Checking/AttributeChecking.fs index 8ef659ac20e..563af942829 100644 --- a/src/Compiler/Checking/AttributeChecking.fs +++ b/src/Compiler/Checking/AttributeChecking.fs @@ -417,7 +417,27 @@ let CheckEntityAttributes g (tcref: TyconRef) m = CheckFSharpAttributes g tcref.Attribs m let CheckILEventAttributes g (tcref: TyconRef) cattrs m = - CheckILAttributes g (isByrefLikeTyconRef g m tcref) cattrs m + CheckILAttributes g (isByrefLikeTyconRef g m tcref) cattrs m + +let CheckUnitOfMeasureAttributes g (measure: Measure) = + let checkAttribs tm m = + let attribs = + ListMeasureConOccsWithNonZeroExponents g true tm + |> List.map fst + |> List.map(_.Attribs) + |> List.concat + + CheckFSharpAttributes g attribs m |> CommitOperationResult + + match measure with + | Measure.Const(range = m) -> checkAttribs measure m + | Measure.Inv ms -> checkAttribs measure ms.Range + | Measure.One(m) -> checkAttribs measure m + | Measure.RationalPower(measure = ms1) -> checkAttribs measure ms1.Range + | Measure.Prod(measure1= ms1; measure2= ms2) -> + checkAttribs ms1 ms1.Range + checkAttribs ms2 ms2.Range + | Measure.Var(typar) -> checkAttribs measure typar.Range /// Check the attributes associated with a method, returning warnings and errors as data. let CheckMethInfoAttributes g m tyargsOpt (minfo: MethInfo) = diff --git a/src/Compiler/Checking/AttributeChecking.fsi b/src/Compiler/Checking/AttributeChecking.fsi index b4a608ef1d1..663198f9247 100644 --- a/src/Compiler/Checking/AttributeChecking.fsi +++ b/src/Compiler/Checking/AttributeChecking.fsi @@ -89,6 +89,8 @@ val CheckEntityAttributes: g: TcGlobals -> tcref: TyconRef -> m: range -> Operat val CheckUnionCaseAttributes: g: TcGlobals -> x: UnionCaseRef -> m: range -> OperationResult +val CheckUnitOfMeasureAttributes: g: TcGlobals -> measure: Measure -> unit + val CheckRecdFieldAttributes: g: TcGlobals -> x: RecdFieldRef -> m: range -> OperationResult val CheckValAttributes: g: TcGlobals -> x: ValRef -> m: range -> OperationResult diff --git a/src/Compiler/Checking/CheckDeclarations.fs b/src/Compiler/Checking/CheckDeclarations.fs index bec5c9d9966..23c547b36b8 100644 --- a/src/Compiler/Checking/CheckDeclarations.fs +++ b/src/Compiler/Checking/CheckDeclarations.fs @@ -3241,6 +3241,13 @@ module EstablishTypeDefinitionCores = warning(Error(FSComp.SR.chkAttributeAliased(attrib.TypeRef.FullName), tycon.Id.idRange)) | _ -> () + // Check for attributes in unit-of-measure declarations + // [] type x = 1 + // ^ + match stripTyEqns g ty with + | TType_measure tm -> CheckUnitOfMeasureAttributes g tm + | _ -> () + checkAttributeAliased ty tycon g.attrib_AutoOpenAttribute checkAttributeAliased ty tycon g.attrib_StructAttribute @@ -3807,11 +3814,11 @@ module EstablishTypeDefinitionCores = and accInMeasure measureTy acc = match stripUnitEqns measureTy with - | Measure.Const tcref when ListSet.contains (===) tcref.Deref tycons -> + | Measure.Const(tyconRef= tcref) when ListSet.contains (===) tcref.Deref tycons -> (tycon, tcref.Deref) :: acc - | Measure.Const tcref when tcref.IsTypeAbbrev -> + | Measure.Const(tyconRef= tcref) when tcref.IsTypeAbbrev -> accInMeasure (reduceTyconRefAbbrevMeasureable tcref) acc - | Measure.Prod (ms1, ms2) -> accInMeasure ms1 (accInMeasure ms2 acc) + | Measure.Prod(measure1= ms1; measure2= ms2) -> accInMeasure ms1 (accInMeasure ms2 acc) | Measure.Inv invTy -> accInMeasure invTy acc | _ -> acc diff --git a/src/Compiler/Checking/CheckPatterns.fs b/src/Compiler/Checking/CheckPatterns.fs index 487c66b0c8c..5d447da6021 100644 --- a/src/Compiler/Checking/CheckPatterns.fs +++ b/src/Compiler/Checking/CheckPatterns.fs @@ -803,7 +803,7 @@ and TcPatLongIdentLiteral warnOnUpper (cenv: cenv) env vFlags patEnv ty (mLongId match vref.LiteralValue with | None -> error (Error(FSComp.SR.tcNonLiteralCannotBeUsedInPattern(), m)) | Some lit -> - let _, _, _, vexpty, _, _ = TcVal true cenv env tpenv vref None None mLongId + let _, _, _, vexpty, _, _ = TcVal cenv env tpenv vref None None mLongId CheckValAccessible mLongId env.AccessRights vref CheckFSharpAttributes g vref.Attribs mLongId |> CommitOperationResult CheckNoArgsForLiteral args m diff --git a/src/Compiler/Checking/ConstraintSolver.fs b/src/Compiler/Checking/ConstraintSolver.fs index 8be7ec551ea..82141080743 100644 --- a/src/Compiler/Checking/ConstraintSolver.fs +++ b/src/Compiler/Checking/ConstraintSolver.fs @@ -42,6 +42,7 @@ module internal FSharp.Compiler.ConstraintSolver +open FSharp.Compiler.Text.Range open Internal.Utilities.Collections open Internal.Utilities.Library open Internal.Utilities.Library.Extras @@ -734,7 +735,7 @@ let SubstMeasureWarnIfRigid (csenv: ConstraintSolverEnv) trace (v: Typar) ms = // Propagate static requirements from 'tp' to 'ty' do! SolveTypStaticReq csenv trace v.StaticReq (TType_measure ms) SubstMeasure v ms - if v.Rigidity = TyparRigidity.Anon && measureEquiv csenv.g ms Measure.One then + if v.Rigidity = TyparRigidity.Anon && measureEquiv csenv.g ms (Measure.One ms.Range) then return! WarnD(Error(FSComp.SR.csCodeLessGeneric(), v.Range)) else () @@ -760,17 +761,17 @@ let UnifyMeasureWithOne (csenv: ConstraintSolverEnv) trace ms = match FindPreferredTypar nonRigidVars with | (v, e) :: vs -> let unexpandedCons = ListMeasureConOccsWithNonZeroExponents csenv.g false ms - let newms = ProdMeasures (List.map (fun (c, e') -> Measure.RationalPower (Measure.Const c, NegRational (DivRational e' e))) unexpandedCons + let newms = ProdMeasures (List.map (fun (c, e') -> Measure.RationalPower(Measure.Const(c, ms.Range), NegRational (DivRational e' e))) unexpandedCons @ List.map (fun (v, e') -> Measure.RationalPower (Measure.Var v, NegRational (DivRational e' e))) (vs @ rigidVars)) SubstMeasureWarnIfRigid csenv trace v newms // Otherwise we require ms to be 1 - | [] -> if measureEquiv csenv.g ms Measure.One then CompleteD else localAbortD + | [] -> if measureEquiv csenv.g ms (Measure.One ms.Range) then CompleteD else localAbortD /// Imperatively unify unit-of-measure expression ms1 against ms2 let UnifyMeasures (csenv: ConstraintSolverEnv) trace ms1 ms2 = - UnifyMeasureWithOne csenv trace (Measure.Prod(ms1, Measure.Inv ms2)) + UnifyMeasureWithOne csenv trace (Measure.Prod(ms1, Measure.Inv ms2, (unionRanges ms1.Range ms2.Range))) /// Simplify a unit-of-measure expression ms that forms part of a type scheme. /// We make substitutions for vars, which are the (remaining) bound variables @@ -791,7 +792,7 @@ let SimplifyMeasure g vars ms = let newms = ProdMeasures [ for (c, e') in nonZeroCon do - Measure.RationalPower (Measure.Const c, NegRational (DivRational e' e)) + Measure.RationalPower (Measure.Const(c, ms.Range), NegRational (DivRational e' e)) for (v', e') in nonZeroVar do if typarEq v v' then newvarExpr @@ -1329,13 +1330,13 @@ and SolveTypeEqualsType (csenv: ConstraintSolverEnv) ndeep m2 (trace: OptionalTr // Catch float<_>=float<1>, float32<_>=float32<1> and decimal<_>=decimal<1> | (_, TType_app (tc2, [ms2], _)) when (tc2.IsMeasureableReprTycon && typeEquiv csenv.g sty1 (reduceTyconRefMeasureableOrProvided csenv.g tc2 [ms2])) -> trackErrors { - do! SolveTypeEqualsType csenv ndeep m2 trace None (TType_measure Measure.One) ms2 + do! SolveTypeEqualsType csenv ndeep m2 trace None (TType_measure(Measure.One m2)) ms2 do! SolveNullnessEquiv csenv m2 trace ty1 ty2 (nullnessOfTy g sty1) (nullnessOfTy g sty2) } | (TType_app (tc1, [ms1], _), _) when (tc1.IsMeasureableReprTycon && typeEquiv csenv.g sty2 (reduceTyconRefMeasureableOrProvided csenv.g tc1 [ms1])) -> trackErrors { - do! SolveTypeEqualsType csenv ndeep m2 trace None ms1 (TType_measure Measure.One) + do! SolveTypeEqualsType csenv ndeep m2 trace None ms1 (TType_measure(Measure.One m2)) do! SolveNullnessEquiv csenv m2 trace ty1 ty2 (nullnessOfTy g sty1) (nullnessOfTy g sty2) } @@ -1518,13 +1519,13 @@ and SolveTypeSubsumesType (csenv: ConstraintSolverEnv) ndeep m2 (trace: Optional // Enforce the identities float=float<1>, float32=float32<1> and decimal=decimal<1> | _, TType_app (tc2, [ms2], _) when tc2.IsMeasureableReprTycon && typeEquiv csenv.g sty1 (reduceTyconRefMeasureableOrProvided csenv.g tc2 [ms2]) -> trackErrors { - do! SolveTypeEqualsTypeKeepAbbrevsWithCxsln csenv ndeep m2 trace cxsln ms2 (TType_measure Measure.One) + do! SolveTypeEqualsTypeKeepAbbrevsWithCxsln csenv ndeep m2 trace cxsln ms2 (TType_measure(Measure.One m2)) do! SolveNullnessSubsumesNullness csenv m2 trace ty1 ty2 (nullnessOfTy g sty1) (nullnessOfTy g sty2) } | TType_app (tc1, [ms1], _), _ when tc1.IsMeasureableReprTycon && typeEquiv csenv.g sty2 (reduceTyconRefMeasureableOrProvided csenv.g tc1 [ms1]) -> trackErrors { - do! SolveTypeEqualsTypeKeepAbbrevsWithCxsln csenv ndeep m2 trace cxsln ms1 (TType_measure Measure.One) + do! SolveTypeEqualsTypeKeepAbbrevsWithCxsln csenv ndeep m2 trace cxsln ms1 (TType_measure(Measure.One m2)) do! SolveNullnessSubsumesNullness csenv m2 trace ty1 ty2 (nullnessOfTy g sty1) (nullnessOfTy g sty2) } @@ -1620,7 +1621,7 @@ and DepthCheck ndeep m = and SolveDimensionlessNumericType (csenv: ConstraintSolverEnv) ndeep m2 trace ty = match getMeasureOfType csenv.g ty with | Some (tcref, _) -> - SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace ty (mkWoNullAppTy tcref [TType_measure Measure.One]) + SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace ty (mkWoNullAppTy tcref [TType_measure(Measure.One m2)]) | None -> CompleteD @@ -1727,7 +1728,7 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload | Some (tcref, ms1) -> let ms2 = freshMeasure () do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argTy2 (mkWoNullAppTy tcref [TType_measure ms2]) - do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace retTy (mkWoNullAppTy tcref [TType_measure (Measure.Prod(ms1, if nm = "op_Multiply" then ms2 else Measure.Inv ms2))]) + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace retTy (mkWoNullAppTy tcref [TType_measure (Measure.Prod(ms1, (if nm = "op_Multiply" then ms2 else Measure.Inv ms2), unionRanges ms1.Range ms2.Range))]) return TTraitBuiltIn | _ -> @@ -1736,7 +1737,7 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload | Some (tcref, ms2) -> let ms1 = freshMeasure () do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argTy1 (mkWoNullAppTy tcref [TType_measure ms1]) - do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace retTy (mkWoNullAppTy tcref [TType_measure (Measure.Prod(ms1, if nm = "op_Multiply" then ms2 else Measure.Inv ms2))]) + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace retTy (mkWoNullAppTy tcref [TType_measure (Measure.Prod(ms1, (if nm = "op_Multiply" then ms2 else Measure.Inv ms2), unionRanges ms1.Range ms2.Range))]) return TTraitBuiltIn | _ -> @@ -1870,7 +1871,7 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload match getMeasureOfType g argTy1 with | Some (tcref, _) -> let ms1 = freshMeasure () - do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argTy1 (mkWoNullAppTy tcref [TType_measure (Measure.Prod (ms1, ms1))]) + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argTy1 (mkWoNullAppTy tcref [TType_measure (Measure.Prod (ms1, ms1, ms1.Range))]) do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace retTy (mkWoNullAppTy tcref [TType_measure ms1]) return TTraitBuiltIn | None -> @@ -1923,7 +1924,7 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argTy2 argTy1 match getMeasureOfType g argTy1 with | None -> do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace retTy argTy1 - | Some (tcref, _) -> do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace retTy (mkWoNullAppTy tcref [TType_measure Measure.One]) + | Some (tcref, ms) -> do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace retTy (mkWoNullAppTy tcref [TType_measure(Measure.One ms.Range)]) return TTraitBuiltIn | _ -> diff --git a/src/Compiler/Checking/Expressions/CheckExpressions.fs b/src/Compiler/Checking/Expressions/CheckExpressions.fs index 16dc49c1a61..9987f02759c 100644 --- a/src/Compiler/Checking/Expressions/CheckExpressions.fs +++ b/src/Compiler/Checking/Expressions/CheckExpressions.fs @@ -798,27 +798,28 @@ let TcConst (cenv: cenv) (overallTy: TType) m env synConst = let g = cenv.g let rec tcMeasure ms = match ms with - | SynMeasure.One _ -> Measure.One + | SynMeasure.One m -> Measure.One m | SynMeasure.Named(tc, m) -> let ad = env.eAccessRights let _, tcref, _ = ForceRaise(ResolveTypeLongIdent cenv.tcSink cenv.nameResolver ItemOccurrence.Use OpenQualified env.eNameResEnv ad tc TypeNameResolutionStaticArgsInfo.DefiniteEmpty PermitDirectReferenceToGeneratedType.No) match tcref.TypeOrMeasureKind with | TyparKind.Type -> error(Error(FSComp.SR.tcExpectedUnitOfMeasureNotType(), m)) - | TyparKind.Measure -> Measure.Const tcref + | TyparKind.Measure -> Measure.Const(tcref, ms.Range) | SynMeasure.Power(measure = ms; power = exponent) -> Measure.RationalPower (tcMeasure ms, TcSynRationalConst exponent) - | SynMeasure.Product(measure1 = ms1; measure2 = ms2) -> Measure.Prod(tcMeasure ms1, tcMeasure ms2) + | SynMeasure.Product(measure1 = ms1; measure2 = ms2; range= m) -> + Measure.Prod(tcMeasure ms1, tcMeasure ms2, m) | SynMeasure.Divide(ms1, _, (SynMeasure.Seq (_ :: _ :: _, _) as ms2), m) -> warning(Error(FSComp.SR.tcImplicitMeasureFollowingSlash(), m)) let factor1 = ms1 |> Option.defaultValue (SynMeasure.One Range.Zero) - Measure.Prod(tcMeasure factor1, Measure.Inv (tcMeasure ms2)) - | SynMeasure.Divide(measure1 = ms1; measure2 = ms2) -> + Measure.Prod(tcMeasure factor1, Measure.Inv (tcMeasure ms2), ms.Range) + | SynMeasure.Divide(measure1 = ms1; measure2 = ms2; range= m) -> let factor1 = ms1 |> Option.defaultValue (SynMeasure.One Range.Zero) - Measure.Prod(tcMeasure factor1, Measure.Inv (tcMeasure ms2)) + Measure.Prod(tcMeasure factor1, Measure.Inv (tcMeasure ms2), ms.Range) | SynMeasure.Seq(mss, _) -> ProdMeasures (List.map tcMeasure mss) | SynMeasure.Anon _ -> error(Error(FSComp.SR.tcUnexpectedMeasureAnon(), m)) - | SynMeasure.Var(_, m) -> error(Error(FSComp.SR.tcNonZeroConstantCannotHaveGenericUnit(), m)) - | SynMeasure.Paren(measure, _) -> tcMeasure measure + | SynMeasure.Var(range= m) -> error(Error(FSComp.SR.tcNonZeroConstantCannotHaveGenericUnit(), m)) + | SynMeasure.Paren(measure= measure) -> tcMeasure measure let unif expectedTy = UnifyTypes cenv env m overallTy expectedTy @@ -829,7 +830,7 @@ let TcConst (cenv: cenv) (overallTy: TType) m env synConst = (mkWoNullAppTy tcr [TType_measure (Measure.Var (NewAnonTypar (TyparKind.Measure, m, TyparRigidity.Anon, (if iszero then TyparStaticReq.None else TyparStaticReq.HeadType), TyparDynamicReq.No)))]) | SynConst.Measure(synMeasure = ms) -> mkWoNullAppTy tcr [TType_measure (tcMeasure ms)] - | _ -> mkWoNullAppTy tcr [TType_measure Measure.One] + | _ -> mkWoNullAppTy tcr [TType_measure(Measure.One m)] unif measureTy let expandedMeasurablesEnabled = @@ -2739,7 +2740,7 @@ let TcValEarlyGeneralizationConsistencyCheck (cenv: cenv) (env: TcEnv) (v: Val, /// instantiationInfoOpt is is also set when building the final call for a reference to an /// F# object model member, in which case the instantiationInfoOpt is the type instantiation /// inferred by member overload resolution. -let TcVal checkAttributes (cenv: cenv) env (tpenv: UnscopedTyparEnv) (vref: ValRef) instantiationInfoOpt optAfterResolution m = +let TcVal (cenv: cenv) env (tpenv: UnscopedTyparEnv) (vref: ValRef) instantiationInfoOpt optAfterResolution m = let g = cenv.g let tpsorig, _, _, _, tinst, _ as res = @@ -2749,8 +2750,7 @@ let TcVal checkAttributes (cenv: cenv) env (tpenv: UnscopedTyparEnv) (vref: ValR CheckValAccessible m env.eAccessRights vref - if checkAttributes then - CheckValAttributes g vref m |> CommitOperationResult + CheckValAttributes g vref m |> CommitOperationResult let vTy = vref.Type @@ -3046,7 +3046,7 @@ let BuildPossiblyConditionalMethodCall (cenv: cenv) env isMutable m isProp minfo | _ -> #endif let tcVal valref valUse ttypes m = - let _, exprForVal, _, tau, _, _ = TcVal true cenv env emptyUnscopedTyparEnv valref (Some (valUse, (fun x _ -> ttypes, x))) None m + let _, exprForVal, _, tau, _, _ = TcVal cenv env emptyUnscopedTyparEnv valref (Some (valUse, (fun x _ -> ttypes, x))) None m exprForVal, tau BuildMethodCall tcVal g cenv.amap isMutable m isProp minfo valUseFlags minst objArgs args staticTyOpt @@ -4550,7 +4550,7 @@ and TcLongIdentType kindOpt (cenv: cenv) newOk checkConstraints occ iwsam env tp error(Error(FSComp.SR.tcExpectedUnitOfMeasureNotType(), m)) TType_measure (NewErrorMeasure ()), tpenv | _, TyparKind.Measure -> - TType_measure (Measure.Const tcref), tpenv + TType_measure (Measure.Const(tcref, m)), tpenv | _, TyparKind.Type -> TcTypeApp cenv newOk checkConstraints occ env tpenv m tcref tinstEnclosing [] inst @@ -4585,7 +4585,7 @@ and TcLongIdentAppType kindOpt (cenv: cenv) newOk checkConstraints occ iwsam env match args, postfix with | [arg], true -> let ms, tpenv = TcMeasure cenv newOk checkConstraints occ env tpenv arg m - TType_measure (Measure.Prod(Measure.Const tcref, ms)), tpenv + TType_measure (Measure.Prod(Measure.Const(tcref, tcref.Range), ms, ms.Range)), tpenv | _, _ -> errorR(Error(FSComp.SR.tcUnitsOfMeasureInvalidInTypeConstructor(), m)) @@ -4715,7 +4715,7 @@ and TcTypeStaticConstant kindOpt tpenv c m = errorR(Error(FSComp.SR.parsInvalidLiteralInType(), m)) NewErrorType (), tpenv | SynConst.Int32 1, _ -> - TType_measure Measure.One, tpenv + TType_measure (Measure.One m), tpenv | _ -> errorR(Error(FSComp.SR.parsInvalidLiteralInType(), m)) NewErrorType (), tpenv @@ -4736,7 +4736,7 @@ and TcTypeMeasureApp kindOpt (cenv: cenv) newOk checkConstraints occ env tpenv a | (None | Some TyparKind.Measure), [arg2], true -> let ms1, tpenv = TcMeasure cenv newOk checkConstraints occ env tpenv arg1 m1 let ms2, tpenv = TcMeasure cenv newOk checkConstraints occ env tpenv arg2 m - TType_measure (Measure.Prod(ms1, ms2)), tpenv + TType_measure (Measure.Prod(ms1, ms2, unionRanges ms1.Range ms2.Range)), tpenv | _ -> errorR(Error(FSComp.SR.tcTypeParameterInvalidAsTypeConstructor(), m)) @@ -4810,12 +4810,13 @@ and TcMeasuresAsTuple (cenv: cenv) newOk checkConstraints occ env (tpenv: Unscop gather args tpenv ms1 | SynTupleTypeSegment.Star _ :: SynTupleTypeSegment.Type ty :: args -> let ms1, tpenv = TcMeasure cenv newOk checkConstraints occ env tpenv ty m - gather args tpenv (Measure.Prod(acc, ms1)) + gather args tpenv (Measure.Prod(acc, ms1, unionRanges acc.Range ms1.Range)) | SynTupleTypeSegment.Slash _ :: SynTupleTypeSegment.Type ty :: args -> let ms1, tpenv = TcMeasure cenv newOk checkConstraints occ env tpenv ty m - gather args tpenv (Measure.Prod(acc, Measure.Inv ms1)) + let ms2 = Measure.Inv ms1 + gather args tpenv (Measure.Prod(acc, ms2, unionRanges acc.Range ms2.Range)) | _ -> failwith "impossible" - gather args tpenv Measure.One + gather args tpenv (Measure.One m) and TcTypesOrMeasures optKinds (cenv: cenv) newOk checkConstraints occ env tpenv args m = match optKinds with @@ -4823,7 +4824,15 @@ and TcTypesOrMeasures optKinds (cenv: cenv) newOk checkConstraints occ env tpenv List.mapFold (TcTypeOrMeasure None cenv newOk checkConstraints occ WarnOnIWSAM.Yes env) tpenv args | Some kinds -> if List.length kinds = List.length args then - List.mapFold (fun tpenv (arg, kind) -> TcTypeOrMeasure (Some kind) cenv newOk checkConstraints occ WarnOnIWSAM.Yes env tpenv arg) tpenv (List.zip args kinds) + let ttypes, tpenv = List.mapFold (fun tpenv (arg, kind) -> TcTypeOrMeasure (Some kind) cenv newOk checkConstraints occ WarnOnIWSAM.Yes env tpenv arg) tpenv (List.zip args kinds) + + for ttype in ttypes do + match stripTyEqns cenv.g ttype with + | TType_measure tm -> CheckUnitOfMeasureAttributes cenv.g tm + | _ -> () + + ttypes, tpenv + elif isNil kinds then error(Error(FSComp.SR.tcUnexpectedTypeArguments(), m)) else error(Error(FSComp.SR.tcTypeParameterArityMismatch((List.length kinds), (List.length args)), m)) @@ -5077,7 +5086,7 @@ and TcTypeOrMeasureAndRecover kindOpt (cenv: cenv) newOk checkConstraints occ iw let recoveryTy = match kindOpt, newOk with - | Some TyparKind.Measure, NoNewTypars -> TType_measure Measure.One + | Some TyparKind.Measure, NoNewTypars -> TType_measure(Measure.One ty.Range) | Some TyparKind.Measure, _ -> TType_measure (NewErrorMeasure ()) | _, NoNewTypars -> g.obj_ty_ambivalent | _ -> NewErrorType () @@ -5163,7 +5172,7 @@ and TcPatLongIdentActivePatternCase warnOnUpper (cenv: cenv) (env: TcEnv) vFlags CallNameResolutionSink cenv.tcSink (mLongId, env.NameEnv, item, emptyTyparInst, ItemOccurrence.Pattern, env.eAccessRights) // TOTAL/PARTIAL ACTIVE PATTERNS - let _, vExpr, _, _, tinst, _ = TcVal true cenv env tpenv vref None None m + let _, vExpr, _, _, tinst, _ = TcVal cenv env tpenv vref None None m let vExpr = MakeApplicableExprWithFlex cenv env vExpr let vExprTy = vExpr.Type @@ -7673,6 +7682,14 @@ and TcConstExpr cenv (overallTy: OverallTy) env m tpenv c = TcNonPropagatingExprLeafThenConvert cenv overallTy env m (fun () -> let cTy = NewInferenceType g let c' = TcConst cenv cTy m env c + let rec checkAttributeInMeasure ty = + match stripTyEqns g ty with + | TType_app(typeInstantiation= ttypes) -> ttypes |> List.iter checkAttributeInMeasure + | TType_fun(rangeType= rangeType) -> checkAttributeInMeasure rangeType + | TType_measure tm -> CheckUnitOfMeasureAttributes g tm + | _ -> () + + checkAttributeInMeasure cTy Expr.Const (c', m, cTy), cTy, tpenv) //------------------------------------------------------------------------- @@ -9258,7 +9275,7 @@ and TcValueItemThen cenv overallTy env vref tpenv mItem afterResolution delayed error (Error(FSComp.SR.expressionHasNoName(), mExprAndTypeArgs)) | _ -> let checkTys tpenv kinds = TcTypesOrMeasures (Some kinds) cenv NewTyparsOK CheckCxs ItemOccurrence.UseInType env tpenv tys mItem - let _, vExpr, isSpecial, _, _, tpenv = TcVal true cenv env tpenv vref (Some (NormalValUse, checkTys)) (Some afterResolution) mItem + let _, vExpr, isSpecial, _, _, tpenv = TcVal cenv env tpenv vref (Some (NormalValUse, checkTys)) (Some afterResolution) mItem let vexpFlex = (if isSpecial then MakeApplicableExprNoFlex cenv vExpr else MakeApplicableExprWithFlex cenv env vExpr) // We need to eventually record the type resolution for an expression, but this is done @@ -9267,7 +9284,7 @@ and TcValueItemThen cenv overallTy env vref tpenv mItem afterResolution delayed // Value get | _ -> - let _, vExpr, isSpecial, _, _, tpenv = TcVal true cenv env tpenv vref None (Some afterResolution) mItem + let _, vExpr, isSpecial, _, _, tpenv = TcVal cenv env tpenv vref None (Some afterResolution) mItem let vExpr, tpenv = match vExpr with @@ -11155,7 +11172,7 @@ and TcNormalizedBinding declKind (cenv: cenv) env tpenv overallTy safeThisValOpt let supportEnforceAttributeTargets = (g.langVersion.SupportsFeature(LanguageFeature.EnforceAttributeTargets) && memberFlagsOpt.IsNone && not attrs.IsEmpty) - && not isVolatile // // VolatileFieldAttribute has a special treatment(specific error FS823) + && not isVolatile // VolatileFieldAttribute has a special treatment(specific error FS823) if supportEnforceAttributeTargets then TcAttributeTargetsOnLetBindings { cenv with tcSink = TcResultsSink.NoSink } env attrs overallPatTy overallExprTy (not declaredTypars.IsEmpty) isClassLetBinding diff --git a/src/Compiler/Checking/Expressions/CheckExpressions.fsi b/src/Compiler/Checking/Expressions/CheckExpressions.fsi index 0e4e17a8f83..ed18b07a58a 100644 --- a/src/Compiler/Checking/Expressions/CheckExpressions.fsi +++ b/src/Compiler/Checking/Expressions/CheckExpressions.fsi @@ -919,7 +919,6 @@ val TcPatLongIdentActivePatternCase: val ConvSynPatToSynExpr: synPat: SynPat -> SynExpr val TcVal: - checkAttributes: bool -> cenv: TcFileState -> env: TcEnv -> tpenv: UnscopedTyparEnv -> diff --git a/src/Compiler/Checking/TypeRelations.fs b/src/Compiler/Checking/TypeRelations.fs index 6c38b68d80a..d180bb778dd 100644 --- a/src/Compiler/Checking/TypeRelations.fs +++ b/src/Compiler/Checking/TypeRelations.fs @@ -176,7 +176,7 @@ let ChooseTyparSolutionAndRange (g: TcGlobals) amap (tp:Typar) = let initialTy = match tp.Kind with | TyparKind.Type -> g.obj_ty_noNulls - | TyparKind.Measure -> TType_measure Measure.One + | TyparKind.Measure -> TType_measure(Measure.One m) // Loop through the constraints computing the lub (((initialTy, false), m), tp.Constraints) ||> List.fold (fun ((maxTy, isRefined), _) tpc -> let join m x = @@ -226,8 +226,8 @@ let ChooseTyparSolutionAndRange (g: TcGlobals) amap (tp:Typar) = maxTy, m let ChooseTyparSolution g amap tp = - let ty, _m = ChooseTyparSolutionAndRange g amap tp - if tp.Rigidity = TyparRigidity.Anon && typeEquiv g ty (TType_measure Measure.One) then + let ty, m = ChooseTyparSolutionAndRange g amap tp + if tp.Rigidity = TyparRigidity.Anon && typeEquiv g ty (TType_measure(Measure.One m)) then warning(Error(FSComp.SR.csCodeLessGeneric(), tp.Range)) ty diff --git a/src/Compiler/Checking/import.fs b/src/Compiler/Checking/import.fs index a1deee1c8a1..c40fd73b234 100644 --- a/src/Compiler/Checking/import.fs +++ b/src/Compiler/Checking/import.fs @@ -6,6 +6,7 @@ module internal FSharp.Compiler.Import open System.Collections.Concurrent open System.Collections.Generic open System.Collections.Immutable +open FSharp.Compiler.Text.Range open Internal.Utilities.Library open Internal.Utilities.Library.Extras open Internal.Utilities.TypeHashing @@ -553,16 +554,19 @@ let rec ImportProvidedType (env: ImportMap) (m: range) (* (tinst: TypeInst) *) ( if tp.Kind = TyparKind.Measure then let rec conv ty = match ty with - | TType_app (tcref, [ty1;ty2], _) when tyconRefEq g tcref g.measureproduct_tcr -> Measure.Prod (conv ty1, conv ty2) + | TType_app (tcref, [ty1;ty2], _) when tyconRefEq g tcref g.measureproduct_tcr -> + let ms1: Measure = conv ty1 + let ms2: Measure = conv ty2 + Measure.Prod(ms1, ms2, unionRanges ms1.Range ms2.Range) | TType_app (tcref, [ty1], _) when tyconRefEq g tcref g.measureinverse_tcr -> Measure.Inv (conv ty1) - | TType_app (tcref, [], _) when tyconRefEq g tcref g.measureone_tcr -> Measure.One - | TType_app (tcref, [], _) when tcref.TypeOrMeasureKind = TyparKind.Measure -> Measure.Const tcref + | TType_app (tcref, [], _) when tyconRefEq g tcref g.measureone_tcr -> Measure.One(tcref.Range) + | TType_app (tcref, [], _) when tcref.TypeOrMeasureKind = TyparKind.Measure -> Measure.Const(tcref, tcref.Range) | TType_app (tcref, _, _) -> errorR(Error(FSComp.SR.impInvalidMeasureArgument1(tcref.CompiledName, tp.Name), m)) - Measure.One + Measure.One(tcref.Range) | _ -> errorR(Error(FSComp.SR.impInvalidMeasureArgument2(tp.Name), m)) - Measure.One + Measure.One(Range.Zero) TType_measure (conv genericArg) else diff --git a/src/Compiler/Service/ItemKey.fs b/src/Compiler/Service/ItemKey.fs index 3c030f84c90..49cdda18940 100644 --- a/src/Compiler/Service/ItemKey.fs +++ b/src/Compiler/Service/ItemKey.fs @@ -362,7 +362,7 @@ and [] ItemKeyStoreBuilder(tcGlobals: TcGlobals) = | Measure.Var typar -> writeString ItemKeyTags.typeMeasureVar writeTypar isStandalone typar - | Measure.Const tcref -> + | Measure.Const(tyconRef = tcref) -> writeString ItemKeyTags.typeMeasureCon writeEntityRef tcref | _ -> () diff --git a/src/Compiler/Symbols/Exprs.fs b/src/Compiler/Symbols/Exprs.fs index 91480597cc2..5ec81f6861d 100644 --- a/src/Compiler/Symbols/Exprs.fs +++ b/src/Compiler/Symbols/Exprs.fs @@ -3,6 +3,7 @@ namespace FSharp.Compiler.Symbols open FSharp.Compiler +open FSharp.Compiler.Text.Range open Internal.Utilities.Library open Internal.Utilities.Library.Extras open FSharp.Compiler.AbstractIL.IL @@ -775,7 +776,7 @@ module FSharpExprConvert = let argTy2 = tyOfExpr g arg2 let resTy = match getMeasureOfType g argTy1, getMeasureOfType g argTy2 with - | Some (tcref, ms1), Some (_tcref2, ms2) -> mkWoNullAppTy tcref [TType_measure (Measure.Prod(ms1, if isMul then ms2 else Measure.Inv ms2))] + | Some (tcref, ms1), Some (_tcref2, ms2) -> mkWoNullAppTy tcref [TType_measure (Measure.Prod(ms1, (if isMul then ms2 else Measure.Inv ms2), unionRanges ms1.Range ms2.Range))] | Some _, None -> argTy1 | None, Some _ -> argTy2 | None, None -> argTy1 diff --git a/src/Compiler/Symbols/Symbols.fs b/src/Compiler/Symbols/Symbols.fs index c2772cf8736..36823f65dc0 100644 --- a/src/Compiler/Symbols/Symbols.fs +++ b/src/Compiler/Symbols/Symbols.fs @@ -2512,9 +2512,9 @@ type FSharpType(cenv, ty:TType) = DiagnosticsLogger.protectAssemblyExploration true <| fun () -> match stripTyparEqns ty with | TType_app (tcref, tyargs, _) -> FSharpEntity(cenv, tcref, tyargs).IsUnresolved - | TType_measure (Measure.Const tcref) -> FSharpEntity(cenv, tcref).IsUnresolved + | TType_measure (Measure.Const(tyconRef= tcref)) -> FSharpEntity(cenv, tcref).IsUnresolved | TType_measure (Measure.Prod _) -> FSharpEntity(cenv, cenv.g.measureproduct_tcr).IsUnresolved - | TType_measure Measure.One -> FSharpEntity(cenv, cenv.g.measureone_tcr).IsUnresolved + | TType_measure (Measure.One _) -> FSharpEntity(cenv, cenv.g.measureone_tcr).IsUnresolved | TType_measure (Measure.Inv _) -> FSharpEntity(cenv, cenv.g.measureinverse_tcr).IsUnresolved | _ -> false @@ -2528,7 +2528,7 @@ type FSharpType(cenv, ty:TType) = isResolved() && protect <| fun () -> match stripTyparEqns ty with - | TType_app _ | TType_measure (Measure.Const _ | Measure.Prod _ | Measure.Inv _ | Measure.One) -> true + | TType_app _ | TType_measure (Measure.Const _ | Measure.Prod _ | Measure.Inv _ | Measure.One _) -> true | _ -> false member _.IsMeasureType = @@ -2556,9 +2556,9 @@ type FSharpType(cenv, ty:TType) = protect <| fun () -> match stripTyparEqns ty with | TType_app (tcref, tyargs, _) -> FSharpEntity(cenv, tcref, tyargs) - | TType_measure (Measure.Const tcref) -> FSharpEntity(cenv, tcref) + | TType_measure (Measure.Const(tyconRef= tcref)) -> FSharpEntity(cenv, tcref) | TType_measure (Measure.Prod _) -> FSharpEntity(cenv, cenv.g.measureproduct_tcr) - | TType_measure Measure.One -> FSharpEntity(cenv, cenv.g.measureone_tcr) + | TType_measure (Measure.One _) -> FSharpEntity(cenv, cenv.g.measureone_tcr) | TType_measure (Measure.Inv _) -> FSharpEntity(cenv, cenv.g.measureinverse_tcr) | _ -> invalidOp "not a named type" @@ -2587,8 +2587,8 @@ type FSharpType(cenv, ty:TType) = | TType_tuple (_, tyargs) -> (tyargs |> List.map (fun ty -> FSharpType(cenv, ty)) |> makeReadOnlyCollection) | TType_fun(domainTy, rangeTy, _) -> [| FSharpType(cenv, domainTy); FSharpType(cenv, rangeTy) |] |> makeReadOnlyCollection | TType_measure (Measure.Const _) -> [| |] |> makeReadOnlyCollection - | TType_measure (Measure.Prod (t1, t2)) -> [| FSharpType(cenv, TType_measure t1); FSharpType(cenv, TType_measure t2) |] |> makeReadOnlyCollection - | TType_measure Measure.One -> [| |] |> makeReadOnlyCollection + | TType_measure (Measure.Prod(measure1= t1; measure2 = t2)) -> [| FSharpType(cenv, TType_measure t1); FSharpType(cenv, TType_measure t2) |] |> makeReadOnlyCollection + | TType_measure (Measure.One _) -> [| |] |> makeReadOnlyCollection | TType_measure (Measure.Inv t1) -> [| FSharpType(cenv, TType_measure t1) |] |> makeReadOnlyCollection | _ -> invalidOp "not a named type" diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fs b/src/Compiler/SyntaxTree/SyntaxTree.fs index 8977e8fba6b..bd918e8848a 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fs +++ b/src/Compiler/SyntaxTree/SyntaxTree.fs @@ -202,6 +202,18 @@ type SynMeasure = | Paren of measure: SynMeasure * range: range + member x.Range = + match x with + | SynMeasure.Named(range = m) + | SynMeasure.Product(range = m) + | SynMeasure.Seq(range = m) + | SynMeasure.Divide(range = m) + | SynMeasure.Power(range = m) + | SynMeasure.One(range = m) + | SynMeasure.Anon(range = m) + | SynMeasure.Var(range = m) + | SynMeasure.Paren(range = m) -> m + [] type SynRationalConst = diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fsi b/src/Compiler/SyntaxTree/SyntaxTree.fsi index 654a3971175..f50adfa289d 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fsi +++ b/src/Compiler/SyntaxTree/SyntaxTree.fsi @@ -213,6 +213,8 @@ type SynMeasure = /// A parenthesized measure | Paren of measure: SynMeasure * range: range + member Range: range + /// Represents an unchecked syntax tree of F# unit of measure exponents. [] type SynRationalConst = diff --git a/src/Compiler/TypedTree/TypedTree.fs b/src/Compiler/TypedTree/TypedTree.fs index 1aaa21eb294..11ff117cc25 100644 --- a/src/Compiler/TypedTree/TypedTree.fs +++ b/src/Compiler/TypedTree/TypedTree.fs @@ -4559,16 +4559,16 @@ type Measure = | Var of typar: Typar /// A constant, leaf unit-of-measure such as 'kg' or 'm' - | Const of tyconRef: TyconRef + | Const of tyconRef: TyconRef * range: range /// A product of two units of measure - | Prod of measure1: Measure * measure2: Measure + | Prod of measure1: Measure * measure2: Measure * range: range /// An inverse of a units of measure expression | Inv of measure: Measure /// The unit of measure '1', e.g. float = float<1> - | One + | One of range: range /// Raising a measure to a rational power | RationalPower of measure: Measure * power: Rational @@ -4577,7 +4577,16 @@ type Measure = //[] //member x.DebugText = x.ToString() - override x.ToString() = sprintf "%+A" x + override x.ToString() = sprintf "%+A" x + + member x.Range = + match x with + | Var(typar) -> typar.Range + | Const(range= m) -> m + | Prod(range= m) -> m + | Inv(m) -> m.Range + | One(range= m) -> m + | RationalPower(measure= ms) -> ms.Range type Attribs = Attrib list diff --git a/src/Compiler/TypedTree/TypedTree.fsi b/src/Compiler/TypedTree/TypedTree.fsi index 73eeb760b4c..82a0a8d84c4 100644 --- a/src/Compiler/TypedTree/TypedTree.fsi +++ b/src/Compiler/TypedTree/TypedTree.fsi @@ -3202,22 +3202,24 @@ type Measure = | Var of typar: Typar /// A constant, leaf unit-of-measure such as 'kg' or 'm' - | Const of tyconRef: TyconRef + | Const of tyconRef: TyconRef * range: range /// A product of two units of measure - | Prod of measure1: Measure * measure2: Measure + | Prod of measure1: Measure * measure2: Measure * range: range /// An inverse of a units of measure expression | Inv of measure: Measure /// The unit of measure '1', e.g. float = float<1> - | One + | One of range: range /// Raising a measure to a rational power | RationalPower of measure: Measure * power: Rational override ToString: unit -> string + member Range: range + type Attribs = Attrib list [] diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index ca7292c6369..e2bc362c784 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -228,12 +228,12 @@ let rec remapTypeAux (tyenv: Remap) (ty: TType) = and remapMeasureAux tyenv unt = match unt with - | Measure.One -> unt - | Measure.Const tcref -> - match tyenv.tyconRefRemap.TryFind tcref with - | Some tcref -> Measure.Const tcref + | Measure.One _ -> unt + | Measure.Const(entityRef, m) -> + match tyenv.tyconRefRemap.TryFind entityRef with + | Some tcref -> Measure.Const(tcref, m) | None -> unt - | Measure.Prod(u1, u2) -> Measure.Prod(remapMeasureAux tyenv u1, remapMeasureAux tyenv u2) + | Measure.Prod(u1, u2, m) -> Measure.Prod(remapMeasureAux tyenv u1, remapMeasureAux tyenv u2, m) | Measure.RationalPower(u, q) -> Measure.RationalPower(remapMeasureAux tyenv u, q) | Measure.Inv u -> Measure.Inv(remapMeasureAux tyenv u) | Measure.Var tp as unt -> @@ -444,7 +444,7 @@ let reduceTyconRefAbbrevMeasureable (tcref: TyconRef) = let rec stripUnitEqnsFromMeasureAux canShortcut unt = match stripUnitEqnsAux canShortcut unt with - | Measure.Const tcref when tcref.IsTypeAbbrev -> + | Measure.Const(tyconRef= tcref) when tcref.IsTypeAbbrev -> stripUnitEqnsFromMeasureAux canShortcut (reduceTyconRefAbbrevMeasureable tcref) | m -> m @@ -457,20 +457,20 @@ let stripUnitEqnsFromMeasure m = stripUnitEqnsFromMeasureAux false m /// What is the contribution of unit-of-measure constant ucref to unit-of-measure expression measure? let rec MeasureExprConExponent g abbrev ucref unt = match (if abbrev then stripUnitEqnsFromMeasure unt else stripUnitEqns unt) with - | Measure.Const ucrefR -> if tyconRefEq g ucrefR ucref then OneRational else ZeroRational + | Measure.Const(tyconRef= ucrefR) -> if tyconRefEq g ucrefR ucref then OneRational else ZeroRational | Measure.Inv untR -> NegRational(MeasureExprConExponent g abbrev ucref untR) - | Measure.Prod(unt1, unt2) -> AddRational(MeasureExprConExponent g abbrev ucref unt1) (MeasureExprConExponent g abbrev ucref unt2) - | Measure.RationalPower(untR, q) -> MulRational (MeasureExprConExponent g abbrev ucref untR) q + | Measure.Prod(measure1= unt1; measure2= unt2) -> AddRational(MeasureExprConExponent g abbrev ucref unt1) (MeasureExprConExponent g abbrev ucref unt2) + | Measure.RationalPower(measure= untR; power= q) -> MulRational (MeasureExprConExponent g abbrev ucref untR) q | _ -> ZeroRational /// What is the contribution of unit-of-measure constant ucref to unit-of-measure expression measure /// after remapping tycons? let rec MeasureConExponentAfterRemapping g r ucref unt = match stripUnitEqnsFromMeasure unt with - | Measure.Const ucrefR -> if tyconRefEq g (r ucrefR) ucref then OneRational else ZeroRational + | Measure.Const(tyconRef= ucrefR) -> if tyconRefEq g (r ucrefR) ucref then OneRational else ZeroRational | Measure.Inv untR -> NegRational(MeasureConExponentAfterRemapping g r ucref untR) - | Measure.Prod(unt1, unt2) -> AddRational(MeasureConExponentAfterRemapping g r ucref unt1) (MeasureConExponentAfterRemapping g r ucref unt2) - | Measure.RationalPower(untR, q) -> MulRational (MeasureConExponentAfterRemapping g r ucref untR) q + | Measure.Prod(measure1= unt1; measure2= unt2) -> AddRational(MeasureConExponentAfterRemapping g r ucref unt1) (MeasureConExponentAfterRemapping g r ucref unt2) + | Measure.RationalPower(measure= untR; power= q) -> MulRational (MeasureConExponentAfterRemapping g r ucref untR) q | _ -> ZeroRational /// What is the contribution of unit-of-measure variable tp to unit-of-measure expression unt? @@ -478,8 +478,8 @@ let rec MeasureVarExponent tp unt = match stripUnitEqnsFromMeasure unt with | Measure.Var tpR -> if typarEq tp tpR then OneRational else ZeroRational | Measure.Inv untR -> NegRational(MeasureVarExponent tp untR) - | Measure.Prod(unt1, unt2) -> AddRational(MeasureVarExponent tp unt1) (MeasureVarExponent tp unt2) - | Measure.RationalPower(untR, q) -> MulRational (MeasureVarExponent tp untR) q + | Measure.Prod(measure1= unt1; measure2= unt2) -> AddRational(MeasureVarExponent tp unt1) (MeasureVarExponent tp unt2) + | Measure.RationalPower(measure = untR; power= q) -> MulRational (MeasureVarExponent tp untR) q | _ -> ZeroRational /// List the *literal* occurrences of unit variables in a unit expression, without repeats @@ -487,8 +487,8 @@ let ListMeasureVarOccs unt = let rec gather acc unt = match stripUnitEqnsFromMeasure unt with | Measure.Var tp -> if List.exists (typarEq tp) acc then acc else tp :: acc - | Measure.Prod(unt1, unt2) -> gather (gather acc unt1) unt2 - | Measure.RationalPower(untR, _) -> gather acc untR + | Measure.Prod(measure1= unt1; measure2= unt2) -> gather (gather acc unt1) unt2 + | Measure.RationalPower(measure= untR) -> gather acc untR | Measure.Inv untR -> gather acc untR | _ -> acc gather [] unt @@ -502,9 +502,9 @@ let ListMeasureVarOccsWithNonZeroExponents untexpr = else let e = MeasureVarExponent tp untexpr if e = ZeroRational then acc else (tp, e) :: acc - | Measure.Prod(unt1, unt2) -> gather (gather acc unt1) unt2 + | Measure.Prod(measure1= unt1; measure2= unt2) -> gather (gather acc unt1) unt2 | Measure.Inv untR -> gather acc untR - | Measure.RationalPower(untR, _) -> gather acc untR + | Measure.RationalPower(measure= untR) -> gather acc untR | _ -> acc gather [] untexpr @@ -512,13 +512,13 @@ let ListMeasureVarOccsWithNonZeroExponents untexpr = let ListMeasureConOccsWithNonZeroExponents g eraseAbbrevs untexpr = let rec gather acc unt = match (if eraseAbbrevs then stripUnitEqnsFromMeasure unt else stripUnitEqns unt) with - | Measure.Const c -> + | Measure.Const(tyconRef= c) -> if List.exists (fun (cR, _) -> tyconRefEq g c cR) acc then acc else let e = MeasureExprConExponent g eraseAbbrevs c untexpr if e = ZeroRational then acc else (c, e) :: acc - | Measure.Prod(unt1, unt2) -> gather (gather acc unt1) unt2 + | Measure.Prod(measure1= unt1; measure2= unt2) -> gather (gather acc unt1) unt2 | Measure.Inv untR -> gather acc untR - | Measure.RationalPower(untR, _) -> gather acc untR + | Measure.RationalPower(measure= untR) -> gather acc untR | _ -> acc gather [] untexpr @@ -527,9 +527,9 @@ let ListMeasureConOccsWithNonZeroExponents g eraseAbbrevs untexpr = let ListMeasureConOccsAfterRemapping g r unt = let rec gather acc unt = match stripUnitEqnsFromMeasure unt with - | Measure.Const c -> if List.exists (tyconRefEq g (r c)) acc then acc else r c :: acc - | Measure.Prod(unt1, unt2) -> gather (gather acc unt1) unt2 - | Measure.RationalPower(untR, _) -> gather acc untR + | Measure.Const(tyconRef= c) -> if List.exists (tyconRefEq g (r c)) acc then acc else r c :: acc + | Measure.Prod(measure1= unt1; measure2= unt2) -> gather (gather acc unt1) unt2 + | Measure.RationalPower(measure= untR) -> gather acc untR | Measure.Inv untR -> gather acc untR | _ -> acc @@ -538,19 +538,19 @@ let ListMeasureConOccsAfterRemapping g r unt = /// Construct a measure expression representing the n'th power of a measure let MeasurePower u n = if n = 1 then u - elif n = 0 then Measure.One + elif n = 0 then Measure.One(range0) else Measure.RationalPower (u, intToRational n) let MeasureProdOpt m1 m2 = match m1, m2 with - | Measure.One, _ -> m2 - | _, Measure.One -> m1 - | _, _ -> Measure.Prod (m1, m2) + | Measure.One _, _ -> m2 + | _, Measure.One _ -> m1 + | _, _ -> Measure.Prod (m1, m2, unionRanges m1.Range m2.Range) /// Construct a measure expression representing the product of a list of measures let ProdMeasures ms = match ms with - | [] -> Measure.One + | [] -> Measure.One(range0) | m :: ms -> List.foldBack MeasureProdOpt ms m let isDimensionless g ty = @@ -580,9 +580,23 @@ let normalizeMeasure g ms = let vs = ListMeasureVarOccsWithNonZeroExponents ms let cs = ListMeasureConOccsWithNonZeroExponents g false ms match vs, cs with - | [], [] -> Measure.One + | [], [] -> Measure.One(ms.Range) | [(v, e)], [] when e = OneRational -> Measure.Var v - | vs, cs -> List.foldBack (fun (v, e) -> fun m -> Measure.Prod (Measure.RationalPower (Measure.Var v, e), m)) vs (List.foldBack (fun (c, e) -> fun m -> Measure.Prod (Measure.RationalPower (Measure.Const c, e), m)) cs Measure.One) + | vs, cs -> + List.foldBack + (fun (v, e) -> + fun unt -> + let measureVar = Measure.Var(v) + let measureRational = Measure.RationalPower(measureVar, e) + Measure.Prod(measureRational, unt, unionRanges measureRational.Range unt.Range)) + vs + (List.foldBack + (fun (c, e) -> + fun unt -> + let measureConst = Measure.Const(c, c.Range) + let measureRational = Measure.RationalPower(measureConst, e) + let prodM = unionRanges measureConst.Range unt.Range + Measure.Prod(measureRational, unt, prodM)) cs (Measure.One(ms.Range))) let tryNormalizeMeasureInType g ty = match ty with @@ -916,14 +930,14 @@ let tryNiceEntityRefOfTy ty = let ty = stripTyparEqnsAux KnownWithoutNull false ty match ty with | TType_app (tcref, _, _) -> ValueSome tcref - | TType_measure (Measure.Const tcref) -> ValueSome tcref + | TType_measure (Measure.Const(tyconRef= tcref)) -> ValueSome tcref | _ -> ValueNone let tryNiceEntityRefOfTyOption ty = let ty = stripTyparEqnsAux KnownWithoutNull false ty match ty with | TType_app (tcref, _, _) -> Some tcref - | TType_measure (Measure.Const tcref) -> Some tcref + | TType_measure (Measure.Const(tyconRef= tcref)) -> Some tcref | _ -> None let mkInstForAppTy g ty = @@ -1159,7 +1173,7 @@ let getMeasureOfType g ty = match ty with | AppTy g (tcref, [tyarg]) -> match stripTyEqns g tyarg with - | TType_measure ms when not (measureEquiv g ms Measure.One) -> Some (tcref, ms) + | TType_measure ms when not (measureEquiv g ms (Measure.One(tcref.Range))) -> Some (tcref, ms) | _ -> None | _ -> None diff --git a/src/Compiler/TypedTree/TypedTreeOps.fsi b/src/Compiler/TypedTree/TypedTreeOps.fsi index bda6c2c3187..6433cf16d3e 100755 --- a/src/Compiler/TypedTree/TypedTreeOps.fsi +++ b/src/Compiler/TypedTree/TypedTreeOps.fsi @@ -843,6 +843,8 @@ val CollectAllNoCaching: FreeVarOptions val CollectAll: FreeVarOptions +val ListMeasureVarOccs: Measure -> Typar list + val accFreeInTypes: FreeVarOptions -> TType list -> FreeTyvars -> FreeTyvars val accFreeInType: FreeVarOptions -> TType -> FreeTyvars -> FreeTyvars diff --git a/src/Compiler/TypedTree/TypedTreePickle.fs b/src/Compiler/TypedTree/TypedTreePickle.fs index 3ce2e68396d..d2b3bd0ec79 100644 --- a/src/Compiler/TypedTree/TypedTreePickle.fs +++ b/src/Compiler/TypedTree/TypedTreePickle.fs @@ -1535,7 +1535,7 @@ let p_measure_one = p_byte 4 // Pickle a unit-of-measure variable or constructor let p_measure_varcon unt st = match unt with - | Measure.Const tcref -> p_measure_con tcref st + | Measure.Const(tyconRef= tcref) -> p_measure_con tcref st | Measure.Var v -> p_measure_var v st | _ -> pfailwith st "p_measure_varcon: expected measure variable or constructor" @@ -1564,12 +1564,12 @@ let rec p_measure_power unt q st = let rec p_normalized_measure unt st = let unt = stripUnitEqnsAux false unt match unt with - | Measure.Const tcref -> p_measure_con tcref st + | Measure.Const(tyconRef= tcref) -> p_measure_con tcref st | Measure.Inv x -> p_byte 1 st; p_normalized_measure x st - | Measure.Prod(x1, x2) -> p_byte 2 st; p_normalized_measure x1 st; p_normalized_measure x2 st + | Measure.Prod(measure1= x1; measure2= x2) -> p_byte 2 st; p_normalized_measure x1 st; p_normalized_measure x2 st | Measure.Var v -> p_measure_var v st - | Measure.One -> p_measure_one st - | Measure.RationalPower(x, q) -> p_measure_power x q st + | Measure.One _ -> p_measure_one st + | Measure.RationalPower(measure= x; power= q) -> p_measure_power x q st // By normalizing the unit-of-measure and treating integer powers as a special case, // we ensure that the pickle format for rational powers of units (byte 5 followed by @@ -1585,11 +1585,11 @@ let u_rational st = let rec u_measure_expr st = let tag = u_byte st match tag with - | 0 -> let a = u_tcref st in Measure.Const a + | 0 -> let a = u_tcref st in Measure.Const(a, range0) | 1 -> let a = u_measure_expr st in Measure.Inv a - | 2 -> let a, b = u_tup2 u_measure_expr u_measure_expr st in Measure.Prod (a, b) - | 3 -> let a = u_tpref st in Measure.Var a - | 4 -> Measure.One + | 2 -> let a, b = u_tup2 u_measure_expr u_measure_expr st in Measure.Prod (a, b, range0) + | 3 -> let a = u_tpref st in Measure.Var(a) + | 4 -> Measure.One(range0) | 5 -> let a = u_measure_expr st in let b = u_rational st in Measure.RationalPower (a, b) | _ -> ufailwith st "u_measure_expr" diff --git a/tests/FSharp.Compiler.ComponentTests/Language/ObsoleteAttributeCheckingTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/ObsoleteAttributeCheckingTests.fs index 002bef2f41b..d9a8bfb28f0 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/ObsoleteAttributeCheckingTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/ObsoleteAttributeCheckingTests.fs @@ -1,6 +1,5 @@ namespace Language -open FSharp.Test open Xunit open FSharp.Test.Compiler @@ -37,6 +36,350 @@ let c = C() (Warning 44, Line 7, Col 9, Line 7, Col 10, "This construct is deprecated. Use B instead") ] + + [] + let ``Obsolete attribute warning taken into account when used with a literal`` () = + Fsx """ +open System +[] +let myLit = 12 + +let myRes = myLit + """ + |> typecheck + |> shouldFail + |> withDiagnostics [ + (Warning 44, Line 6, Col 13, Line 6, Col 18, "This construct is deprecated. Use lit2") + ] + + [] + let ``Obsolete attribute error taken into account when used with a literal`` () = + Fsx """ +open System +[] +let myLit = 12 + +let myRes = myLit + """ + |> typecheck + |> shouldFail + |> withDiagnostics [ + (Error 101, Line 6, Col 13, Line 6, Col 18, "This construct is deprecated. Use lit2") + ] + + [] + let ``Obsolete attribute warning taken into account when used with a simple unit of measure`` () = + Fsx """ +open System +[] +type cm + +let myCm = 3 + """ + |> typecheck + |> shouldFail + |> withDiagnostics [ + (Warning 44, Line 6, Col 14, Line 6, Col 16, "This construct is deprecated. Use cm2") + ] + + [] + let ``Obsolete attribute error taken into account when used with a simple unit of measure`` () = + Fsx """ +open System +[] +type cm + +let myCm = 3 + """ + |> typecheck + |> shouldFail + |> withDiagnostics [ + (Error 101, Line 6, Col 14, Line 6, Col 16, "This construct is deprecated. Use cm2") + ] + + [] + let ``Obsolete attribute warning taken into account when used with a simple unit of measure type abbrev`` () = + Fsx """ +open System +[] type cm + +[] type ml = cm^3 + +type Mls = int * int + +type IMl2 = + abstract member Ml2 : x: int * y: int -> int + abstract member Ml3 : x: int * y: int -> int + """ + |> typecheck + |> shouldFail + |> withDiagnostics [ + (Warning 44, Line 5, Col 23, Line 5, Col 25, "This construct is deprecated. Use something else") + (Warning 44, Line 7, Col 16, Line 7, Col 18, "This construct is deprecated. Use something else") + (Warning 44, Line 7, Col 26, Line 7, Col 28, "This construct is deprecated. Use something else") + (Warning 44, Line 10, Col 34, Line 10, Col 36, "This construct is deprecated. Use something else") + (Warning 44, Line 10, Col 47, Line 10, Col 49, "This construct is deprecated. Use something else") + (Warning 44, Line 11, Col 34, Line 11, Col 36, "This construct is deprecated. Use something else") + (Warning 44, Line 11, Col 47, Line 11, Col 49, "This construct is deprecated. Use something else") + (Warning 44, Line 11, Col 58, Line 11, Col 60, "This construct is deprecated. Use something else") + ] + + [] + let ``Obsolete attribute error taken into account when used with a simple unit of measure type abbrev`` () = + Fsx """ +open System +[] type cm + +[] type ml = cm^3 + """ + |> typecheck + |> shouldFail + |> withDiagnostics [ + (Error 101, Line 5, Col 23, Line 5, Col 25, "This construct is deprecated. Use something else") + ] + + [] + let ``Obsolete attribute warning taken into account when used with a complex unit of measure definition`` () = + Fsx """ +open System +[] +type kg + +[] type m + +[] +type s + +// Force, Newtons. +[] type N = kg m / s^2 + """ + |> typecheck + |> shouldFail + |> withDiagnostics [ + (Warning 44, Line 12, Col 22, Line 12, Col 24, "This construct is deprecated. Use kg2"); + (Warning 44, Line 12, Col 29, Line 12, Col 30, "This construct is deprecated. Use s2") + ] + + [] + let ``Obsolete attribute error taken into account when used with a complex unit of measure definition`` () = + Fsx """ +open System +[] +type kg + +[] type m + +[] +type s + +// Force, Newtons. +[] type N = kg m / s^2 + """ + |> typecheck + |> shouldFail + |> withDiagnostics [ + (Error 101, Line 12, Col 22, Line 12, Col 24, "This construct is deprecated. Use kg2"); + ] + + [] + let ``Obsolete attribute warning taken into account when used within a complex unit of measure`` () = + Fsx """ +open System + +[] +type kg + +[] +type cm + +let myCm = 3 + +let cm2 = 3 * 3 + """ + |> typecheck + |> shouldFail + |> withDiagnostics [ + (Warning 44, Line 10, Col 14, Line 10, Col 16, "This construct is deprecated. Use cm2"); + (Warning 44, Line 12, Col 13, Line 12, Col 15, "This construct is deprecated. Use cm2"); + (Warning 44, Line 12, Col 24, Line 12, Col 26, "This construct is deprecated. Use cm2") + ] + + [] + let ``Obsolete attribute warning taken into account when used within a complex unit of measure. Define conversion constants.`` () = + Fsx """ +open System + +[] +type m + +[] +type cm + +let cmPerMeter : float = 100.0 +let mPerCm = 0.01 + """ + |> typecheck + |> shouldFail + |> withDiagnostics [ + (Warning 44, Line 10, Col 24, Line 10, Col 26, "This construct is deprecated. Use cm2") + (Warning 44, Line 10, Col 27, Line 10, Col 28, "This construct is deprecated. Use m2") + (Warning 44, Line 10, Col 38, Line 10, Col 40, "This construct is deprecated. Use cm2") + (Warning 44, Line 10, Col 41, Line 10, Col 42, "This construct is deprecated. Use m2") + (Warning 44, Line 11, Col 19, Line 11, Col 20, "This construct is deprecated. Use m2") + (Warning 44, Line 11, Col 21, Line 11, Col 23, "This construct is deprecated. Use cm2") + ] + + [] + let ``Obsolete attribute warning taken into account when used with a complex(multiple obsolete) unit of measure`` () = + Fsx """ +open System + +[] +type kg + +[] +type cm + +let myCm = 3 + """ + |> typecheck + |> shouldFail + |> withDiagnostics [ + (Warning 44, Line 10, Col 14, Line 10, Col 16, "This construct is deprecated. Use cm2"); + (Warning 44, Line 10, Col 17, Line 10, Col 19, "This construct is deprecated. Use kg2") + ] + + [] + let ``TopLevel - Obsolete attribute warning taken into account when used with a complex(multiple obsolete) unit of measure usages`` () = + Fsx """ +open System +// Distance, meters. +[] type m + +// Time, seconds. +[] type s + +let genericSumUnits (x: float<'u>) (y: float<'u>) = x + y + +let genericSumUnits2 (x: float) (y: float) = () + +let genericSumUnits3 (x: float) (y: float) (z: float) = () + +let genericSumUnits4 (x: float, y: float) = () + +let genericSumUnits5 (x: float, y: float, z: float) = () + +let v1 = 3.1 +let v2 = 2.7 +let x1 = 1.2 +let t1 = 1.0 + +let result1 = genericSumUnits v1 v2 + +let res = System.Collections.Generic.Dictionary,int>() + """ + |> typecheck + |> shouldFail + |> withDiagnostics [ + (Warning 44, Line 11, Col 32, Line 11, Col 33, "This construct is deprecated. Use m2") + (Warning 44, Line 11, Col 46, Line 11, Col 47, "This construct is deprecated. Use s2") + (Warning 44, Line 13, Col 32, Line 13, Col 33, "This construct is deprecated. Use m2") + (Warning 44, Line 13, Col 46, Line 13, Col 47, "This construct is deprecated. Use s2") + (Warning 44, Line 13, Col 60, Line 13, Col 61, "This construct is deprecated. Use m2") + (Warning 44, Line 15, Col 32, Line 15, Col 33, "This construct is deprecated. Use m2") + (Warning 44, Line 15, Col 45, Line 15, Col 46, "This construct is deprecated. Use s2") + (Warning 44, Line 17, Col 32, Line 17, Col 33, "This construct is deprecated. Use m2") + (Warning 44, Line 17, Col 45, Line 17, Col 46, "This construct is deprecated. Use s2") + (Warning 44, Line 17, Col 58, Line 17, Col 59, "This construct is deprecated. Use m2") + (Warning 44, Line 19, Col 14, Line 19, Col 15, "This construct is deprecated. Use m2") + (Warning 44, Line 19, Col 16, Line 19, Col 17, "This construct is deprecated. Use s2") + (Warning 44, Line 20, Col 14, Line 20, Col 15, "This construct is deprecated. Use m2") + (Warning 44, Line 20, Col 16, Line 20, Col 17, "This construct is deprecated. Use s2") + (Warning 44, Line 21, Col 14, Line 21, Col 15, "This construct is deprecated. Use m2") + (Warning 44, Line 22, Col 14, Line 22, Col 15, "This construct is deprecated. Use s2") + (Warning 44, Line 26, Col 53, Line 26, Col 54, "This construct is deprecated. Use m2") + (Warning 44, Line 26, Col 60, Line 26, Col 61, "This construct is deprecated. Use s2") + ] + + [] + let ``Class- Obsolete attribute warning taken into account when used with a complex(multiple obsolete) unit of measure usages`` () = + Fsx """ +open System +// Distance, meters. +[] type m + +// Time, seconds. +[] type s + +type MyClass() = + let genericSumUnits (x: float<'u>) (y: float<'u>) = x + y + + let genericSumUnits2 (x: float) (y: float) = () + + static let genericSumUnits3 (x: float) (y: float) (z: float) = () + + let genericSumUnits4 (x: float, y: float) = () + + let genericSumUnits5 (x: float, y: float, z: float) = () + + member this.Prop = 3.1 + + member this.Prop2 = 2.7 + + member this.Prop3 = 1.2 + + member this.Prop4 = 1.0 + + member this.GenericSumUnits (x: float<'u>) (y: float<'u>) = x + y + + member this.GenericSumUnits2 (x: float) (y: float) = () + + member this.GenericSumUnits3 (x: float) (y: float) (z: float) = () + + member this.GenericSumUnits4 (x: float, y: float) = () + + member this.GenericSumUnits5 (x: float, y: float, z: float) = () + +type A<[] 'u>(x: int) = + member _.X = x + +type B(x: int, y: int) = + member _.X = x + """ + |> typecheck + |> shouldFail + |> withDiagnostics [ + (Warning 44, Line 30, Col 44, Line 30, Col 45, "This construct is deprecated. Use m2") + (Warning 44, Line 30, Col 58, Line 30, Col 59, "This construct is deprecated. Use s2") + (Warning 44, Line 32, Col 44, Line 32, Col 45, "This construct is deprecated. Use m2") + (Warning 44, Line 32, Col 58, Line 32, Col 59, "This construct is deprecated. Use s2") + (Warning 44, Line 32, Col 72, Line 32, Col 73, "This construct is deprecated. Use m2") + (Warning 44, Line 34, Col 44, Line 34, Col 45, "This construct is deprecated. Use m2") + (Warning 44, Line 34, Col 57, Line 34, Col 58, "This construct is deprecated. Use s2") + (Warning 44, Line 36, Col 44, Line 36, Col 45, "This construct is deprecated. Use m2") + (Warning 44, Line 36, Col 57, Line 36, Col 58, "This construct is deprecated. Use s2") + (Warning 44, Line 36, Col 70, Line 36, Col 71, "This construct is deprecated. Use m2") + (Warning 44, Line 12, Col 36, Line 12, Col 37, "This construct is deprecated. Use m2") + (Warning 44, Line 12, Col 50, Line 12, Col 51, "This construct is deprecated. Use s2") + (Warning 44, Line 14, Col 43, Line 14, Col 44, "This construct is deprecated. Use m2") + (Warning 44, Line 14, Col 57, Line 14, Col 58, "This construct is deprecated. Use s2") + (Warning 44, Line 14, Col 71, Line 14, Col 72, "This construct is deprecated. Use m2") + (Warning 44, Line 16, Col 36, Line 16, Col 37, "This construct is deprecated. Use m2") + (Warning 44, Line 16, Col 49, Line 16, Col 50, "This construct is deprecated. Use s2") + (Warning 44, Line 18, Col 36, Line 18, Col 37, "This construct is deprecated. Use m2") + (Warning 44, Line 18, Col 49, Line 18, Col 50, "This construct is deprecated. Use s2") + (Warning 44, Line 18, Col 62, Line 18, Col 63, "This construct is deprecated. Use m2") + (Warning 44, Line 20, Col 28, Line 20, Col 29, "This construct is deprecated. Use m2") + (Warning 44, Line 20, Col 30, Line 20, Col 31, "This construct is deprecated. Use s2") + (Warning 44, Line 22, Col 29, Line 22, Col 30, "This construct is deprecated. Use m2") + (Warning 44, Line 22, Col 31, Line 22, Col 32, "This construct is deprecated. Use s2") + (Warning 44, Line 24, Col 29, Line 24, Col 30, "This construct is deprecated. Use m2") + (Warning 44, Line 26, Col 29, Line 26, Col 30, "This construct is deprecated. Use s2") + (Warning 44, Line 38, Col 31, Line 38, Col 32, "This construct is deprecated. Use m2") + (Warning 44, Line 41, Col 15, Line 41, Col 16, "This construct is deprecated. Use m2") + (Warning 44, Line 41, Col 26, Line 41, Col 27, "This construct is deprecated. Use s2") + ] + [] let ``Obsolete attribute error taken into account when used instantiating a type`` () = Fsx """ diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl index cf5037bc449..6004f3fb62d 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl @@ -8116,6 +8116,8 @@ FSharp.Compiler.Syntax.SynMeasure: FSharp.Compiler.Syntax.SynMeasure+Product FSharp.Compiler.Syntax.SynMeasure: FSharp.Compiler.Syntax.SynMeasure+Seq FSharp.Compiler.Syntax.SynMeasure: FSharp.Compiler.Syntax.SynMeasure+Tags FSharp.Compiler.Syntax.SynMeasure: FSharp.Compiler.Syntax.SynMeasure+Var +FSharp.Compiler.Syntax.SynMeasure: FSharp.Compiler.Text.Range Range +FSharp.Compiler.Syntax.SynMeasure: FSharp.Compiler.Text.Range get_Range() FSharp.Compiler.Syntax.SynMeasure: Int32 Tag FSharp.Compiler.Syntax.SynMeasure: Int32 get_Tag() FSharp.Compiler.Syntax.SynMeasure: System.String ToString() diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl index cf5037bc449..6004f3fb62d 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl @@ -8116,6 +8116,8 @@ FSharp.Compiler.Syntax.SynMeasure: FSharp.Compiler.Syntax.SynMeasure+Product FSharp.Compiler.Syntax.SynMeasure: FSharp.Compiler.Syntax.SynMeasure+Seq FSharp.Compiler.Syntax.SynMeasure: FSharp.Compiler.Syntax.SynMeasure+Tags FSharp.Compiler.Syntax.SynMeasure: FSharp.Compiler.Syntax.SynMeasure+Var +FSharp.Compiler.Syntax.SynMeasure: FSharp.Compiler.Text.Range Range +FSharp.Compiler.Syntax.SynMeasure: FSharp.Compiler.Text.Range get_Range() FSharp.Compiler.Syntax.SynMeasure: Int32 Tag FSharp.Compiler.Syntax.SynMeasure: Int32 get_Tag() FSharp.Compiler.Syntax.SynMeasure: System.String ToString() From 77e7e08838bb314f1448b24538d40cc8e2cb75c5 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Thu, 9 Jan 2025 14:32:00 +0100 Subject: [PATCH 08/49] Versioning for 17.14 and 9.0.300 (#18222) --- azure-pipelines.yml | 4 ++-- eng/Versions.props | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 1e5aaebbdf9..95c03d1c0d4 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -29,7 +29,7 @@ variables: # Should be 'current' release branch name, i.e. 'release/dev17.10' in dotnet/fsharp/refs/heads/main, 'release/dev17.10' in dotnet/fsharp/refs/heads/release/dev17.10 and 'release/dev17.9' in dotnet/fsharp/refs/heads/release/dev17.9 # Should **never** be 'main' in dotnet/fsharp/refs/heads/main, since it will start inserting to VS twice. - name: FSharpReleaseBranchName - value: release/dev17.13 + value: release/dev17.14 # VS Insertion branch name (NOT the same as F# branch) # Should be previous release branch or 'main' in 'main' and 'main' in release branch # (since for all *new* release branches we insert into VS main and for all *previous* releases we insert into corresponding VS release), @@ -88,7 +88,7 @@ extends: # Signed build # #-------------------------------------------------------------------------------------------------------------------# # Localization: we only run it for specific release branches - - ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/release/dev17.13') }}: + - ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/release/dev17.14') }}: - template: /eng/common/templates-official/job/onelocbuild.yml@self parameters: MirrorRepo: fsharp diff --git a/eng/Versions.props b/eng/Versions.props index 7727e2eda17..00bbbc51afb 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -14,7 +14,7 @@ 9 0 - 200 + 300 0 @@ -53,7 +53,7 @@ 17 - 13 + 14 $(VSMajorVersion).0 $(VSMajorVersion).$(VSMinorVersion).0 $(VSAssemblyVersionPrefix).0 From b204f87d71db43a5640a36e91432f182beb83b41 Mon Sep 17 00:00:00 2001 From: Jakub Majocha <1760221+majocha@users.noreply.github.com> Date: Thu, 9 Jan 2025 16:46:29 +0100 Subject: [PATCH 09/49] Fix AsyncLazy cancellation (#18211) * fix AsyncLazy cancellation * baselines --- src/Compiler/Facilities/AsyncMemoize.fs | 65 +++++++------------ src/Compiler/Facilities/AsyncMemoize.fsi | 7 +- ...y_FSharp.Compiler.Service_Debug_net9.0.bsl | 12 ++-- ....Compiler.Service_Debug_netstandard2.0.bsl | 12 ++-- ...FSharp.Compiler.Service_Release_net9.0.bsl | 12 ++-- ...ompiler.Service_Release_netstandard2.0.bsl | 12 ++-- 6 files changed, 50 insertions(+), 70 deletions(-) diff --git a/src/Compiler/Facilities/AsyncMemoize.fs b/src/Compiler/Facilities/AsyncMemoize.fs index 2e45d131a28..991c8359312 100644 --- a/src/Compiler/Facilities/AsyncMemoize.fs +++ b/src/Compiler/Facilities/AsyncMemoize.fs @@ -18,6 +18,7 @@ type AsyncLazyState<'t> = /// Represents a computation that will execute only once but can be requested by multiple clients. /// It keeps track of the number of requests. When all clients cancel their requests, the underlying computation will also cancel and can be restarted. /// If cancelUnawaited is set to false, the computation will run to completion even when all requests are canceled. +/// When cacheException is false, subsequent requests will restart the computation after an exceptional result. type AsyncLazy<'t> private (initial: AsyncLazyState<'t>, cancelUnawaited: bool, cacheException: bool) = let stateUpdateSync = obj() @@ -33,6 +34,7 @@ type AsyncLazy<'t> private (initial: AsyncLazyState<'t>, cancelUnawaited: bool, let cancelIfUnawaited cancelUnawaited = function | Running(computation, _, cts, 0) when cancelUnawaited -> // To keep state updates fast we don't actually wait for the work to cancel. + // This means single execution is not strictly enforced. cts.Cancel() Initial computation | state -> state @@ -45,38 +47,27 @@ type AsyncLazy<'t> private (initial: AsyncLazyState<'t>, cancelUnawaited: bool, async { try let! ct = Async.CancellationToken - return! - // Using ContinueWith with a CancellationToken allows detaching from the running 'work' task. - // This ensures the lazy 'work' and its awaiting requests can be independently managed - // by separate CancellationTokenSources, enabling individual cancellation. - // Essentially, if this async computation is canceled, it won't wait for the 'work' to complete - // but will immediately proceed to the finally block. - work.ContinueWith((fun (t: Task<_>) -> t.Result), ct) - |> Async.AwaitTask - // Cancellation check before entering the `with` ensures TaskCanceledException coming from the ContinueWith task will never be raised here. - // The cancellation continuation will always be called in case of cancellation. - with exn -> return raise exn + // Using ContinueWith with a CancellationToken allows detaching from the running 'work' task. + // If the current async workflow is canceled, the 'work' task will continue running independently. + do! work.ContinueWith(ignore>, ct) |> Async.AwaitTask + with :? TaskCanceledException -> () + // If we're here it means there was no cancellation and the 'work' task has completed. + return! work |> Async.AwaitTask } + let onComplete (t: Task<'t>) = + updateState <| function + | Running (computation, _, _, _) -> + try Completed t.Result with exn -> if cacheException then Faulted exn else Initial computation + | state -> state + t.Result + let request = function | Initial computation -> let cts = new CancellationTokenSource() - let work = Async.StartAsTask( async { - try - let! result = computation - // If associated cts is signalled it means this work item was abandoned - // and it should not alter the state. - updateState <| function - | state when cts.IsCancellationRequested -> state - | _ -> Completed result - return result - with - | exn -> - updateState <| function - | state when cts.IsCancellationRequested -> state - | _ -> if cacheException then Faulted exn else Initial computation - return raise exn - }, cancellationToken = cts.Token) + let work = + Async.StartAsTask(computation, cancellationToken = cts.Token) + .ContinueWith(onComplete, TaskContinuationOptions.NotOnCanceled) Running (computation, work, cts, 1), detachable work | Running (c, work, cts, count) -> @@ -89,10 +80,10 @@ type AsyncLazy<'t> private (initial: AsyncLazyState<'t>, cancelUnawaited: bool, // computation will deallocate after state transition to Completed ot Faulted. new (computation, ?cancelUnawaited: bool, ?cacheException) = - AsyncLazy(Initial computation, defaultArg cancelUnawaited true, defaultArg cacheException false) + AsyncLazy(Initial computation, defaultArg cancelUnawaited true, defaultArg cacheException true) member _.Request() = - async { + async { try return! withStateUpdate request finally @@ -103,7 +94,7 @@ type AsyncLazy<'t> private (initial: AsyncLazyState<'t>, cancelUnawaited: bool, member _.State = state - member this.TryResult = + member _.TryResult = match state with | Completed result -> Some result | _ -> None @@ -164,12 +155,7 @@ type private KeyData<'TKey, 'TVersion> = type Job<'t> = AsyncLazy * CapturingDiagnosticsLogger> [] -type internal AsyncMemoize<'TKey, 'TVersion, 'TValue when 'TKey: equality and 'TVersion: equality -#if !NO_CHECKNULLS - and 'TKey:not null - and 'TVersion:not null -#endif - > +type internal AsyncMemoize<'TKey, 'TVersion, 'TValue when 'TKey: equality and 'TVersion: equality and 'TKey:not null and 'TVersion:not null> (?keepStrongly, ?keepWeakly, ?name: string, ?cancelUnawaitedJobs: bool, ?cancelDuplicateRunningJobs: bool) = let name = defaultArg name "N/A" @@ -211,8 +197,7 @@ type internal AsyncMemoize<'TKey, 'TVersion, 'TValue when 'TKey: equality and 'T } let wrappedComputation = - async { - use! _handler = Async.OnCancel (fun () -> log Canceled key) + Async.TryCancelled( async { let sw = Stopwatch.StartNew() log Started key let logger = CapturingDiagnosticsLogger "cache" @@ -226,14 +211,14 @@ type internal AsyncMemoize<'TKey, 'TVersion, 'TValue when 'TKey: equality and 'T | Choice2Of2 exn -> log Failed key return Result.Error exn, logger - } + }, fun _ -> log Canceled key) let getOrAdd () = let cached, otherVersions = cache.GetAll(key.Key, key.Version) let countHit v = Interlocked.Increment &hits |> ignore; v let cacheSetNewJob () = - let job = Job(wrappedComputation, cancelUnawaited = cancelUnawaitedJobs) + let job = Job(wrappedComputation, cancelUnawaited = cancelUnawaitedJobs, cacheException = false) cache.Set(key.Key, key.Version, key.Label, job) job diff --git a/src/Compiler/Facilities/AsyncMemoize.fsi b/src/Compiler/Facilities/AsyncMemoize.fsi index 37d2d397fe2..6b9ffb4f433 100644 --- a/src/Compiler/Facilities/AsyncMemoize.fsi +++ b/src/Compiler/Facilities/AsyncMemoize.fsi @@ -42,12 +42,7 @@ type Extensions = /// /// Strongly holds at most one result per key. /// -type internal AsyncMemoize<'TKey, 'TVersion, 'TValue when 'TKey: equality and 'TVersion: equality -#if !NO_CHECKNULLS - and 'TKey:not null - and 'TVersion:not null -#endif - > = +type internal AsyncMemoize<'TKey, 'TVersion, 'TValue when 'TKey: equality and 'TVersion: equality and 'TKey:not null and 'TVersion:not null> = /// Maximum number of strongly held results to keep in the cache /// Maximum number of weakly held results to keep in the cache diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl index 1f0b8002279..d54bcb9419a 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl @@ -21,14 +21,14 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x00000082][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x0000008B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+MagicAssemblyResolution::ResolveAssemblyCore([FSharp.Compiler.Service]Internal.Utilities.Library.CompilationThreadToken, [FSharp.Compiler.Service]FSharp.Compiler.Text.Range, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, [FSharp.Compiler.Service]FSharp.Compiler.CompilerImports+TcImports, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompiler, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiConsoleOutput, string)][offset 0x00000015][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3510-790::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001E5][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3510-796::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001E5][found Char] Unexpected type on the stack. [IL]: Error [UnmanagedPointer]: : FSharp.Compiler.Interactive.Shell+Utilities+pointerToNativeInt@110::Invoke(object)][offset 0x00000007] Unmanaged pointers are not a verifiable type. [IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+dataTipOfReferences@2205::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000084][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-502::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-502::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-502::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000082][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-502::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000008B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-502::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000094][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-508::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-508::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-508::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000082][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-508::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000008B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-508::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000094][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.StaticLinking+TypeForwarding::followTypeForwardForILTypeRef([FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.IL+ILTypeRef)][offset 0x00000010][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions::getCompilerOption([FSharp.Compiler.Service]FSharp.Compiler.CompilerOptions+CompilerOption, [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1)][offset 0x000000E6][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions::AddPathMapping([FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, string)][offset 0x0000000B][found Char] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl index 2013e914ed5..4bbe31fc0d6 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl @@ -28,18 +28,18 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x0000008B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+FsiStdinSyphon::GetLine(string, int32)][offset 0x00000039][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+MagicAssemblyResolution::ResolveAssemblyCore([FSharp.Compiler.Service]Internal.Utilities.Library.CompilationThreadToken, [FSharp.Compiler.Service]FSharp.Compiler.Text.Range, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, [FSharp.Compiler.Service]FSharp.Compiler.CompilerImports+TcImports, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompiler, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiConsoleOutput, string)][offset 0x00000015][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3510-790::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001E5][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3510-796::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001E5][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+FsiInteractionProcessor::CompletionsForPartialLID([FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompilerState, string)][offset 0x0000001B][found Char] Unexpected type on the stack. [IL]: Error [UnmanagedPointer]: : FSharp.Compiler.Interactive.Shell+Utilities+pointerToNativeInt@110::Invoke(object)][offset 0x00000007] Unmanaged pointers are not a verifiable type. [IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+dataTipOfReferences@2205::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000084][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseMemberFunctionAndValues@176::Invoke([FSharp.Compiler.Service]FSharp.Compiler.Symbols.FSharpMemberOrFunctionOrValue)][offset 0x00000059][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseEntity@218::GenerateNext([S.P.CoreLib]System.Collections.Generic.IEnumerable`1&)][offset 0x000000DA][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.ParsedInput+visitor@1423-6::VisitExpr([FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Compiler.Service]FSharp.Compiler.Syntax.SynExpr)][offset 0x00000605][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-502::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-502::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-502::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000082][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-502::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000008B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-502::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000094][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-508::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-508::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-508::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000082][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-508::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000008B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-508::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000094][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$Symbols+fullName@2490-1::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000015][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CreateILModule+MainModuleBuilder::ConvertProductVersionToILVersionInfo(string)][offset 0x00000011][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.StaticLinking+TypeForwarding::followTypeForwardForILTypeRef([FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.IL+ILTypeRef)][offset 0x00000010][found Char] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl index af810c63892..965a760fe81 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl @@ -21,13 +21,13 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x00000082][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x0000008B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+MagicAssemblyResolution::ResolveAssemblyCore([FSharp.Compiler.Service]Internal.Utilities.Library.CompilationThreadToken, [FSharp.Compiler.Service]FSharp.Compiler.Text.Range, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, [FSharp.Compiler.Service]FSharp.Compiler.CompilerImports+TcImports, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompiler, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiConsoleOutput, string)][offset 0x00000015][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3510-830::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001C7][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3510-836::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001C7][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+GetReferenceResolutionStructuredToolTipText@2205::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000076][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-523::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-523::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-523::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000064][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-523::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000006D][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-523::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000076][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-529::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-529::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-529::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000064][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-529::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000006D][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-529::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000076][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Driver+ProcessCommandLineFlags@301-1::Invoke(string)][offset 0x0000000B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Driver+ProcessCommandLineFlags@301-1::Invoke(string)][offset 0x00000014][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.StaticLinking+TypeForwarding::followTypeForwardForILTypeRef([FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.IL+ILTypeRef)][offset 0x00000010][found Char] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl index 5b4d38b154b..38b37691559 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl @@ -28,17 +28,17 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x0000008B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+FsiStdinSyphon::GetLine(string, int32)][offset 0x00000032][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+MagicAssemblyResolution::ResolveAssemblyCore([FSharp.Compiler.Service]Internal.Utilities.Library.CompilationThreadToken, [FSharp.Compiler.Service]FSharp.Compiler.Text.Range, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, [FSharp.Compiler.Service]FSharp.Compiler.CompilerImports+TcImports, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompiler, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiConsoleOutput, string)][offset 0x00000015][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3510-830::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001C7][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3510-836::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001C7][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+FsiInteractionProcessor::CompletionsForPartialLID([FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompilerState, string)][offset 0x00000024][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+GetReferenceResolutionStructuredToolTipText@2205::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000076][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseMemberFunctionAndValues@176::Invoke([FSharp.Compiler.Service]FSharp.Compiler.Symbols.FSharpMemberOrFunctionOrValue)][offset 0x0000002B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseEntity@218::GenerateNext([S.P.CoreLib]System.Collections.Generic.IEnumerable`1&)][offset 0x000000BB][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.ParsedInput+visitor@1423-11::VisitExpr([FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Compiler.Service]FSharp.Compiler.Syntax.SynExpr)][offset 0x00000620][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-523::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-523::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-523::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000064][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-523::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000006D][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-523::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000076][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-529::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-529::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-529::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000064][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-529::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000006D][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-529::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000076][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$Symbols+fullName@2490-3::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000030][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Driver+ProcessCommandLineFlags@301-1::Invoke(string)][offset 0x0000000B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Driver+ProcessCommandLineFlags@301-1::Invoke(string)][offset 0x00000014][found Char] Unexpected type on the stack. From dfffae63ceadf90bf920e190a399ff2eba5ac29f Mon Sep 17 00:00:00 2001 From: Jakub Majocha <1760221+majocha@users.noreply.github.com> Date: Mon, 13 Jan 2025 16:19:38 +0100 Subject: [PATCH 10/49] OpenTelemetry instrumentation for xUnit tests (#18230) * otel instrumentation for xunit test runs * wip * sort out deps version conflict * disable for desktop --- .../FSharpChecker/CommonWorkflows.fs | 11 ---------- .../FSharpChecker/TransparentCompiler.fs | 7 ------ .../FSharp.Test.Utilities.fsproj | 2 +- .../ProjectGeneration.fs | 11 ---------- tests/FSharp.Test.Utilities/XunitHelpers.fs | 22 +++++++++++++++++++ 5 files changed, 23 insertions(+), 30 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/FSharpChecker/CommonWorkflows.fs b/tests/FSharp.Compiler.ComponentTests/FSharpChecker/CommonWorkflows.fs index 4b0163a9f4b..d8bd1f6e262 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharpChecker/CommonWorkflows.fs +++ b/tests/FSharp.Compiler.ComponentTests/FSharpChecker/CommonWorkflows.fs @@ -143,14 +143,6 @@ let ``Using getSource and notifications instead of filesystem`` () = [] let GetAllUsesOfAllSymbols() = - let traceProvider = - Sdk.CreateTracerProviderBuilder() - .AddSource("fsc") - .SetResourceBuilder(ResourceBuilder.CreateDefault().AddService(serviceName="F#", serviceVersion = "1")) - .AddJaegerExporter() - .Build() - - use _ = Activity.start "GetAllUsesOfAllSymbols" [ ] let result = async { @@ -162,9 +154,6 @@ let GetAllUsesOfAllSymbols() = return checkProjectResults.GetAllUsesOfAllSymbols() } |> Async.RunSynchronously - traceProvider.ForceFlush() |> ignore - traceProvider.Dispose() - if result.Length <> 79 then failwith $"Expected 81 symbolUses, got {result.Length}:\n%A{result}" [] diff --git a/tests/FSharp.Compiler.ComponentTests/FSharpChecker/TransparentCompiler.fs b/tests/FSharp.Compiler.ComponentTests/FSharpChecker/TransparentCompiler.fs index b523b814b72..33ac7992e14 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharpChecker/TransparentCompiler.fs +++ b/tests/FSharp.Compiler.ComponentTests/FSharpChecker/TransparentCompiler.fs @@ -556,13 +556,6 @@ let fuzzingTest seed (project: SyntheticProject) = task { do! Task.Delay (rng.Next maxCheckingDelayMs) } - use _tracerProvider = - Sdk.CreateTracerProviderBuilder() - .AddSource("fsc") - .SetResourceBuilder(ResourceBuilder.CreateDefault().AddService(serviceName="F# Fuzzing", serviceVersion = "1")) - .AddJaegerExporter() - .Build() - use _ = Activity.start $"Fuzzing {project.Name}" [ Activity.Tags.project, project.Name; "seed", seed.ToString() ] do! task { diff --git a/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj b/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj index 1e3fd1b84c9..5b8f66bac7d 100644 --- a/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj +++ b/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj @@ -108,7 +108,7 @@ - + diff --git a/tests/FSharp.Test.Utilities/ProjectGeneration.fs b/tests/FSharp.Test.Utilities/ProjectGeneration.fs index 1734e3240a7..92256c2b09b 100644 --- a/tests/FSharp.Test.Utilities/ProjectGeneration.fs +++ b/tests/FSharp.Test.Utilities/ProjectGeneration.fs @@ -961,7 +961,6 @@ type ProjectWorkflowBuilder let mutable latestProject = initialProject let mutable activity = None - let mutable tracerProvider = None let getSource f = f |> getSourceText latestProject :> ISourceText |> Some |> async.Return @@ -1010,13 +1009,6 @@ type ProjectWorkflowBuilder member this.Yield _ = async { let! ctx = getInitialContext() - tracerProvider <- - Sdk.CreateTracerProviderBuilder() - .AddSource("fsc") - .SetResourceBuilder(ResourceBuilder.CreateDefault().AddService(serviceName="F#", serviceVersion = "1")) - .AddJaegerExporter() - .Build() - |> Some activity <- Activity.start ctx.Project.Name [ Activity.Tags.project, ctx.Project.Name; "UsingTransparentCompiler", useTransparentCompiler.ToString() ] |> Some return ctx } @@ -1032,9 +1024,6 @@ type ProjectWorkflowBuilder if initialContext.IsNone && not isExistingProject then this.DeleteProjectDir() activity |> Option.iter (fun x -> if not (isNull x) then x.Dispose()) - tracerProvider |> Option.iter (fun x -> - x.ForceFlush() |> ignore - x.Dispose()) member this.Run(workflow: Async) = if autoStart then diff --git a/tests/FSharp.Test.Utilities/XunitHelpers.fs b/tests/FSharp.Test.Utilities/XunitHelpers.fs index 7a41338200a..3a0049df5a8 100644 --- a/tests/FSharp.Test.Utilities/XunitHelpers.fs +++ b/tests/FSharp.Test.Utilities/XunitHelpers.fs @@ -10,6 +10,12 @@ open Xunit.Abstractions open TestFramework +open FSharp.Compiler.Diagnostics + +open OpenTelemetry +open OpenTelemetry.Resources +open OpenTelemetry.Trace + /// Disables custom internal parallelization added with XUNIT_EXTRAS. /// Execute test cases in a class or a module one by one instead of all at once. Allow other collections to run simultaneously. [] @@ -45,6 +51,7 @@ type ConsoleCapturingTestRunner(test, messageBus, testClass, constructorArgument override this.InvokeTestAsync (aggregator: ExceptionAggregator) = task { use capture = new TestConsole.ExecutionCapture() + use _ = Activity.start test.DisplayName [ ] let! executionTime = this.BaseInvokeTestMethodAsync aggregator let output = seq { @@ -139,9 +146,24 @@ type FSharpXunitFramework(sink: IMessageSink) = log "FSharpXunitFramework with XUNIT_EXTRAS installing TestConsole redirection" TestConsole.install() +// TODO: Currently does not work with Desktop .NET Framework. Upcoming OpenTelemetry 1.11.0 may change it. +#if NETCOREAPP + let traceProvider = + Sdk.CreateTracerProviderBuilder() + .AddSource(ActivityNames.FscSourceName) + .SetResourceBuilder( + ResourceBuilder.CreateDefault().AddService(serviceName="F#", serviceVersion = "1.0.0")) + .AddOtlpExporter() + .Build() +#endif + interface IDisposable with member _.Dispose() = cleanUpTemporaryDirectoryOfThisTestRun () +#if NETCOREAPP + traceProvider.ForceFlush() |> ignore + traceProvider.Dispose() +#endif base.Dispose() override this.CreateDiscoverer (assemblyInfo) = From ec2b3d9db17a22f4f525e95dbd2372ce19fad75d Mon Sep 17 00:00:00 2001 From: Isaac Abraham Date: Mon, 13 Jan 2025 17:02:30 +0000 Subject: [PATCH 11/49] Make nullness equivalent warning message clearer. (#18172) --- src/Compiler/Driver/CompilerDiagnostics.fs | 5 ++--- src/Compiler/FSStrings.resx | 2 +- src/Compiler/xlf/FSStrings.cs.xlf | 4 ++-- src/Compiler/xlf/FSStrings.de.xlf | 4 ++-- src/Compiler/xlf/FSStrings.es.xlf | 4 ++-- src/Compiler/xlf/FSStrings.fr.xlf | 4 ++-- src/Compiler/xlf/FSStrings.it.xlf | 4 ++-- src/Compiler/xlf/FSStrings.ja.xlf | 4 ++-- src/Compiler/xlf/FSStrings.ko.xlf | 4 ++-- src/Compiler/xlf/FSStrings.pl.xlf | 4 ++-- src/Compiler/xlf/FSStrings.pt-BR.xlf | 4 ++-- src/Compiler/xlf/FSStrings.ru.xlf | 4 ++-- src/Compiler/xlf/FSStrings.tr.xlf | 4 ++-- src/Compiler/xlf/FSStrings.zh-Hans.xlf | 4 ++-- src/Compiler/xlf/FSStrings.zh-Hant.xlf | 4 ++-- .../Language/Nullness/NullableCsharpImportTests.fs | 14 +++++++------- .../Nullness/NullableReferenceTypesTests.fs | 6 +++--- .../library-functions.fs.checknulls_on.err.bsl | 6 +++--- 18 files changed, 42 insertions(+), 43 deletions(-) diff --git a/src/Compiler/Driver/CompilerDiagnostics.fs b/src/Compiler/Driver/CompilerDiagnostics.fs index 83554e74834..9dcf0b72ea3 100644 --- a/src/Compiler/Driver/CompilerDiagnostics.fs +++ b/src/Compiler/Driver/CompilerDiagnostics.fs @@ -438,7 +438,7 @@ module OldStyleMessages = let ConstraintSolverTupleDiffLengthsE () = Message("ConstraintSolverTupleDiffLengths", "%d%d") let ConstraintSolverInfiniteTypesE () = Message("ConstraintSolverInfiniteTypes", "%s%s") let ConstraintSolverMissingConstraintE () = Message("ConstraintSolverMissingConstraint", "%s") - let ConstraintSolverNullnessWarningEquivWithTypesE () = Message("ConstraintSolverNullnessWarningEquivWithTypes", "%s%s") + let ConstraintSolverNullnessWarningEquivWithTypesE () = Message("ConstraintSolverNullnessWarningEquivWithTypes", "%s") let ConstraintSolverNullnessWarningWithTypesE () = Message("ConstraintSolverNullnessWarningWithTypes", "%s%s") let ConstraintSolverNullnessWarningWithTypeE () = Message("ConstraintSolverNullnessWarningWithType", "%s") let ConstraintSolverNullnessWarningE () = Message("ConstraintSolverNullnessWarning", "%s") @@ -678,8 +678,7 @@ type Exception with let t1, t2, _cxs = NicePrint.minimalStringsOfTwoTypes denv ty1 ty2 - os.Append(ConstraintSolverNullnessWarningEquivWithTypesE().Format t1 t2) - |> ignore + os.Append(ConstraintSolverNullnessWarningEquivWithTypesE().Format t1) |> ignore if m.StartLine <> m2.StartLine then os.Append(SeeAlsoE().Format(stringOfRange m)) |> ignore diff --git a/src/Compiler/FSStrings.resx b/src/Compiler/FSStrings.resx index 383b4991105..e9338b6b990 100644 --- a/src/Compiler/FSStrings.resx +++ b/src/Compiler/FSStrings.resx @@ -130,7 +130,7 @@ A type parameter is missing a constraint '{0}' - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. Nullness warning: The types '{0}' and '{1}' do not have compatible nullability. diff --git a/src/Compiler/xlf/FSStrings.cs.xlf b/src/Compiler/xlf/FSStrings.cs.xlf index 86a6be9d7e0..20991832c18 100644 --- a/src/Compiler/xlf/FSStrings.cs.xlf +++ b/src/Compiler/xlf/FSStrings.cs.xlf @@ -18,8 +18,8 @@ - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. diff --git a/src/Compiler/xlf/FSStrings.de.xlf b/src/Compiler/xlf/FSStrings.de.xlf index 3b7f46a9769..b429cdd522c 100644 --- a/src/Compiler/xlf/FSStrings.de.xlf +++ b/src/Compiler/xlf/FSStrings.de.xlf @@ -18,8 +18,8 @@ - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. diff --git a/src/Compiler/xlf/FSStrings.es.xlf b/src/Compiler/xlf/FSStrings.es.xlf index f2b6d8ed1ca..6620ac895f8 100644 --- a/src/Compiler/xlf/FSStrings.es.xlf +++ b/src/Compiler/xlf/FSStrings.es.xlf @@ -18,8 +18,8 @@ - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. diff --git a/src/Compiler/xlf/FSStrings.fr.xlf b/src/Compiler/xlf/FSStrings.fr.xlf index f3621e55e63..ac459e73f5b 100644 --- a/src/Compiler/xlf/FSStrings.fr.xlf +++ b/src/Compiler/xlf/FSStrings.fr.xlf @@ -18,8 +18,8 @@ - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. diff --git a/src/Compiler/xlf/FSStrings.it.xlf b/src/Compiler/xlf/FSStrings.it.xlf index d67bbd27dca..1f1ad15e05f 100644 --- a/src/Compiler/xlf/FSStrings.it.xlf +++ b/src/Compiler/xlf/FSStrings.it.xlf @@ -18,8 +18,8 @@ - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. diff --git a/src/Compiler/xlf/FSStrings.ja.xlf b/src/Compiler/xlf/FSStrings.ja.xlf index 486c2fac349..59d40979899 100644 --- a/src/Compiler/xlf/FSStrings.ja.xlf +++ b/src/Compiler/xlf/FSStrings.ja.xlf @@ -18,8 +18,8 @@ - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. diff --git a/src/Compiler/xlf/FSStrings.ko.xlf b/src/Compiler/xlf/FSStrings.ko.xlf index 506b9b9e2de..8ed60cc681f 100644 --- a/src/Compiler/xlf/FSStrings.ko.xlf +++ b/src/Compiler/xlf/FSStrings.ko.xlf @@ -18,8 +18,8 @@ - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. diff --git a/src/Compiler/xlf/FSStrings.pl.xlf b/src/Compiler/xlf/FSStrings.pl.xlf index 30f8155bfc8..c5f8bbc016b 100644 --- a/src/Compiler/xlf/FSStrings.pl.xlf +++ b/src/Compiler/xlf/FSStrings.pl.xlf @@ -18,8 +18,8 @@ - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. diff --git a/src/Compiler/xlf/FSStrings.pt-BR.xlf b/src/Compiler/xlf/FSStrings.pt-BR.xlf index cf7e3a94822..991d77016c9 100644 --- a/src/Compiler/xlf/FSStrings.pt-BR.xlf +++ b/src/Compiler/xlf/FSStrings.pt-BR.xlf @@ -18,8 +18,8 @@ - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. diff --git a/src/Compiler/xlf/FSStrings.ru.xlf b/src/Compiler/xlf/FSStrings.ru.xlf index 34278a4b234..2c4de5a755c 100644 --- a/src/Compiler/xlf/FSStrings.ru.xlf +++ b/src/Compiler/xlf/FSStrings.ru.xlf @@ -18,8 +18,8 @@ - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. diff --git a/src/Compiler/xlf/FSStrings.tr.xlf b/src/Compiler/xlf/FSStrings.tr.xlf index a2601885c52..7b936093a0d 100644 --- a/src/Compiler/xlf/FSStrings.tr.xlf +++ b/src/Compiler/xlf/FSStrings.tr.xlf @@ -18,8 +18,8 @@ - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. diff --git a/src/Compiler/xlf/FSStrings.zh-Hans.xlf b/src/Compiler/xlf/FSStrings.zh-Hans.xlf index 66a54f3d2bb..12afa253444 100644 --- a/src/Compiler/xlf/FSStrings.zh-Hans.xlf +++ b/src/Compiler/xlf/FSStrings.zh-Hans.xlf @@ -18,8 +18,8 @@ - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. diff --git a/src/Compiler/xlf/FSStrings.zh-Hant.xlf b/src/Compiler/xlf/FSStrings.zh-Hant.xlf index 35280cee60f..8e52040ed6f 100644 --- a/src/Compiler/xlf/FSStrings.zh-Hant.xlf +++ b/src/Compiler/xlf/FSStrings.zh-Hant.xlf @@ -18,8 +18,8 @@ - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. - Nullness warning: The types '{0}' and '{1}' do not have equivalent nullability. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. + Nullness warning: A non-nullable '{0}' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. diff --git a/tests/FSharp.Compiler.ComponentTests/Language/Nullness/NullableCsharpImportTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/Nullness/NullableCsharpImportTests.fs index 5a4f3dedf10..bb67476cb9f 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/Nullness/NullableCsharpImportTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/Nullness/NullableCsharpImportTests.fs @@ -107,9 +107,9 @@ let y:System.Collections.Generic.LinkedListNode = ll.First |> shouldFail |> withDiagnostics [ Error 3261, Line 4, Col 59, Line 4, Col 66, "Nullness warning: The types 'System.Collections.Generic.LinkedListNode' and 'System.Collections.Generic.LinkedListNode | null' do not have compatible nullability." - Error 3261, Line 4, Col 59, Line 4, Col 66, "Nullness warning: The types 'System.Collections.Generic.LinkedListNode' and 'System.Collections.Generic.LinkedListNode | null' do not have equivalent nullability." + Error 3261, Line 4, Col 59, Line 4, Col 66, "Nullness warning: A non-nullable 'System.Collections.Generic.LinkedListNode' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression." Error 3261, Line 5, Col 59, Line 5, Col 67, "Nullness warning: The types 'System.Collections.Generic.LinkedListNode' and 'System.Collections.Generic.LinkedListNode | null' do not have compatible nullability." - Error 3261, Line 5, Col 59, Line 5, Col 67, "Nullness warning: The types 'System.Collections.Generic.LinkedListNode' and 'System.Collections.Generic.LinkedListNode | null' do not have equivalent nullability."] + Error 3261, Line 5, Col 59, Line 5, Col 67, "Nullness warning: A non-nullable 'System.Collections.Generic.LinkedListNode' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression." ] [] let ``Nullable directory info show warn on prop access`` () = @@ -219,12 +219,12 @@ let ``Consumption of nullable C# - no generics, just strings in methods and fiel |> shouldFail |> withDiagnostics [ Error 3261, Line 5, Col 40, Line 5, Col 85, "Nullness warning: The types 'string' and 'string | null' do not have compatible nullability." - Error 3261, Line 5, Col 40, Line 5, Col 85, "Nullness warning: The types 'string' and 'string | null' do not have equivalent nullability." - Error 3261, Line 14, Col 34, Line 14, Col 62, "Nullness warning: The types 'string' and 'string | null' do not have equivalent nullability." + Error 3261, Line 5, Col 40, Line 5, Col 85, "Nullness warning: A non-nullable 'string' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression." + Error 3261, Line 14, Col 34, Line 14, Col 62, "Nullness warning: A non-nullable 'string' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression." Error 3261, Line 16, Col 35, Line 16, Col 39, "Nullness warning: The type 'string' does not support 'null'." - Error 3261, Line 25, Col 85, Line 25, Col 97, "Nullness warning: The types 'string' and 'string | null' do not have equivalent nullability." - Error 3261, Line 28, Col 99, Line 28, Col 111, "Nullness warning: The types 'string' and 'string | null' do not have equivalent nullability." - Error 3261, Line 30, Col 97, Line 30, Col 109, "Nullness warning: The types 'string' and 'string | null' do not have equivalent nullability."] + Error 3261, Line 25, Col 85, Line 25, Col 97, "Nullness warning: A non-nullable 'string' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression." + Error 3261, Line 28, Col 99, Line 28, Col 111, "Nullness warning: A non-nullable 'string' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression." + Error 3261, Line 30, Col 97, Line 30, Col 109, "Nullness warning: A non-nullable 'string' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression."] [] diff --git a/tests/FSharp.Compiler.ComponentTests/Language/Nullness/NullableReferenceTypesTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/Nullness/NullableReferenceTypesTests.fs index 55a76b6f522..819bd475152 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/Nullness/NullableReferenceTypesTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/Nullness/NullableReferenceTypesTests.fs @@ -213,7 +213,7 @@ Test.XString("x":(string|null)) Error 3261, Line 11, Col 6, Line 11, Col 7, "Nullness warning: The type 'obj | null' supports 'null' but a non-null type is expected." Error 3261, Line 11, Col 1, Line 11, Col 8, "Nullness warning: The types 'obj' and 'obj | null' do not have compatible nullability." Error 3261, Line 12, Col 14, Line 12, Col 18, "Nullness warning: The type 'string' does not support 'null'." - Error 3261, Line 13, Col 14, Line 13, Col 31, "Nullness warning: The types 'string' and 'string | null' do not have equivalent nullability."] + Error 3261, Line 13, Col 14, Line 13, Col 31, "Nullness warning: A non-nullable 'string' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression."] [] let ``Typar infered to nonnull obj`` () = @@ -256,7 +256,7 @@ let nonStrictFunc(x:string | null) = strictFunc(x) |> typeCheckWithStrictNullness |> shouldFail |> withDiagnostics [ - Error 3261, Line 4, Col 49, Line 4, Col 50, "Nullness warning: The types 'string' and 'string | null' do not have equivalent nullability."] + Error 3261, Line 4, Col 49, Line 4, Col 50, "Nullness warning: A non-nullable 'string' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression."] [] let ``Can have nullable prop of same type T within a custom type T``() = @@ -994,7 +994,7 @@ let thisShouldAlsoWarn = MyRecord.Create(maybeNull) |> shouldFail |> withDiagnostics [Error 3261, Line 7, Col 38, Line 7, Col 42, "Nullness warning: The type 'string' does not support 'null'." - Error 3261, Line 9, Col 42, Line 9, Col 51, "Nullness warning: The types 'string' and 'string | null' do not have equivalent nullability."] + Error 3261, Line 9, Col 42, Line 9, Col 51, "Nullness warning: A non-nullable 'string' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression."] [] diff --git a/tests/FSharp.Compiler.ComponentTests/Language/Nullness/library-functions.fs.checknulls_on.err.bsl b/tests/FSharp.Compiler.ComponentTests/Language/Nullness/library-functions.fs.checknulls_on.err.bsl index a74b139264c..026cfabacff 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/Nullness/library-functions.fs.checknulls_on.err.bsl +++ b/tests/FSharp.Compiler.ComponentTests/Language/Nullness/library-functions.fs.checknulls_on.err.bsl @@ -4,10 +4,10 @@ library-functions.fs (7,33)-(7,35) typecheck error Value known to be without nul library-functions.fs (8,18)-(8,20) typecheck error Value known to be without null passed to a function meant for nullables: You can remove this `nonNull` assertion. library-functions.fs (10,28)-(10,39) typecheck error Value known to be without null passed to a function meant for nullables: You can remove this `nonNull` assertion. library-functions.fs (11,18)-(11,26) typecheck error Value known to be without null passed to a function meant for nullables: You can remove this `nonNull` assertion. -library-functions.fs (17,27)-(17,38) typecheck error Nullness warning: The types 'String' and 'String | null' do not have equivalent nullability. -library-functions.fs (18,28)-(18,39) typecheck error Nullness warning: The types 'String' and 'String | null' do not have equivalent nullability. +library-functions.fs (17,27)-(17,38) typecheck error Nullness warning: A non-nullable 'String' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. +library-functions.fs (18,28)-(18,39) typecheck error Nullness warning: A non-nullable 'String' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. library-functions.fs (20,28)-(20,36) typecheck error Nullness warning: The type 'String | null' supports 'null' but a non-null type is expected. library-functions.fs (26,17)-(26,19) typecheck error Nullness warning: The type 'string' does not support 'null'. library-functions.fs (27,10)-(27,16) typecheck error Nullness warning: The type 'String' does not support 'null'. -library-functions.fs (37,17)-(37,21) typecheck error Nullness warning: The types 'String' and 'string | null' do not have equivalent nullability. +library-functions.fs (37,17)-(37,21) typecheck error Nullness warning: A non-nullable 'String' was expected but this expression is nullable. Consider either changing the target to also be nullable, or use pattern matching to safely handle the null case of this expression. library-functions.fs (41,26)-(41,28) typecheck error Value known to be without null passed to a function meant for nullables: You can remove this `nonNull` assertion. \ No newline at end of file From 9420232c8ba9c946a38b774340b948ad837b1f12 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 13 Jan 2025 09:05:52 -0800 Subject: [PATCH 12/49] Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20250110.3 (#18226) Microsoft.SourceBuild.Intermediate.source-build-reference-packages From Version 9.0.0-alpha.1.24619.1 -> To Version 9.0.0-alpha.1.25060.3 Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 5aee1113c4f..a572c3cab87 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,9 +1,9 @@ - + https://github.com/dotnet/source-build-reference-packages - e2b1d16fd66540b3a5813ec0ac1fd166688c3e0a + f5fa796273e4e59926e3fab26e1ab9e7d577f5e5 From 05362a86bc85d3617be00c5cdc1c0f3a3708f2c1 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 13 Jan 2025 17:47:54 +0000 Subject: [PATCH 13/49] Update dependencies from https://github.com/dotnet/arcade build 20250108.5 (#18227) Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.24623.3 -> To Version 9.0.0-beta.25058.5 Co-authored-by: dotnet-maestro[bot] Co-authored-by: Kevin Ransom (msft) --- eng/Version.Details.xml | 8 ++++---- global.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index a572c3cab87..d005e04efcc 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -42,14 +42,14 @@ - + https://github.com/dotnet/arcade - e0e05154656254a735ebf19ffa5a37a8b915039b + 8cc6ecd76c24ef6665579a5c5e386a211a1e7c54 - + https://github.com/dotnet/arcade - e0e05154656254a735ebf19ffa5a37a8b915039b + 8cc6ecd76c24ef6665579a5c5e386a211a1e7c54 diff --git a/global.json b/global.json index 23eae505b33..57489571a22 100644 --- a/global.json +++ b/global.json @@ -17,7 +17,7 @@ "perl": "5.38.2.2" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24623.3", + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.25058.5", "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.23255.2" } } From c350a410608b3c518355261bd797a3d5ba086a6b Mon Sep 17 00:00:00 2001 From: Theodore Tsirpanis Date: Mon, 13 Jan 2025 20:41:20 +0200 Subject: [PATCH 14/49] Fix `fsi` auto-loading of script file inside NuGet package. (#18177) --- docs/release-notes/.FSharp.Compiler.Service/9.0.200.md | 1 + .../FSharp.DependencyManager.ProjectFile.fs | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.200.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.200.md index 8edf6f814d1..1d799b37f11 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.200.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.200.md @@ -21,6 +21,7 @@ * Completion: fix qualified completion in sequence expressions [PR #18111](https://github.com/dotnet/fsharp/pull/18111) * Symbols: try to use ValReprInfoForDisplay in Mfv.CurriedParameterGroups ([PR #18124](https://github.com/dotnet/fsharp/pull/18124)) * Shim/file system: fix leaks of the shim [PR #18144](https://github.com/dotnet/fsharp/pull/18144) +* fsi: fix auto-loading of script file inside NuGet package ([PR #18177](https://github.com/dotnet/fsharp/pull/18177)) * Fix for `Obsolete` attribute warning/error not taken into account when used with a unit of measure [PR #18182](https://github.com/dotnet/fsharp/pull/18182) ### Added diff --git a/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.ProjectFile.fs b/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.ProjectFile.fs index c8acf99d7e7..553c97dc60f 100644 --- a/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.ProjectFile.fs +++ b/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.ProjectFile.fs @@ -122,7 +122,6 @@ $(PACKAGEREFERENCES) $([System.String]::Copy('%(__InteractiveReferencedAssemblies.PathInPackage)').Replace('\', '/')) $([System.String]::Copy('%(InteractiveResolvedFile.NormalizedIdentity)').IndexOf('%(InteractiveResolvedFile.NormalizedPathInPackage)')) $([System.String]::Copy('%(InteractiveResolvedFile.NormalizedIdentity)').Substring(0, %(InteractiveResolvedFile.PositionPathInPackage)).Replace('\', '/')) - %(InteractiveResolvedFile.PackageRoot)content\%(InteractiveResolvedFile.NugetPackageId)$(SCRIPTEXTENSION) $([System.String]::Copy('%(__InteractiveReferencedAssemblies.PathInPackage)').StartsWith('ref/')) %(__InteractiveReferencedAssemblies.NuGetPackageId) %(__InteractiveReferencedAssemblies.NuGetPackageVersion) @@ -133,11 +132,14 @@ $(PACKAGEREFERENCES) $([System.String]::Copy('%(__InteractiveReferencedAssembliesCopyLocal.PathInPackage)').Replace('\', '/')) $([System.String]::Copy('%(InteractiveResolvedFile.NormalizedIdentity)').IndexOf('%(InteractiveResolvedFile.NormalizedPathInPackage)')) $([System.String]::Copy('%(InteractiveResolvedFile.NormalizedIdentity)').Substring(0, %(InteractiveResolvedFile.PositionPathInPackage)).Replace('\', '/')) - %(__InteractiveReferencedAssembliesCopyLocal.PackageRoot)content\%(__InteractiveReferencedAssembliesCopyLocal.NugetPackageId)$(SCRIPTEXTENSION) $([System.String]::Copy('%(__InteractiveReferencedAssembliesCopyLocal.PathInPackage)').StartsWith('ref/')) %(__InteractiveReferencedAssembliesCopyLocal.NuGetPackageId) %(__InteractiveReferencedAssembliesCopyLocal.NuGetPackageVersion) + + + %(InteractiveResolvedFile.PackageRoot)content\%(InteractiveResolvedFile.NugetPackageId)$(SCRIPTEXTENSION) + Date: Mon, 13 Jan 2025 18:15:17 -0800 Subject: [PATCH 15/49] Fix #17797 -- Realsig+ generates nested closures with incorrect Generic arguments (#17877) * tests * code * baseline * fantomas * release notes * ilverify baselines * Update tests/FSharp.Compiler.ComponentTests/Conformance/LexicalAnalysis/SymbolicOperators.fs Yeah the comments are pointless. Co-authored-by: Tomas Grosup * Feedback pt 1 * temp * tests * release notes * debug * Update DEVGUIDE.md Co-authored-by: Petr --------- Co-authored-by: Tomas Grosup Co-authored-by: Petr --- .gitignore | 7 +- DEVGUIDE.md | 27 + .../.FSharp.Compiler.Service/9.0.200.md | 1 + .../.FSharp.Compiler.Service/9.0.300.md | 12 + src/Compiler/CodeGen/IlxGen.fs | 56 +- src/Compiler/TypedTree/CompilerGlobalState.fs | 4 +- src/Compiler/TypedTree/TypedTreeOps.fsi | 3 + .../LexicalAnalysis/SymbolicOperators.fs | 35 +- .../IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs | 523 ++++++--- .../ComputedCollections.fs | 26 +- .../ForXInList_ToList.fs.il.bsl | 10 +- .../DoNotBoxStruct/DoNotBoxStruct.fs | 37 +- .../ClassTypeInitialization.fs | 627 +++++----- .../nested_generic_closure.fs | 349 ++++++ ...l => TestFunction01.fs.OptimizeOff.il.bsl} | 0 .../TestFunction01.fs.OptimizeOn.il.debug.bsl | 71 ++ ...estFunction01.fs.OptimizeOn.il.release.bsl | 85 ++ ...l => TestFunction02.fs.OptimizeOff.il.bsl} | 0 .../TestFunction02.fs.OptimizeOn.il.debug.bsl | 97 ++ ...estFunction02.fs.OptimizeOn.il.release.bsl | 112 ++ ...l => TestFunction03.fs.OptimizeOff.il.bsl} | 0 ...TestFunction03.fs.OptimizeOn.il.debug.bsl} | 54 +- ...estFunction03.fs.OptimizeOn.il.release.bsl | 126 ++ ... => TestFunction03b.fs.OptimizeOff.il.bsl} | 0 ...TestFunction03b.fs.OptimizeOn.il.debug.bsl | 122 ++ ...stFunction03b.fs.OptimizeOn.il.release.bsl | 133 +++ ... => TestFunction03c.fs.OptimizeOff.il.bsl} | 0 ...TestFunction03c.fs.OptimizeOn.il.debug.bsl | 138 +++ ...stFunction03c.fs.OptimizeOn.il.release.bsl | 144 +++ ...l => TestFunction04.fs.OptimizeOff.il.bsl} | 0 .../TestFunction04.fs.OptimizeOn.il.debug.bsl | 108 ++ ...estFunction04.fs.OptimizeOn.il.release.bsl | 123 ++ ...l => TestFunction05.fs.OptimizeOff.il.bsl} | 0 .../TestFunction05.fs.OptimizeOn.il.debug.bsl | 101 ++ ...estFunction05.fs.OptimizeOn.il.release.bsl | 112 ++ ...alInternalSignatureOff.OptimizeOff.il.bsl} | 0 ...ternalSignatureOff.OptimizeOn.il.debug.bsl | 108 ++ ...rnalSignatureOff.OptimizeOn.il.release.bsl | 119 ++ ...ealInternalSignatureOn.OptimizeOff.il.bsl} | 120 +- ...nternalSignatureOn.OptimizeOn.il.debug.bsl | 139 +++ ...ernalSignatureOn.OptimizeOn.il.release.bsl | 150 +++ ... => TestFunction09b.fs.OptimizeOff.il.bsl} | 0 .../TestFunction09b.fs.OptimizeOn.il.bsl | 206 ++++ ...=> TestFunction09b1.fs.OptimizeOff.il.bsl} | 0 .../TestFunction09b1.fs.OptimizeOn.il.bsl | 206 ++++ ...=> TestFunction09b2.fs.OptimizeOff.il.bsl} | 0 .../TestFunction09b2.fs.OptimizeOn.il.bsl | 206 ++++ ...=> TestFunction09b3.fs.OptimizeOff.il.bsl} | 0 .../TestFunction09b3.fs.OptimizeOn.il.bsl | 206 ++++ ...alInternalSignatureOff.OptimizeOff.il.bsl} | 0 ...ternalSignatureOff.OptimizeOn.il.debug.bsl | 100 ++ ...rnalSignatureOff.OptimizeOn.il.release.bsl | 110 ++ ...ealInternalSignatureOn.OptimizeOff.il.bsl} | 10 - ...nternalSignatureOn.OptimizeOn.il.debug.bsl | 119 ++ ...ernalSignatureOn.OptimizeOn.il.release.bsl | 129 +++ ...l => TestFunction10.fs.OptimizeOff.il.bsl} | 0 .../TestFunction10.fs.OptimizeOn.il.bsl | 67 ++ ...l => TestFunction15.fs.OptimizeOff.il.bsl} | 0 .../TestFunction15.fs.OptimizeOn.il.bsl | 113 ++ ...tion16.fs.OptimizeOff.il.net472.debug.bsl} | 0 ...on16.fs.OptimizeOff.il.net472.release.bsl} | 0 ...ion16.fs.OptimizeOff.il.netcore.debug.bsl} | 0 ...n16.fs.OptimizeOff.il.netcore.release.bsl} | 0 ...nction16.fs.OptimizeOn.il.net472.debug.bsl | 681 +++++++++++ ...tion16.fs.OptimizeOn.il.net472.release.bsl | 681 +++++++++++ ...ction16.fs.OptimizeOn.il.netcore.debug.bsl | 591 ++++++++++ ...ion16.fs.OptimizeOn.il.netcore.release.bsl | 591 ++++++++++ ...tion17.fs.OptimizeOff.il.net472.debug.bsl} | 30 +- ...on17.fs.OptimizeOff.il.net472.release.bsl} | 0 ...ion17.fs.OptimizeOff.il.netcore.debug.bsl} | 26 +- ...n17.fs.OptimizeOff.il.netcore.release.bsl} | 26 +- ...TestFunction17.fs.OptimizeOn.il.net472.bsl | 582 ++++++++++ ...estFunction17.fs.OptimizeOn.il.netcore.bsl | 492 ++++++++ .../TestFunction18.fs.il.netcore.bsl | 10 - ...l => TestFunction19.fs.OptimizeOff.il.bsl} | 0 .../TestFunction19.fs.OptimizeOn.il.debug.bsl | 211 ++++ ...estFunction19.fs.OptimizeOn.il.release.bsl | 221 ++++ ...l => TestFunction20.fs.OptimizeOff.il.bsl} | 512 ++++---- .../TestFunction20.fs.OptimizeOn.il.debug.bsl | 237 ++++ ...estFunction20.fs.OptimizeOn.il.release.bsl | 247 ++++ ...tion21.fs.OptimizeOff.il.net472.debug.bsl} | 0 ...on21.fs.OptimizeOff.il.net472.release.bsl} | 0 ...ion21.fs.OptimizeOff.il.netcore.debug.bsl} | 0 ...n21.fs.OptimizeOff.il.netcore.release.bsl} | 0 ...nction21.fs.OptimizeOn.il.net472.debug.bsl | 765 ++++++++++++ ...tion21.fs.OptimizeOn.il.net472.release.bsl | 775 +++++++++++++ ...ction21.fs.OptimizeOn.il.netcore.debug.bsl | 675 +++++++++++ ...ion21.fs.OptimizeOn.il.netcore.release.bsl | 685 +++++++++++ ...fs.RealInternalSignatureOff.il.netcore.bsl | 10 - ....fs.RealInternalSignatureOn.il.netcore.bsl | 10 - ...fs.RealInternalSignatureOff.il.netcore.bsl | 10 - ....fs.RealInternalSignatureOn.il.netcore.bsl | 10 - ...fs.RealInternalSignatureOff.il.netcore.bsl | 10 - ....fs.RealInternalSignatureOn.il.netcore.bsl | 10 - ...fs.RealInternalSignatureOff.il.netcore.bsl | 10 - ....fs.RealInternalSignatureOn.il.netcore.bsl | 10 - ...fs.RealInternalSignatureOff.il.netcore.bsl | 10 - ....fs.RealInternalSignatureOn.il.netcore.bsl | 10 - ...nalSignatureOff.OptimizeOff.il.net472.bsl} | 0 ...alSignatureOff.OptimizeOff.il.netcore.bsl} | 10 - ...ernalSignatureOff.OptimizeOn.il.net472.bsl | 77 ++ ...nalSignatureOff.OptimizeOn.il.netcore.bsl} | 36 +- ...rnalSignatureOn.OptimizeOff.il.net472.bsl} | 0 ...nalSignatureOn.OptimizeOff.il.netcore.bsl} | 10 - ...ternalSignatureOn.OptimizeOn.il.net472.bsl | 96 ++ ...ernalSignatureOn.OptimizeOn.il.netcore.bsl | 97 ++ ...nalSignatureOff.OptimizeOff.il.net472.bsl} | 0 ...alSignatureOff.OptimizeOff.il.netcore.bsl} | 10 - ...ernalSignatureOff.OptimizeOn.il.net472.bsl | 61 + ...rnalSignatureOff.OptimizeOn.il.netcore.bsl | 62 + ...rnalSignatureOn.OptimizeOff.il.net472.bsl} | 0 ...nalSignatureOn.OptimizeOff.il.netcore.bsl} | 10 - ...ternalSignatureOn.OptimizeOn.il.net472.bsl | 80 ++ ...ernalSignatureOn.OptimizeOn.il.netcore.bsl | 81 ++ ...nalSignatureOff.OptimizeOff.il.net472.bsl} | 0 ...alSignatureOff.OptimizeOff.il.netcore.bsl} | 10 - ...ernalSignatureOff.OptimizeOn.il.net472.bsl | 308 +++++ ...nalSignatureOff.OptimizeOn.il.netcore.bsl} | 174 ++- ...rnalSignatureOn.OptimizeOff.il.net472.bsl} | 10 - ...nalSignatureOn.OptimizeOff.il.netcore.bsl} | 10 - ...ternalSignatureOn.OptimizeOn.il.net472.bsl | 308 +++++ ...ernalSignatureOn.OptimizeOn.il.netcore.bsl | 309 +++++ ...l => TestFunction23.fs.OptimizeOff.il.bsl} | 31 +- ...rnalSignatureOff.OptimizeOff.il.net472.bsl | 165 +++ ...alSignatureOff.OptimizeOff.il.netcore.bsl} | 349 +++--- ...ignatureOff.OptimizeOn.il.net472.debug.bsl | 126 ++ ...natureOff.OptimizeOn.il.net472.release.bsl | 149 +++ ...gnatureOff.OptimizeOn.il.netcore.debug.bsl | 127 ++ ...atureOff.OptimizeOn.il.netcore.release.bsl | 150 +++ ...ernalSignatureOn.OptimizeOff.il.net472.bsl | 165 +++ ...rnalSignatureOn.OptimizeOff.il.netcore.bsl | 166 +++ ...SignatureOn.OptimizeOn.il.net472.debug.bsl | 126 ++ ...gnatureOn.OptimizeOn.il.net472.release.bsl | 176 +++ ...ignatureOn.OptimizeOn.il.netcore.debug.bsl | 127 ++ ...natureOn.OptimizeOn.il.netcore.release.bsl | 177 +++ ...natureOff.OptimizeOff.il.net472.debug.bsl} | 30 +- ...tureOff.OptimizeOff.il.net472.release.bsl} | 30 +- ...atureOff.OptimizeOff.il.netcore.debug.bsl} | 26 +- ...ureOff.OptimizeOff.il.netcore.release.bsl} | 26 +- ...ignatureOff.OptimizeOn.il.net472.debug.bsl | 821 +++++++++++++ ...natureOff.OptimizeOn.il.net472.release.bsl | 821 +++++++++++++ ...gnatureOff.OptimizeOn.il.netcore.debug.bsl | 731 ++++++++++++ ...atureOff.OptimizeOn.il.netcore.release.bsl | 731 ++++++++++++ ...ignatureOn.OptimizeOff.il.net472.debug.bsl | 1025 +++++++++++++++++ ...natureOn.OptimizeOff.il.net472.release.bsl | 911 +++++++++++++++ ...gnatureOn.OptimizeOff.il.netcore.debug.bsl | 935 +++++++++++++++ ...atureOn.OptimizeOff.il.netcore.release.bsl | 821 +++++++++++++ ...SignatureOn.OptimizeOn.il.net472.debug.bsl | 821 +++++++++++++ ...gnatureOn.OptimizeOn.il.net472.release.bsl | 821 +++++++++++++ ...ignatureOn.OptimizeOn.il.netcore.debug.bsl | 731 ++++++++++++ ...natureOn.OptimizeOn.il.netcore.release.bsl | 731 ++++++++++++ .../EmittedIL/TestFunctions/TestFunctions.fs | 89 +- ...ernalSignatureOff.OptimizeOn.il.debug.bsl} | 310 +++-- ...rnalSignatureOff.OptimizeOn.il.release.bsl | 384 ++++++ ...3.fs.RealInternalSignatureOff.il.debug.bsl | 405 ------- ...fs.RealInternalSignatureOff.il.release.bsl | 405 ------- ...ternalSignatureOn.OptimizeOn.il.debug.bsl} | 310 +++-- ...ernalSignatureOn.OptimizeOn.il.release.bsl | 384 ++++++ ...43.fs.RealInternalSignatureOn.il.debug.bsl | 415 ------- ....fs.RealInternalSignatureOn.il.release.bsl | 415 ------- .../Signatures/SigGenerationRoundTripTests.fs | 16 +- .../E_LessThanDotOpenParen001.fs | 31 - tests/FSharp.Test.Utilities/Compiler.fs | 35 +- .../FileInlineDataAttribute.fs | 26 +- tests/FSharp.Test.Utilities/XunitHelpers.fs | 6 +- ...FSharp.Compiler.Service_Release_net9.0.bsl | 4 +- ...ompiler.Service_Release_netstandard2.0.bsl | 4 +- .../CodeGen/EmittedIL/TaskGeneratedCode.fs | 56 +- 168 files changed, 26831 insertions(+), 3758 deletions(-) create mode 100644 docs/release-notes/.FSharp.Compiler.Service/9.0.300.md create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/RealInternalSignature/nested_generic_closure.fs rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction01.fs.il.bsl => TestFunction01.fs.OptimizeOff.il.bsl} (100%) create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction01.fs.OptimizeOn.il.debug.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction01.fs.OptimizeOn.il.release.bsl rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction02.fs.il.bsl => TestFunction02.fs.OptimizeOff.il.bsl} (100%) create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction02.fs.OptimizeOn.il.debug.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction02.fs.OptimizeOn.il.release.bsl rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction03.fs.il.net472.bsl => TestFunction03.fs.OptimizeOff.il.bsl} (100%) rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction03.fs.il.netcore.bsl => TestFunction03.fs.OptimizeOn.il.debug.bsl} (66%) create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction03.fs.OptimizeOn.il.release.bsl rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction03b.fs.il.bsl => TestFunction03b.fs.OptimizeOff.il.bsl} (100%) create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction03b.fs.OptimizeOn.il.debug.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction03b.fs.OptimizeOn.il.release.bsl rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction03c.fs.il.net472.bsl => TestFunction03c.fs.OptimizeOff.il.bsl} (100%) create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction03c.fs.OptimizeOn.il.debug.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction03c.fs.OptimizeOn.il.release.bsl rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction04.fs.il.bsl => TestFunction04.fs.OptimizeOff.il.bsl} (100%) create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction04.fs.OptimizeOn.il.debug.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction04.fs.OptimizeOn.il.release.bsl rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction05.fs.il.bsl => TestFunction05.fs.OptimizeOff.il.bsl} (100%) create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction05.fs.OptimizeOn.il.debug.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction05.fs.OptimizeOn.il.release.bsl rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction06.fs.il.bsl => TestFunction06.fs.RealInternalSignatureOff.OptimizeOff.il.bsl} (100%) create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction06.fs.RealInternalSignatureOff.OptimizeOn.il.debug.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction06.fs.RealInternalSignatureOff.OptimizeOn.il.release.bsl rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction03c.fs.il.netcore.bsl => TestFunction06.fs.RealInternalSignatureOn.OptimizeOff.il.bsl} (59%) create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction06.fs.RealInternalSignatureOn.OptimizeOn.il.debug.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction06.fs.RealInternalSignatureOn.OptimizeOn.il.release.bsl rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction09b.fs.il.bsl => TestFunction09b.fs.OptimizeOff.il.bsl} (100%) create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b.fs.OptimizeOn.il.bsl rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction09b1.fs.il.bsl => TestFunction09b1.fs.OptimizeOff.il.bsl} (100%) create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b1.fs.OptimizeOn.il.bsl rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction09b2.fs.il.bsl => TestFunction09b2.fs.OptimizeOff.il.bsl} (100%) create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b2.fs.OptimizeOn.il.bsl rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction09b3.fs.il.bsl => TestFunction09b3.fs.OptimizeOff.il.bsl} (100%) create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b3.fs.OptimizeOn.il.bsl rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction09b4.fs.RealInternalSignatureOff.il.bsl => TestFunction09b4.fs.RealInternalSignatureOff.OptimizeOff.il.bsl} (100%) create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b4.fs.RealInternalSignatureOff.OptimizeOn.il.debug.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b4.fs.RealInternalSignatureOff.OptimizeOn.il.release.bsl rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction09b4.fs.RealInternalSignatureOn.il.bsl => TestFunction09b4.fs.RealInternalSignatureOn.OptimizeOff.il.bsl} (96%) create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b4.fs.RealInternalSignatureOn.OptimizeOn.il.debug.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b4.fs.RealInternalSignatureOn.OptimizeOn.il.release.bsl rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction10.fs.il.bsl => TestFunction10.fs.OptimizeOff.il.bsl} (100%) create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction10.fs.OptimizeOn.il.bsl rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction15.fs.il.bsl => TestFunction15.fs.OptimizeOff.il.bsl} (100%) create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction15.fs.OptimizeOn.il.bsl rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction16.fs.il.net472.debug.bsl => TestFunction16.fs.OptimizeOff.il.net472.debug.bsl} (100%) rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction16.fs.il.net472.release.bsl => TestFunction16.fs.OptimizeOff.il.net472.release.bsl} (100%) rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction16.fs.il.netcore.debug.bsl => TestFunction16.fs.OptimizeOff.il.netcore.debug.bsl} (100%) rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction16.fs.il.netcore.release.bsl => TestFunction16.fs.OptimizeOff.il.netcore.release.bsl} (100%) create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction16.fs.OptimizeOn.il.net472.debug.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction16.fs.OptimizeOn.il.net472.release.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction16.fs.OptimizeOn.il.netcore.debug.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction16.fs.OptimizeOn.il.netcore.release.bsl rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction17.fs.il.net472.debug.bsl => TestFunction17.fs.OptimizeOff.il.net472.debug.bsl} (96%) rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction17.fs.il.net472.release.bsl => TestFunction17.fs.OptimizeOff.il.net472.release.bsl} (100%) rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction17.fs.il.netcore.debug.bsl => TestFunction17.fs.OptimizeOff.il.netcore.debug.bsl} (95%) rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction17.fs.il.netcore.release.bsl => TestFunction17.fs.OptimizeOff.il.netcore.release.bsl} (95%) create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.OptimizeOn.il.net472.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.OptimizeOn.il.netcore.bsl rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction19.fs.il.bsl => TestFunction19.fs.OptimizeOff.il.bsl} (100%) create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction19.fs.OptimizeOn.il.debug.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction19.fs.OptimizeOn.il.release.bsl rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction20.fs.il.bsl => TestFunction20.fs.OptimizeOff.il.bsl} (97%) create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction20.fs.OptimizeOn.il.debug.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction20.fs.OptimizeOn.il.release.bsl rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction21.fs.il.net472.debug.bsl => TestFunction21.fs.OptimizeOff.il.net472.debug.bsl} (100%) rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction21.fs.il.net472.release.bsl => TestFunction21.fs.OptimizeOff.il.net472.release.bsl} (100%) rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction21.fs.il.netcore.debug.bsl => TestFunction21.fs.OptimizeOff.il.netcore.debug.bsl} (100%) rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction21.fs.il.netcore.release.bsl => TestFunction21.fs.OptimizeOff.il.netcore.release.bsl} (100%) create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction21.fs.OptimizeOn.il.net472.debug.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction21.fs.OptimizeOn.il.net472.release.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction21.fs.OptimizeOn.il.netcore.debug.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction21.fs.OptimizeOn.il.netcore.release.bsl rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction22f.fs.RealInternalSignatureOff.il.net472.bsl => TestFunction22f.fs.RealInternalSignatureOff.OptimizeOff.il.net472.bsl} (100%) rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction22f.fs.RealInternalSignatureOff.il.netcore.bsl => TestFunction22f.fs.RealInternalSignatureOff.OptimizeOff.il.netcore.bsl} (94%) create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22f.fs.RealInternalSignatureOff.OptimizeOn.il.net472.bsl rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction22f.fs.RealInternalSignatureOn.il.netcore .bsl => TestFunction22f.fs.RealInternalSignatureOff.OptimizeOn.il.netcore.bsl} (75%) rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction22f.fs.RealInternalSignatureOn.il.net472.bsl => TestFunction22f.fs.RealInternalSignatureOn.OptimizeOff.il.net472.bsl} (100%) rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction22f.fs.RealInternalSignatureOn.il.bsl => TestFunction22f.fs.RealInternalSignatureOn.OptimizeOff.il.netcore.bsl} (95%) create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22f.fs.RealInternalSignatureOn.OptimizeOn.il.net472.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22f.fs.RealInternalSignatureOn.OptimizeOn.il.netcore.bsl rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction22g.fs.RealInternalSignatureOff.il.net472.bsl => TestFunction22g.fs.RealInternalSignatureOff.OptimizeOff.il.net472.bsl} (100%) rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction22g.fs.RealInternalSignatureOff.il.netcore.bsl => TestFunction22g.fs.RealInternalSignatureOff.OptimizeOff.il.netcore.bsl} (93%) create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22g.fs.RealInternalSignatureOff.OptimizeOn.il.net472.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22g.fs.RealInternalSignatureOff.OptimizeOn.il.netcore.bsl rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction22g.fs.RealInternalSignatureOn.il.net472.bsl => TestFunction22g.fs.RealInternalSignatureOn.OptimizeOff.il.net472.bsl} (100%) rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction22g.fs.RealInternalSignatureOn.il.netcore.bsl => TestFunction22g.fs.RealInternalSignatureOn.OptimizeOff.il.netcore.bsl} (94%) create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22g.fs.RealInternalSignatureOn.OptimizeOn.il.net472.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22g.fs.RealInternalSignatureOn.OptimizeOn.il.netcore.bsl rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction22h.fs.RealInternalSignatureOff.il.net472.bsl => TestFunction22h.fs.RealInternalSignatureOff.OptimizeOff.il.net472.bsl} (100%) rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction22h.fs.RealInternalSignatureOn.il.netcore .bsl => TestFunction22h.fs.RealInternalSignatureOff.OptimizeOff.il.netcore.bsl} (98%) create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22h.fs.RealInternalSignatureOff.OptimizeOn.il.net472.bsl rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction22h.fs.RealInternalSignatureOff.il.netcore.bsl => TestFunction22h.fs.RealInternalSignatureOff.OptimizeOn.il.netcore.bsl} (68%) rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction22h.fs.RealInternalSignatureOn.il.net472.bsl => TestFunction22h.fs.RealInternalSignatureOn.OptimizeOff.il.net472.bsl} (98%) rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction22h.fs.RealInternalSignatureOn.il.bsl => TestFunction22h.fs.RealInternalSignatureOn.OptimizeOff.il.netcore.bsl} (98%) create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22h.fs.RealInternalSignatureOn.OptimizeOn.il.net472.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22h.fs.RealInternalSignatureOn.OptimizeOn.il.netcore.bsl rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction23.fs.il.net472.bsl => TestFunction23.fs.OptimizeOff.il.bsl} (90%) create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction23.fs.RealInternalSignatureOff.OptimizeOff.il.net472.bsl rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction23.fs.il.netcore.bsl => TestFunction23.fs.RealInternalSignatureOff.OptimizeOff.il.netcore.bsl} (87%) create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction23.fs.RealInternalSignatureOff.OptimizeOn.il.net472.debug.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction23.fs.RealInternalSignatureOff.OptimizeOn.il.net472.release.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction23.fs.RealInternalSignatureOff.OptimizeOn.il.netcore.debug.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction23.fs.RealInternalSignatureOff.OptimizeOn.il.netcore.release.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction23.fs.RealInternalSignatureOn.OptimizeOff.il.net472.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction23.fs.RealInternalSignatureOn.OptimizeOff.il.netcore.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction23.fs.RealInternalSignatureOn.OptimizeOn.il.net472.debug.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction23.fs.RealInternalSignatureOn.OptimizeOn.il.net472.release.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction23.fs.RealInternalSignatureOn.OptimizeOn.il.netcore.debug.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction23.fs.RealInternalSignatureOn.OptimizeOn.il.netcore.release.bsl rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction24.fs.il.net472.debug.bsl => TestFunction24.fs.RealInternalSignatureOff.OptimizeOff.il.net472.debug.bsl} (97%) rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction24.fs.il.net472.release.bsl => TestFunction24.fs.RealInternalSignatureOff.OptimizeOff.il.net472.release.bsl} (96%) rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction24.fs.il.netcore.debug.bsl => TestFunction24.fs.RealInternalSignatureOff.OptimizeOff.il.netcore.debug.bsl} (97%) rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{TestFunction24.fs.il.netcore.release.bsl => TestFunction24.fs.RealInternalSignatureOff.OptimizeOff.il.netcore.release.bsl} (96%) create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOff.OptimizeOn.il.net472.debug.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOff.OptimizeOn.il.net472.release.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOff.OptimizeOn.il.netcore.debug.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOff.OptimizeOn.il.netcore.release.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOn.OptimizeOff.il.net472.debug.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOn.OptimizeOff.il.net472.release.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOn.OptimizeOff.il.netcore.debug.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOn.OptimizeOff.il.netcore.release.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOn.OptimizeOn.il.net472.debug.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOn.OptimizeOn.il.net472.release.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOn.OptimizeOn.il.netcore.debug.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOn.OptimizeOn.il.netcore.release.bsl rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{Verify13043.fs.RealInternalSignatureOn.OptimizeOn.il.bsl => Verify13043.fs.RealInternalSignatureOff.OptimizeOn.il.debug.bsl} (57%) create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/Verify13043.fs.RealInternalSignatureOff.OptimizeOn.il.release.bsl delete mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/Verify13043.fs.RealInternalSignatureOff.il.debug.bsl delete mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/Verify13043.fs.RealInternalSignatureOff.il.release.bsl rename tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/{Verify13043.fs.RealInternalSignatureOff.OptimizeOn.il.bsl => Verify13043.fs.RealInternalSignatureOn.OptimizeOn.il.debug.bsl} (57%) create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/Verify13043.fs.RealInternalSignatureOn.OptimizeOn.il.release.bsl delete mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/Verify13043.fs.RealInternalSignatureOn.il.debug.bsl delete mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/Verify13043.fs.RealInternalSignatureOn.il.release.bsl delete mode 100644 tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/LexicalAnalysis/SymbolicOperators/E_LessThanDotOpenParen001.fs diff --git a/.gitignore b/.gitignore index f0dbae4d2f3..33c9666c14b 100644 --- a/.gitignore +++ b/.gitignore @@ -129,4 +129,9 @@ tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstanda /tests/AheadOfTime/Trimming/output.txt *.svclog micro.exe -positive.exe \ No newline at end of file +positive.exe +/tests/FSharp.Compiler.ComponentTests/FSharpChecker/StandardError.txt +/tests/FSharp.Compiler.ComponentTests/FSharpChecker/StandardOutput.txt + +# ilverify baseline result files +*.bsl.actual \ No newline at end of file diff --git a/DEVGUIDE.md b/DEVGUIDE.md index cf3a9419481..2ca137ba100 100644 --- a/DEVGUIDE.md +++ b/DEVGUIDE.md @@ -204,6 +204,33 @@ Linux/macOS: export TEST_UPDATE_BSL=1 ``` +## Retain Test run built artifacts + +When investigating tests issues it is sometimes useful to examine the artifacts built when running tests. Those built using the newer test framework are usually, +built in the %TEMP%\FSharp.Test.Utilities subdirectory. + +To tell the test framework to not cleanup these files use the: FSHARP_RETAIN_TESTBUILDS environment variable + +Windows: + +CMD: + +```shell +set FSHARP_RETAIN_TESTBUILDS=1 +``` + +PowerShell: + +```shell +$env:FSHARP_RETAIN_TESTBUILDS=1 +``` + +Linux/macOS: + +```shell +export FSHARP_RETAIN_TESTBUILDS=1 +``` + Next, run a build script build (debug or release, desktop or coreclr, depending which baselines you need to update), and test as described [above](#Testing-from-the-command-line). For example: `./Build.cmd -c Release -testCoreClr` to update Release CoreCLR baselines. diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.200.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.200.md index 1d799b37f11..3908fc98dd5 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.200.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.200.md @@ -1,5 +1,6 @@ ### Fixed +* Fix Realsig+ generates nested closures with incorrect Generic ([Issue #17797](https://github.com/dotnet/fsharp/issues/17797), [PR #17877](https://github.com/dotnet/fsharp/pull/17877)) * Fix missing TailCall warning in Sequential in use scope ([PR #17927](https://github.com/dotnet/fsharp/pull/17927)) * Fix false negatives for passing null to "obj" arguments. Only "obj | null" can now subsume any type ([PR #17757](https://github.com/dotnet/fsharp/pull/17757)) * Fix internal error when calling 'AddSingleton' and other overloads only differing in generic arity ([PR #17804](https://github.com/dotnet/fsharp/pull/17804)) diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md new file mode 100644 index 00000000000..375263a2a0e --- /dev/null +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md @@ -0,0 +1,12 @@ +### Fixed + +* Fix Realsig+ generates nested closures with incorrect Generic ([Issue #17797](https://github.com/dotnet/fsharp/issues/17797), [PR #17877](https://github.com/dotnet/fsharp/pull/17877)) + +### Added + + +### Changed + + +### Breaking Changes + diff --git a/src/Compiler/CodeGen/IlxGen.fs b/src/Compiler/CodeGen/IlxGen.fs index 60a6f012976..861caeea4ab 100644 --- a/src/Compiler/CodeGen/IlxGen.fs +++ b/src/Compiler/CodeGen/IlxGen.fs @@ -521,7 +521,8 @@ let ComputeTypeAccess (tref: ILTypeRef) hidden (accessibility: Accessibility) re /// Indicates how type parameters are mapped to IL type variables [] -type TypeReprEnv(reprs: Map, count: int, templateReplacement: (TyconRef * ILTypeRef * Typars * TyparInstantiation) option) = +type TypeReprEnv + (reprs: Map, count: int, templateReplacement: (TyconRef * ILTypeRef * Typars * TyparInstantiation) option) = static let empty = TypeReprEnv(count = 0, reprs = Map.empty, templateReplacement = None) @@ -536,7 +537,7 @@ type TypeReprEnv(reprs: Map, count: int, templateReplacement: (Ty /// Lookup a type parameter member _.Item(tp: Typar, m: range) = try - reprs[tp.Stamp] + reprs[tp.Stamp] |> fst with :? KeyNotFoundException -> errorR (InternalError("Undefined or unsolved type variable: " + showL (typarL tp), m)) // Random value for post-hoc diagnostic analysis on generated tree * @@ -546,7 +547,7 @@ type TypeReprEnv(reprs: Map, count: int, templateReplacement: (Ty /// then it is ignored, since it doesn't correspond to a .NET type parameter. member tyenv.AddOne(tp: Typar) = if IsNonErasedTypar tp then - TypeReprEnv(reprs.Add(tp.Stamp, uint16 count), count + 1, templateReplacement) + TypeReprEnv(reprs.Add(tp.Stamp, (uint16 count, tp)), count + 1, templateReplacement) else tyenv @@ -573,6 +574,14 @@ 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 + /// Get a list of the Typars in this environment + member eenv.AsUserProvidedTypars() = + reprs + |> Map.toList + |> List.map (fun (_, (_, tp)) -> tp) + |> List.filter (fun tp -> not tp.IsCompilerGenerated) + |> Zset.ofList typarOrder + //-------------------------------------------------------------------------- // Generate type references //-------------------------------------------------------------------------- @@ -6904,14 +6913,6 @@ and GenFreevar cenv m eenvouter tyenvinner (fv: Val) = and GetIlxClosureFreeVars cenv m (thisVars: ValRef list) boxity eenv takenNames expr = let g = cenv.g - // Choose a base name for the closure - let basename = - let boundv = eenv.letBoundVars |> List.tryFind (fun v -> not v.IsCompilerGenerated) - - match boundv with - | Some v -> v.CompiledName cenv.g.CompilerGlobalState - | None -> "clo" - // Get a unique stamp for the closure. This must be stable for things that can be part of a let rec. let uniq = match expr with @@ -6921,18 +6922,34 @@ and GetIlxClosureFreeVars cenv m (thisVars: ValRef list) boxity eenv takenNames | _ -> newUnique () // Choose a name for the closure - let ilCloTypeRef = + let ilCloTypeRef, initialFreeTyvars = + let boundvar = + eenv.letBoundVars |> List.tryFind (fun v -> not v.IsCompilerGenerated) + + let basename = + match boundvar with + | Some v -> v.CompiledName cenv.g.CompilerGlobalState + | None -> "clo" + // FSharp 1.0 bug 3404: System.Reflection doesn't like '.' and '`' in type names let basenameSafeForUseAsTypename = CleanUpGeneratedTypeName basename - let suffixmark = expr.Range - let cloName = // Ensure that we have an g.CompilerGlobalState assert (g.CompilerGlobalState |> Option.isSome) - g.CompilerGlobalState.Value.StableNameGenerator.GetUniqueCompilerGeneratedName(basenameSafeForUseAsTypename, suffixmark, uniq) + g.CompilerGlobalState.Value.StableNameGenerator.GetUniqueCompilerGeneratedName(basenameSafeForUseAsTypename, expr.Range, uniq) + + let ilCloTypeRef = NestedTypeRefForCompLoc eenv.cloc cloName - NestedTypeRefForCompLoc eenv.cloc cloName + let initialFreeTyvars = + match g.realsig with + | true -> + { emptyFreeTyvars with + FreeTypars = eenv.tyenv.AsUserProvidedTypars() + } + | false -> emptyFreeTyvars + + ilCloTypeRef, initialFreeTyvars // Collect the free variables of the closure let cloFreeVarResults = @@ -6943,7 +6960,12 @@ and GetIlxClosureFreeVars cenv m (thisVars: ValRef list) boxity eenv takenNames | None -> opts | Some(tcref, _, typars, _) -> opts.WithTemplateReplacement(tyconRefEq g tcref, typars) - freeInExpr opts expr + accFreeInExpr + opts + expr + { emptyFreeVars with + FreeTyvars = initialFreeTyvars + } // Partition the free variables when some can be accessed from places besides the immediate environment // Also filter out the current value being bound, if any, as it is available from the "this" diff --git a/src/Compiler/TypedTree/CompilerGlobalState.fs b/src/Compiler/TypedTree/CompilerGlobalState.fs index 72da3da4f58..12dda2b08d8 100644 --- a/src/Compiler/TypedTree/CompilerGlobalState.fs +++ b/src/Compiler/TypedTree/CompilerGlobalState.fs @@ -73,4 +73,6 @@ let newUnique() = System.Threading.Interlocked.Increment &uniqueCount /// Unique name generator for stamps attached to to val_specs, tycon_specs etc. //++GLOBAL MUTABLE STATE (concurrency-safe) let mutable private stampCount = 0L -let newStamp() = System.Threading.Interlocked.Increment &stampCount +let newStamp() = + let stamp = System.Threading.Interlocked.Increment &stampCount + stamp \ No newline at end of file diff --git a/src/Compiler/TypedTree/TypedTreeOps.fsi b/src/Compiler/TypedTree/TypedTreeOps.fsi index 6433cf16d3e..10f66bf63bf 100755 --- a/src/Compiler/TypedTree/TypedTreeOps.fsi +++ b/src/Compiler/TypedTree/TypedTreeOps.fsi @@ -1186,6 +1186,9 @@ val accFreeInDecisionTree: FreeVarOptions -> DecisionTree -> FreeVars -> FreeVar /// Get the free variables in a module definition. val freeInModuleOrNamespace: FreeVarOptions -> ModuleOrNamespaceContents -> FreeVars +/// Get the free variables in an expression with accumulator +val accFreeInExpr: FreeVarOptions -> Expr -> FreeVars -> FreeVars + /// Get the free variables in an expression. val freeInExpr: FreeVarOptions -> Expr -> FreeVars diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/LexicalAnalysis/SymbolicOperators.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/LexicalAnalysis/SymbolicOperators.fs index 331086d940a..73a94c080ec 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/LexicalAnalysis/SymbolicOperators.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/LexicalAnalysis/SymbolicOperators.fs @@ -31,11 +31,38 @@ module SymbolicOperators = // This test was automatically generated (moved from FSharpQA suite - Conformance/LexicalAnalysis/SymbolicOperators) //This code is not sufficiently generic\. The type variable \^T when \^T : \(static member \( \+ \) : \^T \* \^T -> \^a\) could not be generalized because it would escape its scope - [] - let ``SymbolicOperators - E_LessThanDotOpenParen001_fs - --flaterrors`` compilation = - compilation - |> asFsx + [] // RealSig + [] // Regular + [] + let ``SymbolicOperators_E_LessThanDotOpenParen001_fs`` (realsig) = + Fsx """ + +type public TestType<'T,'S>() = + + member public s.Value with get() = Unchecked.defaultof<'T> + static member public (+++) (a : TestType<'T,'S>, b : TestType<'T,'S>) = a.Value + static member public (+++) (a : TestType<'T,'S>, b : 'T) = b + static member public (+++) (a : 'T, b : TestType<'T,'S>) = a + static member public (+++) (a : TestType<'T,'S>, b : 'T -> 'S) = a.Value + static member public (+++) (a : 'S -> 'T, b : TestType<'T,'S>) = (a 17) + b.Value + +let inline (+++) (a : ^a) (b : ^b) = ((^a or ^b): (static member (+++): ^a * ^b -> ^c) (a,b) ) + +let tt0 = TestType() +let tt1 = TestType() + +let f (x : string) = 18 + +let a0 = tt0 +++ tt1 +let a1 = tt0 +++ 11 +let a2 = 12 +++ tt1 +let a3 = tt0 +++ (fun x -> "18") +let a4 = f +++ tt0 + +let a5 = TestType.(+++)(f, tt0) +let a6 = TestType.(+++)((fun (x : string) -> 18), tt0)""" |> withOptions ["--flaterrors"] + |> withRealInternalSignature realsig |> compile |> shouldFail |> withErrorCode 0670 diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs index 5623ac08ca7..bfa44185a1c 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs @@ -8,18 +8,20 @@ open FSharp.Test.Compiler module TypesAndTypeConstraints_IWSAMsAndSRTPs = - let typesModule = + let typesModule realsig = FSharp (loadSourceFromFile (Path.Combine(__SOURCE_DIRECTORY__, "Types.fs"))) |> withName "Types" |> withLangVersion70 + |> withRealInternalSignature realsig |> withOptions ["--nowarn:3535"] - let setupCompilation compilation = + let setupCompilation realsig compilation = compilation |> asExe |> withLangVersion70 - |> withReferences [typesModule] - + |> withRealInternalSignature realsig + |> withReferences [typesModule realsig] + let verifyCompile compilation = compilation |> asExe @@ -71,7 +73,7 @@ let main _ = #endif let ``IWSAM test files`` compilation = compilation - |> setupCompilation + |> setupCompilation false |> withLangVersionPreview |> compileAndRun |> shouldSucceed @@ -380,43 +382,57 @@ let main _ = |> withDiagnosticMessage errorMessage |> ignore - [] - let ``IWSAM warning`` () = - Fsx "let fExpectAWarning(x: Types.ISinOperator<'T>) = ()" - |> withReferences [typesModule] + [] // RealSig + [] // Regular + [] + let ``IWSAM warning`` (realsig) = + Fsx "let fExpectAWarning(x: Types.ISinOperator<'T>) = (realsig)" + |> withReferences [typesModule realsig] + |> withRealInternalSignature realsig |> compile |> shouldFail |> withWarningCode 3536 |> withDiagnosticMessage """'ISinOperator<_>' is normally used as a type constraint in generic code, e.g. "'T when ISomeInterface<'T>" or "let f (x: #ISomeInterface<_>)". See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn "3536"' or '--nowarn:3536'.""" |> ignore - [] - let ``Multiple support types trait error`` () = + [] // RealSig + [] // Regular + [] + let ``Multiple support types trait error`` (realsig) = Fsx "let inline f5 (x: 'T when ('T or int) : (static member A: int) ) = 'T.A" + |> withRealInternalSignature realsig |> compile |> shouldFail |> withErrorCode 3537 |> withDiagnosticMessage "The trait 'A' invoked by this call has multiple support types. This invocation syntax is not permitted for such traits. See https://aka.ms/fsharp-srtp for guidance." |> ignore - [] - let ``SRTP Delegate conversion not supported`` () = + [] // RealSig + [] // Regular + [] + let ``SRTP Delegate conversion not supported`` (realsig) = Fsx "let inline f_TraitWithDelegate<'T when 'T : (static member StaticMethod: x: System.Func -> int) >() = 'T.StaticMethod(fun x -> x + 1)" + |> withRealInternalSignature realsig |> compile |> shouldFail |> withErrorMessage "This function takes too many arguments, or is used in a context where a function is not expected" - [] - let ``SRTP Expression conversion not supported`` () = + [] // RealSig + [] // Regular + [] + let ``SRTP Expression conversion not supported`` (realsig) = Fsx "let inline f_TraitWithExpression<'T when 'T : (static member StaticMethod: x: System.Linq.Expressions.Expression> -> int) >() = 'T.StaticMethod(fun x -> x + 1)" + |> withRealInternalSignature realsig |> compile |> shouldFail |> withErrorMessage "This function takes too many arguments, or is used in a context where a function is not expected" - [] - let ``IWSAM Delegate conversion works`` () = + [] // RealSig + [] // Regular + [] + let ``IWSAM Delegate conversion works`` (realsig) = Fsx """ open Types @@ -428,12 +444,14 @@ let main _ = failwith "Unexpected result" """ - |> setupCompilation + |> setupCompilation realsig |> compileAndRun |> shouldSucceed - [] - let ``IWSAM Expression conversion works`` () = + [] // RealSig + [] // Regular + [] + let ``IWSAM Expression conversion works`` (realsig) = Fsx """ open Types @@ -445,28 +463,36 @@ let main _ = failwith "Unexpected result" """ - |> setupCompilation + |> setupCompilation realsig |> compileAndRun |> shouldSucceed - [] - let ``SRTP Byref can be passed with old syntax`` () = + [] // RealSig + [] // Regular + [] + let ``SRTP Byref can be passed with old syntax`` (realsig) = Fsx "let inline f_TraitWithByref<'T when 'T : ( static member TryParse: string * byref -> bool) >() = let mutable result = 0 (^T : ( static member TryParse: x: string * byref -> bool) (\"42\", &result))" + |> withRealInternalSignature realsig |> compile |> shouldSucceed - [] - let ``SRTP Byref can be passed with new syntax`` () = + [] // RealSig + [] // Regular + [] + let ``SRTP Byref can be passed with new syntax`` (realsig) = Fsx "let inline f_TraitWithByref<'T when 'T : ( static member TryParse: string * byref -> bool) >() = let mutable result = 0 'T.TryParse(\"42\", &result)" + |> withRealInternalSignature realsig |> compile |> shouldSucceed - [] - let ``Call with old syntax`` () = + [] // RealSig + [] // Regular + [] + let ``Call with old syntax`` (realsig) = Fsx """ type C1() = static member X(p: C1 byref) = p @@ -479,11 +505,14 @@ let main _ = if g1 <> c1 then failwith "Unexpected result" """ + |> withRealInternalSignature realsig |> compileExeAndRun |> shouldSucceed - [] - let ``Call with new syntax`` () = + [] // RealSig + [] // Regular + [] + let ``Call with new syntax`` (realsig) = Fsx """ type C2() = static member X(p: C2 byref) = p @@ -495,11 +524,14 @@ let main _ = if g2 <> c2 then failwith "Unexpected result" """ + |> withRealInternalSignature realsig |> compileExeAndRun |> shouldSucceed - [] - let ``Call with tuple`` () = + [] // RealSig + [] // Regular + [] + let ``Call with tuple`` (realsig) = Fsx """ type C3() = @@ -512,11 +544,14 @@ let main _ = if g3 <> c3 then failwith "Unexpected result" """ + |> withRealInternalSignature realsig |> compileExeAndRun |> shouldSucceed - [] - let test4 () = + [] // RealSig + [] // Regular + [] + let test4 (realsig) = Fsx """ type C4() = static member X() = C4() @@ -527,14 +562,17 @@ let main _ = if g4.GetType() <> typeof then failwith "Unexpected result" """ + |> withRealInternalSignature realsig |> compileExeAndRun |> shouldSucceed // NOTE: Trait constraints that involve byref returns currently can never be satisfied by any method. No other warning is given. // This is a bug that may be fixed in the future. // These tests are pinning down current behavior. - [] - let ``Byref returns not allowed`` () = + [] // RealSig + [] // Regular + [] + let ``Byref returns not allowed`` (realsig) = Fsx """ type C5() = static member X(p: C5 byref) = &p @@ -543,12 +581,15 @@ let main _ = let mutable c5 = C5() let g5 () = callX5 &c5 """ + |> withRealInternalSignature realsig |> compile |> shouldFail |> withDiagnosticMessageMatches "This expression was expected to have type\\s+'byref'\\s+but here has type\\s+'C5'" - [] - let ``Byref returns not allowed pt 2`` () = + [] // RealSig + [] // Regular + [] + let ``Byref returns not allowed pt 2`` (realsig) = Fsx """ type C6() = static member X(p: C6 byref) = &p @@ -558,11 +599,12 @@ let main _ = let mutable c6 = C6() let g6 () = callX6 &c6 """ + |> withRealInternalSignature realsig |> compile |> shouldFail |> withDiagnosticMessageMatches "This expression was expected to have type\\s+'byref'\\s+but here has type\\s+'C6'" - let library = + let library realsig= FSharp """ module Lib @@ -580,65 +622,79 @@ let main _ = let add1 (x: int) = x + 1 """ + |> withRealInternalSignature realsig |> withLangVersion70 |> withOptions ["--nowarn:3535"] - [] - let ``Function implicit conversion not supported on constrained type`` () = + [] // RealSig + [] // Regular + [] + let ``Function implicit conversion not supported on constrained type`` (realsig) = Fsx """ open Lib let f_function_implicit_conversion<'T when ICanBeInt<'T>>(a: 'T) : int = add1(a) """ - |> withReferences [library] + |> withReferences [library realsig] |> withLangVersion70 + |> withRealInternalSignature realsig |> compile |> shouldFail |> withDiagnosticMessageMatches "This expression was expected to have type\\s+'int'\\s+but here has type\\s+''T'" - [] - let ``Method implicit conversion not supported on constrained type`` () = + [] // RealSig + [] // Regular + [] + let ``Method implicit conversion not supported on constrained type`` (realsig) = Fsx """ open Lib let f_method_implicit_conversion<'T when ICanBeInt<'T>>(a: 'T) : int = C.TakeInt(a) """ - |> withReferences [library] + |> withRealInternalSignature realsig + |> withReferences [library realsig] |> withLangVersion70 |> compile |> shouldFail |> withDiagnosticMessageMatches "This expression was expected to have type\\s+'int'\\s+but here has type\\s+''T'" - [] - let ``Function explicit conversion works on constrained type`` () = + [] // RealSig + [] // Regular + [] + let ``Function explicit conversion works on constrained type`` (realsig) = Fsx """ open Lib let f_function_explicit_conversion<'T when ICanBeInt<'T>>(a: 'T) : int = add1(int(a)) """ - |> withReferences [library] + |> withReferences [library realsig] |> withLangVersion70 |> compile |> shouldSucceed - [] - let ``Method explicit conversion works on constrained type`` () = + [] // RealSig + [] // Regular + [] + let ``Method explicit conversion works on constrained type`` (realsig) = Fsx """ open Lib let f_method_explicit_conversion<'T when ICanBeInt<'T>>(a: 'T) : int = C.TakeInt(int(a)) """ - |> withReferences [library] + |> withRealInternalSignature realsig + |> withReferences [library realsig] |> withLangVersion70 |> compile |> shouldSucceed - [] - let ``Nominal type can be used after or`` () = + [] // RealSig + [] // Regular + [] + let ``Nominal type can be used after or`` (realsig) = Fsx """ type C() = @@ -652,13 +708,16 @@ let main _ = if not (callX "A" (C()) = "A OK") then failwith "Unexpected result" """ + |> withRealInternalSignature realsig |> withLangVersion70 |> asExe |> compileAndRun |> shouldSucceed - [] - let ``Nominal type can't be used before or`` () = + [] // RealSig + [] // Regular + [] + let ``Nominal type can't be used before or`` (realsig) = Fsx """ type C() = @@ -666,13 +725,16 @@ let main _ = let inline callX (x: 'T) (y: C) = ((C or ^T): (static member X : 'T * C -> string) (x, y));; """ + |> withRealInternalSignature realsig |> withLangVersion70 |> compile |> shouldFail |> withDiagnosticMessageMatches "Unexpected keyword 'static' in binding" - [] - let ``Nominal type is preferred`` () = + [] // RealSig + [] // Regular + [] + let ``Nominal type is preferred`` (realsig) = Fsx """ type C() = @@ -691,12 +753,13 @@ let main _ = if not (callX2 (C()) (D()) = "C") then failwith "Unexpected result" """ + |> withRealInternalSignature realsig |> withLangVersion70 |> asExe |> compileAndRun |> shouldSucceed - let library2 = + let library2 realsig = FSharp """ module Potato.Lib type IPotato<'T when 'T :> IPotato<'T>> = @@ -713,12 +776,15 @@ let main _ = static member IsGood c = false static member op_Equality (a, b) = false """ + |> withRealInternalSignature realsig |> withLangVersion70 |> withName "Potato" |> withOptions ["--nowarn:3535"] - [] - let ``Active patterns- Using IWSAM in active pattern`` () = + [] // RealSig + [] // Regular + [] + let ``Active patterns- Using IWSAM in active pattern`` (realsig) = FSharp """ module Potato.Test @@ -729,7 +795,8 @@ let main _ = match Potato() with GoodPotato -> () | _ -> failwith "Unexpected result" match Rock() with GoodPotato -> failwith "Unexpected result" | _ -> () """ - |> withReferences [library2] + |> withReferences [library2 realsig] + |> withRealInternalSignature realsig |> withLangVersion70 |> compileExeAndRun |> shouldSucceed @@ -746,8 +813,10 @@ let main _ = """ ] - [] - let ``Active patterns - Using IWSAM equality in active pattern uses generic equality intrinsic`` () = + [] // RealSig + [] // Regular + [] + let ``Active patterns - Using IWSAM equality in active pattern uses generic equality intrinsic`` (realsig) = FSharp """ module Potato.Test @@ -762,7 +831,8 @@ let main _ = | IsEqual -> failwith "Unexpected result" | IsNonEqual -> () """ - |> withReferences [library2] + |> withReferences [library2 realsig] + |> withRealInternalSignature realsig |> withLangVersion70 |> asExe |> compileAndRun @@ -780,12 +850,15 @@ let main _ = """ ] - [] - let ``Suppression of System Numerics interfaces on unitized types`` () = + [] // RealSig + [] // Regular + [] + let ``Suppression of System Numerics interfaces on unitized types`` (realsig) = Fsx """ open System.Numerics let f (x: 'T when 'T :> IMultiplyOperators<'T,'T,'T>) = x;; f 3.0 |> ignore""" + |> withRealInternalSignature realsig |> withLangVersion70 |> compile |> shouldSucceed @@ -840,8 +913,10 @@ let main _ = |> shouldFail |> withErrorMessage $"The type 'float' is not compatible with the type '{potatoType}'" - [] - let ``Interface A with static abstracts can be inherited in interface B and then implemented in type C which inherits B in lang version70`` () = + [] // RealSig + [] // Regular + [] + let ``Interface A with static abstracts can be inherited in interface B and then implemented in type C which inherits B in lang version70`` (realsig) = Fsx """ type IParsable<'T when 'T :> IParsable<'T>> = static abstract member Parse : string -> 'T @@ -863,12 +938,15 @@ let main _ = failwith "failed" """ |> withNoWarn 3535 + |> withRealInternalSignature realsig |> withLangVersion70 |> compile |> shouldSucceed - [] - let ``Static abstracts can be inherited through multiple levels in lang version70`` () = + [] // RealSig + [] // Regular + [] + let ``Static abstracts can be inherited through multiple levels in lang version70`` (realsig) = Fsx """ type IParsable<'T when 'T :> IParsable<'T>> = static abstract member Parse : string -> 'T @@ -902,12 +980,15 @@ let main _ = failwith "failed" """ |> withNoWarn 3535 + |> withRealInternalSignature realsig |> withLangVersion70 |> compile |> shouldSucceed - [] - let ``Static abstracts from BCL can be inherited through multiple levels in lang version70`` () = + [] // RealSig + [] // Regular + [] + let ``Static abstracts from BCL can be inherited through multiple levels in lang version70`` (realsig) = Fsx """ open System open System.Globalization @@ -927,12 +1008,15 @@ let main _ = failwith "failed" """ |> withNoWarn 3535 + |> withRealInternalSignature realsig |> withLangVersion70 |> compile |> shouldSucceed - - [] - let ``Produce an error when one leaves out keyword "static" in an implementation of IWSAM`` () = + + [] // RealSig + [] // Regular + [] + let ``Produce an error when one leaves out keyword "static" in an implementation of IWSAM`` (realsig) = Fsx """ module StaticAbstractBug = type IOperation = @@ -951,19 +1035,22 @@ module StaticAbstractBug = member this.Property3 = 0 member this.Property3 with set value = () """ - |> withOptions [ "--nowarn:3535" ] - |> withLangVersion80 - |> compile - |> shouldFail - |> withDiagnostics [ + |> withOptions [ "--nowarn:3535" ] + |> withRealInternalSignature realsig + |> withLangVersion80 + |> compile + |> shouldFail + |> withDiagnostics [ (Error 855, Line 12, Col 22, Line 12, Col 29, "No abstract or interface member was found that corresponds to this override") (Error 859, Line 14, Col 25, Line 14, Col 33, "No abstract property was found that corresponds to this override") (Error 859, Line 16, Col 25, Line 16, Col 34, "No abstract property was found that corresponds to this override") (Error 859, Line 17, Col 25, Line 17, Col 34, "No abstract property was found that corresponds to this override") - ] - - [] - let ``Produce an error when one leaves out keyword "static" in an implementation of IWSAM with multiple overloads`` () = + ] + + [] // RealSig + [] // Regular + [] + let ``Produce an error when one leaves out keyword "static" in an implementation of IWSAM with multiple overloads`` (realsig) = Fsx """ module StaticAbstractBug = type IOperation = @@ -979,11 +1066,12 @@ module StaticAbstractBug = member this.Property = 0 member this.Property = false """ - |> withOptions [ "--nowarn:3535" ] - |> withLangVersion80 - |> compile - |> shouldFail - |> withDiagnostics [ + |> withOptions [ "--nowarn:3535" ] + |> withRealInternalSignature realsig + |> withLangVersion80 + |> compile + |> shouldFail + |> withDiagnostics [ (Error 1, Line 11, Col 34, Line 11, Col 36, "This expression was expected to have type 'bool' but here has type @@ -992,10 +1080,12 @@ but here has type 'int' but here has type 'bool' ") - ] - - [] - let ``Produce an error for interface with static abstract member that is implemented as instance member`` () = + ] + + [] // RealSig + [] // Regular + [] + let ``Produce an error for interface with static abstract member that is implemented as instance member`` (realsig) = Fsx """ module StaticAbstractBug = type IFoo<'T> = @@ -1015,19 +1105,22 @@ module StaticAbstractBug = member this.Property3 = 0 member this.Property3 with set value = () """ - |> withOptions [ "--nowarn:3535" ] - |> withLangVersion80 - |> compile - |> shouldFail - |> withDiagnostics [ + |> withOptions [ "--nowarn:3535" ] + |> withRealInternalSignature realsig + |> withLangVersion80 + |> compile + |> shouldFail + |> withDiagnostics [ (Error 855, Line 14, Col 18, Line 14, Col 23, "No abstract or interface member was found that corresponds to this override"); (Error 859, Line 15, Col 21, Line 15, Col 29, "No abstract property was found that corresponds to this override"); (Error 859, Line 17, Col 21, Line 17, Col 30, "No abstract property was found that corresponds to this override"); (Error 859, Line 18, Col 21, Line 18, Col 30, "No abstract property was found that corresponds to this override") - ] + ] - [] - let ``Produce an error for interface with static abstract member that is implemented as instance member with multiple overloads`` () = + [] // RealSig + [] // Regular + [] + let ``Produce an error for interface with static abstract member that is implemented as instance member with multiple overloads`` (realsig) = Fsx """ module StaticAbstractBug = type IFoo<'T> = @@ -1046,11 +1139,12 @@ module StaticAbstractBug = member this.Property = 0 member this.Property = false """ - |> withOptions [ "--nowarn:3535" ] - |> withLangVersion80 - |> compile - |> shouldFail - |> withDiagnostics [ + |> withOptions [ "--nowarn:3535" ] + |> withRealInternalSignature realsig + |> withLangVersion80 + |> compile + |> shouldFail + |> withDiagnostics [ (Error 1, Line 14, Col 41, Line 14, Col 42, "The type 'bool' does not match the type 'int'") (Error 1, Line 16, Col 32, Line 16, Col 33, "This expression was expected to have type 'bool' @@ -1058,8 +1152,10 @@ but here has type 'int' ") ] - [] - let ``Produce an error when one leaves out keyword "static" in multiple IWSAM implementations`` () = + [] // RealSig + [] // Regular + [] + let ``Produce an error when one leaves out keyword "static" in multiple IWSAM implementations`` (realsig) = Fsx """ module StaticAbstractBug = type IOperation = @@ -1079,17 +1175,20 @@ module StaticAbstractBug = member this.Execute() = 0 member this.Execute2() = () """ - |> withOptions [ "--nowarn:3535" ] - |> withLangVersion80 - |> compile - |> shouldFail - |> withDiagnostics [ + |> withOptions [ "--nowarn:3535" ] + |> withLangVersion80 + |> withRealInternalSignature realsig + |> compile + |> shouldFail + |> withDiagnostics [ (Error 855, Line 13, Col 25, Line 13, Col 32, "No abstract or interface member was found that corresponds to this override") (Error 855, Line 17, Col 25, Line 17, Col 32, "No abstract or interface member was found that corresponds to this override") - ] + ] - [] - let ``Produces errors when includes keyword "static" when implementing a generic interface in a type`` () = + [] // RealSig + [] // Regular + [] + let ``Produces errors when includes keyword "static" when implementing a generic interface in a type`` (realsig) = Fsx """ module StaticAbstractBug = type IFoo<'T> = @@ -1109,21 +1208,24 @@ module StaticAbstractBug = static member Property3 = 0 static member Property3 with set value = () """ - |> withOptions [ "--nowarn:3536" ; "--nowarn:3535" ] - |> withLangVersion80 - |> typecheck - |> shouldFail - |> withDiagnostics [ + |> withOptions [ "--nowarn:3536" ; "--nowarn:3535" ] + |> withRealInternalSignature realsig + |> withLangVersion80 + |> typecheck + |> shouldFail + |> withDiagnostics [ (Error 3855, Line 13, Col 23, Line 13, Col 27, "No static abstract member was found that corresponds to this override") (Error 3855, Line 14, Col 23, Line 14, Col 28, "No static abstract member was found that corresponds to this override") (Error 3859, Line 15, Col 23, Line 15, Col 31, "No static abstract property was found that corresponds to this override") (Error 3859, Line 16, Col 23, Line 16, Col 32, "No static abstract property was found that corresponds to this override") (Error 3859, Line 17, Col 23, Line 17, Col 32, "No static abstract property was found that corresponds to this override") (Error 3859, Line 18, Col 23, Line 18, Col 32, "No static abstract property was found that corresponds to this override") - ] - - [] - let ``Produces errors when includes keyword "static" when implementing an interface in a type`` () = + ] + + [] // RealSig + [] // Regular + [] + let ``Produces errors when includes keyword "static" when implementing an interface in a type`` (realsig) = Fsx """ module StaticAbstractBug = type IOperation = @@ -1139,19 +1241,22 @@ module StaticAbstractBug = static member Property = 0 static member Property = false """ - |> withOptions [ "--nowarn:3536" ; "--nowarn:3535" ] - |> withLangVersion80 - |> typecheck - |> shouldFail - |> withDiagnostics [ + |> withOptions [ "--nowarn:3536" ; "--nowarn:3535" ] + |> withRealInternalSignature realsig + |> withLangVersion80 + |> typecheck + |> shouldFail + |> withDiagnostics [ (Error 3855, Line 11, Col 27, Line 11, Col 34, "No static abstract member was found that corresponds to this override") (Error 3855, Line 12, Col 27, Line 12, Col 34, "No static abstract member was found that corresponds to this override") (Error 3859, Line 13, Col 27, Line 13, Col 35, "No static abstract property was found that corresponds to this override") (Error 3859, Line 14, Col 27, Line 14, Col 35, "No static abstract property was found that corresponds to this override") - ] - - [] - let ``No error when implementing interfaces with static members by using class types`` () = + ] + + [] // RealSig + [] // Regular + [] + let ``No error when implementing interfaces with static members by using class types`` (realsig) = Fsx """ type IPrintable = abstract member Print: unit -> unit @@ -1170,13 +1275,16 @@ let someClass1 = SomeClass1(1, 2.0) someClass.Print() someClass1.GetPrint() """ - |> withOptions [ "--nowarn:3536" ; "--nowarn:3535" ] - |> withLangVersion80 - |> typecheck - |> shouldSucceed - - [] - let ``No error when implementing interfaces with static members and IWSAM by using class types`` () = + |> withOptions [ "--nowarn:3536" ; "--nowarn:3535" ] + |> withRealInternalSignature realsig + |> withLangVersion80 + |> typecheck + |> shouldSucceed + + [] // RealSig + [] // Regular + [] + let ``No error when implementing interfaces with static members and IWSAM by using class types`` (realsig) = Fsx """ [] type IPrintable = @@ -1190,39 +1298,46 @@ type SomeClass1() = let someClass1 = SomeClass1() let execute = IPrintable.Say("hello") """ - |> withOptions [ "--nowarn:3536" ; "--nowarn:3535" ] - |> withLangVersion80 - |> typecheck - |> shouldSucceed + |> withOptions [ "--nowarn:3536" ; "--nowarn:3535" ] + |> withRealInternalSignature realsig + |> withLangVersion80 + |> typecheck + |> shouldSucceed - [] - let ``Accessing to IWSAM(System.Numerics non virtual) produces a compilation error`` () = + [] // RealSig + [] // Regular + [] + let ``Accessing to IWSAM(System.Numerics non virtual) produces a compilation error`` (realsig) = Fsx """ open System.Numerics IAdditionOperators.op_Addition (3, 6) - """ - |> withOptions [ "--nowarn:3536" ; "--nowarn:3535" ] - |> withLangVersion80 - |> compile - |> shouldFail - |> withSingleDiagnostic (Error 3866, Line 4, Col 1, Line 4, Col 38, "A static abstract non-virtual interface member should only be called via type parameter (for example: 'T.op_Addition).") - - [] - let ``Accessing to IWSAM(System.Numerics virtual member) compiles and runs`` () = + """ + |> withOptions [ "--nowarn:3536" ; "--nowarn:3535" ] + |> withRealInternalSignature realsig + |> withLangVersion80 + |> compile + |> shouldFail + |> withSingleDiagnostic (Error 3866, Line 4, Col 1, Line 4, Col 38, "A static abstract non-virtual interface member should only be called via type parameter (for example: 'T.op_Addition).") + + [] // RealSig + [] // Regular + [] + let ``Accessing to IWSAM(System.Numerics virtual member) compiles and runs`` (realsig) = Fsx """ open System.Numerics let res = IAdditionOperators.op_CheckedAddition (3, 6) printf "%A" res""" - |> withOptions [ "--nowarn:3536" ; "--nowarn:3535" ] - |> withLangVersion80 - |> asExe - |> compile - |> shouldSucceed - |> run - |> verifyOutput "9" + |> withOptions [ "--nowarn:3536" ; "--nowarn:3535" ] + |> withRealInternalSignature realsig + |> withLangVersion80 + |> asExe + |> compile + |> shouldSucceed + |> run + |> verifyOutput "9" #if !NETCOREAPP [] @@ -1242,35 +1357,43 @@ printf "%A" res""" (Error 3866, Line 15, Col 82, Line 15, Col 129, "A static abstract non-virtual interface member should only be called via type parameter (for example: 'T.Parse).") ] - [] - let ``Error message that explicitly disallows static abstract methods in abstract classes.`` () = + [] // RealSig + [] // Regular + [] + let ``Error message that explicitly disallows static abstract methods in abstract classes.`` (realsig) = Fsx """ [] type A () = static abstract M : unit -> unit """ |> withOptions [ "--nowarn:3536" ; "--nowarn:3535" ] + |> withRealInternalSignature realsig |> typecheck |> shouldFail |> withDiagnostics [ (Error 3867, Line 4, Col 21, Line 4, Col 22, "Classes cannot contain static abstract members.") ] - [] - let ``Error message that explicitly disallows static abstract methods in classes.`` () = + [] // RealSig + [] // Regular + [] + let ``Error message that explicitly disallows static abstract methods in classes.`` (realsig) = Fsx """ type A () = static abstract M : unit -> unit """ |> withOptions [ "--nowarn:3536" ; "--nowarn:3535" ] + |> withRealInternalSignature realsig |> typecheck |> shouldFail |> withDiagnostics [ (Error 3867, Line 3, Col 21, Line 3, Col 22, "Classes cannot contain static abstract members.") ] - - [] - let ``Access modifiers cannot be applied to an SRTP constraint in preview`` () = + + [] // RealSig + [] // Regular + [] + let ``Access modifiers cannot be applied to an SRTP constraint in preview`` (realsig) = FSharp """ let inline length (x: ^a when ^a: (member public Length: int)) = x.Length let inline length2 (x: ^a when ^a: (member Length: int with public get)) = x.Length @@ -1278,6 +1401,7 @@ let inline length3 (x: ^a when ^a: (member Length: int with public set)) = x.set let inline length4 (x: ^a when ^a: (member public get_Length: unit -> int)) = x.get_Length() """ |> withLangVersionPreview + |> withRealInternalSignature realsig |> typecheck |> shouldFail |> withDiagnostics [ @@ -1286,9 +1410,11 @@ let inline length4 (x: ^a when ^a: (member public get_Length: unit -> int)) = x. (Error 3871, Line 4, Col 61, Line 4, Col 67, "Access modifiers cannot be applied to an SRTP constraint.") (Error 3871, Line 5, Col 44, Line 5, Col 50, "Access modifiers cannot be applied to an SRTP constraint.") ] - - [] - let ``Access modifiers in an SRTP constraint generate warning in F# 8.0`` () = + + [] // RealSig + [] // Regular + [] + let ``Access modifiers in an SRTP constraint generate warning in F# 8.0`` (realsig) = FSharp """ let inline length (x: ^a when ^a: (member public Length: int)) = x.Length let inline length2 (x: ^a when ^a: (member Length: int with public get)) = x.Length @@ -1296,6 +1422,7 @@ let inline length3 (x: ^a when ^a: (member Length: int with public set)) = x.set let inline length4 (x: ^a when ^a: (member public get_Length: unit -> int)) = x.get_Length() """ |> withLangVersion80 + |> withRealInternalSignature realsig |> typecheck |> shouldFail |> withDiagnostics [ @@ -1305,8 +1432,10 @@ let inline length4 (x: ^a when ^a: (member public get_Length: unit -> int)) = x. (Warning 3871, Line 5, Col 44, Line 5, Col 50, "Access modifiers cannot be applied to an SRTP constraint.") ] - [] - let ``Error for partial implementation of interface with static abstract members`` () = + [] // RealSig + [] // Regular + [] + let ``Error for partial implementation of interface with static abstract members`` (realsig) = Fsx """ type IFace = static abstract P1 : int @@ -1318,14 +1447,17 @@ type T = """ |> withOptions [ "--nowarn:3536" ; "--nowarn:3535" ] + |> withRealInternalSignature realsig |> typecheck |> shouldFail |> withDiagnostics [ (Error 366, Line 7, Col 15, Line 7, Col 20, "No implementation was given for 'static abstract IFace.P2: int'. Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'.") ] - - [] - let ``Error for no implementation of interface with static abstract members`` () = + + [] // RealSig + [] // Regular + [] + let ``Error for no implementation of interface with static abstract members`` (realsig) = Fsx """ type IFace = static abstract P1 : int @@ -1335,6 +1467,7 @@ type T = interface IFace with """ |> withOptions [ "--nowarn:3536" ; "--nowarn:3535" ] + |> withRealInternalSignature realsig |> typecheck |> shouldFail |> withDiagnostics [ @@ -1344,8 +1477,10 @@ type T = Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'.") ] - [] - let ``Error for partial implementation of interface with static and non static abstract members`` () = + [] // RealSig + [] // Regular + [] + let ``Error for partial implementation of interface with static and non static abstract members`` (realsig) = Fsx """ type IFace = static abstract P1 : int @@ -1360,6 +1495,7 @@ type T = """ |> withOptions [ "--nowarn:3536" ; "--nowarn:3535" ] + |> withRealInternalSignature realsig |> typecheck |> shouldFail |> withDiagnostics [ @@ -1368,9 +1504,11 @@ type T = 'abstract IFace.P4: int' Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'.") ] - - [] - let ``Error for no implementation of interface with static and non static abstract members`` () = + + [] // RealSig + [] // Regular + [] + let ``Error for no implementation of interface with static and non static abstract members`` (realsig) = Fsx """ type IFace = static abstract P1 : int @@ -1380,9 +1518,10 @@ type IFace = type T = interface IFace with - + """ |> withOptions [ "--nowarn:3536" ; "--nowarn:3535" ] + |> withRealInternalSignature realsig |> typecheck |> shouldFail |> withDiagnostics [ @@ -1394,8 +1533,10 @@ type T = Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'.") ] - [] - let ``Error for partial implementation of interface with non static abstract members`` () = + [] // RealSig + [] // Regular + [] + let ``Error for partial implementation of interface with non static abstract members`` (realsig) = Fsx """ type IFace = abstract member P3 : int @@ -1404,17 +1545,20 @@ type IFace = type T = interface IFace with member this.P3 = 3 - + """ |> withOptions [ "--nowarn:3536" ; "--nowarn:3535" ] + |> withRealInternalSignature realsig |> typecheck |> shouldFail |> withDiagnostics [ (Error 366, Line 7, Col 15, Line 7, Col 20, "No implementation was given for 'abstract IFace.P4: int'. Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'.") ] - - [] - let ``Error for no implementation of interface with non static abstract members`` () = + + [] // RealSig + [] // Regular + [] + let ``Error for no implementation of interface with non static abstract members`` (realsig) = Fsx """ type IFace = abstract member P3 : int @@ -1425,6 +1569,7 @@ type T = """ |> withOptions [ "--nowarn:3536" ; "--nowarn:3535" ] + |> withRealInternalSignature realsig |> typecheck |> shouldFail |> withDiagnostics [ diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ComputedCollections.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ComputedCollections.fs index ebc7634013a..49db6354ad8 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ComputedCollections.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ComputedCollections.fs @@ -13,73 +13,73 @@ module ComputedCollections = |> ignoreWarnings |> verifyILBaseline - [] - let Int32RangeArrays_fs (compilation: CompilationHelper) = + [] + let Int32RangeArrays_fs compilation = compilation |> getCompilation |> verifyCompilation - [] + [] let ``Int32RangeLists_fs`` compilation = compilation |> getCompilation |> verifyCompilation - [] + [] let ``UInt64RangeArrays_fs`` compilation = compilation |> getCompilation |> verifyCompilation - [] + [] let ``UInt64RangeLists_fs`` compilation = compilation |> getCompilation |> verifyCompilation - [] + [] let ``ForNInRangeArrays_fs`` compilation = compilation |> getCompilation |> verifyCompilation - [] + [] let ``ForNInRangeLists_fs`` compilation = compilation |> getCompilation |> verifyCompilation - [] + [] let ``ForXInArray_ToArray_fs`` compilation = compilation |> getCompilation |> verifyCompilation - [] + [] let ``ForXInArray_ToList_fs`` compilation = compilation |> getCompilation |> verifyCompilation - [] + [] let ``ForXInList_ToArray_fs`` compilation = compilation |> getCompilation |> verifyCompilation - [] + [] let ``ForXInList_ToList_fs`` compilation = compilation |> getCompilation |> verifyCompilation - [] + [] let ``ForXInSeq_ToArray_fs`` compilation = compilation |> getCompilation |> verifyCompilation - [] + [] let ``ForXInSeq_ToList_fs`` compilation = compilation |> getCompilation diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInList_ToList.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInList_ToList.fs.il.bsl index 614d86d0f56..1c4d00cee7e 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInList_ToList.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ForXInList_ToList.fs.il.bsl @@ -1274,7 +1274,7 @@ IL_0001: ldsfld class assembly/'for _ in List-groupBy id -- do ---@28' assembly/'for _ in List-groupBy id -- do ---@28'::@_instance IL_0006: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() IL_000b: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>> [FSharp.Core]Microsoft.FSharp.Collections.ListModule::GroupBy(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) IL_0010: stloc.1 IL_0011: ldloc.1 IL_0012: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>>::get_TailOrNull() @@ -1313,7 +1313,7 @@ IL_0001: ldsfld class assembly/'for _ | _ in List-groupBy id -- do ---@29' assembly/'for _ | _ in List-groupBy id -- do ---@29'::@_instance IL_0006: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() IL_000b: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>> [FSharp.Core]Microsoft.FSharp.Collections.ListModule::GroupBy(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) IL_0010: stloc.1 IL_0011: ldloc.1 IL_0012: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>>::get_TailOrNull() @@ -1352,7 +1352,7 @@ IL_0001: ldsfld class assembly/'for _ - _ in List-groupBy id -- do ---@30' assembly/'for _ - _ in List-groupBy id -- do ---@30'::@_instance IL_0006: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() IL_000b: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>> [FSharp.Core]Microsoft.FSharp.Collections.ListModule::GroupBy(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) IL_0010: stloc.1 IL_0011: ldloc.1 IL_0012: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>>::get_TailOrNull() @@ -1391,7 +1391,7 @@ IL_0001: ldsfld class assembly/'for _, _group in List-groupBy id -- do ---@31' assembly/'for _, _group in List-groupBy id -- do ---@31'::@_instance IL_0006: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() IL_000b: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>> [FSharp.Core]Microsoft.FSharp.Collections.ListModule::GroupBy(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) IL_0010: stloc.1 IL_0011: ldloc.1 IL_0012: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>>::get_TailOrNull() @@ -1431,7 +1431,7 @@ IL_0001: ldsfld class assembly/'for _, group in List-groupBy id -- do ---@32' assembly/'for _, group in List-groupBy id -- do ---@32'::@_instance IL_0006: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() IL_000b: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>> [FSharp.Core]Microsoft.FSharp.Collections.ListModule::GroupBy(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) IL_0010: stloc.1 IL_0011: ldloc.1 IL_0012: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>>::get_TailOrNull() diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/DoNotBoxStruct/DoNotBoxStruct.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/DoNotBoxStruct/DoNotBoxStruct.fs index d37be433345..7fc56dba8c1 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/DoNotBoxStruct/DoNotBoxStruct.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/DoNotBoxStruct/DoNotBoxStruct.fs @@ -7,13 +7,16 @@ open FSharp.Test.Compiler module DoNotBoxStruct = - let computationExprLibrary = - FsxFromPath (Path.Combine(__SOURCE_DIRECTORY__, "DoNotBoxStruct_ArrayOfArray_FSInterface_NoExtMeth.fs")) - |> withName "DoNotBoxStruct_ArrayOfArray_FSInterface_NoExtMeth_fs" + let verifyCompilation realsig compilation = + + let computationExprLibrary = + FsxFromPath (Path.Combine(__SOURCE_DIRECTORY__, "DoNotBoxStruct_ArrayOfArray_FSInterface_NoExtMeth.fs")) + |> withRealInternalSignature realsig + |> withName "DoNotBoxStruct_ArrayOfArray_FSInterface_NoExtMeth_fs" - let verifyCompilation compilation = compilation |> asFs + |> withRealInternalSignature realsig |> withOptions ["--test:EmitFeeFeeAs100001"] |> asExe |> withReferences [computationExprLibrary] @@ -28,88 +31,88 @@ module DoNotBoxStruct = let ``DoNotBoxStruct_ArrayOfArray_FSInterface_NoExtMeth_fs`` compilation = compilation |> getCompilation - |> verifyCompilation + |> verifyCompilation false //SOURCE=DoNotBoxStruct_Array_FSInterface_NoExtMeth.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd DoNotBoxStruct_Array_FSInterface_NoExtMeth.exe" # DoNotBoxStruct_Array_FSInterface_NoExtMeth.fs [] let ``DoNotBoxStruct_Array_FSInterface_NoExtMeth_fs`` compilation = compilation |> getCompilation - |> verifyCompilation + |> verifyCompilation false //SOURCE=DoNotBoxStruct_MDArray_FSInterface_NoExtMeth.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd DoNotBoxStruct_MDArray_FSInterface_NoExtMeth.exe" # DoNotBoxStruct_MDArray_FSInterface_NoExtMeth.fs - [] let ``DoNotBoxStruct_MDArray_FSInterface_NoExtMeth_fs`` compilation = compilation |> getCompilation - |> verifyCompilation + |> verifyCompilation false //SOURCE=DoNotBoxStruct_NoArray_FSInterface_NoExtMeth.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd DoNotBoxStruct_NoArray_FSInterface_NoExtMeth.exe" # DoNotBoxStruct_NoArray_FSInterface_NoExtMeth.fs - [] let ``DoNotBoxStruct_NoArray_FSInterface_NoExtMeth_fs`` compilation = compilation |> getCompilation - |> verifyCompilation + |> verifyCompilation false //SOURCE=DoNotBoxStruct_ArrayOfArray_CSInterface.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd DoNotBoxStruct_ArrayOfArray_CSInterface.exe" # DoNotBoxStruct_ArrayOfArray_CSInterface.fs [] let ``DoNotBoxStruct_ArrayOfArray_CSInterface_fs`` compilation = compilation |> getCompilation - |> verifyCompilation + |> verifyCompilation false //SOURCE=DoNotBoxStruct_ArrayOfArray_CSInterface.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd DoNotBoxStruct_ArrayOfArray_CSInterface.exe" # DoNotBoxStruct_ArrayOfArray_CSInterface.fs [] let ``DoNotBoxStruct_ArrayOfArray_FSInterface_fs`` compilation = compilation |> getCompilation - |> verifyCompilation + |> verifyCompilation false //SOURCE=DoNotBoxStruct_Array_CSInterface.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd DoNotBoxStruct_Array_CSInterface.exe" # DoNotBoxStruct_Array_CSInterface.fs [] let ``DoNotBoxStruct_Array_CSInterface_fs`` compilation = compilation |> getCompilation - |> verifyCompilation + |> verifyCompilation false //SOURCE=DoNotBoxStruct_Array_FSInterface.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd DoNotBoxStruct_Array_FSInterface.exe" # DoNotBoxStruct_Array_FSInterface.fs - [] let ``DoNotBoxStruct_Array_FSInterface_fs`` compilation = compilation |> getCompilation - |> verifyCompilation + |> verifyCompilation false //SOURCE=DoNotBoxStruct_MDArray_CSInterface.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd DoNotBoxStruct_MDArray_CSInterface.exe" # DoNotBoxStruct_MDArray_CSInterface.fs - [] let ``DoNotBoxStruct_MDArray_CSInterface_fs`` compilation = compilation |> getCompilation - |> verifyCompilation + |> verifyCompilation false //SOURCE=DoNotBoxStruct_MDArray_FSInterface.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd DoNotBoxStruct_MDArray_FSInterface.exe" # DoNotBoxStruct_MDArray_FSInterface.fs - [] let ``DoNotBoxStruct_MDArray_FSInterface_fs`` compilation = compilation |> getCompilation - |> verifyCompilation + |> verifyCompilation false //SOURCE=DoNotBoxStruct_NoArray_CSInterface.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd DoNotBoxStruct_NoArray_CSInterface.exe" # DoNotBoxStruct_NoArray_CSInterface.fs [] let ``DoNotBoxStruct_NoArray_CSInterface_fs`` compilation = compilation |> getCompilation - |> verifyCompilation + |> verifyCompilation false //SOURCE=DoNotBoxStruct_NoArray_FSInterface.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd DoNotBoxStruct_NoArray_FSInterface.exe" # DoNotBoxStruct_NoArray_FSInterface.fs - [] let ``DoNotBoxStruct_NoArray_FSInterface_fs`` compilation = compilation |> getCompilation - |> verifyCompilation + |> verifyCompilation false //SOURCE=DoNotBoxStruct_ToString.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd DoNotBoxStruct_ToString.exe" # DoNotBoxStruct_ToString.fs [] let ``DoNotBoxStruct_ToString_fs`` compilation = compilation |> getCompilation - |> verifyCompilation + |> verifyCompilation false diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/RealInternalSignature/ClassTypeInitialization.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/RealInternalSignature/ClassTypeInitialization.fs index fe209b3e50e..fd9eb1848d4 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/RealInternalSignature/ClassTypeInitialization.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/RealInternalSignature/ClassTypeInitialization.fs @@ -5,6 +5,7 @@ namespace EmittedIL.RealInternalSignature open Xunit open FSharp.Test open FSharp.Test.Compiler +open System.IO module ClassTypeInitialization = @@ -484,364 +485,322 @@ printfn "%A" (MyClass.result()) ] - [] // RealSig - [] // Regular + [] // RealSig Optimize + [] // RealSig NoOptimize + [] // Regular Optimize + [] // Regular NoOptimize [] - let ``nested generic closure`` (realSig) = + let ``nested generic closure`` (realSig, optimize) = + let path = __SOURCE_DIRECTORY__ ++ "nested_generic_closure.fs" + let source = File.ReadAllText (path) + + FSharp source + |> asExe + |> withRealInternalSignature realSig + |> withOptimization optimize + |> compileAndRun + |> shouldSucceed + + [] // RealSig Optimize + [] // RealSig NoOptimize + [] // Regular Optimize + [] // Regular NoOptimize + [] + let ``Generic class with closure with constraints`` (realSig, optimize) = FSharp """ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. +namespace Test +open System -namespace MyCollections +module RuntimeHelpers = + [] + type MyType<'A,'B when 'B :> seq<'A>>(sources: seq<'B>) = + + member x.MoveNext() = + let rec takeInner c = + let rec takeOuter b = + if b.ToString () = "1" then failwith "Oops" + if sources |> Seq.length > 10 then + sources |> Seq.skip 10 + else + sources + if c.ToString() = "1" then failwith "Oops" + if sources |> Seq.length < 5 then + sources + else + takeOuter 7 + takeInner 3 + +open RuntimeHelpers +module doIt = + let x = seq { ArraySegment([|1uy; 2uy; 3uy|]); ArraySegment([|1uy; 2uy; 3uy|]); ArraySegment([|1uy; 2uy; 3uy|]); } + let enumerator = x |> MyType<_,_> + for i in enumerator.MoveNext() do + printfn "%A" i + """ + |> asExe + |> withRealInternalSignature realSig + |> withOptimization optimize + |> compileAndRun + |> shouldSucceed -#nowarn "52" // The value has been copied to ensure the original is not mutated by this operation + [] // RealSig Optimize + [] // RealSig NoOptimize + [] // Regular Optimize + [] // Regular NoOptimize + [] + let ``AgedLookup`` (realSig, optimize) = -open System.Diagnostics -open System.Collections -open System.Collections.Generic -open Microsoft.FSharp.Core + FSharp """ +namespace Internal.Utilities.Collections -module internal IEnumerator = +open System + +[] +type internal ValueStrength<'T when 'T: not struct> = + | Strong of 'T + | Weak of WeakReference<'T> + +type internal AgedLookup<'Token, 'Key, 'Value when 'Value: not struct>(keepStrongly: int, areSimilar, ?requiredToKeep, ?keepMax: int) = + /// The list of items stored. Youngest is at the end of the list. + /// The choice of order is somewhat arbitrary. If the other way then adding + /// items would be O(1) and removing O(N). + let mutable refs: ('Key * ValueStrength<'Value>) list = [] + + let mutable keepStrongly = keepStrongly + + // The 75 here determines how long the list should be passed the end of strongly held + // references. Some operations are O(N) and we don't want to let things get out of + // hand. + let keepMax = defaultArg keepMax 75 + let mutable keepMax = max keepStrongly keepMax + let requiredToKeep = defaultArg requiredToKeep (fun _ -> false) + + /// Look up the given key, return None if not found. + let TryPeekKeyValueImpl (data, key) = + let rec Lookup key = + function + // Treat a list of key-value pairs as a lookup collection. + // This function returns true if two keys are the same according to the predicate + // function passed in. + | [] -> None + | (similarKey, value) :: t -> + if areSimilar (key, similarKey) then + Some(similarKey, value) + else + Lookup key t + + Lookup key data + + /// Determines whether a particular key exists. + let Exists (data, key) = TryPeekKeyValueImpl(data, key).IsSome + + /// Set a particular key's value. + let Add (data, key, value) = data @ [ key, value ] + + /// Promote a particular key value. + let Promote (data, key, value) = + (data |> List.filter (fun (similarKey, _) -> not (areSimilar (key, similarKey)))) + @ [ (key, value) ] + + /// Remove a particular key value. + let RemoveImpl (data, key) = + let keep = + data |> List.filter (fun (similarKey, _) -> not (areSimilar (key, similarKey))) + + keep + + let TryGetKeyValueImpl (data, key) = + match TryPeekKeyValueImpl(data, key) with + | Some(similarKey, value) as result -> + // If the result existed, move it to the end of the list (more likely to keep it) + result, Promote(data, similarKey, value) + | None -> None, data + + /// Remove weak entries from the list that have been collected. + let FilterAndHold (tok: 'Token) = + ignore tok // reading 'refs' requires a token + + [ + for key, value in refs do + match value with + | Strong(value) -> yield (key, value) + | Weak(weakReference) -> + match weakReference.TryGetTarget() with + | false, _ -> () + | true, value -> yield key, value + ] - let noReset() = raise (new System.NotSupportedException("SR.GetString(SR.resetNotSupported)")) - let notStarted() = raise (new System.InvalidOperationException("SR.GetString(SR.enumerationNotStarted)")) - let alreadyFinished() = raise (new System.InvalidOperationException("SR.GetString(SR.enumerationAlreadyFinished)")) - let check started = if not started then notStarted() - let dispose (r : System.IDisposable) = r.Dispose() + let AssignWithStrength (tok, newData) = + let actualLength = List.length newData + let tossThreshold = max 0 (actualLength - keepMax) // Delete everything less than this threshold + let weakThreshold = max 0 (actualLength - keepStrongly) // Weaken everything less than this threshold + + let newData = newData |> List.mapi (fun n kv -> n, kv) // Place the index. + + let newData = + newData + |> List.filter (fun (n: int, v) -> n >= tossThreshold || requiredToKeep (snd v)) + + let newData = + newData + |> List.map (fun (n: int, (k, v)) -> + let handle = + if n < weakThreshold && not (requiredToKeep v) then + Weak(WeakReference<_>(v)) + else + Strong(v) + + k, handle) + + ignore tok // Updating refs requires tok + refs <- newData + + member al.TryPeekKeyValue(tok, key) = + // Returns the original key value as well since it may be different depending on equality test. + let data = FilterAndHold(tok) + TryPeekKeyValueImpl(data, key) + + member al.TryGetKeyValue(tok, key) = + let data = FilterAndHold(tok) + let result, newData = TryGetKeyValueImpl(data, key) + AssignWithStrength(tok, newData) + result + + member al.TryGet(tok, key) = + let data = FilterAndHold(tok) + let result, newData = TryGetKeyValueImpl(data, key) + AssignWithStrength(tok, newData) + + match result with + | Some(_, value) -> Some(value) + | None -> None + + member al.Put(tok, key, value) = + let data = FilterAndHold(tok) + + let data = if Exists(data, key) then RemoveImpl(data, key) else data + + let data = Add(data, key, value) + AssignWithStrength(tok, data) // This will remove extras + + member al.Remove(tok, key) = + let data = FilterAndHold(tok) + let newData = RemoveImpl(data, key) + AssignWithStrength(tok, newData) + + member al.Clear(tok) = + let _discards = FilterAndHold(tok) + AssignWithStrength(tok, []) + + member al.Resize(tok, newKeepStrongly, ?newKeepMax) = + let newKeepMax = defaultArg newKeepMax 75 + keepStrongly <- newKeepStrongly + keepMax <- max newKeepStrongly newKeepMax + let keep = FilterAndHold(tok) + AssignWithStrength(tok, keep) + """ + |> asLibrary + |> withRealInternalSignature realSig + |> withOptimization optimize + |> compile + |> shouldSucceed - let cast (e : IEnumerator) : IEnumerator<'T> = - { new IEnumerator<'T> with - member _.Current = unbox<'T> e.Current + [] // RealSig Optimize + [] // RealSig NoOptimize + [] // Regular Optimize + [] // Regular NoOptimize + [] + let ``BigTuples`` (realSig, optimize) = - interface IEnumerator with - member _.Current = unbox<'T> e.Current :> obj + FSharp """ +namespace Equality - [] - member _.MoveNext() = e.MoveNext() +type BigGenericTuple<'a> = BigGenericTuple of int * 'a * byte * int * 'a * byte + """ + |> asLibrary + |> withRealInternalSignature realSig + |> withOptimization optimize + |> compile + |> shouldSucceed - member _.Reset() = noReset() + [] // RealSig Optimize + [] // RealSig NoOptimize + [] // Regular Optimize + [] // Regular NoOptimize + [] + let ``Array groupBy id`` (realSig, optimize) = - interface System.IDisposable with - member _.Dispose() = - match e with - | :? System.IDisposable as e -> e.Dispose() - | _ -> () } + FSharp """ +module GroupByTest +let ``for _ in Array groupBy id [||] do ...`` () = [|for _ in Array.groupBy id [||] do 0|] + """ + |> asLibrary + |> withRealInternalSignature realSig + |> withOptimization optimize + |> compile + |> shouldSucceed - /// A concrete implementation of an enumerator that returns no values - [] - type EmptyEnumerator<'T>() = - let mutable started = false - interface IEnumerator<'T> with - member _.Current = - check started - (alreadyFinished() : 'T) - - interface System.Collections.IEnumerator with - member _.Current = - check started - (alreadyFinished() : obj) - - [] - member _.MoveNext() = - if not started then started <- true - false - - member _.Reset() = noReset() - - interface System.IDisposable with - member _.Dispose() = () - - let Empty<'T> () = (new EmptyEnumerator<'T>() :> IEnumerator<'T>) - - [] - type EmptyEnumerable<'T> = - - | EmptyEnumerable - - interface IEnumerable<'T> with - member _.GetEnumerator() = Empty<'T>() - - interface IEnumerable with - member _.GetEnumerator() = (Empty<'T>() :> IEnumerator) - - type GeneratedEnumerable<'T, 'State>(openf: unit -> 'State, compute: 'State -> 'T option, closef: 'State -> unit) = - let mutable started = false - let mutable curr = None - let state = ref (Some (openf ())) - let getCurr() : 'T = - check started - match curr with - | None -> alreadyFinished() - | Some x -> x - - let readAndClear () = - lock state (fun () -> - match state.Value with - | None -> None - | Some _ as res -> - state.Value <- None - res) - - let start() = - if not started then - started <- true - - let dispose() = - readAndClear() |> Option.iter closef - - let finish() = - try dispose() - finally curr <- None - - interface IEnumerator<'T> with - member _.Current = getCurr() - - interface IEnumerator with - member _.Current = box (getCurr()) - - [] - member _.MoveNext() = - start() - match state.Value with - | None -> false // we started, then reached the end, then got another MoveNext - | Some s -> - match (try compute s with e -> finish(); reraise()) with - | None -> finish(); false - | Some _ as x -> - curr <- x - true - - member _.Reset() = noReset() - - interface System.IDisposable with - member _.Dispose() = dispose() - [] - type Singleton<'T>(v:'T) = - let mutable started = false + let roundTripWithInterfaceGeneration(realsig, optimize, implementationFile) = - interface IEnumerator<'T> with - member _.Current = v + let generatedSignature = + Fs implementationFile + |> withRealInternalSignature realsig + |> withOptimization optimize + |> printSignatures - interface IEnumerator with - member _.Current = box v + Fsi generatedSignature + |> asLibrary + |> withAdditionalSourceFile (FsSource implementationFile) + |> withRealInternalSignature realsig + |> withOptimization optimize + |> compile + |> shouldSucceed - [] - member _.MoveNext() = if started then false else (started <- true; true) + [] // RealSig Optimize + [] // RealSig NoOptimize + [] // Regular Optimize + [] // Regular NoOptimize + [] + let ``generic-parameter-order-roundtrip`` (realsig, optimize) = - member _.Reset() = noReset() + let implementationFile = """ +module OrderMatters - interface System.IDisposable with - member _.Dispose() = () +type IMonad<'a> = + interface + // Hash constraint leads to another type parameter + abstract bind : #IMonad<'a> -> ('a -> #IMonad<'b>) -> IMonad<'b> + end""" - let Singleton x = (new Singleton<'T>(x) :> IEnumerator<'T>) + roundTripWithInterfaceGeneration(realsig, optimize, implementationFile) - let EnumerateThenFinally f (e : IEnumerator<'T>) = - { new IEnumerator<'T> with - member _.Current = e.Current + [] // RealSig Optimize + [] // RealSig NoOptimize + [] // Regular Optimize + [] // Regular NoOptimize + [] + let ``members_basic-roundtrip`` (realsig, optimize) = - interface IEnumerator with - member _.Current = (e :> IEnumerator).Current + let implementationFile = """ +namespace GenericInterfaceTest - [] - member _.MoveNext() = e.MoveNext() + type Foo<'a> = + interface + abstract fun1 : 'a -> 'a + abstract fun2 : int -> int + end - member _.Reset() = noReset() - interface System.IDisposable with - member _.Dispose() = - try - e.Dispose() - finally - f() - } + type Bar<'b> = + class + val store : 'b + interface Foo<'b> with + member self.fun1(x) = x + member self.fun2(x) = 1 + end + new(x) = { store = x } + end""" - let inline checkNonNull argName arg = - if isNull arg then - nullArg argName - - let mkSeq f = - { new IEnumerable<'U> with - member _.GetEnumerator() = f() - - interface IEnumerable with - member _.GetEnumerator() = (f() :> IEnumerator) } - -namespace Microsoft.FSharp.Core.CompilerServices - - open System.Diagnostics - open Microsoft.FSharp.Core - open MyCollections - open MyCollections.IEnumerator - open System.Collections - open System.Collections.Generic - - module RuntimeHelpers = - - [] - type internal StructBox<'T when 'T:equality>(value:'T) = - member x.Value = value - - static member Comparer = - let gcomparer = HashIdentity.Structural<'T> - { new IEqualityComparer> with - member _.GetHashCode(v) = gcomparer.GetHashCode(v.Value) - member _.Equals(v1,v2) = gcomparer.Equals(v1.Value,v2.Value) } - - let Generate openf compute closef = - mkSeq (fun () -> new IEnumerator.GeneratedEnumerable<_,_>(openf, compute, closef) :> IEnumerator<'T>) - - let EnumerateFromFunctions create moveNext current = - Generate - create - (fun x -> if moveNext x then Some(current x) else None) - (fun x -> match box(x) with :? System.IDisposable as id -> id.Dispose() | _ -> ()) - - // A family of enumerators that can have additional 'finally' actions added to the enumerator through - // the use of mutation. This is used to 'push' the disposal action for a 'use' into the next enumerator. - // For example, - // seq { use x = ... - // while ... } - // results in the 'while' loop giving an adjustable enumerator. This is then adjusted by adding the disposal action - // from the 'use' into the enumerator. This means that we avoid constructing a two-deep enumerator chain in this - // common case. - type IFinallyEnumerator = - abstract AppendFinallyAction : (unit -> unit) -> unit - - /// A concrete implementation of IEnumerable that adds the given compensation to the "Dispose" chain of any - /// enumerators returned by the enumerable. - [] - type FinallyEnumerable<'T>(compensation: unit -> unit, restf: unit -> seq<'T>) = - interface IEnumerable<'T> with - member _.GetEnumerator() = - try - let ie = restf().GetEnumerator() - match ie with - | :? IFinallyEnumerator as a -> - a.AppendFinallyAction(compensation) - ie - | _ -> - IEnumerator.EnumerateThenFinally compensation ie - with e -> - compensation() - reraise() - interface IEnumerable with - member x.GetEnumerator() = ((x :> IEnumerable<'T>).GetEnumerator() :> IEnumerator) - - /// An optimized object for concatenating a sequence of enumerables - [] - type ConcatEnumerator<'T,'U when 'U :> seq<'T>>(sources: seq<'U>) = - let mutable outerEnum = sources.GetEnumerator() - let mutable currInnerEnum = IEnumerator.Empty() - - let mutable started = false - let mutable finished = false - let mutable compensations = [] - - [] // false = unchecked - val mutable private currElement : 'T - - member _.Finish() = - finished <- true - try - match currInnerEnum with - | null -> () - | _ -> - try - currInnerEnum.Dispose() - finally - currInnerEnum <- null - finally - try - match outerEnum with - | null -> () - | _ -> - try - outerEnum.Dispose() - finally - outerEnum <- null - finally - let rec iter comps = - match comps with - | [] -> () - | h :: t -> - try h() finally iter t - try - compensations |> List.rev |> iter - finally - compensations <- [] - - member x.GetCurrent() = - IEnumerator.check started - if finished then IEnumerator.alreadyFinished() else x.currElement - - interface IFinallyEnumerator with - member _.AppendFinallyAction(f) = - compensations <- f :: compensations - - interface IEnumerator<'T> with - member x.Current = x.GetCurrent() - - interface IEnumerator with - member x.Current = box (x.GetCurrent()) - - [] - member x.MoveNext() = - if not started then started <- true - if finished then false - else - let rec takeInner () = - // check the inner list - if currInnerEnum.MoveNext() then - x.currElement <- currInnerEnum.Current - true - else - // check the outer list - let rec takeOuter() = - if outerEnum.MoveNext() then - let ie = outerEnum.Current - // Optimization to detect the statically-allocated empty IEnumerables - match box ie with - | :? EmptyEnumerable<'T> -> - // This one is empty, just skip, don't call GetEnumerator, try again - takeOuter() - | _ -> - // OK, this one may not be empty. - // Don't forget to dispose of the enumerator for the inner list now we're done with it - currInnerEnum.Dispose() - currInnerEnum <- ie.GetEnumerator() - takeInner () - else - // We're done - x.Finish() - false - takeOuter() - takeInner () - - member _.Reset() = IEnumerator.noReset() - - interface System.IDisposable with - - [] - member x.Dispose() = - if not finished then - x.Finish() - - module doIt = - open System - open Microsoft.FSharp.Core.CompilerServices - open Microsoft.FSharp.Collections - - let x = seq { ArraySegment([|1uy; 2uy; 3uy|]); ArraySegment([|1uy; 2uy; 3uy|]); ArraySegment([|1uy; 2uy; 3uy|]); } - let enumerator = new RuntimeHelpers.ConcatEnumerator<_,_>(x) :> IEnumerator - let rec loop () = - if enumerator.MoveNext() then - printfn $"{enumerator.Current}" - loop () - loop () -""" - |> asExe - |> withRealInternalSignature realSig - |> withOptimize - |> compileAndRun - |> shouldSucceed + roundTripWithInterfaceGeneration(realsig, optimize, implementationFile) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/RealInternalSignature/nested_generic_closure.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/RealInternalSignature/nested_generic_closure.fs new file mode 100644 index 00000000000..4d63e54ce28 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/RealInternalSignature/nested_generic_closure.fs @@ -0,0 +1,349 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace MyCollections + +#nowarn "52" // The value has been copied to ensure the original is not mutated by this operation + +open System.Diagnostics +open System.Collections +open System.Collections.Generic +open Microsoft.FSharp.Core + +module internal IEnumerator = + + let noReset() = raise (new System.NotSupportedException("SR.GetString(SR.resetNotSupported)")) + let notStarted() = raise (new System.InvalidOperationException("SR.GetString(SR.enumerationNotStarted)")) + let alreadyFinished() = raise (new System.InvalidOperationException("SR.GetString(SR.enumerationAlreadyFinished)")) + let check started = if not started then notStarted() + let dispose (r : System.IDisposable) = r.Dispose() + + let cast (e : IEnumerator) : IEnumerator<'T> = + { new IEnumerator<'T> with + member _.Current = unbox<'T> e.Current + + interface IEnumerator with + member _.Current = unbox<'T> e.Current :> obj + + [] + member _.MoveNext() = e.MoveNext() + + member _.Reset() = noReset() + + interface System.IDisposable with + member _.Dispose() = + match e with + | :? System.IDisposable as e -> e.Dispose() + | _ -> () } + + /// A concrete implementation of an enumerator that returns no values + [] + type EmptyEnumerator<'T>() = + let mutable started = false + interface IEnumerator<'T> with + member _.Current = + check started + (alreadyFinished() : 'T) + + interface System.Collections.IEnumerator with + member _.Current = + check started + (alreadyFinished() : obj) + + [] + member _.MoveNext() = + if not started then started <- true + false + + member _.Reset() = noReset() + + interface System.IDisposable with + member _.Dispose() = () + + let Empty<'T> () = (new EmptyEnumerator<'T>() :> IEnumerator<'T>) + + [] + type EmptyEnumerable<'T> = + + | EmptyEnumerable + + interface IEnumerable<'T> with + member _.GetEnumerator() = Empty<'T>() + + interface IEnumerable with + member _.GetEnumerator() = (Empty<'T>() :> IEnumerator) + + type GeneratedEnumerable<'T, 'State>(openf: unit -> 'State, compute: 'State -> 'T option, closef: 'State -> unit) = + let mutable started = false + let mutable curr = None + let state = ref (Some (openf ())) + let getCurr() : 'T = + check started + match curr with + | None -> alreadyFinished() + | Some x -> x + + let readAndClear () = + lock state (fun () -> + match state.Value with + | None -> None + | Some _ as res -> + state.Value <- None + res) + + let start() = + if not started then + started <- true + + let dispose() = + readAndClear() |> Option.iter closef + + let finish() = + try dispose() + finally curr <- None + + interface IEnumerator<'T> with + member _.Current = getCurr() + + interface IEnumerator with + member _.Current = box (getCurr()) + + [] + member _.MoveNext() = + start() + match state.Value with + | None -> false // we started, then reached the end, then got another MoveNext + | Some s -> + match (try compute s with e -> finish(); reraise()) with + | None -> finish(); false + | Some _ as x -> + curr <- x + true + + member _.Reset() = noReset() + + interface System.IDisposable with + member _.Dispose() = dispose() + + [] + type Singleton<'T>(v:'T) = + let mutable started = false + + interface IEnumerator<'T> with + member _.Current = v + + interface IEnumerator with + member _.Current = box v + + [] + member _.MoveNext() = if started then false else (started <- true; true) + + member _.Reset() = noReset() + + interface System.IDisposable with + member _.Dispose() = () + + let Singleton x = (new Singleton<'T>(x) :> IEnumerator<'T>) + + let EnumerateThenFinally f (e : IEnumerator<'T>) = + { new IEnumerator<'T> with + member _.Current = e.Current + + interface IEnumerator with + member _.Current = (e :> IEnumerator).Current + + [] + member _.MoveNext() = e.MoveNext() + + member _.Reset() = noReset() + + interface System.IDisposable with + member _.Dispose() = + try + e.Dispose() + finally + f() + } + + let inline checkNonNull argName arg = + if isNull arg then + nullArg argName + + let mkSeq f = + { new IEnumerable<'U> with + member _.GetEnumerator() = f() + + interface IEnumerable with + member _.GetEnumerator() = (f() :> IEnumerator) } + +namespace Microsoft.FSharp.Core.CompilerServices + + open System.Diagnostics + open Microsoft.FSharp.Core + open MyCollections + open MyCollections.IEnumerator + open System.Collections + open System.Collections.Generic + + module RuntimeHelpers = + + [] + type internal StructBox<'T when 'T:equality>(value:'T) = + member x.Value = value + + static member Comparer = + let gcomparer = HashIdentity.Structural<'T> + { new IEqualityComparer> with + member _.GetHashCode(v) = gcomparer.GetHashCode(v.Value) + member _.Equals(v1,v2) = gcomparer.Equals(v1.Value,v2.Value) } + + let Generate openf compute closef = + mkSeq (fun () -> new IEnumerator.GeneratedEnumerable<_,_>(openf, compute, closef) :> IEnumerator<'T>) + + let EnumerateFromFunctions create moveNext current = + Generate + create + (fun x -> if moveNext x then Some(current x) else None) + (fun x -> match box(x) with :? System.IDisposable as id -> id.Dispose() | _ -> ()) + + // A family of enumerators that can have additional 'finally' actions added to the enumerator through + // the use of mutation. This is used to 'push' the disposal action for a 'use' into the next enumerator. + // For example, + // seq { use x = ... + // while ... } + // results in the 'while' loop giving an adjustable enumerator. This is then adjusted by adding the disposal action + // from the 'use' into the enumerator. This means that we avoid constructing a two-deep enumerator chain in this + // common case. + type IFinallyEnumerator = + abstract AppendFinallyAction : (unit -> unit) -> unit + + /// A concrete implementation of IEnumerable that adds the given compensation to the "Dispose" chain of any + /// enumerators returned by the enumerable. + [] + type FinallyEnumerable<'T>(compensation: unit -> unit, restf: unit -> seq<'T>) = + interface IEnumerable<'T> with + member _.GetEnumerator() = + try + let ie = restf().GetEnumerator() + match ie with + | :? IFinallyEnumerator as a -> + a.AppendFinallyAction(compensation) + ie + | _ -> + IEnumerator.EnumerateThenFinally compensation ie + with e -> + compensation() + reraise() + interface IEnumerable with + member x.GetEnumerator() = ((x :> IEnumerable<'T>).GetEnumerator() :> IEnumerator) + + /// An optimized object for concatenating a sequence of enumerables + [] + type ConcatEnumerator<'T,'U when 'U :> seq<'T>>(sources: seq<'U>) = + let mutable outerEnum = sources.GetEnumerator() + let mutable currInnerEnum = IEnumerator.Empty() + + let mutable started = false + let mutable finished = false + let mutable compensations = [] + + [] // false = unchecked + val mutable private currElement : 'T + + member _.Finish() = + finished <- true + try + match currInnerEnum with + | null -> () + | _ -> + try + currInnerEnum.Dispose() + finally + currInnerEnum <- null + finally + try + match outerEnum with + | null -> () + | _ -> + try + outerEnum.Dispose() + finally + outerEnum <- null + finally + let rec iter comps = + match comps with + | [] -> () + | h :: t -> + try h() finally iter t + try + compensations |> List.rev |> iter + finally + compensations <- [] + + member x.GetCurrent() = + IEnumerator.check started + if finished then IEnumerator.alreadyFinished() else x.currElement + + interface IFinallyEnumerator with + member _.AppendFinallyAction(f) = + compensations <- f :: compensations + + interface IEnumerator<'T> with + member x.Current = x.GetCurrent() + + interface IEnumerator with + member x.Current = box (x.GetCurrent()) + + [] + member x.MoveNext() = + if not started then started <- true + if finished then false + else + let rec takeInner () = + // check the inner list + if currInnerEnum.MoveNext() then + x.currElement <- currInnerEnum.Current + true + else + // check the outer list + let rec takeOuter() = + if outerEnum.MoveNext() then + let ie = outerEnum.Current + // Optimization to detect the statically-allocated empty IEnumerables + match box ie with + | :? EmptyEnumerable<'T> -> + // This one is empty, just skip, don't call GetEnumerator, try again + takeOuter() + | _ -> + // OK, this one may not be empty. + // Don't forget to dispose of the enumerator for the inner list now we're done with it + currInnerEnum.Dispose() + currInnerEnum <- ie.GetEnumerator() + takeInner () + else + // We're done + x.Finish() + false + takeOuter() + takeInner () + + member _.Reset() = IEnumerator.noReset() + + interface System.IDisposable with + + [] + member x.Dispose() = + if not finished then + x.Finish() + + module doIt = + open System + open Microsoft.FSharp.Core.CompilerServices + open Microsoft.FSharp.Collections + + let x = seq { ArraySegment([|1uy; 2uy; 3uy|]); ArraySegment([|1uy; 2uy; 3uy|]); ArraySegment([|1uy; 2uy; 3uy|]); } + let enumerator = new RuntimeHelpers.ConcatEnumerator<_,_>(x) :> IEnumerator + let rec loop () = + if enumerator.MoveNext() then + printfn $"{enumerator.Current}" + loop () + loop () diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction01.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction01.fs.OptimizeOff.il.bsl similarity index 100% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction01.fs.il.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction01.fs.OptimizeOff.il.bsl diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction01.fs.OptimizeOn.il.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction01.fs.OptimizeOn.il.debug.bsl new file mode 100644 index 00000000000..19521c33bdd --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction01.fs.OptimizeOn.il.debug.bsl @@ -0,0 +1,71 @@ + + + + + +.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 +} +.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 ) + .method public static int32 TestFunction1() cil managed + { + + .maxstack 8 + IL_0000: ldstr "Hello" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_000f: pop + IL_0010: ldstr "World" + IL_0015: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_001a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_001f: pop + IL_0020: ldc.i4.7 + IL_0021: 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/TestFunction01.fs.OptimizeOn.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction01.fs.OptimizeOn.il.release.bsl new file mode 100644 index 00000000000..6259c8c71fd --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction01.fs.OptimizeOn.il.release.bsl @@ -0,0 +1,85 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly extern netstandard +{ + .publickeytoken = (CC 7B 13 FF CD 2D DD 51 ) + .ver 2:1:0:0 +} +.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 +} +.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 ) + .method public static int32 TestFunction1() cil managed + { + + .maxstack 4 + .locals init (class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4 V_0) + IL_0000: ldstr "Hello" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_000a: stloc.0 + IL_000b: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() + IL_0010: ldloc.0 + IL_0011: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter(class [runtime]System.IO.TextWriter, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0016: pop + IL_0017: ldstr "World" + IL_001c: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_0021: stloc.0 + IL_0022: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() + IL_0027: ldloc.0 + IL_0028: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter(class [runtime]System.IO.TextWriter, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_002d: pop + IL_002e: ldc.i4.7 + IL_002f: 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/TestFunction02.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction02.fs.OptimizeOff.il.bsl similarity index 100% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction02.fs.il.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction02.fs.OptimizeOff.il.bsl diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction02.fs.OptimizeOn.il.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction02.fs.OptimizeOn.il.debug.bsl new file mode 100644 index 00000000000..5e66edefaa5 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction02.fs.OptimizeOn.il.debug.bsl @@ -0,0 +1,97 @@ + + + + + +.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 +} +.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 ) + .method public static int32 TestFunction1() cil managed + { + + .maxstack 8 + IL_0000: ldstr "Hello" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_000f: pop + IL_0010: ldstr "World" + IL_0015: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_001a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_001f: pop + IL_0020: ldc.i4.7 + IL_0021: ret + } + + .method public static void TestFunction2() cil managed + { + + .maxstack 3 + .locals init (int32 V_0) + IL_0000: ldstr "Hello" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_000f: pop + IL_0010: ldstr "World" + IL_0015: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_001a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_001f: pop + IL_0020: ldc.i4.7 + IL_0021: stloc.0 + IL_0022: ldstr "Hello" + IL_0027: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_002c: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0031: pop + IL_0032: ldstr "World" + IL_0037: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_003c: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0041: pop + IL_0042: 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/TestFunction02.fs.OptimizeOn.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction02.fs.OptimizeOn.il.release.bsl new file mode 100644 index 00000000000..4acf6ff711a --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction02.fs.OptimizeOn.il.release.bsl @@ -0,0 +1,112 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly extern netstandard +{ + .publickeytoken = (CC 7B 13 FF CD 2D DD 51 ) + .ver 2:1:0:0 +} +.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 +} +.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 ) + .method public static int32 TestFunction1() cil managed + { + + .maxstack 4 + .locals init (class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4 V_0) + IL_0000: ldstr "Hello" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_000a: stloc.0 + IL_000b: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() + IL_0010: ldloc.0 + IL_0011: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter(class [runtime]System.IO.TextWriter, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0016: pop + IL_0017: ldstr "World" + IL_001c: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_0021: stloc.0 + IL_0022: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() + IL_0027: ldloc.0 + IL_0028: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter(class [runtime]System.IO.TextWriter, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_002d: pop + IL_002e: ldc.i4.7 + IL_002f: ret + } + + .method public static void TestFunction2() cil managed + { + + .maxstack 4 + .locals init (int32 V_0, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4 V_1) + IL_0000: call int32 assembly::TestFunction1() + IL_0005: stloc.0 + IL_0006: ldstr "Hello" + IL_000b: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_0010: stloc.1 + IL_0011: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() + IL_0016: ldloc.1 + IL_0017: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter(class [runtime]System.IO.TextWriter, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_001c: pop + IL_001d: ldstr "World" + IL_0022: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_0027: stloc.1 + IL_0028: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() + IL_002d: ldloc.1 + IL_002e: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter(class [runtime]System.IO.TextWriter, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0033: pop + IL_0034: 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/TestFunction03.fs.il.net472.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction03.fs.OptimizeOff.il.bsl similarity index 100% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction03.fs.il.net472.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction03.fs.OptimizeOff.il.bsl diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction03.fs.il.netcore.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction03.fs.OptimizeOn.il.debug.bsl similarity index 66% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction03.fs.il.netcore.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction03.fs.OptimizeOn.il.debug.bsl index dd6e6ab1b40..ea7a3bfd97d 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction03.fs.il.netcore.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction03.fs.OptimizeOn.il.debug.bsl @@ -16,16 +16,6 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 -} -.mresource public FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - } .module assembly.exe @@ -55,10 +45,8 @@ IL_0015: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) IL_001a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) IL_001f: pop - IL_0020: ldc.i4.3 - IL_0021: ldc.i4.4 - IL_0022: add - IL_0023: ret + IL_0020: ldc.i4.7 + IL_0021: ret } .method public static void TestFunction3() cil managed @@ -70,27 +58,35 @@ .try { IL_0000: nop - IL_0001: call int32 assembly::TestFunction1() - IL_0006: stloc.0 - IL_0007: ldstr "Hello" - IL_000c: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) - IL_0011: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) - IL_0016: pop - IL_0017: leave.s IL_0031 + IL_0001: ldstr "Hello" + IL_0006: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_000b: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0010: pop + IL_0011: ldstr "World" + IL_0016: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_001b: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0020: pop + IL_0021: ldc.i4.7 + IL_0022: stloc.0 + IL_0023: ldstr "Hello" + IL_0028: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_002d: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0032: pop + IL_0033: leave.s IL_004d } catch [runtime]System.Object { - IL_0019: castclass [runtime]System.Exception - IL_001e: stloc.1 - IL_001f: ldstr "World" - IL_0024: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) - IL_0029: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) - IL_002e: pop - IL_002f: leave.s IL_0031 + IL_0035: castclass [runtime]System.Exception + IL_003a: stloc.1 + IL_003b: ldstr "World" + IL_0040: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_0045: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_004a: pop + IL_004b: leave.s IL_004d } - IL_0031: ret + IL_004d: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction03.fs.OptimizeOn.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction03.fs.OptimizeOn.il.release.bsl new file mode 100644 index 00000000000..d360b2a91eb --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction03.fs.OptimizeOn.il.release.bsl @@ -0,0 +1,126 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly extern netstandard +{ + .publickeytoken = (CC 7B 13 FF CD 2D DD 51 ) + .ver 2:1:0:0 +} +.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 +} +.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 ) + .method public static int32 TestFunction1() cil managed + { + + .maxstack 4 + .locals init (class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4 V_0) + IL_0000: ldstr "Hello" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_000a: stloc.0 + IL_000b: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() + IL_0010: ldloc.0 + IL_0011: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter(class [runtime]System.IO.TextWriter, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0016: pop + IL_0017: ldstr "World" + IL_001c: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_0021: stloc.0 + IL_0022: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() + IL_0027: ldloc.0 + IL_0028: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter(class [runtime]System.IO.TextWriter, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_002d: pop + IL_002e: ldc.i4.7 + IL_002f: ret + } + + .method public static void TestFunction3() cil managed + { + + .maxstack 4 + .locals init (int32 V_0, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4 V_1, + class [runtime]System.Exception V_2) + .try + { + IL_0000: nop + IL_0001: call int32 assembly::TestFunction1() + IL_0006: stloc.0 + IL_0007: ldstr "Hello" + IL_000c: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_0011: stloc.1 + IL_0012: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() + IL_0017: ldloc.1 + IL_0018: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter(class [runtime]System.IO.TextWriter, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_001d: pop + IL_001e: leave.s IL_003f + + } + catch [runtime]System.Object + { + IL_0020: castclass [runtime]System.Exception + IL_0025: stloc.2 + IL_0026: ldstr "World" + IL_002b: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_0030: stloc.1 + IL_0031: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() + IL_0036: ldloc.1 + IL_0037: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter(class [runtime]System.IO.TextWriter, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_003c: pop + IL_003d: leave.s IL_003f + + } + IL_003f: 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/TestFunction03b.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction03b.fs.OptimizeOff.il.bsl similarity index 100% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction03b.fs.il.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction03b.fs.OptimizeOff.il.bsl diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction03b.fs.OptimizeOn.il.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction03b.fs.OptimizeOn.il.debug.bsl new file mode 100644 index 00000000000..2328fef8d8d --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction03b.fs.OptimizeOn.il.debug.bsl @@ -0,0 +1,122 @@ + + + + + +.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 +} +.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 ) + .method public static int32 TestFunction1() cil managed + { + + .maxstack 8 + IL_0000: ldstr "Hello" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_000f: pop + IL_0010: ldstr "World" + IL_0015: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_001a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_001f: pop + IL_0020: ldc.i4.7 + IL_0021: ret + } + + .method public static void TestFunction3b() cil managed + { + + .maxstack 3 + .locals init (int32 V_0, + class [runtime]System.Exception V_1, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1 V_2) + .try + { + IL_0000: nop + IL_0001: ldstr "Hello" + IL_0006: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_000b: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0010: pop + IL_0011: ldstr "World" + IL_0016: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_001b: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0020: pop + IL_0021: ldc.i4.7 + IL_0022: stloc.0 + IL_0023: ldstr "hello" + IL_0028: call class [runtime]System.Exception [FSharp.Core]Microsoft.FSharp.Core.Operators::Failure(string) + IL_002d: throw + + } + catch [runtime]System.Object + { + IL_002e: castclass [runtime]System.Exception + IL_0033: stloc.1 + IL_0034: ldloc.1 + IL_0035: call class [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::FailurePattern(class [runtime]System.Exception) + IL_003a: stloc.2 + IL_003b: ldloc.2 + IL_003c: brfalse.s IL_0050 + + IL_003e: ldstr "World" + IL_0043: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_0048: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_004d: pop + IL_004e: leave.s IL_005b + + IL_0050: rethrow + IL_0052: ldnull + IL_0053: unbox.any [FSharp.Core]Microsoft.FSharp.Core.Unit + IL_0058: pop + IL_0059: leave.s IL_005b + + } + IL_005b: 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/TestFunction03b.fs.OptimizeOn.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction03b.fs.OptimizeOn.il.release.bsl new file mode 100644 index 00000000000..0a3ae50e3e0 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction03b.fs.OptimizeOn.il.release.bsl @@ -0,0 +1,133 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly extern netstandard +{ + .publickeytoken = (CC 7B 13 FF CD 2D DD 51 ) + .ver 2:1:0:0 +} +.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 +} +.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 ) + .method public static int32 TestFunction1() cil managed + { + + .maxstack 4 + .locals init (class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4 V_0) + IL_0000: ldstr "Hello" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_000a: stloc.0 + IL_000b: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() + IL_0010: ldloc.0 + IL_0011: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter(class [runtime]System.IO.TextWriter, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0016: pop + IL_0017: ldstr "World" + IL_001c: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_0021: stloc.0 + IL_0022: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() + IL_0027: ldloc.0 + IL_0028: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter(class [runtime]System.IO.TextWriter, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_002d: pop + IL_002e: ldc.i4.7 + IL_002f: ret + } + + .method public static void TestFunction3b() cil managed + { + + .maxstack 4 + .locals init (int32 V_0, + class [runtime]System.Exception V_1, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1 V_2, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4 V_3) + .try + { + IL_0000: nop + IL_0001: call int32 assembly::TestFunction1() + IL_0006: stloc.0 + IL_0007: ldstr "hello" + IL_000c: newobj instance void [netstandard]System.Exception::.ctor(string) + IL_0011: throw + + } + catch [runtime]System.Object + { + IL_0012: castclass [runtime]System.Exception + IL_0017: stloc.1 + IL_0018: ldloc.1 + IL_0019: call class [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::FailurePattern(class [runtime]System.Exception) + IL_001e: stloc.2 + IL_001f: ldloc.2 + IL_0020: brfalse.s IL_003b + + IL_0022: ldstr "World" + IL_0027: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_002c: stloc.3 + IL_002d: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() + IL_0032: ldloc.3 + IL_0033: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter(class [runtime]System.IO.TextWriter, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0038: pop + IL_0039: leave.s IL_0046 + + IL_003b: rethrow + IL_003d: ldnull + IL_003e: unbox.any [FSharp.Core]Microsoft.FSharp.Core.Unit + IL_0043: pop + IL_0044: leave.s IL_0046 + + } + IL_0046: 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/TestFunction03c.fs.il.net472.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction03c.fs.OptimizeOff.il.bsl similarity index 100% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction03c.fs.il.net472.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction03c.fs.OptimizeOff.il.bsl diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction03c.fs.OptimizeOn.il.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction03c.fs.OptimizeOn.il.debug.bsl new file mode 100644 index 00000000000..76aacaacac4 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction03c.fs.OptimizeOn.il.debug.bsl @@ -0,0 +1,138 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly extern netstandard +{ + .publickeytoken = (CC 7B 13 FF CD 2D DD 51 ) + .ver 2:1:0:0 +} +.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 +} +.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 ) + .method public static int32 TestFunction1() cil managed + { + + .maxstack 8 + IL_0000: ldstr "Hello" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_000f: pop + IL_0010: ldstr "World" + IL_0015: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_001a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_001f: pop + IL_0020: ldc.i4.7 + IL_0021: ret + } + + .method public static void TestFunction3c() cil managed + { + + .maxstack 4 + .locals init (int32 V_0, + class [runtime]System.Exception V_1, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1 V_2, + string V_3) + .try + { + IL_0000: nop + IL_0001: ldstr "Hello" + IL_0006: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_000b: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0010: pop + IL_0011: ldstr "World" + IL_0016: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_001b: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0020: pop + IL_0021: ldc.i4.7 + IL_0022: stloc.0 + IL_0023: ldstr "hello" + IL_0028: call class [runtime]System.Exception [FSharp.Core]Microsoft.FSharp.Core.Operators::Failure(string) + IL_002d: throw + + } + catch [runtime]System.Object + { + IL_002e: castclass [runtime]System.Exception + IL_0033: stloc.1 + IL_0034: ldloc.1 + IL_0035: call class [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::FailurePattern(class [runtime]System.Exception) + IL_003a: stloc.2 + IL_003b: ldloc.2 + IL_003c: brfalse.s IL_0069 + + IL_003e: ldloc.2 + IL_003f: call instance !0 class [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1::get_Value() + IL_0044: ldstr "hello" + IL_0049: call bool [netstandard]System.String::Equals(string, + string) + IL_004e: brfalse.s IL_0069 + + IL_0050: ldloc.2 + IL_0051: call instance !0 class [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1::get_Value() + IL_0056: stloc.3 + IL_0057: ldstr "World" + IL_005c: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_0061: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0066: pop + IL_0067: leave.s IL_0074 + + IL_0069: rethrow + IL_006b: ldnull + IL_006c: unbox.any [FSharp.Core]Microsoft.FSharp.Core.Unit + IL_0071: pop + IL_0072: leave.s IL_0074 + + } + IL_0074: 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/TestFunction03c.fs.OptimizeOn.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction03c.fs.OptimizeOn.il.release.bsl new file mode 100644 index 00000000000..ad3903afb89 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction03c.fs.OptimizeOn.il.release.bsl @@ -0,0 +1,144 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly extern netstandard +{ + .publickeytoken = (CC 7B 13 FF CD 2D DD 51 ) + .ver 2:1:0:0 +} +.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 +} +.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 ) + .method public static int32 TestFunction1() cil managed + { + + .maxstack 4 + .locals init (class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4 V_0) + IL_0000: ldstr "Hello" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_000a: stloc.0 + IL_000b: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() + IL_0010: ldloc.0 + IL_0011: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter(class [runtime]System.IO.TextWriter, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0016: pop + IL_0017: ldstr "World" + IL_001c: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_0021: stloc.0 + IL_0022: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() + IL_0027: ldloc.0 + IL_0028: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter(class [runtime]System.IO.TextWriter, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_002d: pop + IL_002e: ldc.i4.7 + IL_002f: ret + } + + .method public static void TestFunction3c() cil managed + { + + .maxstack 4 + .locals init (int32 V_0, + class [runtime]System.Exception V_1, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1 V_2, + string V_3, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4 V_4) + .try + { + IL_0000: nop + IL_0001: call int32 assembly::TestFunction1() + IL_0006: stloc.0 + IL_0007: ldstr "hello" + IL_000c: newobj instance void [netstandard]System.Exception::.ctor(string) + IL_0011: throw + + } + catch [runtime]System.Object + { + IL_0012: castclass [runtime]System.Exception + IL_0017: stloc.1 + IL_0018: ldloc.1 + IL_0019: call class [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::FailurePattern(class [runtime]System.Exception) + IL_001e: stloc.2 + IL_001f: ldloc.2 + IL_0020: brfalse.s IL_0056 + + IL_0022: ldloc.2 + IL_0023: call instance !0 class [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1::get_Value() + IL_0028: ldstr "hello" + IL_002d: call bool [netstandard]System.String::Equals(string, + string) + IL_0032: brfalse.s IL_0056 + + IL_0034: ldloc.2 + IL_0035: call instance !0 class [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1::get_Value() + IL_003a: stloc.3 + IL_003b: ldstr "World" + IL_0040: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_0045: stloc.s V_4 + IL_0047: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() + IL_004c: ldloc.s V_4 + IL_004e: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter(class [runtime]System.IO.TextWriter, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0053: pop + IL_0054: leave.s IL_0061 + + IL_0056: rethrow + IL_0058: ldnull + IL_0059: unbox.any [FSharp.Core]Microsoft.FSharp.Core.Unit + IL_005e: pop + IL_005f: leave.s IL_0061 + + } + IL_0061: 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/TestFunction04.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction04.fs.OptimizeOff.il.bsl similarity index 100% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction04.fs.il.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction04.fs.OptimizeOff.il.bsl diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction04.fs.OptimizeOn.il.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction04.fs.OptimizeOn.il.debug.bsl new file mode 100644 index 00000000000..c70e950c717 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction04.fs.OptimizeOn.il.debug.bsl @@ -0,0 +1,108 @@ + + + + + +.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 +} +.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 ) + .method public static int32 TestFunction1() cil managed + { + + .maxstack 8 + IL_0000: ldstr "Hello" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_000f: pop + IL_0010: ldstr "World" + IL_0015: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_001a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_001f: pop + IL_0020: ldc.i4.7 + IL_0021: ret + } + + .method public static void TestFunction4() cil managed + { + + .maxstack 3 + .locals init (int32 V_0) + .try + { + IL_0000: nop + IL_0001: ldstr "Hello" + IL_0006: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_000b: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0010: pop + IL_0011: ldstr "World" + IL_0016: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_001b: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0020: pop + IL_0021: ldc.i4.7 + IL_0022: stloc.0 + IL_0023: ldstr "Hello" + IL_0028: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_002d: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0032: pop + IL_0033: leave.s IL_0047 + + } + finally + { + IL_0035: nop + IL_0036: ldstr "World" + IL_003b: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_0040: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0045: pop + IL_0046: endfinally + } + IL_0047: 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/TestFunction04.fs.OptimizeOn.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction04.fs.OptimizeOn.il.release.bsl new file mode 100644 index 00000000000..96b23abcb9c --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction04.fs.OptimizeOn.il.release.bsl @@ -0,0 +1,123 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly extern netstandard +{ + .publickeytoken = (CC 7B 13 FF CD 2D DD 51 ) + .ver 2:1:0:0 +} +.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 +} +.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 ) + .method public static int32 TestFunction1() cil managed + { + + .maxstack 4 + .locals init (class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4 V_0) + IL_0000: ldstr "Hello" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_000a: stloc.0 + IL_000b: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() + IL_0010: ldloc.0 + IL_0011: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter(class [runtime]System.IO.TextWriter, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0016: pop + IL_0017: ldstr "World" + IL_001c: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_0021: stloc.0 + IL_0022: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() + IL_0027: ldloc.0 + IL_0028: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter(class [runtime]System.IO.TextWriter, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_002d: pop + IL_002e: ldc.i4.7 + IL_002f: ret + } + + .method public static void TestFunction4() cil managed + { + + .maxstack 4 + .locals init (int32 V_0, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4 V_1) + .try + { + IL_0000: nop + IL_0001: call int32 assembly::TestFunction1() + IL_0006: stloc.0 + IL_0007: ldstr "Hello" + IL_000c: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_0011: stloc.1 + IL_0012: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() + IL_0017: ldloc.1 + IL_0018: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter(class [runtime]System.IO.TextWriter, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_001d: pop + IL_001e: leave.s IL_0039 + + } + finally + { + IL_0020: nop + IL_0021: ldstr "World" + IL_0026: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_002b: stloc.1 + IL_002c: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() + IL_0031: ldloc.1 + IL_0032: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter(class [runtime]System.IO.TextWriter, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0037: pop + IL_0038: endfinally + } + IL_0039: 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/TestFunction05.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction05.fs.OptimizeOff.il.bsl similarity index 100% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction05.fs.il.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction05.fs.OptimizeOff.il.bsl diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction05.fs.OptimizeOn.il.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction05.fs.OptimizeOn.il.debug.bsl new file mode 100644 index 00000000000..ea934ddc64e --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction05.fs.OptimizeOn.il.debug.bsl @@ -0,0 +1,101 @@ + + + + + +.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 +} +.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 ) + .method public static int32 TestFunction1() cil managed + { + + .maxstack 8 + IL_0000: ldstr "Hello" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_000f: pop + IL_0010: ldstr "World" + IL_0015: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_001a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_001f: pop + IL_0020: ldc.i4.7 + IL_0021: ret + } + + .method public static int32 TestFunction5() cil managed + { + + .maxstack 4 + .locals init (int32 V_0, + int32 V_1) + IL_0000: ldstr "Hello" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_000f: pop + IL_0010: ldstr "World" + IL_0015: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_001a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_001f: pop + IL_0020: ldc.i4.7 + IL_0021: stloc.1 + IL_0022: ldstr "Hello" + IL_0027: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_002c: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0031: pop + IL_0032: ldloc.1 + IL_0033: ldloc.1 + IL_0034: add + IL_0035: stloc.0 + IL_0036: ldloc.0 + IL_0037: ldloc.0 + IL_0038: add + IL_0039: 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/TestFunction05.fs.OptimizeOn.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction05.fs.OptimizeOn.il.release.bsl new file mode 100644 index 00000000000..fbe5ab53d7d --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction05.fs.OptimizeOn.il.release.bsl @@ -0,0 +1,112 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly extern netstandard +{ + .publickeytoken = (CC 7B 13 FF CD 2D DD 51 ) + .ver 2:1:0:0 +} +.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 +} +.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 ) + .method public static int32 TestFunction1() cil managed + { + + .maxstack 4 + .locals init (class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4 V_0) + IL_0000: ldstr "Hello" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_000a: stloc.0 + IL_000b: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() + IL_0010: ldloc.0 + IL_0011: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter(class [runtime]System.IO.TextWriter, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0016: pop + IL_0017: ldstr "World" + IL_001c: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_0021: stloc.0 + IL_0022: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() + IL_0027: ldloc.0 + IL_0028: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter(class [runtime]System.IO.TextWriter, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_002d: pop + IL_002e: ldc.i4.7 + IL_002f: ret + } + + .method public static int32 TestFunction5() cil managed + { + + .maxstack 4 + .locals init (int32 V_0, + int32 V_1, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4 V_2) + IL_0000: call int32 assembly::TestFunction1() + IL_0005: stloc.1 + IL_0006: ldstr "Hello" + IL_000b: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_0010: stloc.2 + IL_0011: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() + IL_0016: ldloc.2 + IL_0017: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter(class [runtime]System.IO.TextWriter, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_001c: pop + IL_001d: ldloc.1 + IL_001e: ldloc.1 + IL_001f: add + IL_0020: stloc.0 + IL_0021: ldloc.0 + IL_0022: ldloc.0 + IL_0023: add + IL_0024: 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/TestFunction06.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction06.fs.RealInternalSignatureOff.OptimizeOff.il.bsl similarity index 100% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction06.fs.il.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction06.fs.RealInternalSignatureOff.OptimizeOff.il.bsl diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction06.fs.RealInternalSignatureOff.OptimizeOn.il.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction06.fs.RealInternalSignatureOff.OptimizeOn.il.debug.bsl new file mode 100644 index 00000000000..05e56e999f0 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction06.fs.RealInternalSignatureOff.OptimizeOn.il.debug.bsl @@ -0,0 +1,108 @@ + + + + + +.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 +} +.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 ) + .method public static int32 TestFunction1() cil managed + { + + .maxstack 8 + IL_0000: ldstr "Hello" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_000f: pop + IL_0010: ldstr "World" + IL_0015: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_001a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_001f: pop + IL_0020: ldc.i4.7 + IL_0021: ret + } + + .method assembly static int32 f@10(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar0) cil managed + { + + .maxstack 4 + .locals init (int32 V_0) + IL_0000: ldstr "Hello" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_000f: pop + IL_0010: ldstr "World" + IL_0015: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_001a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_001f: pop + IL_0020: ldc.i4.7 + IL_0021: stloc.0 + IL_0022: ldstr "Hello" + IL_0027: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_002c: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0031: pop + IL_0032: ldloc.0 + IL_0033: ldloc.0 + IL_0034: add + IL_0035: ret + } + + .method public static int32 TestFunction6() cil managed + { + + .maxstack 8 + IL_0000: ldnull + IL_0001: call int32 assembly::f@10(class [FSharp.Core]Microsoft.FSharp.Core.Unit) + IL_0006: ldnull + IL_0007: call int32 assembly::f@10(class [FSharp.Core]Microsoft.FSharp.Core.Unit) + IL_000c: add + IL_000d: 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/TestFunction06.fs.RealInternalSignatureOff.OptimizeOn.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction06.fs.RealInternalSignatureOff.OptimizeOn.il.release.bsl new file mode 100644 index 00000000000..e78c657be22 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction06.fs.RealInternalSignatureOff.OptimizeOn.il.release.bsl @@ -0,0 +1,119 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly extern netstandard +{ + .publickeytoken = (CC 7B 13 FF CD 2D DD 51 ) + .ver 2:1:0:0 +} +.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 +} +.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 ) + .method public static int32 TestFunction1() cil managed + { + + .maxstack 4 + .locals init (class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4 V_0) + IL_0000: ldstr "Hello" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_000a: stloc.0 + IL_000b: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() + IL_0010: ldloc.0 + IL_0011: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter(class [runtime]System.IO.TextWriter, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0016: pop + IL_0017: ldstr "World" + IL_001c: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_0021: stloc.0 + IL_0022: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() + IL_0027: ldloc.0 + IL_0028: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter(class [runtime]System.IO.TextWriter, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_002d: pop + IL_002e: ldc.i4.7 + IL_002f: ret + } + + .method assembly static int32 f@10(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar0) cil managed + { + + .maxstack 4 + .locals init (int32 V_0, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4 V_1) + IL_0000: call int32 assembly::TestFunction1() + IL_0005: stloc.0 + IL_0006: ldstr "Hello" + IL_000b: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_0010: stloc.1 + IL_0011: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() + IL_0016: ldloc.1 + IL_0017: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter(class [runtime]System.IO.TextWriter, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_001c: pop + IL_001d: ldloc.0 + IL_001e: ldloc.0 + IL_001f: add + IL_0020: ret + } + + .method public static int32 TestFunction6() cil managed + { + + .maxstack 8 + IL_0000: ldnull + IL_0001: call int32 assembly::f@10(class [FSharp.Core]Microsoft.FSharp.Core.Unit) + IL_0006: ldnull + IL_0007: call int32 assembly::f@10(class [FSharp.Core]Microsoft.FSharp.Core.Unit) + IL_000c: add + IL_000d: 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/TestFunction03c.fs.il.netcore.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction06.fs.RealInternalSignatureOn.OptimizeOff.il.bsl similarity index 59% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction03c.fs.il.netcore.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction06.fs.RealInternalSignatureOn.OptimizeOff.il.bsl index bad4d474c98..50b0eb21ac2 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction03c.fs.il.netcore.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction06.fs.RealInternalSignatureOn.OptimizeOff.il.bsl @@ -5,11 +5,6 @@ .assembly extern runtime { } .assembly extern FSharp.Core { } -.assembly extern netstandard -{ - .publickeytoken = (CC 7B 13 FF CD 2D DD 51 ) - .ver 2:1:0:0 -} .assembly assembly { .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32, @@ -48,6 +43,52 @@ 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 assembly beforefieldinit f@11 + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 + { + .field static assembly initonly class assembly/f@11 @_instance + .method assembly specialname rtspecialname + instance void .ctor() 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::.ctor() + IL_0006: ret + } + + .method public strict virtual instance int32 + Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar0) cil managed + { + + .maxstack 6 + .locals init (int32 V_0) + IL_0000: call int32 assembly::TestFunction1() + IL_0005: stloc.0 + IL_0006: ldstr "Hello" + IL_000b: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_0010: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0015: pop + IL_0016: ldloc.0 + IL_0017: ldloc.0 + IL_0018: add + IL_0019: ret + } + + .method private specialname rtspecialname static + void .cctor() cil managed + { + + .maxstack 10 + IL_0000: newobj instance void assembly/f@11::.ctor() + IL_0005: stsfld class assembly/f@11 assembly/f@11::@_instance + IL_000a: ret + } + + } + .method public static int32 TestFunction1() cil managed { @@ -66,64 +107,21 @@ IL_0023: ret } - .method public static void TestFunction3c() cil managed + .method public static int32 TestFunction6() cil managed { - .maxstack 4 - .locals init (int32 V_0, - string V_1, - class [runtime]System.Exception V_2, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1 V_3, - string V_4, - string V_5) - .try - { - IL_0000: nop - IL_0001: call int32 assembly::TestFunction1() - IL_0006: stloc.0 - IL_0007: ldstr "hello" - IL_000c: stloc.1 - IL_000d: ldloc.1 - IL_000e: call class [runtime]System.Exception [FSharp.Core]Microsoft.FSharp.Core.Operators::Failure(string) - IL_0013: throw - - } - catch [runtime]System.Object - { - IL_0014: castclass [runtime]System.Exception - IL_0019: stloc.2 - IL_001a: ldloc.2 - IL_001b: call class [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::FailurePattern(class [runtime]System.Exception) - IL_0020: stloc.3 - IL_0021: ldloc.3 - IL_0022: brfalse.s IL_0054 - - IL_0024: ldloc.3 - IL_0025: call instance !0 class [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1::get_Value() - IL_002a: stloc.s V_4 - IL_002c: ldloc.s V_4 - IL_002e: ldstr "hello" - IL_0033: call bool [netstandard]System.String::Equals(string, - string) - IL_0038: brfalse.s IL_0054 - - IL_003a: ldloc.3 - IL_003b: call instance !0 class [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1::get_Value() - IL_0040: stloc.s V_5 - IL_0042: ldstr "World" - IL_0047: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) - IL_004c: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) - IL_0051: pop - IL_0052: leave.s IL_005f - - IL_0054: rethrow - IL_0056: ldnull - IL_0057: unbox.any [FSharp.Core]Microsoft.FSharp.Core.Unit - IL_005c: pop - IL_005d: leave.s IL_005f - - } - IL_005f: ret + .maxstack 5 + .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 V_0) + IL_0000: ldsfld class assembly/f@11 assembly/f@11::@_instance + IL_0005: stloc.0 + IL_0006: ldloc.0 + IL_0007: ldnull + IL_0008: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_000d: ldloc.0 + IL_000e: ldnull + IL_000f: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0014: add + IL_0015: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction06.fs.RealInternalSignatureOn.OptimizeOn.il.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction06.fs.RealInternalSignatureOn.OptimizeOn.il.debug.bsl new file mode 100644 index 00000000000..3aecc9d17a0 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction06.fs.RealInternalSignatureOn.OptimizeOn.il.debug.bsl @@ -0,0 +1,139 @@ + + + + + +.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 +} +.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 assembly beforefieldinit f@11 + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 + { + .field static assembly initonly class assembly/f@11 @_instance + .method assembly specialname rtspecialname instance void .ctor() 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::.ctor() + IL_0006: ret + } + + .method public strict virtual instance int32 Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar0) cil managed + { + + .maxstack 6 + .locals init (int32 V_0) + IL_0000: ldstr "Hello" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_000f: pop + IL_0010: ldstr "World" + IL_0015: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_001a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_001f: pop + IL_0020: ldc.i4.7 + IL_0021: stloc.0 + IL_0022: ldstr "Hello" + IL_0027: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_002c: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0031: pop + IL_0032: ldloc.0 + IL_0033: ldloc.0 + IL_0034: add + IL_0035: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 10 + IL_0000: newobj instance void assembly/f@11::.ctor() + IL_0005: stsfld class assembly/f@11 assembly/f@11::@_instance + IL_000a: ret + } + + } + + .method public static int32 TestFunction1() cil managed + { + + .maxstack 8 + IL_0000: ldstr "Hello" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_000f: pop + IL_0010: ldstr "World" + IL_0015: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_001a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_001f: pop + IL_0020: ldc.i4.7 + IL_0021: ret + } + + .method public static int32 TestFunction6() cil managed + { + + .maxstack 5 + .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 V_0) + IL_0000: ldsfld class assembly/f@11 assembly/f@11::@_instance + IL_0005: stloc.0 + IL_0006: ldloc.0 + IL_0007: ldnull + IL_0008: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_000d: ldloc.0 + IL_000e: ldnull + IL_000f: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0014: add + IL_0015: 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/TestFunction06.fs.RealInternalSignatureOn.OptimizeOn.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction06.fs.RealInternalSignatureOn.OptimizeOn.il.release.bsl new file mode 100644 index 00000000000..fa8c139a871 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction06.fs.RealInternalSignatureOn.OptimizeOn.il.release.bsl @@ -0,0 +1,150 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly extern netstandard +{ + .publickeytoken = (CC 7B 13 FF CD 2D DD 51 ) + .ver 2:1:0:0 +} +.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 +} +.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 assembly beforefieldinit f@11 + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 + { + .field static assembly initonly class assembly/f@11 @_instance + .method assembly specialname rtspecialname instance void .ctor() 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::.ctor() + IL_0006: ret + } + + .method public strict virtual instance int32 Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar0) cil managed + { + + .maxstack 6 + .locals init (int32 V_0, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4 V_1) + IL_0000: call int32 assembly::TestFunction1() + IL_0005: stloc.0 + IL_0006: ldstr "Hello" + IL_000b: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_0010: stloc.1 + IL_0011: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() + IL_0016: ldloc.1 + IL_0017: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter(class [runtime]System.IO.TextWriter, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_001c: pop + IL_001d: ldloc.0 + IL_001e: ldloc.0 + IL_001f: add + IL_0020: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 10 + IL_0000: newobj instance void assembly/f@11::.ctor() + IL_0005: stsfld class assembly/f@11 assembly/f@11::@_instance + IL_000a: ret + } + + } + + .method public static int32 TestFunction1() cil managed + { + + .maxstack 4 + .locals init (class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4 V_0) + IL_0000: ldstr "Hello" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_000a: stloc.0 + IL_000b: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() + IL_0010: ldloc.0 + IL_0011: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter(class [runtime]System.IO.TextWriter, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0016: pop + IL_0017: ldstr "World" + IL_001c: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_0021: stloc.0 + IL_0022: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() + IL_0027: ldloc.0 + IL_0028: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter(class [runtime]System.IO.TextWriter, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_002d: pop + IL_002e: ldc.i4.7 + IL_002f: ret + } + + .method public static int32 TestFunction6() cil managed + { + + .maxstack 5 + .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 V_0) + IL_0000: ldsfld class assembly/f@11 assembly/f@11::@_instance + IL_0005: stloc.0 + IL_0006: ldloc.0 + IL_0007: ldnull + IL_0008: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_000d: ldloc.0 + IL_000e: ldnull + IL_000f: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0014: add + IL_0015: 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/TestFunction09b.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b.fs.OptimizeOff.il.bsl similarity index 100% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b.fs.il.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b.fs.OptimizeOff.il.bsl diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b.fs.OptimizeOn.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b.fs.OptimizeOn.il.bsl new file mode 100644 index 00000000000..d1b6847e2fa --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b.fs.OptimizeOn.il.bsl @@ -0,0 +1,206 @@ + + + + + +.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 +} +.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 ) + .method public static string TestFunction9b(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 x) cil managed + { + + .maxstack 4 + .locals init (class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_0, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_1, + int32 V_2, + int32 V_3) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0007: brfalse IL_015e + + IL_000c: ldarg.0 + IL_000d: stloc.0 + IL_000e: ldloc.0 + IL_000f: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_0014: ldc.i4.1 + IL_0015: sub + IL_0016: switch ( + IL_00df) + IL_001f: ldloc.0 + IL_0020: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_0025: ldc.i4.3 + IL_0026: sub + IL_0027: switch ( + IL_006f) + IL_0030: ldloc.0 + IL_0031: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0036: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_003b: brfalse IL_015e + + IL_0040: ldloc.0 + IL_0041: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0046: stloc.1 + IL_0047: ldloc.1 + IL_0048: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_004d: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0052: brtrue IL_015e + + IL_0057: ldloc.0 + IL_0058: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_005d: ldloc.1 + IL_005e: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_0063: add + IL_0064: ldc.i4.4 + IL_0065: bne.un IL_015e + + IL_006a: br IL_014a + + IL_006f: ldloc.0 + IL_0070: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0075: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_007a: brfalse IL_015e + + IL_007f: ldloc.0 + IL_0080: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0085: stloc.1 + IL_0086: ldloc.1 + IL_0087: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_008c: ldc.i4.4 + IL_008d: sub + IL_008e: switch ( + IL_00cd) + IL_0097: ldloc.1 + IL_0098: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_009d: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00a2: brtrue IL_015e + + IL_00a7: ldloc.0 + IL_00a8: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_00ad: ldloc.1 + IL_00ae: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_00b3: add + IL_00b4: ldc.i4.4 + IL_00b5: bne.un IL_015e + + IL_00ba: ldloc.1 + IL_00bb: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_00c0: ldloc.0 + IL_00c1: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_00c6: stloc.3 + IL_00c7: stloc.2 + IL_00c8: br IL_0158 + + IL_00cd: ldloc.1 + IL_00ce: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00d3: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00d8: brtrue IL_015e + + IL_00dd: br.s IL_0144 + + IL_00df: ldloc.0 + IL_00e0: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00e5: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00ea: brfalse.s IL_015e + + IL_00ec: ldloc.0 + IL_00ed: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00f2: stloc.1 + IL_00f3: ldloc.1 + IL_00f4: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_00f9: ldc.i4.2 + IL_00fa: sub + IL_00fb: switch ( + IL_0131) + IL_0104: ldloc.1 + IL_0105: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_010a: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_010f: brtrue.s IL_015e + + IL_0111: ldloc.0 + IL_0112: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_0117: ldloc.1 + IL_0118: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_011d: add + IL_011e: ldc.i4.4 + IL_011f: bne.un.s IL_015e + + IL_0121: ldloc.1 + IL_0122: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_0127: ldloc.0 + IL_0128: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_012d: stloc.3 + IL_012e: stloc.2 + IL_012f: br.s IL_0158 + + IL_0131: ldloc.1 + IL_0132: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0137: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_013c: brtrue.s IL_015e + + IL_013e: ldstr "three" + IL_0143: ret + + IL_0144: ldstr "seven" + IL_0149: ret + + IL_014a: ldloc.1 + IL_014b: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_0150: stloc.2 + IL_0151: ldloc.0 + IL_0152: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_0157: stloc.3 + IL_0158: ldstr "four" + IL_015d: ret + + IL_015e: ldstr "big" + IL_0163: 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/TestFunction09b1.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b1.fs.OptimizeOff.il.bsl similarity index 100% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b1.fs.il.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b1.fs.OptimizeOff.il.bsl diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b1.fs.OptimizeOn.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b1.fs.OptimizeOn.il.bsl new file mode 100644 index 00000000000..d1b6847e2fa --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b1.fs.OptimizeOn.il.bsl @@ -0,0 +1,206 @@ + + + + + +.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 +} +.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 ) + .method public static string TestFunction9b(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 x) cil managed + { + + .maxstack 4 + .locals init (class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_0, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_1, + int32 V_2, + int32 V_3) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0007: brfalse IL_015e + + IL_000c: ldarg.0 + IL_000d: stloc.0 + IL_000e: ldloc.0 + IL_000f: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_0014: ldc.i4.1 + IL_0015: sub + IL_0016: switch ( + IL_00df) + IL_001f: ldloc.0 + IL_0020: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_0025: ldc.i4.3 + IL_0026: sub + IL_0027: switch ( + IL_006f) + IL_0030: ldloc.0 + IL_0031: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0036: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_003b: brfalse IL_015e + + IL_0040: ldloc.0 + IL_0041: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0046: stloc.1 + IL_0047: ldloc.1 + IL_0048: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_004d: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0052: brtrue IL_015e + + IL_0057: ldloc.0 + IL_0058: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_005d: ldloc.1 + IL_005e: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_0063: add + IL_0064: ldc.i4.4 + IL_0065: bne.un IL_015e + + IL_006a: br IL_014a + + IL_006f: ldloc.0 + IL_0070: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0075: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_007a: brfalse IL_015e + + IL_007f: ldloc.0 + IL_0080: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0085: stloc.1 + IL_0086: ldloc.1 + IL_0087: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_008c: ldc.i4.4 + IL_008d: sub + IL_008e: switch ( + IL_00cd) + IL_0097: ldloc.1 + IL_0098: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_009d: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00a2: brtrue IL_015e + + IL_00a7: ldloc.0 + IL_00a8: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_00ad: ldloc.1 + IL_00ae: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_00b3: add + IL_00b4: ldc.i4.4 + IL_00b5: bne.un IL_015e + + IL_00ba: ldloc.1 + IL_00bb: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_00c0: ldloc.0 + IL_00c1: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_00c6: stloc.3 + IL_00c7: stloc.2 + IL_00c8: br IL_0158 + + IL_00cd: ldloc.1 + IL_00ce: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00d3: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00d8: brtrue IL_015e + + IL_00dd: br.s IL_0144 + + IL_00df: ldloc.0 + IL_00e0: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00e5: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00ea: brfalse.s IL_015e + + IL_00ec: ldloc.0 + IL_00ed: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00f2: stloc.1 + IL_00f3: ldloc.1 + IL_00f4: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_00f9: ldc.i4.2 + IL_00fa: sub + IL_00fb: switch ( + IL_0131) + IL_0104: ldloc.1 + IL_0105: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_010a: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_010f: brtrue.s IL_015e + + IL_0111: ldloc.0 + IL_0112: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_0117: ldloc.1 + IL_0118: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_011d: add + IL_011e: ldc.i4.4 + IL_011f: bne.un.s IL_015e + + IL_0121: ldloc.1 + IL_0122: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_0127: ldloc.0 + IL_0128: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_012d: stloc.3 + IL_012e: stloc.2 + IL_012f: br.s IL_0158 + + IL_0131: ldloc.1 + IL_0132: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0137: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_013c: brtrue.s IL_015e + + IL_013e: ldstr "three" + IL_0143: ret + + IL_0144: ldstr "seven" + IL_0149: ret + + IL_014a: ldloc.1 + IL_014b: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_0150: stloc.2 + IL_0151: ldloc.0 + IL_0152: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_0157: stloc.3 + IL_0158: ldstr "four" + IL_015d: ret + + IL_015e: ldstr "big" + IL_0163: 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/TestFunction09b2.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b2.fs.OptimizeOff.il.bsl similarity index 100% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b2.fs.il.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b2.fs.OptimizeOff.il.bsl diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b2.fs.OptimizeOn.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b2.fs.OptimizeOn.il.bsl new file mode 100644 index 00000000000..d1b6847e2fa --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b2.fs.OptimizeOn.il.bsl @@ -0,0 +1,206 @@ + + + + + +.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 +} +.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 ) + .method public static string TestFunction9b(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 x) cil managed + { + + .maxstack 4 + .locals init (class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_0, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_1, + int32 V_2, + int32 V_3) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0007: brfalse IL_015e + + IL_000c: ldarg.0 + IL_000d: stloc.0 + IL_000e: ldloc.0 + IL_000f: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_0014: ldc.i4.1 + IL_0015: sub + IL_0016: switch ( + IL_00df) + IL_001f: ldloc.0 + IL_0020: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_0025: ldc.i4.3 + IL_0026: sub + IL_0027: switch ( + IL_006f) + IL_0030: ldloc.0 + IL_0031: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0036: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_003b: brfalse IL_015e + + IL_0040: ldloc.0 + IL_0041: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0046: stloc.1 + IL_0047: ldloc.1 + IL_0048: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_004d: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0052: brtrue IL_015e + + IL_0057: ldloc.0 + IL_0058: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_005d: ldloc.1 + IL_005e: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_0063: add + IL_0064: ldc.i4.4 + IL_0065: bne.un IL_015e + + IL_006a: br IL_014a + + IL_006f: ldloc.0 + IL_0070: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0075: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_007a: brfalse IL_015e + + IL_007f: ldloc.0 + IL_0080: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0085: stloc.1 + IL_0086: ldloc.1 + IL_0087: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_008c: ldc.i4.4 + IL_008d: sub + IL_008e: switch ( + IL_00cd) + IL_0097: ldloc.1 + IL_0098: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_009d: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00a2: brtrue IL_015e + + IL_00a7: ldloc.0 + IL_00a8: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_00ad: ldloc.1 + IL_00ae: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_00b3: add + IL_00b4: ldc.i4.4 + IL_00b5: bne.un IL_015e + + IL_00ba: ldloc.1 + IL_00bb: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_00c0: ldloc.0 + IL_00c1: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_00c6: stloc.3 + IL_00c7: stloc.2 + IL_00c8: br IL_0158 + + IL_00cd: ldloc.1 + IL_00ce: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00d3: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00d8: brtrue IL_015e + + IL_00dd: br.s IL_0144 + + IL_00df: ldloc.0 + IL_00e0: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00e5: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00ea: brfalse.s IL_015e + + IL_00ec: ldloc.0 + IL_00ed: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00f2: stloc.1 + IL_00f3: ldloc.1 + IL_00f4: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_00f9: ldc.i4.2 + IL_00fa: sub + IL_00fb: switch ( + IL_0131) + IL_0104: ldloc.1 + IL_0105: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_010a: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_010f: brtrue.s IL_015e + + IL_0111: ldloc.0 + IL_0112: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_0117: ldloc.1 + IL_0118: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_011d: add + IL_011e: ldc.i4.4 + IL_011f: bne.un.s IL_015e + + IL_0121: ldloc.1 + IL_0122: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_0127: ldloc.0 + IL_0128: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_012d: stloc.3 + IL_012e: stloc.2 + IL_012f: br.s IL_0158 + + IL_0131: ldloc.1 + IL_0132: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0137: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_013c: brtrue.s IL_015e + + IL_013e: ldstr "three" + IL_0143: ret + + IL_0144: ldstr "seven" + IL_0149: ret + + IL_014a: ldloc.1 + IL_014b: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_0150: stloc.2 + IL_0151: ldloc.0 + IL_0152: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_0157: stloc.3 + IL_0158: ldstr "four" + IL_015d: ret + + IL_015e: ldstr "big" + IL_0163: 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/TestFunction09b3.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b3.fs.OptimizeOff.il.bsl similarity index 100% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b3.fs.il.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b3.fs.OptimizeOff.il.bsl diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b3.fs.OptimizeOn.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b3.fs.OptimizeOn.il.bsl new file mode 100644 index 00000000000..d1b6847e2fa --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b3.fs.OptimizeOn.il.bsl @@ -0,0 +1,206 @@ + + + + + +.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 +} +.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 ) + .method public static string TestFunction9b(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 x) cil managed + { + + .maxstack 4 + .locals init (class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_0, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_1, + int32 V_2, + int32 V_3) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0007: brfalse IL_015e + + IL_000c: ldarg.0 + IL_000d: stloc.0 + IL_000e: ldloc.0 + IL_000f: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_0014: ldc.i4.1 + IL_0015: sub + IL_0016: switch ( + IL_00df) + IL_001f: ldloc.0 + IL_0020: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_0025: ldc.i4.3 + IL_0026: sub + IL_0027: switch ( + IL_006f) + IL_0030: ldloc.0 + IL_0031: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0036: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_003b: brfalse IL_015e + + IL_0040: ldloc.0 + IL_0041: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0046: stloc.1 + IL_0047: ldloc.1 + IL_0048: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_004d: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0052: brtrue IL_015e + + IL_0057: ldloc.0 + IL_0058: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_005d: ldloc.1 + IL_005e: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_0063: add + IL_0064: ldc.i4.4 + IL_0065: bne.un IL_015e + + IL_006a: br IL_014a + + IL_006f: ldloc.0 + IL_0070: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0075: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_007a: brfalse IL_015e + + IL_007f: ldloc.0 + IL_0080: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0085: stloc.1 + IL_0086: ldloc.1 + IL_0087: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_008c: ldc.i4.4 + IL_008d: sub + IL_008e: switch ( + IL_00cd) + IL_0097: ldloc.1 + IL_0098: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_009d: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00a2: brtrue IL_015e + + IL_00a7: ldloc.0 + IL_00a8: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_00ad: ldloc.1 + IL_00ae: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_00b3: add + IL_00b4: ldc.i4.4 + IL_00b5: bne.un IL_015e + + IL_00ba: ldloc.1 + IL_00bb: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_00c0: ldloc.0 + IL_00c1: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_00c6: stloc.3 + IL_00c7: stloc.2 + IL_00c8: br IL_0158 + + IL_00cd: ldloc.1 + IL_00ce: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00d3: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00d8: brtrue IL_015e + + IL_00dd: br.s IL_0144 + + IL_00df: ldloc.0 + IL_00e0: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00e5: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00ea: brfalse.s IL_015e + + IL_00ec: ldloc.0 + IL_00ed: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00f2: stloc.1 + IL_00f3: ldloc.1 + IL_00f4: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_00f9: ldc.i4.2 + IL_00fa: sub + IL_00fb: switch ( + IL_0131) + IL_0104: ldloc.1 + IL_0105: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_010a: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_010f: brtrue.s IL_015e + + IL_0111: ldloc.0 + IL_0112: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_0117: ldloc.1 + IL_0118: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_011d: add + IL_011e: ldc.i4.4 + IL_011f: bne.un.s IL_015e + + IL_0121: ldloc.1 + IL_0122: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_0127: ldloc.0 + IL_0128: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_012d: stloc.3 + IL_012e: stloc.2 + IL_012f: br.s IL_0158 + + IL_0131: ldloc.1 + IL_0132: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0137: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_013c: brtrue.s IL_015e + + IL_013e: ldstr "three" + IL_0143: ret + + IL_0144: ldstr "seven" + IL_0149: ret + + IL_014a: ldloc.1 + IL_014b: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_0150: stloc.2 + IL_0151: ldloc.0 + IL_0152: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_0157: stloc.3 + IL_0158: ldstr "four" + IL_015d: ret + + IL_015e: ldstr "big" + IL_0163: 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/TestFunction09b4.fs.RealInternalSignatureOff.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b4.fs.RealInternalSignatureOff.OptimizeOff.il.bsl similarity index 100% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b4.fs.RealInternalSignatureOff.il.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b4.fs.RealInternalSignatureOff.OptimizeOff.il.bsl diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b4.fs.RealInternalSignatureOff.OptimizeOn.il.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b4.fs.RealInternalSignatureOff.OptimizeOn.il.debug.bsl new file mode 100644 index 00000000000..3a71ba2a668 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b4.fs.RealInternalSignatureOff.OptimizeOn.il.debug.bsl @@ -0,0 +1,100 @@ + + + + + +.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 +} +.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 ) + .method public static !!a Null() cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.LiteralAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 3 + .locals init (!!a V_0) + IL_0000: ldloc.0 + IL_0001: ret + } + + .method public specialname static 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: ldc.i4.5 + IL_0001: ret + } + + .property int32 x() + { + .get int32 assembly::get_x() + } +} + +.class private abstract auto ansi sealed ''.$assembly + extends [runtime]System.Object +{ + .field static assembly int32 init@ + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: nop + IL_0001: nop + IL_0002: ldc.i4.5 + IL_0003: box [runtime]System.Int32 + IL_0008: brfalse.s IL_000c + + IL_000a: br.s IL_001f + + IL_000c: ldstr "Is null" + IL_0011: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_0016: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_001b: pop + IL_001c: nop + IL_001d: br.s IL_0021 + + IL_001f: nop + IL_0020: nop + IL_0021: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b4.fs.RealInternalSignatureOff.OptimizeOn.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b4.fs.RealInternalSignatureOff.OptimizeOn.il.release.bsl new file mode 100644 index 00000000000..eb2cb7152ea --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b4.fs.RealInternalSignatureOff.OptimizeOn.il.release.bsl @@ -0,0 +1,110 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly extern netstandard +{ + .publickeytoken = (CC 7B 13 FF CD 2D DD 51 ) + .ver 2:1:0:0 +} +.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 +} +.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 ) + .method public static !!a Null() cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.LiteralAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 3 + .locals init (!!a V_0) + IL_0000: ldloc.0 + IL_0001: ret + } + + .method public specialname static 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: ldc.i4.5 + IL_0001: ret + } + + .property int32 x() + { + .get int32 assembly::get_x() + } +} + +.class private abstract auto ansi sealed ''.$assembly + extends [runtime]System.Object +{ + .field static assembly int32 init@ + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 4 + .locals init (class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4 V_0) + IL_0000: nop + IL_0001: nop + IL_0002: ldc.i4.5 + IL_0003: box [runtime]System.Int32 + IL_0008: brfalse.s IL_000c + + IL_000a: br.s IL_0026 + + IL_000c: ldstr "Is null" + IL_0011: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_0016: stloc.0 + IL_0017: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() + IL_001c: ldloc.0 + IL_001d: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter(class [runtime]System.IO.TextWriter, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0022: pop + IL_0023: nop + IL_0024: br.s IL_0028 + + IL_0026: nop + IL_0027: nop + IL_0028: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b4.fs.RealInternalSignatureOn.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b4.fs.RealInternalSignatureOn.OptimizeOff.il.bsl similarity index 96% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b4.fs.RealInternalSignatureOn.il.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b4.fs.RealInternalSignatureOn.OptimizeOff.il.bsl index 56d60188bec..8e7e9131047 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b4.fs.RealInternalSignatureOn.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b4.fs.RealInternalSignatureOn.OptimizeOff.il.bsl @@ -16,16 +16,6 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 -} -.mresource public FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - } .module assembly.exe diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b4.fs.RealInternalSignatureOn.OptimizeOn.il.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b4.fs.RealInternalSignatureOn.OptimizeOn.il.debug.bsl new file mode 100644 index 00000000000..c23d0f0be87 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b4.fs.RealInternalSignatureOn.OptimizeOn.il.debug.bsl @@ -0,0 +1,119 @@ + + + + + +.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 +} +.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 ) + .method public static !!a Null() cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.LiteralAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 3 + .locals init (!!a V_0) + IL_0000: ldloc.0 + IL_0001: ret + } + + .method public specialname static 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: ldc.i4.5 + IL_0001: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: stsfld int32 ''.$assembly::init@ + IL_0006: ldsfld int32 ''.$assembly::init@ + IL_000b: pop + IL_000c: ret + } + + .method assembly specialname static void staticInitialization@() cil managed + { + + .maxstack 8 + IL_0000: nop + IL_0001: nop + IL_0002: ldc.i4.5 + IL_0003: box [runtime]System.Int32 + IL_0008: brfalse.s IL_000c + + IL_000a: br.s IL_001f + + IL_000c: ldstr "Is null" + IL_0011: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_0016: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_001b: pop + IL_001c: nop + IL_001d: br.s IL_0021 + + IL_001f: nop + IL_0020: nop + IL_0021: ret + } + + .property int32 x() + { + .get int32 assembly::get_x() + } +} + +.class private abstract auto ansi sealed ''.$assembly + extends [runtime]System.Object +{ + .field static assembly int32 init@ + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: call void assembly::staticInitialization@() + IL_0005: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b4.fs.RealInternalSignatureOn.OptimizeOn.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b4.fs.RealInternalSignatureOn.OptimizeOn.il.release.bsl new file mode 100644 index 00000000000..222c70142b7 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction09b4.fs.RealInternalSignatureOn.OptimizeOn.il.release.bsl @@ -0,0 +1,129 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly extern netstandard +{ + .publickeytoken = (CC 7B 13 FF CD 2D DD 51 ) + .ver 2:1:0:0 +} +.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 +} +.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 ) + .method public static !!a Null() cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.LiteralAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 3 + .locals init (!!a V_0) + IL_0000: ldloc.0 + IL_0001: ret + } + + .method public specialname static 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: ldc.i4.5 + IL_0001: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: stsfld int32 ''.$assembly::init@ + IL_0006: ldsfld int32 ''.$assembly::init@ + IL_000b: pop + IL_000c: ret + } + + .method assembly specialname static void staticInitialization@() cil managed + { + + .maxstack 4 + .locals init (class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4 V_0) + IL_0000: nop + IL_0001: nop + IL_0002: ldc.i4.5 + IL_0003: box [runtime]System.Int32 + IL_0008: brfalse.s IL_000c + + IL_000a: br.s IL_0026 + + IL_000c: ldstr "Is null" + IL_0011: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_0016: stloc.0 + IL_0017: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() + IL_001c: ldloc.0 + IL_001d: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter(class [runtime]System.IO.TextWriter, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0022: pop + IL_0023: nop + IL_0024: br.s IL_0028 + + IL_0026: nop + IL_0027: nop + IL_0028: ret + } + + .property int32 x() + { + .get int32 assembly::get_x() + } +} + +.class private abstract auto ansi sealed ''.$assembly + extends [runtime]System.Object +{ + .field static assembly int32 init@ + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: call void assembly::staticInitialization@() + IL_0005: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction10.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction10.fs.OptimizeOff.il.bsl similarity index 100% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction10.fs.il.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction10.fs.OptimizeOff.il.bsl diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction10.fs.OptimizeOn.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction10.fs.OptimizeOn.il.bsl new file mode 100644 index 00000000000..16b4ee0ef05 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction10.fs.OptimizeOn.il.bsl @@ -0,0 +1,67 @@ + + + + + +.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 +} +.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 ) + .method public static int32 assembly(int32 x, + int32 y) cil managed + { + + .maxstack 8 + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: ldarg.1 + IL_0003: add + IL_0004: 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/TestFunction15.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction15.fs.OptimizeOff.il.bsl similarity index 100% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction15.fs.il.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction15.fs.OptimizeOff.il.bsl diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction15.fs.OptimizeOn.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction15.fs.OptimizeOn.il.bsl new file mode 100644 index 00000000000..d8bdd5101a0 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction15.fs.OptimizeOn.il.bsl @@ -0,0 +1,113 @@ + + + + + +.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 +} +.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 assembly beforefieldinit assembly@6 + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 + { + .field static assembly initonly class assembly/assembly@6 @_instance + .method assembly specialname rtspecialname instance void .ctor() 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::.ctor() + IL_0006: ret + } + + .method public strict virtual instance int32 Invoke(int32 x) cil managed + { + + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: ldc.i4.1 + IL_0002: add + IL_0003: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 10 + IL_0000: newobj instance void assembly/assembly@6::.ctor() + IL_0005: stsfld class assembly/assembly@6 assembly/assembly@6::@_instance + IL_000a: ret + } + + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly(int32 inp) cil managed + { + + .maxstack 8 + IL_0000: nop + IL_0001: ldsfld class assembly/assembly@6 assembly/assembly@6::@_instance + IL_0006: ldc.i4.1 + IL_0007: ldc.i4.2 + IL_0008: ldc.i4.3 + IL_0009: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() + IL_000e: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_0013: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_0018: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_001d: tail. + IL_001f: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.ListModule::Map(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_0024: 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/TestFunction16.fs.il.net472.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction16.fs.OptimizeOff.il.net472.debug.bsl similarity index 100% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction16.fs.il.net472.debug.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction16.fs.OptimizeOff.il.net472.debug.bsl diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction16.fs.il.net472.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction16.fs.OptimizeOff.il.net472.release.bsl similarity index 100% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction16.fs.il.net472.release.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction16.fs.OptimizeOff.il.net472.release.bsl diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction16.fs.il.netcore.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction16.fs.OptimizeOff.il.netcore.debug.bsl similarity index 100% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction16.fs.il.netcore.debug.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction16.fs.OptimizeOff.il.netcore.debug.bsl diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction16.fs.il.netcore.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction16.fs.OptimizeOff.il.netcore.release.bsl similarity index 100% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction16.fs.il.netcore.release.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction16.fs.OptimizeOff.il.netcore.release.bsl diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction16.fs.OptimizeOn.il.net472.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction16.fs.OptimizeOn.il.net472.debug.bsl new file mode 100644 index 00000000000..6184cdff6e8 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction16.fs.OptimizeOn.il.net472.debug.bsl @@ -0,0 +1,681 @@ + + + + + +.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 +} +.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 autochar serializable sealed nested public beforefieldinit U + 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 [runtime]System.Diagnostics.DebuggerDisplayAttribute::.ctor(string) = ( 01 00 15 7B 5F 5F 44 65 62 75 67 44 69 73 70 6C + 61 79 28 29 2C 6E 71 7D 00 00 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 01 00 00 00 00 00 ) + .field assembly initonly int32 item1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 assembly initonly int32 item2 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) + .method public static class assembly/U NewU(int32 item1, int32 item2) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32) = ( 01 00 08 00 00 00 00 00 00 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: ldarg.0 + IL_0001: ldarg.1 + IL_0002: newobj instance void assembly/U::.ctor(int32, + int32) + IL_0007: ret + } + + .method assembly specialname rtspecialname instance void .ctor(int32 item1, int32 item2) 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 36 2B 55 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: ldarg.0 + IL_0001: call instance void [runtime]System.Object::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld int32 assembly/U::item1 + IL_000d: ldarg.0 + IL_000e: ldarg.2 + IL_000f: stfld int32 assembly/U::item2 + IL_0014: ret + } + + .method public hidebysig instance int32 get_Item1() 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/U::item1 + IL_0006: ret + } + + .method public hidebysig instance int32 get_Item2() 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/U::item2 + IL_0006: ret + } + + .method public hidebysig instance int32 get_Tag() 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: pop + IL_0002: ldc.i4.0 + IL_0003: ret + } + + .method assembly hidebysig specialname instance object __DebugDisplay() 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: ldstr "%+0.8A" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,string>::.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 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/U>::.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/U obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 5 + .locals init (class assembly/U V_0, + class assembly/U V_1, + int32 V_2, + class [runtime]System.Collections.IComparer V_3, + int32 V_4, + int32 V_5) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0062 + + IL_0003: ldarg.1 + IL_0004: brfalse.s IL_0060 + + IL_0006: ldarg.0 + IL_0007: pop + IL_0008: ldarg.0 + IL_0009: stloc.0 + IL_000a: ldarg.1 + IL_000b: stloc.1 + IL_000c: call class [runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() + IL_0011: stloc.3 + IL_0012: ldloc.0 + IL_0013: ldfld int32 assembly/U::item1 + IL_0018: stloc.s V_4 + IL_001a: ldloc.1 + IL_001b: ldfld int32 assembly/U::item1 + IL_0020: stloc.s V_5 + IL_0022: ldloc.s V_4 + IL_0024: ldloc.s V_5 + IL_0026: cgt + IL_0028: ldloc.s V_4 + IL_002a: ldloc.s V_5 + IL_002c: clt + IL_002e: sub + IL_002f: stloc.2 + IL_0030: ldloc.2 + IL_0031: ldc.i4.0 + IL_0032: bge.s IL_0036 + + IL_0034: ldloc.2 + IL_0035: ret + + IL_0036: ldloc.2 + IL_0037: ldc.i4.0 + IL_0038: ble.s IL_003c + + IL_003a: ldloc.2 + IL_003b: ret + + IL_003c: call class [runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() + IL_0041: stloc.3 + IL_0042: ldloc.0 + IL_0043: ldfld int32 assembly/U::item2 + IL_0048: stloc.s V_4 + IL_004a: ldloc.1 + IL_004b: ldfld int32 assembly/U::item2 + IL_0050: stloc.s V_5 + IL_0052: ldloc.s V_4 + IL_0054: ldloc.s V_5 + IL_0056: cgt + IL_0058: ldloc.s V_4 + IL_005a: ldloc.s V_5 + IL_005c: clt + IL_005e: sub + IL_005f: ret + + IL_0060: ldc.i4.1 + IL_0061: ret + + IL_0062: ldarg.1 + IL_0063: brfalse.s IL_0067 + + IL_0065: ldc.i4.m1 + IL_0066: ret + + IL_0067: ldc.i4.0 + IL_0068: 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/U + IL_0007: callvirt instance int32 assembly/U::CompareTo(class assembly/U) + 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/U V_0, + class assembly/U V_1, + class assembly/U V_2, + int32 V_3, + int32 V_4, + int32 V_5) + IL_0000: ldarg.1 + IL_0001: unbox.any assembly/U + IL_0006: stloc.0 + IL_0007: ldarg.0 + IL_0008: brfalse.s IL_0062 + + IL_000a: ldarg.1 + IL_000b: unbox.any assembly/U + IL_0010: brfalse.s IL_0060 + + IL_0012: ldarg.0 + IL_0013: pop + IL_0014: ldarg.0 + IL_0015: stloc.1 + IL_0016: ldloc.0 + IL_0017: stloc.2 + IL_0018: ldloc.1 + IL_0019: ldfld int32 assembly/U::item1 + IL_001e: stloc.s V_4 + IL_0020: ldloc.2 + IL_0021: ldfld int32 assembly/U::item1 + IL_0026: stloc.s V_5 + IL_0028: ldloc.s V_4 + IL_002a: ldloc.s V_5 + IL_002c: cgt + IL_002e: ldloc.s V_4 + IL_0030: ldloc.s V_5 + IL_0032: clt + IL_0034: sub + IL_0035: stloc.3 + IL_0036: ldloc.3 + IL_0037: ldc.i4.0 + IL_0038: bge.s IL_003c + + IL_003a: ldloc.3 + IL_003b: ret + + IL_003c: ldloc.3 + IL_003d: ldc.i4.0 + IL_003e: ble.s IL_0042 + + IL_0040: ldloc.3 + IL_0041: ret + + IL_0042: ldloc.1 + IL_0043: ldfld int32 assembly/U::item2 + IL_0048: stloc.s V_4 + IL_004a: ldloc.2 + IL_004b: ldfld int32 assembly/U::item2 + IL_0050: stloc.s V_5 + IL_0052: ldloc.s V_4 + IL_0054: ldloc.s V_5 + IL_0056: cgt + IL_0058: ldloc.s V_4 + IL_005a: ldloc.s V_5 + IL_005c: clt + IL_005e: sub + IL_005f: ret + + IL_0060: ldc.i4.1 + IL_0061: ret + + IL_0062: ldarg.1 + IL_0063: unbox.any assembly/U + IL_0068: brfalse.s IL_006c + + IL_006a: ldc.i4.m1 + IL_006b: ret + + IL_006c: ldc.i4.0 + IL_006d: 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 assembly/U V_1) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0037 + + IL_0003: ldc.i4.0 + IL_0004: stloc.0 + IL_0005: ldarg.0 + IL_0006: pop + IL_0007: ldarg.0 + IL_0008: stloc.1 + IL_0009: ldc.i4.0 + IL_000a: stloc.0 + IL_000b: ldc.i4 0x9e3779b9 + IL_0010: ldloc.1 + IL_0011: ldfld int32 assembly/U::item2 + 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: ldloc.1 + IL_0026: ldfld int32 assembly/U::item1 + IL_002b: ldloc.0 + IL_002c: ldc.i4.6 + IL_002d: shl + IL_002e: ldloc.0 + IL_002f: ldc.i4.2 + IL_0030: shr + IL_0031: add + IL_0032: add + IL_0033: add + IL_0034: stloc.0 + IL_0035: ldloc.0 + IL_0036: ret + + IL_0037: ldc.i4.0 + IL_0038: 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/U::GetHashCode(class [runtime]System.Collections.IEqualityComparer) + IL_000b: ret + } + + .method public hidebysig instance bool Equals(class assembly/U 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/U V_0, + class assembly/U V_1) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_002d + + IL_0003: ldarg.1 + IL_0004: brfalse.s IL_002b + + IL_0006: ldarg.0 + IL_0007: pop + IL_0008: ldarg.0 + IL_0009: stloc.0 + IL_000a: ldarg.1 + IL_000b: stloc.1 + IL_000c: ldloc.0 + IL_000d: ldfld int32 assembly/U::item1 + IL_0012: ldloc.1 + IL_0013: ldfld int32 assembly/U::item1 + IL_0018: bne.un.s IL_0029 + + IL_001a: ldloc.0 + IL_001b: ldfld int32 assembly/U::item2 + IL_0020: ldloc.1 + IL_0021: ldfld int32 assembly/U::item2 + IL_0026: ceq + IL_0028: ret + + IL_0029: ldc.i4.0 + IL_002a: ret + + IL_002b: ldc.i4.0 + IL_002c: ret + + IL_002d: ldarg.1 + IL_002e: ldnull + IL_002f: cgt.un + IL_0031: ldc.i4.0 + IL_0032: ceq + IL_0034: 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 5 + .locals init (class assembly/U V_0) + IL_0000: ldarg.1 + IL_0001: isinst assembly/U + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: brfalse.s IL_0013 + + IL_000a: ldarg.0 + IL_000b: ldloc.0 + IL_000c: ldarg.2 + IL_000d: callvirt instance bool assembly/U::Equals(class assembly/U, + class [runtime]System.Collections.IEqualityComparer) + IL_0012: ret + + IL_0013: ldc.i4.0 + IL_0014: ret + } + + .method public hidebysig virtual final instance bool Equals(class assembly/U obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 4 + .locals init (class assembly/U V_0, + class assembly/U V_1) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_002d + + IL_0003: ldarg.1 + IL_0004: brfalse.s IL_002b + + IL_0006: ldarg.0 + IL_0007: pop + IL_0008: ldarg.0 + IL_0009: stloc.0 + IL_000a: ldarg.1 + IL_000b: stloc.1 + IL_000c: ldloc.0 + IL_000d: ldfld int32 assembly/U::item1 + IL_0012: ldloc.1 + IL_0013: ldfld int32 assembly/U::item1 + IL_0018: bne.un.s IL_0029 + + IL_001a: ldloc.0 + IL_001b: ldfld int32 assembly/U::item2 + IL_0020: ldloc.1 + IL_0021: ldfld int32 assembly/U::item2 + IL_0026: ceq + IL_0028: ret + + IL_0029: ldc.i4.0 + IL_002a: ret + + IL_002b: ldc.i4.0 + IL_002c: ret + + IL_002d: ldarg.1 + IL_002e: ldnull + IL_002f: cgt.un + IL_0031: ldc.i4.0 + IL_0032: ceq + IL_0034: 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/U V_0) + IL_0000: ldarg.1 + IL_0001: isinst assembly/U + 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/U::Equals(class assembly/U) + IL_0011: ret + + IL_0012: ldc.i4.0 + IL_0013: ret + } + + .property instance int32 Tag() + { + .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.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .get instance int32 assembly/U::get_Tag() + } + .property instance int32 Item1() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32, + int32) = ( 01 00 04 00 00 00 00 00 00 00 00 00 00 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 ) + .get instance int32 assembly/U::get_Item1() + } + .property instance int32 Item2() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32, + int32) = ( 01 00 04 00 00 00 00 00 00 00 01 00 00 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 ) + .get instance int32 assembly/U::get_Item2() + } + } + + .method public static class [runtime]System.Tuple`2 assembly(int32 inp) cil managed + { + + .maxstack 4 + .locals init (class assembly/U V_0) + IL_0000: ldarg.0 + IL_0001: ldarg.0 + IL_0002: call class assembly/U assembly/U::NewU(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 serializable 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__ + .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 +{ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .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 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 + } + + .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 ) + .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 ) + .get instance class [runtime]System.Type System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::get_Type() + } +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction16.fs.OptimizeOn.il.net472.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction16.fs.OptimizeOn.il.net472.release.bsl new file mode 100644 index 00000000000..6184cdff6e8 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction16.fs.OptimizeOn.il.net472.release.bsl @@ -0,0 +1,681 @@ + + + + + +.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 +} +.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 autochar serializable sealed nested public beforefieldinit U + 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 [runtime]System.Diagnostics.DebuggerDisplayAttribute::.ctor(string) = ( 01 00 15 7B 5F 5F 44 65 62 75 67 44 69 73 70 6C + 61 79 28 29 2C 6E 71 7D 00 00 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 01 00 00 00 00 00 ) + .field assembly initonly int32 item1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 assembly initonly int32 item2 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) + .method public static class assembly/U NewU(int32 item1, int32 item2) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32) = ( 01 00 08 00 00 00 00 00 00 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: ldarg.0 + IL_0001: ldarg.1 + IL_0002: newobj instance void assembly/U::.ctor(int32, + int32) + IL_0007: ret + } + + .method assembly specialname rtspecialname instance void .ctor(int32 item1, int32 item2) 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 36 2B 55 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: ldarg.0 + IL_0001: call instance void [runtime]System.Object::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld int32 assembly/U::item1 + IL_000d: ldarg.0 + IL_000e: ldarg.2 + IL_000f: stfld int32 assembly/U::item2 + IL_0014: ret + } + + .method public hidebysig instance int32 get_Item1() 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/U::item1 + IL_0006: ret + } + + .method public hidebysig instance int32 get_Item2() 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/U::item2 + IL_0006: ret + } + + .method public hidebysig instance int32 get_Tag() 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: pop + IL_0002: ldc.i4.0 + IL_0003: ret + } + + .method assembly hidebysig specialname instance object __DebugDisplay() 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: ldstr "%+0.8A" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,string>::.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 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/U>::.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/U obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 5 + .locals init (class assembly/U V_0, + class assembly/U V_1, + int32 V_2, + class [runtime]System.Collections.IComparer V_3, + int32 V_4, + int32 V_5) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0062 + + IL_0003: ldarg.1 + IL_0004: brfalse.s IL_0060 + + IL_0006: ldarg.0 + IL_0007: pop + IL_0008: ldarg.0 + IL_0009: stloc.0 + IL_000a: ldarg.1 + IL_000b: stloc.1 + IL_000c: call class [runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() + IL_0011: stloc.3 + IL_0012: ldloc.0 + IL_0013: ldfld int32 assembly/U::item1 + IL_0018: stloc.s V_4 + IL_001a: ldloc.1 + IL_001b: ldfld int32 assembly/U::item1 + IL_0020: stloc.s V_5 + IL_0022: ldloc.s V_4 + IL_0024: ldloc.s V_5 + IL_0026: cgt + IL_0028: ldloc.s V_4 + IL_002a: ldloc.s V_5 + IL_002c: clt + IL_002e: sub + IL_002f: stloc.2 + IL_0030: ldloc.2 + IL_0031: ldc.i4.0 + IL_0032: bge.s IL_0036 + + IL_0034: ldloc.2 + IL_0035: ret + + IL_0036: ldloc.2 + IL_0037: ldc.i4.0 + IL_0038: ble.s IL_003c + + IL_003a: ldloc.2 + IL_003b: ret + + IL_003c: call class [runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() + IL_0041: stloc.3 + IL_0042: ldloc.0 + IL_0043: ldfld int32 assembly/U::item2 + IL_0048: stloc.s V_4 + IL_004a: ldloc.1 + IL_004b: ldfld int32 assembly/U::item2 + IL_0050: stloc.s V_5 + IL_0052: ldloc.s V_4 + IL_0054: ldloc.s V_5 + IL_0056: cgt + IL_0058: ldloc.s V_4 + IL_005a: ldloc.s V_5 + IL_005c: clt + IL_005e: sub + IL_005f: ret + + IL_0060: ldc.i4.1 + IL_0061: ret + + IL_0062: ldarg.1 + IL_0063: brfalse.s IL_0067 + + IL_0065: ldc.i4.m1 + IL_0066: ret + + IL_0067: ldc.i4.0 + IL_0068: 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/U + IL_0007: callvirt instance int32 assembly/U::CompareTo(class assembly/U) + 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/U V_0, + class assembly/U V_1, + class assembly/U V_2, + int32 V_3, + int32 V_4, + int32 V_5) + IL_0000: ldarg.1 + IL_0001: unbox.any assembly/U + IL_0006: stloc.0 + IL_0007: ldarg.0 + IL_0008: brfalse.s IL_0062 + + IL_000a: ldarg.1 + IL_000b: unbox.any assembly/U + IL_0010: brfalse.s IL_0060 + + IL_0012: ldarg.0 + IL_0013: pop + IL_0014: ldarg.0 + IL_0015: stloc.1 + IL_0016: ldloc.0 + IL_0017: stloc.2 + IL_0018: ldloc.1 + IL_0019: ldfld int32 assembly/U::item1 + IL_001e: stloc.s V_4 + IL_0020: ldloc.2 + IL_0021: ldfld int32 assembly/U::item1 + IL_0026: stloc.s V_5 + IL_0028: ldloc.s V_4 + IL_002a: ldloc.s V_5 + IL_002c: cgt + IL_002e: ldloc.s V_4 + IL_0030: ldloc.s V_5 + IL_0032: clt + IL_0034: sub + IL_0035: stloc.3 + IL_0036: ldloc.3 + IL_0037: ldc.i4.0 + IL_0038: bge.s IL_003c + + IL_003a: ldloc.3 + IL_003b: ret + + IL_003c: ldloc.3 + IL_003d: ldc.i4.0 + IL_003e: ble.s IL_0042 + + IL_0040: ldloc.3 + IL_0041: ret + + IL_0042: ldloc.1 + IL_0043: ldfld int32 assembly/U::item2 + IL_0048: stloc.s V_4 + IL_004a: ldloc.2 + IL_004b: ldfld int32 assembly/U::item2 + IL_0050: stloc.s V_5 + IL_0052: ldloc.s V_4 + IL_0054: ldloc.s V_5 + IL_0056: cgt + IL_0058: ldloc.s V_4 + IL_005a: ldloc.s V_5 + IL_005c: clt + IL_005e: sub + IL_005f: ret + + IL_0060: ldc.i4.1 + IL_0061: ret + + IL_0062: ldarg.1 + IL_0063: unbox.any assembly/U + IL_0068: brfalse.s IL_006c + + IL_006a: ldc.i4.m1 + IL_006b: ret + + IL_006c: ldc.i4.0 + IL_006d: 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 assembly/U V_1) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0037 + + IL_0003: ldc.i4.0 + IL_0004: stloc.0 + IL_0005: ldarg.0 + IL_0006: pop + IL_0007: ldarg.0 + IL_0008: stloc.1 + IL_0009: ldc.i4.0 + IL_000a: stloc.0 + IL_000b: ldc.i4 0x9e3779b9 + IL_0010: ldloc.1 + IL_0011: ldfld int32 assembly/U::item2 + 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: ldloc.1 + IL_0026: ldfld int32 assembly/U::item1 + IL_002b: ldloc.0 + IL_002c: ldc.i4.6 + IL_002d: shl + IL_002e: ldloc.0 + IL_002f: ldc.i4.2 + IL_0030: shr + IL_0031: add + IL_0032: add + IL_0033: add + IL_0034: stloc.0 + IL_0035: ldloc.0 + IL_0036: ret + + IL_0037: ldc.i4.0 + IL_0038: 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/U::GetHashCode(class [runtime]System.Collections.IEqualityComparer) + IL_000b: ret + } + + .method public hidebysig instance bool Equals(class assembly/U 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/U V_0, + class assembly/U V_1) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_002d + + IL_0003: ldarg.1 + IL_0004: brfalse.s IL_002b + + IL_0006: ldarg.0 + IL_0007: pop + IL_0008: ldarg.0 + IL_0009: stloc.0 + IL_000a: ldarg.1 + IL_000b: stloc.1 + IL_000c: ldloc.0 + IL_000d: ldfld int32 assembly/U::item1 + IL_0012: ldloc.1 + IL_0013: ldfld int32 assembly/U::item1 + IL_0018: bne.un.s IL_0029 + + IL_001a: ldloc.0 + IL_001b: ldfld int32 assembly/U::item2 + IL_0020: ldloc.1 + IL_0021: ldfld int32 assembly/U::item2 + IL_0026: ceq + IL_0028: ret + + IL_0029: ldc.i4.0 + IL_002a: ret + + IL_002b: ldc.i4.0 + IL_002c: ret + + IL_002d: ldarg.1 + IL_002e: ldnull + IL_002f: cgt.un + IL_0031: ldc.i4.0 + IL_0032: ceq + IL_0034: 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 5 + .locals init (class assembly/U V_0) + IL_0000: ldarg.1 + IL_0001: isinst assembly/U + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: brfalse.s IL_0013 + + IL_000a: ldarg.0 + IL_000b: ldloc.0 + IL_000c: ldarg.2 + IL_000d: callvirt instance bool assembly/U::Equals(class assembly/U, + class [runtime]System.Collections.IEqualityComparer) + IL_0012: ret + + IL_0013: ldc.i4.0 + IL_0014: ret + } + + .method public hidebysig virtual final instance bool Equals(class assembly/U obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 4 + .locals init (class assembly/U V_0, + class assembly/U V_1) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_002d + + IL_0003: ldarg.1 + IL_0004: brfalse.s IL_002b + + IL_0006: ldarg.0 + IL_0007: pop + IL_0008: ldarg.0 + IL_0009: stloc.0 + IL_000a: ldarg.1 + IL_000b: stloc.1 + IL_000c: ldloc.0 + IL_000d: ldfld int32 assembly/U::item1 + IL_0012: ldloc.1 + IL_0013: ldfld int32 assembly/U::item1 + IL_0018: bne.un.s IL_0029 + + IL_001a: ldloc.0 + IL_001b: ldfld int32 assembly/U::item2 + IL_0020: ldloc.1 + IL_0021: ldfld int32 assembly/U::item2 + IL_0026: ceq + IL_0028: ret + + IL_0029: ldc.i4.0 + IL_002a: ret + + IL_002b: ldc.i4.0 + IL_002c: ret + + IL_002d: ldarg.1 + IL_002e: ldnull + IL_002f: cgt.un + IL_0031: ldc.i4.0 + IL_0032: ceq + IL_0034: 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/U V_0) + IL_0000: ldarg.1 + IL_0001: isinst assembly/U + 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/U::Equals(class assembly/U) + IL_0011: ret + + IL_0012: ldc.i4.0 + IL_0013: ret + } + + .property instance int32 Tag() + { + .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.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .get instance int32 assembly/U::get_Tag() + } + .property instance int32 Item1() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32, + int32) = ( 01 00 04 00 00 00 00 00 00 00 00 00 00 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 ) + .get instance int32 assembly/U::get_Item1() + } + .property instance int32 Item2() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32, + int32) = ( 01 00 04 00 00 00 00 00 00 00 01 00 00 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 ) + .get instance int32 assembly/U::get_Item2() + } + } + + .method public static class [runtime]System.Tuple`2 assembly(int32 inp) cil managed + { + + .maxstack 4 + .locals init (class assembly/U V_0) + IL_0000: ldarg.0 + IL_0001: ldarg.0 + IL_0002: call class assembly/U assembly/U::NewU(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 serializable 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__ + .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 +{ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .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 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 + } + + .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 ) + .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 ) + .get instance class [runtime]System.Type System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::get_Type() + } +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction16.fs.OptimizeOn.il.netcore.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction16.fs.OptimizeOn.il.netcore.debug.bsl new file mode 100644 index 00000000000..947e3ebf7aa --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction16.fs.OptimizeOn.il.netcore.debug.bsl @@ -0,0 +1,591 @@ + + + + + +.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 +} +.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 autochar serializable sealed nested public beforefieldinit U + 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 [runtime]System.Diagnostics.DebuggerDisplayAttribute::.ctor(string) = ( 01 00 15 7B 5F 5F 44 65 62 75 67 44 69 73 70 6C + 61 79 28 29 2C 6E 71 7D 00 00 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 01 00 00 00 00 00 ) + .field assembly initonly int32 item1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 assembly initonly int32 item2 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) + .method public static class assembly/U NewU(int32 item1, int32 item2) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32) = ( 01 00 08 00 00 00 00 00 00 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: ldarg.0 + IL_0001: ldarg.1 + IL_0002: newobj instance void assembly/U::.ctor(int32, + int32) + IL_0007: ret + } + + .method assembly specialname rtspecialname instance void .ctor(int32 item1, int32 item2) 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 36 2B 55 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: ldarg.0 + IL_0001: call instance void [runtime]System.Object::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld int32 assembly/U::item1 + IL_000d: ldarg.0 + IL_000e: ldarg.2 + IL_000f: stfld int32 assembly/U::item2 + IL_0014: ret + } + + .method public hidebysig instance int32 get_Item1() 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/U::item1 + IL_0006: ret + } + + .method public hidebysig instance int32 get_Item2() 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/U::item2 + IL_0006: ret + } + + .method public hidebysig instance int32 get_Tag() 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: pop + IL_0002: ldc.i4.0 + IL_0003: ret + } + + .method assembly hidebysig specialname instance object __DebugDisplay() 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: ldstr "%+0.8A" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,string>::.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 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/U>::.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/U obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 5 + .locals init (class assembly/U V_0, + class assembly/U V_1, + int32 V_2, + class [runtime]System.Collections.IComparer V_3, + int32 V_4, + int32 V_5) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0062 + + IL_0003: ldarg.1 + IL_0004: brfalse.s IL_0060 + + IL_0006: ldarg.0 + IL_0007: pop + IL_0008: ldarg.0 + IL_0009: stloc.0 + IL_000a: ldarg.1 + IL_000b: stloc.1 + IL_000c: call class [runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() + IL_0011: stloc.3 + IL_0012: ldloc.0 + IL_0013: ldfld int32 assembly/U::item1 + IL_0018: stloc.s V_4 + IL_001a: ldloc.1 + IL_001b: ldfld int32 assembly/U::item1 + IL_0020: stloc.s V_5 + IL_0022: ldloc.s V_4 + IL_0024: ldloc.s V_5 + IL_0026: cgt + IL_0028: ldloc.s V_4 + IL_002a: ldloc.s V_5 + IL_002c: clt + IL_002e: sub + IL_002f: stloc.2 + IL_0030: ldloc.2 + IL_0031: ldc.i4.0 + IL_0032: bge.s IL_0036 + + IL_0034: ldloc.2 + IL_0035: ret + + IL_0036: ldloc.2 + IL_0037: ldc.i4.0 + IL_0038: ble.s IL_003c + + IL_003a: ldloc.2 + IL_003b: ret + + IL_003c: call class [runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() + IL_0041: stloc.3 + IL_0042: ldloc.0 + IL_0043: ldfld int32 assembly/U::item2 + IL_0048: stloc.s V_4 + IL_004a: ldloc.1 + IL_004b: ldfld int32 assembly/U::item2 + IL_0050: stloc.s V_5 + IL_0052: ldloc.s V_4 + IL_0054: ldloc.s V_5 + IL_0056: cgt + IL_0058: ldloc.s V_4 + IL_005a: ldloc.s V_5 + IL_005c: clt + IL_005e: sub + IL_005f: ret + + IL_0060: ldc.i4.1 + IL_0061: ret + + IL_0062: ldarg.1 + IL_0063: brfalse.s IL_0067 + + IL_0065: ldc.i4.m1 + IL_0066: ret + + IL_0067: ldc.i4.0 + IL_0068: 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/U + IL_0007: callvirt instance int32 assembly/U::CompareTo(class assembly/U) + 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/U V_0, + class assembly/U V_1, + class assembly/U V_2, + int32 V_3, + int32 V_4, + int32 V_5) + IL_0000: ldarg.1 + IL_0001: unbox.any assembly/U + IL_0006: stloc.0 + IL_0007: ldarg.0 + IL_0008: brfalse.s IL_0062 + + IL_000a: ldarg.1 + IL_000b: unbox.any assembly/U + IL_0010: brfalse.s IL_0060 + + IL_0012: ldarg.0 + IL_0013: pop + IL_0014: ldarg.0 + IL_0015: stloc.1 + IL_0016: ldloc.0 + IL_0017: stloc.2 + IL_0018: ldloc.1 + IL_0019: ldfld int32 assembly/U::item1 + IL_001e: stloc.s V_4 + IL_0020: ldloc.2 + IL_0021: ldfld int32 assembly/U::item1 + IL_0026: stloc.s V_5 + IL_0028: ldloc.s V_4 + IL_002a: ldloc.s V_5 + IL_002c: cgt + IL_002e: ldloc.s V_4 + IL_0030: ldloc.s V_5 + IL_0032: clt + IL_0034: sub + IL_0035: stloc.3 + IL_0036: ldloc.3 + IL_0037: ldc.i4.0 + IL_0038: bge.s IL_003c + + IL_003a: ldloc.3 + IL_003b: ret + + IL_003c: ldloc.3 + IL_003d: ldc.i4.0 + IL_003e: ble.s IL_0042 + + IL_0040: ldloc.3 + IL_0041: ret + + IL_0042: ldloc.1 + IL_0043: ldfld int32 assembly/U::item2 + IL_0048: stloc.s V_4 + IL_004a: ldloc.2 + IL_004b: ldfld int32 assembly/U::item2 + IL_0050: stloc.s V_5 + IL_0052: ldloc.s V_4 + IL_0054: ldloc.s V_5 + IL_0056: cgt + IL_0058: ldloc.s V_4 + IL_005a: ldloc.s V_5 + IL_005c: clt + IL_005e: sub + IL_005f: ret + + IL_0060: ldc.i4.1 + IL_0061: ret + + IL_0062: ldarg.1 + IL_0063: unbox.any assembly/U + IL_0068: brfalse.s IL_006c + + IL_006a: ldc.i4.m1 + IL_006b: ret + + IL_006c: ldc.i4.0 + IL_006d: 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 assembly/U V_1) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0037 + + IL_0003: ldc.i4.0 + IL_0004: stloc.0 + IL_0005: ldarg.0 + IL_0006: pop + IL_0007: ldarg.0 + IL_0008: stloc.1 + IL_0009: ldc.i4.0 + IL_000a: stloc.0 + IL_000b: ldc.i4 0x9e3779b9 + IL_0010: ldloc.1 + IL_0011: ldfld int32 assembly/U::item2 + 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: ldloc.1 + IL_0026: ldfld int32 assembly/U::item1 + IL_002b: ldloc.0 + IL_002c: ldc.i4.6 + IL_002d: shl + IL_002e: ldloc.0 + IL_002f: ldc.i4.2 + IL_0030: shr + IL_0031: add + IL_0032: add + IL_0033: add + IL_0034: stloc.0 + IL_0035: ldloc.0 + IL_0036: ret + + IL_0037: ldc.i4.0 + IL_0038: 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/U::GetHashCode(class [runtime]System.Collections.IEqualityComparer) + IL_000b: ret + } + + .method public hidebysig instance bool Equals(class assembly/U 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/U V_0, + class assembly/U V_1) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_002d + + IL_0003: ldarg.1 + IL_0004: brfalse.s IL_002b + + IL_0006: ldarg.0 + IL_0007: pop + IL_0008: ldarg.0 + IL_0009: stloc.0 + IL_000a: ldarg.1 + IL_000b: stloc.1 + IL_000c: ldloc.0 + IL_000d: ldfld int32 assembly/U::item1 + IL_0012: ldloc.1 + IL_0013: ldfld int32 assembly/U::item1 + IL_0018: bne.un.s IL_0029 + + IL_001a: ldloc.0 + IL_001b: ldfld int32 assembly/U::item2 + IL_0020: ldloc.1 + IL_0021: ldfld int32 assembly/U::item2 + IL_0026: ceq + IL_0028: ret + + IL_0029: ldc.i4.0 + IL_002a: ret + + IL_002b: ldc.i4.0 + IL_002c: ret + + IL_002d: ldarg.1 + IL_002e: ldnull + IL_002f: cgt.un + IL_0031: ldc.i4.0 + IL_0032: ceq + IL_0034: 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 5 + .locals init (class assembly/U V_0) + IL_0000: ldarg.1 + IL_0001: isinst assembly/U + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: brfalse.s IL_0013 + + IL_000a: ldarg.0 + IL_000b: ldloc.0 + IL_000c: ldarg.2 + IL_000d: callvirt instance bool assembly/U::Equals(class assembly/U, + class [runtime]System.Collections.IEqualityComparer) + IL_0012: ret + + IL_0013: ldc.i4.0 + IL_0014: ret + } + + .method public hidebysig virtual final instance bool Equals(class assembly/U obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 4 + .locals init (class assembly/U V_0, + class assembly/U V_1) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_002d + + IL_0003: ldarg.1 + IL_0004: brfalse.s IL_002b + + IL_0006: ldarg.0 + IL_0007: pop + IL_0008: ldarg.0 + IL_0009: stloc.0 + IL_000a: ldarg.1 + IL_000b: stloc.1 + IL_000c: ldloc.0 + IL_000d: ldfld int32 assembly/U::item1 + IL_0012: ldloc.1 + IL_0013: ldfld int32 assembly/U::item1 + IL_0018: bne.un.s IL_0029 + + IL_001a: ldloc.0 + IL_001b: ldfld int32 assembly/U::item2 + IL_0020: ldloc.1 + IL_0021: ldfld int32 assembly/U::item2 + IL_0026: ceq + IL_0028: ret + + IL_0029: ldc.i4.0 + IL_002a: ret + + IL_002b: ldc.i4.0 + IL_002c: ret + + IL_002d: ldarg.1 + IL_002e: ldnull + IL_002f: cgt.un + IL_0031: ldc.i4.0 + IL_0032: ceq + IL_0034: 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/U V_0) + IL_0000: ldarg.1 + IL_0001: isinst assembly/U + 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/U::Equals(class assembly/U) + IL_0011: ret + + IL_0012: ldc.i4.0 + IL_0013: ret + } + + .property instance int32 Tag() + { + .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.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .get instance int32 assembly/U::get_Tag() + } + .property instance int32 Item1() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32, + int32) = ( 01 00 04 00 00 00 00 00 00 00 00 00 00 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 ) + .get instance int32 assembly/U::get_Item1() + } + .property instance int32 Item2() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32, + int32) = ( 01 00 04 00 00 00 00 00 00 00 01 00 00 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 ) + .get instance int32 assembly/U::get_Item2() + } + } + + .method public static class [runtime]System.Tuple`2 assembly(int32 inp) cil managed + { + + .maxstack 4 + .locals init (class assembly/U V_0) + IL_0000: ldarg.0 + IL_0001: ldarg.0 + IL_0002: call class assembly/U assembly/U::NewU(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/TestFunction16.fs.OptimizeOn.il.netcore.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction16.fs.OptimizeOn.il.netcore.release.bsl new file mode 100644 index 00000000000..947e3ebf7aa --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction16.fs.OptimizeOn.il.netcore.release.bsl @@ -0,0 +1,591 @@ + + + + + +.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 +} +.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 autochar serializable sealed nested public beforefieldinit U + 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 [runtime]System.Diagnostics.DebuggerDisplayAttribute::.ctor(string) = ( 01 00 15 7B 5F 5F 44 65 62 75 67 44 69 73 70 6C + 61 79 28 29 2C 6E 71 7D 00 00 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 01 00 00 00 00 00 ) + .field assembly initonly int32 item1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 assembly initonly int32 item2 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) + .method public static class assembly/U NewU(int32 item1, int32 item2) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32) = ( 01 00 08 00 00 00 00 00 00 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: ldarg.0 + IL_0001: ldarg.1 + IL_0002: newobj instance void assembly/U::.ctor(int32, + int32) + IL_0007: ret + } + + .method assembly specialname rtspecialname instance void .ctor(int32 item1, int32 item2) 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 36 2B 55 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: ldarg.0 + IL_0001: call instance void [runtime]System.Object::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld int32 assembly/U::item1 + IL_000d: ldarg.0 + IL_000e: ldarg.2 + IL_000f: stfld int32 assembly/U::item2 + IL_0014: ret + } + + .method public hidebysig instance int32 get_Item1() 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/U::item1 + IL_0006: ret + } + + .method public hidebysig instance int32 get_Item2() 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/U::item2 + IL_0006: ret + } + + .method public hidebysig instance int32 get_Tag() 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: pop + IL_0002: ldc.i4.0 + IL_0003: ret + } + + .method assembly hidebysig specialname instance object __DebugDisplay() 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: ldstr "%+0.8A" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,string>::.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 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/U>::.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/U obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 5 + .locals init (class assembly/U V_0, + class assembly/U V_1, + int32 V_2, + class [runtime]System.Collections.IComparer V_3, + int32 V_4, + int32 V_5) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0062 + + IL_0003: ldarg.1 + IL_0004: brfalse.s IL_0060 + + IL_0006: ldarg.0 + IL_0007: pop + IL_0008: ldarg.0 + IL_0009: stloc.0 + IL_000a: ldarg.1 + IL_000b: stloc.1 + IL_000c: call class [runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() + IL_0011: stloc.3 + IL_0012: ldloc.0 + IL_0013: ldfld int32 assembly/U::item1 + IL_0018: stloc.s V_4 + IL_001a: ldloc.1 + IL_001b: ldfld int32 assembly/U::item1 + IL_0020: stloc.s V_5 + IL_0022: ldloc.s V_4 + IL_0024: ldloc.s V_5 + IL_0026: cgt + IL_0028: ldloc.s V_4 + IL_002a: ldloc.s V_5 + IL_002c: clt + IL_002e: sub + IL_002f: stloc.2 + IL_0030: ldloc.2 + IL_0031: ldc.i4.0 + IL_0032: bge.s IL_0036 + + IL_0034: ldloc.2 + IL_0035: ret + + IL_0036: ldloc.2 + IL_0037: ldc.i4.0 + IL_0038: ble.s IL_003c + + IL_003a: ldloc.2 + IL_003b: ret + + IL_003c: call class [runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() + IL_0041: stloc.3 + IL_0042: ldloc.0 + IL_0043: ldfld int32 assembly/U::item2 + IL_0048: stloc.s V_4 + IL_004a: ldloc.1 + IL_004b: ldfld int32 assembly/U::item2 + IL_0050: stloc.s V_5 + IL_0052: ldloc.s V_4 + IL_0054: ldloc.s V_5 + IL_0056: cgt + IL_0058: ldloc.s V_4 + IL_005a: ldloc.s V_5 + IL_005c: clt + IL_005e: sub + IL_005f: ret + + IL_0060: ldc.i4.1 + IL_0061: ret + + IL_0062: ldarg.1 + IL_0063: brfalse.s IL_0067 + + IL_0065: ldc.i4.m1 + IL_0066: ret + + IL_0067: ldc.i4.0 + IL_0068: 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/U + IL_0007: callvirt instance int32 assembly/U::CompareTo(class assembly/U) + 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/U V_0, + class assembly/U V_1, + class assembly/U V_2, + int32 V_3, + int32 V_4, + int32 V_5) + IL_0000: ldarg.1 + IL_0001: unbox.any assembly/U + IL_0006: stloc.0 + IL_0007: ldarg.0 + IL_0008: brfalse.s IL_0062 + + IL_000a: ldarg.1 + IL_000b: unbox.any assembly/U + IL_0010: brfalse.s IL_0060 + + IL_0012: ldarg.0 + IL_0013: pop + IL_0014: ldarg.0 + IL_0015: stloc.1 + IL_0016: ldloc.0 + IL_0017: stloc.2 + IL_0018: ldloc.1 + IL_0019: ldfld int32 assembly/U::item1 + IL_001e: stloc.s V_4 + IL_0020: ldloc.2 + IL_0021: ldfld int32 assembly/U::item1 + IL_0026: stloc.s V_5 + IL_0028: ldloc.s V_4 + IL_002a: ldloc.s V_5 + IL_002c: cgt + IL_002e: ldloc.s V_4 + IL_0030: ldloc.s V_5 + IL_0032: clt + IL_0034: sub + IL_0035: stloc.3 + IL_0036: ldloc.3 + IL_0037: ldc.i4.0 + IL_0038: bge.s IL_003c + + IL_003a: ldloc.3 + IL_003b: ret + + IL_003c: ldloc.3 + IL_003d: ldc.i4.0 + IL_003e: ble.s IL_0042 + + IL_0040: ldloc.3 + IL_0041: ret + + IL_0042: ldloc.1 + IL_0043: ldfld int32 assembly/U::item2 + IL_0048: stloc.s V_4 + IL_004a: ldloc.2 + IL_004b: ldfld int32 assembly/U::item2 + IL_0050: stloc.s V_5 + IL_0052: ldloc.s V_4 + IL_0054: ldloc.s V_5 + IL_0056: cgt + IL_0058: ldloc.s V_4 + IL_005a: ldloc.s V_5 + IL_005c: clt + IL_005e: sub + IL_005f: ret + + IL_0060: ldc.i4.1 + IL_0061: ret + + IL_0062: ldarg.1 + IL_0063: unbox.any assembly/U + IL_0068: brfalse.s IL_006c + + IL_006a: ldc.i4.m1 + IL_006b: ret + + IL_006c: ldc.i4.0 + IL_006d: 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 assembly/U V_1) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0037 + + IL_0003: ldc.i4.0 + IL_0004: stloc.0 + IL_0005: ldarg.0 + IL_0006: pop + IL_0007: ldarg.0 + IL_0008: stloc.1 + IL_0009: ldc.i4.0 + IL_000a: stloc.0 + IL_000b: ldc.i4 0x9e3779b9 + IL_0010: ldloc.1 + IL_0011: ldfld int32 assembly/U::item2 + 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: ldloc.1 + IL_0026: ldfld int32 assembly/U::item1 + IL_002b: ldloc.0 + IL_002c: ldc.i4.6 + IL_002d: shl + IL_002e: ldloc.0 + IL_002f: ldc.i4.2 + IL_0030: shr + IL_0031: add + IL_0032: add + IL_0033: add + IL_0034: stloc.0 + IL_0035: ldloc.0 + IL_0036: ret + + IL_0037: ldc.i4.0 + IL_0038: 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/U::GetHashCode(class [runtime]System.Collections.IEqualityComparer) + IL_000b: ret + } + + .method public hidebysig instance bool Equals(class assembly/U 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/U V_0, + class assembly/U V_1) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_002d + + IL_0003: ldarg.1 + IL_0004: brfalse.s IL_002b + + IL_0006: ldarg.0 + IL_0007: pop + IL_0008: ldarg.0 + IL_0009: stloc.0 + IL_000a: ldarg.1 + IL_000b: stloc.1 + IL_000c: ldloc.0 + IL_000d: ldfld int32 assembly/U::item1 + IL_0012: ldloc.1 + IL_0013: ldfld int32 assembly/U::item1 + IL_0018: bne.un.s IL_0029 + + IL_001a: ldloc.0 + IL_001b: ldfld int32 assembly/U::item2 + IL_0020: ldloc.1 + IL_0021: ldfld int32 assembly/U::item2 + IL_0026: ceq + IL_0028: ret + + IL_0029: ldc.i4.0 + IL_002a: ret + + IL_002b: ldc.i4.0 + IL_002c: ret + + IL_002d: ldarg.1 + IL_002e: ldnull + IL_002f: cgt.un + IL_0031: ldc.i4.0 + IL_0032: ceq + IL_0034: 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 5 + .locals init (class assembly/U V_0) + IL_0000: ldarg.1 + IL_0001: isinst assembly/U + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: brfalse.s IL_0013 + + IL_000a: ldarg.0 + IL_000b: ldloc.0 + IL_000c: ldarg.2 + IL_000d: callvirt instance bool assembly/U::Equals(class assembly/U, + class [runtime]System.Collections.IEqualityComparer) + IL_0012: ret + + IL_0013: ldc.i4.0 + IL_0014: ret + } + + .method public hidebysig virtual final instance bool Equals(class assembly/U obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 4 + .locals init (class assembly/U V_0, + class assembly/U V_1) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_002d + + IL_0003: ldarg.1 + IL_0004: brfalse.s IL_002b + + IL_0006: ldarg.0 + IL_0007: pop + IL_0008: ldarg.0 + IL_0009: stloc.0 + IL_000a: ldarg.1 + IL_000b: stloc.1 + IL_000c: ldloc.0 + IL_000d: ldfld int32 assembly/U::item1 + IL_0012: ldloc.1 + IL_0013: ldfld int32 assembly/U::item1 + IL_0018: bne.un.s IL_0029 + + IL_001a: ldloc.0 + IL_001b: ldfld int32 assembly/U::item2 + IL_0020: ldloc.1 + IL_0021: ldfld int32 assembly/U::item2 + IL_0026: ceq + IL_0028: ret + + IL_0029: ldc.i4.0 + IL_002a: ret + + IL_002b: ldc.i4.0 + IL_002c: ret + + IL_002d: ldarg.1 + IL_002e: ldnull + IL_002f: cgt.un + IL_0031: ldc.i4.0 + IL_0032: ceq + IL_0034: 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/U V_0) + IL_0000: ldarg.1 + IL_0001: isinst assembly/U + 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/U::Equals(class assembly/U) + IL_0011: ret + + IL_0012: ldc.i4.0 + IL_0013: ret + } + + .property instance int32 Tag() + { + .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.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .get instance int32 assembly/U::get_Tag() + } + .property instance int32 Item1() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32, + int32) = ( 01 00 04 00 00 00 00 00 00 00 00 00 00 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 ) + .get instance int32 assembly/U::get_Item1() + } + .property instance int32 Item2() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32, + int32) = ( 01 00 04 00 00 00 00 00 00 00 01 00 00 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 ) + .get instance int32 assembly/U::get_Item2() + } + } + + .method public static class [runtime]System.Tuple`2 assembly(int32 inp) cil managed + { + + .maxstack 4 + .locals init (class assembly/U V_0) + IL_0000: ldarg.0 + IL_0001: ldarg.0 + IL_0002: call class assembly/U assembly/U::NewU(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/TestFunction17.fs.il.net472.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.OptimizeOff.il.net472.debug.bsl similarity index 96% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.net472.debug.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.OptimizeOff.il.net472.debug.bsl index 7ac3e544a40..dc1f44b8100 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.net472.debug.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.OptimizeOff.il.net472.debug.bsl @@ -16,16 +16,6 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 -} -.mresource public FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - } .module assembly.exe @@ -80,9 +70,7 @@ IL_0006: ret } - .method public specialname rtspecialname - instance void .ctor(int32 x, - int32 y) cil managed + .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 @@ -221,9 +209,7 @@ IL_000c: ret } - .method public hidebysig virtual final - instance int32 CompareTo(object obj, - class [runtime]System.Collections.IComparer comp) cil managed + .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 ) @@ -401,9 +387,7 @@ IL_000b: ret } - .method public hidebysig instance bool - Equals(class assembly/R obj, - class [runtime]System.Collections.IEqualityComparer comp) cil managed + .method public hidebysig instance bool Equals(class assembly/R obj, class [runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) @@ -469,9 +453,7 @@ IL_004a: ret } - .method public hidebysig virtual final - instance bool Equals(object obj, - class [runtime]System.Collections.IEqualityComparer comp) cil managed + .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 ) @@ -634,9 +616,7 @@ .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 + .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 ) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.net472.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.OptimizeOff.il.net472.release.bsl similarity index 100% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.net472.release.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.OptimizeOff.il.net472.release.bsl diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.netcore.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.OptimizeOff.il.netcore.debug.bsl similarity index 95% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.netcore.debug.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.OptimizeOff.il.netcore.debug.bsl index a65cea31c60..5d852fc64f3 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.netcore.debug.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.OptimizeOff.il.netcore.debug.bsl @@ -16,16 +16,6 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 -} -.mresource public FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - } .module assembly.exe @@ -80,9 +70,7 @@ IL_0006: ret } - .method public specialname rtspecialname - instance void .ctor(int32 x, - int32 y) cil managed + .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 @@ -221,9 +209,7 @@ IL_000c: ret } - .method public hidebysig virtual final - instance int32 CompareTo(object obj, - class [runtime]System.Collections.IComparer comp) cil managed + .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 ) @@ -401,9 +387,7 @@ IL_000b: ret } - .method public hidebysig instance bool - Equals(class assembly/R obj, - class [runtime]System.Collections.IEqualityComparer comp) cil managed + .method public hidebysig instance bool Equals(class assembly/R obj, class [runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) @@ -469,9 +453,7 @@ IL_004a: ret } - .method public hidebysig virtual final - instance bool Equals(object obj, - class [runtime]System.Collections.IEqualityComparer comp) cil managed + .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 ) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.netcore.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.OptimizeOff.il.netcore.release.bsl similarity index 95% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.netcore.release.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.OptimizeOff.il.netcore.release.bsl index f73cfafb59f..73ec84dc342 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.il.netcore.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.OptimizeOff.il.netcore.release.bsl @@ -16,16 +16,6 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 -} -.mresource public FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - } .module assembly.exe @@ -80,9 +70,7 @@ IL_0006: ret } - .method public specialname rtspecialname - instance void .ctor(int32 x, - int32 y) cil managed + .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 @@ -203,9 +191,7 @@ IL_000c: ret } - .method public hidebysig virtual final - instance int32 CompareTo(object obj, - class [runtime]System.Collections.IComparer comp) cil managed + .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 ) @@ -353,9 +339,7 @@ IL_000b: ret } - .method public hidebysig instance bool - Equals(class assembly/R obj, - class [runtime]System.Collections.IEqualityComparer comp) cil managed + .method public hidebysig instance bool Equals(class assembly/R obj, class [runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) @@ -403,9 +387,7 @@ IL_0036: ret } - .method public hidebysig virtual final - instance bool Equals(object obj, - class [runtime]System.Collections.IEqualityComparer comp) cil managed + .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 ) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.OptimizeOn.il.net472.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.OptimizeOn.il.net472.bsl new file mode 100644 index 00000000000..4f3b183612d --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.OptimizeOn.il.net472.bsl @@ -0,0 +1,582 @@ + + + + + +.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 +} +.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) + 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/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.1 + IL_0036: ldarg.0 + IL_0037: ldfld int32 assembly/R::y@ + IL_003c: stloc.2 + IL_003d: ldarg.1 + IL_003e: ldfld int32 assembly/R::y@ + 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/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, + int32 V_1, + int32 V_2, + int32 V_3) + IL_0000: ldarg.1 + IL_0001: unbox.any assembly/R + IL_0006: stloc.0 + IL_0007: ldarg.0 + IL_0008: brfalse.s IL_0050 + + IL_000a: ldarg.1 + IL_000b: unbox.any assembly/R + IL_0010: brfalse.s IL_004e + + IL_0012: ldarg.0 + IL_0013: ldfld int32 assembly/R::x@ + IL_0018: stloc.2 + IL_0019: ldloc.0 + IL_001a: ldfld int32 assembly/R::x@ + 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/R::y@ + IL_003c: stloc.2 + IL_003d: ldloc.0 + IL_003e: ldfld int32 assembly/R::y@ + 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/R + 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/R::y@ + 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/R::x@ + 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/R::GetHashCode(class [runtime]System.Collections.IEqualityComparer) + IL_000b: ret + } + + .method public hidebysig instance bool Equals(class assembly/R 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: 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, class [runtime]System.Collections.IEqualityComparer 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) + IL_0000: ldarg.1 + IL_0001: isinst assembly/R + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: brfalse.s IL_0013 + + IL_000a: ldarg.0 + IL_000b: ldloc.0 + IL_000c: ldarg.2 + IL_000d: callvirt instance bool assembly/R::Equals(class assembly/R, + class [runtime]System.Collections.IEqualityComparer) + IL_0012: ret + + IL_0013: ldc.i4.0 + IL_0014: 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 serializable 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__ + .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 +{ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .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 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 + } + + .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 ) + .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 ) + .get instance class [runtime]System.Type System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::get_Type() + } +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.OptimizeOn.il.netcore.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.OptimizeOn.il.netcore.bsl new file mode 100644 index 00000000000..2187485370e --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction17.fs.OptimizeOn.il.netcore.bsl @@ -0,0 +1,492 @@ + + + + + +.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 +} +.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) + 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/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.1 + IL_0036: ldarg.0 + IL_0037: ldfld int32 assembly/R::y@ + IL_003c: stloc.2 + IL_003d: ldarg.1 + IL_003e: ldfld int32 assembly/R::y@ + 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/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, + int32 V_1, + int32 V_2, + int32 V_3) + IL_0000: ldarg.1 + IL_0001: unbox.any assembly/R + IL_0006: stloc.0 + IL_0007: ldarg.0 + IL_0008: brfalse.s IL_0050 + + IL_000a: ldarg.1 + IL_000b: unbox.any assembly/R + IL_0010: brfalse.s IL_004e + + IL_0012: ldarg.0 + IL_0013: ldfld int32 assembly/R::x@ + IL_0018: stloc.2 + IL_0019: ldloc.0 + IL_001a: ldfld int32 assembly/R::x@ + 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/R::y@ + IL_003c: stloc.2 + IL_003d: ldloc.0 + IL_003e: ldfld int32 assembly/R::y@ + 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/R + 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/R::y@ + 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/R::x@ + 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/R::GetHashCode(class [runtime]System.Collections.IEqualityComparer) + IL_000b: ret + } + + .method public hidebysig instance bool Equals(class assembly/R 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: 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, class [runtime]System.Collections.IEqualityComparer 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) + IL_0000: ldarg.1 + IL_0001: isinst assembly/R + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: brfalse.s IL_0013 + + IL_000a: ldarg.0 + IL_000b: ldloc.0 + IL_000c: ldarg.2 + IL_000d: callvirt instance bool assembly/R::Equals(class assembly/R, + class [runtime]System.Collections.IEqualityComparer) + IL_0012: ret + + IL_0013: ldc.i4.0 + IL_0014: 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/TestFunction18.fs.il.netcore.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction18.fs.il.netcore.bsl index 5ae41fb6039..9905ef38bb1 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction18.fs.il.netcore.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction18.fs.il.netcore.bsl @@ -17,16 +17,6 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 -} -.mresource public FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - } .module assembly.exe diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction19.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction19.fs.OptimizeOff.il.bsl similarity index 100% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction19.fs.il.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction19.fs.OptimizeOff.il.bsl diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction19.fs.OptimizeOn.il.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction19.fs.OptimizeOn.il.debug.bsl new file mode 100644 index 00000000000..e8747679fec --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction19.fs.OptimizeOn.il.debug.bsl @@ -0,0 +1,211 @@ + + + + + +.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 +} +.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 nested public C + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) + .field assembly int32 y + .field assembly int32 x + .method public specialname rtspecialname instance void .ctor(int32 x, int32 y) cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: callvirt instance void [runtime]System.Object::.ctor() + IL_0006: ldarg.0 + IL_0007: pop + IL_0008: ldarg.0 + IL_0009: ldarg.1 + IL_000a: stfld int32 assembly/C::x + IL_000f: ldarg.0 + IL_0010: ldarg.2 + IL_0011: stfld int32 assembly/C::y + IL_0016: ret + } + + .method public hidebysig specialname instance int32 get_X() cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 assembly/C::x + IL_0006: ret + } + + .method public hidebysig specialname instance int32 get_Y() cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 assembly/C::y + IL_0006: ret + } + + .property instance int32 X() + { + .get instance int32 assembly/C::get_X() + } + .property instance int32 Y() + { + .get instance int32 assembly/C::get_Y() + } + } + + .class auto ansi serializable sealed nested assembly beforefieldinit 'assembly@11-1' + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 + { + .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 clo2 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 clo2) 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 assembly/'assembly@11-1'::clo2 + IL_000d: ret + } + + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Core.Unit Invoke(class assembly/C arg20) cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 assembly/'assembly@11-1'::clo2 + IL_0006: ldarg.1 + IL_0007: tail. + IL_0009: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_000e: ret + } + + } + + .class auto ansi serializable sealed nested assembly beforefieldinit assembly@11 + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> + { + .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> clo1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> clo1) 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly@11::clo1 + IL_000d: ret + } + + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 Invoke(class assembly/C arg10) cil managed + { + + .maxstack 6 + .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 V_0) + IL_0000: ldarg.0 + IL_0001: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly@11::clo1 + IL_0006: ldarg.1 + IL_0007: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>::Invoke(!0) + IL_000c: stloc.0 + IL_000d: ldloc.0 + IL_000e: newobj instance void assembly/'assembly@11-1'::.ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) + IL_0013: ret + } + + } + + .method public static void assembly(int32 inp) cil managed + { + + .maxstack 5 + .locals init (class assembly/C V_0, + class assembly/C V_1, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> V_2) + IL_0000: ldarg.0 + IL_0001: ldarg.0 + IL_0002: newobj instance void assembly/C::.ctor(int32, + int32) + IL_0007: stloc.0 + IL_0008: ldarg.0 + IL_0009: ldarg.0 + IL_000a: newobj instance void assembly/C::.ctor(int32, + int32) + IL_000f: stloc.1 + IL_0010: ldstr "c1 = %A, c2 = %A" + IL_0015: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [runtime]System.Tuple`2>::.ctor(string) + IL_001a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine>>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_001f: stloc.2 + IL_0020: ldloc.2 + IL_0021: newobj instance void assembly/assembly@11::.ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) + IL_0026: ldloc.0 + IL_0027: ldloc.1 + IL_0028: call !!0 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::InvokeFast(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, + !0, + !1) + IL_002d: pop + IL_002e: 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/TestFunction19.fs.OptimizeOn.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction19.fs.OptimizeOn.il.release.bsl new file mode 100644 index 00000000000..7d58e14e9df --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction19.fs.OptimizeOn.il.release.bsl @@ -0,0 +1,221 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly extern netstandard +{ + .publickeytoken = (CC 7B 13 FF CD 2D DD 51 ) + .ver 2:1:0:0 +} +.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 +} +.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 nested public C + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) + .field assembly int32 y + .field assembly int32 x + .method public specialname rtspecialname instance void .ctor(int32 x, int32 y) cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: callvirt instance void [runtime]System.Object::.ctor() + IL_0006: ldarg.0 + IL_0007: pop + IL_0008: ldarg.0 + IL_0009: ldarg.1 + IL_000a: stfld int32 assembly/C::x + IL_000f: ldarg.0 + IL_0010: ldarg.2 + IL_0011: stfld int32 assembly/C::y + IL_0016: ret + } + + .method public hidebysig specialname instance int32 get_X() cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 assembly/C::x + IL_0006: ret + } + + .method public hidebysig specialname instance int32 get_Y() cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 assembly/C::y + IL_0006: ret + } + + .property instance int32 X() + { + .get instance int32 assembly/C::get_X() + } + .property instance int32 Y() + { + .get instance int32 assembly/C::get_Y() + } + } + + .class auto ansi serializable sealed nested assembly beforefieldinit 'assembly@11-1' + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 + { + .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 clo2 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 clo2) 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 assembly/'assembly@11-1'::clo2 + IL_000d: ret + } + + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Core.Unit Invoke(class assembly/C arg20) cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 assembly/'assembly@11-1'::clo2 + IL_0006: ldarg.1 + IL_0007: tail. + IL_0009: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_000e: ret + } + + } + + .class auto ansi serializable sealed nested assembly beforefieldinit assembly@11 + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> + { + .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> clo1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> clo1) 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly@11::clo1 + IL_000d: ret + } + + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 Invoke(class assembly/C arg10) cil managed + { + + .maxstack 6 + .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 V_0) + IL_0000: ldarg.0 + IL_0001: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly@11::clo1 + IL_0006: ldarg.1 + IL_0007: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>::Invoke(!0) + IL_000c: stloc.0 + IL_000d: ldloc.0 + IL_000e: newobj instance void assembly/'assembly@11-1'::.ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) + IL_0013: ret + } + + } + + .method public static void assembly(int32 inp) cil managed + { + + .maxstack 5 + .locals init (class assembly/C V_0, + class assembly/C V_1, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> V_2, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit> V_3) + IL_0000: ldarg.0 + IL_0001: ldarg.0 + IL_0002: newobj instance void assembly/C::.ctor(int32, + int32) + IL_0007: stloc.0 + IL_0008: ldarg.0 + IL_0009: ldarg.0 + IL_000a: newobj instance void assembly/C::.ctor(int32, + int32) + IL_000f: stloc.1 + IL_0010: ldstr "c1 = %A, c2 = %A" + IL_0015: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [runtime]System.Tuple`2>::.ctor(string) + IL_001a: stloc.3 + IL_001b: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() + IL_0020: ldloc.3 + IL_0021: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter>>(class [runtime]System.IO.TextWriter, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0026: stloc.2 + IL_0027: ldloc.2 + IL_0028: newobj instance void assembly/assembly@11::.ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) + IL_002d: ldloc.0 + IL_002e: ldloc.1 + IL_002f: call !!0 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::InvokeFast(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, + !0, + !1) + IL_0034: pop + IL_0035: 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/TestFunction20.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction20.fs.OptimizeOff.il.bsl similarity index 97% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction20.fs.il.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction20.fs.OptimizeOff.il.bsl index f926ac566bb..3450ee5d002 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction20.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction20.fs.OptimizeOff.il.bsl @@ -1,256 +1,256 @@ - - - - - -.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 FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.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 nested public D - extends [runtime]System.Object - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) - .field assembly int32 y - .field assembly int32 x - .method public specialname rtspecialname - instance void .ctor(int32 x, - int32 y) cil managed - { - - .maxstack 4 - .locals init (int32 V_0, - int32 V_1) - IL_0000: ldarg.0 - IL_0001: callvirt instance void [runtime]System.Object::.ctor() - IL_0006: ldarg.0 - IL_0007: pop - IL_0008: ldarg.0 - IL_0009: ldarg.1 - IL_000a: stfld int32 assembly/D::x - IL_000f: ldarg.0 - IL_0010: ldarg.2 - IL_0011: stfld int32 assembly/D::y - IL_0016: ldarg.0 - IL_0017: ldfld int32 assembly/D::x - IL_001c: ldarg.0 - IL_001d: ldfld int32 assembly/D::y - IL_0022: add - IL_0023: stloc.0 - IL_0024: ldarg.0 - IL_0025: ldloc.0 - IL_0026: callvirt instance int32 assembly/D::f(int32) - IL_002b: ldloc.0 - IL_002c: add - IL_002d: stloc.1 - IL_002e: ret - } - - .method public hidebysig specialname - instance int32 get_X() cil managed - { - - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: ldfld int32 assembly/D::x - IL_0006: ret - } - - .method public hidebysig specialname - instance int32 get_Y() cil managed - { - - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: ldfld int32 assembly/D::y - IL_0006: ret - } - - .method assembly hidebysig instance int32 - f(int32 a) cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: ldfld int32 assembly/D::x - IL_0006: ldarg.1 - IL_0007: add - IL_0008: ret - } - - .property instance int32 X() - { - .get instance int32 assembly/D::get_X() - } - .property instance int32 Y() - { - .get instance int32 assembly/D::get_Y() - } - } - - .class auto ansi serializable sealed nested assembly beforefieldinit 'assembly@14-1' - extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 - { - .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 clo2 - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 clo2) 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::.ctor() - IL_0006: ldarg.0 - IL_0007: ldarg.1 - IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 assembly/'assembly@14-1'::clo2 - IL_000d: ret - } - - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Core.Unit - Invoke(class assembly/D arg20) cil managed - { - - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 assembly/'assembly@14-1'::clo2 - IL_0006: ldarg.1 - IL_0007: tail. - IL_0009: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) - IL_000e: ret - } - - } - - .class auto ansi serializable sealed nested assembly beforefieldinit assembly@14 - extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> - { - .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> clo1 - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> clo1) 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>::.ctor() - IL_0006: ldarg.0 - IL_0007: ldarg.1 - IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly@14::clo1 - IL_000d: ret - } - - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 - Invoke(class assembly/D arg10) cil managed - { - - .maxstack 6 - .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 V_0) - IL_0000: ldarg.0 - IL_0001: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly@14::clo1 - IL_0006: ldarg.1 - IL_0007: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>::Invoke(!0) - IL_000c: stloc.0 - IL_000d: ldloc.0 - IL_000e: newobj instance void assembly/'assembly@14-1'::.ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) - IL_0013: ret - } - - } - - .method public static void assembly(int32 inp) cil managed - { - - .maxstack 5 - .locals init (class assembly/D V_0, - class assembly/D V_1, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> V_2) - IL_0000: ldarg.0 - IL_0001: ldarg.0 - IL_0002: newobj instance void assembly/D::.ctor(int32, - int32) - IL_0007: stloc.0 - IL_0008: ldarg.0 - IL_0009: ldarg.0 - IL_000a: newobj instance void assembly/D::.ctor(int32, - int32) - IL_000f: stloc.1 - IL_0010: ldstr "d1 = %A, d2 = %A" - IL_0015: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [runtime]System.Tuple`2>::.ctor(string) - IL_001a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine>>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) - IL_001f: stloc.2 - IL_0020: ldloc.2 - IL_0021: newobj instance void assembly/assembly@14::.ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) - IL_0026: ldloc.0 - IL_0027: ldloc.1 - IL_0028: call !!0 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::InvokeFast(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, - !0, - !1) - IL_002d: pop - IL_002e: 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 FSharpSignatureCompressedData.assembly +{ + + +} +.mresource public FSharpOptimizationCompressedData.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 nested public D + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) + .field assembly int32 y + .field assembly int32 x + .method public specialname rtspecialname + instance void .ctor(int32 x, + int32 y) cil managed + { + + .maxstack 4 + .locals init (int32 V_0, + int32 V_1) + IL_0000: ldarg.0 + IL_0001: callvirt instance void [runtime]System.Object::.ctor() + IL_0006: ldarg.0 + IL_0007: pop + IL_0008: ldarg.0 + IL_0009: ldarg.1 + IL_000a: stfld int32 assembly/D::x + IL_000f: ldarg.0 + IL_0010: ldarg.2 + IL_0011: stfld int32 assembly/D::y + IL_0016: ldarg.0 + IL_0017: ldfld int32 assembly/D::x + IL_001c: ldarg.0 + IL_001d: ldfld int32 assembly/D::y + IL_0022: add + IL_0023: stloc.0 + IL_0024: ldarg.0 + IL_0025: ldloc.0 + IL_0026: callvirt instance int32 assembly/D::f(int32) + IL_002b: ldloc.0 + IL_002c: add + IL_002d: stloc.1 + IL_002e: ret + } + + .method public hidebysig specialname + instance int32 get_X() cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 assembly/D::x + IL_0006: ret + } + + .method public hidebysig specialname + instance int32 get_Y() cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 assembly/D::y + IL_0006: ret + } + + .method assembly hidebysig instance int32 + f(int32 a) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 assembly/D::x + IL_0006: ldarg.1 + IL_0007: add + IL_0008: ret + } + + .property instance int32 X() + { + .get instance int32 assembly/D::get_X() + } + .property instance int32 Y() + { + .get instance int32 assembly/D::get_Y() + } + } + + .class auto ansi serializable sealed nested assembly beforefieldinit 'assembly@14-1' + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 + { + .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 clo2 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) + .method assembly specialname rtspecialname + instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 clo2) 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 assembly/'assembly@14-1'::clo2 + IL_000d: ret + } + + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Core.Unit + Invoke(class assembly/D arg20) cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 assembly/'assembly@14-1'::clo2 + IL_0006: ldarg.1 + IL_0007: tail. + IL_0009: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_000e: ret + } + + } + + .class auto ansi serializable sealed nested assembly beforefieldinit assembly@14 + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> + { + .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> clo1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) + .method assembly specialname rtspecialname + instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> clo1) 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly@14::clo1 + IL_000d: ret + } + + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 + Invoke(class assembly/D arg10) cil managed + { + + .maxstack 6 + .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 V_0) + IL_0000: ldarg.0 + IL_0001: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly@14::clo1 + IL_0006: ldarg.1 + IL_0007: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>::Invoke(!0) + IL_000c: stloc.0 + IL_000d: ldloc.0 + IL_000e: newobj instance void assembly/'assembly@14-1'::.ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) + IL_0013: ret + } + + } + + .method public static void assembly(int32 inp) cil managed + { + + .maxstack 5 + .locals init (class assembly/D V_0, + class assembly/D V_1, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> V_2) + IL_0000: ldarg.0 + IL_0001: ldarg.0 + IL_0002: newobj instance void assembly/D::.ctor(int32, + int32) + IL_0007: stloc.0 + IL_0008: ldarg.0 + IL_0009: ldarg.0 + IL_000a: newobj instance void assembly/D::.ctor(int32, + int32) + IL_000f: stloc.1 + IL_0010: ldstr "d1 = %A, d2 = %A" + IL_0015: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [runtime]System.Tuple`2>::.ctor(string) + IL_001a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine>>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_001f: stloc.2 + IL_0020: ldloc.2 + IL_0021: newobj instance void assembly/assembly@14::.ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) + IL_0026: ldloc.0 + IL_0027: ldloc.1 + IL_0028: call !!0 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::InvokeFast(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, + !0, + !1) + IL_002d: pop + IL_002e: 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/TestFunction20.fs.OptimizeOn.il.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction20.fs.OptimizeOn.il.debug.bsl new file mode 100644 index 00000000000..8561b29ba42 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction20.fs.OptimizeOn.il.debug.bsl @@ -0,0 +1,237 @@ + + + + + +.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 +} +.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 nested public D + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) + .field assembly int32 y + .field assembly int32 x + .method public specialname rtspecialname instance void .ctor(int32 x, int32 y) cil managed + { + + .maxstack 4 + .locals init (int32 V_0, + int32 V_1) + IL_0000: ldarg.0 + IL_0001: callvirt instance void [runtime]System.Object::.ctor() + IL_0006: ldarg.0 + IL_0007: pop + IL_0008: ldarg.0 + IL_0009: ldarg.1 + IL_000a: stfld int32 assembly/D::x + IL_000f: ldarg.0 + IL_0010: ldarg.2 + IL_0011: stfld int32 assembly/D::y + IL_0016: ldarg.0 + IL_0017: ldfld int32 assembly/D::x + IL_001c: ldarg.0 + IL_001d: ldfld int32 assembly/D::y + IL_0022: add + IL_0023: stloc.0 + IL_0024: ldarg.0 + IL_0025: ldloc.0 + IL_0026: callvirt instance int32 assembly/D::f(int32) + IL_002b: ldloc.0 + IL_002c: add + IL_002d: stloc.1 + IL_002e: ret + } + + .method public hidebysig specialname instance int32 get_X() cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 assembly/D::x + IL_0006: ret + } + + .method public hidebysig specialname instance int32 get_Y() cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 assembly/D::y + IL_0006: ret + } + + .method assembly hidebysig instance int32 f(int32 a) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 assembly/D::x + IL_0006: ldarg.1 + IL_0007: add + IL_0008: ret + } + + .property instance int32 X() + { + .get instance int32 assembly/D::get_X() + } + .property instance int32 Y() + { + .get instance int32 assembly/D::get_Y() + } + } + + .class auto ansi serializable sealed nested assembly beforefieldinit 'assembly@14-1' + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 + { + .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 clo2 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 clo2) 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 assembly/'assembly@14-1'::clo2 + IL_000d: ret + } + + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Core.Unit Invoke(class assembly/D arg20) cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 assembly/'assembly@14-1'::clo2 + IL_0006: ldarg.1 + IL_0007: tail. + IL_0009: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_000e: ret + } + + } + + .class auto ansi serializable sealed nested assembly beforefieldinit assembly@14 + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> + { + .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> clo1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> clo1) 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly@14::clo1 + IL_000d: ret + } + + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 Invoke(class assembly/D arg10) cil managed + { + + .maxstack 6 + .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 V_0) + IL_0000: ldarg.0 + IL_0001: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly@14::clo1 + IL_0006: ldarg.1 + IL_0007: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>::Invoke(!0) + IL_000c: stloc.0 + IL_000d: ldloc.0 + IL_000e: newobj instance void assembly/'assembly@14-1'::.ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) + IL_0013: ret + } + + } + + .method public static void assembly(int32 inp) cil managed + { + + .maxstack 5 + .locals init (class assembly/D V_0, + class assembly/D V_1, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> V_2) + IL_0000: ldarg.0 + IL_0001: ldarg.0 + IL_0002: newobj instance void assembly/D::.ctor(int32, + int32) + IL_0007: stloc.0 + IL_0008: ldarg.0 + IL_0009: ldarg.0 + IL_000a: newobj instance void assembly/D::.ctor(int32, + int32) + IL_000f: stloc.1 + IL_0010: ldstr "d1 = %A, d2 = %A" + IL_0015: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [runtime]System.Tuple`2>::.ctor(string) + IL_001a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine>>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_001f: stloc.2 + IL_0020: ldloc.2 + IL_0021: newobj instance void assembly/assembly@14::.ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) + IL_0026: ldloc.0 + IL_0027: ldloc.1 + IL_0028: call !!0 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::InvokeFast(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, + !0, + !1) + IL_002d: pop + IL_002e: 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/TestFunction20.fs.OptimizeOn.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction20.fs.OptimizeOn.il.release.bsl new file mode 100644 index 00000000000..fd47d9be0a3 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction20.fs.OptimizeOn.il.release.bsl @@ -0,0 +1,247 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly extern netstandard +{ + .publickeytoken = (CC 7B 13 FF CD 2D DD 51 ) + .ver 2:1:0:0 +} +.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 +} +.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 nested public D + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) + .field assembly int32 y + .field assembly int32 x + .method public specialname rtspecialname instance void .ctor(int32 x, int32 y) cil managed + { + + .maxstack 4 + .locals init (int32 V_0, + int32 V_1) + IL_0000: ldarg.0 + IL_0001: callvirt instance void [runtime]System.Object::.ctor() + IL_0006: ldarg.0 + IL_0007: pop + IL_0008: ldarg.0 + IL_0009: ldarg.1 + IL_000a: stfld int32 assembly/D::x + IL_000f: ldarg.0 + IL_0010: ldarg.2 + IL_0011: stfld int32 assembly/D::y + IL_0016: ldarg.0 + IL_0017: ldfld int32 assembly/D::x + IL_001c: ldarg.0 + IL_001d: ldfld int32 assembly/D::y + IL_0022: add + IL_0023: stloc.0 + IL_0024: ldarg.0 + IL_0025: ldloc.0 + IL_0026: callvirt instance int32 assembly/D::f(int32) + IL_002b: ldloc.0 + IL_002c: add + IL_002d: stloc.1 + IL_002e: ret + } + + .method public hidebysig specialname instance int32 get_X() cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 assembly/D::x + IL_0006: ret + } + + .method public hidebysig specialname instance int32 get_Y() cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 assembly/D::y + IL_0006: ret + } + + .method assembly hidebysig instance int32 f(int32 a) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 assembly/D::x + IL_0006: ldarg.1 + IL_0007: add + IL_0008: ret + } + + .property instance int32 X() + { + .get instance int32 assembly/D::get_X() + } + .property instance int32 Y() + { + .get instance int32 assembly/D::get_Y() + } + } + + .class auto ansi serializable sealed nested assembly beforefieldinit 'assembly@14-1' + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 + { + .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 clo2 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 clo2) 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 assembly/'assembly@14-1'::clo2 + IL_000d: ret + } + + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Core.Unit Invoke(class assembly/D arg20) cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 assembly/'assembly@14-1'::clo2 + IL_0006: ldarg.1 + IL_0007: tail. + IL_0009: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_000e: ret + } + + } + + .class auto ansi serializable sealed nested assembly beforefieldinit assembly@14 + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> + { + .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> clo1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> clo1) 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly@14::clo1 + IL_000d: ret + } + + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 Invoke(class assembly/D arg10) cil managed + { + + .maxstack 6 + .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 V_0) + IL_0000: ldarg.0 + IL_0001: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly@14::clo1 + IL_0006: ldarg.1 + IL_0007: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>::Invoke(!0) + IL_000c: stloc.0 + IL_000d: ldloc.0 + IL_000e: newobj instance void assembly/'assembly@14-1'::.ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) + IL_0013: ret + } + + } + + .method public static void assembly(int32 inp) cil managed + { + + .maxstack 5 + .locals init (class assembly/D V_0, + class assembly/D V_1, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> V_2, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit> V_3) + IL_0000: ldarg.0 + IL_0001: ldarg.0 + IL_0002: newobj instance void assembly/D::.ctor(int32, + int32) + IL_0007: stloc.0 + IL_0008: ldarg.0 + IL_0009: ldarg.0 + IL_000a: newobj instance void assembly/D::.ctor(int32, + int32) + IL_000f: stloc.1 + IL_0010: ldstr "d1 = %A, d2 = %A" + IL_0015: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [runtime]System.Tuple`2>::.ctor(string) + IL_001a: stloc.3 + IL_001b: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() + IL_0020: ldloc.3 + IL_0021: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter>>(class [runtime]System.IO.TextWriter, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0026: stloc.2 + IL_0027: ldloc.2 + IL_0028: newobj instance void assembly/assembly@14::.ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) + IL_002d: ldloc.0 + IL_002e: ldloc.1 + IL_002f: call !!0 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::InvokeFast(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, + !0, + !1) + IL_0034: pop + IL_0035: 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/TestFunction21.fs.il.net472.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction21.fs.OptimizeOff.il.net472.debug.bsl similarity index 100% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction21.fs.il.net472.debug.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction21.fs.OptimizeOff.il.net472.debug.bsl diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction21.fs.il.net472.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction21.fs.OptimizeOff.il.net472.release.bsl similarity index 100% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction21.fs.il.net472.release.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction21.fs.OptimizeOff.il.net472.release.bsl diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction21.fs.il.netcore.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction21.fs.OptimizeOff.il.netcore.debug.bsl similarity index 100% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction21.fs.il.netcore.debug.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction21.fs.OptimizeOff.il.netcore.debug.bsl diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction21.fs.il.netcore.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction21.fs.OptimizeOff.il.netcore.release.bsl similarity index 100% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction21.fs.il.netcore.release.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction21.fs.OptimizeOff.il.netcore.release.bsl diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction21.fs.OptimizeOn.il.net472.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction21.fs.OptimizeOn.il.net472.debug.bsl new file mode 100644 index 00000000000..64d7879c1b7 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction21.fs.OptimizeOn.il.net472.debug.bsl @@ -0,0 +1,765 @@ + + + + + +.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 +} +.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 autochar serializable sealed nested public beforefieldinit U + 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 [runtime]System.Diagnostics.DebuggerDisplayAttribute::.ctor(string) = ( 01 00 15 7B 5F 5F 44 65 62 75 67 44 69 73 70 6C + 61 79 28 29 2C 6E 71 7D 00 00 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 01 00 00 00 00 00 ) + .field assembly initonly int32 item1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 assembly initonly int32 item2 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) + .method public static class assembly/U NewU(int32 item1, int32 item2) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32) = ( 01 00 08 00 00 00 00 00 00 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: ldarg.0 + IL_0001: ldarg.1 + IL_0002: newobj instance void assembly/U::.ctor(int32, + int32) + IL_0007: ret + } + + .method assembly specialname rtspecialname instance void .ctor(int32 item1, int32 item2) 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 32 31 2B 55 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: ldarg.0 + IL_0001: call instance void [runtime]System.Object::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld int32 assembly/U::item1 + IL_000d: ldarg.0 + IL_000e: ldarg.2 + IL_000f: stfld int32 assembly/U::item2 + IL_0014: ret + } + + .method public hidebysig instance int32 get_Item1() 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/U::item1 + IL_0006: ret + } + + .method public hidebysig instance int32 get_Item2() 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/U::item2 + IL_0006: ret + } + + .method public hidebysig instance int32 get_Tag() 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: pop + IL_0002: ldc.i4.0 + IL_0003: ret + } + + .method assembly hidebysig specialname instance object __DebugDisplay() 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: ldstr "%+0.8A" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,string>::.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 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/U>::.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/U obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 5 + .locals init (class assembly/U V_0, + class assembly/U V_1, + int32 V_2, + class [runtime]System.Collections.IComparer V_3, + int32 V_4, + int32 V_5) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0062 + + IL_0003: ldarg.1 + IL_0004: brfalse.s IL_0060 + + IL_0006: ldarg.0 + IL_0007: pop + IL_0008: ldarg.0 + IL_0009: stloc.0 + IL_000a: ldarg.1 + IL_000b: stloc.1 + IL_000c: call class [runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() + IL_0011: stloc.3 + IL_0012: ldloc.0 + IL_0013: ldfld int32 assembly/U::item1 + IL_0018: stloc.s V_4 + IL_001a: ldloc.1 + IL_001b: ldfld int32 assembly/U::item1 + IL_0020: stloc.s V_5 + IL_0022: ldloc.s V_4 + IL_0024: ldloc.s V_5 + IL_0026: cgt + IL_0028: ldloc.s V_4 + IL_002a: ldloc.s V_5 + IL_002c: clt + IL_002e: sub + IL_002f: stloc.2 + IL_0030: ldloc.2 + IL_0031: ldc.i4.0 + IL_0032: bge.s IL_0036 + + IL_0034: ldloc.2 + IL_0035: ret + + IL_0036: ldloc.2 + IL_0037: ldc.i4.0 + IL_0038: ble.s IL_003c + + IL_003a: ldloc.2 + IL_003b: ret + + IL_003c: call class [runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() + IL_0041: stloc.3 + IL_0042: ldloc.0 + IL_0043: ldfld int32 assembly/U::item2 + IL_0048: stloc.s V_4 + IL_004a: ldloc.1 + IL_004b: ldfld int32 assembly/U::item2 + IL_0050: stloc.s V_5 + IL_0052: ldloc.s V_4 + IL_0054: ldloc.s V_5 + IL_0056: cgt + IL_0058: ldloc.s V_4 + IL_005a: ldloc.s V_5 + IL_005c: clt + IL_005e: sub + IL_005f: ret + + IL_0060: ldc.i4.1 + IL_0061: ret + + IL_0062: ldarg.1 + IL_0063: brfalse.s IL_0067 + + IL_0065: ldc.i4.m1 + IL_0066: ret + + IL_0067: ldc.i4.0 + IL_0068: 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/U + IL_0007: callvirt instance int32 assembly/U::CompareTo(class assembly/U) + 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/U V_0, + class assembly/U V_1, + class assembly/U V_2, + int32 V_3, + int32 V_4, + int32 V_5) + IL_0000: ldarg.1 + IL_0001: unbox.any assembly/U + IL_0006: stloc.0 + IL_0007: ldarg.0 + IL_0008: brfalse.s IL_0062 + + IL_000a: ldarg.1 + IL_000b: unbox.any assembly/U + IL_0010: brfalse.s IL_0060 + + IL_0012: ldarg.0 + IL_0013: pop + IL_0014: ldarg.0 + IL_0015: stloc.1 + IL_0016: ldloc.0 + IL_0017: stloc.2 + IL_0018: ldloc.1 + IL_0019: ldfld int32 assembly/U::item1 + IL_001e: stloc.s V_4 + IL_0020: ldloc.2 + IL_0021: ldfld int32 assembly/U::item1 + IL_0026: stloc.s V_5 + IL_0028: ldloc.s V_4 + IL_002a: ldloc.s V_5 + IL_002c: cgt + IL_002e: ldloc.s V_4 + IL_0030: ldloc.s V_5 + IL_0032: clt + IL_0034: sub + IL_0035: stloc.3 + IL_0036: ldloc.3 + IL_0037: ldc.i4.0 + IL_0038: bge.s IL_003c + + IL_003a: ldloc.3 + IL_003b: ret + + IL_003c: ldloc.3 + IL_003d: ldc.i4.0 + IL_003e: ble.s IL_0042 + + IL_0040: ldloc.3 + IL_0041: ret + + IL_0042: ldloc.1 + IL_0043: ldfld int32 assembly/U::item2 + IL_0048: stloc.s V_4 + IL_004a: ldloc.2 + IL_004b: ldfld int32 assembly/U::item2 + IL_0050: stloc.s V_5 + IL_0052: ldloc.s V_4 + IL_0054: ldloc.s V_5 + IL_0056: cgt + IL_0058: ldloc.s V_4 + IL_005a: ldloc.s V_5 + IL_005c: clt + IL_005e: sub + IL_005f: ret + + IL_0060: ldc.i4.1 + IL_0061: ret + + IL_0062: ldarg.1 + IL_0063: unbox.any assembly/U + IL_0068: brfalse.s IL_006c + + IL_006a: ldc.i4.m1 + IL_006b: ret + + IL_006c: ldc.i4.0 + IL_006d: 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 assembly/U V_1) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0037 + + IL_0003: ldc.i4.0 + IL_0004: stloc.0 + IL_0005: ldarg.0 + IL_0006: pop + IL_0007: ldarg.0 + IL_0008: stloc.1 + IL_0009: ldc.i4.0 + IL_000a: stloc.0 + IL_000b: ldc.i4 0x9e3779b9 + IL_0010: ldloc.1 + IL_0011: ldfld int32 assembly/U::item2 + 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: ldloc.1 + IL_0026: ldfld int32 assembly/U::item1 + IL_002b: ldloc.0 + IL_002c: ldc.i4.6 + IL_002d: shl + IL_002e: ldloc.0 + IL_002f: ldc.i4.2 + IL_0030: shr + IL_0031: add + IL_0032: add + IL_0033: add + IL_0034: stloc.0 + IL_0035: ldloc.0 + IL_0036: ret + + IL_0037: ldc.i4.0 + IL_0038: 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/U::GetHashCode(class [runtime]System.Collections.IEqualityComparer) + IL_000b: ret + } + + .method public hidebysig instance bool Equals(class assembly/U 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/U V_0, + class assembly/U V_1) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_002d + + IL_0003: ldarg.1 + IL_0004: brfalse.s IL_002b + + IL_0006: ldarg.0 + IL_0007: pop + IL_0008: ldarg.0 + IL_0009: stloc.0 + IL_000a: ldarg.1 + IL_000b: stloc.1 + IL_000c: ldloc.0 + IL_000d: ldfld int32 assembly/U::item1 + IL_0012: ldloc.1 + IL_0013: ldfld int32 assembly/U::item1 + IL_0018: bne.un.s IL_0029 + + IL_001a: ldloc.0 + IL_001b: ldfld int32 assembly/U::item2 + IL_0020: ldloc.1 + IL_0021: ldfld int32 assembly/U::item2 + IL_0026: ceq + IL_0028: ret + + IL_0029: ldc.i4.0 + IL_002a: ret + + IL_002b: ldc.i4.0 + IL_002c: ret + + IL_002d: ldarg.1 + IL_002e: ldnull + IL_002f: cgt.un + IL_0031: ldc.i4.0 + IL_0032: ceq + IL_0034: 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 5 + .locals init (class assembly/U V_0) + IL_0000: ldarg.1 + IL_0001: isinst assembly/U + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: brfalse.s IL_0013 + + IL_000a: ldarg.0 + IL_000b: ldloc.0 + IL_000c: ldarg.2 + IL_000d: callvirt instance bool assembly/U::Equals(class assembly/U, + class [runtime]System.Collections.IEqualityComparer) + IL_0012: ret + + IL_0013: ldc.i4.0 + IL_0014: ret + } + + .method public hidebysig virtual final instance bool Equals(class assembly/U obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 4 + .locals init (class assembly/U V_0, + class assembly/U V_1) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_002d + + IL_0003: ldarg.1 + IL_0004: brfalse.s IL_002b + + IL_0006: ldarg.0 + IL_0007: pop + IL_0008: ldarg.0 + IL_0009: stloc.0 + IL_000a: ldarg.1 + IL_000b: stloc.1 + IL_000c: ldloc.0 + IL_000d: ldfld int32 assembly/U::item1 + IL_0012: ldloc.1 + IL_0013: ldfld int32 assembly/U::item1 + IL_0018: bne.un.s IL_0029 + + IL_001a: ldloc.0 + IL_001b: ldfld int32 assembly/U::item2 + IL_0020: ldloc.1 + IL_0021: ldfld int32 assembly/U::item2 + IL_0026: ceq + IL_0028: ret + + IL_0029: ldc.i4.0 + IL_002a: ret + + IL_002b: ldc.i4.0 + IL_002c: ret + + IL_002d: ldarg.1 + IL_002e: ldnull + IL_002f: cgt.un + IL_0031: ldc.i4.0 + IL_0032: ceq + IL_0034: 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/U V_0) + IL_0000: ldarg.1 + IL_0001: isinst assembly/U + 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/U::Equals(class assembly/U) + IL_0011: ret + + IL_0012: ldc.i4.0 + IL_0013: ret + } + + .property instance int32 Tag() + { + .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.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .get instance int32 assembly/U::get_Tag() + } + .property instance int32 Item1() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32, + int32) = ( 01 00 04 00 00 00 00 00 00 00 00 00 00 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 ) + .get instance int32 assembly/U::get_Item1() + } + .property instance int32 Item2() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32, + int32) = ( 01 00 04 00 00 00 00 00 00 00 01 00 00 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 ) + .get instance int32 assembly/U::get_Item2() + } + } + + .class auto ansi serializable sealed nested assembly beforefieldinit 'assembly@7-1' + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 + { + .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 clo2 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 clo2) 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 assembly/'assembly@7-1'::clo2 + IL_000d: ret + } + + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Core.Unit Invoke(int32 arg20) cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 assembly/'assembly@7-1'::clo2 + IL_0006: ldarg.1 + IL_0007: tail. + IL_0009: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_000e: ret + } + + } + + .class auto ansi serializable sealed nested assembly beforefieldinit assembly@7 + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> + { + .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> clo1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> clo1) 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly@7::clo1 + IL_000d: ret + } + + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 Invoke(int32 arg10) cil managed + { + + .maxstack 6 + .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 V_0) + IL_0000: ldarg.0 + IL_0001: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly@7::clo1 + IL_0006: ldarg.1 + IL_0007: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>::Invoke(!0) + IL_000c: stloc.0 + IL_000d: ldloc.0 + IL_000e: newobj instance void assembly/'assembly@7-1'::.ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) + IL_0013: ret + } + + } + + .method public static void assembly(class assembly/U _arg1) cil managed + { + + .maxstack 5 + .locals init (int32 V_0, + int32 V_1, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> V_2) + IL_0000: ldarg.0 + IL_0001: ldfld int32 assembly/U::item2 + IL_0006: stloc.0 + IL_0007: ldarg.0 + IL_0008: ldfld int32 assembly/U::item1 + IL_000d: stloc.1 + IL_000e: ldstr "a = %A, a = %A" + IL_0013: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [runtime]System.Tuple`2>::.ctor(string) + IL_0018: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine>>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_001d: stloc.2 + IL_001e: ldloc.2 + IL_001f: newobj instance void assembly/assembly@7::.ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) + IL_0024: ldloc.1 + IL_0025: ldloc.0 + IL_0026: call !!0 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::InvokeFast(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, + !0, + !1) + IL_002b: pop + IL_002c: 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 serializable 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__ + .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 +{ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .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 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 + } + + .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 ) + .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 ) + .get instance class [runtime]System.Type System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::get_Type() + } +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction21.fs.OptimizeOn.il.net472.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction21.fs.OptimizeOn.il.net472.release.bsl new file mode 100644 index 00000000000..bc06902d8e3 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction21.fs.OptimizeOn.il.net472.release.bsl @@ -0,0 +1,775 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly extern netstandard +{ + .publickeytoken = (CC 7B 13 FF CD 2D DD 51 ) + .ver 2:1:0:0 +} +.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 +} +.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 autochar serializable sealed nested public beforefieldinit U + 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 [runtime]System.Diagnostics.DebuggerDisplayAttribute::.ctor(string) = ( 01 00 15 7B 5F 5F 44 65 62 75 67 44 69 73 70 6C + 61 79 28 29 2C 6E 71 7D 00 00 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 01 00 00 00 00 00 ) + .field assembly initonly int32 item1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 assembly initonly int32 item2 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) + .method public static class assembly/U NewU(int32 item1, int32 item2) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32) = ( 01 00 08 00 00 00 00 00 00 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: ldarg.0 + IL_0001: ldarg.1 + IL_0002: newobj instance void assembly/U::.ctor(int32, + int32) + IL_0007: ret + } + + .method assembly specialname rtspecialname instance void .ctor(int32 item1, int32 item2) 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 32 31 2B 55 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: ldarg.0 + IL_0001: call instance void [runtime]System.Object::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld int32 assembly/U::item1 + IL_000d: ldarg.0 + IL_000e: ldarg.2 + IL_000f: stfld int32 assembly/U::item2 + IL_0014: ret + } + + .method public hidebysig instance int32 get_Item1() 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/U::item1 + IL_0006: ret + } + + .method public hidebysig instance int32 get_Item2() 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/U::item2 + IL_0006: ret + } + + .method public hidebysig instance int32 get_Tag() 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: pop + IL_0002: ldc.i4.0 + IL_0003: ret + } + + .method assembly hidebysig specialname instance object __DebugDisplay() 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: ldstr "%+0.8A" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,string>::.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 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/U>::.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/U obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 5 + .locals init (class assembly/U V_0, + class assembly/U V_1, + int32 V_2, + class [runtime]System.Collections.IComparer V_3, + int32 V_4, + int32 V_5) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0062 + + IL_0003: ldarg.1 + IL_0004: brfalse.s IL_0060 + + IL_0006: ldarg.0 + IL_0007: pop + IL_0008: ldarg.0 + IL_0009: stloc.0 + IL_000a: ldarg.1 + IL_000b: stloc.1 + IL_000c: call class [runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() + IL_0011: stloc.3 + IL_0012: ldloc.0 + IL_0013: ldfld int32 assembly/U::item1 + IL_0018: stloc.s V_4 + IL_001a: ldloc.1 + IL_001b: ldfld int32 assembly/U::item1 + IL_0020: stloc.s V_5 + IL_0022: ldloc.s V_4 + IL_0024: ldloc.s V_5 + IL_0026: cgt + IL_0028: ldloc.s V_4 + IL_002a: ldloc.s V_5 + IL_002c: clt + IL_002e: sub + IL_002f: stloc.2 + IL_0030: ldloc.2 + IL_0031: ldc.i4.0 + IL_0032: bge.s IL_0036 + + IL_0034: ldloc.2 + IL_0035: ret + + IL_0036: ldloc.2 + IL_0037: ldc.i4.0 + IL_0038: ble.s IL_003c + + IL_003a: ldloc.2 + IL_003b: ret + + IL_003c: call class [runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() + IL_0041: stloc.3 + IL_0042: ldloc.0 + IL_0043: ldfld int32 assembly/U::item2 + IL_0048: stloc.s V_4 + IL_004a: ldloc.1 + IL_004b: ldfld int32 assembly/U::item2 + IL_0050: stloc.s V_5 + IL_0052: ldloc.s V_4 + IL_0054: ldloc.s V_5 + IL_0056: cgt + IL_0058: ldloc.s V_4 + IL_005a: ldloc.s V_5 + IL_005c: clt + IL_005e: sub + IL_005f: ret + + IL_0060: ldc.i4.1 + IL_0061: ret + + IL_0062: ldarg.1 + IL_0063: brfalse.s IL_0067 + + IL_0065: ldc.i4.m1 + IL_0066: ret + + IL_0067: ldc.i4.0 + IL_0068: 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/U + IL_0007: callvirt instance int32 assembly/U::CompareTo(class assembly/U) + 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/U V_0, + class assembly/U V_1, + class assembly/U V_2, + int32 V_3, + int32 V_4, + int32 V_5) + IL_0000: ldarg.1 + IL_0001: unbox.any assembly/U + IL_0006: stloc.0 + IL_0007: ldarg.0 + IL_0008: brfalse.s IL_0062 + + IL_000a: ldarg.1 + IL_000b: unbox.any assembly/U + IL_0010: brfalse.s IL_0060 + + IL_0012: ldarg.0 + IL_0013: pop + IL_0014: ldarg.0 + IL_0015: stloc.1 + IL_0016: ldloc.0 + IL_0017: stloc.2 + IL_0018: ldloc.1 + IL_0019: ldfld int32 assembly/U::item1 + IL_001e: stloc.s V_4 + IL_0020: ldloc.2 + IL_0021: ldfld int32 assembly/U::item1 + IL_0026: stloc.s V_5 + IL_0028: ldloc.s V_4 + IL_002a: ldloc.s V_5 + IL_002c: cgt + IL_002e: ldloc.s V_4 + IL_0030: ldloc.s V_5 + IL_0032: clt + IL_0034: sub + IL_0035: stloc.3 + IL_0036: ldloc.3 + IL_0037: ldc.i4.0 + IL_0038: bge.s IL_003c + + IL_003a: ldloc.3 + IL_003b: ret + + IL_003c: ldloc.3 + IL_003d: ldc.i4.0 + IL_003e: ble.s IL_0042 + + IL_0040: ldloc.3 + IL_0041: ret + + IL_0042: ldloc.1 + IL_0043: ldfld int32 assembly/U::item2 + IL_0048: stloc.s V_4 + IL_004a: ldloc.2 + IL_004b: ldfld int32 assembly/U::item2 + IL_0050: stloc.s V_5 + IL_0052: ldloc.s V_4 + IL_0054: ldloc.s V_5 + IL_0056: cgt + IL_0058: ldloc.s V_4 + IL_005a: ldloc.s V_5 + IL_005c: clt + IL_005e: sub + IL_005f: ret + + IL_0060: ldc.i4.1 + IL_0061: ret + + IL_0062: ldarg.1 + IL_0063: unbox.any assembly/U + IL_0068: brfalse.s IL_006c + + IL_006a: ldc.i4.m1 + IL_006b: ret + + IL_006c: ldc.i4.0 + IL_006d: 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 assembly/U V_1) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0037 + + IL_0003: ldc.i4.0 + IL_0004: stloc.0 + IL_0005: ldarg.0 + IL_0006: pop + IL_0007: ldarg.0 + IL_0008: stloc.1 + IL_0009: ldc.i4.0 + IL_000a: stloc.0 + IL_000b: ldc.i4 0x9e3779b9 + IL_0010: ldloc.1 + IL_0011: ldfld int32 assembly/U::item2 + 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: ldloc.1 + IL_0026: ldfld int32 assembly/U::item1 + IL_002b: ldloc.0 + IL_002c: ldc.i4.6 + IL_002d: shl + IL_002e: ldloc.0 + IL_002f: ldc.i4.2 + IL_0030: shr + IL_0031: add + IL_0032: add + IL_0033: add + IL_0034: stloc.0 + IL_0035: ldloc.0 + IL_0036: ret + + IL_0037: ldc.i4.0 + IL_0038: 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/U::GetHashCode(class [runtime]System.Collections.IEqualityComparer) + IL_000b: ret + } + + .method public hidebysig instance bool Equals(class assembly/U 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/U V_0, + class assembly/U V_1) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_002d + + IL_0003: ldarg.1 + IL_0004: brfalse.s IL_002b + + IL_0006: ldarg.0 + IL_0007: pop + IL_0008: ldarg.0 + IL_0009: stloc.0 + IL_000a: ldarg.1 + IL_000b: stloc.1 + IL_000c: ldloc.0 + IL_000d: ldfld int32 assembly/U::item1 + IL_0012: ldloc.1 + IL_0013: ldfld int32 assembly/U::item1 + IL_0018: bne.un.s IL_0029 + + IL_001a: ldloc.0 + IL_001b: ldfld int32 assembly/U::item2 + IL_0020: ldloc.1 + IL_0021: ldfld int32 assembly/U::item2 + IL_0026: ceq + IL_0028: ret + + IL_0029: ldc.i4.0 + IL_002a: ret + + IL_002b: ldc.i4.0 + IL_002c: ret + + IL_002d: ldarg.1 + IL_002e: ldnull + IL_002f: cgt.un + IL_0031: ldc.i4.0 + IL_0032: ceq + IL_0034: 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 5 + .locals init (class assembly/U V_0) + IL_0000: ldarg.1 + IL_0001: isinst assembly/U + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: brfalse.s IL_0013 + + IL_000a: ldarg.0 + IL_000b: ldloc.0 + IL_000c: ldarg.2 + IL_000d: callvirt instance bool assembly/U::Equals(class assembly/U, + class [runtime]System.Collections.IEqualityComparer) + IL_0012: ret + + IL_0013: ldc.i4.0 + IL_0014: ret + } + + .method public hidebysig virtual final instance bool Equals(class assembly/U obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 4 + .locals init (class assembly/U V_0, + class assembly/U V_1) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_002d + + IL_0003: ldarg.1 + IL_0004: brfalse.s IL_002b + + IL_0006: ldarg.0 + IL_0007: pop + IL_0008: ldarg.0 + IL_0009: stloc.0 + IL_000a: ldarg.1 + IL_000b: stloc.1 + IL_000c: ldloc.0 + IL_000d: ldfld int32 assembly/U::item1 + IL_0012: ldloc.1 + IL_0013: ldfld int32 assembly/U::item1 + IL_0018: bne.un.s IL_0029 + + IL_001a: ldloc.0 + IL_001b: ldfld int32 assembly/U::item2 + IL_0020: ldloc.1 + IL_0021: ldfld int32 assembly/U::item2 + IL_0026: ceq + IL_0028: ret + + IL_0029: ldc.i4.0 + IL_002a: ret + + IL_002b: ldc.i4.0 + IL_002c: ret + + IL_002d: ldarg.1 + IL_002e: ldnull + IL_002f: cgt.un + IL_0031: ldc.i4.0 + IL_0032: ceq + IL_0034: 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/U V_0) + IL_0000: ldarg.1 + IL_0001: isinst assembly/U + 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/U::Equals(class assembly/U) + IL_0011: ret + + IL_0012: ldc.i4.0 + IL_0013: ret + } + + .property instance int32 Tag() + { + .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.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .get instance int32 assembly/U::get_Tag() + } + .property instance int32 Item1() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32, + int32) = ( 01 00 04 00 00 00 00 00 00 00 00 00 00 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 ) + .get instance int32 assembly/U::get_Item1() + } + .property instance int32 Item2() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32, + int32) = ( 01 00 04 00 00 00 00 00 00 00 01 00 00 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 ) + .get instance int32 assembly/U::get_Item2() + } + } + + .class auto ansi serializable sealed nested assembly beforefieldinit 'assembly@7-1' + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 + { + .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 clo2 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 clo2) 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 assembly/'assembly@7-1'::clo2 + IL_000d: ret + } + + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Core.Unit Invoke(int32 arg20) cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 assembly/'assembly@7-1'::clo2 + IL_0006: ldarg.1 + IL_0007: tail. + IL_0009: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_000e: ret + } + + } + + .class auto ansi serializable sealed nested assembly beforefieldinit assembly@7 + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> + { + .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> clo1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> clo1) 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly@7::clo1 + IL_000d: ret + } + + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 Invoke(int32 arg10) cil managed + { + + .maxstack 6 + .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 V_0) + IL_0000: ldarg.0 + IL_0001: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly@7::clo1 + IL_0006: ldarg.1 + IL_0007: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>::Invoke(!0) + IL_000c: stloc.0 + IL_000d: ldloc.0 + IL_000e: newobj instance void assembly/'assembly@7-1'::.ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) + IL_0013: ret + } + + } + + .method public static void assembly(class assembly/U _arg1) cil managed + { + + .maxstack 5 + .locals init (int32 V_0, + int32 V_1, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> V_2, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit> V_3) + IL_0000: ldarg.0 + IL_0001: ldfld int32 assembly/U::item2 + IL_0006: stloc.0 + IL_0007: ldarg.0 + IL_0008: ldfld int32 assembly/U::item1 + IL_000d: stloc.1 + IL_000e: ldstr "a = %A, a = %A" + IL_0013: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [runtime]System.Tuple`2>::.ctor(string) + IL_0018: stloc.3 + IL_0019: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() + IL_001e: ldloc.3 + IL_001f: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter>>(class [runtime]System.IO.TextWriter, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0024: stloc.2 + IL_0025: ldloc.2 + IL_0026: newobj instance void assembly/assembly@7::.ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) + IL_002b: ldloc.1 + IL_002c: ldloc.0 + IL_002d: call !!0 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::InvokeFast(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, + !0, + !1) + IL_0032: pop + IL_0033: 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 serializable 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__ + .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 +{ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .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 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 + } + + .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 ) + .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 ) + .get instance class [runtime]System.Type System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::get_Type() + } +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction21.fs.OptimizeOn.il.netcore.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction21.fs.OptimizeOn.il.netcore.debug.bsl new file mode 100644 index 00000000000..bf1d7ea6bf5 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction21.fs.OptimizeOn.il.netcore.debug.bsl @@ -0,0 +1,675 @@ + + + + + +.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 +} +.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 autochar serializable sealed nested public beforefieldinit U + 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 [runtime]System.Diagnostics.DebuggerDisplayAttribute::.ctor(string) = ( 01 00 15 7B 5F 5F 44 65 62 75 67 44 69 73 70 6C + 61 79 28 29 2C 6E 71 7D 00 00 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 01 00 00 00 00 00 ) + .field assembly initonly int32 item1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 assembly initonly int32 item2 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) + .method public static class assembly/U NewU(int32 item1, int32 item2) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32) = ( 01 00 08 00 00 00 00 00 00 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: ldarg.0 + IL_0001: ldarg.1 + IL_0002: newobj instance void assembly/U::.ctor(int32, + int32) + IL_0007: ret + } + + .method assembly specialname rtspecialname instance void .ctor(int32 item1, int32 item2) 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 32 31 2B 55 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: ldarg.0 + IL_0001: call instance void [runtime]System.Object::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld int32 assembly/U::item1 + IL_000d: ldarg.0 + IL_000e: ldarg.2 + IL_000f: stfld int32 assembly/U::item2 + IL_0014: ret + } + + .method public hidebysig instance int32 get_Item1() 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/U::item1 + IL_0006: ret + } + + .method public hidebysig instance int32 get_Item2() 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/U::item2 + IL_0006: ret + } + + .method public hidebysig instance int32 get_Tag() 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: pop + IL_0002: ldc.i4.0 + IL_0003: ret + } + + .method assembly hidebysig specialname instance object __DebugDisplay() 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: ldstr "%+0.8A" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,string>::.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 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/U>::.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/U obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 5 + .locals init (class assembly/U V_0, + class assembly/U V_1, + int32 V_2, + class [runtime]System.Collections.IComparer V_3, + int32 V_4, + int32 V_5) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0062 + + IL_0003: ldarg.1 + IL_0004: brfalse.s IL_0060 + + IL_0006: ldarg.0 + IL_0007: pop + IL_0008: ldarg.0 + IL_0009: stloc.0 + IL_000a: ldarg.1 + IL_000b: stloc.1 + IL_000c: call class [runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() + IL_0011: stloc.3 + IL_0012: ldloc.0 + IL_0013: ldfld int32 assembly/U::item1 + IL_0018: stloc.s V_4 + IL_001a: ldloc.1 + IL_001b: ldfld int32 assembly/U::item1 + IL_0020: stloc.s V_5 + IL_0022: ldloc.s V_4 + IL_0024: ldloc.s V_5 + IL_0026: cgt + IL_0028: ldloc.s V_4 + IL_002a: ldloc.s V_5 + IL_002c: clt + IL_002e: sub + IL_002f: stloc.2 + IL_0030: ldloc.2 + IL_0031: ldc.i4.0 + IL_0032: bge.s IL_0036 + + IL_0034: ldloc.2 + IL_0035: ret + + IL_0036: ldloc.2 + IL_0037: ldc.i4.0 + IL_0038: ble.s IL_003c + + IL_003a: ldloc.2 + IL_003b: ret + + IL_003c: call class [runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() + IL_0041: stloc.3 + IL_0042: ldloc.0 + IL_0043: ldfld int32 assembly/U::item2 + IL_0048: stloc.s V_4 + IL_004a: ldloc.1 + IL_004b: ldfld int32 assembly/U::item2 + IL_0050: stloc.s V_5 + IL_0052: ldloc.s V_4 + IL_0054: ldloc.s V_5 + IL_0056: cgt + IL_0058: ldloc.s V_4 + IL_005a: ldloc.s V_5 + IL_005c: clt + IL_005e: sub + IL_005f: ret + + IL_0060: ldc.i4.1 + IL_0061: ret + + IL_0062: ldarg.1 + IL_0063: brfalse.s IL_0067 + + IL_0065: ldc.i4.m1 + IL_0066: ret + + IL_0067: ldc.i4.0 + IL_0068: 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/U + IL_0007: callvirt instance int32 assembly/U::CompareTo(class assembly/U) + 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/U V_0, + class assembly/U V_1, + class assembly/U V_2, + int32 V_3, + int32 V_4, + int32 V_5) + IL_0000: ldarg.1 + IL_0001: unbox.any assembly/U + IL_0006: stloc.0 + IL_0007: ldarg.0 + IL_0008: brfalse.s IL_0062 + + IL_000a: ldarg.1 + IL_000b: unbox.any assembly/U + IL_0010: brfalse.s IL_0060 + + IL_0012: ldarg.0 + IL_0013: pop + IL_0014: ldarg.0 + IL_0015: stloc.1 + IL_0016: ldloc.0 + IL_0017: stloc.2 + IL_0018: ldloc.1 + IL_0019: ldfld int32 assembly/U::item1 + IL_001e: stloc.s V_4 + IL_0020: ldloc.2 + IL_0021: ldfld int32 assembly/U::item1 + IL_0026: stloc.s V_5 + IL_0028: ldloc.s V_4 + IL_002a: ldloc.s V_5 + IL_002c: cgt + IL_002e: ldloc.s V_4 + IL_0030: ldloc.s V_5 + IL_0032: clt + IL_0034: sub + IL_0035: stloc.3 + IL_0036: ldloc.3 + IL_0037: ldc.i4.0 + IL_0038: bge.s IL_003c + + IL_003a: ldloc.3 + IL_003b: ret + + IL_003c: ldloc.3 + IL_003d: ldc.i4.0 + IL_003e: ble.s IL_0042 + + IL_0040: ldloc.3 + IL_0041: ret + + IL_0042: ldloc.1 + IL_0043: ldfld int32 assembly/U::item2 + IL_0048: stloc.s V_4 + IL_004a: ldloc.2 + IL_004b: ldfld int32 assembly/U::item2 + IL_0050: stloc.s V_5 + IL_0052: ldloc.s V_4 + IL_0054: ldloc.s V_5 + IL_0056: cgt + IL_0058: ldloc.s V_4 + IL_005a: ldloc.s V_5 + IL_005c: clt + IL_005e: sub + IL_005f: ret + + IL_0060: ldc.i4.1 + IL_0061: ret + + IL_0062: ldarg.1 + IL_0063: unbox.any assembly/U + IL_0068: brfalse.s IL_006c + + IL_006a: ldc.i4.m1 + IL_006b: ret + + IL_006c: ldc.i4.0 + IL_006d: 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 assembly/U V_1) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0037 + + IL_0003: ldc.i4.0 + IL_0004: stloc.0 + IL_0005: ldarg.0 + IL_0006: pop + IL_0007: ldarg.0 + IL_0008: stloc.1 + IL_0009: ldc.i4.0 + IL_000a: stloc.0 + IL_000b: ldc.i4 0x9e3779b9 + IL_0010: ldloc.1 + IL_0011: ldfld int32 assembly/U::item2 + 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: ldloc.1 + IL_0026: ldfld int32 assembly/U::item1 + IL_002b: ldloc.0 + IL_002c: ldc.i4.6 + IL_002d: shl + IL_002e: ldloc.0 + IL_002f: ldc.i4.2 + IL_0030: shr + IL_0031: add + IL_0032: add + IL_0033: add + IL_0034: stloc.0 + IL_0035: ldloc.0 + IL_0036: ret + + IL_0037: ldc.i4.0 + IL_0038: 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/U::GetHashCode(class [runtime]System.Collections.IEqualityComparer) + IL_000b: ret + } + + .method public hidebysig instance bool Equals(class assembly/U 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/U V_0, + class assembly/U V_1) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_002d + + IL_0003: ldarg.1 + IL_0004: brfalse.s IL_002b + + IL_0006: ldarg.0 + IL_0007: pop + IL_0008: ldarg.0 + IL_0009: stloc.0 + IL_000a: ldarg.1 + IL_000b: stloc.1 + IL_000c: ldloc.0 + IL_000d: ldfld int32 assembly/U::item1 + IL_0012: ldloc.1 + IL_0013: ldfld int32 assembly/U::item1 + IL_0018: bne.un.s IL_0029 + + IL_001a: ldloc.0 + IL_001b: ldfld int32 assembly/U::item2 + IL_0020: ldloc.1 + IL_0021: ldfld int32 assembly/U::item2 + IL_0026: ceq + IL_0028: ret + + IL_0029: ldc.i4.0 + IL_002a: ret + + IL_002b: ldc.i4.0 + IL_002c: ret + + IL_002d: ldarg.1 + IL_002e: ldnull + IL_002f: cgt.un + IL_0031: ldc.i4.0 + IL_0032: ceq + IL_0034: 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 5 + .locals init (class assembly/U V_0) + IL_0000: ldarg.1 + IL_0001: isinst assembly/U + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: brfalse.s IL_0013 + + IL_000a: ldarg.0 + IL_000b: ldloc.0 + IL_000c: ldarg.2 + IL_000d: callvirt instance bool assembly/U::Equals(class assembly/U, + class [runtime]System.Collections.IEqualityComparer) + IL_0012: ret + + IL_0013: ldc.i4.0 + IL_0014: ret + } + + .method public hidebysig virtual final instance bool Equals(class assembly/U obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 4 + .locals init (class assembly/U V_0, + class assembly/U V_1) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_002d + + IL_0003: ldarg.1 + IL_0004: brfalse.s IL_002b + + IL_0006: ldarg.0 + IL_0007: pop + IL_0008: ldarg.0 + IL_0009: stloc.0 + IL_000a: ldarg.1 + IL_000b: stloc.1 + IL_000c: ldloc.0 + IL_000d: ldfld int32 assembly/U::item1 + IL_0012: ldloc.1 + IL_0013: ldfld int32 assembly/U::item1 + IL_0018: bne.un.s IL_0029 + + IL_001a: ldloc.0 + IL_001b: ldfld int32 assembly/U::item2 + IL_0020: ldloc.1 + IL_0021: ldfld int32 assembly/U::item2 + IL_0026: ceq + IL_0028: ret + + IL_0029: ldc.i4.0 + IL_002a: ret + + IL_002b: ldc.i4.0 + IL_002c: ret + + IL_002d: ldarg.1 + IL_002e: ldnull + IL_002f: cgt.un + IL_0031: ldc.i4.0 + IL_0032: ceq + IL_0034: 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/U V_0) + IL_0000: ldarg.1 + IL_0001: isinst assembly/U + 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/U::Equals(class assembly/U) + IL_0011: ret + + IL_0012: ldc.i4.0 + IL_0013: ret + } + + .property instance int32 Tag() + { + .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.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .get instance int32 assembly/U::get_Tag() + } + .property instance int32 Item1() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32, + int32) = ( 01 00 04 00 00 00 00 00 00 00 00 00 00 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 ) + .get instance int32 assembly/U::get_Item1() + } + .property instance int32 Item2() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32, + int32) = ( 01 00 04 00 00 00 00 00 00 00 01 00 00 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 ) + .get instance int32 assembly/U::get_Item2() + } + } + + .class auto ansi serializable sealed nested assembly beforefieldinit 'assembly@7-1' + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 + { + .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 clo2 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 clo2) 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 assembly/'assembly@7-1'::clo2 + IL_000d: ret + } + + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Core.Unit Invoke(int32 arg20) cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 assembly/'assembly@7-1'::clo2 + IL_0006: ldarg.1 + IL_0007: tail. + IL_0009: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_000e: ret + } + + } + + .class auto ansi serializable sealed nested assembly beforefieldinit assembly@7 + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> + { + .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> clo1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> clo1) 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly@7::clo1 + IL_000d: ret + } + + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 Invoke(int32 arg10) cil managed + { + + .maxstack 6 + .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 V_0) + IL_0000: ldarg.0 + IL_0001: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly@7::clo1 + IL_0006: ldarg.1 + IL_0007: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>::Invoke(!0) + IL_000c: stloc.0 + IL_000d: ldloc.0 + IL_000e: newobj instance void assembly/'assembly@7-1'::.ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) + IL_0013: ret + } + + } + + .method public static void assembly(class assembly/U _arg1) cil managed + { + + .maxstack 5 + .locals init (int32 V_0, + int32 V_1, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> V_2) + IL_0000: ldarg.0 + IL_0001: ldfld int32 assembly/U::item2 + IL_0006: stloc.0 + IL_0007: ldarg.0 + IL_0008: ldfld int32 assembly/U::item1 + IL_000d: stloc.1 + IL_000e: ldstr "a = %A, a = %A" + IL_0013: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [runtime]System.Tuple`2>::.ctor(string) + IL_0018: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine>>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_001d: stloc.2 + IL_001e: ldloc.2 + IL_001f: newobj instance void assembly/assembly@7::.ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) + IL_0024: ldloc.1 + IL_0025: ldloc.0 + IL_0026: call !!0 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::InvokeFast(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, + !0, + !1) + IL_002b: pop + IL_002c: 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/TestFunction21.fs.OptimizeOn.il.netcore.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction21.fs.OptimizeOn.il.netcore.release.bsl new file mode 100644 index 00000000000..3a3fec8a284 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction21.fs.OptimizeOn.il.netcore.release.bsl @@ -0,0 +1,685 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly extern netstandard +{ + .publickeytoken = (CC 7B 13 FF CD 2D DD 51 ) + .ver 2:1:0:0 +} +.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 +} +.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 autochar serializable sealed nested public beforefieldinit U + 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 [runtime]System.Diagnostics.DebuggerDisplayAttribute::.ctor(string) = ( 01 00 15 7B 5F 5F 44 65 62 75 67 44 69 73 70 6C + 61 79 28 29 2C 6E 71 7D 00 00 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 01 00 00 00 00 00 ) + .field assembly initonly int32 item1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 assembly initonly int32 item2 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) + .method public static class assembly/U NewU(int32 item1, int32 item2) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32) = ( 01 00 08 00 00 00 00 00 00 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: ldarg.0 + IL_0001: ldarg.1 + IL_0002: newobj instance void assembly/U::.ctor(int32, + int32) + IL_0007: ret + } + + .method assembly specialname rtspecialname instance void .ctor(int32 item1, int32 item2) 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 32 31 2B 55 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: ldarg.0 + IL_0001: call instance void [runtime]System.Object::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld int32 assembly/U::item1 + IL_000d: ldarg.0 + IL_000e: ldarg.2 + IL_000f: stfld int32 assembly/U::item2 + IL_0014: ret + } + + .method public hidebysig instance int32 get_Item1() 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/U::item1 + IL_0006: ret + } + + .method public hidebysig instance int32 get_Item2() 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/U::item2 + IL_0006: ret + } + + .method public hidebysig instance int32 get_Tag() 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: pop + IL_0002: ldc.i4.0 + IL_0003: ret + } + + .method assembly hidebysig specialname instance object __DebugDisplay() 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: ldstr "%+0.8A" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,string>::.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 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/U>::.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/U obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 5 + .locals init (class assembly/U V_0, + class assembly/U V_1, + int32 V_2, + class [runtime]System.Collections.IComparer V_3, + int32 V_4, + int32 V_5) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0062 + + IL_0003: ldarg.1 + IL_0004: brfalse.s IL_0060 + + IL_0006: ldarg.0 + IL_0007: pop + IL_0008: ldarg.0 + IL_0009: stloc.0 + IL_000a: ldarg.1 + IL_000b: stloc.1 + IL_000c: call class [runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() + IL_0011: stloc.3 + IL_0012: ldloc.0 + IL_0013: ldfld int32 assembly/U::item1 + IL_0018: stloc.s V_4 + IL_001a: ldloc.1 + IL_001b: ldfld int32 assembly/U::item1 + IL_0020: stloc.s V_5 + IL_0022: ldloc.s V_4 + IL_0024: ldloc.s V_5 + IL_0026: cgt + IL_0028: ldloc.s V_4 + IL_002a: ldloc.s V_5 + IL_002c: clt + IL_002e: sub + IL_002f: stloc.2 + IL_0030: ldloc.2 + IL_0031: ldc.i4.0 + IL_0032: bge.s IL_0036 + + IL_0034: ldloc.2 + IL_0035: ret + + IL_0036: ldloc.2 + IL_0037: ldc.i4.0 + IL_0038: ble.s IL_003c + + IL_003a: ldloc.2 + IL_003b: ret + + IL_003c: call class [runtime]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer() + IL_0041: stloc.3 + IL_0042: ldloc.0 + IL_0043: ldfld int32 assembly/U::item2 + IL_0048: stloc.s V_4 + IL_004a: ldloc.1 + IL_004b: ldfld int32 assembly/U::item2 + IL_0050: stloc.s V_5 + IL_0052: ldloc.s V_4 + IL_0054: ldloc.s V_5 + IL_0056: cgt + IL_0058: ldloc.s V_4 + IL_005a: ldloc.s V_5 + IL_005c: clt + IL_005e: sub + IL_005f: ret + + IL_0060: ldc.i4.1 + IL_0061: ret + + IL_0062: ldarg.1 + IL_0063: brfalse.s IL_0067 + + IL_0065: ldc.i4.m1 + IL_0066: ret + + IL_0067: ldc.i4.0 + IL_0068: 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/U + IL_0007: callvirt instance int32 assembly/U::CompareTo(class assembly/U) + 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/U V_0, + class assembly/U V_1, + class assembly/U V_2, + int32 V_3, + int32 V_4, + int32 V_5) + IL_0000: ldarg.1 + IL_0001: unbox.any assembly/U + IL_0006: stloc.0 + IL_0007: ldarg.0 + IL_0008: brfalse.s IL_0062 + + IL_000a: ldarg.1 + IL_000b: unbox.any assembly/U + IL_0010: brfalse.s IL_0060 + + IL_0012: ldarg.0 + IL_0013: pop + IL_0014: ldarg.0 + IL_0015: stloc.1 + IL_0016: ldloc.0 + IL_0017: stloc.2 + IL_0018: ldloc.1 + IL_0019: ldfld int32 assembly/U::item1 + IL_001e: stloc.s V_4 + IL_0020: ldloc.2 + IL_0021: ldfld int32 assembly/U::item1 + IL_0026: stloc.s V_5 + IL_0028: ldloc.s V_4 + IL_002a: ldloc.s V_5 + IL_002c: cgt + IL_002e: ldloc.s V_4 + IL_0030: ldloc.s V_5 + IL_0032: clt + IL_0034: sub + IL_0035: stloc.3 + IL_0036: ldloc.3 + IL_0037: ldc.i4.0 + IL_0038: bge.s IL_003c + + IL_003a: ldloc.3 + IL_003b: ret + + IL_003c: ldloc.3 + IL_003d: ldc.i4.0 + IL_003e: ble.s IL_0042 + + IL_0040: ldloc.3 + IL_0041: ret + + IL_0042: ldloc.1 + IL_0043: ldfld int32 assembly/U::item2 + IL_0048: stloc.s V_4 + IL_004a: ldloc.2 + IL_004b: ldfld int32 assembly/U::item2 + IL_0050: stloc.s V_5 + IL_0052: ldloc.s V_4 + IL_0054: ldloc.s V_5 + IL_0056: cgt + IL_0058: ldloc.s V_4 + IL_005a: ldloc.s V_5 + IL_005c: clt + IL_005e: sub + IL_005f: ret + + IL_0060: ldc.i4.1 + IL_0061: ret + + IL_0062: ldarg.1 + IL_0063: unbox.any assembly/U + IL_0068: brfalse.s IL_006c + + IL_006a: ldc.i4.m1 + IL_006b: ret + + IL_006c: ldc.i4.0 + IL_006d: 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 assembly/U V_1) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0037 + + IL_0003: ldc.i4.0 + IL_0004: stloc.0 + IL_0005: ldarg.0 + IL_0006: pop + IL_0007: ldarg.0 + IL_0008: stloc.1 + IL_0009: ldc.i4.0 + IL_000a: stloc.0 + IL_000b: ldc.i4 0x9e3779b9 + IL_0010: ldloc.1 + IL_0011: ldfld int32 assembly/U::item2 + 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: ldloc.1 + IL_0026: ldfld int32 assembly/U::item1 + IL_002b: ldloc.0 + IL_002c: ldc.i4.6 + IL_002d: shl + IL_002e: ldloc.0 + IL_002f: ldc.i4.2 + IL_0030: shr + IL_0031: add + IL_0032: add + IL_0033: add + IL_0034: stloc.0 + IL_0035: ldloc.0 + IL_0036: ret + + IL_0037: ldc.i4.0 + IL_0038: 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/U::GetHashCode(class [runtime]System.Collections.IEqualityComparer) + IL_000b: ret + } + + .method public hidebysig instance bool Equals(class assembly/U 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/U V_0, + class assembly/U V_1) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_002d + + IL_0003: ldarg.1 + IL_0004: brfalse.s IL_002b + + IL_0006: ldarg.0 + IL_0007: pop + IL_0008: ldarg.0 + IL_0009: stloc.0 + IL_000a: ldarg.1 + IL_000b: stloc.1 + IL_000c: ldloc.0 + IL_000d: ldfld int32 assembly/U::item1 + IL_0012: ldloc.1 + IL_0013: ldfld int32 assembly/U::item1 + IL_0018: bne.un.s IL_0029 + + IL_001a: ldloc.0 + IL_001b: ldfld int32 assembly/U::item2 + IL_0020: ldloc.1 + IL_0021: ldfld int32 assembly/U::item2 + IL_0026: ceq + IL_0028: ret + + IL_0029: ldc.i4.0 + IL_002a: ret + + IL_002b: ldc.i4.0 + IL_002c: ret + + IL_002d: ldarg.1 + IL_002e: ldnull + IL_002f: cgt.un + IL_0031: ldc.i4.0 + IL_0032: ceq + IL_0034: 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 5 + .locals init (class assembly/U V_0) + IL_0000: ldarg.1 + IL_0001: isinst assembly/U + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: brfalse.s IL_0013 + + IL_000a: ldarg.0 + IL_000b: ldloc.0 + IL_000c: ldarg.2 + IL_000d: callvirt instance bool assembly/U::Equals(class assembly/U, + class [runtime]System.Collections.IEqualityComparer) + IL_0012: ret + + IL_0013: ldc.i4.0 + IL_0014: ret + } + + .method public hidebysig virtual final instance bool Equals(class assembly/U obj) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 4 + .locals init (class assembly/U V_0, + class assembly/U V_1) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_002d + + IL_0003: ldarg.1 + IL_0004: brfalse.s IL_002b + + IL_0006: ldarg.0 + IL_0007: pop + IL_0008: ldarg.0 + IL_0009: stloc.0 + IL_000a: ldarg.1 + IL_000b: stloc.1 + IL_000c: ldloc.0 + IL_000d: ldfld int32 assembly/U::item1 + IL_0012: ldloc.1 + IL_0013: ldfld int32 assembly/U::item1 + IL_0018: bne.un.s IL_0029 + + IL_001a: ldloc.0 + IL_001b: ldfld int32 assembly/U::item2 + IL_0020: ldloc.1 + IL_0021: ldfld int32 assembly/U::item2 + IL_0026: ceq + IL_0028: ret + + IL_0029: ldc.i4.0 + IL_002a: ret + + IL_002b: ldc.i4.0 + IL_002c: ret + + IL_002d: ldarg.1 + IL_002e: ldnull + IL_002f: cgt.un + IL_0031: ldc.i4.0 + IL_0032: ceq + IL_0034: 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/U V_0) + IL_0000: ldarg.1 + IL_0001: isinst assembly/U + 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/U::Equals(class assembly/U) + IL_0011: ret + + IL_0012: ldc.i4.0 + IL_0013: ret + } + + .property instance int32 Tag() + { + .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.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .get instance int32 assembly/U::get_Tag() + } + .property instance int32 Item1() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32, + int32) = ( 01 00 04 00 00 00 00 00 00 00 00 00 00 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 ) + .get instance int32 assembly/U::get_Item1() + } + .property instance int32 Item2() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32, + int32) = ( 01 00 04 00 00 00 00 00 00 00 01 00 00 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 ) + .get instance int32 assembly/U::get_Item2() + } + } + + .class auto ansi serializable sealed nested assembly beforefieldinit 'assembly@7-1' + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 + { + .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 clo2 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 clo2) 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 assembly/'assembly@7-1'::clo2 + IL_000d: ret + } + + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Core.Unit Invoke(int32 arg20) cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 assembly/'assembly@7-1'::clo2 + IL_0006: ldarg.1 + IL_0007: tail. + IL_0009: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_000e: ret + } + + } + + .class auto ansi serializable sealed nested assembly beforefieldinit assembly@7 + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> + { + .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> clo1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> clo1) 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly@7::clo1 + IL_000d: ret + } + + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 Invoke(int32 arg10) cil managed + { + + .maxstack 6 + .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 V_0) + IL_0000: ldarg.0 + IL_0001: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly@7::clo1 + IL_0006: ldarg.1 + IL_0007: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>::Invoke(!0) + IL_000c: stloc.0 + IL_000d: ldloc.0 + IL_000e: newobj instance void assembly/'assembly@7-1'::.ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) + IL_0013: ret + } + + } + + .method public static void assembly(class assembly/U _arg1) cil managed + { + + .maxstack 5 + .locals init (int32 V_0, + int32 V_1, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> V_2, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit> V_3) + IL_0000: ldarg.0 + IL_0001: ldfld int32 assembly/U::item2 + IL_0006: stloc.0 + IL_0007: ldarg.0 + IL_0008: ldfld int32 assembly/U::item1 + IL_000d: stloc.1 + IL_000e: ldstr "a = %A, a = %A" + IL_0013: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [runtime]System.Tuple`2>::.ctor(string) + IL_0018: stloc.3 + IL_0019: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() + IL_001e: ldloc.3 + IL_001f: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter>>(class [runtime]System.IO.TextWriter, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0024: stloc.2 + IL_0025: ldloc.2 + IL_0026: newobj instance void assembly/assembly@7::.ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) + IL_002b: ldloc.1 + IL_002c: ldloc.0 + IL_002d: call !!0 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::InvokeFast(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, + !0, + !1) + IL_0032: pop + IL_0033: 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/TestFunction22.fs.RealInternalSignatureOff.il.netcore.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22.fs.RealInternalSignatureOff.il.netcore.bsl index 4be84f3b9b0..a52189c9300 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22.fs.RealInternalSignatureOff.il.netcore.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22.fs.RealInternalSignatureOff.il.netcore.bsl @@ -17,16 +17,6 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 -} -.mresource public FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - } .module assembly.exe diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22.fs.RealInternalSignatureOn.il.netcore.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22.fs.RealInternalSignatureOn.il.netcore.bsl index df7927a467b..41b244c5a7a 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22.fs.RealInternalSignatureOn.il.netcore.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22.fs.RealInternalSignatureOn.il.netcore.bsl @@ -17,16 +17,6 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 -} -.mresource public FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - } .module assembly.exe diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22b.fs.RealInternalSignatureOff.il.netcore.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22b.fs.RealInternalSignatureOff.il.netcore.bsl index 4be84f3b9b0..a52189c9300 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22b.fs.RealInternalSignatureOff.il.netcore.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22b.fs.RealInternalSignatureOff.il.netcore.bsl @@ -17,16 +17,6 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 -} -.mresource public FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - } .module assembly.exe diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22b.fs.RealInternalSignatureOn.il.netcore.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22b.fs.RealInternalSignatureOn.il.netcore.bsl index df7927a467b..41b244c5a7a 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22b.fs.RealInternalSignatureOn.il.netcore.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22b.fs.RealInternalSignatureOn.il.netcore.bsl @@ -17,16 +17,6 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 -} -.mresource public FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - } .module assembly.exe diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22c.fs.RealInternalSignatureOff.il.netcore.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22c.fs.RealInternalSignatureOff.il.netcore.bsl index 4be84f3b9b0..a52189c9300 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22c.fs.RealInternalSignatureOff.il.netcore.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22c.fs.RealInternalSignatureOff.il.netcore.bsl @@ -17,16 +17,6 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 -} -.mresource public FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - } .module assembly.exe diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22c.fs.RealInternalSignatureOn.il.netcore.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22c.fs.RealInternalSignatureOn.il.netcore.bsl index df7927a467b..41b244c5a7a 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22c.fs.RealInternalSignatureOn.il.netcore.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22c.fs.RealInternalSignatureOn.il.netcore.bsl @@ -17,16 +17,6 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 -} -.mresource public FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - } .module assembly.exe diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22d.fs.RealInternalSignatureOff.il.netcore.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22d.fs.RealInternalSignatureOff.il.netcore.bsl index 4be84f3b9b0..a52189c9300 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22d.fs.RealInternalSignatureOff.il.netcore.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22d.fs.RealInternalSignatureOff.il.netcore.bsl @@ -17,16 +17,6 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 -} -.mresource public FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - } .module assembly.exe diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22d.fs.RealInternalSignatureOn.il.netcore.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22d.fs.RealInternalSignatureOn.il.netcore.bsl index df7927a467b..41b244c5a7a 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22d.fs.RealInternalSignatureOn.il.netcore.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22d.fs.RealInternalSignatureOn.il.netcore.bsl @@ -17,16 +17,6 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 -} -.mresource public FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - } .module assembly.exe diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22e.fs.RealInternalSignatureOff.il.netcore.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22e.fs.RealInternalSignatureOff.il.netcore.bsl index b3c737c5df4..85706bdfccd 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22e.fs.RealInternalSignatureOff.il.netcore.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22e.fs.RealInternalSignatureOff.il.netcore.bsl @@ -17,16 +17,6 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 -} -.mresource public FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - } .module assembly.exe diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22e.fs.RealInternalSignatureOn.il.netcore.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22e.fs.RealInternalSignatureOn.il.netcore.bsl index 965581a344c..6d9816702f2 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22e.fs.RealInternalSignatureOn.il.netcore.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22e.fs.RealInternalSignatureOn.il.netcore.bsl @@ -17,16 +17,6 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 -} -.mresource public FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - } .module assembly.exe diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22f.fs.RealInternalSignatureOff.il.net472.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22f.fs.RealInternalSignatureOff.OptimizeOff.il.net472.bsl similarity index 100% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22f.fs.RealInternalSignatureOff.il.net472.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22f.fs.RealInternalSignatureOff.OptimizeOff.il.net472.bsl diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22f.fs.RealInternalSignatureOff.il.netcore.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22f.fs.RealInternalSignatureOff.OptimizeOff.il.netcore.bsl similarity index 94% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22f.fs.RealInternalSignatureOff.il.netcore.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22f.fs.RealInternalSignatureOff.OptimizeOff.il.netcore.bsl index ef0c2030d4a..f9b2fa31440 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22f.fs.RealInternalSignatureOff.il.netcore.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22f.fs.RealInternalSignatureOff.OptimizeOff.il.netcore.bsl @@ -22,16 +22,6 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 -} -.mresource public FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - } .module assembly.exe diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22f.fs.RealInternalSignatureOff.OptimizeOn.il.net472.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22f.fs.RealInternalSignatureOff.OptimizeOn.il.net472.bsl new file mode 100644 index 00000000000..74cb3fb32ef --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22f.fs.RealInternalSignatureOff.OptimizeOn.il.net472.bsl @@ -0,0 +1,77 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly extern netstandard +{ + .publickeytoken = (CC 7B 13 FF CD 2D DD 51 ) + .ver 2:1:0:0 +} +.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 +} +.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 private abstract auto ansi sealed ''.$assembly + extends [runtime]System.Object +{ + .field static assembly int32 init@ + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: nop + IL_0001: ldstr "A" + IL_0006: ldstr "A" + IL_000b: call bool [netstandard]System.String::Equals(string, + string) + IL_0010: brfalse.s IL_001a + + IL_0012: call void [runtime]System.Console::WriteLine() + IL_0017: nop + IL_0018: br.s IL_0020 + + IL_001a: call void [runtime]System.Console::WriteLine() + IL_001f: nop + IL_0020: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22f.fs.RealInternalSignatureOn.il.netcore .bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22f.fs.RealInternalSignatureOff.OptimizeOn.il.netcore.bsl similarity index 75% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22f.fs.RealInternalSignatureOn.il.netcore .bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22f.fs.RealInternalSignatureOff.OptimizeOn.il.netcore.bsl index ef0c2030d4a..b78a9ea4355 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22f.fs.RealInternalSignatureOn.il.netcore .bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22f.fs.RealInternalSignatureOff.OptimizeOn.il.netcore.bsl @@ -22,16 +22,6 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 -} -.mresource public FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - } .module assembly.exe @@ -62,23 +52,21 @@ { .entrypoint - .maxstack 4 - .locals init (string V_0) - IL_0000: ldstr "A" - IL_0005: stloc.0 - IL_0006: ldloc.0 - IL_0007: ldstr "A" - IL_000c: call bool [netstandard]System.String::Equals(string, + .maxstack 8 + IL_0000: nop + IL_0001: ldstr "A" + IL_0006: ldstr "A" + IL_000b: call bool [netstandard]System.String::Equals(string, string) - IL_0011: brfalse.s IL_001b + IL_0010: brfalse.s IL_001a - IL_0013: call void [runtime]System.Console::WriteLine() - IL_0018: nop - IL_0019: br.s IL_0021 + IL_0012: call void [runtime]System.Console::WriteLine() + IL_0017: nop + IL_0018: br.s IL_0020 - IL_001b: call void [runtime]System.Console::WriteLine() - IL_0020: nop - IL_0021: ret + IL_001a: call void [runtime]System.Console::WriteLine() + IL_001f: nop + IL_0020: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22f.fs.RealInternalSignatureOn.il.net472.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22f.fs.RealInternalSignatureOn.OptimizeOff.il.net472.bsl similarity index 100% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22f.fs.RealInternalSignatureOn.il.net472.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22f.fs.RealInternalSignatureOn.OptimizeOff.il.net472.bsl diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22f.fs.RealInternalSignatureOn.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22f.fs.RealInternalSignatureOn.OptimizeOff.il.netcore.bsl similarity index 95% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22f.fs.RealInternalSignatureOn.il.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22f.fs.RealInternalSignatureOn.OptimizeOff.il.netcore.bsl index d40d4a5eaec..3bebfff9e17 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22f.fs.RealInternalSignatureOn.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22f.fs.RealInternalSignatureOn.OptimizeOff.il.netcore.bsl @@ -22,16 +22,6 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 -} -.mresource public FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - } .module assembly.exe diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22f.fs.RealInternalSignatureOn.OptimizeOn.il.net472.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22f.fs.RealInternalSignatureOn.OptimizeOn.il.net472.bsl new file mode 100644 index 00000000000..625456a9501 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22f.fs.RealInternalSignatureOn.OptimizeOn.il.net472.bsl @@ -0,0 +1,96 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly extern netstandard +{ + .publickeytoken = (CC 7B 13 FF CD 2D DD 51 ) + .ver 2:1:0:0 +} +.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 +} +.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 ) + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: stsfld int32 ''.$assembly::init@ + IL_0006: ldsfld int32 ''.$assembly::init@ + IL_000b: pop + IL_000c: ret + } + + .method assembly specialname static void staticInitialization@() cil managed + { + + .maxstack 8 + IL_0000: nop + IL_0001: ldstr "A" + IL_0006: ldstr "A" + IL_000b: call bool [netstandard]System.String::Equals(string, + string) + IL_0010: brfalse.s IL_001a + + IL_0012: call void [runtime]System.Console::WriteLine() + IL_0017: nop + IL_0018: br.s IL_0020 + + IL_001a: call void [runtime]System.Console::WriteLine() + IL_001f: nop + IL_0020: ret + } + +} + +.class private abstract auto ansi sealed ''.$assembly + extends [runtime]System.Object +{ + .field static assembly int32 init@ + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: call void assembly::staticInitialization@() + IL_0005: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22f.fs.RealInternalSignatureOn.OptimizeOn.il.netcore.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22f.fs.RealInternalSignatureOn.OptimizeOn.il.netcore.bsl new file mode 100644 index 00000000000..d07a80b3bb2 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22f.fs.RealInternalSignatureOn.OptimizeOn.il.netcore.bsl @@ -0,0 +1,97 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly extern netstandard +{ + .publickeytoken = (CC 7B 13 FF CD 2D DD 51 ) + .ver 2:1:0:0 +} +.assembly extern runtime { } +.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 +} +.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 ) + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: stsfld int32 ''.$assembly::init@ + IL_0006: ldsfld int32 ''.$assembly::init@ + IL_000b: pop + IL_000c: ret + } + + .method assembly specialname static void staticInitialization@() cil managed + { + + .maxstack 8 + IL_0000: nop + IL_0001: ldstr "A" + IL_0006: ldstr "A" + IL_000b: call bool [netstandard]System.String::Equals(string, + string) + IL_0010: brfalse.s IL_001a + + IL_0012: call void [runtime]System.Console::WriteLine() + IL_0017: nop + IL_0018: br.s IL_0020 + + IL_001a: call void [runtime]System.Console::WriteLine() + IL_001f: nop + IL_0020: ret + } + +} + +.class private abstract auto ansi sealed ''.$assembly + extends [runtime]System.Object +{ + .field static assembly int32 init@ + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: call void assembly::staticInitialization@() + IL_0005: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22g.fs.RealInternalSignatureOff.il.net472.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22g.fs.RealInternalSignatureOff.OptimizeOff.il.net472.bsl similarity index 100% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22g.fs.RealInternalSignatureOff.il.net472.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22g.fs.RealInternalSignatureOff.OptimizeOff.il.net472.bsl diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22g.fs.RealInternalSignatureOff.il.netcore.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22g.fs.RealInternalSignatureOff.OptimizeOff.il.netcore.bsl similarity index 93% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22g.fs.RealInternalSignatureOff.il.netcore.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22g.fs.RealInternalSignatureOff.OptimizeOff.il.netcore.bsl index be3321156ef..8e50cf1e6de 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22g.fs.RealInternalSignatureOff.il.netcore.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22g.fs.RealInternalSignatureOff.OptimizeOff.il.netcore.bsl @@ -17,16 +17,6 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 -} -.mresource public FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - } .module assembly.exe diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22g.fs.RealInternalSignatureOff.OptimizeOn.il.net472.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22g.fs.RealInternalSignatureOff.OptimizeOn.il.net472.bsl new file mode 100644 index 00000000000..24ef383498f --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22g.fs.RealInternalSignatureOff.OptimizeOn.il.net472.bsl @@ -0,0 +1,61 @@ + + + + + +.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 +} +.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 private abstract auto ansi sealed ''.$assembly + extends [runtime]System.Object +{ + .field static assembly int32 init@ + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: nop + IL_0001: call void [runtime]System.Console::WriteLine() + IL_0006: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22g.fs.RealInternalSignatureOff.OptimizeOn.il.netcore.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22g.fs.RealInternalSignatureOff.OptimizeOn.il.netcore.bsl new file mode 100644 index 00000000000..3960fe05b8a --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22g.fs.RealInternalSignatureOff.OptimizeOn.il.netcore.bsl @@ -0,0 +1,62 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly extern runtime { } +.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 +} +.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 private abstract auto ansi sealed ''.$assembly + extends [runtime]System.Object +{ + .field static assembly int32 init@ + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: nop + IL_0001: call void [runtime]System.Console::WriteLine() + IL_0006: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22g.fs.RealInternalSignatureOn.il.net472.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22g.fs.RealInternalSignatureOn.OptimizeOff.il.net472.bsl similarity index 100% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22g.fs.RealInternalSignatureOn.il.net472.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22g.fs.RealInternalSignatureOn.OptimizeOff.il.net472.bsl diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22g.fs.RealInternalSignatureOn.il.netcore.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22g.fs.RealInternalSignatureOn.OptimizeOff.il.netcore.bsl similarity index 94% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22g.fs.RealInternalSignatureOn.il.netcore.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22g.fs.RealInternalSignatureOn.OptimizeOff.il.netcore.bsl index 034610cf4a5..bb3254b463e 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22g.fs.RealInternalSignatureOn.il.netcore.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22g.fs.RealInternalSignatureOn.OptimizeOff.il.netcore.bsl @@ -17,16 +17,6 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 -} -.mresource public FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - } .module assembly.exe diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22g.fs.RealInternalSignatureOn.OptimizeOn.il.net472.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22g.fs.RealInternalSignatureOn.OptimizeOn.il.net472.bsl new file mode 100644 index 00000000000..385ee3b69d3 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22g.fs.RealInternalSignatureOn.OptimizeOn.il.net472.bsl @@ -0,0 +1,80 @@ + + + + + +.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 +} +.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 ) + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: stsfld int32 ''.$assembly::init@ + IL_0006: ldsfld int32 ''.$assembly::init@ + IL_000b: pop + IL_000c: ret + } + + .method assembly specialname static void staticInitialization@() cil managed + { + + .maxstack 8 + IL_0000: nop + IL_0001: call void [runtime]System.Console::WriteLine() + IL_0006: ret + } + +} + +.class private abstract auto ansi sealed ''.$assembly + extends [runtime]System.Object +{ + .field static assembly int32 init@ + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: call void assembly::staticInitialization@() + IL_0005: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22g.fs.RealInternalSignatureOn.OptimizeOn.il.netcore.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22g.fs.RealInternalSignatureOn.OptimizeOn.il.netcore.bsl new file mode 100644 index 00000000000..2aa82125439 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22g.fs.RealInternalSignatureOn.OptimizeOn.il.netcore.bsl @@ -0,0 +1,81 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly extern runtime { } +.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 +} +.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 ) + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: stsfld int32 ''.$assembly::init@ + IL_0006: ldsfld int32 ''.$assembly::init@ + IL_000b: pop + IL_000c: ret + } + + .method assembly specialname static void staticInitialization@() cil managed + { + + .maxstack 8 + IL_0000: nop + IL_0001: call void [runtime]System.Console::WriteLine() + IL_0006: ret + } + +} + +.class private abstract auto ansi sealed ''.$assembly + extends [runtime]System.Object +{ + .field static assembly int32 init@ + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: call void assembly::staticInitialization@() + IL_0005: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22h.fs.RealInternalSignatureOff.il.net472.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22h.fs.RealInternalSignatureOff.OptimizeOff.il.net472.bsl similarity index 100% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22h.fs.RealInternalSignatureOff.il.net472.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22h.fs.RealInternalSignatureOff.OptimizeOff.il.net472.bsl diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22h.fs.RealInternalSignatureOn.il.netcore .bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22h.fs.RealInternalSignatureOff.OptimizeOff.il.netcore.bsl similarity index 98% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22h.fs.RealInternalSignatureOn.il.netcore .bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22h.fs.RealInternalSignatureOff.OptimizeOff.il.netcore.bsl index 1bc97bec0a1..0a339bb2ae3 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22h.fs.RealInternalSignatureOn.il.netcore .bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22h.fs.RealInternalSignatureOff.OptimizeOff.il.netcore.bsl @@ -17,16 +17,6 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 -} -.mresource public FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - } .module assembly.exe diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22h.fs.RealInternalSignatureOff.OptimizeOn.il.net472.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22h.fs.RealInternalSignatureOff.OptimizeOn.il.net472.bsl new file mode 100644 index 00000000000..c85c72152d8 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22h.fs.RealInternalSignatureOff.OptimizeOn.il.net472.bsl @@ -0,0 +1,308 @@ + + + + + +.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 +} +.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 ) + .method public static void test1() cil managed + { + + .maxstack 3 + .locals init (class [runtime]System.Exception V_0) + .try + { + IL_0000: nop + IL_0001: call void [runtime]System.Console::WriteLine() + IL_0006: leave.s IL_0015 + + } + catch [runtime]System.Object + { + IL_0008: castclass [runtime]System.Exception + IL_000d: stloc.0 + IL_000e: call void [runtime]System.Console::WriteLine() + IL_0013: leave.s IL_0015 + + } + IL_0015: ret + } + + .method public static void test2() cil managed + { + + .maxstack 3 + .locals init (class [runtime]System.Exception V_0, + class [runtime]System.ArgumentException V_1, + class [runtime]System.Exception V_2) + .try + { + IL_0000: nop + IL_0001: call void [runtime]System.Console::WriteLine() + IL_0006: leave.s IL_0042 + + } + filter + { + IL_0008: castclass [runtime]System.Exception + IL_000d: stloc.0 + IL_000e: ldloc.0 + IL_000f: isinst [runtime]System.ArgumentException + IL_0014: stloc.1 + IL_0015: ldloc.1 + IL_0016: brfalse.s IL_001c + + IL_0018: ldc.i4.1 + IL_0019: nop + IL_001a: br.s IL_001e + + IL_001c: ldc.i4.0 + IL_001d: nop + IL_001e: endfilter + } + { + IL_0020: castclass [runtime]System.Exception + IL_0025: stloc.2 + IL_0026: ldloc.2 + IL_0027: isinst [runtime]System.ArgumentException + IL_002c: stloc.1 + IL_002d: ldloc.1 + IL_002e: brfalse.s IL_0037 + + IL_0030: call void [runtime]System.Console::WriteLine() + IL_0035: leave.s IL_0042 + + IL_0037: rethrow + IL_0039: ldnull + IL_003a: unbox.any [FSharp.Core]Microsoft.FSharp.Core.Unit + IL_003f: pop + IL_0040: leave.s IL_0042 + + } + IL_0042: ret + } + + .method public static void test3() cil managed + { + + .maxstack 3 + .locals init (class [runtime]System.Exception V_0, + class [runtime]System.ArgumentException V_1, + class [runtime]System.ArgumentException V_2, + class [runtime]System.Exception V_3) + .try + { + IL_0000: nop + IL_0001: call void [runtime]System.Console::WriteLine() + IL_0006: leave.s IL_004c + + } + filter + { + IL_0008: castclass [runtime]System.Exception + IL_000d: stloc.0 + IL_000e: ldloc.0 + IL_000f: isinst [runtime]System.ArgumentException + IL_0014: stloc.1 + IL_0015: ldloc.1 + IL_0016: brfalse.s IL_001e + + IL_0018: ldloc.1 + IL_0019: stloc.2 + IL_001a: ldc.i4.1 + IL_001b: nop + IL_001c: br.s IL_0020 + + IL_001e: ldc.i4.0 + IL_001f: nop + IL_0020: endfilter + } + { + IL_0022: castclass [runtime]System.Exception + IL_0027: stloc.3 + IL_0028: ldloc.3 + IL_0029: isinst [runtime]System.ArgumentException + IL_002e: stloc.1 + IL_002f: ldloc.1 + IL_0030: brfalse.s IL_0041 + + IL_0032: ldloc.1 + IL_0033: stloc.2 + IL_0034: ldloc.2 + IL_0035: callvirt instance string [runtime]System.Exception::get_Message() + IL_003a: call void [runtime]System.Console::WriteLine(string) + IL_003f: leave.s IL_004c + + IL_0041: rethrow + IL_0043: ldnull + IL_0044: unbox.any [FSharp.Core]Microsoft.FSharp.Core.Unit + IL_0049: pop + IL_004a: leave.s IL_004c + + } + IL_004c: ret + } + + .method public static void test4() cil managed + { + + .maxstack 3 + .locals init (class [runtime]System.Exception V_0, + class [FSharp.Core]Microsoft.FSharp.Core.MatchFailureException V_1, + string V_2, + class [runtime]System.Exception V_3) + .try + { + IL_0000: nop + IL_0001: call void [runtime]System.Console::WriteLine() + IL_0006: leave.s IL_005b + + } + filter + { + IL_0008: castclass [runtime]System.Exception + IL_000d: stloc.0 + IL_000e: ldloc.0 + IL_000f: isinst [FSharp.Core]Microsoft.FSharp.Core.MatchFailureException + IL_0014: stloc.1 + IL_0015: ldloc.1 + IL_0016: brfalse.s IL_0028 + + IL_0018: ldloc.0 + IL_0019: castclass [FSharp.Core]Microsoft.FSharp.Core.MatchFailureException + IL_001e: call instance string [FSharp.Core]Microsoft.FSharp.Core.MatchFailureException::get_Data0() + IL_0023: stloc.2 + IL_0024: ldc.i4.1 + IL_0025: nop + IL_0026: br.s IL_002a + + IL_0028: ldc.i4.0 + IL_0029: nop + IL_002a: endfilter + } + { + IL_002c: castclass [runtime]System.Exception + IL_0031: stloc.3 + IL_0032: ldloc.3 + IL_0033: isinst [FSharp.Core]Microsoft.FSharp.Core.MatchFailureException + IL_0038: stloc.1 + IL_0039: ldloc.1 + IL_003a: brfalse.s IL_0050 + + IL_003c: ldloc.3 + IL_003d: castclass [FSharp.Core]Microsoft.FSharp.Core.MatchFailureException + IL_0042: call instance string [FSharp.Core]Microsoft.FSharp.Core.MatchFailureException::get_Data0() + IL_0047: stloc.2 + IL_0048: ldloc.2 + IL_0049: call void [runtime]System.Console::WriteLine(string) + IL_004e: leave.s IL_005b + + IL_0050: rethrow + IL_0052: ldnull + IL_0053: unbox.any [FSharp.Core]Microsoft.FSharp.Core.Unit + IL_0058: pop + IL_0059: leave.s IL_005b + + } + IL_005b: ret + } + + .method public static void test5() cil managed + { + + .maxstack 3 + .locals init (class [runtime]System.Exception V_0, + class [runtime]System.ArgumentException V_1) + .try + { + IL_0000: nop + IL_0001: call void [runtime]System.Console::WriteLine() + IL_0006: leave.s IL_0051 + + } + catch [runtime]System.Object + { + IL_0008: castclass [runtime]System.Exception + IL_000d: stloc.0 + IL_000e: ldloc.0 + IL_000f: isinst [runtime]System.ArgumentException + IL_0014: brtrue.s IL_0020 + + IL_0016: ldloc.0 + IL_0017: isinst [FSharp.Core]Microsoft.FSharp.Core.MatchFailureException + IL_001c: brfalse.s IL_0046 + + IL_001e: br.s IL_0034 + + IL_0020: ldloc.0 + IL_0021: unbox.any [runtime]System.ArgumentException + IL_0026: stloc.1 + IL_0027: ldloc.1 + IL_0028: callvirt instance string [runtime]System.Exception::get_Message() + IL_002d: call void [runtime]System.Console::WriteLine(string) + IL_0032: leave.s IL_0051 + + IL_0034: ldloc.0 + IL_0035: castclass [FSharp.Core]Microsoft.FSharp.Core.MatchFailureException + IL_003a: call instance string [FSharp.Core]Microsoft.FSharp.Core.MatchFailureException::get_Data0() + IL_003f: call void [runtime]System.Console::WriteLine(string) + IL_0044: leave.s IL_0051 + + IL_0046: rethrow + IL_0048: ldnull + IL_0049: unbox.any [FSharp.Core]Microsoft.FSharp.Core.Unit + IL_004e: pop + IL_004f: leave.s IL_0051 + + } + IL_0051: 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/TestFunction22h.fs.RealInternalSignatureOff.il.netcore.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22h.fs.RealInternalSignatureOff.OptimizeOn.il.netcore.bsl similarity index 68% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22h.fs.RealInternalSignatureOff.il.netcore.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22h.fs.RealInternalSignatureOff.OptimizeOn.il.netcore.bsl index 1bc97bec0a1..a73fda88e58 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22h.fs.RealInternalSignatureOff.il.netcore.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22h.fs.RealInternalSignatureOff.OptimizeOn.il.netcore.bsl @@ -17,16 +17,6 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 -} -.mresource public FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - } .module assembly.exe @@ -73,8 +63,7 @@ .maxstack 3 .locals init (class [runtime]System.Exception V_0, class [runtime]System.ArgumentException V_1, - class [runtime]System.Exception V_2, - class [runtime]System.ArgumentException V_3) + class [runtime]System.Exception V_2) .try { IL_0000: nop @@ -105,8 +94,8 @@ IL_0025: stloc.2 IL_0026: ldloc.2 IL_0027: isinst [runtime]System.ArgumentException - IL_002c: stloc.3 - IL_002d: ldloc.3 + IL_002c: stloc.1 + IL_002d: ldloc.1 IL_002e: brfalse.s IL_0037 IL_0030: call void [runtime]System.Console::WriteLine() @@ -129,14 +118,12 @@ .locals init (class [runtime]System.Exception V_0, class [runtime]System.ArgumentException V_1, class [runtime]System.ArgumentException V_2, - class [runtime]System.Exception V_3, - class [runtime]System.ArgumentException V_4, - class [runtime]System.ArgumentException V_5) + class [runtime]System.Exception V_3) .try { IL_0000: nop IL_0001: call void [runtime]System.Console::WriteLine() - IL_0006: leave.s IL_0051 + IL_0006: leave.s IL_004c } filter @@ -164,25 +151,25 @@ IL_0027: stloc.3 IL_0028: ldloc.3 IL_0029: isinst [runtime]System.ArgumentException - IL_002e: stloc.s V_4 - IL_0030: ldloc.s V_4 - IL_0032: brfalse.s IL_0046 - - IL_0034: ldloc.s V_4 - IL_0036: stloc.s V_5 - IL_0038: ldloc.s V_5 - IL_003a: callvirt instance string [runtime]System.Exception::get_Message() - IL_003f: call void [runtime]System.Console::WriteLine(string) - IL_0044: leave.s IL_0051 - - IL_0046: rethrow - IL_0048: ldnull - IL_0049: unbox.any [FSharp.Core]Microsoft.FSharp.Core.Unit - IL_004e: pop - IL_004f: leave.s IL_0051 + IL_002e: stloc.1 + IL_002f: ldloc.1 + IL_0030: brfalse.s IL_0041 + + IL_0032: ldloc.1 + IL_0033: stloc.2 + IL_0034: ldloc.2 + IL_0035: callvirt instance string [runtime]System.Exception::get_Message() + IL_003a: call void [runtime]System.Console::WriteLine(string) + IL_003f: leave.s IL_004c + + IL_0041: rethrow + IL_0043: ldnull + IL_0044: unbox.any [FSharp.Core]Microsoft.FSharp.Core.Unit + IL_0049: pop + IL_004a: leave.s IL_004c } - IL_0051: ret + IL_004c: ret } .method public static void test4() cil managed @@ -192,14 +179,12 @@ .locals init (class [runtime]System.Exception V_0, class [FSharp.Core]Microsoft.FSharp.Core.MatchFailureException V_1, string V_2, - class [runtime]System.Exception V_3, - class [FSharp.Core]Microsoft.FSharp.Core.MatchFailureException V_4, - string V_5) + class [runtime]System.Exception V_3) .try { IL_0000: nop IL_0001: call void [runtime]System.Console::WriteLine() - IL_0006: leave.s IL_005f + IL_0006: leave.s IL_005b } filter @@ -229,26 +214,26 @@ IL_0031: stloc.3 IL_0032: ldloc.3 IL_0033: isinst [FSharp.Core]Microsoft.FSharp.Core.MatchFailureException - IL_0038: stloc.s V_4 - IL_003a: ldloc.s V_4 - IL_003c: brfalse.s IL_0054 - - IL_003e: ldloc.3 - IL_003f: castclass [FSharp.Core]Microsoft.FSharp.Core.MatchFailureException - IL_0044: call instance string [FSharp.Core]Microsoft.FSharp.Core.MatchFailureException::get_Data0() - IL_0049: stloc.s V_5 - IL_004b: ldloc.s V_5 - IL_004d: call void [runtime]System.Console::WriteLine(string) - IL_0052: leave.s IL_005f - - IL_0054: rethrow - IL_0056: ldnull - IL_0057: unbox.any [FSharp.Core]Microsoft.FSharp.Core.Unit - IL_005c: pop - IL_005d: leave.s IL_005f + IL_0038: stloc.1 + IL_0039: ldloc.1 + IL_003a: brfalse.s IL_0050 + + IL_003c: ldloc.3 + IL_003d: castclass [FSharp.Core]Microsoft.FSharp.Core.MatchFailureException + IL_0042: call instance string [FSharp.Core]Microsoft.FSharp.Core.MatchFailureException::get_Data0() + IL_0047: stloc.2 + IL_0048: ldloc.2 + IL_0049: call void [runtime]System.Console::WriteLine(string) + IL_004e: leave.s IL_005b + + IL_0050: rethrow + IL_0052: ldnull + IL_0053: unbox.any [FSharp.Core]Microsoft.FSharp.Core.Unit + IL_0058: pop + IL_0059: leave.s IL_005b } - IL_005f: ret + IL_005b: ret } .method public static void test5() cil managed @@ -256,15 +241,12 @@ .maxstack 3 .locals init (class [runtime]System.Exception V_0, - object V_1, - object V_2, - class [runtime]System.ArgumentException V_3, - string V_4) + class [runtime]System.ArgumentException V_1) .try { IL_0000: nop IL_0001: call void [runtime]System.Console::WriteLine() - IL_0006: leave.s IL_005f + IL_0006: leave.s IL_0051 } catch [runtime]System.Object @@ -272,47 +254,37 @@ IL_0008: castclass [runtime]System.Exception IL_000d: stloc.0 IL_000e: ldloc.0 - IL_000f: stloc.1 - IL_0010: ldloc.1 - IL_0011: isinst [runtime]System.ArgumentException - IL_0016: ldnull - IL_0017: cgt.un - IL_0019: brtrue.s IL_002a - - IL_001b: ldloc.0 - IL_001c: stloc.2 - IL_001d: ldloc.2 - IL_001e: isinst [FSharp.Core]Microsoft.FSharp.Core.MatchFailureException - IL_0023: ldnull - IL_0024: cgt.un - IL_0026: brfalse.s IL_0054 - - IL_0028: br.s IL_003e - - IL_002a: ldloc.0 - IL_002b: unbox.any [runtime]System.ArgumentException - IL_0030: stloc.3 - IL_0031: ldloc.3 - IL_0032: callvirt instance string [runtime]System.Exception::get_Message() - IL_0037: call void [runtime]System.Console::WriteLine(string) - IL_003c: leave.s IL_005f - - IL_003e: ldloc.0 - IL_003f: castclass [FSharp.Core]Microsoft.FSharp.Core.MatchFailureException - IL_0044: call instance string [FSharp.Core]Microsoft.FSharp.Core.MatchFailureException::get_Data0() - IL_0049: stloc.s V_4 - IL_004b: ldloc.s V_4 - IL_004d: call void [runtime]System.Console::WriteLine(string) - IL_0052: leave.s IL_005f - - IL_0054: rethrow - IL_0056: ldnull - IL_0057: unbox.any [FSharp.Core]Microsoft.FSharp.Core.Unit - IL_005c: pop - IL_005d: leave.s IL_005f + IL_000f: isinst [runtime]System.ArgumentException + IL_0014: brtrue.s IL_0020 + + IL_0016: ldloc.0 + IL_0017: isinst [FSharp.Core]Microsoft.FSharp.Core.MatchFailureException + IL_001c: brfalse.s IL_0046 + + IL_001e: br.s IL_0034 + + IL_0020: ldloc.0 + IL_0021: unbox.any [runtime]System.ArgumentException + IL_0026: stloc.1 + IL_0027: ldloc.1 + IL_0028: callvirt instance string [runtime]System.Exception::get_Message() + IL_002d: call void [runtime]System.Console::WriteLine(string) + IL_0032: leave.s IL_0051 + + IL_0034: ldloc.0 + IL_0035: castclass [FSharp.Core]Microsoft.FSharp.Core.MatchFailureException + IL_003a: call instance string [FSharp.Core]Microsoft.FSharp.Core.MatchFailureException::get_Data0() + IL_003f: call void [runtime]System.Console::WriteLine(string) + IL_0044: leave.s IL_0051 + + IL_0046: rethrow + IL_0048: ldnull + IL_0049: unbox.any [FSharp.Core]Microsoft.FSharp.Core.Unit + IL_004e: pop + IL_004f: leave.s IL_0051 } - IL_005f: ret + IL_0051: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22h.fs.RealInternalSignatureOn.il.net472.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22h.fs.RealInternalSignatureOn.OptimizeOff.il.net472.bsl similarity index 98% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22h.fs.RealInternalSignatureOn.il.net472.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22h.fs.RealInternalSignatureOn.OptimizeOff.il.net472.bsl index 43e2de4d4aa..433c9858f45 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22h.fs.RealInternalSignatureOn.il.net472.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22h.fs.RealInternalSignatureOn.OptimizeOff.il.net472.bsl @@ -16,16 +16,6 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 -} -.mresource public FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - } .module assembly.exe diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22h.fs.RealInternalSignatureOn.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22h.fs.RealInternalSignatureOn.OptimizeOff.il.netcore.bsl similarity index 98% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22h.fs.RealInternalSignatureOn.il.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22h.fs.RealInternalSignatureOn.OptimizeOff.il.netcore.bsl index 1bc97bec0a1..0a339bb2ae3 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22h.fs.RealInternalSignatureOn.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22h.fs.RealInternalSignatureOn.OptimizeOff.il.netcore.bsl @@ -17,16 +17,6 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 -} -.mresource public FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - } .module assembly.exe diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22h.fs.RealInternalSignatureOn.OptimizeOn.il.net472.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22h.fs.RealInternalSignatureOn.OptimizeOn.il.net472.bsl new file mode 100644 index 00000000000..c85c72152d8 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22h.fs.RealInternalSignatureOn.OptimizeOn.il.net472.bsl @@ -0,0 +1,308 @@ + + + + + +.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 +} +.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 ) + .method public static void test1() cil managed + { + + .maxstack 3 + .locals init (class [runtime]System.Exception V_0) + .try + { + IL_0000: nop + IL_0001: call void [runtime]System.Console::WriteLine() + IL_0006: leave.s IL_0015 + + } + catch [runtime]System.Object + { + IL_0008: castclass [runtime]System.Exception + IL_000d: stloc.0 + IL_000e: call void [runtime]System.Console::WriteLine() + IL_0013: leave.s IL_0015 + + } + IL_0015: ret + } + + .method public static void test2() cil managed + { + + .maxstack 3 + .locals init (class [runtime]System.Exception V_0, + class [runtime]System.ArgumentException V_1, + class [runtime]System.Exception V_2) + .try + { + IL_0000: nop + IL_0001: call void [runtime]System.Console::WriteLine() + IL_0006: leave.s IL_0042 + + } + filter + { + IL_0008: castclass [runtime]System.Exception + IL_000d: stloc.0 + IL_000e: ldloc.0 + IL_000f: isinst [runtime]System.ArgumentException + IL_0014: stloc.1 + IL_0015: ldloc.1 + IL_0016: brfalse.s IL_001c + + IL_0018: ldc.i4.1 + IL_0019: nop + IL_001a: br.s IL_001e + + IL_001c: ldc.i4.0 + IL_001d: nop + IL_001e: endfilter + } + { + IL_0020: castclass [runtime]System.Exception + IL_0025: stloc.2 + IL_0026: ldloc.2 + IL_0027: isinst [runtime]System.ArgumentException + IL_002c: stloc.1 + IL_002d: ldloc.1 + IL_002e: brfalse.s IL_0037 + + IL_0030: call void [runtime]System.Console::WriteLine() + IL_0035: leave.s IL_0042 + + IL_0037: rethrow + IL_0039: ldnull + IL_003a: unbox.any [FSharp.Core]Microsoft.FSharp.Core.Unit + IL_003f: pop + IL_0040: leave.s IL_0042 + + } + IL_0042: ret + } + + .method public static void test3() cil managed + { + + .maxstack 3 + .locals init (class [runtime]System.Exception V_0, + class [runtime]System.ArgumentException V_1, + class [runtime]System.ArgumentException V_2, + class [runtime]System.Exception V_3) + .try + { + IL_0000: nop + IL_0001: call void [runtime]System.Console::WriteLine() + IL_0006: leave.s IL_004c + + } + filter + { + IL_0008: castclass [runtime]System.Exception + IL_000d: stloc.0 + IL_000e: ldloc.0 + IL_000f: isinst [runtime]System.ArgumentException + IL_0014: stloc.1 + IL_0015: ldloc.1 + IL_0016: brfalse.s IL_001e + + IL_0018: ldloc.1 + IL_0019: stloc.2 + IL_001a: ldc.i4.1 + IL_001b: nop + IL_001c: br.s IL_0020 + + IL_001e: ldc.i4.0 + IL_001f: nop + IL_0020: endfilter + } + { + IL_0022: castclass [runtime]System.Exception + IL_0027: stloc.3 + IL_0028: ldloc.3 + IL_0029: isinst [runtime]System.ArgumentException + IL_002e: stloc.1 + IL_002f: ldloc.1 + IL_0030: brfalse.s IL_0041 + + IL_0032: ldloc.1 + IL_0033: stloc.2 + IL_0034: ldloc.2 + IL_0035: callvirt instance string [runtime]System.Exception::get_Message() + IL_003a: call void [runtime]System.Console::WriteLine(string) + IL_003f: leave.s IL_004c + + IL_0041: rethrow + IL_0043: ldnull + IL_0044: unbox.any [FSharp.Core]Microsoft.FSharp.Core.Unit + IL_0049: pop + IL_004a: leave.s IL_004c + + } + IL_004c: ret + } + + .method public static void test4() cil managed + { + + .maxstack 3 + .locals init (class [runtime]System.Exception V_0, + class [FSharp.Core]Microsoft.FSharp.Core.MatchFailureException V_1, + string V_2, + class [runtime]System.Exception V_3) + .try + { + IL_0000: nop + IL_0001: call void [runtime]System.Console::WriteLine() + IL_0006: leave.s IL_005b + + } + filter + { + IL_0008: castclass [runtime]System.Exception + IL_000d: stloc.0 + IL_000e: ldloc.0 + IL_000f: isinst [FSharp.Core]Microsoft.FSharp.Core.MatchFailureException + IL_0014: stloc.1 + IL_0015: ldloc.1 + IL_0016: brfalse.s IL_0028 + + IL_0018: ldloc.0 + IL_0019: castclass [FSharp.Core]Microsoft.FSharp.Core.MatchFailureException + IL_001e: call instance string [FSharp.Core]Microsoft.FSharp.Core.MatchFailureException::get_Data0() + IL_0023: stloc.2 + IL_0024: ldc.i4.1 + IL_0025: nop + IL_0026: br.s IL_002a + + IL_0028: ldc.i4.0 + IL_0029: nop + IL_002a: endfilter + } + { + IL_002c: castclass [runtime]System.Exception + IL_0031: stloc.3 + IL_0032: ldloc.3 + IL_0033: isinst [FSharp.Core]Microsoft.FSharp.Core.MatchFailureException + IL_0038: stloc.1 + IL_0039: ldloc.1 + IL_003a: brfalse.s IL_0050 + + IL_003c: ldloc.3 + IL_003d: castclass [FSharp.Core]Microsoft.FSharp.Core.MatchFailureException + IL_0042: call instance string [FSharp.Core]Microsoft.FSharp.Core.MatchFailureException::get_Data0() + IL_0047: stloc.2 + IL_0048: ldloc.2 + IL_0049: call void [runtime]System.Console::WriteLine(string) + IL_004e: leave.s IL_005b + + IL_0050: rethrow + IL_0052: ldnull + IL_0053: unbox.any [FSharp.Core]Microsoft.FSharp.Core.Unit + IL_0058: pop + IL_0059: leave.s IL_005b + + } + IL_005b: ret + } + + .method public static void test5() cil managed + { + + .maxstack 3 + .locals init (class [runtime]System.Exception V_0, + class [runtime]System.ArgumentException V_1) + .try + { + IL_0000: nop + IL_0001: call void [runtime]System.Console::WriteLine() + IL_0006: leave.s IL_0051 + + } + catch [runtime]System.Object + { + IL_0008: castclass [runtime]System.Exception + IL_000d: stloc.0 + IL_000e: ldloc.0 + IL_000f: isinst [runtime]System.ArgumentException + IL_0014: brtrue.s IL_0020 + + IL_0016: ldloc.0 + IL_0017: isinst [FSharp.Core]Microsoft.FSharp.Core.MatchFailureException + IL_001c: brfalse.s IL_0046 + + IL_001e: br.s IL_0034 + + IL_0020: ldloc.0 + IL_0021: unbox.any [runtime]System.ArgumentException + IL_0026: stloc.1 + IL_0027: ldloc.1 + IL_0028: callvirt instance string [runtime]System.Exception::get_Message() + IL_002d: call void [runtime]System.Console::WriteLine(string) + IL_0032: leave.s IL_0051 + + IL_0034: ldloc.0 + IL_0035: castclass [FSharp.Core]Microsoft.FSharp.Core.MatchFailureException + IL_003a: call instance string [FSharp.Core]Microsoft.FSharp.Core.MatchFailureException::get_Data0() + IL_003f: call void [runtime]System.Console::WriteLine(string) + IL_0044: leave.s IL_0051 + + IL_0046: rethrow + IL_0048: ldnull + IL_0049: unbox.any [FSharp.Core]Microsoft.FSharp.Core.Unit + IL_004e: pop + IL_004f: leave.s IL_0051 + + } + IL_0051: 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/TestFunction22h.fs.RealInternalSignatureOn.OptimizeOn.il.netcore.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22h.fs.RealInternalSignatureOn.OptimizeOn.il.netcore.bsl new file mode 100644 index 00000000000..a73fda88e58 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction22h.fs.RealInternalSignatureOn.OptimizeOn.il.netcore.bsl @@ -0,0 +1,309 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly extern runtime { } +.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 +} +.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 ) + .method public static void test1() cil managed + { + + .maxstack 3 + .locals init (class [runtime]System.Exception V_0) + .try + { + IL_0000: nop + IL_0001: call void [runtime]System.Console::WriteLine() + IL_0006: leave.s IL_0015 + + } + catch [runtime]System.Object + { + IL_0008: castclass [runtime]System.Exception + IL_000d: stloc.0 + IL_000e: call void [runtime]System.Console::WriteLine() + IL_0013: leave.s IL_0015 + + } + IL_0015: ret + } + + .method public static void test2() cil managed + { + + .maxstack 3 + .locals init (class [runtime]System.Exception V_0, + class [runtime]System.ArgumentException V_1, + class [runtime]System.Exception V_2) + .try + { + IL_0000: nop + IL_0001: call void [runtime]System.Console::WriteLine() + IL_0006: leave.s IL_0042 + + } + filter + { + IL_0008: castclass [runtime]System.Exception + IL_000d: stloc.0 + IL_000e: ldloc.0 + IL_000f: isinst [runtime]System.ArgumentException + IL_0014: stloc.1 + IL_0015: ldloc.1 + IL_0016: brfalse.s IL_001c + + IL_0018: ldc.i4.1 + IL_0019: nop + IL_001a: br.s IL_001e + + IL_001c: ldc.i4.0 + IL_001d: nop + IL_001e: endfilter + } + { + IL_0020: castclass [runtime]System.Exception + IL_0025: stloc.2 + IL_0026: ldloc.2 + IL_0027: isinst [runtime]System.ArgumentException + IL_002c: stloc.1 + IL_002d: ldloc.1 + IL_002e: brfalse.s IL_0037 + + IL_0030: call void [runtime]System.Console::WriteLine() + IL_0035: leave.s IL_0042 + + IL_0037: rethrow + IL_0039: ldnull + IL_003a: unbox.any [FSharp.Core]Microsoft.FSharp.Core.Unit + IL_003f: pop + IL_0040: leave.s IL_0042 + + } + IL_0042: ret + } + + .method public static void test3() cil managed + { + + .maxstack 3 + .locals init (class [runtime]System.Exception V_0, + class [runtime]System.ArgumentException V_1, + class [runtime]System.ArgumentException V_2, + class [runtime]System.Exception V_3) + .try + { + IL_0000: nop + IL_0001: call void [runtime]System.Console::WriteLine() + IL_0006: leave.s IL_004c + + } + filter + { + IL_0008: castclass [runtime]System.Exception + IL_000d: stloc.0 + IL_000e: ldloc.0 + IL_000f: isinst [runtime]System.ArgumentException + IL_0014: stloc.1 + IL_0015: ldloc.1 + IL_0016: brfalse.s IL_001e + + IL_0018: ldloc.1 + IL_0019: stloc.2 + IL_001a: ldc.i4.1 + IL_001b: nop + IL_001c: br.s IL_0020 + + IL_001e: ldc.i4.0 + IL_001f: nop + IL_0020: endfilter + } + { + IL_0022: castclass [runtime]System.Exception + IL_0027: stloc.3 + IL_0028: ldloc.3 + IL_0029: isinst [runtime]System.ArgumentException + IL_002e: stloc.1 + IL_002f: ldloc.1 + IL_0030: brfalse.s IL_0041 + + IL_0032: ldloc.1 + IL_0033: stloc.2 + IL_0034: ldloc.2 + IL_0035: callvirt instance string [runtime]System.Exception::get_Message() + IL_003a: call void [runtime]System.Console::WriteLine(string) + IL_003f: leave.s IL_004c + + IL_0041: rethrow + IL_0043: ldnull + IL_0044: unbox.any [FSharp.Core]Microsoft.FSharp.Core.Unit + IL_0049: pop + IL_004a: leave.s IL_004c + + } + IL_004c: ret + } + + .method public static void test4() cil managed + { + + .maxstack 3 + .locals init (class [runtime]System.Exception V_0, + class [FSharp.Core]Microsoft.FSharp.Core.MatchFailureException V_1, + string V_2, + class [runtime]System.Exception V_3) + .try + { + IL_0000: nop + IL_0001: call void [runtime]System.Console::WriteLine() + IL_0006: leave.s IL_005b + + } + filter + { + IL_0008: castclass [runtime]System.Exception + IL_000d: stloc.0 + IL_000e: ldloc.0 + IL_000f: isinst [FSharp.Core]Microsoft.FSharp.Core.MatchFailureException + IL_0014: stloc.1 + IL_0015: ldloc.1 + IL_0016: brfalse.s IL_0028 + + IL_0018: ldloc.0 + IL_0019: castclass [FSharp.Core]Microsoft.FSharp.Core.MatchFailureException + IL_001e: call instance string [FSharp.Core]Microsoft.FSharp.Core.MatchFailureException::get_Data0() + IL_0023: stloc.2 + IL_0024: ldc.i4.1 + IL_0025: nop + IL_0026: br.s IL_002a + + IL_0028: ldc.i4.0 + IL_0029: nop + IL_002a: endfilter + } + { + IL_002c: castclass [runtime]System.Exception + IL_0031: stloc.3 + IL_0032: ldloc.3 + IL_0033: isinst [FSharp.Core]Microsoft.FSharp.Core.MatchFailureException + IL_0038: stloc.1 + IL_0039: ldloc.1 + IL_003a: brfalse.s IL_0050 + + IL_003c: ldloc.3 + IL_003d: castclass [FSharp.Core]Microsoft.FSharp.Core.MatchFailureException + IL_0042: call instance string [FSharp.Core]Microsoft.FSharp.Core.MatchFailureException::get_Data0() + IL_0047: stloc.2 + IL_0048: ldloc.2 + IL_0049: call void [runtime]System.Console::WriteLine(string) + IL_004e: leave.s IL_005b + + IL_0050: rethrow + IL_0052: ldnull + IL_0053: unbox.any [FSharp.Core]Microsoft.FSharp.Core.Unit + IL_0058: pop + IL_0059: leave.s IL_005b + + } + IL_005b: ret + } + + .method public static void test5() cil managed + { + + .maxstack 3 + .locals init (class [runtime]System.Exception V_0, + class [runtime]System.ArgumentException V_1) + .try + { + IL_0000: nop + IL_0001: call void [runtime]System.Console::WriteLine() + IL_0006: leave.s IL_0051 + + } + catch [runtime]System.Object + { + IL_0008: castclass [runtime]System.Exception + IL_000d: stloc.0 + IL_000e: ldloc.0 + IL_000f: isinst [runtime]System.ArgumentException + IL_0014: brtrue.s IL_0020 + + IL_0016: ldloc.0 + IL_0017: isinst [FSharp.Core]Microsoft.FSharp.Core.MatchFailureException + IL_001c: brfalse.s IL_0046 + + IL_001e: br.s IL_0034 + + IL_0020: ldloc.0 + IL_0021: unbox.any [runtime]System.ArgumentException + IL_0026: stloc.1 + IL_0027: ldloc.1 + IL_0028: callvirt instance string [runtime]System.Exception::get_Message() + IL_002d: call void [runtime]System.Console::WriteLine(string) + IL_0032: leave.s IL_0051 + + IL_0034: ldloc.0 + IL_0035: castclass [FSharp.Core]Microsoft.FSharp.Core.MatchFailureException + IL_003a: call instance string [FSharp.Core]Microsoft.FSharp.Core.MatchFailureException::get_Data0() + IL_003f: call void [runtime]System.Console::WriteLine(string) + IL_0044: leave.s IL_0051 + + IL_0046: rethrow + IL_0048: ldnull + IL_0049: unbox.any [FSharp.Core]Microsoft.FSharp.Core.Unit + IL_004e: pop + IL_004f: leave.s IL_0051 + + } + IL_0051: 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/TestFunction23.fs.il.net472.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction23.fs.OptimizeOff.il.bsl similarity index 90% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction23.fs.il.net472.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction23.fs.OptimizeOff.il.bsl index 3f4c324d6dd..879f6b4e90f 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction23.fs.il.net472.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction23.fs.OptimizeOff.il.bsl @@ -16,16 +16,6 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 -} -.mresource public FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - } .module assembly.exe @@ -49,8 +39,7 @@ .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) .field assembly string x .field assembly string x@8 - .method public specialname rtspecialname - instance void .ctor() cil managed + .method public specialname rtspecialname instance void .ctor() cil managed { .maxstack 8 @@ -67,8 +56,7 @@ IL_001e: ret } - .method public hidebysig instance string - M() cil managed + .method public hidebysig instance string M() cil managed { .maxstack 4 @@ -84,8 +72,7 @@ IL_0013: ret } - .method assembly hidebysig instance string - g() cil managed + .method assembly hidebysig instance string g() cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) @@ -101,8 +88,7 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 { .field static assembly initonly class assembly/g@13 @_instance - .method assembly specialname rtspecialname - instance void .ctor() cil managed + .method assembly specialname rtspecialname instance void .ctor() 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 ) @@ -113,8 +99,7 @@ IL_0006: ret } - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Core.Unit - Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar0) cil managed + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Core.Unit Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar0) cil managed { .maxstack 8 @@ -129,8 +114,7 @@ IL_0021: ret } - .method private specialname rtspecialname static - void .cctor() cil managed + .method private specialname rtspecialname static void .cctor() cil managed { .maxstack 10 @@ -141,8 +125,7 @@ } - .method public static class [runtime]System.Tuple`2 - f(!!a x) cil managed + .method public static class [runtime]System.Tuple`2 f(!!a x) cil managed { .maxstack 5 diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction23.fs.RealInternalSignatureOff.OptimizeOff.il.net472.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction23.fs.RealInternalSignatureOff.OptimizeOff.il.net472.bsl new file mode 100644 index 00000000000..879f6b4e90f --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction23.fs.RealInternalSignatureOff.OptimizeOff.il.net472.bsl @@ -0,0 +1,165 @@ + + + + + +.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 +} +.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 nested public C + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) + .field assembly string x + .field assembly string x@8 + .method public specialname rtspecialname instance void .ctor() cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: callvirt instance void [runtime]System.Object::.ctor() + IL_0006: ldarg.0 + IL_0007: pop + IL_0008: ldarg.0 + IL_0009: call string [runtime]System.Console::ReadLine() + IL_000e: stfld string assembly/C::x + IL_0013: ldarg.0 + IL_0014: call string [runtime]System.Console::ReadLine() + IL_0019: stfld string assembly/C::x@8 + IL_001e: ret + } + + .method public hidebysig instance string M() cil managed + { + + .maxstack 4 + .locals init (class assembly/C V_0) + IL_0000: ldarg.0 + IL_0001: stloc.0 + IL_0002: ldarg.0 + IL_0003: ldfld string assembly/C::x@8 + IL_0008: ldarg.0 + IL_0009: callvirt instance string assembly/C::g() + IL_000e: call string [runtime]System.String::Concat(string, + string) + IL_0013: ret + } + + .method assembly hidebysig instance string g() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld string assembly/C::x + IL_0006: ret + } + + } + + .class auto ansi serializable sealed nested assembly beforefieldinit g@13 + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 + { + .field static assembly initonly class assembly/g@13 @_instance + .method assembly specialname rtspecialname instance void .ctor() 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::.ctor() + IL_0006: ret + } + + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Core.Unit Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar0) cil managed + { + + .maxstack 8 + IL_0000: ldstr "Hello" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_000f: pop + IL_0010: ldstr "Hello" + IL_0015: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_001a: tail. + IL_001c: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0021: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 10 + IL_0000: newobj instance void assembly/g@13::.ctor() + IL_0005: stsfld class assembly/g@13 assembly/g@13::@_instance + IL_000a: ret + } + + } + + .method public static class [runtime]System.Tuple`2 f(!!a x) cil managed + { + + .maxstack 5 + .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 V_0) + IL_0000: ldsfld class assembly/g@13 assembly/g@13::@_instance + IL_0005: stloc.0 + IL_0006: ldloc.0 + IL_0007: ldnull + IL_0008: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_000d: ldloc.0 + IL_000e: ldnull + IL_000f: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0014: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, + !1) + IL_0019: 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/TestFunction23.fs.il.netcore.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction23.fs.RealInternalSignatureOff.OptimizeOff.il.netcore.bsl similarity index 87% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction23.fs.il.netcore.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction23.fs.RealInternalSignatureOff.OptimizeOff.il.netcore.bsl index 9f1ef581c16..3314328bdef 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction23.fs.il.netcore.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction23.fs.RealInternalSignatureOff.OptimizeOff.il.netcore.bsl @@ -1,183 +1,166 @@ - - - - - -.assembly extern runtime { } -.assembly extern FSharp.Core { } -.assembly extern runtime { } -.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 FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.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 nested public C - extends [runtime]System.Object - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) - .field assembly string x - .field assembly string x@8 - .method public specialname rtspecialname - instance void .ctor() cil managed - { - - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: callvirt instance void [runtime]System.Object::.ctor() - IL_0006: ldarg.0 - IL_0007: pop - IL_0008: ldarg.0 - IL_0009: call string [runtime]System.Console::ReadLine() - IL_000e: stfld string assembly/C::x - IL_0013: ldarg.0 - IL_0014: call string [runtime]System.Console::ReadLine() - IL_0019: stfld string assembly/C::x@8 - IL_001e: ret - } - - .method public hidebysig instance string - M() cil managed - { - - .maxstack 4 - .locals init (class assembly/C V_0) - IL_0000: ldarg.0 - IL_0001: stloc.0 - IL_0002: ldarg.0 - IL_0003: ldfld string assembly/C::x@8 - IL_0008: ldarg.0 - IL_0009: callvirt instance string assembly/C::g() - IL_000e: call string [runtime]System.String::Concat(string, - string) - IL_0013: ret - } - - .method assembly hidebysig instance string - g() cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: ldfld string assembly/C::x - IL_0006: ret - } - - } - - .class auto ansi serializable sealed nested assembly beforefieldinit g@13 - extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 - { - .field static assembly initonly class assembly/g@13 @_instance - .method assembly specialname rtspecialname - instance void .ctor() 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::.ctor() - IL_0006: ret - } - - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Core.Unit - Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar0) cil managed - { - - .maxstack 8 - IL_0000: ldstr "Hello" - IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) - IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) - IL_000f: pop - IL_0010: ldstr "Hello" - IL_0015: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) - IL_001a: tail. - IL_001c: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) - IL_0021: ret - } - - .method private specialname rtspecialname static - void .cctor() cil managed - { - - .maxstack 10 - IL_0000: newobj instance void assembly/g@13::.ctor() - IL_0005: stsfld class assembly/g@13 assembly/g@13::@_instance - IL_000a: ret - } - - } - - .method public static class [runtime]System.Tuple`2 - f(!!a x) cil managed - { - - .maxstack 5 - .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 V_0) - IL_0000: ldsfld class assembly/g@13 assembly/g@13::@_instance - IL_0005: stloc.0 - IL_0006: ldloc.0 - IL_0007: ldnull - IL_0008: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) - IL_000d: ldloc.0 - IL_000e: ldnull - IL_000f: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) - IL_0014: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, - !1) - IL_0019: 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 extern runtime { } +.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 +} +.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 nested public C + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) + .field assembly string x + .field assembly string x@8 + .method public specialname rtspecialname instance void .ctor() cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: callvirt instance void [runtime]System.Object::.ctor() + IL_0006: ldarg.0 + IL_0007: pop + IL_0008: ldarg.0 + IL_0009: call string [runtime]System.Console::ReadLine() + IL_000e: stfld string assembly/C::x + IL_0013: ldarg.0 + IL_0014: call string [runtime]System.Console::ReadLine() + IL_0019: stfld string assembly/C::x@8 + IL_001e: ret + } + + .method public hidebysig instance string M() cil managed + { + + .maxstack 4 + .locals init (class assembly/C V_0) + IL_0000: ldarg.0 + IL_0001: stloc.0 + IL_0002: ldarg.0 + IL_0003: ldfld string assembly/C::x@8 + IL_0008: ldarg.0 + IL_0009: callvirt instance string assembly/C::g() + IL_000e: call string [runtime]System.String::Concat(string, + string) + IL_0013: ret + } + + .method assembly hidebysig instance string g() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld string assembly/C::x + IL_0006: ret + } + + } + + .class auto ansi serializable sealed nested assembly beforefieldinit g@13 + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 + { + .field static assembly initonly class assembly/g@13 @_instance + .method assembly specialname rtspecialname instance void .ctor() 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::.ctor() + IL_0006: ret + } + + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Core.Unit Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar0) cil managed + { + + .maxstack 8 + IL_0000: ldstr "Hello" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_000f: pop + IL_0010: ldstr "Hello" + IL_0015: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_001a: tail. + IL_001c: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0021: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 10 + IL_0000: newobj instance void assembly/g@13::.ctor() + IL_0005: stsfld class assembly/g@13 assembly/g@13::@_instance + IL_000a: ret + } + + } + + .method public static class [runtime]System.Tuple`2 f(!!a x) cil managed + { + + .maxstack 5 + .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 V_0) + IL_0000: ldsfld class assembly/g@13 assembly/g@13::@_instance + IL_0005: stloc.0 + IL_0006: ldloc.0 + IL_0007: ldnull + IL_0008: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_000d: ldloc.0 + IL_000e: ldnull + IL_000f: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0014: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, + !1) + IL_0019: 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/TestFunction23.fs.RealInternalSignatureOff.OptimizeOn.il.net472.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction23.fs.RealInternalSignatureOff.OptimizeOn.il.net472.debug.bsl new file mode 100644 index 00000000000..87912f0102a --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction23.fs.RealInternalSignatureOff.OptimizeOn.il.net472.debug.bsl @@ -0,0 +1,126 @@ + + + + + +.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 +} +.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 nested public C + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) + .field assembly string x + .field assembly string x@8 + .method public specialname rtspecialname instance void .ctor() cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: callvirt instance void [runtime]System.Object::.ctor() + IL_0006: ldarg.0 + IL_0007: pop + IL_0008: ldarg.0 + IL_0009: call string [runtime]System.Console::ReadLine() + IL_000e: stfld string assembly/C::x + IL_0013: ldarg.0 + IL_0014: call string [runtime]System.Console::ReadLine() + IL_0019: stfld string assembly/C::x@8 + IL_001e: ret + } + + .method public hidebysig instance string M() cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld string assembly/C::x@8 + IL_0006: ldarg.0 + IL_0007: callvirt instance string assembly/C::g() + IL_000c: call string [runtime]System.String::Concat(string, + string) + IL_0011: ret + } + + .method assembly hidebysig instance string g() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld string assembly/C::x + IL_0006: ret + } + + } + + .method public static class [runtime]System.Tuple`2 f(!!a x) cil managed + { + + .maxstack 4 + IL_0000: ldstr "Hello" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_000f: pop + IL_0010: ldstr "Hello" + IL_0015: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_001a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_001f: ldstr "Hello" + IL_0024: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_0029: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_002e: pop + IL_002f: ldstr "Hello" + IL_0034: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_0039: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_003e: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, + !1) + IL_0043: 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/TestFunction23.fs.RealInternalSignatureOff.OptimizeOn.il.net472.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction23.fs.RealInternalSignatureOff.OptimizeOn.il.net472.release.bsl new file mode 100644 index 00000000000..e9cb7d80f37 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction23.fs.RealInternalSignatureOff.OptimizeOn.il.net472.release.bsl @@ -0,0 +1,149 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly extern netstandard +{ + .publickeytoken = (CC 7B 13 FF CD 2D DD 51 ) + .ver 2:1:0:0 +} +.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 +} +.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 nested public C + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) + .field assembly string x + .field assembly string x@8 + .method public specialname rtspecialname instance void .ctor() cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: callvirt instance void [runtime]System.Object::.ctor() + IL_0006: ldarg.0 + IL_0007: pop + IL_0008: ldarg.0 + IL_0009: call string [runtime]System.Console::ReadLine() + IL_000e: stfld string assembly/C::x + IL_0013: ldarg.0 + IL_0014: call string [runtime]System.Console::ReadLine() + IL_0019: stfld string assembly/C::x@8 + IL_001e: ret + } + + .method public hidebysig instance string M() cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld string assembly/C::x@8 + IL_0006: ldarg.0 + IL_0007: callvirt instance string assembly/C::g() + IL_000c: call string [runtime]System.String::Concat(string, + string) + IL_0011: ret + } + + .method assembly hidebysig instance string g() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld string assembly/C::x + IL_0006: ret + } + + } + + .method assembly static void g@12(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar0) cil managed + { + + .maxstack 4 + .locals init (class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4 V_0) + IL_0000: ldstr "Hello" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_000a: stloc.0 + IL_000b: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() + IL_0010: ldloc.0 + IL_0011: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter(class [runtime]System.IO.TextWriter, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0016: pop + IL_0017: ldstr "Hello" + IL_001c: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_0021: stloc.0 + IL_0022: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() + IL_0027: ldloc.0 + IL_0028: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter(class [runtime]System.IO.TextWriter, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_002d: pop + IL_002e: ret + } + + .method public static class [runtime]System.Tuple`2 f(!!a x) cil managed + { + + .maxstack 8 + IL_0000: ldnull + IL_0001: call void assembly::g@12(class [FSharp.Core]Microsoft.FSharp.Core.Unit) + IL_0006: nop + IL_0007: ldnull + IL_0008: ldnull + IL_0009: call void assembly::g@12(class [FSharp.Core]Microsoft.FSharp.Core.Unit) + IL_000e: nop + IL_000f: ldnull + IL_0010: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, + !1) + IL_0015: 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/TestFunction23.fs.RealInternalSignatureOff.OptimizeOn.il.netcore.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction23.fs.RealInternalSignatureOff.OptimizeOn.il.netcore.debug.bsl new file mode 100644 index 00000000000..245ae20eb9b --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction23.fs.RealInternalSignatureOff.OptimizeOn.il.netcore.debug.bsl @@ -0,0 +1,127 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly extern runtime { } +.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 +} +.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 nested public C + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) + .field assembly string x + .field assembly string x@8 + .method public specialname rtspecialname instance void .ctor() cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: callvirt instance void [runtime]System.Object::.ctor() + IL_0006: ldarg.0 + IL_0007: pop + IL_0008: ldarg.0 + IL_0009: call string [runtime]System.Console::ReadLine() + IL_000e: stfld string assembly/C::x + IL_0013: ldarg.0 + IL_0014: call string [runtime]System.Console::ReadLine() + IL_0019: stfld string assembly/C::x@8 + IL_001e: ret + } + + .method public hidebysig instance string M() cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld string assembly/C::x@8 + IL_0006: ldarg.0 + IL_0007: callvirt instance string assembly/C::g() + IL_000c: call string [runtime]System.String::Concat(string, + string) + IL_0011: ret + } + + .method assembly hidebysig instance string g() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld string assembly/C::x + IL_0006: ret + } + + } + + .method public static class [runtime]System.Tuple`2 f(!!a x) cil managed + { + + .maxstack 4 + IL_0000: ldstr "Hello" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_000f: pop + IL_0010: ldstr "Hello" + IL_0015: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_001a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_001f: ldstr "Hello" + IL_0024: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_0029: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_002e: pop + IL_002f: ldstr "Hello" + IL_0034: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_0039: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_003e: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, + !1) + IL_0043: 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/TestFunction23.fs.RealInternalSignatureOff.OptimizeOn.il.netcore.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction23.fs.RealInternalSignatureOff.OptimizeOn.il.netcore.release.bsl new file mode 100644 index 00000000000..c3d7168eab9 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction23.fs.RealInternalSignatureOff.OptimizeOn.il.netcore.release.bsl @@ -0,0 +1,150 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly extern netstandard +{ + .publickeytoken = (CC 7B 13 FF CD 2D DD 51 ) + .ver 2:1:0:0 +} +.assembly extern runtime { } +.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 +} +.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 nested public C + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) + .field assembly string x + .field assembly string x@8 + .method public specialname rtspecialname instance void .ctor() cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: callvirt instance void [runtime]System.Object::.ctor() + IL_0006: ldarg.0 + IL_0007: pop + IL_0008: ldarg.0 + IL_0009: call string [runtime]System.Console::ReadLine() + IL_000e: stfld string assembly/C::x + IL_0013: ldarg.0 + IL_0014: call string [runtime]System.Console::ReadLine() + IL_0019: stfld string assembly/C::x@8 + IL_001e: ret + } + + .method public hidebysig instance string M() cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld string assembly/C::x@8 + IL_0006: ldarg.0 + IL_0007: callvirt instance string assembly/C::g() + IL_000c: call string [runtime]System.String::Concat(string, + string) + IL_0011: ret + } + + .method assembly hidebysig instance string g() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld string assembly/C::x + IL_0006: ret + } + + } + + .method assembly static void g@12(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar0) cil managed + { + + .maxstack 4 + .locals init (class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4 V_0) + IL_0000: ldstr "Hello" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_000a: stloc.0 + IL_000b: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() + IL_0010: ldloc.0 + IL_0011: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter(class [runtime]System.IO.TextWriter, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0016: pop + IL_0017: ldstr "Hello" + IL_001c: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_0021: stloc.0 + IL_0022: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() + IL_0027: ldloc.0 + IL_0028: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter(class [runtime]System.IO.TextWriter, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_002d: pop + IL_002e: ret + } + + .method public static class [runtime]System.Tuple`2 f(!!a x) cil managed + { + + .maxstack 8 + IL_0000: ldnull + IL_0001: call void assembly::g@12(class [FSharp.Core]Microsoft.FSharp.Core.Unit) + IL_0006: nop + IL_0007: ldnull + IL_0008: ldnull + IL_0009: call void assembly::g@12(class [FSharp.Core]Microsoft.FSharp.Core.Unit) + IL_000e: nop + IL_000f: ldnull + IL_0010: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, + !1) + IL_0015: 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/TestFunction23.fs.RealInternalSignatureOn.OptimizeOff.il.net472.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction23.fs.RealInternalSignatureOn.OptimizeOff.il.net472.bsl new file mode 100644 index 00000000000..879f6b4e90f --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction23.fs.RealInternalSignatureOn.OptimizeOff.il.net472.bsl @@ -0,0 +1,165 @@ + + + + + +.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 +} +.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 nested public C + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) + .field assembly string x + .field assembly string x@8 + .method public specialname rtspecialname instance void .ctor() cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: callvirt instance void [runtime]System.Object::.ctor() + IL_0006: ldarg.0 + IL_0007: pop + IL_0008: ldarg.0 + IL_0009: call string [runtime]System.Console::ReadLine() + IL_000e: stfld string assembly/C::x + IL_0013: ldarg.0 + IL_0014: call string [runtime]System.Console::ReadLine() + IL_0019: stfld string assembly/C::x@8 + IL_001e: ret + } + + .method public hidebysig instance string M() cil managed + { + + .maxstack 4 + .locals init (class assembly/C V_0) + IL_0000: ldarg.0 + IL_0001: stloc.0 + IL_0002: ldarg.0 + IL_0003: ldfld string assembly/C::x@8 + IL_0008: ldarg.0 + IL_0009: callvirt instance string assembly/C::g() + IL_000e: call string [runtime]System.String::Concat(string, + string) + IL_0013: ret + } + + .method assembly hidebysig instance string g() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld string assembly/C::x + IL_0006: ret + } + + } + + .class auto ansi serializable sealed nested assembly beforefieldinit g@13 + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 + { + .field static assembly initonly class assembly/g@13 @_instance + .method assembly specialname rtspecialname instance void .ctor() 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::.ctor() + IL_0006: ret + } + + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Core.Unit Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar0) cil managed + { + + .maxstack 8 + IL_0000: ldstr "Hello" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_000f: pop + IL_0010: ldstr "Hello" + IL_0015: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_001a: tail. + IL_001c: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0021: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 10 + IL_0000: newobj instance void assembly/g@13::.ctor() + IL_0005: stsfld class assembly/g@13 assembly/g@13::@_instance + IL_000a: ret + } + + } + + .method public static class [runtime]System.Tuple`2 f(!!a x) cil managed + { + + .maxstack 5 + .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 V_0) + IL_0000: ldsfld class assembly/g@13 assembly/g@13::@_instance + IL_0005: stloc.0 + IL_0006: ldloc.0 + IL_0007: ldnull + IL_0008: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_000d: ldloc.0 + IL_000e: ldnull + IL_000f: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0014: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, + !1) + IL_0019: 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/TestFunction23.fs.RealInternalSignatureOn.OptimizeOff.il.netcore.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction23.fs.RealInternalSignatureOn.OptimizeOff.il.netcore.bsl new file mode 100644 index 00000000000..3314328bdef --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction23.fs.RealInternalSignatureOn.OptimizeOff.il.netcore.bsl @@ -0,0 +1,166 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly extern runtime { } +.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 +} +.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 nested public C + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) + .field assembly string x + .field assembly string x@8 + .method public specialname rtspecialname instance void .ctor() cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: callvirt instance void [runtime]System.Object::.ctor() + IL_0006: ldarg.0 + IL_0007: pop + IL_0008: ldarg.0 + IL_0009: call string [runtime]System.Console::ReadLine() + IL_000e: stfld string assembly/C::x + IL_0013: ldarg.0 + IL_0014: call string [runtime]System.Console::ReadLine() + IL_0019: stfld string assembly/C::x@8 + IL_001e: ret + } + + .method public hidebysig instance string M() cil managed + { + + .maxstack 4 + .locals init (class assembly/C V_0) + IL_0000: ldarg.0 + IL_0001: stloc.0 + IL_0002: ldarg.0 + IL_0003: ldfld string assembly/C::x@8 + IL_0008: ldarg.0 + IL_0009: callvirt instance string assembly/C::g() + IL_000e: call string [runtime]System.String::Concat(string, + string) + IL_0013: ret + } + + .method assembly hidebysig instance string g() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld string assembly/C::x + IL_0006: ret + } + + } + + .class auto ansi serializable sealed nested assembly beforefieldinit g@13 + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 + { + .field static assembly initonly class assembly/g@13 @_instance + .method assembly specialname rtspecialname instance void .ctor() 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::.ctor() + IL_0006: ret + } + + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Core.Unit Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar0) cil managed + { + + .maxstack 8 + IL_0000: ldstr "Hello" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_000f: pop + IL_0010: ldstr "Hello" + IL_0015: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_001a: tail. + IL_001c: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0021: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 10 + IL_0000: newobj instance void assembly/g@13::.ctor() + IL_0005: stsfld class assembly/g@13 assembly/g@13::@_instance + IL_000a: ret + } + + } + + .method public static class [runtime]System.Tuple`2 f(!!a x) cil managed + { + + .maxstack 5 + .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 V_0) + IL_0000: ldsfld class assembly/g@13 assembly/g@13::@_instance + IL_0005: stloc.0 + IL_0006: ldloc.0 + IL_0007: ldnull + IL_0008: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_000d: ldloc.0 + IL_000e: ldnull + IL_000f: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0014: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, + !1) + IL_0019: 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/TestFunction23.fs.RealInternalSignatureOn.OptimizeOn.il.net472.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction23.fs.RealInternalSignatureOn.OptimizeOn.il.net472.debug.bsl new file mode 100644 index 00000000000..87912f0102a --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction23.fs.RealInternalSignatureOn.OptimizeOn.il.net472.debug.bsl @@ -0,0 +1,126 @@ + + + + + +.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 +} +.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 nested public C + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) + .field assembly string x + .field assembly string x@8 + .method public specialname rtspecialname instance void .ctor() cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: callvirt instance void [runtime]System.Object::.ctor() + IL_0006: ldarg.0 + IL_0007: pop + IL_0008: ldarg.0 + IL_0009: call string [runtime]System.Console::ReadLine() + IL_000e: stfld string assembly/C::x + IL_0013: ldarg.0 + IL_0014: call string [runtime]System.Console::ReadLine() + IL_0019: stfld string assembly/C::x@8 + IL_001e: ret + } + + .method public hidebysig instance string M() cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld string assembly/C::x@8 + IL_0006: ldarg.0 + IL_0007: callvirt instance string assembly/C::g() + IL_000c: call string [runtime]System.String::Concat(string, + string) + IL_0011: ret + } + + .method assembly hidebysig instance string g() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld string assembly/C::x + IL_0006: ret + } + + } + + .method public static class [runtime]System.Tuple`2 f(!!a x) cil managed + { + + .maxstack 4 + IL_0000: ldstr "Hello" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_000f: pop + IL_0010: ldstr "Hello" + IL_0015: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_001a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_001f: ldstr "Hello" + IL_0024: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_0029: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_002e: pop + IL_002f: ldstr "Hello" + IL_0034: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_0039: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_003e: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, + !1) + IL_0043: 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/TestFunction23.fs.RealInternalSignatureOn.OptimizeOn.il.net472.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction23.fs.RealInternalSignatureOn.OptimizeOn.il.net472.release.bsl new file mode 100644 index 00000000000..f4f126bbc5b --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction23.fs.RealInternalSignatureOn.OptimizeOn.il.net472.release.bsl @@ -0,0 +1,176 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly extern netstandard +{ + .publickeytoken = (CC 7B 13 FF CD 2D DD 51 ) + .ver 2:1:0:0 +} +.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 +} +.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 nested public C + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) + .field assembly string x + .field assembly string x@8 + .method public specialname rtspecialname instance void .ctor() cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: callvirt instance void [runtime]System.Object::.ctor() + IL_0006: ldarg.0 + IL_0007: pop + IL_0008: ldarg.0 + IL_0009: call string [runtime]System.Console::ReadLine() + IL_000e: stfld string assembly/C::x + IL_0013: ldarg.0 + IL_0014: call string [runtime]System.Console::ReadLine() + IL_0019: stfld string assembly/C::x@8 + IL_001e: ret + } + + .method public hidebysig instance string M() cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld string assembly/C::x@8 + IL_0006: ldarg.0 + IL_0007: callvirt instance string assembly/C::g() + IL_000c: call string [runtime]System.String::Concat(string, + string) + IL_0011: ret + } + + .method assembly hidebysig instance string g() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld string assembly/C::x + IL_0006: ret + } + + } + + .class auto ansi serializable sealed nested assembly beforefieldinit g@13 + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 + { + .field static assembly initonly class assembly/g@13 @_instance + .method assembly specialname rtspecialname instance void .ctor() 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::.ctor() + IL_0006: ret + } + + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Core.Unit Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar0) cil managed + { + + .maxstack 6 + .locals init (class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4 V_0) + IL_0000: ldstr "Hello" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_000a: stloc.0 + IL_000b: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() + IL_0010: ldloc.0 + IL_0011: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter(class [runtime]System.IO.TextWriter, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0016: pop + IL_0017: ldstr "Hello" + IL_001c: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_0021: stloc.0 + IL_0022: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() + IL_0027: ldloc.0 + IL_0028: tail. + IL_002a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter(class [runtime]System.IO.TextWriter, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_002f: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 10 + IL_0000: newobj instance void assembly/g@13::.ctor() + IL_0005: stsfld class assembly/g@13 assembly/g@13::@_instance + IL_000a: ret + } + + } + + .method public static class [runtime]System.Tuple`2 f(!!a x) cil managed + { + + .maxstack 5 + .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 V_0) + IL_0000: ldsfld class assembly/g@13 assembly/g@13::@_instance + IL_0005: stloc.0 + IL_0006: ldloc.0 + IL_0007: ldnull + IL_0008: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_000d: ldloc.0 + IL_000e: ldnull + IL_000f: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0014: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, + !1) + IL_0019: 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/TestFunction23.fs.RealInternalSignatureOn.OptimizeOn.il.netcore.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction23.fs.RealInternalSignatureOn.OptimizeOn.il.netcore.debug.bsl new file mode 100644 index 00000000000..245ae20eb9b --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction23.fs.RealInternalSignatureOn.OptimizeOn.il.netcore.debug.bsl @@ -0,0 +1,127 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly extern runtime { } +.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 +} +.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 nested public C + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) + .field assembly string x + .field assembly string x@8 + .method public specialname rtspecialname instance void .ctor() cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: callvirt instance void [runtime]System.Object::.ctor() + IL_0006: ldarg.0 + IL_0007: pop + IL_0008: ldarg.0 + IL_0009: call string [runtime]System.Console::ReadLine() + IL_000e: stfld string assembly/C::x + IL_0013: ldarg.0 + IL_0014: call string [runtime]System.Console::ReadLine() + IL_0019: stfld string assembly/C::x@8 + IL_001e: ret + } + + .method public hidebysig instance string M() cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld string assembly/C::x@8 + IL_0006: ldarg.0 + IL_0007: callvirt instance string assembly/C::g() + IL_000c: call string [runtime]System.String::Concat(string, + string) + IL_0011: ret + } + + .method assembly hidebysig instance string g() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld string assembly/C::x + IL_0006: ret + } + + } + + .method public static class [runtime]System.Tuple`2 f(!!a x) cil managed + { + + .maxstack 4 + IL_0000: ldstr "Hello" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_000f: pop + IL_0010: ldstr "Hello" + IL_0015: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_001a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_001f: ldstr "Hello" + IL_0024: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_0029: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_002e: pop + IL_002f: ldstr "Hello" + IL_0034: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_0039: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_003e: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, + !1) + IL_0043: 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/TestFunction23.fs.RealInternalSignatureOn.OptimizeOn.il.netcore.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction23.fs.RealInternalSignatureOn.OptimizeOn.il.netcore.release.bsl new file mode 100644 index 00000000000..422674eeb50 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction23.fs.RealInternalSignatureOn.OptimizeOn.il.netcore.release.bsl @@ -0,0 +1,177 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly extern runtime { } +.assembly extern netstandard +{ + .publickeytoken = (CC 7B 13 FF CD 2D DD 51 ) + .ver 2:1:0:0 +} +.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 +} +.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 nested public C + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) + .field assembly string x + .field assembly string x@8 + .method public specialname rtspecialname instance void .ctor() cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: callvirt instance void [runtime]System.Object::.ctor() + IL_0006: ldarg.0 + IL_0007: pop + IL_0008: ldarg.0 + IL_0009: call string [runtime]System.Console::ReadLine() + IL_000e: stfld string assembly/C::x + IL_0013: ldarg.0 + IL_0014: call string [runtime]System.Console::ReadLine() + IL_0019: stfld string assembly/C::x@8 + IL_001e: ret + } + + .method public hidebysig instance string M() cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld string assembly/C::x@8 + IL_0006: ldarg.0 + IL_0007: callvirt instance string assembly/C::g() + IL_000c: call string [runtime]System.String::Concat(string, + string) + IL_0011: ret + } + + .method assembly hidebysig instance string g() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld string assembly/C::x + IL_0006: ret + } + + } + + .class auto ansi serializable sealed nested assembly beforefieldinit g@13 + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 + { + .field static assembly initonly class assembly/g@13 @_instance + .method assembly specialname rtspecialname instance void .ctor() 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::.ctor() + IL_0006: ret + } + + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Core.Unit Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar0) cil managed + { + + .maxstack 6 + .locals init (class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4 V_0) + IL_0000: ldstr "Hello" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_000a: stloc.0 + IL_000b: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() + IL_0010: ldloc.0 + IL_0011: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter(class [runtime]System.IO.TextWriter, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0016: pop + IL_0017: ldstr "Hello" + IL_001c: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_0021: stloc.0 + IL_0022: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() + IL_0027: ldloc.0 + IL_0028: tail. + IL_002a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter(class [runtime]System.IO.TextWriter, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_002f: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 10 + IL_0000: newobj instance void assembly/g@13::.ctor() + IL_0005: stsfld class assembly/g@13 assembly/g@13::@_instance + IL_000a: ret + } + + } + + .method public static class [runtime]System.Tuple`2 f(!!a x) cil managed + { + + .maxstack 5 + .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 V_0) + IL_0000: ldsfld class assembly/g@13 assembly/g@13::@_instance + IL_0005: stloc.0 + IL_0006: ldloc.0 + IL_0007: ldnull + IL_0008: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_000d: ldloc.0 + IL_000e: ldnull + IL_000f: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0014: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, + !1) + IL_0019: 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.RealInternalSignatureOff.OptimizeOff.il.net472.debug.bsl similarity index 97% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.net472.debug.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOff.OptimizeOff.il.net472.debug.bsl index d7f985f6888..7852e2509a4 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.net472.debug.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOff.OptimizeOff.il.net472.debug.bsl @@ -16,16 +16,6 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 -} -.mresource public FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - } .module assembly.exe @@ -104,9 +94,7 @@ IL_0007: ret } - .method public specialname rtspecialname - instance void .ctor(int32 x, - int32 y) cil managed + .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 @@ -245,9 +233,7 @@ IL_000c: ret } - .method public hidebysig virtual final - instance int32 CompareTo(object obj, - class [runtime]System.Collections.IComparer comp) cil managed + .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 ) @@ -425,9 +411,7 @@ IL_000b: ret } - .method public hidebysig instance bool - Equals(class assembly/Point obj, - class [runtime]System.Collections.IEqualityComparer comp) cil managed + .method public hidebysig instance bool Equals(class assembly/Point obj, class [runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) @@ -493,9 +477,7 @@ IL_004a: ret } - .method public hidebysig virtual final - instance bool Equals(object obj, - class [runtime]System.Collections.IEqualityComparer comp) cil managed + .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 ) @@ -981,9 +963,7 @@ .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 + .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 ) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.net472.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOff.OptimizeOff.il.net472.release.bsl similarity index 96% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.net472.release.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOff.OptimizeOff.il.net472.release.bsl index 2e425f74278..ab7bca6340a 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.net472.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOff.OptimizeOff.il.net472.release.bsl @@ -16,16 +16,6 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 -} -.mresource public FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - } .module assembly.exe @@ -104,9 +94,7 @@ IL_0007: ret } - .method public specialname rtspecialname - instance void .ctor(int32 x, - int32 y) cil managed + .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 @@ -227,9 +215,7 @@ IL_000c: ret } - .method public hidebysig virtual final - instance int32 CompareTo(object obj, - class [runtime]System.Collections.IComparer comp) cil managed + .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 ) @@ -377,9 +363,7 @@ IL_000b: ret } - .method public hidebysig instance bool - Equals(class assembly/Point obj, - class [runtime]System.Collections.IEqualityComparer comp) cil managed + .method public hidebysig instance bool Equals(class assembly/Point obj, class [runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) @@ -427,9 +411,7 @@ IL_0036: ret } - .method public hidebysig virtual final - instance bool Equals(object obj, - class [runtime]System.Collections.IEqualityComparer comp) cil managed + .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 ) @@ -867,9 +849,7 @@ .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 + .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 ) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.netcore.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOff.OptimizeOff.il.netcore.debug.bsl similarity index 97% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.netcore.debug.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOff.OptimizeOff.il.netcore.debug.bsl index 8de09a8c9d9..bda000c5fe3 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.netcore.debug.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOff.OptimizeOff.il.netcore.debug.bsl @@ -16,16 +16,6 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 -} -.mresource public FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - } .module assembly.exe @@ -104,9 +94,7 @@ IL_0007: ret } - .method public specialname rtspecialname - instance void .ctor(int32 x, - int32 y) cil managed + .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 @@ -245,9 +233,7 @@ IL_000c: ret } - .method public hidebysig virtual final - instance int32 CompareTo(object obj, - class [runtime]System.Collections.IComparer comp) cil managed + .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 ) @@ -425,9 +411,7 @@ IL_000b: ret } - .method public hidebysig instance bool - Equals(class assembly/Point obj, - class [runtime]System.Collections.IEqualityComparer comp) cil managed + .method public hidebysig instance bool Equals(class assembly/Point obj, class [runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) @@ -493,9 +477,7 @@ IL_004a: ret } - .method public hidebysig virtual final - instance bool Equals(object obj, - class [runtime]System.Collections.IEqualityComparer comp) cil managed + .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 ) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.netcore.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOff.OptimizeOff.il.netcore.release.bsl similarity index 96% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.netcore.release.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOff.OptimizeOff.il.netcore.release.bsl index 896ab224ac8..d0244dfedf7 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.il.netcore.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOff.OptimizeOff.il.netcore.release.bsl @@ -16,16 +16,6 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 -} -.mresource public FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - } .module assembly.exe @@ -104,9 +94,7 @@ IL_0007: ret } - .method public specialname rtspecialname - instance void .ctor(int32 x, - int32 y) cil managed + .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 @@ -227,9 +215,7 @@ IL_000c: ret } - .method public hidebysig virtual final - instance int32 CompareTo(object obj, - class [runtime]System.Collections.IComparer comp) cil managed + .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 ) @@ -377,9 +363,7 @@ IL_000b: ret } - .method public hidebysig instance bool - Equals(class assembly/Point obj, - class [runtime]System.Collections.IEqualityComparer comp) cil managed + .method public hidebysig instance bool Equals(class assembly/Point obj, class [runtime]System.Collections.IEqualityComparer comp) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) @@ -427,9 +411,7 @@ IL_0036: ret } - .method public hidebysig virtual final - instance bool Equals(object obj, - class [runtime]System.Collections.IEqualityComparer comp) cil managed + .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 ) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOff.OptimizeOn.il.net472.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOff.OptimizeOn.il.net472.debug.bsl new file mode 100644 index 00000000000..5ce65a01960 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOff.OptimizeOn.il.net472.debug.bsl @@ -0,0 +1,821 @@ + + + + + +.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 +} +.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) + 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/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.1 + IL_0036: ldarg.0 + IL_0037: ldfld int32 assembly/Point::y@ + IL_003c: stloc.2 + IL_003d: ldarg.1 + IL_003e: ldfld int32 assembly/Point::y@ + 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/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, + int32 V_1, + int32 V_2, + int32 V_3) + IL_0000: ldarg.1 + IL_0001: unbox.any assembly/Point + IL_0006: stloc.0 + IL_0007: ldarg.0 + IL_0008: brfalse.s IL_0050 + + IL_000a: ldarg.1 + IL_000b: unbox.any assembly/Point + IL_0010: brfalse.s IL_004e + + IL_0012: ldarg.0 + IL_0013: ldfld int32 assembly/Point::x@ + IL_0018: stloc.2 + IL_0019: ldloc.0 + IL_001a: ldfld int32 assembly/Point::x@ + 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/Point::y@ + IL_003c: stloc.2 + IL_003d: ldloc.0 + IL_003e: ldfld int32 assembly/Point::y@ + 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/Point + 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/Point::y@ + 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/Point::x@ + 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/Point::GetHashCode(class [runtime]System.Collections.IEqualityComparer) + IL_000b: ret + } + + .method public hidebysig instance bool Equals(class assembly/Point 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: 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, class [runtime]System.Collections.IEqualityComparer 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) + IL_0000: ldarg.1 + IL_0001: isinst assembly/Point + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: brfalse.s IL_0013 + + IL_000a: ldarg.0 + IL_000b: ldloc.0 + IL_000c: ldarg.2 + IL_000d: callvirt instance bool assembly/Point::Equals(class assembly/Point, + class [runtime]System.Collections.IEqualityComparer) + IL_0012: ret + + IL_0013: ldc.i4.0 + IL_0014: 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) + 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: ldc.i4.0 + IL_0014: conv.i + IL_0015: sizeof [runtime]System.Int32 + IL_001b: mul + IL_001c: add + IL_001d: ldobj [runtime]System.Int32 + IL_0022: ldloc.1 + IL_0023: ldc.i4.1 + IL_0024: conv.i + IL_0025: sizeof [runtime]System.Int32 + IL_002b: mul + IL_002c: add + IL_002d: ldobj [runtime]System.Int32 + IL_0032: add + IL_0033: 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& pinned V_2) + 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: nop + IL_0068: ldloc.0 + IL_0069: brfalse.s IL_0085 + + IL_006b: ldloc.0 + IL_006c: call int32 [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Length(!!0[]) + IL_0071: brfalse.s IL_0080 + + IL_0073: ldloc.0 + IL_0074: ldc.i4.0 + IL_0075: ldelema [runtime]System.Double + IL_007a: stloc.2 + IL_007b: ldloc.2 + IL_007c: conv.i + IL_007d: nop + IL_007e: br.s IL_0088 + + IL_0080: ldc.i4.0 + IL_0081: conv.i + IL_0082: nop + IL_0083: br.s IL_0088 + + IL_0085: ldc.i4.0 + IL_0086: conv.i + IL_0087: nop + IL_0088: stloc.1 + IL_0089: ldloc.1 + IL_008a: ldc.i4.0 + IL_008b: conv.i + IL_008c: sizeof [runtime]System.Double + IL_0092: mul + IL_0093: add + IL_0094: ldobj [runtime]System.Double + IL_0099: ldloc.1 + IL_009a: ldc.i4.1 + IL_009b: conv.i + IL_009c: sizeof [runtime]System.Double + IL_00a2: mul + IL_00a3: add + IL_00a4: ldobj [runtime]System.Double + IL_00a9: add + IL_00aa: ret + } + + .method public static float64 pinArray2() cil managed + { + + .maxstack 6 + .locals init (float64[] V_0, + native int V_1, + float64& pinned V_2) + 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: ldc.i4.0 + IL_0074: conv.i + IL_0075: sizeof [runtime]System.Double + IL_007b: mul + IL_007c: add + IL_007d: ldobj [runtime]System.Double + IL_0082: ldloc.1 + IL_0083: ldc.i4.1 + IL_0084: conv.i + IL_0085: sizeof [runtime]System.Double + IL_008b: mul + IL_008c: add + IL_008d: ldobj [runtime]System.Double + IL_0092: add + IL_0093: ret + } + + .method public static class [runtime]System.Tuple`2 pinString() cil managed + { + + .maxstack 6 + .locals init (native int V_0, + string pinned V_1) + IL_0000: nop + IL_0001: ldstr "Hello World" + IL_0006: stloc.1 + IL_0007: ldstr "Hello World" + IL_000c: conv.i + IL_000d: call int32 [runtime]System.Runtime.CompilerServices.RuntimeHelpers::get_OffsetToStringData() + IL_0012: add + IL_0013: stloc.0 + IL_0014: ldloc.0 + IL_0015: ldc.i4.0 + IL_0016: conv.i + IL_0017: sizeof [runtime]System.Char + IL_001d: mul + IL_001e: add + IL_001f: ldobj [runtime]System.Char + IL_0024: ldloc.0 + IL_0025: ldc.i4.1 + IL_0026: conv.i + IL_0027: sizeof [runtime]System.Char + IL_002d: mul + IL_002e: add + IL_002f: ldobj [runtime]System.Char + IL_0034: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, + !1) + IL_0039: 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 serializable 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__ + .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 +{ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .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 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 + } + + .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 ) + .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 ) + .get instance class [runtime]System.Type System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::get_Type() + } +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOff.OptimizeOn.il.net472.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOff.OptimizeOn.il.net472.release.bsl new file mode 100644 index 00000000000..9b4153c5532 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOff.OptimizeOn.il.net472.release.bsl @@ -0,0 +1,821 @@ + + + + + +.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 +} +.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) + 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/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.1 + IL_0036: ldarg.0 + IL_0037: ldfld int32 assembly/Point::y@ + IL_003c: stloc.2 + IL_003d: ldarg.1 + IL_003e: ldfld int32 assembly/Point::y@ + 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/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, + int32 V_1, + int32 V_2, + int32 V_3) + IL_0000: ldarg.1 + IL_0001: unbox.any assembly/Point + IL_0006: stloc.0 + IL_0007: ldarg.0 + IL_0008: brfalse.s IL_0050 + + IL_000a: ldarg.1 + IL_000b: unbox.any assembly/Point + IL_0010: brfalse.s IL_004e + + IL_0012: ldarg.0 + IL_0013: ldfld int32 assembly/Point::x@ + IL_0018: stloc.2 + IL_0019: ldloc.0 + IL_001a: ldfld int32 assembly/Point::x@ + 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/Point::y@ + IL_003c: stloc.2 + IL_003d: ldloc.0 + IL_003e: ldfld int32 assembly/Point::y@ + 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/Point + 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/Point::y@ + 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/Point::x@ + 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/Point::GetHashCode(class [runtime]System.Collections.IEqualityComparer) + IL_000b: ret + } + + .method public hidebysig instance bool Equals(class assembly/Point 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: 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, class [runtime]System.Collections.IEqualityComparer 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) + IL_0000: ldarg.1 + IL_0001: isinst assembly/Point + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: brfalse.s IL_0013 + + IL_000a: ldarg.0 + IL_000b: ldloc.0 + IL_000c: ldarg.2 + IL_000d: callvirt instance bool assembly/Point::Equals(class assembly/Point, + class [runtime]System.Collections.IEqualityComparer) + IL_0012: ret + + IL_0013: ldc.i4.0 + IL_0014: 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) + 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: ldc.i4.0 + IL_0014: conv.i + IL_0015: sizeof [runtime]System.Int32 + IL_001b: mul + IL_001c: add + IL_001d: ldobj [runtime]System.Int32 + IL_0022: ldloc.1 + IL_0023: ldc.i4.1 + IL_0024: conv.i + IL_0025: sizeof [runtime]System.Int32 + IL_002b: mul + IL_002c: add + IL_002d: ldobj [runtime]System.Int32 + IL_0032: add + IL_0033: 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: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1::.ctor(!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& pinned V_2) + 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: nop + IL_0068: ldloc.0 + IL_0069: brfalse.s IL_0085 + + IL_006b: ldloc.0 + IL_006c: call int32 [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Length(!!0[]) + IL_0071: brfalse.s IL_0080 + + IL_0073: ldloc.0 + IL_0074: ldc.i4.0 + IL_0075: ldelema [runtime]System.Double + IL_007a: stloc.2 + IL_007b: ldloc.2 + IL_007c: conv.i + IL_007d: nop + IL_007e: br.s IL_0088 + + IL_0080: ldc.i4.0 + IL_0081: conv.i + IL_0082: nop + IL_0083: br.s IL_0088 + + IL_0085: ldc.i4.0 + IL_0086: conv.i + IL_0087: nop + IL_0088: stloc.1 + IL_0089: ldloc.1 + IL_008a: ldc.i4.0 + IL_008b: conv.i + IL_008c: sizeof [runtime]System.Double + IL_0092: mul + IL_0093: add + IL_0094: ldobj [runtime]System.Double + IL_0099: ldloc.1 + IL_009a: ldc.i4.1 + IL_009b: conv.i + IL_009c: sizeof [runtime]System.Double + IL_00a2: mul + IL_00a3: add + IL_00a4: ldobj [runtime]System.Double + IL_00a9: add + IL_00aa: ret + } + + .method public static float64 pinArray2() cil managed + { + + .maxstack 6 + .locals init (float64[] V_0, + native int V_1, + float64& pinned V_2) + 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: ldc.i4.0 + IL_0074: conv.i + IL_0075: sizeof [runtime]System.Double + IL_007b: mul + IL_007c: add + IL_007d: ldobj [runtime]System.Double + IL_0082: ldloc.1 + IL_0083: ldc.i4.1 + IL_0084: conv.i + IL_0085: sizeof [runtime]System.Double + IL_008b: mul + IL_008c: add + IL_008d: ldobj [runtime]System.Double + IL_0092: add + IL_0093: ret + } + + .method public static class [runtime]System.Tuple`2 pinString() cil managed + { + + .maxstack 6 + .locals init (native int V_0, + string pinned V_1) + IL_0000: nop + IL_0001: ldstr "Hello World" + IL_0006: stloc.1 + IL_0007: ldstr "Hello World" + IL_000c: conv.i + IL_000d: call int32 [runtime]System.Runtime.CompilerServices.RuntimeHelpers::get_OffsetToStringData() + IL_0012: add + IL_0013: stloc.0 + IL_0014: ldloc.0 + IL_0015: ldc.i4.0 + IL_0016: conv.i + IL_0017: sizeof [runtime]System.Char + IL_001d: mul + IL_001e: add + IL_001f: ldobj [runtime]System.Char + IL_0024: ldloc.0 + IL_0025: ldc.i4.1 + IL_0026: conv.i + IL_0027: sizeof [runtime]System.Char + IL_002d: mul + IL_002e: add + IL_002f: ldobj [runtime]System.Char + IL_0034: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, + !1) + IL_0039: 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 serializable 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__ + .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 +{ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .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 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 + } + + .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 ) + .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 ) + .get instance class [runtime]System.Type System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::get_Type() + } +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOff.OptimizeOn.il.netcore.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOff.OptimizeOn.il.netcore.debug.bsl new file mode 100644 index 00000000000..f4025c40141 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOff.OptimizeOn.il.netcore.debug.bsl @@ -0,0 +1,731 @@ + + + + + +.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 +} +.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) + 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/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.1 + IL_0036: ldarg.0 + IL_0037: ldfld int32 assembly/Point::y@ + IL_003c: stloc.2 + IL_003d: ldarg.1 + IL_003e: ldfld int32 assembly/Point::y@ + 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/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, + int32 V_1, + int32 V_2, + int32 V_3) + IL_0000: ldarg.1 + IL_0001: unbox.any assembly/Point + IL_0006: stloc.0 + IL_0007: ldarg.0 + IL_0008: brfalse.s IL_0050 + + IL_000a: ldarg.1 + IL_000b: unbox.any assembly/Point + IL_0010: brfalse.s IL_004e + + IL_0012: ldarg.0 + IL_0013: ldfld int32 assembly/Point::x@ + IL_0018: stloc.2 + IL_0019: ldloc.0 + IL_001a: ldfld int32 assembly/Point::x@ + 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/Point::y@ + IL_003c: stloc.2 + IL_003d: ldloc.0 + IL_003e: ldfld int32 assembly/Point::y@ + 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/Point + 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/Point::y@ + 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/Point::x@ + 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/Point::GetHashCode(class [runtime]System.Collections.IEqualityComparer) + IL_000b: ret + } + + .method public hidebysig instance bool Equals(class assembly/Point 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: 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, class [runtime]System.Collections.IEqualityComparer 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) + IL_0000: ldarg.1 + IL_0001: isinst assembly/Point + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: brfalse.s IL_0013 + + IL_000a: ldarg.0 + IL_000b: ldloc.0 + IL_000c: ldarg.2 + IL_000d: callvirt instance bool assembly/Point::Equals(class assembly/Point, + class [runtime]System.Collections.IEqualityComparer) + IL_0012: ret + + IL_0013: ldc.i4.0 + IL_0014: 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) + 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: ldc.i4.0 + IL_0014: conv.i + IL_0015: sizeof [runtime]System.Int32 + IL_001b: mul + IL_001c: add + IL_001d: ldobj [runtime]System.Int32 + IL_0022: ldloc.1 + IL_0023: ldc.i4.1 + IL_0024: conv.i + IL_0025: sizeof [runtime]System.Int32 + IL_002b: mul + IL_002c: add + IL_002d: ldobj [runtime]System.Int32 + IL_0032: add + IL_0033: 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& pinned V_2) + 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: nop + IL_0068: ldloc.0 + IL_0069: brfalse.s IL_0085 + + IL_006b: ldloc.0 + IL_006c: call int32 [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Length(!!0[]) + IL_0071: brfalse.s IL_0080 + + IL_0073: ldloc.0 + IL_0074: ldc.i4.0 + IL_0075: ldelema [runtime]System.Double + IL_007a: stloc.2 + IL_007b: ldloc.2 + IL_007c: conv.i + IL_007d: nop + IL_007e: br.s IL_0088 + + IL_0080: ldc.i4.0 + IL_0081: conv.i + IL_0082: nop + IL_0083: br.s IL_0088 + + IL_0085: ldc.i4.0 + IL_0086: conv.i + IL_0087: nop + IL_0088: stloc.1 + IL_0089: ldloc.1 + IL_008a: ldc.i4.0 + IL_008b: conv.i + IL_008c: sizeof [runtime]System.Double + IL_0092: mul + IL_0093: add + IL_0094: ldobj [runtime]System.Double + IL_0099: ldloc.1 + IL_009a: ldc.i4.1 + IL_009b: conv.i + IL_009c: sizeof [runtime]System.Double + IL_00a2: mul + IL_00a3: add + IL_00a4: ldobj [runtime]System.Double + IL_00a9: add + IL_00aa: ret + } + + .method public static float64 pinArray2() cil managed + { + + .maxstack 6 + .locals init (float64[] V_0, + native int V_1, + float64& pinned V_2) + 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: ldc.i4.0 + IL_0074: conv.i + IL_0075: sizeof [runtime]System.Double + IL_007b: mul + IL_007c: add + IL_007d: ldobj [runtime]System.Double + IL_0082: ldloc.1 + IL_0083: ldc.i4.1 + IL_0084: conv.i + IL_0085: sizeof [runtime]System.Double + IL_008b: mul + IL_008c: add + IL_008d: ldobj [runtime]System.Double + IL_0092: add + IL_0093: ret + } + + .method public static class [runtime]System.Tuple`2 pinString() cil managed + { + + .maxstack 6 + .locals init (native int V_0, + string pinned V_1) + IL_0000: nop + IL_0001: ldstr "Hello World" + IL_0006: stloc.1 + IL_0007: ldstr "Hello World" + IL_000c: conv.i + IL_000d: call int32 [runtime]System.Runtime.CompilerServices.RuntimeHelpers::get_OffsetToStringData() + IL_0012: add + IL_0013: stloc.0 + IL_0014: ldloc.0 + IL_0015: ldc.i4.0 + IL_0016: conv.i + IL_0017: sizeof [runtime]System.Char + IL_001d: mul + IL_001e: add + IL_001f: ldobj [runtime]System.Char + IL_0024: ldloc.0 + IL_0025: ldc.i4.1 + IL_0026: conv.i + IL_0027: sizeof [runtime]System.Char + IL_002d: mul + IL_002e: add + IL_002f: ldobj [runtime]System.Char + IL_0034: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, + !1) + IL_0039: 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.RealInternalSignatureOff.OptimizeOn.il.netcore.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOff.OptimizeOn.il.netcore.release.bsl new file mode 100644 index 00000000000..e618d937c7c --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOff.OptimizeOn.il.netcore.release.bsl @@ -0,0 +1,731 @@ + + + + + +.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 +} +.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) + 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/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.1 + IL_0036: ldarg.0 + IL_0037: ldfld int32 assembly/Point::y@ + IL_003c: stloc.2 + IL_003d: ldarg.1 + IL_003e: ldfld int32 assembly/Point::y@ + 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/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, + int32 V_1, + int32 V_2, + int32 V_3) + IL_0000: ldarg.1 + IL_0001: unbox.any assembly/Point + IL_0006: stloc.0 + IL_0007: ldarg.0 + IL_0008: brfalse.s IL_0050 + + IL_000a: ldarg.1 + IL_000b: unbox.any assembly/Point + IL_0010: brfalse.s IL_004e + + IL_0012: ldarg.0 + IL_0013: ldfld int32 assembly/Point::x@ + IL_0018: stloc.2 + IL_0019: ldloc.0 + IL_001a: ldfld int32 assembly/Point::x@ + 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/Point::y@ + IL_003c: stloc.2 + IL_003d: ldloc.0 + IL_003e: ldfld int32 assembly/Point::y@ + 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/Point + 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/Point::y@ + 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/Point::x@ + 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/Point::GetHashCode(class [runtime]System.Collections.IEqualityComparer) + IL_000b: ret + } + + .method public hidebysig instance bool Equals(class assembly/Point 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: 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, class [runtime]System.Collections.IEqualityComparer 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) + IL_0000: ldarg.1 + IL_0001: isinst assembly/Point + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: brfalse.s IL_0013 + + IL_000a: ldarg.0 + IL_000b: ldloc.0 + IL_000c: ldarg.2 + IL_000d: callvirt instance bool assembly/Point::Equals(class assembly/Point, + class [runtime]System.Collections.IEqualityComparer) + IL_0012: ret + + IL_0013: ldc.i4.0 + IL_0014: 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) + 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: ldc.i4.0 + IL_0014: conv.i + IL_0015: sizeof [runtime]System.Int32 + IL_001b: mul + IL_001c: add + IL_001d: ldobj [runtime]System.Int32 + IL_0022: ldloc.1 + IL_0023: ldc.i4.1 + IL_0024: conv.i + IL_0025: sizeof [runtime]System.Int32 + IL_002b: mul + IL_002c: add + IL_002d: ldobj [runtime]System.Int32 + IL_0032: add + IL_0033: 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: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1::.ctor(!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& pinned V_2) + 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: nop + IL_0068: ldloc.0 + IL_0069: brfalse.s IL_0085 + + IL_006b: ldloc.0 + IL_006c: call int32 [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Length(!!0[]) + IL_0071: brfalse.s IL_0080 + + IL_0073: ldloc.0 + IL_0074: ldc.i4.0 + IL_0075: ldelema [runtime]System.Double + IL_007a: stloc.2 + IL_007b: ldloc.2 + IL_007c: conv.i + IL_007d: nop + IL_007e: br.s IL_0088 + + IL_0080: ldc.i4.0 + IL_0081: conv.i + IL_0082: nop + IL_0083: br.s IL_0088 + + IL_0085: ldc.i4.0 + IL_0086: conv.i + IL_0087: nop + IL_0088: stloc.1 + IL_0089: ldloc.1 + IL_008a: ldc.i4.0 + IL_008b: conv.i + IL_008c: sizeof [runtime]System.Double + IL_0092: mul + IL_0093: add + IL_0094: ldobj [runtime]System.Double + IL_0099: ldloc.1 + IL_009a: ldc.i4.1 + IL_009b: conv.i + IL_009c: sizeof [runtime]System.Double + IL_00a2: mul + IL_00a3: add + IL_00a4: ldobj [runtime]System.Double + IL_00a9: add + IL_00aa: ret + } + + .method public static float64 pinArray2() cil managed + { + + .maxstack 6 + .locals init (float64[] V_0, + native int V_1, + float64& pinned V_2) + 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: ldc.i4.0 + IL_0074: conv.i + IL_0075: sizeof [runtime]System.Double + IL_007b: mul + IL_007c: add + IL_007d: ldobj [runtime]System.Double + IL_0082: ldloc.1 + IL_0083: ldc.i4.1 + IL_0084: conv.i + IL_0085: sizeof [runtime]System.Double + IL_008b: mul + IL_008c: add + IL_008d: ldobj [runtime]System.Double + IL_0092: add + IL_0093: ret + } + + .method public static class [runtime]System.Tuple`2 pinString() cil managed + { + + .maxstack 6 + .locals init (native int V_0, + string pinned V_1) + IL_0000: nop + IL_0001: ldstr "Hello World" + IL_0006: stloc.1 + IL_0007: ldstr "Hello World" + IL_000c: conv.i + IL_000d: call int32 [runtime]System.Runtime.CompilerServices.RuntimeHelpers::get_OffsetToStringData() + IL_0012: add + IL_0013: stloc.0 + IL_0014: ldloc.0 + IL_0015: ldc.i4.0 + IL_0016: conv.i + IL_0017: sizeof [runtime]System.Char + IL_001d: mul + IL_001e: add + IL_001f: ldobj [runtime]System.Char + IL_0024: ldloc.0 + IL_0025: ldc.i4.1 + IL_0026: conv.i + IL_0027: sizeof [runtime]System.Char + IL_002d: mul + IL_002e: add + IL_002f: ldobj [runtime]System.Char + IL_0034: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, + !1) + IL_0039: 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.RealInternalSignatureOn.OptimizeOff.il.net472.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOn.OptimizeOff.il.net472.debug.bsl new file mode 100644 index 00000000000..7852e2509a4 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOn.OptimizeOff.il.net472.debug.bsl @@ -0,0 +1,1025 @@ + + + + + +.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 +} +.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 instance bool Equals(class assembly/Point 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 [runtime]System.Collections.IEqualityComparer V_1, + int32 V_2, + int32 V_3, + class [runtime]System.Collections.IEqualityComparer V_4, + class [runtime]System.Collections.IEqualityComparer V_5, + int32 V_6, + int32 V_7, + class [runtime]System.Collections.IEqualityComparer V_8) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0043 + + IL_0003: ldarg.1 + IL_0004: brfalse.s IL_0041 + + IL_0006: ldarg.1 + IL_0007: stloc.0 + IL_0008: ldarg.2 + IL_0009: stloc.1 + IL_000a: ldarg.0 + IL_000b: ldfld int32 assembly/Point::x@ + IL_0010: stloc.2 + IL_0011: ldloc.0 + IL_0012: ldfld int32 assembly/Point::x@ + IL_0017: stloc.3 + IL_0018: ldloc.1 + IL_0019: stloc.s V_4 + IL_001b: ldloc.2 + IL_001c: ldloc.3 + IL_001d: ceq + IL_001f: brfalse.s IL_003f + + IL_0021: ldarg.2 + IL_0022: stloc.s V_5 + IL_0024: ldarg.0 + IL_0025: ldfld int32 assembly/Point::y@ + IL_002a: stloc.s V_6 + IL_002c: ldloc.0 + IL_002d: ldfld int32 assembly/Point::y@ + IL_0032: stloc.s V_7 + IL_0034: ldloc.s V_5 + IL_0036: stloc.s V_8 + IL_0038: ldloc.s V_6 + IL_003a: ldloc.s V_7 + IL_003c: ceq + IL_003e: ret + + IL_003f: ldc.i4.0 + IL_0040: ret + + IL_0041: ldc.i4.0 + IL_0042: ret + + IL_0043: ldarg.1 + IL_0044: ldnull + IL_0045: cgt.un + IL_0047: ldc.i4.0 + IL_0048: ceq + IL_004a: 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 5 + .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_0013 + + IL_000a: ldarg.0 + IL_000b: ldloc.0 + IL_000c: ldarg.2 + IL_000d: callvirt instance bool assembly/Point::Equals(class assembly/Point, + class [runtime]System.Collections.IEqualityComparer) + IL_0012: ret + + IL_0013: ldc.i4.0 + IL_0014: 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 serializable 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__ + .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 +{ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .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 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 + } + + .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 ) + .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 ) + .get instance class [runtime]System.Type System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::get_Type() + } +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOn.OptimizeOff.il.net472.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOn.OptimizeOff.il.net472.release.bsl new file mode 100644 index 00000000000..ab7bca6340a --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOn.OptimizeOff.il.net472.release.bsl @@ -0,0 +1,911 @@ + + + + + +.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 +} +.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 instance bool Equals(class assembly/Point 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 [runtime]System.Collections.IEqualityComparer V_1, + class [runtime]System.Collections.IEqualityComparer V_2) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_002f + + IL_0003: ldarg.1 + IL_0004: brfalse.s IL_002d + + IL_0006: ldarg.1 + IL_0007: stloc.0 + IL_0008: ldarg.2 + IL_0009: stloc.1 + IL_000a: ldarg.0 + IL_000b: ldfld int32 assembly/Point::x@ + IL_0010: ldloc.0 + IL_0011: ldfld int32 assembly/Point::x@ + IL_0016: ceq + IL_0018: brfalse.s IL_002b + + IL_001a: ldarg.2 + IL_001b: stloc.2 + IL_001c: ldarg.0 + IL_001d: ldfld int32 assembly/Point::y@ + IL_0022: ldloc.0 + IL_0023: ldfld int32 assembly/Point::y@ + IL_0028: ceq + IL_002a: ret + + IL_002b: ldc.i4.0 + IL_002c: ret + + IL_002d: ldc.i4.0 + IL_002e: ret + + IL_002f: ldarg.1 + IL_0030: ldnull + IL_0031: cgt.un + IL_0033: ldc.i4.0 + IL_0034: ceq + IL_0036: 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 5 + .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_0013 + + IL_000a: ldarg.0 + IL_000b: ldloc.0 + IL_000c: ldarg.2 + IL_000d: callvirt instance bool assembly/Point::Equals(class assembly/Point, + class [runtime]System.Collections.IEqualityComparer) + IL_0012: ret + + IL_0013: ldc.i4.0 + IL_0014: 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 serializable 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__ + .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 +{ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .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 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 + } + + .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 ) + .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 ) + .get instance class [runtime]System.Type System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::get_Type() + } +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOn.OptimizeOff.il.netcore.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOn.OptimizeOff.il.netcore.debug.bsl new file mode 100644 index 00000000000..bda000c5fe3 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOn.OptimizeOff.il.netcore.debug.bsl @@ -0,0 +1,935 @@ + + + + + +.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 +} +.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, + 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 instance bool Equals(class assembly/Point 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 [runtime]System.Collections.IEqualityComparer V_1, + int32 V_2, + int32 V_3, + class [runtime]System.Collections.IEqualityComparer V_4, + class [runtime]System.Collections.IEqualityComparer V_5, + int32 V_6, + int32 V_7, + class [runtime]System.Collections.IEqualityComparer V_8) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_0043 + + IL_0003: ldarg.1 + IL_0004: brfalse.s IL_0041 + + IL_0006: ldarg.1 + IL_0007: stloc.0 + IL_0008: ldarg.2 + IL_0009: stloc.1 + IL_000a: ldarg.0 + IL_000b: ldfld int32 assembly/Point::x@ + IL_0010: stloc.2 + IL_0011: ldloc.0 + IL_0012: ldfld int32 assembly/Point::x@ + IL_0017: stloc.3 + IL_0018: ldloc.1 + IL_0019: stloc.s V_4 + IL_001b: ldloc.2 + IL_001c: ldloc.3 + IL_001d: ceq + IL_001f: brfalse.s IL_003f + + IL_0021: ldarg.2 + IL_0022: stloc.s V_5 + IL_0024: ldarg.0 + IL_0025: ldfld int32 assembly/Point::y@ + IL_002a: stloc.s V_6 + IL_002c: ldloc.0 + IL_002d: ldfld int32 assembly/Point::y@ + IL_0032: stloc.s V_7 + IL_0034: ldloc.s V_5 + IL_0036: stloc.s V_8 + IL_0038: ldloc.s V_6 + IL_003a: ldloc.s V_7 + IL_003c: ceq + IL_003e: ret + + IL_003f: ldc.i4.0 + IL_0040: ret + + IL_0041: ldc.i4.0 + IL_0042: ret + + IL_0043: ldarg.1 + IL_0044: ldnull + IL_0045: cgt.un + IL_0047: ldc.i4.0 + IL_0048: ceq + IL_004a: 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 5 + .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_0013 + + IL_000a: ldarg.0 + IL_000b: ldloc.0 + IL_000c: ldarg.2 + IL_000d: callvirt instance bool assembly/Point::Equals(class assembly/Point, + class [runtime]System.Collections.IEqualityComparer) + IL_0012: ret + + IL_0013: ldc.i4.0 + IL_0014: 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 + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOn.OptimizeOff.il.netcore.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOn.OptimizeOff.il.netcore.release.bsl new file mode 100644 index 00000000000..d0244dfedf7 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOn.OptimizeOff.il.netcore.release.bsl @@ -0,0 +1,821 @@ + + + + + +.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 +} +.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 instance bool Equals(class assembly/Point 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 [runtime]System.Collections.IEqualityComparer V_1, + class [runtime]System.Collections.IEqualityComparer V_2) + IL_0000: ldarg.0 + IL_0001: brfalse.s IL_002f + + IL_0003: ldarg.1 + IL_0004: brfalse.s IL_002d + + IL_0006: ldarg.1 + IL_0007: stloc.0 + IL_0008: ldarg.2 + IL_0009: stloc.1 + IL_000a: ldarg.0 + IL_000b: ldfld int32 assembly/Point::x@ + IL_0010: ldloc.0 + IL_0011: ldfld int32 assembly/Point::x@ + IL_0016: ceq + IL_0018: brfalse.s IL_002b + + IL_001a: ldarg.2 + IL_001b: stloc.2 + IL_001c: ldarg.0 + IL_001d: ldfld int32 assembly/Point::y@ + IL_0022: ldloc.0 + IL_0023: ldfld int32 assembly/Point::y@ + IL_0028: ceq + IL_002a: ret + + IL_002b: ldc.i4.0 + IL_002c: ret + + IL_002d: ldc.i4.0 + IL_002e: ret + + IL_002f: ldarg.1 + IL_0030: ldnull + IL_0031: cgt.un + IL_0033: ldc.i4.0 + IL_0034: ceq + IL_0036: 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 5 + .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_0013 + + IL_000a: ldarg.0 + IL_000b: ldloc.0 + IL_000c: ldarg.2 + IL_000d: callvirt instance bool assembly/Point::Equals(class assembly/Point, + class [runtime]System.Collections.IEqualityComparer) + IL_0012: ret + + IL_0013: ldc.i4.0 + IL_0014: 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/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOn.OptimizeOn.il.net472.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOn.OptimizeOn.il.net472.debug.bsl new file mode 100644 index 00000000000..5ce65a01960 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOn.OptimizeOn.il.net472.debug.bsl @@ -0,0 +1,821 @@ + + + + + +.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 +} +.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) + 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/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.1 + IL_0036: ldarg.0 + IL_0037: ldfld int32 assembly/Point::y@ + IL_003c: stloc.2 + IL_003d: ldarg.1 + IL_003e: ldfld int32 assembly/Point::y@ + 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/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, + int32 V_1, + int32 V_2, + int32 V_3) + IL_0000: ldarg.1 + IL_0001: unbox.any assembly/Point + IL_0006: stloc.0 + IL_0007: ldarg.0 + IL_0008: brfalse.s IL_0050 + + IL_000a: ldarg.1 + IL_000b: unbox.any assembly/Point + IL_0010: brfalse.s IL_004e + + IL_0012: ldarg.0 + IL_0013: ldfld int32 assembly/Point::x@ + IL_0018: stloc.2 + IL_0019: ldloc.0 + IL_001a: ldfld int32 assembly/Point::x@ + 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/Point::y@ + IL_003c: stloc.2 + IL_003d: ldloc.0 + IL_003e: ldfld int32 assembly/Point::y@ + 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/Point + 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/Point::y@ + 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/Point::x@ + 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/Point::GetHashCode(class [runtime]System.Collections.IEqualityComparer) + IL_000b: ret + } + + .method public hidebysig instance bool Equals(class assembly/Point 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: 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, class [runtime]System.Collections.IEqualityComparer 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) + IL_0000: ldarg.1 + IL_0001: isinst assembly/Point + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: brfalse.s IL_0013 + + IL_000a: ldarg.0 + IL_000b: ldloc.0 + IL_000c: ldarg.2 + IL_000d: callvirt instance bool assembly/Point::Equals(class assembly/Point, + class [runtime]System.Collections.IEqualityComparer) + IL_0012: ret + + IL_0013: ldc.i4.0 + IL_0014: 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) + 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: ldc.i4.0 + IL_0014: conv.i + IL_0015: sizeof [runtime]System.Int32 + IL_001b: mul + IL_001c: add + IL_001d: ldobj [runtime]System.Int32 + IL_0022: ldloc.1 + IL_0023: ldc.i4.1 + IL_0024: conv.i + IL_0025: sizeof [runtime]System.Int32 + IL_002b: mul + IL_002c: add + IL_002d: ldobj [runtime]System.Int32 + IL_0032: add + IL_0033: 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& pinned V_2) + 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: nop + IL_0068: ldloc.0 + IL_0069: brfalse.s IL_0085 + + IL_006b: ldloc.0 + IL_006c: call int32 [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Length(!!0[]) + IL_0071: brfalse.s IL_0080 + + IL_0073: ldloc.0 + IL_0074: ldc.i4.0 + IL_0075: ldelema [runtime]System.Double + IL_007a: stloc.2 + IL_007b: ldloc.2 + IL_007c: conv.i + IL_007d: nop + IL_007e: br.s IL_0088 + + IL_0080: ldc.i4.0 + IL_0081: conv.i + IL_0082: nop + IL_0083: br.s IL_0088 + + IL_0085: ldc.i4.0 + IL_0086: conv.i + IL_0087: nop + IL_0088: stloc.1 + IL_0089: ldloc.1 + IL_008a: ldc.i4.0 + IL_008b: conv.i + IL_008c: sizeof [runtime]System.Double + IL_0092: mul + IL_0093: add + IL_0094: ldobj [runtime]System.Double + IL_0099: ldloc.1 + IL_009a: ldc.i4.1 + IL_009b: conv.i + IL_009c: sizeof [runtime]System.Double + IL_00a2: mul + IL_00a3: add + IL_00a4: ldobj [runtime]System.Double + IL_00a9: add + IL_00aa: ret + } + + .method public static float64 pinArray2() cil managed + { + + .maxstack 6 + .locals init (float64[] V_0, + native int V_1, + float64& pinned V_2) + 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: ldc.i4.0 + IL_0074: conv.i + IL_0075: sizeof [runtime]System.Double + IL_007b: mul + IL_007c: add + IL_007d: ldobj [runtime]System.Double + IL_0082: ldloc.1 + IL_0083: ldc.i4.1 + IL_0084: conv.i + IL_0085: sizeof [runtime]System.Double + IL_008b: mul + IL_008c: add + IL_008d: ldobj [runtime]System.Double + IL_0092: add + IL_0093: ret + } + + .method public static class [runtime]System.Tuple`2 pinString() cil managed + { + + .maxstack 6 + .locals init (native int V_0, + string pinned V_1) + IL_0000: nop + IL_0001: ldstr "Hello World" + IL_0006: stloc.1 + IL_0007: ldstr "Hello World" + IL_000c: conv.i + IL_000d: call int32 [runtime]System.Runtime.CompilerServices.RuntimeHelpers::get_OffsetToStringData() + IL_0012: add + IL_0013: stloc.0 + IL_0014: ldloc.0 + IL_0015: ldc.i4.0 + IL_0016: conv.i + IL_0017: sizeof [runtime]System.Char + IL_001d: mul + IL_001e: add + IL_001f: ldobj [runtime]System.Char + IL_0024: ldloc.0 + IL_0025: ldc.i4.1 + IL_0026: conv.i + IL_0027: sizeof [runtime]System.Char + IL_002d: mul + IL_002e: add + IL_002f: ldobj [runtime]System.Char + IL_0034: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, + !1) + IL_0039: 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 serializable 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__ + .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 +{ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .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 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 + } + + .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 ) + .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 ) + .get instance class [runtime]System.Type System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::get_Type() + } +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOn.OptimizeOn.il.net472.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOn.OptimizeOn.il.net472.release.bsl new file mode 100644 index 00000000000..9b4153c5532 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOn.OptimizeOn.il.net472.release.bsl @@ -0,0 +1,821 @@ + + + + + +.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 +} +.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) + 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/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.1 + IL_0036: ldarg.0 + IL_0037: ldfld int32 assembly/Point::y@ + IL_003c: stloc.2 + IL_003d: ldarg.1 + IL_003e: ldfld int32 assembly/Point::y@ + 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/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, + int32 V_1, + int32 V_2, + int32 V_3) + IL_0000: ldarg.1 + IL_0001: unbox.any assembly/Point + IL_0006: stloc.0 + IL_0007: ldarg.0 + IL_0008: brfalse.s IL_0050 + + IL_000a: ldarg.1 + IL_000b: unbox.any assembly/Point + IL_0010: brfalse.s IL_004e + + IL_0012: ldarg.0 + IL_0013: ldfld int32 assembly/Point::x@ + IL_0018: stloc.2 + IL_0019: ldloc.0 + IL_001a: ldfld int32 assembly/Point::x@ + 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/Point::y@ + IL_003c: stloc.2 + IL_003d: ldloc.0 + IL_003e: ldfld int32 assembly/Point::y@ + 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/Point + 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/Point::y@ + 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/Point::x@ + 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/Point::GetHashCode(class [runtime]System.Collections.IEqualityComparer) + IL_000b: ret + } + + .method public hidebysig instance bool Equals(class assembly/Point 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: 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, class [runtime]System.Collections.IEqualityComparer 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) + IL_0000: ldarg.1 + IL_0001: isinst assembly/Point + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: brfalse.s IL_0013 + + IL_000a: ldarg.0 + IL_000b: ldloc.0 + IL_000c: ldarg.2 + IL_000d: callvirt instance bool assembly/Point::Equals(class assembly/Point, + class [runtime]System.Collections.IEqualityComparer) + IL_0012: ret + + IL_0013: ldc.i4.0 + IL_0014: 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) + 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: ldc.i4.0 + IL_0014: conv.i + IL_0015: sizeof [runtime]System.Int32 + IL_001b: mul + IL_001c: add + IL_001d: ldobj [runtime]System.Int32 + IL_0022: ldloc.1 + IL_0023: ldc.i4.1 + IL_0024: conv.i + IL_0025: sizeof [runtime]System.Int32 + IL_002b: mul + IL_002c: add + IL_002d: ldobj [runtime]System.Int32 + IL_0032: add + IL_0033: 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: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1::.ctor(!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& pinned V_2) + 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: nop + IL_0068: ldloc.0 + IL_0069: brfalse.s IL_0085 + + IL_006b: ldloc.0 + IL_006c: call int32 [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Length(!!0[]) + IL_0071: brfalse.s IL_0080 + + IL_0073: ldloc.0 + IL_0074: ldc.i4.0 + IL_0075: ldelema [runtime]System.Double + IL_007a: stloc.2 + IL_007b: ldloc.2 + IL_007c: conv.i + IL_007d: nop + IL_007e: br.s IL_0088 + + IL_0080: ldc.i4.0 + IL_0081: conv.i + IL_0082: nop + IL_0083: br.s IL_0088 + + IL_0085: ldc.i4.0 + IL_0086: conv.i + IL_0087: nop + IL_0088: stloc.1 + IL_0089: ldloc.1 + IL_008a: ldc.i4.0 + IL_008b: conv.i + IL_008c: sizeof [runtime]System.Double + IL_0092: mul + IL_0093: add + IL_0094: ldobj [runtime]System.Double + IL_0099: ldloc.1 + IL_009a: ldc.i4.1 + IL_009b: conv.i + IL_009c: sizeof [runtime]System.Double + IL_00a2: mul + IL_00a3: add + IL_00a4: ldobj [runtime]System.Double + IL_00a9: add + IL_00aa: ret + } + + .method public static float64 pinArray2() cil managed + { + + .maxstack 6 + .locals init (float64[] V_0, + native int V_1, + float64& pinned V_2) + 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: ldc.i4.0 + IL_0074: conv.i + IL_0075: sizeof [runtime]System.Double + IL_007b: mul + IL_007c: add + IL_007d: ldobj [runtime]System.Double + IL_0082: ldloc.1 + IL_0083: ldc.i4.1 + IL_0084: conv.i + IL_0085: sizeof [runtime]System.Double + IL_008b: mul + IL_008c: add + IL_008d: ldobj [runtime]System.Double + IL_0092: add + IL_0093: ret + } + + .method public static class [runtime]System.Tuple`2 pinString() cil managed + { + + .maxstack 6 + .locals init (native int V_0, + string pinned V_1) + IL_0000: nop + IL_0001: ldstr "Hello World" + IL_0006: stloc.1 + IL_0007: ldstr "Hello World" + IL_000c: conv.i + IL_000d: call int32 [runtime]System.Runtime.CompilerServices.RuntimeHelpers::get_OffsetToStringData() + IL_0012: add + IL_0013: stloc.0 + IL_0014: ldloc.0 + IL_0015: ldc.i4.0 + IL_0016: conv.i + IL_0017: sizeof [runtime]System.Char + IL_001d: mul + IL_001e: add + IL_001f: ldobj [runtime]System.Char + IL_0024: ldloc.0 + IL_0025: ldc.i4.1 + IL_0026: conv.i + IL_0027: sizeof [runtime]System.Char + IL_002d: mul + IL_002e: add + IL_002f: ldobj [runtime]System.Char + IL_0034: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, + !1) + IL_0039: 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 serializable 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__ + .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 +{ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .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 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 + } + + .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 ) + .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 ) + .get instance class [runtime]System.Type System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::get_Type() + } +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOn.OptimizeOn.il.netcore.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOn.OptimizeOn.il.netcore.debug.bsl new file mode 100644 index 00000000000..f4025c40141 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOn.OptimizeOn.il.netcore.debug.bsl @@ -0,0 +1,731 @@ + + + + + +.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 +} +.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) + 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/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.1 + IL_0036: ldarg.0 + IL_0037: ldfld int32 assembly/Point::y@ + IL_003c: stloc.2 + IL_003d: ldarg.1 + IL_003e: ldfld int32 assembly/Point::y@ + 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/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, + int32 V_1, + int32 V_2, + int32 V_3) + IL_0000: ldarg.1 + IL_0001: unbox.any assembly/Point + IL_0006: stloc.0 + IL_0007: ldarg.0 + IL_0008: brfalse.s IL_0050 + + IL_000a: ldarg.1 + IL_000b: unbox.any assembly/Point + IL_0010: brfalse.s IL_004e + + IL_0012: ldarg.0 + IL_0013: ldfld int32 assembly/Point::x@ + IL_0018: stloc.2 + IL_0019: ldloc.0 + IL_001a: ldfld int32 assembly/Point::x@ + 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/Point::y@ + IL_003c: stloc.2 + IL_003d: ldloc.0 + IL_003e: ldfld int32 assembly/Point::y@ + 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/Point + 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/Point::y@ + 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/Point::x@ + 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/Point::GetHashCode(class [runtime]System.Collections.IEqualityComparer) + IL_000b: ret + } + + .method public hidebysig instance bool Equals(class assembly/Point 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: 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, class [runtime]System.Collections.IEqualityComparer 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) + IL_0000: ldarg.1 + IL_0001: isinst assembly/Point + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: brfalse.s IL_0013 + + IL_000a: ldarg.0 + IL_000b: ldloc.0 + IL_000c: ldarg.2 + IL_000d: callvirt instance bool assembly/Point::Equals(class assembly/Point, + class [runtime]System.Collections.IEqualityComparer) + IL_0012: ret + + IL_0013: ldc.i4.0 + IL_0014: 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) + 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: ldc.i4.0 + IL_0014: conv.i + IL_0015: sizeof [runtime]System.Int32 + IL_001b: mul + IL_001c: add + IL_001d: ldobj [runtime]System.Int32 + IL_0022: ldloc.1 + IL_0023: ldc.i4.1 + IL_0024: conv.i + IL_0025: sizeof [runtime]System.Int32 + IL_002b: mul + IL_002c: add + IL_002d: ldobj [runtime]System.Int32 + IL_0032: add + IL_0033: 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& pinned V_2) + 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: nop + IL_0068: ldloc.0 + IL_0069: brfalse.s IL_0085 + + IL_006b: ldloc.0 + IL_006c: call int32 [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Length(!!0[]) + IL_0071: brfalse.s IL_0080 + + IL_0073: ldloc.0 + IL_0074: ldc.i4.0 + IL_0075: ldelema [runtime]System.Double + IL_007a: stloc.2 + IL_007b: ldloc.2 + IL_007c: conv.i + IL_007d: nop + IL_007e: br.s IL_0088 + + IL_0080: ldc.i4.0 + IL_0081: conv.i + IL_0082: nop + IL_0083: br.s IL_0088 + + IL_0085: ldc.i4.0 + IL_0086: conv.i + IL_0087: nop + IL_0088: stloc.1 + IL_0089: ldloc.1 + IL_008a: ldc.i4.0 + IL_008b: conv.i + IL_008c: sizeof [runtime]System.Double + IL_0092: mul + IL_0093: add + IL_0094: ldobj [runtime]System.Double + IL_0099: ldloc.1 + IL_009a: ldc.i4.1 + IL_009b: conv.i + IL_009c: sizeof [runtime]System.Double + IL_00a2: mul + IL_00a3: add + IL_00a4: ldobj [runtime]System.Double + IL_00a9: add + IL_00aa: ret + } + + .method public static float64 pinArray2() cil managed + { + + .maxstack 6 + .locals init (float64[] V_0, + native int V_1, + float64& pinned V_2) + 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: ldc.i4.0 + IL_0074: conv.i + IL_0075: sizeof [runtime]System.Double + IL_007b: mul + IL_007c: add + IL_007d: ldobj [runtime]System.Double + IL_0082: ldloc.1 + IL_0083: ldc.i4.1 + IL_0084: conv.i + IL_0085: sizeof [runtime]System.Double + IL_008b: mul + IL_008c: add + IL_008d: ldobj [runtime]System.Double + IL_0092: add + IL_0093: ret + } + + .method public static class [runtime]System.Tuple`2 pinString() cil managed + { + + .maxstack 6 + .locals init (native int V_0, + string pinned V_1) + IL_0000: nop + IL_0001: ldstr "Hello World" + IL_0006: stloc.1 + IL_0007: ldstr "Hello World" + IL_000c: conv.i + IL_000d: call int32 [runtime]System.Runtime.CompilerServices.RuntimeHelpers::get_OffsetToStringData() + IL_0012: add + IL_0013: stloc.0 + IL_0014: ldloc.0 + IL_0015: ldc.i4.0 + IL_0016: conv.i + IL_0017: sizeof [runtime]System.Char + IL_001d: mul + IL_001e: add + IL_001f: ldobj [runtime]System.Char + IL_0024: ldloc.0 + IL_0025: ldc.i4.1 + IL_0026: conv.i + IL_0027: sizeof [runtime]System.Char + IL_002d: mul + IL_002e: add + IL_002f: ldobj [runtime]System.Char + IL_0034: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, + !1) + IL_0039: 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.RealInternalSignatureOn.OptimizeOn.il.netcore.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOn.OptimizeOn.il.netcore.release.bsl new file mode 100644 index 00000000000..e618d937c7c --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunction24.fs.RealInternalSignatureOn.OptimizeOn.il.netcore.release.bsl @@ -0,0 +1,731 @@ + + + + + +.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 +} +.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) + 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/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.1 + IL_0036: ldarg.0 + IL_0037: ldfld int32 assembly/Point::y@ + IL_003c: stloc.2 + IL_003d: ldarg.1 + IL_003e: ldfld int32 assembly/Point::y@ + 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/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, + int32 V_1, + int32 V_2, + int32 V_3) + IL_0000: ldarg.1 + IL_0001: unbox.any assembly/Point + IL_0006: stloc.0 + IL_0007: ldarg.0 + IL_0008: brfalse.s IL_0050 + + IL_000a: ldarg.1 + IL_000b: unbox.any assembly/Point + IL_0010: brfalse.s IL_004e + + IL_0012: ldarg.0 + IL_0013: ldfld int32 assembly/Point::x@ + IL_0018: stloc.2 + IL_0019: ldloc.0 + IL_001a: ldfld int32 assembly/Point::x@ + 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/Point::y@ + IL_003c: stloc.2 + IL_003d: ldloc.0 + IL_003e: ldfld int32 assembly/Point::y@ + 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/Point + 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/Point::y@ + 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/Point::x@ + 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/Point::GetHashCode(class [runtime]System.Collections.IEqualityComparer) + IL_000b: ret + } + + .method public hidebysig instance bool Equals(class assembly/Point 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: 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, class [runtime]System.Collections.IEqualityComparer 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) + IL_0000: ldarg.1 + IL_0001: isinst assembly/Point + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: brfalse.s IL_0013 + + IL_000a: ldarg.0 + IL_000b: ldloc.0 + IL_000c: ldarg.2 + IL_000d: callvirt instance bool assembly/Point::Equals(class assembly/Point, + class [runtime]System.Collections.IEqualityComparer) + IL_0012: ret + + IL_0013: ldc.i4.0 + IL_0014: 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) + 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: ldc.i4.0 + IL_0014: conv.i + IL_0015: sizeof [runtime]System.Int32 + IL_001b: mul + IL_001c: add + IL_001d: ldobj [runtime]System.Int32 + IL_0022: ldloc.1 + IL_0023: ldc.i4.1 + IL_0024: conv.i + IL_0025: sizeof [runtime]System.Int32 + IL_002b: mul + IL_002c: add + IL_002d: ldobj [runtime]System.Int32 + IL_0032: add + IL_0033: 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: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1::.ctor(!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& pinned V_2) + 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: nop + IL_0068: ldloc.0 + IL_0069: brfalse.s IL_0085 + + IL_006b: ldloc.0 + IL_006c: call int32 [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Length(!!0[]) + IL_0071: brfalse.s IL_0080 + + IL_0073: ldloc.0 + IL_0074: ldc.i4.0 + IL_0075: ldelema [runtime]System.Double + IL_007a: stloc.2 + IL_007b: ldloc.2 + IL_007c: conv.i + IL_007d: nop + IL_007e: br.s IL_0088 + + IL_0080: ldc.i4.0 + IL_0081: conv.i + IL_0082: nop + IL_0083: br.s IL_0088 + + IL_0085: ldc.i4.0 + IL_0086: conv.i + IL_0087: nop + IL_0088: stloc.1 + IL_0089: ldloc.1 + IL_008a: ldc.i4.0 + IL_008b: conv.i + IL_008c: sizeof [runtime]System.Double + IL_0092: mul + IL_0093: add + IL_0094: ldobj [runtime]System.Double + IL_0099: ldloc.1 + IL_009a: ldc.i4.1 + IL_009b: conv.i + IL_009c: sizeof [runtime]System.Double + IL_00a2: mul + IL_00a3: add + IL_00a4: ldobj [runtime]System.Double + IL_00a9: add + IL_00aa: ret + } + + .method public static float64 pinArray2() cil managed + { + + .maxstack 6 + .locals init (float64[] V_0, + native int V_1, + float64& pinned V_2) + 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: ldc.i4.0 + IL_0074: conv.i + IL_0075: sizeof [runtime]System.Double + IL_007b: mul + IL_007c: add + IL_007d: ldobj [runtime]System.Double + IL_0082: ldloc.1 + IL_0083: ldc.i4.1 + IL_0084: conv.i + IL_0085: sizeof [runtime]System.Double + IL_008b: mul + IL_008c: add + IL_008d: ldobj [runtime]System.Double + IL_0092: add + IL_0093: ret + } + + .method public static class [runtime]System.Tuple`2 pinString() cil managed + { + + .maxstack 6 + .locals init (native int V_0, + string pinned V_1) + IL_0000: nop + IL_0001: ldstr "Hello World" + IL_0006: stloc.1 + IL_0007: ldstr "Hello World" + IL_000c: conv.i + IL_000d: call int32 [runtime]System.Runtime.CompilerServices.RuntimeHelpers::get_OffsetToStringData() + IL_0012: add + IL_0013: stloc.0 + IL_0014: ldloc.0 + IL_0015: ldc.i4.0 + IL_0016: conv.i + IL_0017: sizeof [runtime]System.Char + IL_001d: mul + IL_001e: add + IL_001f: ldobj [runtime]System.Char + IL_0024: ldloc.0 + IL_0025: ldc.i4.1 + IL_0026: conv.i + IL_0027: sizeof [runtime]System.Char + IL_002d: mul + IL_002e: add + IL_002f: ldobj [runtime]System.Char + IL_0034: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, + !1) + IL_0039: 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/TestFunctions.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunctions.fs index 3f17c4d1db2..4390225b850 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunctions.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/TestFunctions.fs @@ -11,7 +11,6 @@ module TestFunctions = compilation |> withOptions [ "--test:EmitFeeFeeAs100001"; "--nowarn:988"; "--nowarn:3370"] |> asExe - |> withNoOptimize |> withEmbeddedPdb |> withEmbedAllSource |> ignoreWarnings @@ -19,6 +18,7 @@ module TestFunctions = let verifyCompileAndRun compilation = compilation |> verifyCore + |> verifyILBaseline |> compileAndRun let verifyCompilation compilation = @@ -27,252 +27,252 @@ module TestFunctions = |> verifyILBaseline //SOURCE=TestFunction01.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd TestFunction01.exe" # TestFunction01.fs - [] + [] let ``TestFunction01_fs`` compilation = compilation |> getCompilation |> verifyCompilation //SOURCE=TestFunction02.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd TestFunction02.exe" # TestFunction02.fs - [] + [] let ``TestFunction02_fs`` compilation = compilation |> getCompilation |> verifyCompilation //SOURCE=TestFunction03.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd TestFunction03.exe" # TestFunction03.fs - - [] + [] let ``TestFunction03_fs`` compilation = compilation |> getCompilation |> verifyCompilation //SOURCE=TestFunction03b.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd TestFunction03b.exe" # TestFunction03b.fs - - [] + [] let ``TestFunction03b_fs`` compilation = compilation |> getCompilation |> verifyCompilation //SOURCE=TestFunction03c.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd TestFunction03c.exe" # TestFunction03c.fs - - [] + [] let ``TestFunction03c_fs`` compilation = compilation |> getCompilation |> verifyCompilation //SOURCE=TestFunction04.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd TestFunction04.exe" # TestFunction04.fs - [] + [] let ``TestFunction04_fs`` compilation = compilation |> getCompilation |> verifyCompilation //SOURCE=TestFunction05.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd TestFunction05.exe" # TestFunction05.fs - [] + [] let ``TestFunction05_fs`` compilation = compilation |> getCompilation |> verifyCompilation //SOURCE=TestFunction06.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd TestFunction06.exe" # TestFunction06.fs - [] + [] let ``TestFunction06_fs`` compilation = compilation |> getCompilation |> verifyCompilation //SOURCE=TestFunction07.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd TestFunction07.exe" # TestFunction07.fs - [] + [] let ``TestFunction07_fs`` compilation = compilation |> getCompilation |> verifyCompilation //SOURCE=TestFunction08.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd TestFunction08.exe" # TestFunction08.fs - [] + [] let ``TestFunction08_fs`` compilation = compilation |> getCompilation |> verifyCompilation //SOURCE=TestFunction09.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd TestFunction09.exe" # TestFunction09.fs - [] + [] let ``TestFunction09_fs`` compilation = compilation |> getCompilation |> verifyCompilation //SOURCE=TestFunction09b.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd TestFunction09b.exe" # TestFunction09b.fs - [] + [] let ``TestFunction09b_fs`` compilation = compilation |> getCompilation |> verifyCompilation //SOURCE=TestFunction09b1.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd TestFunction09b1.exe" # TestFunction09b1.fs - [] + [] let ``TestFunction09b1_fs`` compilation = compilation |> getCompilation |> verifyCompilation //SOURCE=TestFunction09b2.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd TestFunction09b2.exe" # TestFunction09b2.fs - [] + [] let ``TestFunction09b2_fs`` compilation = compilation |> getCompilation |> verifyCompilation //SOURCE=TestFunction09b3.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd TestFunction09b3.exe" # TestFunction09b3.fs - [] + [] let ``TestFunction09b3_fs`` compilation = compilation |> getCompilation |> verifyCompilation //SOURCE=TestFunction09b4.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd TestFunction09b4.exe" # TestFunction09b4.fs - [] + [] let ``TestFunction09b4_fs`` compilation = compilation |> getCompilation |> verifyCompilation //SOURCE=TestFunction10.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd TestFunction10.exe" # TestFunction10.fs - - [] + [] let ``TestFunction10_fs`` compilation = compilation |> getCompilation |> verifyCompilation //SOURCE=TestFunction11.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd TestFunction11.exe" # TestFunction11.fs - [] + [] let ``TestFunction11_fs`` compilation = compilation |> getCompilation |> verifyCompilation //SOURCE=TestFunction12.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd TestFunction12.exe" # TestFunction12.fs - [] + [] let ``TestFunction12_fs`` compilation = compilation |> getCompilation |> verifyCompilation //SOURCE=TestFunction13.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd TestFunction13.exe" # TestFunction13.fs - - [] + [] let ``TestFunction13_fs`` compilation = compilation |> getCompilation |> verifyCompilation //SOURCE=TestFunction14.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd TestFunction14.exe" # TestFunction14.fs - - [] + [] let ``TestFunction14_fs`` compilation = compilation |> getCompilation |> verifyCompilation //SOURCE=TestFunction15.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd TestFunction15.exe" # TestFunction15.fs - [] + [] let ``TestFunction15_fs`` compilation = compilation |> getCompilation |> verifyCompilation //SOURCE=TestFunction16.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd TestFunction16.exe" # TestFunction16.fs - - [] + [] let ``TestFunction16_fs`` compilation = compilation |> getCompilation |> verifyCompilation //SOURCE=TestFunction17.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd TestFunction17.exe" # TestFunction17.fs - - [] + [] let ``TestFunction17_fs`` compilation = compilation |> getCompilation |> verifyCompilation //SOURCE=TestFunction18.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd TestFunction18.exe" # TestFunction18.fs - [] + [] let ``TestFunction18_fs`` compilation = compilation |> getCompilation |> verifyCompilation //SOURCE=TestFunction19.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd TestFunction19.exe" # TestFunction19.fs - - [] + [] let ``TestFunction19_fs`` compilation = compilation |> getCompilation |> verifyCompilation //SOURCE=TestFunction20.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd TestFunction20.exe" # TestFunction20.fs - - [] + [] let ``TestFunction20_fs`` compilation = compilation |> getCompilation |> verifyCompilation //SOURCE=TestFunction21.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd TestFunction21.exe" # TestFunction21.fs - - [] + [] let ``TestFunction21_fs`` compilation = compilation |> getCompilation |> verifyCompilation //SOURCE=TestFunction22.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd TestFunction22.exe" # TestFunction22.fs - [] + [] let ``TestFunction22_fs`` compilation = compilation |> getCompilation |> verifyCompilation //SOURCE=TestFunction22b.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd TestFunction22b.exe" # TestFunction22b.fs - [] + [] let ``TestFunction22b_fs`` compilation = compilation |> getCompilation |> verifyCompilation //SOURCE=TestFunction22c.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd TestFunction22c.exe" # TestFunction22c.fs - [] + [] let ``TestFunction22c_fs`` compilation = compilation |> getCompilation |> verifyCompilation //SOURCE=TestFunction22d.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd TestFunction22d.exe" # TestFunction22d.fs - [] + [] let ``TestFunction22d_fs`` compilation = compilation |> getCompilation |> verifyCompilation //SOURCE=TestFunction22e.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd TestFunction22e.exe" # TestFunction22e.fs - [] + [] let ``TestFunction22e_fs`` compilation = compilation |> getCompilation |> verifyCompilation //SOURCE=TestFunction22f.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd TestFunction22f.exe" # TestFunction22f.fs - [] + [] let ``TestFunction22f_fs`` compilation = compilation |> getCompilation |> verifyCompilation //SOURCE=TestFunction22g.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd TestFunction22g.exe" # TestFunction22g.fs - [] + [] let ``TestFunction22g_fs`` compilation = compilation |> getCompilation |> verifyCompilation //SOURCE=TestFunction22h.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd TestFunction22h.exe" # TestFunction22h.fs - - [] + [] let ``TestFunction22h_fs`` compilation = compilation |> getCompilation @@ -281,19 +281,19 @@ module TestFunctions = //SOURCE=TestFunction22h.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd TestFunction22h.exe" # TestFunction22h.fs - //SOURCE=TestFunction23.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd TestFunction23.exe" # TestFunction23.fs - - [] + [] let ``TestFunction23_fs`` compilation = compilation |> getCompilation |> verifyCompilation //SOURCE=TestFunction24.fs SCFLAGS="-g --optimize-" PEVER=/Exp_Fail COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd TestFunction24.exe" # TestFunction24.fs - - [] + [] let ``TestFunction24_fs`` compilation = compilation |> getCompilation |> withLangVersion70 - |> verifyCompilation + |> verifyCompileAndRun // Verify Execution 13043 run it built not optimized with debug [] @@ -303,12 +303,3 @@ module TestFunctions = |> withDebug |> withRealInternalSignatureOff |> verifyCompileAndRun - - // Verify Execution 13043 run it built not optimized with debug - [] - let ``Verify13043_Baselines`` compilation = - compilation - |> getCompilation - |> withDebug - |> withRealInternalSignatureOff - |> verifyCompilation diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/Verify13043.fs.RealInternalSignatureOn.OptimizeOn.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/Verify13043.fs.RealInternalSignatureOff.OptimizeOn.il.debug.bsl similarity index 57% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/Verify13043.fs.RealInternalSignatureOn.OptimizeOn.il.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/Verify13043.fs.RealInternalSignatureOff.OptimizeOn.il.debug.bsl index 3198f042779..58a96db5e27 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/Verify13043.fs.RealInternalSignatureOn.OptimizeOn.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/Verify13043.fs.RealInternalSignatureOff.OptimizeOn.il.debug.bsl @@ -33,136 +33,6 @@ 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 assembly beforefieldinit f@8 - extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> - { - .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 condition - .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 condition) 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::.ctor() - IL_0006: ldarg.0 - IL_0007: ldarg.1 - IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 assembly/f@8::condition - IL_000d: ret - } - - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Invoke(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 l) cil managed - { - - .maxstack 6 - .locals init (class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_0, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_1, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_2, - int32 V_3) - IL_0000: ldarg.1 - IL_0001: stloc.0 - IL_0002: ldloc.0 - IL_0003: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_0008: brfalse.s IL_000c - - IL_000a: br.s IL_0012 - - IL_000c: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() - IL_0011: ret - - IL_0012: ldloc.0 - IL_0013: stloc.1 - IL_0014: ldloc.1 - IL_0015: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_001a: stloc.2 - IL_001b: ldloc.1 - IL_001c: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() - IL_0021: stloc.3 - IL_0022: nop - IL_0023: ldarg.0 - IL_0024: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 assembly/f@8::condition - IL_0029: ldloc.3 - IL_002a: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) - IL_002f: brfalse.s IL_0036 - - IL_0031: ldloc.2 - IL_0032: starg.s l - IL_0034: br.s IL_0000 - - IL_0036: ldloc.3 - IL_0037: ldloc.2 - IL_0038: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_003d: ret - } - - } - - .class auto ansi serializable sealed nested assembly beforefieldinit 'f@27-1' - extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> - { - .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 condition - .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 condition) 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::.ctor() - IL_0006: ldarg.0 - IL_0007: ldarg.1 - IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 assembly/'f@27-1'::condition - IL_000d: ret - } - - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Invoke(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 _arg1) cil managed - { - - .maxstack 6 - .locals init (class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_0, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_1, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_2, - int32 V_3) - IL_0000: ldarg.1 - IL_0001: stloc.0 - IL_0002: ldloc.0 - IL_0003: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_0008: brfalse.s IL_000c - - IL_000a: br.s IL_0012 - - IL_000c: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() - IL_0011: ret - - IL_0012: ldloc.0 - IL_0013: stloc.1 - IL_0014: ldloc.1 - IL_0015: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_001a: stloc.2 - IL_001b: ldloc.1 - IL_001c: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() - IL_0021: stloc.3 - IL_0022: nop - IL_0023: ldarg.0 - IL_0024: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 assembly/'f@27-1'::condition - IL_0029: ldloc.3 - IL_002a: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) - IL_002f: brfalse.s IL_0036 - - IL_0031: ldloc.2 - IL_0032: starg.s _arg1 - IL_0034: br.s IL_0000 - - IL_0036: ldloc.3 - IL_0037: ldloc.2 - IL_0038: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_003d: ret - } - - } - .class auto ansi serializable sealed nested assembly beforefieldinit matchResult@38 extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 { @@ -183,8 +53,9 @@ .maxstack 8 IL_0000: ldarg.1 - IL_0001: call bool assembly::condition(int32) - IL_0006: ret + IL_0001: ldc.i4.3 + IL_0002: clt + IL_0004: ret } .method private specialname rtspecialname static void .cctor() cil managed @@ -218,8 +89,9 @@ .maxstack 8 IL_0000: ldarg.1 - IL_0001: call bool assembly::condition(int32) - IL_0006: ret + IL_0001: ldc.i4.3 + IL_0002: clt + IL_0004: ret } .method private specialname rtspecialname static void .cctor() cil managed @@ -251,20 +123,106 @@ IL_0004: ret } + .method assembly static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f@7(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 condition, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 l) cil managed + { + + .maxstack 4 + .locals init (class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_0, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_1, + int32 V_2) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0007: brfalse.s IL_000b + + IL_0009: br.s IL_0011 + + IL_000b: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() + IL_0010: ret + + IL_0011: ldarg.1 + IL_0012: stloc.0 + IL_0013: ldloc.0 + IL_0014: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0019: stloc.1 + IL_001a: ldloc.0 + IL_001b: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_0020: stloc.2 + IL_0021: nop + IL_0022: ldarg.0 + IL_0023: ldloc.2 + IL_0024: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0029: brfalse.s IL_0033 + + IL_002b: ldarg.0 + IL_002c: ldloc.1 + IL_002d: starg.s l + IL_002f: starg.s condition + IL_0031: br.s IL_0000 + + IL_0033: ldloc.2 + IL_0034: ldloc.1 + IL_0035: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_003a: ret + } + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 dropWhileWithMatch(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 condition, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 list) cil managed { .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) .maxstack 4 - .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> V_0) + .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 V_0) IL_0000: ldarg.0 - IL_0001: newobj instance void assembly/f@8::.ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) - IL_0006: stloc.0 - IL_0007: ldloc.0 - IL_0008: ldarg.1 - IL_0009: tail. - IL_000b: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::Invoke(!0) - IL_0010: ret + IL_0001: stloc.0 + IL_0002: ldarg.0 + IL_0003: ldarg.1 + IL_0004: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::f@7(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_0009: ret + } + + .method assembly static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'f@26-1'(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 condition, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 _arg1) cil managed + { + + .maxstack 4 + .locals init (class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_0, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_1, + int32 V_2) + IL_0000: ldarg.1 + IL_0001: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0006: brfalse.s IL_000a + + IL_0008: br.s IL_0010 + + IL_000a: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() + IL_000f: ret + + IL_0010: ldarg.1 + IL_0011: stloc.0 + IL_0012: ldloc.0 + IL_0013: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0018: stloc.1 + IL_0019: ldloc.0 + IL_001a: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_001f: stloc.2 + IL_0020: nop + IL_0021: ldarg.0 + IL_0022: ldloc.2 + IL_0023: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0028: brfalse.s IL_0032 + + IL_002a: ldarg.0 + IL_002b: ldloc.1 + IL_002c: starg.s _arg1 + IL_002e: starg.s condition + IL_0030: br.s IL_0000 + + IL_0032: ldloc.2 + IL_0033: ldloc.1 + IL_0034: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_0039: ret } .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 dropWhileWithFunction(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 condition, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 list) cil managed @@ -272,15 +230,14 @@ .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) .maxstack 4 - .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> V_0) + .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 V_0) IL_0000: ldarg.0 - IL_0001: newobj instance void assembly/'f@27-1'::.ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) - IL_0006: stloc.0 - IL_0007: ldloc.0 - IL_0008: ldarg.1 - IL_0009: tail. - IL_000b: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::Invoke(!0) - IL_0010: ret + IL_0001: stloc.0 + IL_0002: ldarg.0 + IL_0003: ldarg.1 + IL_0004: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::'f@26-1'(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_0009: ret } .method public specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 get_matchResult() cil managed @@ -337,9 +294,6 @@ .entrypoint .maxstack 6 - .locals init (class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_0, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_1, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_2) IL_0000: ldc.i4.1 IL_0001: ldc.i4.2 IL_0002: ldc.i4.3 @@ -350,36 +304,30 @@ class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) IL_0012: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_0017: dup - IL_0018: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::list@3 - IL_001d: stloc.0 - IL_001e: ldsfld class assembly/matchResult@38 assembly/matchResult@38::@_instance - IL_0023: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_list() - IL_0028: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::dropWhileWithMatch(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, + IL_0017: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::list@3 + IL_001c: ldsfld class assembly/matchResult@38 assembly/matchResult@38::@_instance + IL_0021: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_list() + IL_0026: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::dropWhileWithMatch(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_002d: dup - IL_002e: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::matchResult@38 - IL_0033: stloc.1 - IL_0034: ldstr "Match: %A" - IL_0039: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::.ctor(string) - IL_003e: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine,class [FSharp.Core]Microsoft.FSharp.Core.Unit>>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) - IL_0043: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_matchResult() - IL_0048: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Core.Unit>::Invoke(!0) - IL_004d: pop - IL_004e: ldsfld class assembly/functionResult@43 assembly/functionResult@43::@_instance - IL_0053: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_list() - IL_0058: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::dropWhileWithFunction(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, + IL_002b: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::matchResult@38 + IL_0030: ldstr "Match: %A" + IL_0035: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::.ctor(string) + IL_003a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine,class [FSharp.Core]Microsoft.FSharp.Core.Unit>>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_003f: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_matchResult() + IL_0044: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Core.Unit>::Invoke(!0) + IL_0049: pop + IL_004a: ldsfld class assembly/functionResult@43 assembly/functionResult@43::@_instance + IL_004f: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_list() + IL_0054: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::dropWhileWithFunction(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_005d: dup - IL_005e: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::functionResult@43 - IL_0063: stloc.2 - IL_0064: ldstr "Function: %A" - IL_0069: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::.ctor(string) - IL_006e: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine,class [FSharp.Core]Microsoft.FSharp.Core.Unit>>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) - IL_0073: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_functionResult() - IL_0078: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Core.Unit>::Invoke(!0) - IL_007d: pop - IL_007e: ret + IL_0059: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::functionResult@43 + IL_005e: ldstr "Function: %A" + IL_0063: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::.ctor(string) + IL_0068: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine,class [FSharp.Core]Microsoft.FSharp.Core.Unit>>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_006d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_functionResult() + IL_0072: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Core.Unit>::Invoke(!0) + IL_0077: pop + IL_0078: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/Verify13043.fs.RealInternalSignatureOff.OptimizeOn.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/Verify13043.fs.RealInternalSignatureOff.OptimizeOn.il.release.bsl new file mode 100644 index 00000000000..dc747ca00e0 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/Verify13043.fs.RealInternalSignatureOff.OptimizeOn.il.release.bsl @@ -0,0 +1,384 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly extern netstandard +{ + .publickeytoken = (CC 7B 13 FF CD 2D DD 51 ) + .ver 2:1:0:0 +} +.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 +} +.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 assembly beforefieldinit matchResult@38 + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 + { + .field static assembly initonly class assembly/matchResult@38 @_instance + .method assembly specialname rtspecialname instance void .ctor() 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::.ctor() + IL_0006: ret + } + + .method public strict virtual instance bool Invoke(int32 n) cil managed + { + + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: ldc.i4.3 + IL_0002: clt + IL_0004: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 10 + IL_0000: newobj instance void assembly/matchResult@38::.ctor() + IL_0005: stsfld class assembly/matchResult@38 assembly/matchResult@38::@_instance + IL_000a: ret + } + + } + + .class auto ansi serializable sealed nested assembly beforefieldinit functionResult@43 + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 + { + .field static assembly initonly class assembly/functionResult@43 @_instance + .method assembly specialname rtspecialname instance void .ctor() 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::.ctor() + IL_0006: ret + } + + .method public strict virtual instance bool Invoke(int32 n) cil managed + { + + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: ldc.i4.3 + IL_0002: clt + IL_0004: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 10 + IL_0000: newobj instance void assembly/functionResult@43::.ctor() + IL_0005: stsfld class assembly/functionResult@43 assembly/functionResult@43::@_instance + IL_000a: ret + } + + } + + .method public specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 get_list() cil managed + { + + .maxstack 8 + IL_0000: ldsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::list@3 + IL_0005: ret + } + + .method public static bool condition(int32 n) cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldc.i4.3 + IL_0002: clt + IL_0004: ret + } + + .method assembly static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f@7(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 condition, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 l) cil managed + { + + .maxstack 4 + .locals init (class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_0, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_1, + int32 V_2) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0007: brfalse.s IL_000b + + IL_0009: br.s IL_0011 + + IL_000b: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() + IL_0010: ret + + IL_0011: ldarg.1 + IL_0012: stloc.0 + IL_0013: ldloc.0 + IL_0014: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0019: stloc.1 + IL_001a: ldloc.0 + IL_001b: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_0020: stloc.2 + IL_0021: nop + IL_0022: ldarg.0 + IL_0023: ldloc.2 + IL_0024: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0029: brfalse.s IL_0033 + + IL_002b: ldarg.0 + IL_002c: ldloc.1 + IL_002d: starg.s l + IL_002f: starg.s condition + IL_0031: br.s IL_0000 + + IL_0033: ldloc.2 + IL_0034: ldloc.1 + IL_0035: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_003a: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 dropWhileWithMatch(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 condition, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 list) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 4 + .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 V_0) + IL_0000: ldarg.0 + IL_0001: stloc.0 + IL_0002: ldarg.0 + IL_0003: ldarg.1 + IL_0004: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::f@7(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_0009: ret + } + + .method assembly static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'f@26-1'(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 condition, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 _arg1) cil managed + { + + .maxstack 4 + .locals init (class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_0, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_1, + int32 V_2) + IL_0000: ldarg.1 + IL_0001: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0006: brfalse.s IL_000a + + IL_0008: br.s IL_0010 + + IL_000a: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() + IL_000f: ret + + IL_0010: ldarg.1 + IL_0011: stloc.0 + IL_0012: ldloc.0 + IL_0013: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0018: stloc.1 + IL_0019: ldloc.0 + IL_001a: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_001f: stloc.2 + IL_0020: nop + IL_0021: ldarg.0 + IL_0022: ldloc.2 + IL_0023: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0028: brfalse.s IL_0032 + + IL_002a: ldarg.0 + IL_002b: ldloc.1 + IL_002c: starg.s _arg1 + IL_002e: starg.s condition + IL_0030: br.s IL_0000 + + IL_0032: ldloc.2 + IL_0033: ldloc.1 + IL_0034: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_0039: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 dropWhileWithFunction(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 condition, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 list) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 4 + .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 V_0) + IL_0000: ldarg.0 + IL_0001: stloc.0 + IL_0002: ldarg.0 + IL_0003: ldarg.1 + IL_0004: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::'f@26-1'(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_0009: ret + } + + .method public specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 get_matchResult() cil managed + { + + .maxstack 8 + IL_0000: ldsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::matchResult@38 + IL_0005: ret + } + + .method assembly specialname static class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit> get_format@1() cil managed + { + + .maxstack 8 + IL_0000: ldsfld class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit> ''.$assembly::format@1 + IL_0005: ret + } + + .method public specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 get_functionResult() cil managed + { + + .maxstack 8 + IL_0000: ldsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::functionResult@43 + IL_0005: ret + } + + .method assembly specialname static class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit> 'get_format@1-1'() cil managed + { + + .maxstack 8 + IL_0000: ldsfld class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit> ''.$assembly::'format@1-1' + IL_0005: ret + } + + .property class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 + list() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) + .get class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_list() + } + .property class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 + matchResult() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) + .get class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_matchResult() + } + .property class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit> + format@1() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) + .get class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit> assembly::get_format@1() + } + .property class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 + functionResult() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) + .get class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_functionResult() + } + .property class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit> + 'format@1-1'() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) + .get class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit> assembly::'get_format@1-1'() + } +} + +.class private abstract auto ansi sealed ''.$assembly + extends [runtime]System.Object +{ + .field static assembly class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 list@3 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .field static assembly class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 matchResult@38 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .field static assembly class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit> format@1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .field static assembly class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 functionResult@43 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .field static assembly class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit> 'format@1-1' + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .field static assembly int32 init@ + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 6 + IL_0000: ldc.i4.1 + IL_0001: ldc.i4.2 + IL_0002: ldc.i4.3 + IL_0003: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() + IL_0008: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_000d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_0012: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_0017: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::list@3 + IL_001c: ldsfld class assembly/matchResult@38 assembly/matchResult@38::@_instance + IL_0021: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_list() + IL_0026: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::dropWhileWithMatch(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_002b: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::matchResult@38 + IL_0030: ldstr "Match: %A" + IL_0035: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::.ctor(string) + IL_003a: stsfld class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit> ''.$assembly::format@1 + IL_003f: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() + IL_0044: call class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit> assembly::get_format@1() + IL_0049: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit>>(class [runtime]System.IO.TextWriter, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_004e: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_matchResult() + IL_0053: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Core.Unit>::Invoke(!0) + IL_0058: pop + IL_0059: ldsfld class assembly/functionResult@43 assembly/functionResult@43::@_instance + IL_005e: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_list() + IL_0063: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::dropWhileWithFunction(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_0068: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::functionResult@43 + IL_006d: ldstr "Function: %A" + IL_0072: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::.ctor(string) + IL_0077: stsfld class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit> ''.$assembly::'format@1-1' + IL_007c: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() + IL_0081: call class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit> assembly::'get_format@1-1'() + IL_0086: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit>>(class [runtime]System.IO.TextWriter, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_008b: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_functionResult() + IL_0090: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Core.Unit>::Invoke(!0) + IL_0095: pop + IL_0096: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/Verify13043.fs.RealInternalSignatureOff.il.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/Verify13043.fs.RealInternalSignatureOff.il.debug.bsl deleted file mode 100644 index f6fd1e69d10..00000000000 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/Verify13043.fs.RealInternalSignatureOff.il.debug.bsl +++ /dev/null @@ -1,405 +0,0 @@ - - - - - -.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 FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - -} -.module assembly.exe - -.imagebase {value} -.file alignment 0x00000200 -.stackreserve 0x00100000 -.subsystem 0x0003 -.corflags 0x00000001 - - - - - -.class public abstract auto ansi sealed Verify13043 - 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 assembly beforefieldinit f@8 - extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> - { - .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 condition - .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 condition) 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::.ctor() - IL_0006: ldarg.0 - IL_0007: ldarg.1 - IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 Verify13043/f@8::condition - IL_000d: ret - } - - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Invoke(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 l) cil managed - { - - .maxstack 6 - .locals init (class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_0, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_1, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_2, - int32 V_3) - IL_0000: ldarg.1 - IL_0001: stloc.0 - IL_0002: ldloc.0 - IL_0003: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_0008: brfalse.s IL_000c - - IL_000a: br.s IL_0012 - - IL_000c: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() - IL_0011: ret - - IL_0012: ldloc.0 - IL_0013: stloc.1 - IL_0014: ldloc.1 - IL_0015: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_001a: stloc.2 - IL_001b: ldloc.1 - IL_001c: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() - IL_0021: stloc.3 - IL_0022: nop - IL_0023: ldarg.0 - IL_0024: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 Verify13043/f@8::condition - IL_0029: ldloc.3 - IL_002a: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) - IL_002f: brfalse.s IL_0036 - - IL_0031: ldloc.2 - IL_0032: starg.s l - IL_0034: br.s IL_0000 - - IL_0036: ldloc.3 - IL_0037: ldloc.2 - IL_0038: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_003d: ret - } - - } - - .class auto ansi serializable sealed nested assembly beforefieldinit 'f@27-1' - extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> - { - .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 condition - .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 condition) 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::.ctor() - IL_0006: ldarg.0 - IL_0007: ldarg.1 - IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 Verify13043/'f@27-1'::condition - IL_000d: ret - } - - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Invoke(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 _arg1) cil managed - { - - .maxstack 6 - .locals init (class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_0, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_1, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_2, - int32 V_3) - IL_0000: ldarg.1 - IL_0001: stloc.0 - IL_0002: ldloc.0 - IL_0003: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_0008: brfalse.s IL_000c - - IL_000a: br.s IL_0012 - - IL_000c: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() - IL_0011: ret - - IL_0012: ldloc.0 - IL_0013: stloc.1 - IL_0014: ldloc.1 - IL_0015: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_001a: stloc.2 - IL_001b: ldloc.1 - IL_001c: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() - IL_0021: stloc.3 - IL_0022: nop - IL_0023: ldarg.0 - IL_0024: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 Verify13043/'f@27-1'::condition - IL_0029: ldloc.3 - IL_002a: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) - IL_002f: brfalse.s IL_0036 - - IL_0031: ldloc.2 - IL_0032: starg.s _arg1 - IL_0034: br.s IL_0000 - - IL_0036: ldloc.3 - IL_0037: ldloc.2 - IL_0038: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_003d: ret - } - - } - - .class auto ansi serializable sealed nested assembly beforefieldinit matchResult@38 - extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 - { - .field static assembly initonly class Verify13043/matchResult@38 @_instance - .method assembly specialname rtspecialname instance void .ctor() 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::.ctor() - IL_0006: ret - } - - .method public strict virtual instance bool Invoke(int32 n) cil managed - { - - .maxstack 8 - IL_0000: ldarg.1 - IL_0001: call bool Verify13043::condition(int32) - IL_0006: ret - } - - .method private specialname rtspecialname static void .cctor() cil managed - { - - .maxstack 10 - IL_0000: newobj instance void Verify13043/matchResult@38::.ctor() - IL_0005: stsfld class Verify13043/matchResult@38 Verify13043/matchResult@38::@_instance - IL_000a: ret - } - - } - - .class auto ansi serializable sealed nested assembly beforefieldinit functionResult@43 - extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 - { - .field static assembly initonly class Verify13043/functionResult@43 @_instance - .method assembly specialname rtspecialname instance void .ctor() 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::.ctor() - IL_0006: ret - } - - .method public strict virtual instance bool Invoke(int32 n) cil managed - { - - .maxstack 8 - IL_0000: ldarg.1 - IL_0001: call bool Verify13043::condition(int32) - IL_0006: ret - } - - .method private specialname rtspecialname static void .cctor() cil managed - { - - .maxstack 10 - IL_0000: newobj instance void Verify13043/functionResult@43::.ctor() - IL_0005: stsfld class Verify13043/functionResult@43 Verify13043/functionResult@43::@_instance - IL_000a: ret - } - - } - - .method public specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 get_list() cil managed - { - - .maxstack 8 - IL_0000: ldsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$Verify13043::list@3 - IL_0005: ret - } - - .method public static bool condition(int32 n) cil managed - { - - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: ldc.i4.3 - IL_0002: clt - IL_0004: ret - } - - .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - dropWhileWithMatch(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 condition, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 list) cil managed - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) - - .maxstack 4 - .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> V_0) - IL_0000: ldarg.0 - IL_0001: newobj instance void Verify13043/f@8::.ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) - IL_0006: stloc.0 - IL_0007: ldloc.0 - IL_0008: ldarg.1 - IL_0009: tail. - IL_000b: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::Invoke(!0) - IL_0010: ret - } - - .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - dropWhileWithFunction(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 condition, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 list) cil managed - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) - - .maxstack 4 - .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> V_0) - IL_0000: ldarg.0 - IL_0001: newobj instance void Verify13043/'f@27-1'::.ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) - IL_0006: stloc.0 - IL_0007: ldloc.0 - IL_0008: ldarg.1 - IL_0009: tail. - IL_000b: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::Invoke(!0) - IL_0010: ret - } - - .method public specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 get_matchResult() cil managed - { - - .maxstack 8 - IL_0000: ldsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$Verify13043::matchResult@38 - IL_0005: ret - } - - .method public specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 get_functionResult() cil managed - { - - .maxstack 8 - IL_0000: ldsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$Verify13043::functionResult@43 - IL_0005: ret - } - - .property class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - list() - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) - .get class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Verify13043::get_list() - } - .property class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - matchResult() - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) - .get class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Verify13043::get_matchResult() - } - .property class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - functionResult() - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) - .get class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Verify13043::get_functionResult() - } -} - -.class private abstract auto ansi sealed ''.$Verify13043 - extends [runtime]System.Object -{ - .field static assembly class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 list@3 - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) - .field static assembly class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 matchResult@38 - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) - .field static assembly class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 functionResult@43 - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) - .field static assembly int32 init@ - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) - .method public static void main@() cil managed - { - .entrypoint - - .maxstack 6 - .locals init (class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_0, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_1, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_2) - IL_0000: ldc.i4.1 - IL_0001: ldc.i4.2 - IL_0002: ldc.i4.3 - IL_0003: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() - IL_0008: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_000d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_0012: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_0017: dup - IL_0018: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$Verify13043::list@3 - IL_001d: stloc.0 - IL_001e: ldsfld class Verify13043/matchResult@38 Verify13043/matchResult@38::@_instance - IL_0023: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Verify13043::get_list() - IL_0028: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Verify13043::dropWhileWithMatch(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_002d: dup - IL_002e: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$Verify13043::matchResult@38 - IL_0033: stloc.1 - IL_0034: ldstr "Match: %A" - IL_0039: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::.ctor(string) - IL_003e: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine,class [FSharp.Core]Microsoft.FSharp.Core.Unit>>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) - IL_0043: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Verify13043::get_matchResult() - IL_0048: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Core.Unit>::Invoke(!0) - IL_004d: pop - IL_004e: ldsfld class Verify13043/functionResult@43 Verify13043/functionResult@43::@_instance - IL_0053: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Verify13043::get_list() - IL_0058: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Verify13043::dropWhileWithFunction(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_005d: dup - IL_005e: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$Verify13043::functionResult@43 - IL_0063: stloc.2 - IL_0064: ldstr "Function: %A" - IL_0069: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::.ctor(string) - IL_006e: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine,class [FSharp.Core]Microsoft.FSharp.Core.Unit>>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) - IL_0073: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Verify13043::get_functionResult() - IL_0078: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Core.Unit>::Invoke(!0) - IL_007d: pop - IL_007e: ret - } - -} - - - - - - diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/Verify13043.fs.RealInternalSignatureOff.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/Verify13043.fs.RealInternalSignatureOff.il.release.bsl deleted file mode 100644 index f6fd1e69d10..00000000000 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/Verify13043.fs.RealInternalSignatureOff.il.release.bsl +++ /dev/null @@ -1,405 +0,0 @@ - - - - - -.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 FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - -} -.module assembly.exe - -.imagebase {value} -.file alignment 0x00000200 -.stackreserve 0x00100000 -.subsystem 0x0003 -.corflags 0x00000001 - - - - - -.class public abstract auto ansi sealed Verify13043 - 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 assembly beforefieldinit f@8 - extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> - { - .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 condition - .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 condition) 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::.ctor() - IL_0006: ldarg.0 - IL_0007: ldarg.1 - IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 Verify13043/f@8::condition - IL_000d: ret - } - - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Invoke(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 l) cil managed - { - - .maxstack 6 - .locals init (class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_0, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_1, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_2, - int32 V_3) - IL_0000: ldarg.1 - IL_0001: stloc.0 - IL_0002: ldloc.0 - IL_0003: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_0008: brfalse.s IL_000c - - IL_000a: br.s IL_0012 - - IL_000c: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() - IL_0011: ret - - IL_0012: ldloc.0 - IL_0013: stloc.1 - IL_0014: ldloc.1 - IL_0015: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_001a: stloc.2 - IL_001b: ldloc.1 - IL_001c: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() - IL_0021: stloc.3 - IL_0022: nop - IL_0023: ldarg.0 - IL_0024: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 Verify13043/f@8::condition - IL_0029: ldloc.3 - IL_002a: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) - IL_002f: brfalse.s IL_0036 - - IL_0031: ldloc.2 - IL_0032: starg.s l - IL_0034: br.s IL_0000 - - IL_0036: ldloc.3 - IL_0037: ldloc.2 - IL_0038: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_003d: ret - } - - } - - .class auto ansi serializable sealed nested assembly beforefieldinit 'f@27-1' - extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> - { - .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 condition - .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 condition) 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::.ctor() - IL_0006: ldarg.0 - IL_0007: ldarg.1 - IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 Verify13043/'f@27-1'::condition - IL_000d: ret - } - - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Invoke(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 _arg1) cil managed - { - - .maxstack 6 - .locals init (class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_0, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_1, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_2, - int32 V_3) - IL_0000: ldarg.1 - IL_0001: stloc.0 - IL_0002: ldloc.0 - IL_0003: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_0008: brfalse.s IL_000c - - IL_000a: br.s IL_0012 - - IL_000c: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() - IL_0011: ret - - IL_0012: ldloc.0 - IL_0013: stloc.1 - IL_0014: ldloc.1 - IL_0015: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_001a: stloc.2 - IL_001b: ldloc.1 - IL_001c: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() - IL_0021: stloc.3 - IL_0022: nop - IL_0023: ldarg.0 - IL_0024: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 Verify13043/'f@27-1'::condition - IL_0029: ldloc.3 - IL_002a: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) - IL_002f: brfalse.s IL_0036 - - IL_0031: ldloc.2 - IL_0032: starg.s _arg1 - IL_0034: br.s IL_0000 - - IL_0036: ldloc.3 - IL_0037: ldloc.2 - IL_0038: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_003d: ret - } - - } - - .class auto ansi serializable sealed nested assembly beforefieldinit matchResult@38 - extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 - { - .field static assembly initonly class Verify13043/matchResult@38 @_instance - .method assembly specialname rtspecialname instance void .ctor() 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::.ctor() - IL_0006: ret - } - - .method public strict virtual instance bool Invoke(int32 n) cil managed - { - - .maxstack 8 - IL_0000: ldarg.1 - IL_0001: call bool Verify13043::condition(int32) - IL_0006: ret - } - - .method private specialname rtspecialname static void .cctor() cil managed - { - - .maxstack 10 - IL_0000: newobj instance void Verify13043/matchResult@38::.ctor() - IL_0005: stsfld class Verify13043/matchResult@38 Verify13043/matchResult@38::@_instance - IL_000a: ret - } - - } - - .class auto ansi serializable sealed nested assembly beforefieldinit functionResult@43 - extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 - { - .field static assembly initonly class Verify13043/functionResult@43 @_instance - .method assembly specialname rtspecialname instance void .ctor() 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::.ctor() - IL_0006: ret - } - - .method public strict virtual instance bool Invoke(int32 n) cil managed - { - - .maxstack 8 - IL_0000: ldarg.1 - IL_0001: call bool Verify13043::condition(int32) - IL_0006: ret - } - - .method private specialname rtspecialname static void .cctor() cil managed - { - - .maxstack 10 - IL_0000: newobj instance void Verify13043/functionResult@43::.ctor() - IL_0005: stsfld class Verify13043/functionResult@43 Verify13043/functionResult@43::@_instance - IL_000a: ret - } - - } - - .method public specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 get_list() cil managed - { - - .maxstack 8 - IL_0000: ldsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$Verify13043::list@3 - IL_0005: ret - } - - .method public static bool condition(int32 n) cil managed - { - - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: ldc.i4.3 - IL_0002: clt - IL_0004: ret - } - - .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - dropWhileWithMatch(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 condition, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 list) cil managed - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) - - .maxstack 4 - .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> V_0) - IL_0000: ldarg.0 - IL_0001: newobj instance void Verify13043/f@8::.ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) - IL_0006: stloc.0 - IL_0007: ldloc.0 - IL_0008: ldarg.1 - IL_0009: tail. - IL_000b: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::Invoke(!0) - IL_0010: ret - } - - .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - dropWhileWithFunction(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 condition, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 list) cil managed - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) - - .maxstack 4 - .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> V_0) - IL_0000: ldarg.0 - IL_0001: newobj instance void Verify13043/'f@27-1'::.ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) - IL_0006: stloc.0 - IL_0007: ldloc.0 - IL_0008: ldarg.1 - IL_0009: tail. - IL_000b: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::Invoke(!0) - IL_0010: ret - } - - .method public specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 get_matchResult() cil managed - { - - .maxstack 8 - IL_0000: ldsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$Verify13043::matchResult@38 - IL_0005: ret - } - - .method public specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 get_functionResult() cil managed - { - - .maxstack 8 - IL_0000: ldsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$Verify13043::functionResult@43 - IL_0005: ret - } - - .property class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - list() - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) - .get class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Verify13043::get_list() - } - .property class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - matchResult() - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) - .get class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Verify13043::get_matchResult() - } - .property class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - functionResult() - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) - .get class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Verify13043::get_functionResult() - } -} - -.class private abstract auto ansi sealed ''.$Verify13043 - extends [runtime]System.Object -{ - .field static assembly class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 list@3 - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) - .field static assembly class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 matchResult@38 - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) - .field static assembly class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 functionResult@43 - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) - .field static assembly int32 init@ - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) - .method public static void main@() cil managed - { - .entrypoint - - .maxstack 6 - .locals init (class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_0, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_1, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_2) - IL_0000: ldc.i4.1 - IL_0001: ldc.i4.2 - IL_0002: ldc.i4.3 - IL_0003: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() - IL_0008: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_000d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_0012: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_0017: dup - IL_0018: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$Verify13043::list@3 - IL_001d: stloc.0 - IL_001e: ldsfld class Verify13043/matchResult@38 Verify13043/matchResult@38::@_instance - IL_0023: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Verify13043::get_list() - IL_0028: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Verify13043::dropWhileWithMatch(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_002d: dup - IL_002e: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$Verify13043::matchResult@38 - IL_0033: stloc.1 - IL_0034: ldstr "Match: %A" - IL_0039: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::.ctor(string) - IL_003e: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine,class [FSharp.Core]Microsoft.FSharp.Core.Unit>>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) - IL_0043: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Verify13043::get_matchResult() - IL_0048: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Core.Unit>::Invoke(!0) - IL_004d: pop - IL_004e: ldsfld class Verify13043/functionResult@43 Verify13043/functionResult@43::@_instance - IL_0053: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Verify13043::get_list() - IL_0058: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Verify13043::dropWhileWithFunction(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_005d: dup - IL_005e: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$Verify13043::functionResult@43 - IL_0063: stloc.2 - IL_0064: ldstr "Function: %A" - IL_0069: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::.ctor(string) - IL_006e: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine,class [FSharp.Core]Microsoft.FSharp.Core.Unit>>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) - IL_0073: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Verify13043::get_functionResult() - IL_0078: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Core.Unit>::Invoke(!0) - IL_007d: pop - IL_007e: ret - } - -} - - - - - - diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/Verify13043.fs.RealInternalSignatureOff.OptimizeOn.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/Verify13043.fs.RealInternalSignatureOn.OptimizeOn.il.debug.bsl similarity index 57% rename from tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/Verify13043.fs.RealInternalSignatureOff.OptimizeOn.il.bsl rename to tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/Verify13043.fs.RealInternalSignatureOn.OptimizeOn.il.debug.bsl index 3198f042779..58a96db5e27 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/Verify13043.fs.RealInternalSignatureOff.OptimizeOn.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/Verify13043.fs.RealInternalSignatureOn.OptimizeOn.il.debug.bsl @@ -33,136 +33,6 @@ 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 assembly beforefieldinit f@8 - extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> - { - .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 condition - .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 condition) 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::.ctor() - IL_0006: ldarg.0 - IL_0007: ldarg.1 - IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 assembly/f@8::condition - IL_000d: ret - } - - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Invoke(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 l) cil managed - { - - .maxstack 6 - .locals init (class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_0, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_1, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_2, - int32 V_3) - IL_0000: ldarg.1 - IL_0001: stloc.0 - IL_0002: ldloc.0 - IL_0003: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_0008: brfalse.s IL_000c - - IL_000a: br.s IL_0012 - - IL_000c: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() - IL_0011: ret - - IL_0012: ldloc.0 - IL_0013: stloc.1 - IL_0014: ldloc.1 - IL_0015: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_001a: stloc.2 - IL_001b: ldloc.1 - IL_001c: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() - IL_0021: stloc.3 - IL_0022: nop - IL_0023: ldarg.0 - IL_0024: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 assembly/f@8::condition - IL_0029: ldloc.3 - IL_002a: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) - IL_002f: brfalse.s IL_0036 - - IL_0031: ldloc.2 - IL_0032: starg.s l - IL_0034: br.s IL_0000 - - IL_0036: ldloc.3 - IL_0037: ldloc.2 - IL_0038: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_003d: ret - } - - } - - .class auto ansi serializable sealed nested assembly beforefieldinit 'f@27-1' - extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> - { - .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 condition - .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 condition) 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::.ctor() - IL_0006: ldarg.0 - IL_0007: ldarg.1 - IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 assembly/'f@27-1'::condition - IL_000d: ret - } - - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Invoke(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 _arg1) cil managed - { - - .maxstack 6 - .locals init (class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_0, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_1, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_2, - int32 V_3) - IL_0000: ldarg.1 - IL_0001: stloc.0 - IL_0002: ldloc.0 - IL_0003: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_0008: brfalse.s IL_000c - - IL_000a: br.s IL_0012 - - IL_000c: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() - IL_0011: ret - - IL_0012: ldloc.0 - IL_0013: stloc.1 - IL_0014: ldloc.1 - IL_0015: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_001a: stloc.2 - IL_001b: ldloc.1 - IL_001c: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() - IL_0021: stloc.3 - IL_0022: nop - IL_0023: ldarg.0 - IL_0024: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 assembly/'f@27-1'::condition - IL_0029: ldloc.3 - IL_002a: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) - IL_002f: brfalse.s IL_0036 - - IL_0031: ldloc.2 - IL_0032: starg.s _arg1 - IL_0034: br.s IL_0000 - - IL_0036: ldloc.3 - IL_0037: ldloc.2 - IL_0038: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_003d: ret - } - - } - .class auto ansi serializable sealed nested assembly beforefieldinit matchResult@38 extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 { @@ -183,8 +53,9 @@ .maxstack 8 IL_0000: ldarg.1 - IL_0001: call bool assembly::condition(int32) - IL_0006: ret + IL_0001: ldc.i4.3 + IL_0002: clt + IL_0004: ret } .method private specialname rtspecialname static void .cctor() cil managed @@ -218,8 +89,9 @@ .maxstack 8 IL_0000: ldarg.1 - IL_0001: call bool assembly::condition(int32) - IL_0006: ret + IL_0001: ldc.i4.3 + IL_0002: clt + IL_0004: ret } .method private specialname rtspecialname static void .cctor() cil managed @@ -251,20 +123,106 @@ IL_0004: ret } + .method assembly static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f@7(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 condition, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 l) cil managed + { + + .maxstack 4 + .locals init (class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_0, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_1, + int32 V_2) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0007: brfalse.s IL_000b + + IL_0009: br.s IL_0011 + + IL_000b: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() + IL_0010: ret + + IL_0011: ldarg.1 + IL_0012: stloc.0 + IL_0013: ldloc.0 + IL_0014: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0019: stloc.1 + IL_001a: ldloc.0 + IL_001b: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_0020: stloc.2 + IL_0021: nop + IL_0022: ldarg.0 + IL_0023: ldloc.2 + IL_0024: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0029: brfalse.s IL_0033 + + IL_002b: ldarg.0 + IL_002c: ldloc.1 + IL_002d: starg.s l + IL_002f: starg.s condition + IL_0031: br.s IL_0000 + + IL_0033: ldloc.2 + IL_0034: ldloc.1 + IL_0035: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_003a: ret + } + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 dropWhileWithMatch(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 condition, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 list) cil managed { .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) .maxstack 4 - .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> V_0) + .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 V_0) IL_0000: ldarg.0 - IL_0001: newobj instance void assembly/f@8::.ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) - IL_0006: stloc.0 - IL_0007: ldloc.0 - IL_0008: ldarg.1 - IL_0009: tail. - IL_000b: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::Invoke(!0) - IL_0010: ret + IL_0001: stloc.0 + IL_0002: ldarg.0 + IL_0003: ldarg.1 + IL_0004: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::f@7(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_0009: ret + } + + .method assembly static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'f@26-1'(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 condition, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 _arg1) cil managed + { + + .maxstack 4 + .locals init (class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_0, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_1, + int32 V_2) + IL_0000: ldarg.1 + IL_0001: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0006: brfalse.s IL_000a + + IL_0008: br.s IL_0010 + + IL_000a: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() + IL_000f: ret + + IL_0010: ldarg.1 + IL_0011: stloc.0 + IL_0012: ldloc.0 + IL_0013: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0018: stloc.1 + IL_0019: ldloc.0 + IL_001a: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_001f: stloc.2 + IL_0020: nop + IL_0021: ldarg.0 + IL_0022: ldloc.2 + IL_0023: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0028: brfalse.s IL_0032 + + IL_002a: ldarg.0 + IL_002b: ldloc.1 + IL_002c: starg.s _arg1 + IL_002e: starg.s condition + IL_0030: br.s IL_0000 + + IL_0032: ldloc.2 + IL_0033: ldloc.1 + IL_0034: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_0039: ret } .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 dropWhileWithFunction(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 condition, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 list) cil managed @@ -272,15 +230,14 @@ .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) .maxstack 4 - .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> V_0) + .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 V_0) IL_0000: ldarg.0 - IL_0001: newobj instance void assembly/'f@27-1'::.ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) - IL_0006: stloc.0 - IL_0007: ldloc.0 - IL_0008: ldarg.1 - IL_0009: tail. - IL_000b: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::Invoke(!0) - IL_0010: ret + IL_0001: stloc.0 + IL_0002: ldarg.0 + IL_0003: ldarg.1 + IL_0004: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::'f@26-1'(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_0009: ret } .method public specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 get_matchResult() cil managed @@ -337,9 +294,6 @@ .entrypoint .maxstack 6 - .locals init (class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_0, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_1, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_2) IL_0000: ldc.i4.1 IL_0001: ldc.i4.2 IL_0002: ldc.i4.3 @@ -350,36 +304,30 @@ class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) IL_0012: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_0017: dup - IL_0018: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::list@3 - IL_001d: stloc.0 - IL_001e: ldsfld class assembly/matchResult@38 assembly/matchResult@38::@_instance - IL_0023: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_list() - IL_0028: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::dropWhileWithMatch(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, + IL_0017: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::list@3 + IL_001c: ldsfld class assembly/matchResult@38 assembly/matchResult@38::@_instance + IL_0021: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_list() + IL_0026: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::dropWhileWithMatch(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_002d: dup - IL_002e: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::matchResult@38 - IL_0033: stloc.1 - IL_0034: ldstr "Match: %A" - IL_0039: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::.ctor(string) - IL_003e: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine,class [FSharp.Core]Microsoft.FSharp.Core.Unit>>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) - IL_0043: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_matchResult() - IL_0048: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Core.Unit>::Invoke(!0) - IL_004d: pop - IL_004e: ldsfld class assembly/functionResult@43 assembly/functionResult@43::@_instance - IL_0053: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_list() - IL_0058: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::dropWhileWithFunction(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, + IL_002b: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::matchResult@38 + IL_0030: ldstr "Match: %A" + IL_0035: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::.ctor(string) + IL_003a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine,class [FSharp.Core]Microsoft.FSharp.Core.Unit>>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_003f: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_matchResult() + IL_0044: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Core.Unit>::Invoke(!0) + IL_0049: pop + IL_004a: ldsfld class assembly/functionResult@43 assembly/functionResult@43::@_instance + IL_004f: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_list() + IL_0054: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::dropWhileWithFunction(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_005d: dup - IL_005e: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::functionResult@43 - IL_0063: stloc.2 - IL_0064: ldstr "Function: %A" - IL_0069: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::.ctor(string) - IL_006e: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine,class [FSharp.Core]Microsoft.FSharp.Core.Unit>>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) - IL_0073: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_functionResult() - IL_0078: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Core.Unit>::Invoke(!0) - IL_007d: pop - IL_007e: ret + IL_0059: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::functionResult@43 + IL_005e: ldstr "Function: %A" + IL_0063: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::.ctor(string) + IL_0068: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine,class [FSharp.Core]Microsoft.FSharp.Core.Unit>>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_006d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_functionResult() + IL_0072: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Core.Unit>::Invoke(!0) + IL_0077: pop + IL_0078: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/Verify13043.fs.RealInternalSignatureOn.OptimizeOn.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/Verify13043.fs.RealInternalSignatureOn.OptimizeOn.il.release.bsl new file mode 100644 index 00000000000..dc747ca00e0 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/Verify13043.fs.RealInternalSignatureOn.OptimizeOn.il.release.bsl @@ -0,0 +1,384 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly extern netstandard +{ + .publickeytoken = (CC 7B 13 FF CD 2D DD 51 ) + .ver 2:1:0:0 +} +.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 +} +.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 assembly beforefieldinit matchResult@38 + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 + { + .field static assembly initonly class assembly/matchResult@38 @_instance + .method assembly specialname rtspecialname instance void .ctor() 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::.ctor() + IL_0006: ret + } + + .method public strict virtual instance bool Invoke(int32 n) cil managed + { + + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: ldc.i4.3 + IL_0002: clt + IL_0004: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 10 + IL_0000: newobj instance void assembly/matchResult@38::.ctor() + IL_0005: stsfld class assembly/matchResult@38 assembly/matchResult@38::@_instance + IL_000a: ret + } + + } + + .class auto ansi serializable sealed nested assembly beforefieldinit functionResult@43 + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 + { + .field static assembly initonly class assembly/functionResult@43 @_instance + .method assembly specialname rtspecialname instance void .ctor() 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::.ctor() + IL_0006: ret + } + + .method public strict virtual instance bool Invoke(int32 n) cil managed + { + + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: ldc.i4.3 + IL_0002: clt + IL_0004: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 10 + IL_0000: newobj instance void assembly/functionResult@43::.ctor() + IL_0005: stsfld class assembly/functionResult@43 assembly/functionResult@43::@_instance + IL_000a: ret + } + + } + + .method public specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 get_list() cil managed + { + + .maxstack 8 + IL_0000: ldsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::list@3 + IL_0005: ret + } + + .method public static bool condition(int32 n) cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldc.i4.3 + IL_0002: clt + IL_0004: ret + } + + .method assembly static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f@7(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 condition, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 l) cil managed + { + + .maxstack 4 + .locals init (class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_0, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_1, + int32 V_2) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0007: brfalse.s IL_000b + + IL_0009: br.s IL_0011 + + IL_000b: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() + IL_0010: ret + + IL_0011: ldarg.1 + IL_0012: stloc.0 + IL_0013: ldloc.0 + IL_0014: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0019: stloc.1 + IL_001a: ldloc.0 + IL_001b: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_0020: stloc.2 + IL_0021: nop + IL_0022: ldarg.0 + IL_0023: ldloc.2 + IL_0024: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0029: brfalse.s IL_0033 + + IL_002b: ldarg.0 + IL_002c: ldloc.1 + IL_002d: starg.s l + IL_002f: starg.s condition + IL_0031: br.s IL_0000 + + IL_0033: ldloc.2 + IL_0034: ldloc.1 + IL_0035: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_003a: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 dropWhileWithMatch(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 condition, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 list) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 4 + .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 V_0) + IL_0000: ldarg.0 + IL_0001: stloc.0 + IL_0002: ldarg.0 + IL_0003: ldarg.1 + IL_0004: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::f@7(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_0009: ret + } + + .method assembly static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'f@26-1'(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 condition, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 _arg1) cil managed + { + + .maxstack 4 + .locals init (class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_0, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_1, + int32 V_2) + IL_0000: ldarg.1 + IL_0001: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0006: brfalse.s IL_000a + + IL_0008: br.s IL_0010 + + IL_000a: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() + IL_000f: ret + + IL_0010: ldarg.1 + IL_0011: stloc.0 + IL_0012: ldloc.0 + IL_0013: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0018: stloc.1 + IL_0019: ldloc.0 + IL_001a: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_001f: stloc.2 + IL_0020: nop + IL_0021: ldarg.0 + IL_0022: ldloc.2 + IL_0023: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0028: brfalse.s IL_0032 + + IL_002a: ldarg.0 + IL_002b: ldloc.1 + IL_002c: starg.s _arg1 + IL_002e: starg.s condition + IL_0030: br.s IL_0000 + + IL_0032: ldloc.2 + IL_0033: ldloc.1 + IL_0034: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_0039: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 dropWhileWithFunction(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 condition, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 list) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 4 + .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 V_0) + IL_0000: ldarg.0 + IL_0001: stloc.0 + IL_0002: ldarg.0 + IL_0003: ldarg.1 + IL_0004: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::'f@26-1'(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_0009: ret + } + + .method public specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 get_matchResult() cil managed + { + + .maxstack 8 + IL_0000: ldsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::matchResult@38 + IL_0005: ret + } + + .method assembly specialname static class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit> get_format@1() cil managed + { + + .maxstack 8 + IL_0000: ldsfld class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit> ''.$assembly::format@1 + IL_0005: ret + } + + .method public specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 get_functionResult() cil managed + { + + .maxstack 8 + IL_0000: ldsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::functionResult@43 + IL_0005: ret + } + + .method assembly specialname static class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit> 'get_format@1-1'() cil managed + { + + .maxstack 8 + IL_0000: ldsfld class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit> ''.$assembly::'format@1-1' + IL_0005: ret + } + + .property class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 + list() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) + .get class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_list() + } + .property class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 + matchResult() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) + .get class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_matchResult() + } + .property class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit> + format@1() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) + .get class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit> assembly::get_format@1() + } + .property class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 + functionResult() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) + .get class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_functionResult() + } + .property class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit> + 'format@1-1'() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) + .get class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit> assembly::'get_format@1-1'() + } +} + +.class private abstract auto ansi sealed ''.$assembly + extends [runtime]System.Object +{ + .field static assembly class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 list@3 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .field static assembly class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 matchResult@38 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .field static assembly class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit> format@1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .field static assembly class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 functionResult@43 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .field static assembly class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit> 'format@1-1' + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .field static assembly int32 init@ + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 6 + IL_0000: ldc.i4.1 + IL_0001: ldc.i4.2 + IL_0002: ldc.i4.3 + IL_0003: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() + IL_0008: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_000d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_0012: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_0017: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::list@3 + IL_001c: ldsfld class assembly/matchResult@38 assembly/matchResult@38::@_instance + IL_0021: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_list() + IL_0026: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::dropWhileWithMatch(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_002b: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::matchResult@38 + IL_0030: ldstr "Match: %A" + IL_0035: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::.ctor(string) + IL_003a: stsfld class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit> ''.$assembly::format@1 + IL_003f: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() + IL_0044: call class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit> assembly::get_format@1() + IL_0049: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit>>(class [runtime]System.IO.TextWriter, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_004e: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_matchResult() + IL_0053: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Core.Unit>::Invoke(!0) + IL_0058: pop + IL_0059: ldsfld class assembly/functionResult@43 assembly/functionResult@43::@_instance + IL_005e: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_list() + IL_0063: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::dropWhileWithFunction(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_0068: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$assembly::functionResult@43 + IL_006d: ldstr "Function: %A" + IL_0072: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::.ctor(string) + IL_0077: stsfld class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit> ''.$assembly::'format@1-1' + IL_007c: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() + IL_0081: call class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit> assembly::'get_format@1-1'() + IL_0086: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit>>(class [runtime]System.IO.TextWriter, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_008b: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_functionResult() + IL_0090: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Core.Unit>::Invoke(!0) + IL_0095: pop + IL_0096: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/Verify13043.fs.RealInternalSignatureOn.il.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/Verify13043.fs.RealInternalSignatureOn.il.debug.bsl deleted file mode 100644 index ffb2898dcf8..00000000000 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/Verify13043.fs.RealInternalSignatureOn.il.debug.bsl +++ /dev/null @@ -1,415 +0,0 @@ - - - - - -.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 FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - -} -.module assembly.exe - -.imagebase {value} -.file alignment 0x00000200 -.stackreserve 0x00100000 -.subsystem 0x0003 -.corflags 0x00000001 - - - - - -.class public abstract auto ansi sealed Verify13043 - 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 assembly beforefieldinit f@8 - extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> - { - .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 condition - .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 condition) 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::.ctor() - IL_0006: ldarg.0 - IL_0007: ldarg.1 - IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 Verify13043/f@8::condition - IL_000d: ret - } - - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Invoke(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 l) cil managed - { - - .maxstack 6 - .locals init (class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_0, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_1, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_2, - int32 V_3) - IL_0000: ldarg.1 - IL_0001: stloc.0 - IL_0002: ldloc.0 - IL_0003: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_0008: brfalse.s IL_000c - - IL_000a: br.s IL_0012 - - IL_000c: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() - IL_0011: ret - - IL_0012: ldloc.0 - IL_0013: stloc.1 - IL_0014: ldloc.1 - IL_0015: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_001a: stloc.2 - IL_001b: ldloc.1 - IL_001c: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() - IL_0021: stloc.3 - IL_0022: nop - IL_0023: ldarg.0 - IL_0024: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 Verify13043/f@8::condition - IL_0029: ldloc.3 - IL_002a: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) - IL_002f: brfalse.s IL_0036 - - IL_0031: ldloc.2 - IL_0032: starg.s l - IL_0034: br.s IL_0000 - - IL_0036: ldloc.3 - IL_0037: ldloc.2 - IL_0038: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_003d: ret - } - - } - - .class auto ansi serializable sealed nested assembly beforefieldinit 'f@27-1' - extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> - { - .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 condition - .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 condition) 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::.ctor() - IL_0006: ldarg.0 - IL_0007: ldarg.1 - IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 Verify13043/'f@27-1'::condition - IL_000d: ret - } - - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Invoke(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 _arg1) cil managed - { - - .maxstack 6 - .locals init (class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_0, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_1, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_2, - int32 V_3) - IL_0000: ldarg.1 - IL_0001: stloc.0 - IL_0002: ldloc.0 - IL_0003: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_0008: brfalse.s IL_000c - - IL_000a: br.s IL_0012 - - IL_000c: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() - IL_0011: ret - - IL_0012: ldloc.0 - IL_0013: stloc.1 - IL_0014: ldloc.1 - IL_0015: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_001a: stloc.2 - IL_001b: ldloc.1 - IL_001c: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() - IL_0021: stloc.3 - IL_0022: nop - IL_0023: ldarg.0 - IL_0024: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 Verify13043/'f@27-1'::condition - IL_0029: ldloc.3 - IL_002a: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) - IL_002f: brfalse.s IL_0036 - - IL_0031: ldloc.2 - IL_0032: starg.s _arg1 - IL_0034: br.s IL_0000 - - IL_0036: ldloc.3 - IL_0037: ldloc.2 - IL_0038: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_003d: ret - } - - } - - .class auto ansi serializable sealed nested assembly beforefieldinit matchResult@38 - extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 - { - .field static assembly initonly class Verify13043/matchResult@38 @_instance - .method assembly specialname rtspecialname instance void .ctor() 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::.ctor() - IL_0006: ret - } - - .method public strict virtual instance bool Invoke(int32 n) cil managed - { - - .maxstack 8 - IL_0000: ldarg.1 - IL_0001: call bool Verify13043::condition(int32) - IL_0006: ret - } - - .method private specialname rtspecialname static void .cctor() cil managed - { - - .maxstack 10 - IL_0000: newobj instance void Verify13043/matchResult@38::.ctor() - IL_0005: stsfld class Verify13043/matchResult@38 Verify13043/matchResult@38::@_instance - IL_000a: ret - } - - } - - .class auto ansi serializable sealed nested assembly beforefieldinit functionResult@43 - extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 - { - .field static assembly initonly class Verify13043/functionResult@43 @_instance - .method assembly specialname rtspecialname instance void .ctor() 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::.ctor() - IL_0006: ret - } - - .method public strict virtual instance bool Invoke(int32 n) cil managed - { - - .maxstack 8 - IL_0000: ldarg.1 - IL_0001: call bool Verify13043::condition(int32) - IL_0006: ret - } - - .method private specialname rtspecialname static void .cctor() cil managed - { - - .maxstack 10 - IL_0000: newobj instance void Verify13043/functionResult@43::.ctor() - IL_0005: stsfld class Verify13043/functionResult@43 Verify13043/functionResult@43::@_instance - IL_000a: ret - } - - } - - .field static assembly class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 list@3 - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) - .field static assembly class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 matchResult@38 - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) - .field static assembly class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 functionResult@43 - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) - .method public specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 get_list() cil managed - { - - .maxstack 8 - IL_0000: ldsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Verify13043::list@3 - IL_0005: ret - } - - .method public static bool condition(int32 n) cil managed - { - - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: ldc.i4.3 - IL_0002: clt - IL_0004: ret - } - - .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - dropWhileWithMatch(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 condition, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 list) cil managed - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) - - .maxstack 4 - .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> V_0) - IL_0000: ldarg.0 - IL_0001: newobj instance void Verify13043/f@8::.ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) - IL_0006: stloc.0 - IL_0007: ldloc.0 - IL_0008: ldarg.1 - IL_0009: tail. - IL_000b: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::Invoke(!0) - IL_0010: ret - } - - .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - dropWhileWithFunction(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 condition, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 list) cil managed - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) - - .maxstack 4 - .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> V_0) - IL_0000: ldarg.0 - IL_0001: newobj instance void Verify13043/'f@27-1'::.ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) - IL_0006: stloc.0 - IL_0007: ldloc.0 - IL_0008: ldarg.1 - IL_0009: tail. - IL_000b: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::Invoke(!0) - IL_0010: ret - } - - .method public specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 get_matchResult() cil managed - { - - .maxstack 8 - IL_0000: ldsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Verify13043::matchResult@38 - IL_0005: ret - } - - .method public specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 get_functionResult() cil managed - { - - .maxstack 8 - IL_0000: ldsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Verify13043::functionResult@43 - IL_0005: ret - } - - .method private specialname rtspecialname static void .cctor() cil managed - { - - .maxstack 8 - IL_0000: ldc.i4.0 - IL_0001: stsfld int32 ''.$Verify13043::init@ - IL_0006: ldsfld int32 ''.$Verify13043::init@ - IL_000b: pop - IL_000c: ret - } - - .method assembly specialname static void staticInitialization@() cil managed - { - - .maxstack 6 - IL_0000: ldc.i4.1 - IL_0001: ldc.i4.2 - IL_0002: ldc.i4.3 - IL_0003: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() - IL_0008: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_000d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_0012: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_0017: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Verify13043::list@3 - IL_001c: ldsfld class Verify13043/matchResult@38 Verify13043/matchResult@38::@_instance - IL_0021: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Verify13043::get_list() - IL_0026: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Verify13043::dropWhileWithMatch(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_002b: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Verify13043::matchResult@38 - IL_0030: ldstr "Match: %A" - IL_0035: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::.ctor(string) - IL_003a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine,class [FSharp.Core]Microsoft.FSharp.Core.Unit>>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) - IL_003f: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Verify13043::get_matchResult() - IL_0044: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Core.Unit>::Invoke(!0) - IL_0049: pop - IL_004a: ldsfld class Verify13043/functionResult@43 Verify13043/functionResult@43::@_instance - IL_004f: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Verify13043::get_list() - IL_0054: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Verify13043::dropWhileWithFunction(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_0059: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Verify13043::functionResult@43 - IL_005e: ldstr "Function: %A" - IL_0063: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::.ctor(string) - IL_0068: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine,class [FSharp.Core]Microsoft.FSharp.Core.Unit>>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) - IL_006d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Verify13043::get_functionResult() - IL_0072: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Core.Unit>::Invoke(!0) - IL_0077: pop - IL_0078: ret - } - - .property class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - list() - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) - .get class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Verify13043::get_list() - } - .property class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - matchResult() - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) - .get class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Verify13043::get_matchResult() - } - .property class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - functionResult() - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) - .get class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Verify13043::get_functionResult() - } -} - -.class private abstract auto ansi sealed ''.$Verify13043 - extends [runtime]System.Object -{ - .field static assembly int32 init@ - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) - .method public static void main@() cil managed - { - .entrypoint - - .maxstack 8 - IL_0000: call void Verify13043::staticInitialization@() - IL_0005: ret - } - -} - - - - - - diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/Verify13043.fs.RealInternalSignatureOn.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/Verify13043.fs.RealInternalSignatureOn.il.release.bsl deleted file mode 100644 index ffb2898dcf8..00000000000 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TestFunctions/Verify13043.fs.RealInternalSignatureOn.il.release.bsl +++ /dev/null @@ -1,415 +0,0 @@ - - - - - -.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 FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - -} -.module assembly.exe - -.imagebase {value} -.file alignment 0x00000200 -.stackreserve 0x00100000 -.subsystem 0x0003 -.corflags 0x00000001 - - - - - -.class public abstract auto ansi sealed Verify13043 - 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 assembly beforefieldinit f@8 - extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> - { - .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 condition - .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 condition) 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::.ctor() - IL_0006: ldarg.0 - IL_0007: ldarg.1 - IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 Verify13043/f@8::condition - IL_000d: ret - } - - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Invoke(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 l) cil managed - { - - .maxstack 6 - .locals init (class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_0, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_1, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_2, - int32 V_3) - IL_0000: ldarg.1 - IL_0001: stloc.0 - IL_0002: ldloc.0 - IL_0003: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_0008: brfalse.s IL_000c - - IL_000a: br.s IL_0012 - - IL_000c: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() - IL_0011: ret - - IL_0012: ldloc.0 - IL_0013: stloc.1 - IL_0014: ldloc.1 - IL_0015: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_001a: stloc.2 - IL_001b: ldloc.1 - IL_001c: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() - IL_0021: stloc.3 - IL_0022: nop - IL_0023: ldarg.0 - IL_0024: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 Verify13043/f@8::condition - IL_0029: ldloc.3 - IL_002a: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) - IL_002f: brfalse.s IL_0036 - - IL_0031: ldloc.2 - IL_0032: starg.s l - IL_0034: br.s IL_0000 - - IL_0036: ldloc.3 - IL_0037: ldloc.2 - IL_0038: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_003d: ret - } - - } - - .class auto ansi serializable sealed nested assembly beforefieldinit 'f@27-1' - extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> - { - .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 condition - .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 condition) 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::.ctor() - IL_0006: ldarg.0 - IL_0007: ldarg.1 - IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 Verify13043/'f@27-1'::condition - IL_000d: ret - } - - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Invoke(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 _arg1) cil managed - { - - .maxstack 6 - .locals init (class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_0, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_1, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_2, - int32 V_3) - IL_0000: ldarg.1 - IL_0001: stloc.0 - IL_0002: ldloc.0 - IL_0003: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_0008: brfalse.s IL_000c - - IL_000a: br.s IL_0012 - - IL_000c: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() - IL_0011: ret - - IL_0012: ldloc.0 - IL_0013: stloc.1 - IL_0014: ldloc.1 - IL_0015: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_001a: stloc.2 - IL_001b: ldloc.1 - IL_001c: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() - IL_0021: stloc.3 - IL_0022: nop - IL_0023: ldarg.0 - IL_0024: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 Verify13043/'f@27-1'::condition - IL_0029: ldloc.3 - IL_002a: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) - IL_002f: brfalse.s IL_0036 - - IL_0031: ldloc.2 - IL_0032: starg.s _arg1 - IL_0034: br.s IL_0000 - - IL_0036: ldloc.3 - IL_0037: ldloc.2 - IL_0038: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_003d: ret - } - - } - - .class auto ansi serializable sealed nested assembly beforefieldinit matchResult@38 - extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 - { - .field static assembly initonly class Verify13043/matchResult@38 @_instance - .method assembly specialname rtspecialname instance void .ctor() 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::.ctor() - IL_0006: ret - } - - .method public strict virtual instance bool Invoke(int32 n) cil managed - { - - .maxstack 8 - IL_0000: ldarg.1 - IL_0001: call bool Verify13043::condition(int32) - IL_0006: ret - } - - .method private specialname rtspecialname static void .cctor() cil managed - { - - .maxstack 10 - IL_0000: newobj instance void Verify13043/matchResult@38::.ctor() - IL_0005: stsfld class Verify13043/matchResult@38 Verify13043/matchResult@38::@_instance - IL_000a: ret - } - - } - - .class auto ansi serializable sealed nested assembly beforefieldinit functionResult@43 - extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 - { - .field static assembly initonly class Verify13043/functionResult@43 @_instance - .method assembly specialname rtspecialname instance void .ctor() 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 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::.ctor() - IL_0006: ret - } - - .method public strict virtual instance bool Invoke(int32 n) cil managed - { - - .maxstack 8 - IL_0000: ldarg.1 - IL_0001: call bool Verify13043::condition(int32) - IL_0006: ret - } - - .method private specialname rtspecialname static void .cctor() cil managed - { - - .maxstack 10 - IL_0000: newobj instance void Verify13043/functionResult@43::.ctor() - IL_0005: stsfld class Verify13043/functionResult@43 Verify13043/functionResult@43::@_instance - IL_000a: ret - } - - } - - .field static assembly class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 list@3 - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) - .field static assembly class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 matchResult@38 - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) - .field static assembly class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 functionResult@43 - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) - .method public specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 get_list() cil managed - { - - .maxstack 8 - IL_0000: ldsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Verify13043::list@3 - IL_0005: ret - } - - .method public static bool condition(int32 n) cil managed - { - - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: ldc.i4.3 - IL_0002: clt - IL_0004: ret - } - - .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - dropWhileWithMatch(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 condition, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 list) cil managed - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) - - .maxstack 4 - .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> V_0) - IL_0000: ldarg.0 - IL_0001: newobj instance void Verify13043/f@8::.ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) - IL_0006: stloc.0 - IL_0007: ldloc.0 - IL_0008: ldarg.1 - IL_0009: tail. - IL_000b: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::Invoke(!0) - IL_0010: ret - } - - .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - dropWhileWithFunction(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 condition, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 list) cil managed - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) - - .maxstack 4 - .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> V_0) - IL_0000: ldarg.0 - IL_0001: newobj instance void Verify13043/'f@27-1'::.ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) - IL_0006: stloc.0 - IL_0007: ldloc.0 - IL_0008: ldarg.1 - IL_0009: tail. - IL_000b: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::Invoke(!0) - IL_0010: ret - } - - .method public specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 get_matchResult() cil managed - { - - .maxstack 8 - IL_0000: ldsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Verify13043::matchResult@38 - IL_0005: ret - } - - .method public specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 get_functionResult() cil managed - { - - .maxstack 8 - IL_0000: ldsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Verify13043::functionResult@43 - IL_0005: ret - } - - .method private specialname rtspecialname static void .cctor() cil managed - { - - .maxstack 8 - IL_0000: ldc.i4.0 - IL_0001: stsfld int32 ''.$Verify13043::init@ - IL_0006: ldsfld int32 ''.$Verify13043::init@ - IL_000b: pop - IL_000c: ret - } - - .method assembly specialname static void staticInitialization@() cil managed - { - - .maxstack 6 - IL_0000: ldc.i4.1 - IL_0001: ldc.i4.2 - IL_0002: ldc.i4.3 - IL_0003: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() - IL_0008: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_000d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_0012: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_0017: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Verify13043::list@3 - IL_001c: ldsfld class Verify13043/matchResult@38 Verify13043/matchResult@38::@_instance - IL_0021: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Verify13043::get_list() - IL_0026: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Verify13043::dropWhileWithMatch(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_002b: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Verify13043::matchResult@38 - IL_0030: ldstr "Match: %A" - IL_0035: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::.ctor(string) - IL_003a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine,class [FSharp.Core]Microsoft.FSharp.Core.Unit>>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) - IL_003f: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Verify13043::get_matchResult() - IL_0044: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Core.Unit>::Invoke(!0) - IL_0049: pop - IL_004a: ldsfld class Verify13043/functionResult@43 Verify13043/functionResult@43::@_instance - IL_004f: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Verify13043::get_list() - IL_0054: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Verify13043::dropWhileWithFunction(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_0059: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Verify13043::functionResult@43 - IL_005e: ldstr "Function: %A" - IL_0063: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::.ctor(string) - IL_0068: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine,class [FSharp.Core]Microsoft.FSharp.Core.Unit>>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) - IL_006d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Verify13043::get_functionResult() - IL_0072: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Core.Unit>::Invoke(!0) - IL_0077: pop - IL_0078: ret - } - - .property class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - list() - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) - .get class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Verify13043::get_list() - } - .property class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - matchResult() - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) - .get class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Verify13043::get_matchResult() - } - .property class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - functionResult() - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) - .get class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Verify13043::get_functionResult() - } -} - -.class private abstract auto ansi sealed ''.$Verify13043 - extends [runtime]System.Object -{ - .field static assembly int32 init@ - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) - .method public static void main@() cil managed - { - .entrypoint - - .maxstack 8 - IL_0000: call void Verify13043::staticInitialization@() - IL_0005: ret - } - -} - - - - - - diff --git a/tests/FSharp.Compiler.ComponentTests/Signatures/SigGenerationRoundTripTests.fs b/tests/FSharp.Compiler.ComponentTests/Signatures/SigGenerationRoundTripTests.fs index 469f9fda0e7..d70fb546637 100644 --- a/tests/FSharp.Compiler.ComponentTests/Signatures/SigGenerationRoundTripTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Signatures/SigGenerationRoundTripTests.fs @@ -6,24 +6,24 @@ open FSharp.Test.Compiler open System.IO let testCasesDir = Path.Combine(__SOURCE_DIRECTORY__,"TestCasesForGenerationRoundTrip") -let allTestCases = - Directory.EnumerateFiles(testCasesDir) - |> Seq.toArray +let allTestCases = + Directory.EnumerateFiles(testCasesDir) + |> Seq.toArray |> Array.map Path.GetFileName |> Array.map (fun f -> [|f :> obj|]) [] [] -let ``Generate and compile`` implFileName = +let ``Generate and compile`` implFileName = let implContents = File.ReadAllText (Path.Combine(testCasesDir,implFileName)) - let generatedSignature = - Fs implContents + let generatedSignature = + Fs implContents |> withLangVersion80 |> withDefines ["TESTS_AS_APP";"COMPILED"] - |> printSignatures + |> printSignatures - Fsi generatedSignature + Fsi generatedSignature |> withAdditionalSourceFile (FsSource implContents) |> withLangVersion80 |> withDefines ["TESTS_AS_APP";"COMPILED"] diff --git a/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/LexicalAnalysis/SymbolicOperators/E_LessThanDotOpenParen001.fs b/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/LexicalAnalysis/SymbolicOperators/E_LessThanDotOpenParen001.fs deleted file mode 100644 index a8cf50ea24b..00000000000 --- a/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/LexicalAnalysis/SymbolicOperators/E_LessThanDotOpenParen001.fs +++ /dev/null @@ -1,31 +0,0 @@ -// #Regression #Conformance #LexicalAnalysis #Operators -// Regression test for FSHARP1.0:4805 -// We are not really after the actual error messages here (some of them have been omitted), rather we -// want to verify we do not crash! -//This construct causes code to be less generic than indicated by the type annotations\. The type variable 'S has been constrained to be type 'int' -//This code is not sufficiently generic\. The type variable \^T when \^T : \(static member \( \+ \) : \^T \* \^T -> \^a\) could not be generalized because it would escape its scope - -type public TestType<'T,'S>() = - - member public s.Value with get() = Unchecked.defaultof<'T> - static member public (+++) (a : TestType<'T,'S>, b : TestType<'T,'S>) = a.Value - static member public (+++) (a : TestType<'T,'S>, b : 'T) = b - static member public (+++) (a : 'T, b : TestType<'T,'S>) = a - static member public (+++) (a : TestType<'T,'S>, b : 'T -> 'S) = a.Value - static member public (+++) (a : 'S -> 'T, b : TestType<'T,'S>) = (a 17) + b.Value - -let inline (+++) (a : ^a) (b : ^b) = ((^a or ^b): (static member (+++): ^a * ^b -> ^c) (a,b) ) - -let tt0 = TestType() -let tt1 = TestType() - -let f (x : string) = 18 - -let a0 = tt0 +++ tt1 -let a1 = tt0 +++ 11 -let a2 = 12 +++ tt1 -let a3 = tt0 +++ (fun x -> "18") -let a4 = f +++ tt0 - -let a5 = TestType.(+++)(f, tt0) -let a6 = TestType.(+++)((fun (x : string) -> 18), tt0) diff --git a/tests/FSharp.Test.Utilities/Compiler.fs b/tests/FSharp.Test.Utilities/Compiler.fs index cee7c81b0d7..7de76521d83 100644 --- a/tests/FSharp.Test.Utilities/Compiler.fs +++ b/tests/FSharp.Test.Utilities/Compiler.fs @@ -228,42 +228,43 @@ module rec Compiler = | true -> Some (File.ReadAllText path) | _ -> None - let createCompilationUnit baselineSuffix directoryPath filename = + let createCompilationUnit sourceBaselineSuffix ilBaselineSuffixes directoryPath filename = let outputDirectoryPath = createTemporaryDirectory().FullName let sourceFilePath = normalizePathSeparator (directoryPath ++ filename) - let fsBslFilePath = sourceFilePath + baselineSuffix + ".err.bsl" + let fsBslFilePath = sourceFilePath + sourceBaselineSuffix + ".err.bsl" let ilBslFilePath = let ilBslPaths = [| + for baselineSuffix in ilBaselineSuffixes do #if DEBUG #if NETCOREAPP - yield sourceFilePath + baselineSuffix + ".il.netcore.debug.bsl" - yield sourceFilePath + baselineSuffix + ".il.netcore.bsl" + yield sourceFilePath + baselineSuffix + ".il.netcore.debug.bsl" + yield sourceFilePath + baselineSuffix + ".il.netcore.bsl" #else - yield sourceFilePath + baselineSuffix + ".il.net472.debug.bsl" - yield sourceFilePath + baselineSuffix + ".il.net472.bsl" + yield sourceFilePath + baselineSuffix + ".il.net472.debug.bsl" + yield sourceFilePath + baselineSuffix + ".il.net472.bsl" #endif - yield sourceFilePath + baselineSuffix + ".il.debug.bsl" - yield sourceFilePath + baselineSuffix + ".il.bsl" + yield sourceFilePath + baselineSuffix + ".il.debug.bsl" + yield sourceFilePath + baselineSuffix + ".il.bsl" #else #if NETCOREAPP - yield sourceFilePath + baselineSuffix + ".il.netcore.release.bsl" - yield sourceFilePath + baselineSuffix + ".il.netcore.bsl" + yield sourceFilePath + baselineSuffix + ".il.netcore.release.bsl" + yield sourceFilePath + baselineSuffix + ".il.netcore.bsl" #else - yield sourceFilePath + baselineSuffix + ".il.net472.release.bsl" - yield sourceFilePath + baselineSuffix + ".il.net472.bsl" + yield sourceFilePath + baselineSuffix + ".il.net472.release.bsl" + yield sourceFilePath + baselineSuffix + ".il.net472.bsl" #endif - yield sourceFilePath + baselineSuffix + ".il.release.bsl" - yield sourceFilePath + baselineSuffix + ".il.bsl" + yield sourceFilePath + baselineSuffix + ".il.release.bsl" + yield sourceFilePath + baselineSuffix + ".il.bsl" #endif - |] + |] let findBaseline = ilBslPaths |> Array.tryPick(fun p -> if File.Exists(p) then Some p else None) match findBaseline with | Some s -> s - | None -> sourceFilePath + baselineSuffix + ".il.bsl" + | None -> sourceFilePath + sourceBaselineSuffix + ".il.bsl" let fsOutFilePath = normalizePathSeparator (Path.ChangeExtension(outputDirectoryPath ++ filename, ".err")) let ilOutFilePath = normalizePathSeparator (Path.ChangeExtension(outputDirectoryPath ++ filename, ".il")) @@ -314,7 +315,7 @@ module rec Compiler = let results = fsFiles - |> Array.map (fun fs -> (createCompilationUnit baselineSuffix directoryPath fs) :> obj) + |> Array.map (fun fs -> (createCompilationUnit baselineSuffix [baselineSuffix] directoryPath fs) :> obj) |> Seq.map (fun c -> [| c |]) results diff --git a/tests/FSharp.Test.Utilities/FileInlineDataAttribute.fs b/tests/FSharp.Test.Utilities/FileInlineDataAttribute.fs index f38a12ebd5a..f0262560cf9 100644 --- a/tests/FSharp.Test.Utilities/FileInlineDataAttribute.fs +++ b/tests/FSharp.Test.Utilities/FileInlineDataAttribute.fs @@ -130,11 +130,27 @@ and [] else "" - let realsigBsl = (getBaseline realsig ".RealInternalSignature") - let optimizeBsl = (getBaseline optimize ".Optimize") - let baselineSuffix = Option.defaultValue "" (combineBaselines realsigBsl optimizeBsl) - let compilation = createCompilationUnit baselineSuffix directoryPath fileName - + let rsLabel = ".RealInternalSignature" + let optLabel = ".Optimize" + let realsigBsl = (getBaseline realsig rsLabel) + let optimizeBsl = (getBaseline optimize optLabel) + let sourceBaselineSuffix = Option.defaultValue "" (combineBaselines realsigBsl optimizeBsl) + + let baselineSuffixes = [ + yield Option.defaultValue "" (combineBaselines realsigBsl optimizeBsl) // .RealInternalSignatureOff.OptimizeOff + yield Option.defaultValue "" (combineBaselines realsigBsl (Some (optLabel))) // .RealInternalSignatureOff.Optimize + yield Option.defaultValue "" (combineBaselines (Some rsLabel) optimizeBsl) // .RealInternalSignature.OptimizeOff + yield Option.defaultValue "" (combineBaselines (Some rsLabel) (Some optLabel)) // .RealInternalSignature.Optimize + yield Option.defaultValue "" (combineBaselines realsigBsl None) // .RealInternalSignatureOff + yield Option.defaultValue "" (combineBaselines (Some rsLabel) None) // .RealInternalSignature + yield Option.defaultValue "" (combineBaselines None optimizeBsl) // .OptimizeOff + yield Option.defaultValue "" (combineBaselines None (Some optLabel)) // .Optimize + yield Option.defaultValue "" (combineBaselines None optimizeBsl) // .OptimizeOff + yield Option.defaultValue "" (combineBaselines None (Some optLabel)) // .Optimize + yield "" // + ] + + let compilation = createCompilationUnit sourceBaselineSuffix baselineSuffixes directoryPath fileName compilation |> setRealInternalSignature |> setOptimization override _.ToString(): string = diff --git a/tests/FSharp.Test.Utilities/XunitHelpers.fs b/tests/FSharp.Test.Utilities/XunitHelpers.fs index 3a0049df5a8..981c150b34d 100644 --- a/tests/FSharp.Test.Utilities/XunitHelpers.fs +++ b/tests/FSharp.Test.Utilities/XunitHelpers.fs @@ -34,8 +34,10 @@ type FSharpXunitFramework(sink: IMessageSink) = interface IDisposable with member _.Dispose() = - cleanUpTemporaryDirectoryOfThisTestRun () - base.Dispose() + match Environment.GetEnvironmentVariable("FSHARP_RETAIN_TESTBUILDS") with + | null -> cleanUpTemporaryDirectoryOfThisTestRun () + | _ -> () + base.Dispose() #else diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl index 965a760fe81..11d7d18be88 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl @@ -43,8 +43,8 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.ParseAndCheckInputs+CheckMultipleInputsUsingGraphMode@1865::Invoke(int32)][offset 0x0000003A][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerConfig+TcConfig::.ctor([FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, bool)][offset 0x0000059C][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerConfig+TcConfig::.ctor([FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, bool)][offset 0x000005A5][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.IlxGen::HashRangeSorted([S.P.CoreLib]System.Collections.Generic.IDictionary`2>)][offset 0x00000011][found ref '[FSharp.Compiler.Service]FSharp.Compiler.IlxGen+HashRangeSorted@1850-1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,int32>'] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.IlxGen::HashRangeSorted([S.P.CoreLib]System.Collections.Generic.IDictionary`2>)][offset 0x00000012][found ref '[FSharp.Compiler.Service]FSharp.Compiler.IlxGen+HashRangeSorted@1850'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,T0>'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.IlxGen::HashRangeSorted([S.P.CoreLib]System.Collections.Generic.IDictionary`2>)][offset 0x00000011][found ref '[FSharp.Compiler.Service]FSharp.Compiler.IlxGen+HashRangeSorted@1859-1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,int32>'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.IlxGen::HashRangeSorted([S.P.CoreLib]System.Collections.Generic.IDictionary`2>)][offset 0x00000012][found ref '[FSharp.Compiler.Service]FSharp.Compiler.IlxGen+HashRangeSorted@1859'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,T0>'] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.PatternMatchCompilation::isProblematicClause([FSharp.Compiler.Service]FSharp.Compiler.PatternMatchCompilation+MatchClause)][offset 0x00000040][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$FSharp.Compiler.PatternMatchCompilation::.cctor()][offset 0x0000000B][found Boolean] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.TypeProviders::ValidateExpectedName([FSharp.Compiler.Service]FSharp.Compiler.Text.Range, string[], string, [FSharp.Compiler.Service]FSharp.Compiler.Tainted`1)][offset 0x000000A8][found Char] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl index 38b37691559..63cdf028b2e 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl @@ -61,8 +61,8 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerImports+TcConfig-TryResolveLibWithDirectories@558-1::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x0000003B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerConfig+TcConfig::.ctor([FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, bool)][offset 0x0000059C][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerConfig+TcConfig::.ctor([FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, bool)][offset 0x000005A5][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.IlxGen::HashRangeSorted([S.P.CoreLib]System.Collections.Generic.IDictionary`2>)][offset 0x00000011][found ref '[FSharp.Compiler.Service]FSharp.Compiler.IlxGen+HashRangeSorted@1850-1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,int32>'] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.IlxGen::HashRangeSorted([S.P.CoreLib]System.Collections.Generic.IDictionary`2>)][offset 0x00000012][found ref '[FSharp.Compiler.Service]FSharp.Compiler.IlxGen+HashRangeSorted@1850'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,T0>'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.IlxGen::HashRangeSorted([S.P.CoreLib]System.Collections.Generic.IDictionary`2>)][offset 0x00000011][found ref '[FSharp.Compiler.Service]FSharp.Compiler.IlxGen+HashRangeSorted@1859-1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,int32>'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.IlxGen::HashRangeSorted([S.P.CoreLib]System.Collections.Generic.IDictionary`2>)][offset 0x00000012][found ref '[FSharp.Compiler.Service]FSharp.Compiler.IlxGen+HashRangeSorted@1859'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,T0>'] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.PatternMatchCompilation::isProblematicClause([FSharp.Compiler.Service]FSharp.Compiler.PatternMatchCompilation+MatchClause)][offset 0x00000040][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$FSharp.Compiler.PatternMatchCompilation::.cctor()][offset 0x0000000B][found Boolean] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.NicePrint+TastDefinitionPrinting+meths@2092-3::Invoke([FSharp.Compiler.Service]FSharp.Compiler.Infos+MethInfo)][offset 0x000000B3][found Char] Unexpected type on the stack. diff --git a/tests/fsharp/Compiler/CodeGen/EmittedIL/TaskGeneratedCode.fs b/tests/fsharp/Compiler/CodeGen/EmittedIL/TaskGeneratedCode.fs index 7fe5a0db4b4..d4f5c692e05 100644 --- a/tests/fsharp/Compiler/CodeGen/EmittedIL/TaskGeneratedCode.fs +++ b/tests/fsharp/Compiler/CodeGen/EmittedIL/TaskGeneratedCode.fs @@ -1104,7 +1104,7 @@ type Generic1InGeneric1<'T>() = extends [runtime]System.Object { .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) - .class auto autochar sealed nested assembly beforefieldinit specialname clo@7 + .class auto autochar sealed nested assembly beforefieldinit specialname clo@7 extends [runtime]System.ValueType implements [runtime]System.Runtime.CompilerServices.IAsyncStateMachine, class [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.IResumableStateMachine`1> @@ -1132,7 +1132,7 @@ type Generic1InGeneric1<'T>() = class [runtime]System.Exception V_9, class [runtime]System.Exception V_10) IL_0000: ldarg.0 - IL_0001: ldfld int32 valuetype Test/Generic1InGeneric1`1/clo@7::ResumptionPoint + IL_0001: ldfld int32 valuetype Test/Generic1InGeneric1`1/clo@7::ResumptionPoint IL_0006: stloc.0 IL_0007: ldloc.0 IL_0008: ldc.i4.1 @@ -1161,16 +1161,16 @@ type Generic1InGeneric1<'T>() = IL_002c: nop IL_002d: ldarg.0 - IL_002e: ldfld class [runtime]System.Threading.Tasks.Task`1 valuetype Test/Generic1InGeneric1`1/clo@7::computation + IL_002e: ldfld class [runtime]System.Threading.Tasks.Task`1 valuetype Test/Generic1InGeneric1`1/clo@7::computation IL_0033: stloc.3 IL_0034: ldarg.0 IL_0035: ldloc.3 IL_0036: callvirt instance valuetype [netstandard]System.Runtime.CompilerServices.TaskAwaiter`1 class [netstandard]System.Threading.Tasks.Task`1::GetAwaiter() - IL_003b: stfld valuetype [runtime]System.Runtime.CompilerServices.TaskAwaiter`1 valuetype Test/Generic1InGeneric1`1/clo@7::awaiter + IL_003b: stfld valuetype [runtime]System.Runtime.CompilerServices.TaskAwaiter`1 valuetype Test/Generic1InGeneric1`1/clo@7::awaiter IL_0040: ldc.i4.1 IL_0041: stloc.s V_4 IL_0043: ldarg.0 - IL_0044: ldflda valuetype [runtime]System.Runtime.CompilerServices.TaskAwaiter`1 valuetype Test/Generic1InGeneric1`1/clo@7::awaiter + IL_0044: ldflda valuetype [runtime]System.Runtime.CompilerServices.TaskAwaiter`1 valuetype Test/Generic1InGeneric1`1/clo@7::awaiter IL_0049: call instance bool valuetype [netstandard]System.Runtime.CompilerServices.TaskAwaiter`1::get_IsCompleted() IL_004e: brfalse.s IL_0052 @@ -1185,7 +1185,7 @@ type Generic1InGeneric1<'T>() = IL_0059: ldarg.0 IL_005a: ldc.i4.1 - IL_005b: stfld int32 valuetype Test/Generic1InGeneric1`1/clo@7::ResumptionPoint + IL_005b: stfld int32 valuetype Test/Generic1InGeneric1`1/clo@7::ResumptionPoint IL_0060: ldc.i4.0 IL_0061: nop IL_0062: stloc.s V_5 @@ -1199,13 +1199,13 @@ type Generic1InGeneric1<'T>() = IL_006e: brfalse.s IL_0092 IL_0070: ldarg.0 - IL_0071: ldflda valuetype [runtime]System.Runtime.CompilerServices.TaskAwaiter`1 valuetype Test/Generic1InGeneric1`1/clo@7::awaiter + IL_0071: ldflda valuetype [runtime]System.Runtime.CompilerServices.TaskAwaiter`1 valuetype Test/Generic1InGeneric1`1/clo@7::awaiter IL_0076: call instance !0 valuetype [netstandard]System.Runtime.CompilerServices.TaskAwaiter`1::GetResult() IL_007b: stloc.s V_6 IL_007d: ldloc.s V_6 IL_007f: stloc.s V_7 IL_0081: ldarg.0 - IL_0082: ldflda valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1 valuetype Test/Generic1InGeneric1`1/clo@7::Data + IL_0082: ldflda valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1 valuetype Test/Generic1InGeneric1`1/clo@7::Data IL_0087: ldloc.s V_7 IL_0089: stfld !0 valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1::Result IL_008e: ldc.i4.1 @@ -1213,13 +1213,13 @@ type Generic1InGeneric1<'T>() = IL_0090: br.s IL_00ab IL_0092: ldarg.0 - IL_0093: ldflda valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1 valuetype Test/Generic1InGeneric1`1/clo@7::Data + IL_0093: ldflda valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1 valuetype Test/Generic1InGeneric1`1/clo@7::Data IL_0098: ldflda valuetype [runtime]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1 valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1::MethodBuilder IL_009d: ldarg.0 - IL_009e: ldflda valuetype [runtime]System.Runtime.CompilerServices.TaskAwaiter`1 valuetype Test/Generic1InGeneric1`1/clo@7::awaiter + IL_009e: ldflda valuetype [runtime]System.Runtime.CompilerServices.TaskAwaiter`1 valuetype Test/Generic1InGeneric1`1/clo@7::awaiter IL_00a3: ldarg.0 - IL_00a4: call instance void valuetype [netstandard]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1::AwaitUnsafeOnCompleted,valuetype Test/Generic1InGeneric1`1/clo@7>(!!0&, - !!1&) + IL_00a4: call instance void valuetype [netstandard]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1::AwaitUnsafeOnCompleted,valuetype Test/Generic1InGeneric1`1/clo@7>(!!0&, + !!1&) IL_00a9: ldc.i4.0 IL_00aa: nop IL_00ab: brfalse.s IL_00c1 @@ -1228,7 +1228,7 @@ type Generic1InGeneric1<'T>() = IL_00ae: ldloca.s V_8 IL_00b0: initobj valuetype [runtime]System.Runtime.CompilerServices.TaskAwaiter`1 IL_00b6: ldloc.s V_8 - IL_00b8: stfld valuetype [runtime]System.Runtime.CompilerServices.TaskAwaiter`1 valuetype Test/Generic1InGeneric1`1/clo@7::awaiter + IL_00b8: stfld valuetype [runtime]System.Runtime.CompilerServices.TaskAwaiter`1 valuetype Test/Generic1InGeneric1`1/clo@7::awaiter IL_00bd: ldc.i4.1 IL_00be: nop IL_00bf: br.s IL_00c3 @@ -1240,10 +1240,10 @@ type Generic1InGeneric1<'T>() = IL_00c5: brfalse.s IL_00e4 IL_00c7: ldarg.0 - IL_00c8: ldflda valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1 valuetype Test/Generic1InGeneric1`1/clo@7::Data + IL_00c8: ldflda valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1 valuetype Test/Generic1InGeneric1`1/clo@7::Data IL_00cd: ldflda valuetype [runtime]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1 valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1::MethodBuilder IL_00d2: ldarg.0 - IL_00d3: ldflda valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1 valuetype Test/Generic1InGeneric1`1/clo@7::Data + IL_00d3: ldflda valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1 valuetype Test/Generic1InGeneric1`1/clo@7::Data IL_00d8: ldfld !0 valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1::Result IL_00dd: call instance void valuetype [netstandard]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1::SetResult(!0) IL_00e2: leave.s IL_00f2 @@ -1268,7 +1268,7 @@ type Generic1InGeneric1<'T>() = IL_00f9: ret IL_00fa: ldarg.0 - IL_00fb: ldflda valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1 valuetype Test/Generic1InGeneric1`1/clo@7::Data + IL_00fb: ldflda valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1 valuetype Test/Generic1InGeneric1`1/clo@7::Data IL_0100: ldflda valuetype [runtime]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1 valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1::MethodBuilder IL_0105: ldloc.s V_10 IL_0107: call instance void valuetype [netstandard]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1::SetException(class [netstandard]System.Exception) @@ -1281,7 +1281,7 @@ type Generic1InGeneric1<'T>() = .maxstack 8 IL_0000: ldarg.0 - IL_0001: ldflda valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1 valuetype Test/Generic1InGeneric1`1/clo@7::Data + IL_0001: ldflda valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1 valuetype Test/Generic1InGeneric1`1/clo@7::Data IL_0006: ldflda valuetype [runtime]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1 valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1::MethodBuilder IL_000b: ldarg.1 IL_000c: call instance void valuetype [netstandard]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1::SetStateMachine(class [netstandard]System.Runtime.CompilerServices.IAsyncStateMachine) @@ -1294,7 +1294,7 @@ type Generic1InGeneric1<'T>() = .maxstack 8 IL_0000: ldarg.0 - IL_0001: ldfld int32 valuetype Test/Generic1InGeneric1`1/clo@7::ResumptionPoint + IL_0001: ldfld int32 valuetype Test/Generic1InGeneric1`1/clo@7::ResumptionPoint IL_0006: ret } @@ -1304,7 +1304,7 @@ type Generic1InGeneric1<'T>() = .maxstack 8 IL_0000: ldarg.0 - IL_0001: ldfld valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1 valuetype Test/Generic1InGeneric1`1/clo@7::Data + IL_0001: ldfld valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1 valuetype Test/Generic1InGeneric1`1/clo@7::Data IL_0006: ret } @@ -1315,7 +1315,7 @@ type Generic1InGeneric1<'T>() = .maxstack 8 IL_0000: ldarg.0 IL_0001: ldarg.1 - IL_0002: stfld valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1 valuetype Test/Generic1InGeneric1`1/clo@7::Data + IL_0002: stfld valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1 valuetype Test/Generic1InGeneric1`1/clo@7::Data IL_0007: ret } @@ -1348,26 +1348,26 @@ type Generic1InGeneric1<'T>() = .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .maxstack 4 - .locals init (valuetype Test/Generic1InGeneric1`1/clo@7 V_0, - valuetype Test/Generic1InGeneric1`1/clo@7& V_1) + .locals init (valuetype Test/Generic1InGeneric1`1/clo@7 V_0, + valuetype Test/Generic1InGeneric1`1/clo@7& V_1) IL_0000: ldloca.s V_0 - IL_0002: initobj valuetype Test/Generic1InGeneric1`1/clo@7 + IL_0002: initobj valuetype Test/Generic1InGeneric1`1/clo@7 IL_0008: ldloca.s V_0 IL_000a: stloc.1 IL_000b: ldloc.1 IL_000c: ldarg.1 - IL_000d: stfld class [runtime]System.Threading.Tasks.Task`1 valuetype Test/Generic1InGeneric1`1/clo@7::computation + IL_000d: stfld class [runtime]System.Threading.Tasks.Task`1 valuetype Test/Generic1InGeneric1`1/clo@7::computation IL_0012: ldloc.1 - IL_0013: ldflda valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1 valuetype Test/Generic1InGeneric1`1/clo@7::Data + IL_0013: ldflda valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1 valuetype Test/Generic1InGeneric1`1/clo@7::Data IL_0018: call valuetype [netstandard]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1 valuetype [netstandard]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1::Create() IL_001d: stfld valuetype [runtime]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1 valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1::MethodBuilder IL_0022: ldloc.1 - IL_0023: ldflda valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1 valuetype Test/Generic1InGeneric1`1/clo@7::Data + IL_0023: ldflda valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1 valuetype Test/Generic1InGeneric1`1/clo@7::Data IL_0028: ldflda valuetype [runtime]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1 valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1::MethodBuilder IL_002d: ldloc.1 - IL_002e: call instance void valuetype [netstandard]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1::Start>(!!0&) + IL_002e: call instance void valuetype [netstandard]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1::Start>(!!0&) IL_0033: ldloc.1 - IL_0034: ldflda valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1 valuetype Test/Generic1InGeneric1`1/clo@7::Data + IL_0034: ldflda valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1 valuetype Test/Generic1InGeneric1`1/clo@7::Data IL_0039: ldflda valuetype [runtime]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1 valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1::MethodBuilder IL_003e: call instance class [netstandard]System.Threading.Tasks.Task`1 valuetype [netstandard]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1::get_Task() IL_0043: ret From b2f2065a99c50f8336e34ce51d276b67579bb352 Mon Sep 17 00:00:00 2001 From: progressive-galib <125106402+progressive-galib@users.noreply.github.com> Date: Tue, 14 Jan 2025 18:01:10 +0600 Subject: [PATCH 16/49] "#if" directive around nullness removed fromsrc/Compiler/DependencyManager/DependencyProvider.fs and refactored. (#18207) * /Compiler/TypedTree/TypedTreePickle.fs refactored. "#if" directive around nullness removed from src Related: #18061 (partially addresses) - [x] Release notes entry updated: in `docs/release-notes/.FSharp.Compiler.Service/9.0.200.md`, * try 2 * refactoring * . * . * lets hope this works * . * fantomas tried with a bit of tricks DependencyProvider.fs * fantomas ignore * unformat --------- Co-authored-by: Petr --- .fantomasignore | 3 +++ .../.FSharp.Compiler.Service/9.0.200.md | 4 ++-- src/Compiler/DependencyManager/DependencyProvider.fs | 12 ++++++------ .../DependencyManager/DependencyProvider.fsi | 6 +++--- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/.fantomasignore b/.fantomasignore index b901c74bd99..d1bea49f566 100644 --- a/.fantomasignore +++ b/.fantomasignore @@ -40,6 +40,9 @@ src/Compiler/Checking/SignatureConformance.fs src/Compiler/Checking/TypeHierarchy.fs src/Compiler/Checking/TypeRelations.fs +# nullness-related problems +src/Compiler/DependencyManager/DependencyProvider.fs + # Incorrectly formatted: https://github.com/dotnet/fsharp/pull/14645/commits/49443a67ea8a17670c8a7c80c8bdf91f82231e91 or https://github.com/fsprojects/fantomas/issues/2733 # This CompilerImports.fs behavior is not fixed yet, following up in https://github.com/fsprojects/fantomas/issues/2733 src/Compiler/Driver/CompilerImports.fs diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.200.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.200.md index 3908fc98dd5..0a05f20bf45 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.200.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.200.md @@ -55,8 +55,8 @@ * Better ranges for #nowarn error reporting; bring back #nowarn warnings for --langVersion:80; add warnings under feature flag ([PR #17871](https://github.com/dotnet/fsharp/pull/17871)) * CheckAndThrow can be invoked only from within Cancellable context ([PR #18037](https://github.com/dotnet/fsharp/pull/18037)) * Make ILTypeDef base type calculation lazy. ([PR #18005](https://github.com/dotnet/fsharp/pull/18005)) -* "#if" directive around nullness removed from src/Compiler/TypedTree/TypedTreePickle.fs and refactored. ([PR #18203](https://github.com/dotnet/fsharp/pull/18203)) +* Removed redundant hash directives around nullness syntax ([Issue #18601](https://github.com/dotnet/fsharp/issues/18061), [PR #18203](https://github.com/dotnet/fsharp/pull/18203), [PR #18207](https://github.com/dotnet/fsharp/pull/18207)) ### Breaking Changes -* Aliasing `StructAttribute` will now produce a warning (part of [Language suggestion #1136](https://github.com/fsharp/fslang-suggestions/issues/1136), [PR #18098](https://github.com/dotnet/fsharp/pull/18098)) \ No newline at end of file +* Aliasing `StructAttribute` will now produce a warning (part of [Language suggestion #1136](https://github.com/fsharp/fslang-suggestions/issues/1136), [PR #18098](https://github.com/dotnet/fsharp/pull/18098)) diff --git a/src/Compiler/DependencyManager/DependencyProvider.fs b/src/Compiler/DependencyManager/DependencyProvider.fs index cc1b47de2ea..1bf72a76e5b 100644 --- a/src/Compiler/DependencyManager/DependencyProvider.fs +++ b/src/Compiler/DependencyManager/DependencyProvider.fs @@ -15,7 +15,7 @@ open System.Collections.Concurrent module Option = /// Convert string into Option string where null and String.Empty result in None - let ofString (s: string MaybeNull) = + let ofString (s: string | null) = match s with | null -> None | "" -> None @@ -607,7 +607,7 @@ type DependencyProvider outputDir: string, reportError: ResolvingErrorReport, path: string - ) : string MaybeNull * IDependencyManagerProvider MaybeNull = + ) : string | null * IDependencyManagerProvider | null = try if path.Contains ":" && not (Path.IsPathRooted path) then let managers = @@ -637,7 +637,7 @@ type DependencyProvider outputDir: string, reportError: ResolvingErrorReport, key: string - ) : IDependencyManagerProvider MaybeNull = + ) : IDependencyManagerProvider | null = try RegisteredDependencyManagers compilerTools (Option.ofString outputDir) reportError |> Map.tryFind key @@ -657,7 +657,7 @@ type DependencyProvider packageManagerTextLines: (string * string) seq, reportError: ResolvingErrorReport, executionTfm: string, - [] executionRid: string MaybeNull, + [] executionRid: string | null, [] implicitIncludeDir: string, [] mainScriptName: string, [] fileName: string, @@ -681,8 +681,8 @@ type DependencyProvider try let executionRid = match executionRid with - | Null -> RidHelpers.platformRid - | NonNull executionRid -> executionRid + | null -> RidHelpers.platformRid + | executionRid -> executionRid Ok( packageManager.ResolveDependencies( diff --git a/src/Compiler/DependencyManager/DependencyProvider.fsi b/src/Compiler/DependencyManager/DependencyProvider.fsi index 4c97224fc90..fffaa9a2026 100644 --- a/src/Compiler/DependencyManager/DependencyProvider.fsi +++ b/src/Compiler/DependencyManager/DependencyProvider.fsi @@ -123,7 +123,7 @@ type DependencyProvider = packageManagerTextLines: (string * string) seq * reportError: ResolvingErrorReport * executionTfm: string * - [] executionRid: string * + [] executionRid: string * [] implicitIncludeDir: string * [] mainScriptName: string * [] fileName: string * @@ -133,9 +133,9 @@ type DependencyProvider = /// Fetch a dependencymanager that supports a specific key member TryFindDependencyManagerByKey: compilerTools: string seq * outputDir: string * reportError: ResolvingErrorReport * key: string -> - IDependencyManagerProvider MaybeNull + IDependencyManagerProvider | null /// TryFindDependencyManagerInPath - given a #r "key:sometext" go and find a DependencyManager that satisfies the key member TryFindDependencyManagerInPath: compilerTools: string seq * outputDir: string * reportError: ResolvingErrorReport * path: string -> - string MaybeNull * IDependencyManagerProvider MaybeNull + string | null * IDependencyManagerProvider | null \ No newline at end of file From 9b345442ddbaa44929a27d63c859bcb70d9aeac2 Mon Sep 17 00:00:00 2001 From: Jakub Majocha <1760221+majocha@users.noreply.github.com> Date: Wed, 15 Jan 2025 08:24:19 +0100 Subject: [PATCH 17/49] Enable OpenTelemetry for Desktop target in xUnit tests (#18233) --- tests/FSharp.Test.Utilities/CompilerAssert.fs | 2 -- .../FSharp.Test.Utilities.fsproj | 2 +- tests/FSharp.Test.Utilities/XunitHelpers.fs | 12 +++++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/FSharp.Test.Utilities/CompilerAssert.fs b/tests/FSharp.Test.Utilities/CompilerAssert.fs index 0f7baf597fb..cc5fb4c3e9b 100644 --- a/tests/FSharp.Test.Utilities/CompilerAssert.fs +++ b/tests/FSharp.Test.Utilities/CompilerAssert.fs @@ -59,8 +59,6 @@ module AssemblyResolver = match found() with | None -> Unchecked.defaultof | Some name -> Assembly.Load(name) ) - - do addResolver() #endif type ExecutionOutcome = diff --git a/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj b/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj index 5b8f66bac7d..4a255384e07 100644 --- a/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj +++ b/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj @@ -33,7 +33,6 @@ - @@ -46,6 +45,7 @@ + diff --git a/tests/FSharp.Test.Utilities/XunitHelpers.fs b/tests/FSharp.Test.Utilities/XunitHelpers.fs index 981c150b34d..2747bdc5a63 100644 --- a/tests/FSharp.Test.Utilities/XunitHelpers.fs +++ b/tests/FSharp.Test.Utilities/XunitHelpers.fs @@ -31,6 +31,9 @@ type FSharpXunitFramework(sink: IMessageSink) = // This gets executed once per test assembly. MessageSink.sinkWriter |> ignore TestConsole.install() +#if !NETCOREAPP + AssemblyResolver.addResolver () +#endif interface IDisposable with member _.Dispose() = @@ -148,8 +151,10 @@ type FSharpXunitFramework(sink: IMessageSink) = log "FSharpXunitFramework with XUNIT_EXTRAS installing TestConsole redirection" TestConsole.install() -// TODO: Currently does not work with Desktop .NET Framework. Upcoming OpenTelemetry 1.11.0 may change it. -#if NETCOREAPP +#if !NETCOREAPP + AssemblyResolver.addResolver () +#endif + let traceProvider = Sdk.CreateTracerProviderBuilder() .AddSource(ActivityNames.FscSourceName) @@ -157,15 +162,12 @@ type FSharpXunitFramework(sink: IMessageSink) = ResourceBuilder.CreateDefault().AddService(serviceName="F#", serviceVersion = "1.0.0")) .AddOtlpExporter() .Build() -#endif interface IDisposable with member _.Dispose() = cleanUpTemporaryDirectoryOfThisTestRun () -#if NETCOREAPP traceProvider.ForceFlush() |> ignore traceProvider.Dispose() -#endif base.Dispose() override this.CreateDiscoverer (assemblyInfo) = From c73b2160c6b4362fb9419264d6e58604f6eef15a Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Thu, 16 Jan 2025 13:01:13 +0100 Subject: [PATCH 18/49] Update dependencies from https://github.com/dotnet/arcade build 20250115.2 (#18240) Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.25058.5 -> To Version 9.0.0-beta.25065.2 Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 8 ++++---- eng/common/template-guidance.md | 2 +- global.json | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index d005e04efcc..6071737c331 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -42,14 +42,14 @@ - + https://github.com/dotnet/arcade - 8cc6ecd76c24ef6665579a5c5e386a211a1e7c54 + c4bbc67763bf0c5a868862df874079380e647d61 - + https://github.com/dotnet/arcade - 8cc6ecd76c24ef6665579a5c5e386a211a1e7c54 + c4bbc67763bf0c5a868862df874079380e647d61 diff --git a/eng/common/template-guidance.md b/eng/common/template-guidance.md index 5ef6c30ba92..98bbc1ded0b 100644 --- a/eng/common/template-guidance.md +++ b/eng/common/template-guidance.md @@ -57,7 +57,7 @@ extends: Note: Multiple outputs are ONLY applicable to 1ES PT publishing (only usable when referencing `templates-official`). -# Development notes +## Development notes **Folder / file structure** diff --git a/global.json b/global.json index 57489571a22..8fe04b02ff8 100644 --- a/global.json +++ b/global.json @@ -1,10 +1,10 @@ { "sdk": { - "version": "9.0.100", + "version": "9.0.102", "allowPrerelease": true }, "tools": { - "dotnet": "9.0.100", + "dotnet": "9.0.102", "vs": { "version": "17.8", "components": [ @@ -17,7 +17,7 @@ "perl": "5.38.2.2" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.25058.5", + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.25065.2", "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.23255.2" } } From 8473ce651941f94ed0c93e4c0cc9a3c51d3a8db2 Mon Sep 17 00:00:00 2001 From: Jakub Majocha <1760221+majocha@users.noreply.github.com> Date: Thu, 16 Jan 2025 16:15:55 +0100 Subject: [PATCH 19/49] Set Cancellable.token from async computation (#18238) --- docs/release-notes/.FSharp.Compiler.Service/9.0.300.md | 1 + src/Compiler/Driver/CompilerImports.fs | 1 + src/Compiler/Service/BackgroundCompiler.fs | 5 +++-- src/Compiler/Service/TransparentCompiler.fs | 5 +++-- src/Compiler/Utilities/Cancellable.fs | 6 ++++++ src/Compiler/Utilities/Cancellable.fsi | 2 ++ .../ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl | 2 +- ...lverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl | 2 +- .../ilverify_FSharp.Compiler.Service_Release_net9.0.bsl | 2 +- ...erify_FSharp.Compiler.Service_Release_netstandard2.0.bsl | 2 +- 10 files changed, 20 insertions(+), 8 deletions(-) diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md index 375263a2a0e..66888c7cebe 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md @@ -1,6 +1,7 @@ ### Fixed * Fix Realsig+ generates nested closures with incorrect Generic ([Issue #17797](https://github.com/dotnet/fsharp/issues/17797), [PR #17877](https://github.com/dotnet/fsharp/pull/17877)) +* Set `Cancellable.token` from async computation ([Issue #18235](https://github.com/dotnet/fsharp/issues/18235), [PR #18238](https://github.com/dotnet/fsharp/pull/18238)) ### Added diff --git a/src/Compiler/Driver/CompilerImports.fs b/src/Compiler/Driver/CompilerImports.fs index c54ccc41c58..8478429a452 100644 --- a/src/Compiler/Driver/CompilerImports.fs +++ b/src/Compiler/Driver/CompilerImports.fs @@ -2255,6 +2255,7 @@ and [] TcImports r: AssemblyResolution ) : Async<(_ * (unit -> AvailableImportedAssembly list)) option> = async { + do! Cancellable.UseToken() CheckDisposed() let m = r.originalReference.Range let fileName = r.resolvedPath diff --git a/src/Compiler/Service/BackgroundCompiler.fs b/src/Compiler/Service/BackgroundCompiler.fs index 1089f5774e8..63d147d005b 100644 --- a/src/Compiler/Service/BackgroundCompiler.fs +++ b/src/Compiler/Service/BackgroundCompiler.fs @@ -328,8 +328,8 @@ type internal BackgroundCompiler | FSharpReferencedProject.PEReference(getStamp, delayedReader) -> { new IProjectReference with member x.EvaluateRawContents() = - async { - let! ilReaderOpt = delayedReader.TryGetILModuleReader() |> Cancellable.toAsync + cancellable { + let! ilReaderOpt = delayedReader.TryGetILModuleReader() match ilReaderOpt with | Some ilReader -> @@ -341,6 +341,7 @@ type internal BackgroundCompiler // continue to try to use an on-disk DLL return ProjectAssemblyDataResult.Unavailable false } + |> Cancellable.toAsync member x.TryGetLogicalTimeStamp _ = getStamp () |> Some member x.FileName = delayedReader.OutputFile diff --git a/src/Compiler/Service/TransparentCompiler.fs b/src/Compiler/Service/TransparentCompiler.fs index bc15b6c3b67..f25b75fe99d 100644 --- a/src/Compiler/Service/TransparentCompiler.fs +++ b/src/Compiler/Service/TransparentCompiler.fs @@ -766,8 +766,8 @@ type internal TransparentCompiler | FSharpReferencedProjectSnapshot.PEReference(getStamp, delayedReader) -> { new IProjectReference with member x.EvaluateRawContents() = - async { - let! ilReaderOpt = delayedReader.TryGetILModuleReader() |> Cancellable.toAsync + cancellable { + let! ilReaderOpt = delayedReader.TryGetILModuleReader() match ilReaderOpt with | Some ilReader -> @@ -779,6 +779,7 @@ type internal TransparentCompiler // continue to try to use an on-disk DLL return ProjectAssemblyDataResult.Unavailable false } + |> Cancellable.toAsync member x.TryGetLogicalTimeStamp _ = getStamp () |> Some member x.FileName = delayedReader.OutputFile diff --git a/src/Compiler/Utilities/Cancellable.fs b/src/Compiler/Utilities/Cancellable.fs index 8f14b5ddbfe..9ec81438ca4 100644 --- a/src/Compiler/Utilities/Cancellable.fs +++ b/src/Compiler/Utilities/Cancellable.fs @@ -18,6 +18,12 @@ type Cancellable = static member Token = ensureToken "Token not available outside of Cancellable computation." + static member UseToken() = + async { + let! ct = Async.CancellationToken + tokenHolder.Value <- ValueSome ct + } + static member UsingToken(ct) = let oldCt = tokenHolder.Value tokenHolder.Value <- ValueSome ct diff --git a/src/Compiler/Utilities/Cancellable.fsi b/src/Compiler/Utilities/Cancellable.fsi index c5a8d9627ea..aba96859491 100644 --- a/src/Compiler/Utilities/Cancellable.fsi +++ b/src/Compiler/Utilities/Cancellable.fsi @@ -5,6 +5,8 @@ open System.Threading [] type Cancellable = + static member internal UseToken: unit -> Async + /// For use in testing only. Cancellable.token should be set only by the cancellable computation. static member internal UsingToken: CancellationToken -> IDisposable diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl index d54bcb9419a..d301673c927 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl @@ -21,7 +21,7 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x00000082][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x0000008B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+MagicAssemblyResolution::ResolveAssemblyCore([FSharp.Compiler.Service]Internal.Utilities.Library.CompilationThreadToken, [FSharp.Compiler.Service]FSharp.Compiler.Text.Range, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, [FSharp.Compiler.Service]FSharp.Compiler.CompilerImports+TcImports, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompiler, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiConsoleOutput, string)][offset 0x00000015][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3510-796::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001E5][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3510-786::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001E5][found Char] Unexpected type on the stack. [IL]: Error [UnmanagedPointer]: : FSharp.Compiler.Interactive.Shell+Utilities+pointerToNativeInt@110::Invoke(object)][offset 0x00000007] Unmanaged pointers are not a verifiable type. [IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+dataTipOfReferences@2205::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000084][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-508::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl index 4bbe31fc0d6..1a5e3d85c4a 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl @@ -28,7 +28,7 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x0000008B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+FsiStdinSyphon::GetLine(string, int32)][offset 0x00000039][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+MagicAssemblyResolution::ResolveAssemblyCore([FSharp.Compiler.Service]Internal.Utilities.Library.CompilationThreadToken, [FSharp.Compiler.Service]FSharp.Compiler.Text.Range, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, [FSharp.Compiler.Service]FSharp.Compiler.CompilerImports+TcImports, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompiler, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiConsoleOutput, string)][offset 0x00000015][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3510-796::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001E5][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3510-786::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001E5][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+FsiInteractionProcessor::CompletionsForPartialLID([FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompilerState, string)][offset 0x0000001B][found Char] Unexpected type on the stack. [IL]: Error [UnmanagedPointer]: : FSharp.Compiler.Interactive.Shell+Utilities+pointerToNativeInt@110::Invoke(object)][offset 0x00000007] Unmanaged pointers are not a verifiable type. [IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+dataTipOfReferences@2205::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000084][found Char] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl index 11d7d18be88..8c2b6a97465 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl @@ -21,7 +21,7 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x00000082][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x0000008B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+MagicAssemblyResolution::ResolveAssemblyCore([FSharp.Compiler.Service]Internal.Utilities.Library.CompilationThreadToken, [FSharp.Compiler.Service]FSharp.Compiler.Text.Range, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, [FSharp.Compiler.Service]FSharp.Compiler.CompilerImports+TcImports, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompiler, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiConsoleOutput, string)][offset 0x00000015][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3510-836::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001C7][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3510-830::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001C7][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+GetReferenceResolutionStructuredToolTipText@2205::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000076][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-529::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-529::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl index 63cdf028b2e..77ba0d7133e 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl @@ -28,7 +28,7 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x0000008B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+FsiStdinSyphon::GetLine(string, int32)][offset 0x00000032][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+MagicAssemblyResolution::ResolveAssemblyCore([FSharp.Compiler.Service]Internal.Utilities.Library.CompilationThreadToken, [FSharp.Compiler.Service]FSharp.Compiler.Text.Range, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, [FSharp.Compiler.Service]FSharp.Compiler.CompilerImports+TcImports, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompiler, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiConsoleOutput, string)][offset 0x00000015][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3510-836::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001C7][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3510-830::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001C7][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+FsiInteractionProcessor::CompletionsForPartialLID([FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompilerState, string)][offset 0x00000024][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+GetReferenceResolutionStructuredToolTipText@2205::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000076][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseMemberFunctionAndValues@176::Invoke([FSharp.Compiler.Service]FSharp.Compiler.Symbols.FSharpMemberOrFunctionOrValue)][offset 0x0000002B][found Char] Unexpected type on the stack. From 7c598f43e574cd64b4ccdcdc57c5ec071d106d42 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Thu, 16 Jan 2025 09:08:27 -0800 Subject: [PATCH 20/49] Simplify Dependencies a tad (#18236) * simplify tests dependencies * OverallHintExperienceTests --- eng/Versions.props | 1 - .../FSharp.Compiler.Service.Tests/FsiTests.fs | 17 ++++----- .../ManglingNameOfProvidedTypes.fs | 4 +- .../SuggestionBuffer.fs | 2 +- tests/FSharp.Test.Utilities/Assert.fs | 37 +++++++++---------- .../FSharp.Test.Utilities.fsproj | 15 +++----- tests/README.md | 3 +- 7 files changed, 36 insertions(+), 43 deletions(-) diff --git a/eng/Versions.props b/eng/Versions.props index 00bbbc51afb..59f0f6e7cb9 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -193,7 +193,6 @@ 2.9.0 2.8.2 3.1.17 - 5.10.3 2.2.0 diff --git a/tests/FSharp.Compiler.Service.Tests/FsiTests.fs b/tests/FSharp.Compiler.Service.Tests/FsiTests.fs index bb3e8407d6f..208f7a465a6 100644 --- a/tests/FSharp.Compiler.Service.Tests/FsiTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/FsiTests.fs @@ -2,7 +2,6 @@ open System open System.IO -open FluentAssertions open FSharp.Compiler.Interactive.Shell open FSharp.Test open Xunit @@ -575,7 +574,7 @@ module FsiTests = fsiSession.AddBoundValue("boundMdArray", arr) let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne Assert.shouldBe typeof boundValue.Value.ReflectionType - boundValue.Value.ReflectionValue.Should().Be(arr, "") |> ignore + Assert.shouldBe arr boundValue.Value.ReflectionValue [] let ``Creation of a bound value succeeds if the value is an array of a built-in reference type``() = @@ -584,7 +583,7 @@ module FsiTests = fsiSession.AddBoundValue("boundMdArray", arr) let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne Assert.shouldBe typeof boundValue.Value.ReflectionType - boundValue.Value.ReflectionValue.Should().Be(arr, "") |> ignore + Assert.shouldBe arr boundValue.Value.ReflectionValue [] let ``Creation of a bound value succeeds if the value is an array of a custom value type``() = @@ -593,7 +592,7 @@ module FsiTests = fsiSession.AddBoundValue("boundMdArray", arr) let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne Assert.shouldBe typeof boundValue.Value.ReflectionType - boundValue.Value.ReflectionValue.Should().Be(arr, "") |> ignore + Assert.shouldBe arr boundValue.Value.ReflectionValue [] let ``Creation of a bound value succeeds if the value is an array of a custom reference type``() = @@ -602,7 +601,7 @@ module FsiTests = fsiSession.AddBoundValue("boundMdArray", arr) let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne Assert.shouldBe typeof boundValue.Value.ReflectionType - boundValue.Value.ReflectionValue.Should().Be(arr, "") |> ignore + Assert.shouldBe arr boundValue.Value.ReflectionValue [] let ``Creation of a bound value succeeds if the value is a multidimensional array of a built-in value type``() = @@ -611,7 +610,7 @@ module FsiTests = fsiSession.AddBoundValue("boundMdArray", mdArr) let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne Assert.shouldBe typeof boundValue.Value.ReflectionType - boundValue.Value.ReflectionValue.Should().Be(mdArr, "") |> ignore + Assert.shouldBe mdArr boundValue.Value.ReflectionValue [] let ``Creation of a bound value succeeds if the value is a multidimensional array of a built-in reference type``() = @@ -620,7 +619,7 @@ module FsiTests = fsiSession.AddBoundValue("boundMdArray", mdArr) let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne Assert.shouldBe typeof boundValue.Value.ReflectionType - boundValue.Value.ReflectionValue.Should().Be(mdArr, "") |> ignore + Assert.shouldBe mdArr boundValue.Value.ReflectionValue [] let ``Creation of a bound value succeeds if the value is a multidimensional array of a custom value type``() = @@ -629,7 +628,7 @@ module FsiTests = fsiSession.AddBoundValue("boundMdArray", mdArr) let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne Assert.shouldBe typeof boundValue.Value.ReflectionType - boundValue.Value.ReflectionValue.Should().Be(mdArr, "") |> ignore + Assert.shouldBe mdArr boundValue.Value.ReflectionValue [] let ``Creation of a bound value succeeds if the value is a multidimensional array of a custom reference type``() = @@ -638,7 +637,7 @@ module FsiTests = fsiSession.AddBoundValue("boundMdArray", mdArr) let boundValue = fsiSession.GetBoundValues() |> List.exactlyOne Assert.shouldBe typeof boundValue.Value.ReflectionType - boundValue.Value.ReflectionValue.Should().Be(mdArr, "") |> ignore + Assert.shouldBe mdArr boundValue.Value.ReflectionValue [] [] diff --git a/tests/FSharp.Compiler.Service.Tests/ManglingNameOfProvidedTypes.fs b/tests/FSharp.Compiler.Service.Tests/ManglingNameOfProvidedTypes.fs index 5f8fd967342..cd728482876 100644 --- a/tests/FSharp.Compiler.Service.Tests/ManglingNameOfProvidedTypes.fs +++ b/tests/FSharp.Compiler.Service.Tests/ManglingNameOfProvidedTypes.fs @@ -32,13 +32,13 @@ type ManglingNamesOfProvidedTypesWithSingleParameter() = member this.DemangleDefaultValue() = let name, parameters = PrettyNaming.DemangleProvidedTypeName "MyNamespace.Test," Assert.shouldBe "MyNamespace.Test" name - Assert.shouldBeEquivalentTo [||] parameters + Assert.shouldBeEmpty parameters [] member this.DemangleNewDefaultValue() = let name, parameters = PrettyNaming.DemangleProvidedTypeName "MyNamespace.Test" Assert.shouldBe "MyNamespace.Test" name - Assert.shouldBeEquivalentTo [||] parameters + Assert.shouldBeEmpty parameters type ManglingNamesOfProvidedTypesWithMultipleParameter() = diff --git a/tests/FSharp.Compiler.Service.Tests/SuggestionBuffer.fs b/tests/FSharp.Compiler.Service.Tests/SuggestionBuffer.fs index 04494592586..bc5c82f0b61 100644 --- a/tests/FSharp.Compiler.Service.Tests/SuggestionBuffer.fs +++ b/tests/FSharp.Compiler.Service.Tests/SuggestionBuffer.fs @@ -41,7 +41,7 @@ module SuggestionBuffer = let results = Array.ofSeq buffer Assert.shouldBeTrue buffer.Disabled - Assert.shouldBeEquivalentTo [||] results + Assert.shouldBeEmpty results [] let BufferShouldOnlyTakeTop5Elements() = diff --git a/tests/FSharp.Test.Utilities/Assert.fs b/tests/FSharp.Test.Utilities/Assert.fs index 41287757a0f..dc1df050fed 100644 --- a/tests/FSharp.Test.Utilities/Assert.fs +++ b/tests/FSharp.Test.Utilities/Assert.fs @@ -1,49 +1,48 @@ namespace FSharp.Test module Assert = - open FluentAssertions open System.Collections open Xunit open System.IO + // Equivalent, with message let inline shouldBeEqualWith (expected : ^T) (message: string) (actual: ^U) = - actual.Should().BeEquivalentTo(expected, message) |> ignore + try + Assert.Equivalent(expected, actual) + with e -> + Assert.True(false, message); let inline shouldBeEquivalentTo (expected : ^T) (actual : ^U) = - actual.Should().BeEquivalentTo(expected, "") |> ignore - - let inline shouldStartWith (expected : string) (actual : string) = - actual.Should().StartWith(expected) |> ignore - - let inline shouldContain (needle : string) (haystack : string) = - haystack.Should().Contain(needle) |> ignore + Assert.Equivalent(expected, actual) - // One fine day, all of the 3 things below should be purged and replaced with pure Assert.Equal. - // Xunit checks types by default. These are just artifacts of the testing chaos in the repo back in a day. let inline shouldBe (expected : ^T) (actual : ^U) = - actual.Should().Be(expected, "") |> ignore + Assert.Equal(expected :> obj, actual :> obj) + + let inline shouldStartWith (expected : string) (actual : string) = + Assert.StartsWith(expected, actual) + + let inline shouldContain (needle : string) (haystack : string) = + Assert.Contains(needle, haystack) let inline areEqual (expected: ^T) (actual: ^T) = Assert.Equal<^T>(expected, actual) let inline shouldEqual (x: 'a) (y: 'a) = Assert.Equal<'a>(x, y) - // let inline shouldBeEmpty (actual : ^T when ^T :> IEnumerable) = - actual.Should().BeEmpty("") |> ignore + Assert.Empty(actual) let inline shouldNotBeEmpty (actual : ^T when ^T :> IEnumerable) = - actual.Should().NotBeEmpty("") |> ignore + Assert.NotEmpty(actual) let shouldBeFalse (actual: bool) = - actual.Should().BeFalse("") |> ignore + Assert.False(actual) let shouldBeTrue (actual: bool) = - actual.Should().BeTrue("") |> ignore + Assert.True(actual) - let shouldBeSameMultilineStringSets expectedText actualText = - + let shouldBeSameMultilineStringSets expectedText actualText = let getLines text = use reader = new StringReader(text) Seq.initInfinite (fun _ -> reader.ReadLine()) diff --git a/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj b/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj index 4a255384e07..192783edd57 100644 --- a/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj +++ b/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj @@ -73,7 +73,6 @@ - @@ -83,14 +82,12 @@ - - - - - - - - + + + + + + diff --git a/tests/README.md b/tests/README.md index 40c9a35b177..81202f86f4e 100644 --- a/tests/README.md +++ b/tests/README.md @@ -19,12 +19,11 @@ ## Framework for testing -The following test frameworks and libraries will be used for new test projects **[xUnit Test Framework](https://xunit.net/), [FluentAssertions](https://fluentassertions.com/) (+ [FsUnit](https://fsprojects.github.io/FsUnit/) and [FsCheck](https://github.com/fscheck/FsCheck) when needed)**. +The following test frameworks and libraries will be used for new test projects **[xUnit Test Framework](https://xunit.net/) and [FsCheck](https://github.com/fscheck/FsCheck) when needed)**. **Justification:** * **xUnit** is an extensible, TDD adherent, testing framework, which was successfully adopted by many .NET engineering teams, including Roslyn, AspNetCore, EFcore, etc, has a "cleaner" approach for writing test suites (i.e. class constructor for setup, implementing IDisposable for teardown, as oppose to custom attributes). More info [here](https://xunit.net/docs/comparisons). -* **FluentAssertions** makes it easier to write scoped assertions, provides better error messages. **Alternatives:** NUnit, MSBuild, Expecto From 4fcf1a7f419a133802515f28263632d81d511455 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 17 Jan 2025 13:11:23 +0100 Subject: [PATCH 21/49] Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20250116.1 (#18242) Microsoft.SourceBuild.Intermediate.source-build-reference-packages From Version 9.0.0-alpha.1.25060.3 -> To Version 9.0.0-alpha.1.25066.1 Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 6071737c331..e0c968cbe09 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,9 +1,9 @@ - + https://github.com/dotnet/source-build-reference-packages - f5fa796273e4e59926e3fab26e1ab9e7d577f5e5 + 93a3395781d30f69201367371c28cfc5005c0264 From 72ab794e5ef6506ff3a0d33c66fb48a0324aeac3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=BB=D0=B0=D0=B2=D0=B0=20=D0=A3=D0=BA=D1=80=D0=B0?= =?UTF-8?q?=D1=97=D0=BD=D1=96!=20=D0=93=D0=B5=D1=80=D0=BE=D1=8F=D0=BC=20?= =?UTF-8?q?=D1=81=D0=BB=D0=B0=D0=B2=D0=B0!?= <777696+ncave@users.noreply.github.com> Date: Mon, 20 Jan 2025 10:33:51 +0000 Subject: [PATCH 22/49] Added missing type constraints in FCS (#18241) * Expose missing constraints * Updated release notes --- docs/release-notes/.FSharp.Compiler.Service/9.0.300.md | 1 + src/Compiler/Symbols/Symbols.fs | 5 +++++ src/Compiler/Symbols/Symbols.fsi | 6 ++++++ ...arp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl | 4 ++++ ...p.Compiler.Service.SurfaceArea.netstandard20.release.bsl | 4 ++++ ...lverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl | 2 +- ...erify_FSharp.Compiler.Service_Release_netstandard2.0.bsl | 2 +- 7 files changed, 22 insertions(+), 2 deletions(-) diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md index 66888c7cebe..5997ca29bd4 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md @@ -5,6 +5,7 @@ ### Added +* Added missing type constraints in FCS. ([PR #18241](https://github.com/dotnet/fsharp/pull/18241)) ### Changed diff --git a/src/Compiler/Symbols/Symbols.fs b/src/Compiler/Symbols/Symbols.fs index 36823f65dc0..470327f59cd 100644 --- a/src/Compiler/Symbols/Symbols.fs +++ b/src/Compiler/Symbols/Symbols.fs @@ -1596,6 +1596,11 @@ type FSharpGenericParameterConstraint(cenv, cx: TyparConstraint) = | TyparConstraint.IsDelegate(ty1, ty2, _) -> FSharpGenericParameterDelegateConstraint(cenv, ty1, ty2) | _ -> invalidOp "not a delegate constraint" + member _.IsAllowsRefStructConstraint = + match cx with + | TyparConstraint.AllowsRefStruct _ -> true + | _ -> false + override x.ToString() = "" type FSharpInlineAnnotation = diff --git a/src/Compiler/Symbols/Symbols.fsi b/src/Compiler/Symbols/Symbols.fsi index 5c26d2d42ea..49742673d58 100644 --- a/src/Compiler/Symbols/Symbols.fsi +++ b/src/Compiler/Symbols/Symbols.fsi @@ -708,6 +708,9 @@ type FSharpGenericParameterConstraint = /// Indicates a constraint that a type has a 'null' value member IsSupportsNullConstraint: bool + /// Indicates a constraint that a type doesn't support nullness + member IsNotSupportsNullConstraint: bool + /// Indicates a constraint that a type supports F# generic comparison member IsComparisonConstraint: bool @@ -750,6 +753,9 @@ type FSharpGenericParameterConstraint = /// Gets further information about a delegate constraint member DelegateConstraintData: FSharpGenericParameterDelegateConstraint + /// An anti-constraint indicating that ref structs (e.g. Span<>) are allowed here + member IsAllowsRefStructConstraint: bool + [] type FSharpInlineAnnotation = diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl index 6004f3fb62d..13180c3b649 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl @@ -5398,6 +5398,8 @@ FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean IsRequiresDefa FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean IsSimpleChoiceConstraint FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean IsSupportsNullConstraint FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean IsUnmanagedConstraint +FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean IsNotSupportsNullConstraint +FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean IsAllowsRefStructConstraint FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean get_IsCoercesToConstraint() FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean get_IsComparisonConstraint() FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean get_IsDefaultsToConstraint() @@ -5411,6 +5413,8 @@ FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean get_IsRequires FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean get_IsSimpleChoiceConstraint() FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean get_IsSupportsNullConstraint() FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean get_IsUnmanagedConstraint() +FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean get_IsNotSupportsNullConstraint() +FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean get_IsAllowsRefStructConstraint() FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: FSharp.Compiler.Symbols.FSharpGenericParameterDefaultsToConstraint DefaultsToConstraintData FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: FSharp.Compiler.Symbols.FSharpGenericParameterDefaultsToConstraint get_DefaultsToConstraintData() FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: FSharp.Compiler.Symbols.FSharpGenericParameterDelegateConstraint DelegateConstraintData diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl index 6004f3fb62d..13180c3b649 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl @@ -5398,6 +5398,8 @@ FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean IsRequiresDefa FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean IsSimpleChoiceConstraint FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean IsSupportsNullConstraint FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean IsUnmanagedConstraint +FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean IsNotSupportsNullConstraint +FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean IsAllowsRefStructConstraint FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean get_IsCoercesToConstraint() FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean get_IsComparisonConstraint() FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean get_IsDefaultsToConstraint() @@ -5411,6 +5413,8 @@ FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean get_IsRequires FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean get_IsSimpleChoiceConstraint() FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean get_IsSupportsNullConstraint() FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean get_IsUnmanagedConstraint() +FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean get_IsNotSupportsNullConstraint() +FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean get_IsAllowsRefStructConstraint() FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: FSharp.Compiler.Symbols.FSharpGenericParameterDefaultsToConstraint DefaultsToConstraintData FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: FSharp.Compiler.Symbols.FSharpGenericParameterDefaultsToConstraint get_DefaultsToConstraintData() FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: FSharp.Compiler.Symbols.FSharpGenericParameterDelegateConstraint DelegateConstraintData diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl index 1a5e3d85c4a..81cc143b139 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl @@ -40,7 +40,7 @@ [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-508::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000082][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-508::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000008B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-508::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000094][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$Symbols+fullName@2490-1::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000015][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$Symbols+fullName@2495-1::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000015][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CreateILModule+MainModuleBuilder::ConvertProductVersionToILVersionInfo(string)][offset 0x00000011][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.StaticLinking+TypeForwarding::followTypeForwardForILTypeRef([FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.IL+ILTypeRef)][offset 0x00000010][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions::getCompilerOption([FSharp.Compiler.Service]FSharp.Compiler.CompilerOptions+CompilerOption, [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1)][offset 0x000000E6][found Char] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl index 77ba0d7133e..588f29f5a96 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl @@ -39,7 +39,7 @@ [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-529::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000064][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-529::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000006D][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-529::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000076][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$Symbols+fullName@2490-3::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000030][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$Symbols+fullName@2495-3::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000030][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Driver+ProcessCommandLineFlags@301-1::Invoke(string)][offset 0x0000000B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Driver+ProcessCommandLineFlags@301-1::Invoke(string)][offset 0x00000014][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CreateILModule+MainModuleBuilder::ConvertProductVersionToILVersionInfo(string)][offset 0x00000010][found Char] Unexpected type on the stack. From 3d780e06fbae1bc106cb90088fa9605ea4a42eed Mon Sep 17 00:00:00 2001 From: Petr Pokorny Date: Mon, 20 Jan 2025 14:11:15 +0100 Subject: [PATCH 23/49] Update VSInsertionTargetBranchName and version (#18243) --- azure-pipelines.yml | 2 +- eng/Versions.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 1e5aaebbdf9..2d562813543 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -35,7 +35,7 @@ variables: # (since for all *new* release branches we insert into VS main and for all *previous* releases we insert into corresponding VS release), # i.e. 'rel/d17.9' *or* 'main' in dotnet/fsharp/refs/heads/main and 'main' in F# dotnet/fsharp/refs/heads/release/dev17.10 (latest release branch) - name: VSInsertionTargetBranchName - value: main + value: rel/d17.13 - name: _TeamName value: FSharp - name: TeamName diff --git a/eng/Versions.props b/eng/Versions.props index 7727e2eda17..3007a6046ed 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -14,7 +14,7 @@ 9 0 - 200 + 201 0 From 5bfbc6dd4213ac8628a6df77dfe144ccd5fc450c Mon Sep 17 00:00:00 2001 From: Edgar Gonzalez Date: Mon, 20 Jan 2025 15:34:41 +0000 Subject: [PATCH 24/49] Fix internal error when missing measure attribute in an unsolved measure typar (#18234) --- .../.FSharp.Compiler.Service/9.0.300.md | 1 + src/Compiler/FSComp.txt | 1 + src/Compiler/TypedTree/TypedTreeOps.fs | 3 ++ src/Compiler/xlf/FSComp.txt.cs.xlf | 5 ++ src/Compiler/xlf/FSComp.txt.de.xlf | 5 ++ src/Compiler/xlf/FSComp.txt.es.xlf | 5 ++ src/Compiler/xlf/FSComp.txt.fr.xlf | 5 ++ src/Compiler/xlf/FSComp.txt.it.xlf | 5 ++ src/Compiler/xlf/FSComp.txt.ja.xlf | 5 ++ src/Compiler/xlf/FSComp.txt.ko.xlf | 5 ++ src/Compiler/xlf/FSComp.txt.pl.xlf | 5 ++ src/Compiler/xlf/FSComp.txt.pt-BR.xlf | 5 ++ src/Compiler/xlf/FSComp.txt.ru.xlf | 5 ++ src/Compiler/xlf/FSComp.txt.tr.xlf | 5 ++ src/Compiler/xlf/FSComp.txt.zh-Hans.xlf | 5 ++ src/Compiler/xlf/FSComp.txt.zh-Hant.xlf | 5 ++ .../ErrorMessages/UnitOfMeasureTests.fs | 52 +++++++++++++++++++ .../FSharp.Compiler.ComponentTests.fsproj | 1 + 18 files changed, 123 insertions(+) create mode 100644 tests/FSharp.Compiler.ComponentTests/ErrorMessages/UnitOfMeasureTests.fs diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md index 5997ca29bd4..f68fffaf418 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md @@ -1,6 +1,7 @@ ### Fixed * Fix Realsig+ generates nested closures with incorrect Generic ([Issue #17797](https://github.com/dotnet/fsharp/issues/17797), [PR #17877](https://github.com/dotnet/fsharp/pull/17877)) +* Fix internal error when missing measure attribute in an unsolved measure typar. ([Issue #7491](https://github.com/dotnet/fsharp/issues/7491), [PR #18234](https://github.com/dotnet/fsharp/pull/18234)== * Set `Cancellable.token` from async computation ([Issue #18235](https://github.com/dotnet/fsharp/issues/18235), [PR #18238](https://github.com/dotnet/fsharp/pull/18238)) ### Added diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index f16be8658dd..4bdee0183ea 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -1789,5 +1789,6 @@ featureUseTypeSubsumptionCache,"Use type conversion cache during compilation" 3872,tcPartialActivePattern,"Multi-case partial active patterns are not supported. Consider using a single-case partial active pattern or a full active pattern." featureDontWarnOnUppercaseIdentifiersInBindingPatterns,"Don't warn on uppercase identifiers in binding patterns" 3873,chkDeprecatePlacesWhereSeqCanBeOmitted,"This construct is deprecated. Sequence expressions should be of the form 'seq {{ ... }}'" +3874,tcExpectedTypeParamMarkedWithUnitOfMeasureAttribute,"Expected unit-of-measure type parameter must be marked with the [] attribute." featureDeprecatePlacesWhereSeqCanBeOmitted,"Deprecate places where 'seq' can be omitted" featureSupportValueOptionsAsOptionalParameters,"Support ValueOption as valid type for optional member parameters" diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index e2bc362c784..e7caeaeec71 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -243,6 +243,9 @@ and remapMeasureAux tyenv unt = | Some tpTy -> match tpTy with | TType_measure unt -> unt + | TType_var(typar= typar) when tp.Kind = TyparKind.Measure -> + // This is a measure typar that is not yet solved, so we can't remap it + error(Error(FSComp.SR.tcExpectedTypeParamMarkedWithUnitOfMeasureAttribute(), typar.Range)) | _ -> failwith "remapMeasureAux: incorrect kinds" | None -> unt | Some (TType_measure unt) -> remapMeasureAux tyenv unt diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index 46543dceeda..94d0739a8ce 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -1362,6 +1362,11 @@ An empty body may only be used if the computation expression builder defines a 'Zero' method. + + Expected unit-of-measure type parameter must be marked with the [<Measure>] attribute. + Expected unit-of-measure type parameter must be marked with the [<Measure>] attribute. + + The syntax 'expr1[expr2]' is used for indexing. Consider adding a type annotation to enable indexing, or if calling a function add a space, e.g. 'expr1 [expr2]'. Syntaxe expr1[expr2] se používá pro indexování. Pokud chcete povolit indexování, zvažte možnost přidat anotaci typu, nebo pokud voláte funkci, přidejte mezeru, třeba expr1 [expr2]. diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index 15daa1c6f0c..b24a332b3cb 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -1362,6 +1362,11 @@ An empty body may only be used if the computation expression builder defines a 'Zero' method. + + Expected unit-of-measure type parameter must be marked with the [<Measure>] attribute. + Expected unit-of-measure type parameter must be marked with the [<Measure>] attribute. + + The syntax 'expr1[expr2]' is used for indexing. Consider adding a type annotation to enable indexing, or if calling a function add a space, e.g. 'expr1 [expr2]'. Die Syntax "expr1[expr2]" wird für die Indizierung verwendet. Fügen Sie ggf. eine Typanmerkung hinzu, um die Indizierung zu aktivieren, oder fügen Sie beim Aufrufen einer Funktion ein Leerzeichen hinzu, z. B. "expr1 [expr2]". diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index e7da4d1c8c0..40dbae13a65 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -1362,6 +1362,11 @@ An empty body may only be used if the computation expression builder defines a 'Zero' method. + + Expected unit-of-measure type parameter must be marked with the [<Measure>] attribute. + Expected unit-of-measure type parameter must be marked with the [<Measure>] attribute. + + The syntax 'expr1[expr2]' is used for indexing. Consider adding a type annotation to enable indexing, or if calling a function add a space, e.g. 'expr1 [expr2]'. La sintaxis "expr1[expr2]" se usa para la indexación. Considere la posibilidad de agregar una anotación de tipo para habilitar la indexación, si se llama a una función, agregue un espacio, por ejemplo, "expr1 [expr2]". diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index b45be9ead6f..6ee0c6f3dd1 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -1362,6 +1362,11 @@ An empty body may only be used if the computation expression builder defines a 'Zero' method. + + Expected unit-of-measure type parameter must be marked with the [<Measure>] attribute. + Expected unit-of-measure type parameter must be marked with the [<Measure>] attribute. + + The syntax 'expr1[expr2]' is used for indexing. Consider adding a type annotation to enable indexing, or if calling a function add a space, e.g. 'expr1 [expr2]'. La syntaxe « expr1[expr2] » est utilisée pour l’indexation. Envisagez d’ajouter une annotation de type pour activer l’indexation, ou si vous appelez une fonction, ajoutez un espace, par exemple « expr1 [expr2] ». diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index a2836525b32..95d709d785e 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -1362,6 +1362,11 @@ An empty body may only be used if the computation expression builder defines a 'Zero' method. + + Expected unit-of-measure type parameter must be marked with the [<Measure>] attribute. + Expected unit-of-measure type parameter must be marked with the [<Measure>] attribute. + + The syntax 'expr1[expr2]' is used for indexing. Consider adding a type annotation to enable indexing, or if calling a function add a space, e.g. 'expr1 [expr2]'. La sintassi 'expr1[expr2]' viene usata per l'indicizzazione. Provare ad aggiungere un'annotazione di tipo per abilitare l'indicizzazione oppure se la chiamata a una funzione aggiunge uno spazio, ad esempio 'expr1 [expr2]'. diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index 1c4d2a34843..8d7e59c2726 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -1362,6 +1362,11 @@ An empty body may only be used if the computation expression builder defines a 'Zero' method. + + Expected unit-of-measure type parameter must be marked with the [<Measure>] attribute. + Expected unit-of-measure type parameter must be marked with the [<Measure>] attribute. + + The syntax 'expr1[expr2]' is used for indexing. Consider adding a type annotation to enable indexing, or if calling a function add a space, e.g. 'expr1 [expr2]'. 構文 'expr1[expr2]' はインデックス作成に使用されます。インデックスを有効にするために型の注釈を追加するか、関数を呼び出す場合には、'expr1 [expr2]' のようにスペースを入れます。 diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index 191f33e9eca..d63fbeba99c 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -1362,6 +1362,11 @@ An empty body may only be used if the computation expression builder defines a 'Zero' method. + + Expected unit-of-measure type parameter must be marked with the [<Measure>] attribute. + Expected unit-of-measure type parameter must be marked with the [<Measure>] attribute. + + The syntax 'expr1[expr2]' is used for indexing. Consider adding a type annotation to enable indexing, or if calling a function add a space, e.g. 'expr1 [expr2]'. 인덱싱에는 'expr1[expr2]' 구문이 사용됩니다. 인덱싱을 사용하도록 설정하기 위해 형식 주석을 추가하는 것을 고려하거나 함수를 호출하는 경우 공백을 추가하세요(예: 'expr1 [expr2]'). diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index 46ddfa1e868..b34ec2ab246 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -1362,6 +1362,11 @@ An empty body may only be used if the computation expression builder defines a 'Zero' method. + + Expected unit-of-measure type parameter must be marked with the [<Measure>] attribute. + Expected unit-of-measure type parameter must be marked with the [<Measure>] attribute. + + The syntax 'expr1[expr2]' is used for indexing. Consider adding a type annotation to enable indexing, or if calling a function add a space, e.g. 'expr1 [expr2]'. Do indeksowania używana jest składnia „expr1[expr2]”. Rozważ dodanie adnotacji typu, aby umożliwić indeksowanie, lub jeśli wywołujesz funkcję dodaj spację, np. „expr1 [expr2]”. diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index 2a86f172c2b..04ae53e1fa8 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -1362,6 +1362,11 @@ An empty body may only be used if the computation expression builder defines a 'Zero' method. + + Expected unit-of-measure type parameter must be marked with the [<Measure>] attribute. + Expected unit-of-measure type parameter must be marked with the [<Measure>] attribute. + + The syntax 'expr1[expr2]' is used for indexing. Consider adding a type annotation to enable indexing, or if calling a function add a space, e.g. 'expr1 [expr2]'. A sintaxe 'expr1[expr2]' é usada para indexação. Considere adicionar uma anotação de tipo para habilitar a indexação ou, se chamar uma função, adicione um espaço, por exemplo, 'expr1 [expr2]'. diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index 3e52e4501b4..66c68dbe5e0 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -1362,6 +1362,11 @@ An empty body may only be used if the computation expression builder defines a 'Zero' method. + + Expected unit-of-measure type parameter must be marked with the [<Measure>] attribute. + Expected unit-of-measure type parameter must be marked with the [<Measure>] attribute. + + The syntax 'expr1[expr2]' is used for indexing. Consider adding a type annotation to enable indexing, or if calling a function add a space, e.g. 'expr1 [expr2]'. Для индексирования используется синтаксис "expr1[expr2]". Рассмотрите возможность добавления аннотации типа для включения индексации или при вызове функции добавьте пробел, например "expr1 [expr2]". diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index 81ed83f5717..b6979546951 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -1362,6 +1362,11 @@ An empty body may only be used if the computation expression builder defines a 'Zero' method. + + Expected unit-of-measure type parameter must be marked with the [<Measure>] attribute. + Expected unit-of-measure type parameter must be marked with the [<Measure>] attribute. + + The syntax 'expr1[expr2]' is used for indexing. Consider adding a type annotation to enable indexing, or if calling a function add a space, e.g. 'expr1 [expr2]'. Söz dizimi “expr1[expr2]” dizin oluşturma için kullanılıyor. Dizin oluşturmayı etkinleştirmek için bir tür ek açıklama eklemeyi düşünün veya bir işlev çağırıyorsanız bir boşluk ekleyin, örn. “expr1 [expr2]”. diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index 35e9ec9073e..2101acb475e 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -1362,6 +1362,11 @@ An empty body may only be used if the computation expression builder defines a 'Zero' method. + + Expected unit-of-measure type parameter must be marked with the [<Measure>] attribute. + Expected unit-of-measure type parameter must be marked with the [<Measure>] attribute. + + The syntax 'expr1[expr2]' is used for indexing. Consider adding a type annotation to enable indexing, or if calling a function add a space, e.g. 'expr1 [expr2]'. 语法“expr1[expr2]”用于索引。考虑添加类型批注来启用索引,或者在调用函数添加空格,例如“expr1 [expr2]”。 diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index bed34cb225b..0a02ec6669c 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -1362,6 +1362,11 @@ An empty body may only be used if the computation expression builder defines a 'Zero' method. + + Expected unit-of-measure type parameter must be marked with the [<Measure>] attribute. + Expected unit-of-measure type parameter must be marked with the [<Measure>] attribute. + + The syntax 'expr1[expr2]' is used for indexing. Consider adding a type annotation to enable indexing, or if calling a function add a space, e.g. 'expr1 [expr2]'. 語法 'expr1[expr2]' 已用於編製索引。請考慮新增類型註釋來啟用編製索引,或是呼叫函式並新增空格,例如 'expr1 [expr2]'。 diff --git a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/UnitOfMeasureTests.fs b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/UnitOfMeasureTests.fs new file mode 100644 index 00000000000..36ef76e772d --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/UnitOfMeasureTests.fs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +module ErrorMessages.UnitOfMeasureTests + +open Xunit +open FSharp.Test.Compiler + +[] +let ``Error - Expected unit-of-measure type parameter must be marked with the [] attribute.`` () = + Fsx """ +type A<[]'u>(x : int<'u>) = + member this.X = x + +type B<'u>(x: 'u) = + member this.X = x + +module M = + type A<'u> with // Note the missing Measure attribute + member this.Y = this.X + + type B<'u> with + member this.Y = this.X + +open System.Runtime.CompilerServices +type FooExt = + [] + static member Bar(this: A<'u>, value: A<'u>) = this + """ + |> typecheck + |> shouldFail + |> withDiagnostics [ + (Error 3874, Line 9, Col 12, Line 9, Col 14, "Expected unit-of-measure type parameter must be marked with the [] attribute.") + ] + +[] +let ``Expected unit-of-measure type parameter must be marked with the [] attribute.`` () = + Fsx """ +type A<[]'u>(x : int<'u>) = + member this.X = x + +module M = + type A<[] 'u> with // Note the Measure attribute + member this.Y = this.X + +open System.Runtime.CompilerServices +type FooExt = + [] + static member Bar(this: A<'u>, value: A<'u>) = this + """ + |> typecheck + |> shouldSucceed + diff --git a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj index b96aba6777b..9eb31c35e0d 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj +++ b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj @@ -218,6 +218,7 @@ + From 4b676b4bceec4466611b686760b9cc082b8e1e1c Mon Sep 17 00:00:00 2001 From: Edgar Gonzalez Date: Mon, 20 Jan 2025 16:18:57 +0000 Subject: [PATCH 25/49] Update `Obsolete` attribute checking to account for `diagnosticId` and `urlFormat` properties (#18224) --- .../.FSharp.Compiler.Service/9.0.300.md | 5 +- src/Compiler/Checking/AttributeChecking.fs | 230 ++++++++----- src/Compiler/Checking/AttributeChecking.fsi | 9 +- src/Compiler/Checking/PostInferenceChecks.fs | 2 +- src/Compiler/Driver/CompilerDiagnostics.fs | 11 +- src/Compiler/Symbols/FSharpDiagnostic.fs | 15 +- src/Compiler/Symbols/FSharpDiagnostic.fsi | 11 + src/Compiler/TypedTree/TypedTreeOps.fs | 6 + src/Compiler/TypedTree/TypedTreeOps.fsi | 5 + .../ExtendedDiagnosticDataTests.fs | 301 ++++++++++++++++++ ...ervice.SurfaceArea.netstandard20.debug.bsl | 5 + ...vice.SurfaceArea.netstandard20.release.bsl | 5 + 12 files changed, 512 insertions(+), 93 deletions(-) mode change 100644 => 100755 src/Compiler/Checking/AttributeChecking.fs diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md index f68fffaf418..157b1af93cc 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md @@ -1,15 +1,12 @@ ### Fixed - * Fix Realsig+ generates nested closures with incorrect Generic ([Issue #17797](https://github.com/dotnet/fsharp/issues/17797), [PR #17877](https://github.com/dotnet/fsharp/pull/17877)) * Fix internal error when missing measure attribute in an unsolved measure typar. ([Issue #7491](https://github.com/dotnet/fsharp/issues/7491), [PR #18234](https://github.com/dotnet/fsharp/pull/18234)== * Set `Cancellable.token` from async computation ([Issue #18235](https://github.com/dotnet/fsharp/issues/18235), [PR #18238](https://github.com/dotnet/fsharp/pull/18238)) ### Added - * Added missing type constraints in FCS. ([PR #18241](https://github.com/dotnet/fsharp/pull/18241)) ### Changed - +* Update `Obsolete` attribute checking to account for `DiagnosticId` and `UrlFormat` properties. ([PR #18224](https://github.com/dotnet/fsharp/pull/18224)) ### Breaking Changes - diff --git a/src/Compiler/Checking/AttributeChecking.fs b/src/Compiler/Checking/AttributeChecking.fs old mode 100644 new mode 100755 index 563af942829..8c317ad5f31 --- a/src/Compiler/Checking/AttributeChecking.fs +++ b/src/Compiler/Checking/AttributeChecking.fs @@ -24,8 +24,12 @@ open FSharp.Compiler.TypeProviders open FSharp.Core.CompilerServices #endif -exception ObsoleteWarning of string * range -exception ObsoleteError of string * range +exception ObsoleteDiagnostic of + isError: bool * + diagnosticId: string * + message: string * + urlFormat: string * + range: range let fail() = failwith "This custom attribute has an argument that cannot yet be converted using this API" @@ -234,7 +238,6 @@ let MethInfoHasAttribute g m attribSpec minfo = (fun _ -> Some ()) |> Option.isSome - let private CheckCompilerFeatureRequiredAttribute (g: TcGlobals) cattrs msg m = // In some cases C# will generate both ObsoleteAttribute and CompilerFeatureRequiredAttribute. // Specifically, when default constructor is generated for class with any required members in them. @@ -244,87 +247,160 @@ let private CheckCompilerFeatureRequiredAttribute (g: TcGlobals) cattrs msg m = | Some([ILAttribElem.String (Some featureName) ], _) when featureName = "RequiredMembers" -> CompleteD | _ -> - ErrorD (ObsoleteError(msg, m)) + ErrorD (ObsoleteDiagnostic(true, "", msg, "", m)) + +let private extractILObsoleteAttributeInfo namedArgs = + let extractILAttribValueFrom name namedArgs = + match namedArgs with + | ExtractILAttributeNamedArg name (AttribElemStringArg v) -> v + | _ -> "" + let diagnosticId = extractILAttribValueFrom "DiagnosticId" namedArgs + let urlFormat = extractILAttribValueFrom "UrlFormat" namedArgs + (diagnosticId, urlFormat) + +let private CheckILObsoleteAttributes (g: TcGlobals) isByrefLikeTyconRef cattrs m = + if isByrefLikeTyconRef then + CompleteD + else + let (AttribInfo(tref,_)) = g.attrib_SystemObsolete + match TryDecodeILAttribute tref cattrs with + // [] + // [] + // [] + // [] + // [] + // [] + // [] + // [] + // [] + // Constructors deciding on IsError and Message properties. + | Some ([ attribElement ], namedArgs) -> + let diagnosticId, urlFormat = extractILObsoleteAttributeInfo namedArgs + let msg = + match attribElement with + | ILAttribElem.String (Some msg) -> msg + | ILAttribElem.String None + | _ -> "" + + WarnD (ObsoleteDiagnostic(false, diagnosticId, msg, urlFormat, m)) + | Some ([ILAttribElem.String (Some msg); ILAttribElem.Bool isError ], namedArgs) -> + let diagnosticId, urlFormat = extractILObsoleteAttributeInfo namedArgs + if isError then + if g.langVersion.SupportsFeature(LanguageFeature.RequiredPropertiesSupport) then + CheckCompilerFeatureRequiredAttribute g cattrs msg m + else + ErrorD (ObsoleteDiagnostic(true, diagnosticId, msg, urlFormat, m)) + else + WarnD (ObsoleteDiagnostic(false, diagnosticId, msg, urlFormat, m)) + // Only DiagnosticId, UrlFormat + | Some (_, namedArgs) -> + let diagnosticId, urlFormat = extractILObsoleteAttributeInfo namedArgs + WarnD(ObsoleteDiagnostic(false, diagnosticId, "", urlFormat, m)) + // No arguments + | None -> CompleteD /// Check IL attributes for 'ObsoleteAttribute', returning errors and warnings as data let private CheckILAttributes (g: TcGlobals) isByrefLikeTyconRef cattrs m = - let (AttribInfo(tref,_)) = g.attrib_SystemObsolete - match TryDecodeILAttribute tref cattrs with - | Some ([ILAttribElem.String (Some msg) ], _) when not isByrefLikeTyconRef -> - WarnD(ObsoleteWarning(msg, m)) - | Some ([ILAttribElem.String (Some msg); ILAttribElem.Bool isError ], _) when not isByrefLikeTyconRef -> - if isError then - if g.langVersion.SupportsFeature(LanguageFeature.RequiredPropertiesSupport) then - CheckCompilerFeatureRequiredAttribute g cattrs msg m - else - ErrorD (ObsoleteError(msg, m)) - else - WarnD (ObsoleteWarning(msg, m)) - | Some ([ILAttribElem.String None ], _) when not isByrefLikeTyconRef -> - WarnD(ObsoleteWarning("", m)) - | Some _ when not isByrefLikeTyconRef -> - WarnD(ObsoleteWarning("", m)) - | _ -> - CompleteD + trackErrors { + do! CheckILObsoleteAttributes g isByrefLikeTyconRef cattrs m + } let langVersionPrefix = "--langversion:preview" +let private extractObsoleteAttributeInfo namedArgs = + let extractILAttribValueFrom name namedArgs = + match namedArgs with + | ExtractAttribNamedArg name (AttribStringArg v) -> v + | _ -> "" + let diagnosticId = extractILAttribValueFrom "DiagnosticId" namedArgs + let urlFormat = extractILAttribValueFrom "UrlFormat" namedArgs + (diagnosticId, urlFormat) + +let private CheckObsoleteAttributes g attribs m = + trackErrors { + match TryFindFSharpAttribute g g.attrib_SystemObsolete attribs with + // [] + // [] + // [] + // [] + // [] + // [] + // [] + // [] + // [] + // Constructors deciding on IsError and Message properties. + | Some(Attrib(unnamedArgs= [ AttribStringArg s ]; propVal= namedArgs)) -> + let diagnosticId, urlFormat = extractObsoleteAttributeInfo namedArgs + do! WarnD(ObsoleteDiagnostic(false, diagnosticId, s, urlFormat, m)) + | Some(Attrib(unnamedArgs= [ AttribStringArg s; AttribBoolArg(isError) ]; propVal= namedArgs)) -> + let diagnosticId, urlFormat = extractObsoleteAttributeInfo namedArgs + if isError then + do! ErrorD (ObsoleteDiagnostic(true, diagnosticId, s, urlFormat, m)) + else + do! WarnD (ObsoleteDiagnostic(false, diagnosticId, s, urlFormat, m)) + // Only DiagnosticId, UrlFormat + | Some(Attrib(propVal= namedArgs)) -> + let diagnosticId, urlFormat = extractObsoleteAttributeInfo namedArgs + do! WarnD(ObsoleteDiagnostic(false, diagnosticId, "", urlFormat, m)) + | None -> () + } + +let private CheckCompilerMessageAttribute g attribs m = + trackErrors { + match TryFindFSharpAttribute g g.attrib_CompilerMessageAttribute attribs with + | Some(Attrib(unnamedArgs= [ AttribStringArg s ; AttribInt32Arg n ]; propVal= namedArgs)) -> + let msg = UserCompilerMessage(s, n, m) + let isError = + match namedArgs with + | ExtractAttribNamedArg "IsError" (AttribBoolArg v) -> v + | _ -> false + // If we are using a compiler that supports nameof then error 3501 is always suppressed. + // See attribute on FSharp.Core 'nameof' + if n = 3501 then + () + elif isError && (not g.compilingFSharpCore || n <> 1204) then + do! ErrorD msg + else + do! WarnD msg + | _ -> + () + } + +let private CheckExperimentalAttribute g attribs m = + trackErrors { + match TryFindFSharpAttribute g g.attrib_ExperimentalAttribute attribs with + | Some(Attrib(unnamedArgs= [ AttribStringArg(s) ])) -> + let isExperimentalAttributeDisabled (s:string) = + if g.compilingFSharpCore then + true + else + g.langVersion.IsPreviewEnabled && (s.IndexOf(langVersionPrefix, StringComparison.OrdinalIgnoreCase) >= 0) + if not (isExperimentalAttributeDisabled s) then + do! WarnD(Experimental(s, m)) + | Some _ -> + do! WarnD(Experimental(FSComp.SR.experimentalConstruct (), m)) + | _ -> + () + } + +let private CheckUnverifiableAttribute g attribs m = + trackErrors { + match TryFindFSharpAttribute g g.attrib_UnverifiableAttribute attribs with + | Some _ -> + do! WarnD(PossibleUnverifiableCode(m)) + | _ -> () + } + /// Check F# attributes for 'ObsoleteAttribute', 'CompilerMessageAttribute' and 'ExperimentalAttribute', /// returning errors and warnings as data let CheckFSharpAttributes (g:TcGlobals) attribs m = if isNil attribs then CompleteD else trackErrors { - match TryFindFSharpAttribute g g.attrib_SystemObsolete attribs with - | Some(Attrib(_, _, [ AttribStringArg s ], _, _, _, _)) -> - do! WarnD(ObsoleteWarning(s, m)) - | Some(Attrib(_, _, [ AttribStringArg s; AttribBoolArg(isError) ], _, _, _, _)) -> - if isError then - do! ErrorD (ObsoleteError(s, m)) - else - do! WarnD (ObsoleteWarning(s, m)) - | Some _ -> - do! WarnD(ObsoleteWarning("", m)) - | None -> - () - - match TryFindFSharpAttribute g g.attrib_CompilerMessageAttribute attribs with - | Some(Attrib(_, _, [ AttribStringArg s ; AttribInt32Arg n ], namedArgs, _, _, _)) -> - let msg = UserCompilerMessage(s, n, m) - let isError = - match namedArgs with - | ExtractAttribNamedArg "IsError" (AttribBoolArg v) -> v - | _ -> false - // If we are using a compiler that supports nameof then error 3501 is always suppressed. - // See attribute on FSharp.Core 'nameof' - if n = 3501 then - () - elif isError && (not g.compilingFSharpCore || n <> 1204) then - do! ErrorD msg - else - do! WarnD msg - | _ -> - () - - match TryFindFSharpAttribute g g.attrib_ExperimentalAttribute attribs with - | Some(Attrib(_, _, [ AttribStringArg(s) ], _, _, _, _)) -> - let isExperimentalAttributeDisabled (s:string) = - if g.compilingFSharpCore then - true - else - g.langVersion.IsPreviewEnabled && (s.IndexOf(langVersionPrefix, StringComparison.OrdinalIgnoreCase) >= 0) - if not (isExperimentalAttributeDisabled s) then - do! WarnD(Experimental(s, m)) - | Some _ -> - do! WarnD(Experimental(FSComp.SR.experimentalConstruct (), m)) - | _ -> - () - - match TryFindFSharpAttribute g g.attrib_UnverifiableAttribute attribs with - | Some _ -> - do! WarnD(PossibleUnverifiableCode(m)) - | _ -> - () + do! CheckObsoleteAttributes g attribs m + do! CheckCompilerMessageAttribute g attribs m + do! CheckExperimentalAttribute g attribs m + do! CheckUnverifiableAttribute g attribs m } #if !NO_TYPEPROVIDERS @@ -332,16 +408,16 @@ let CheckFSharpAttributes (g:TcGlobals) attribs m = let private CheckProvidedAttributes (g: TcGlobals) m (provAttribs: Tainted) = let (AttribInfo(tref, _)) = g.attrib_SystemObsolete match provAttribs.PUntaint((fun a -> a.GetAttributeConstructorArgs(provAttribs.TypeProvider.PUntaintNoFailure(id), tref.FullName)), m) with - | Some ([ Some (:? string as msg) ], _) -> WarnD(ObsoleteWarning(msg, m)) + | Some ([ Some (:? string as msg) ], _) -> WarnD(ObsoleteDiagnostic(false, "", msg, "", m)) | Some ([ Some (:? string as msg); Some (:?bool as isError) ], _) -> if isError then - ErrorD (ObsoleteError(msg, m)) + ErrorD (ObsoleteDiagnostic(true, "", msg, "", m)) else - WarnD (ObsoleteWarning(msg, m)) + WarnD (ObsoleteDiagnostic(false, "", msg, "", m)) | Some ([ None ], _) -> - WarnD(ObsoleteWarning("", m)) + WarnD(ObsoleteDiagnostic(false, "", "", "", m)) | Some _ -> - WarnD(ObsoleteWarning("", m)) + WarnD(ObsoleteDiagnostic(false, "", "", "", m)) | None -> CompleteD #endif diff --git a/src/Compiler/Checking/AttributeChecking.fsi b/src/Compiler/Checking/AttributeChecking.fsi index 663198f9247..5885c1b39e9 100644 --- a/src/Compiler/Checking/AttributeChecking.fsi +++ b/src/Compiler/Checking/AttributeChecking.fsi @@ -13,9 +13,12 @@ open FSharp.Compiler.TcGlobals open FSharp.Compiler.Text open FSharp.Compiler.TypedTree -exception ObsoleteWarning of string * range - -exception ObsoleteError of string * range +exception ObsoleteDiagnostic of + isError: bool * + diagnosticId: string * + message: string * + urlFormat: string * + range: range type AttribInfo = | FSAttribInfo of TcGlobals * Attrib diff --git a/src/Compiler/Checking/PostInferenceChecks.fs b/src/Compiler/Checking/PostInferenceChecks.fs index 645f43fe3cb..e8d6f5a5af0 100644 --- a/src/Compiler/Checking/PostInferenceChecks.fs +++ b/src/Compiler/Checking/PostInferenceChecks.fs @@ -551,7 +551,7 @@ let WarnOnWrongTypeForAccess (cenv: cenv) env objName valAcc m ty = if isLessAccessible tyconAcc valAcc then let errorText = FSComp.SR.chkTypeLessAccessibleThanType(tcref.DisplayName, (objName())) |> snd let warningText = errorText + Environment.NewLine + FSComp.SR.tcTypeAbbreviationsCheckedAtCompileTime() - warning(AttributeChecking.ObsoleteWarning(warningText, m)) + warning(AttributeChecking.ObsoleteDiagnostic(false, "", warningText, "", m)) CheckTypeDeep cenv (visitType, None, None, None, None) cenv.g env NoInfo ty diff --git a/src/Compiler/Driver/CompilerDiagnostics.fs b/src/Compiler/Driver/CompilerDiagnostics.fs index 9dcf0b72ea3..019226f46e4 100644 --- a/src/Compiler/Driver/CompilerDiagnostics.fs +++ b/src/Compiler/Driver/CompilerDiagnostics.fs @@ -148,8 +148,7 @@ type Exception with | IntfImplInExtrinsicAugmentation m | ValueRestriction(_, _, _, _, m) | LetRecUnsound(_, _, m) - | ObsoleteError(_, m) - | ObsoleteWarning(_, m) + | ObsoleteDiagnostic(_, _, _, _, m) | Experimental(_, m) | PossibleUnverifiableCode m | UserCompilerMessage(_, _, m) @@ -266,7 +265,7 @@ type Exception with | UnresolvedOverloading _ -> 41 | LibraryUseOnly _ -> 42 | ErrorFromAddingConstraint _ -> 43 - | ObsoleteWarning _ -> 44 + | ObsoleteDiagnostic(isError = false) -> 44 | ReservedKeyword _ -> 46 | SelfRefObjCtor _ -> 47 | VirtualAugmentationOnNullValuedType _ -> 48 @@ -327,7 +326,7 @@ type Exception with | UnresolvedConversionOperator _ -> 93 // avoid 94-100 for safety - | ObsoleteError _ -> 101 + | ObsoleteDiagnostic(isError = true) -> 101 #if !NO_TYPEPROVIDERS | TypeProviders.ProvidedTypeResolutionNoRange _ | TypeProviders.ProvidedTypeResolution _ -> 103 @@ -1790,9 +1789,7 @@ type Exception with | ValNotLocal _ -> os.AppendString(ValNotLocalE().Format) - | ObsoleteError(s, _) - - | ObsoleteWarning(s, _) -> + | ObsoleteDiagnostic(message = s) -> os.AppendString(Obsolete1E().Format) if s <> "" then diff --git a/src/Compiler/Symbols/FSharpDiagnostic.fs b/src/Compiler/Symbols/FSharpDiagnostic.fs index 31ec0536c3e..581b51ab8c7 100644 --- a/src/Compiler/Symbols/FSharpDiagnostic.fs +++ b/src/Compiler/Symbols/FSharpDiagnostic.fs @@ -9,6 +9,7 @@ namespace FSharp.Compiler.Diagnostics open System +open FSharp.Compiler.AttributeChecking open FSharp.Compiler.CheckExpressions open FSharp.Compiler.ConstraintSolver open FSharp.Compiler.SignatureConformance @@ -18,7 +19,6 @@ open FSharp.Compiler.TypedTree open FSharp.Compiler.TypedTreeBasics open FSharp.Compiler.TypedTreeOps open Internal.Utilities.Library -open Internal.Utilities.Library.Extras open FSharp.Core.Printf open FSharp.Compiler @@ -67,6 +67,17 @@ module ExtendedData = [] type IFSharpDiagnosticExtendedData = interface end + /// Additional data for diagnostics about obsolete attributes. + [] + type ObsoleteDiagnosticExtendedData + internal (diagnosticId: string, urlFormat: string) = + interface IFSharpDiagnosticExtendedData + /// Represents the DiagnosticId of the diagnostic + member this.DiagnosticId: string = diagnosticId + + /// Represents the URL format of the diagnostic + member this.UrlFormat: string = urlFormat + [] type TypeMismatchDiagnosticExtendedData internal (symbolEnv: SymbolEnv, dispEnv: DisplayEnv, expectedType: TType, actualType: TType, context: DiagnosticContextInfo) = @@ -201,6 +212,8 @@ type FSharpDiagnostic(m: range, severity: FSharpDiagnosticSeverity, message: str | DefinitionsInSigAndImplNotCompatibleAbbreviationsDiffer(implTycon = implTycon; sigTycon = sigTycon) -> Some(DefinitionsInSigAndImplNotCompatibleAbbreviationsDifferExtendedData(sigTycon, implTycon)) + | ObsoleteDiagnostic(diagnosticId= diagnosticId; urlFormat= urlFormat) -> + Some(ObsoleteDiagnosticExtendedData(diagnosticId, urlFormat)) | _ -> None let msg = diff --git a/src/Compiler/Symbols/FSharpDiagnostic.fsi b/src/Compiler/Symbols/FSharpDiagnostic.fsi index 6c941bdd84d..ecee4c0540b 100644 --- a/src/Compiler/Symbols/FSharpDiagnostic.fsi +++ b/src/Compiler/Symbols/FSharpDiagnostic.fsi @@ -50,6 +50,17 @@ module public ExtendedData = interface end + /// Additional data for diagnostics about obsolete attributes. + [] + type public ObsoleteDiagnosticExtendedData = + interface IFSharpDiagnosticExtendedData + + /// Represents the DiagnosticId of the diagnostic + member DiagnosticId: string + + /// Represents the URL format of the diagnostic + member UrlFormat: string + /// Additional data for type-mismatch-like (usually with ErrorNumber = 1) diagnostics [] type public TypeMismatchDiagnosticExtendedData = diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index e7caeaeec71..d4f58881b19 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -3527,6 +3527,10 @@ let IsMatchingFSharpAttributeOpt g attrOpt (Attrib(tcref2, _, _, _, _, _, _)) = [] let (|ExtractAttribNamedArg|_|) nm args = args |> List.tryPick (function AttribNamedArg(nm2, _, _, v) when nm = nm2 -> Some v | _ -> None) |> ValueOptionInternal.ofOption + +[] +let (|ExtractILAttributeNamedArg|_|) nm (args: ILAttributeNamedArg list) = + args |> List.tryPick (function nm2, _, _, v when nm = nm2 -> Some v | _ -> None) |> ValueOptionInternal.ofOption [] let (|StringExpr|_|) = function Expr.Const (Const.String n, _, _) -> ValueSome n | _ -> ValueNone @@ -3543,6 +3547,8 @@ let (|AttribBoolArg|_|) = function AttribExpr(_, Expr.Const (Const.Bool n, _, _) [] let (|AttribStringArg|_|) = function AttribExpr(_, Expr.Const (Const.String n, _, _)) -> ValueSome n | _ -> ValueNone +let (|AttribElemStringArg|_|) = function ILAttribElem.String(n) -> n | _ -> None + let TryFindFSharpBoolAttributeWithDefault dflt g nm attrs = match TryFindFSharpAttribute g nm attrs with | Some(Attrib(_, _, [ ], _, _, _, _)) -> Some dflt diff --git a/src/Compiler/TypedTree/TypedTreeOps.fsi b/src/Compiler/TypedTree/TypedTreeOps.fsi index 10f66bf63bf..3bca5cdb21e 100755 --- a/src/Compiler/TypedTree/TypedTreeOps.fsi +++ b/src/Compiler/TypedTree/TypedTreeOps.fsi @@ -2601,6 +2601,9 @@ val (|ConstToILFieldInit|_|): Const -> ILFieldInit voption [] val (|ExtractAttribNamedArg|_|): string -> AttribNamedArg list -> AttribExpr voption +[] +val (|ExtractILAttributeNamedArg|_|): string -> ILAttributeNamedArg list -> ILAttribElem voption + [] val (|AttribInt32Arg|_|): (AttribExpr -> int32 voption) @@ -2613,6 +2616,8 @@ val (|AttribBoolArg|_|): (AttribExpr -> bool voption) [] val (|AttribStringArg|_|): (AttribExpr -> string voption) +val (|AttribElemStringArg|_|): (ILAttribElem -> string option) + [] val (|Int32Expr|_|): Expr -> int32 voption diff --git a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/ExtendedDiagnosticDataTests.fs b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/ExtendedDiagnosticDataTests.fs index 65a1cceb43d..23e4a9b9440 100644 --- a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/ExtendedDiagnosticDataTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/ExtendedDiagnosticDataTests.fs @@ -241,3 +241,304 @@ type Foo = {| bar: int; x: int |} (fun (fieldsData: DefinitionsInSigAndImplNotCompatibleAbbreviationsDifferExtendedData) -> assertRange (4,5) (4,8) fieldsData.SignatureRange assertRange (4,6) (4,9) fieldsData.ImplementationRange) + + +[] +let ``Warning - ObsoleteDiagnosticExtendedData 01`` () = + FSharp """ +open System +[] +type MyClass() = class end + +let x = MyClass() +""" + |> typecheckResults + |> checkDiagnostic + (44, "This construct is deprecated. Message") + (fun (obsoleteDiagnostic: ObsoleteDiagnosticExtendedData) -> + Assert.Equal("FS222", obsoleteDiagnostic.DiagnosticId) + Assert.Equal("https://example.com", obsoleteDiagnostic.UrlFormat)) + +[] +let ``Warning - ObsoleteDiagnosticExtendedData 02`` () = + FSharp """ +open System +[] +type MyClass() = class end + +let x = MyClass() +""" + |> typecheckResults + |> checkDiagnostic + (44, "This construct is deprecated. Message") + (fun (obsoleteDiagnostic: ObsoleteDiagnosticExtendedData) -> + Assert.Equal("FS222", obsoleteDiagnostic.DiagnosticId) + Assert.Equal("", obsoleteDiagnostic.UrlFormat)) + +[] +let ``Warning - ObsoleteDiagnosticExtendedData 03`` () = + FSharp """ +open System +[] +type MyClass() = class end + +let x = MyClass() +""" + |> typecheckResults + |> checkDiagnostic + (44, "This construct is deprecated. Message") + (fun (obsoleteDiagnostic: ObsoleteDiagnosticExtendedData) -> + Assert.Equal("", obsoleteDiagnostic.DiagnosticId) + Assert.Equal("", obsoleteDiagnostic.UrlFormat)) + +[] +let ``Warning - ObsoleteDiagnosticExtendedData 04`` () = + FSharp """ +open System +[] +type MyClass() = class end + +let x = MyClass() +""" + |> typecheckResults + |> checkDiagnostic + (44, "This construct is deprecated") + (fun (obsoleteDiagnostic: ObsoleteDiagnosticExtendedData) -> + Assert.Equal("FS222", obsoleteDiagnostic.DiagnosticId) + Assert.Equal("https://example.com", obsoleteDiagnostic.UrlFormat)) + + +[] +let ``Warning - ObsoleteDiagnosticExtendedData 05`` () = + let CSLib = + CSharp """ +using System; +[Obsolete("Use something else", false, DiagnosticId = "FS222")] +public static class Class1 +{ + public static string Test() + { + return "Hello"; + } +} + """ + |> withName "CSLib" + + let app = + FSharp """ +open MyLib + +let text = Class1.Test(); + """ |> withReferences [CSLib] + + app + |> typecheckResults + |> checkDiagnostic + (44, "This construct is deprecated. Use something else") + (fun (obsoleteDiagnostic: ObsoleteDiagnosticExtendedData) -> + Assert.Equal("FS222", obsoleteDiagnostic.DiagnosticId) + Assert.Equal("", obsoleteDiagnostic.UrlFormat)) + +[] +let ``Warning - ObsoleteDiagnosticExtendedData 06`` () = + let CSLib = + CSharp """ +using System; +[Obsolete("Use something else", false, DiagnosticId = "FS222", UrlFormat = "https://example.com")] +public static class Class1 +{ + public static string Test() + { + return "Hello"; + } +} + """ + |> withName "CSLib" + + let app = + FSharp """ +open MyLib + +let text = Class1.Test(); + """ |> withReferences [CSLib] + + app + |> typecheckResults + |> checkDiagnostic + (44, "This construct is deprecated. Use something else") + (fun (obsoleteDiagnostic: ObsoleteDiagnosticExtendedData) -> + Assert.Equal("FS222", obsoleteDiagnostic.DiagnosticId) + Assert.Equal("https://example.com", obsoleteDiagnostic.UrlFormat)) + +[] +let ``Warning - ObsoleteDiagnosticExtendedData 07`` () = + let CSLib = + CSharp """ +using System; +[Obsolete("Use something else", false)] +public static class Class1 +{ + public static string Test() + { + return "Hello"; + } +} + """ + |> withName "CSLib" + + let app = + FSharp """ +open MyLib + +let text = Class1.Test(); + """ |> withReferences [CSLib] + + app + |> typecheckResults + |> checkDiagnostic + (44, "This construct is deprecated. Use something else") + (fun (obsoleteDiagnostic: ObsoleteDiagnosticExtendedData) -> + Assert.Equal("", obsoleteDiagnostic.DiagnosticId) + Assert.Equal("", obsoleteDiagnostic.UrlFormat)) + +[] +let ``Warning - ObsoleteDiagnosticExtendedData 08`` () = + let CSLib = + CSharp """ +using System; +[Obsolete(DiagnosticId = "FS222", UrlFormat = "https://example.com")] +public static class Class1 +{ + public static string Test() + { + return "Hello"; + } +} + """ + |> withName "CSLib" + + let app = + FSharp """ +open MyLib + +let text = Class1.Test(); + """ |> withReferences [CSLib] + + app + |> typecheckResults + |> checkDiagnostic + (44, "This construct is deprecated") + (fun (obsoleteDiagnostic: ObsoleteDiagnosticExtendedData) -> + Assert.Equal("FS222", obsoleteDiagnostic.DiagnosticId) + Assert.Equal("https://example.com", obsoleteDiagnostic.UrlFormat)) + +[] +let ``Warning - ObsoleteDiagnosticExtendedData 09`` () = + FSharp """ +open System +[] +type MyClass() = class end + +let x = MyClass() +""" + |> typecheckResults + |> checkDiagnostic + (44, "This construct is deprecated") + (fun (obsoleteDiagnostic: ObsoleteDiagnosticExtendedData) -> + Assert.Equal("", obsoleteDiagnostic.DiagnosticId) + Assert.Equal("", obsoleteDiagnostic.UrlFormat)) + +[] +let ``Warning - ObsoleteDiagnosticExtendedData 10`` () = + let CSLib = + CSharp """ +using System; +[Obsolete] +public static class Class1 +{ + public static string Test() + { + return "Hello"; + } +} + """ + |> withName "CSLib" + + let app = + FSharp """ +open MyLib + +let text = Class1.Test(); + """ |> withReferences [CSLib] + + app + |> typecheckResults + |> checkDiagnostic + (44, "This construct is deprecated") + (fun (obsoleteDiagnostic: ObsoleteDiagnosticExtendedData) -> + Assert.Equal("", obsoleteDiagnostic.DiagnosticId) + Assert.Equal("", obsoleteDiagnostic.UrlFormat)) + +[] +let ``Error - ObsoleteDiagnosticExtendedData 01`` () = + FSharp """ +open System +[] +type MyClass() = class end + +let x = MyClass() +""" + |> typecheckResults + |> checkDiagnostic + (101, "This construct is deprecated. Message") + (fun (obsoleteDiagnostic: ObsoleteDiagnosticExtendedData) -> + Assert.Equal("FS222", obsoleteDiagnostic.DiagnosticId) + Assert.Equal("https://example.com", obsoleteDiagnostic.UrlFormat)) + +[] +let ``Error - ObsoleteDiagnosticExtendedData 02`` () = + FSharp """ +open System +[] +type MyClass() = class end + +let x = MyClass() +""" + |> typecheckResults + |> checkDiagnostic + (101, "This construct is deprecated. Message") + (fun (obsoleteDiagnostic: ObsoleteDiagnosticExtendedData) -> + Assert.Equal("FS222", obsoleteDiagnostic.DiagnosticId) + Assert.Equal("", obsoleteDiagnostic.UrlFormat)) + +[] +let ``Error - ObsoleteDiagnosticExtendedData 03`` () = + FSharp """ +open System +[] +type MyClass() = class end + +let x = MyClass() +""" + |> typecheckResults + |> checkDiagnostic + (101, "This construct is deprecated. Message") + (fun (obsoleteDiagnostic: ObsoleteDiagnosticExtendedData) -> + Assert.Equal("", obsoleteDiagnostic.DiagnosticId) + Assert.Equal("", obsoleteDiagnostic.UrlFormat)) + +[] +let ``Error - ObsoleteDiagnosticExtendedData 04`` () = + FSharp """ +open System +[] +type MyClass() = class end + +let x = MyClass() +""" + |> typecheckResults + |> checkDiagnostic + (101, "This construct is deprecated") + (fun (obsoleteDiagnostic: ObsoleteDiagnosticExtendedData) -> + Assert.Equal("FS222", obsoleteDiagnostic.DiagnosticId) + Assert.Equal("https://example.com", obsoleteDiagnostic.UrlFormat)) \ No newline at end of file diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl index 13180c3b649..e85b3022c96 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl @@ -2856,6 +2856,11 @@ FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedDa FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+IFSharpDiagnosticExtendedData FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+TypeMismatchDiagnosticExtendedData FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+ValueNotContainedDiagnosticExtendedData +FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: System.String DiagnosticId +FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: System.String UrlFormat +FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: System.String get_DiagnosticId() +FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: System.String get_UrlFormat() +FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData FSharp.Compiler.Diagnostics.FSharpDiagnostic: FSharp.Compiler.Diagnostics.FSharpDiagnostic Create(FSharp.Compiler.Diagnostics.FSharpDiagnosticSeverity, System.String, Int32, FSharp.Compiler.Text.Range, Microsoft.FSharp.Core.FSharpOption`1[System.String], Microsoft.FSharp.Core.FSharpOption`1[System.String]) FSharp.Compiler.Diagnostics.FSharpDiagnostic: FSharp.Compiler.Diagnostics.FSharpDiagnosticSeverity Severity FSharp.Compiler.Diagnostics.FSharpDiagnostic: FSharp.Compiler.Diagnostics.FSharpDiagnosticSeverity get_Severity() diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl index 13180c3b649..e85b3022c96 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl @@ -2856,6 +2856,11 @@ FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedDa FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+IFSharpDiagnosticExtendedData FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+TypeMismatchDiagnosticExtendedData FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+ValueNotContainedDiagnosticExtendedData +FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: System.String DiagnosticId +FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: System.String UrlFormat +FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: System.String get_DiagnosticId() +FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: System.String get_UrlFormat() +FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData FSharp.Compiler.Diagnostics.FSharpDiagnostic: FSharp.Compiler.Diagnostics.FSharpDiagnostic Create(FSharp.Compiler.Diagnostics.FSharpDiagnosticSeverity, System.String, Int32, FSharp.Compiler.Text.Range, Microsoft.FSharp.Core.FSharpOption`1[System.String], Microsoft.FSharp.Core.FSharpOption`1[System.String]) FSharp.Compiler.Diagnostics.FSharpDiagnostic: FSharp.Compiler.Diagnostics.FSharpDiagnosticSeverity Severity FSharp.Compiler.Diagnostics.FSharpDiagnostic: FSharp.Compiler.Diagnostics.FSharpDiagnosticSeverity get_Severity() From 8660de9805d3cfe7ad46689d440d2584e45837a2 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Mon, 20 Jan 2025 17:51:34 +0100 Subject: [PATCH 26/49] Update azure-pipelines.yml --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 2d562813543..1e5aaebbdf9 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -35,7 +35,7 @@ variables: # (since for all *new* release branches we insert into VS main and for all *previous* releases we insert into corresponding VS release), # i.e. 'rel/d17.9' *or* 'main' in dotnet/fsharp/refs/heads/main and 'main' in F# dotnet/fsharp/refs/heads/release/dev17.10 (latest release branch) - name: VSInsertionTargetBranchName - value: rel/d17.13 + value: main - name: _TeamName value: FSharp - name: TeamName From 9800899d5ad7fd14dc28156ca0ef121268d2067a Mon Sep 17 00:00:00 2001 From: Petr Pokorny Date: Tue, 21 Jan 2025 13:18:00 +0100 Subject: [PATCH 27/49] Remove FSharpProjectOptions from Transparent Compiler check results (#18205) --- .../.FSharp.Compiler.Service/9.0.300.md | 2 ++ src/Compiler/Service/BackgroundCompiler.fs | 4 ++-- src/Compiler/Service/FSharpCheckerResults.fs | 17 +++++++++++------ src/Compiler/Service/FSharpCheckerResults.fsi | 4 ++-- src/Compiler/Service/TransparentCompiler.fs | 4 ++-- 5 files changed, 19 insertions(+), 12 deletions(-) diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md index 157b1af93cc..52b92207001 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md @@ -7,6 +7,8 @@ * Added missing type constraints in FCS. ([PR #18241](https://github.com/dotnet/fsharp/pull/18241)) ### Changed + +* FSharpCheckFileResults.ProjectContext.ProjectOptions will not be available when using the experimental Transparent Compiler feature. ([PR #18205](https://github.com/dotnet/fsharp/pull/18205)) * Update `Obsolete` attribute checking to account for `DiagnosticId` and `UrlFormat` properties. ([PR #18224](https://github.com/dotnet/fsharp/pull/18224)) ### Breaking Changes diff --git a/src/Compiler/Service/BackgroundCompiler.fs b/src/Compiler/Service/BackgroundCompiler.fs index 63d147d005b..8f119f2fd60 100644 --- a/src/Compiler/Service/BackgroundCompiler.fs +++ b/src/Compiler/Service/BackgroundCompiler.fs @@ -1066,7 +1066,7 @@ type internal BackgroundCompiler tcProj.TcGlobals, options.IsIncompleteTypeCheckEnvironment, Some builder, - options, + Some options, Array.ofList tcDependencyFiles, creationDiags, parseResults.Diagnostics, @@ -1248,7 +1248,7 @@ type internal BackgroundCompiler tcEnvAtEnd.AccessRights, tcAssemblyExprOpt, Array.ofList tcDependencyFiles, - options) + Some options) let results = FSharpCheckProjectResults( diff --git a/src/Compiler/Service/FSharpCheckerResults.fs b/src/Compiler/Service/FSharpCheckerResults.fs index 1c7878c6df8..0d6e83a61c2 100644 --- a/src/Compiler/Service/FSharpCheckerResults.fs +++ b/src/Compiler/Service/FSharpCheckerResults.fs @@ -348,7 +348,7 @@ type internal TypeCheckInfo tcAccessRights: AccessorDomain, projectFileName: string, mainInputFileName: string, - projectOptions: FSharpProjectOptions, + projectOptions: FSharpProjectOptions option, sResolutions: TcResolutions, sSymbolUses: TcSymbolUses, sFallback: NameResolutionEnv, @@ -3289,7 +3289,7 @@ module internal ParseAndCheckFile = tcEnvAtEnd.AccessRights, projectFileName, mainInputFileName, - projectOptions, + Some projectOptions, sink.GetResolutions(), sink.GetSymbolUses(), tcEnvAtEnd.NameEnv, @@ -3302,9 +3302,14 @@ module internal ParseAndCheckFile = } [] -type FSharpProjectContext(thisCcu: CcuThunk, assemblies: FSharpAssembly list, ad: AccessorDomain, projectOptions: FSharpProjectOptions) = +type FSharpProjectContext + (thisCcu: CcuThunk, assemblies: FSharpAssembly list, ad: AccessorDomain, projectOptions: FSharpProjectOptions option) = - member _.ProjectOptions = projectOptions + // TODO: Once API around Transparent Compiler is stabilized we should probably remove this. + member _.ProjectOptions = + projectOptions + |> Option.defaultWith (fun () -> + failwith "ProjectOptions are not available. This is expected when using FSharpChecker with useTransparentCompiler=true.") member _.GetReferencedAssemblies() = assemblies @@ -3713,7 +3718,7 @@ type FSharpCheckProjectResults AccessorDomain * CheckedImplFile list option * string[] * - FSharpProjectOptions) option + FSharpProjectOptions option) option ) = let getDetails () = @@ -4009,7 +4014,7 @@ type FsiInteractiveChecker(legacyReferenceResolver, tcConfig: TcConfig, tcGlobal tcState.TcEnvFromImpls.AccessRights, None, dependencyFiles, - projectOptions) + Some projectOptions) let projectResults = FSharpCheckProjectResults(fileName, Some tcConfig, keepAssemblyContents, errors, Some details) diff --git a/src/Compiler/Service/FSharpCheckerResults.fsi b/src/Compiler/Service/FSharpCheckerResults.fsi index 6b0a7f49135..607232f3c92 100644 --- a/src/Compiler/Service/FSharpCheckerResults.fsi +++ b/src/Compiler/Service/FSharpCheckerResults.fsi @@ -454,7 +454,7 @@ type public FSharpCheckFileResults = tcGlobals: TcGlobals * isIncompleteTypeCheckEnvironment: bool * builder: IncrementalBuilder option * - projectOptions: FSharpProjectOptions * + projectOptions: FSharpProjectOptions option * dependencyFiles: string[] * creationErrors: FSharpDiagnostic[] * parseErrors: FSharpDiagnostic[] * @@ -554,7 +554,7 @@ type public FSharpCheckProjectResults = AccessorDomain * CheckedImplFile list option * string[] * - FSharpProjectOptions) option -> + FSharpProjectOptions option) option -> FSharpCheckProjectResults module internal ParseAndCheckFile = diff --git a/src/Compiler/Service/TransparentCompiler.fs b/src/Compiler/Service/TransparentCompiler.fs index f25b75fe99d..9f35b4f2835 100644 --- a/src/Compiler/Service/TransparentCompiler.fs +++ b/src/Compiler/Service/TransparentCompiler.fs @@ -1696,7 +1696,7 @@ type internal TransparentCompiler bootstrapInfo.TcGlobals, projectSnapshot.IsIncompleteTypeCheckEnvironment, None, - projectSnapshot.ToOptions(), + None, Array.ofList tcInfo.tcDependencyFiles, creationDiags, parseResults.Diagnostics, @@ -1963,7 +1963,7 @@ type internal TransparentCompiler tcEnvAtEnd.AccessRights, Some checkedImplFiles, Array.ofList tcDependencyFiles, - projectSnapshot.ToOptions()) + None) let results = FSharpCheckProjectResults( From 950437d892207d1a6974830532e2524cf259eb30 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Tue, 21 Jan 2025 14:40:09 +0100 Subject: [PATCH 28/49] Update devcontainer .NET version + bump to latest fscore version (#18257) --- .devcontainer/devcontainer.json | 6 +++--- eng/Versions.props | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index bbae4ecb698..6e0c412215d 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,12 +1,12 @@ // For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at: { "name": "F#", - "image": "mcr.microsoft.com/dotnet/sdk:9.0.100", + "image": "mcr.microsoft.com/dotnet/sdk:9.0.102", "features": { - "ghcr.io/devcontainers/features/common-utils:2.5.1": {}, + "ghcr.io/devcontainers/features/common-utils:2.5.2": {}, "ghcr.io/devcontainers/features/git:1.3.2": {}, "ghcr.io/devcontainers/features/github-cli:1.0.13": {}, - "ghcr.io/devcontainers/features/dotnet:2.1.3": {} + "ghcr.io/devcontainers/features/dotnet:2.2.0": {} }, "hostRequirements": { "cpus": 2, diff --git a/eng/Versions.props b/eng/Versions.props index 59f0f6e7cb9..3b36ad6a716 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -37,7 +37,7 @@ $(FSMajorVersion).$(FSMinorVersion).$(FSBuildVersion) - 9.0.100 + 9.0.101 $(FSCorePackageVersionValue)-$(PreReleaseVersionLabel).* From 2d6b138b56eb0724724377402f7c1ed88a840c92 Mon Sep 17 00:00:00 2001 From: Tuomas Hietanen Date: Thu, 23 Jan 2025 12:55:00 +0000 Subject: [PATCH 29/49] Took some fixes from FSharp.TypeProvider.SDK to TestTP. (#18252) --- tests/service/data/TestTP/ProvidedTypes.fs | 228 +++++++++++---------- 1 file changed, 119 insertions(+), 109 deletions(-) diff --git a/tests/service/data/TestTP/ProvidedTypes.fs b/tests/service/data/TestTP/ProvidedTypes.fs index 747455e271f..50dd53a55a4 100644 --- a/tests/service/data/TestTP/ProvidedTypes.fs +++ b/tests/service/data/TestTP/ProvidedTypes.fs @@ -613,7 +613,7 @@ type ProvidedTypeSymbol(kind: ProvidedTypeSymbolKind, typeArgs: Type list, typeB | ProvidedTypeSymbolKind.ByRef, [| arg |] -> arg.Name + "&" | ProvidedTypeSymbolKind.Generic gty, _typeArgs -> gty.Name | ProvidedTypeSymbolKind.FSharpTypeAbbreviation (_, _, path), _ -> path[path.Length-1] - | _ -> failwith "unreachable" + | c -> failwithf "unreachable %O" c override __.BaseType = match kind with @@ -669,7 +669,7 @@ type ProvidedTypeSymbol(kind: ProvidedTypeSymbolKind, typeArgs: Type list, typeB | ProvidedTypeSymbolKind.ByRef, [| arg |] -> 43904 + hash arg | ProvidedTypeSymbolKind.Generic gty, _ -> 9797 + hash gty + Array.sumBy hash typeArgs | ProvidedTypeSymbolKind.FSharpTypeAbbreviation _, _ -> 3092 - | _ -> failwith "unreachable" + | c -> failwithf "unreachable %O" c override this.Equals(other: obj) = eqTypeObj this other @@ -1313,16 +1313,17 @@ and ProvidedMeasureBuilder() = // there seems to be no way to check if a type abbreviation exists static let unitNamesTypeAbbreviations = [ - "meter"; "hertz"; "newton"; "pascal"; "joule"; "watt"; "coulomb"; - "volt"; "farad"; "ohm"; "siemens"; "weber"; "tesla"; "henry" - "lumen"; "lux"; "becquerel"; "gray"; "sievert"; "katal" + "metre"; "meter"; "kilogram"; "second"; "ampere"; "kelvin"; "mole"; "candela" + "hertz"; "newton"; "pascal"; "joule"; "watt"; "coulomb"; "volt"; "farad" + "ohm"; "siemens"; "weber"; "tesla"; "henry"; "lumen"; "lux"; "becquerel" + "gray"; "sievert"; "katal" ] |> Set.ofList static let unitSymbolsTypeAbbreviations = [ "m"; "kg"; "s"; "A"; "K"; "mol"; "cd"; "Hz"; "N"; "Pa"; "J"; "W"; "C" - "V"; "F"; "S"; "Wb"; "T"; "lm"; "lx"; "Bq"; "Gy"; "Sv"; "kat"; "H" + "V"; "F"; "S"; "ohm"; "Wb"; "T"; "lm"; "lx"; "Bq"; "Gy"; "Sv"; "kat"; "H" ] |> Set.ofList @@ -1448,7 +1449,7 @@ and ProvidedTypeDefinition(isTgt: bool, container:TypeContainer, className: stri let save (key: BindingFlags) f : 'T = let key = int key - if bindings = null then + if isNull bindings then bindings <- Dictionary<_, _>(HashIdentity.Structural) if not (moreMembers()) && bindings.ContainsKey(key) then @@ -1557,13 +1558,13 @@ and ProvidedTypeDefinition(isTgt: bool, container:TypeContainer, className: stri (//save ("methods", bindingFlags, None) (fun () -> getMembers() |> Array.choose (function :? MethodInfo as m when memberBinds false bindingFlags m.IsStatic m.IsPublic -> Some m | _ -> None) - |> (if hasFlag bindingFlags BindingFlags.DeclaredOnly || this.BaseType = null then id else (fun mems -> Array.append mems (this.ErasedBaseType.GetMethods(bindingFlags))))) + |> (if hasFlag bindingFlags BindingFlags.DeclaredOnly || isNull this.BaseType then id else (fun mems -> Array.append mems (this.ErasedBaseType.GetMethods(bindingFlags))))) override this.GetFields bindingFlags = (//save ("fields", bindingFlags, None) (fun () -> getMembers() |> Array.choose (function :? FieldInfo as m when memberBinds false bindingFlags m.IsStatic m.IsPublic -> Some m | _ -> None) - |> (if hasFlag bindingFlags BindingFlags.DeclaredOnly || this.BaseType = null then id else (fun mems -> Array.append mems (this.ErasedBaseType.GetFields(bindingFlags))))) + |> (if hasFlag bindingFlags BindingFlags.DeclaredOnly || isNull this.BaseType then id else (fun mems -> Array.append mems (this.ErasedBaseType.GetFields(bindingFlags))))) override this.GetProperties bindingFlags = (//save ("props", bindingFlags, None) (fun () -> @@ -1571,7 +1572,7 @@ and ProvidedTypeDefinition(isTgt: bool, container:TypeContainer, className: stri getMembers() |> Array.choose (function :? PropertyInfo as m when memberBinds false bindingFlags m.IsStatic m.IsPublic -> Some m | _ -> None) staticOrPublic - |> (if hasFlag bindingFlags BindingFlags.DeclaredOnly || this.BaseType = null + |> (if hasFlag bindingFlags BindingFlags.DeclaredOnly || isNull this.BaseType then id else (fun mems -> Array.append mems (this.ErasedBaseType.GetProperties(bindingFlags))))) @@ -1579,13 +1580,13 @@ and ProvidedTypeDefinition(isTgt: bool, container:TypeContainer, className: stri (//save ("events", bindingFlags, None) (fun () -> getMembers() |> Array.choose (function :? EventInfo as m when memberBinds false bindingFlags m.IsStatic m.IsPublic -> Some m | _ -> None) - |> (if hasFlag bindingFlags BindingFlags.DeclaredOnly || this.BaseType = null then id else (fun mems -> Array.append mems (this.ErasedBaseType.GetEvents(bindingFlags))))) + |> (if hasFlag bindingFlags BindingFlags.DeclaredOnly || isNull this.BaseType then id else (fun mems -> Array.append mems (this.ErasedBaseType.GetEvents(bindingFlags))))) override __.GetNestedTypes bindingFlags = (//save ("nested", bindingFlags, None) (fun () -> getMembers() |> Array.choose (function :? Type as m when memberBinds true bindingFlags false m.IsPublic || m.IsNestedPublic -> Some m | _ -> None) - |> (if hasFlag bindingFlags BindingFlags.DeclaredOnly || this.BaseType = null then id else (fun mems -> Array.append mems (this.ErasedBaseType.GetNestedTypes(bindingFlags))))) + |> (if hasFlag bindingFlags BindingFlags.DeclaredOnly || isNull this.BaseType then id else (fun mems -> Array.append mems (this.ErasedBaseType.GetNestedTypes(bindingFlags))))) override this.GetConstructorImpl(bindingFlags, _binder, _callConventions, _types, _modifiers) = let xs = this.GetConstructors bindingFlags |> Array.filter (fun m -> m.Name = ".ctor") @@ -1601,7 +1602,7 @@ and ProvidedTypeDefinition(isTgt: bool, container:TypeContainer, className: stri let methods = this.GetMethods bindingFlags methods |> Seq.groupBy (fun m -> m.Name) |> Seq.map (fun (k, v) -> k, Seq.toArray v) |> dict) - let xs = if table.ContainsKey name then table[name] else [| |] + let xs = match table.TryGetValue name with | true, tn -> tn | false, _ -> [| |] //let xs = this.GetMethods bindingFlags |> Array.filter (fun m -> m.Name = name) if xs.Length > 1 then failwithf "GetMethodImpl. not support overloads, name = '%s', methods - '%A', callstack = '%A'" name xs Environment.StackTrace if xs.Length > 0 then xs[0] else null) @@ -1617,7 +1618,7 @@ and ProvidedTypeDefinition(isTgt: bool, container:TypeContainer, className: stri save (bindingFlags ||| BindingFlags.GetProperty) (fun () -> let methods = this.GetProperties bindingFlags methods |> Seq.groupBy (fun m -> m.Name) |> Seq.map (fun (k, v) -> k, Seq.toArray v) |> dict) - let xs = if table.ContainsKey name then table[name] else [| |] + let xs = match table.TryGetValue name with | true, tn -> tn | false, _ -> [| |] //let xs = this.GetProperties bindingFlags |> Array.filter (fun m -> m.Name = name) if xs.Length > 0 then xs[0] else null) @@ -1804,7 +1805,7 @@ and ProvidedTypeDefinition(isTgt: bool, container:TypeContainer, className: stri match keylist with | [] -> () | key::rest -> - buckets[key] <- (rest, v) :: (if buckets.ContainsKey key then buckets[key] else []); + buckets.[key] <- (rest, v) :: (match buckets.TryGetValue key with |true, bucket -> bucket | false, _ -> []); [ for (KeyValue(key, items)) in buckets -> nodef key items ] @@ -2209,7 +2210,7 @@ module internal AssemblyReader = override x.ToString() = x.QualifiedName - type ILArrayBound = int32 option + type ILArrayBound = int32 uoption type ILArrayBounds = ILArrayBound * ILArrayBound [] @@ -2217,11 +2218,11 @@ module internal AssemblyReader = | ILArrayShape of ILArrayBounds[] (* lobound/size pairs *) member x.Rank = (let (ILArrayShape l) = x in l.Length) static member SingleDimensional = ILArrayShapeStatics.SingleDimensional - static member FromRank n = if n = 1 then ILArrayShape.SingleDimensional else ILArrayShape(List.replicate n (Some 0, None) |> List.toArray) + static member FromRank n = if n = 1 then ILArrayShape.SingleDimensional else ILArrayShape(List.replicate n (USome 0, UNone) |> List.toArray) and ILArrayShapeStatics() = - static let singleDimensional = ILArrayShape [| (Some 0, None) |] + static let singleDimensional = ILArrayShape [| (USome 0, UNone) |] static member SingleDimensional = singleDimensional /// Calling conventions. These are used in method pointer types. @@ -2259,6 +2260,7 @@ module internal AssemblyReader = static member Instance = instanceCallConv static member Static = staticCallConv + [] type ILBoxity = | AsObject | AsValue @@ -2360,9 +2362,9 @@ module internal AssemblyReader = | ILType.Array (ILArrayShape(s), ty) -> ty.BasicQualifiedName + "[" + System.String(',', s.Length-1) + "]" | ILType.Value tr | ILType.Boxed tr -> tr.BasicQualifiedName | ILType.Void -> "void" - | ILType.Ptr _ty -> failwith "unexpected pointer type" - | ILType.Byref _ty -> failwith "unexpected byref type" - | ILType.FunctionPointer _mref -> failwith "unexpected function pointer type" + | ILType.Ptr _ty -> failwithf "unexpected pointer type %O" _ty + | ILType.Byref _ty -> failwithf "unexpected byref type %O" _ty + | ILType.FunctionPointer _mref -> failwithf "unexpected function pointer type %O" _mref member x.QualifiedNameExtension = match x with @@ -2371,9 +2373,9 @@ module internal AssemblyReader = | ILType.Array (ILArrayShape(_s), ty) -> ty.QualifiedNameExtension | ILType.Value tr | ILType.Boxed tr -> tr.QualifiedNameExtension | ILType.Void -> failwith "void" - | ILType.Ptr _ty -> failwith "unexpected pointer type" - | ILType.Byref _ty -> failwith "unexpected byref type" - | ILType.FunctionPointer _mref -> failwith "unexpected function pointer type" + | ILType.Ptr _ty -> failwithf "unexpected pointer type %O" _ty + | ILType.Byref _ty -> failwithf "unexpected byref type %O" _ty + | ILType.FunctionPointer _mref -> failwithf "unexpected function pointer type %O" _mref member x.QualifiedName = x.BasicQualifiedName + x.QualifiedNameExtension @@ -2381,18 +2383,18 @@ module internal AssemblyReader = member x.TypeSpec = match x with | ILType.Boxed tr | ILType.Value tr -> tr - | _ -> failwithf "not a nominal type" + | c -> failwithf "not a nominal type %O" c member x.Boxity = match x with | ILType.Boxed _ -> AsObject | ILType.Value _ -> AsValue - | _ -> failwithf "not a nominal type" + | c -> failwithf "not a nominal type %O" c member x.TypeRef = match x with | ILType.Boxed tspec | ILType.Value tspec -> tspec.TypeRef - | _ -> failwithf "not a nominal type" + | c -> failwithf "not a nominal type %O" c member x.IsNominal = match x with @@ -2843,14 +2845,13 @@ module internal AssemblyReader = let mutable lmap = null let getmap() = - if lmap = null then + if isNull lmap then lmap <- Dictionary() for y in larr.Force() do let key = y.Name - if lmap.ContainsKey key then - lmap[key] <- Array.append [| y |] lmap[key] - else - lmap[key] <- [| y |] + match lmap.TryGetValue key with + | true, lmpak -> lmap.[key] <- Array.append [| y |] lmpak + | false, _ -> lmap.[key] <- [| y |] lmap member __.Entries = larr.Force() @@ -3061,7 +3062,7 @@ module internal AssemblyReader = let mutable lmap = null let getmap() = - if lmap = null then + if isNull lmap then lmap <- Dictionary() for (nsp, nm, ltd) in larr.Force() do let key = nsp, nm @@ -3074,9 +3075,10 @@ module internal AssemblyReader = member __.TryFindByName (nsp, nm) = let tdefs = getmap() let key = (nsp, nm) - if tdefs.ContainsKey key then - Some (tdefs[key].Force()) - else + match tdefs.TryGetValue key with + | true, tdefFal -> + Some (tdefFal.Force()) + | false, _ -> None type ILNestedExportedType = @@ -3105,7 +3107,7 @@ module internal AssemblyReader = and ILExportedTypesAndForwarders(larr:Lazy) = let mutable lmap = null let getmap() = - if lmap = null then + if isNull lmap then lmap <- Dictionary() for ltd in larr.Force() do let key = ltd.Namespace, ltd.Name @@ -4565,8 +4567,9 @@ module internal AssemblyReader = | null -> cache := new Dictionary<_, _>(11 (* sz:int *) ) | _ -> () !cache - if cache.ContainsKey idx then cache[idx] - else let res = f idx in cache[idx] <- res; res + match cache.TryGetValue idx with + | true, cached -> cached + | false, _ -> let res = f idx in cache.[idx] <- res; res let seekFindRow numRows rowChooser = let mutable i = 1 @@ -5108,18 +5111,18 @@ module internal AssemblyReader = seekReadIdx tableBigness[tab.Index] &addr - let seekReadResolutionScopeIdx (addr: byref) = seekReadTaggedIdx (fun idx -> ResolutionScopeTag idx) 2 rsBigness &addr - let seekReadTypeDefOrRefOrSpecIdx (addr: byref) = seekReadTaggedIdx (fun idx -> TypeDefOrRefOrSpecTag idx) 2 tdorBigness &addr - let seekReadTypeOrMethodDefIdx (addr: byref) = seekReadTaggedIdx (fun idx -> TypeOrMethodDefTag idx) 1 tomdBigness &addr - let seekReadHasConstantIdx (addr: byref) = seekReadTaggedIdx (fun idx -> HasConstantTag idx) 2 hcBigness &addr - let seekReadHasCustomAttributeIdx (addr: byref) = seekReadTaggedIdx (fun idx -> HasCustomAttributeTag idx) 5 hcaBigness &addr - //let seekReadHasFieldMarshalIdx (addr: byref) = seekReadTaggedIdx (fun idx -> HasFieldMarshalTag idx) 1 hfmBigness &addr - //let seekReadHasDeclSecurityIdx (addr: byref) = seekReadTaggedIdx (fun idx -> HasDeclSecurityTag idx) 2 hdsBigness &addr - let seekReadMemberRefParentIdx (addr: byref) = seekReadTaggedIdx (fun idx -> MemberRefParentTag idx) 3 mrpBigness &addr - let seekReadHasSemanticsIdx (addr: byref) = seekReadTaggedIdx (fun idx -> HasSemanticsTag idx) 1 hsBigness &addr - let seekReadMethodDefOrRefIdx (addr: byref) = seekReadTaggedIdx (fun idx -> MethodDefOrRefTag idx) 1 mdorBigness &addr - let seekReadImplementationIdx (addr: byref) = seekReadTaggedIdx (fun idx -> ImplementationTag idx) 2 iBigness &addr - let seekReadCustomAttributeTypeIdx (addr: byref) = seekReadTaggedIdx (fun idx -> CustomAttributeTypeTag idx) 3 catBigness &addr + let seekReadResolutionScopeIdx (addr: byref) = seekReadTaggedIdx ResolutionScopeTag 2 rsBigness &addr + let seekReadTypeDefOrRefOrSpecIdx (addr: byref) = seekReadTaggedIdx TypeDefOrRefOrSpecTag 2 tdorBigness &addr + let seekReadTypeOrMethodDefIdx (addr: byref) = seekReadTaggedIdx TypeOrMethodDefTag 1 tomdBigness &addr + let seekReadHasConstantIdx (addr: byref) = seekReadTaggedIdx HasConstantTag 2 hcBigness &addr + let seekReadHasCustomAttributeIdx (addr: byref) = seekReadTaggedIdx HasCustomAttributeTag 5 hcaBigness &addr + //let seekReadHasFieldMarshalIdx (addr: byref) = seekReadTaggedIdx HasFieldMarshalTag 1 hfmBigness &addr + //let seekReadHasDeclSecurityIdx (addr: byref) = seekReadTaggedIdx HasDeclSecurityTag 2 hdsBigness &addr + let seekReadMemberRefParentIdx (addr: byref) = seekReadTaggedIdx MemberRefParentTag 3 mrpBigness &addr + let seekReadHasSemanticsIdx (addr: byref) = seekReadTaggedIdx HasSemanticsTag 1 hsBigness &addr + let seekReadMethodDefOrRefIdx (addr: byref) = seekReadTaggedIdx MethodDefOrRefTag 1 mdorBigness &addr + let seekReadImplementationIdx (addr: byref) = seekReadTaggedIdx ImplementationTag 2 iBigness &addr + let seekReadCustomAttributeTypeIdx (addr: byref) = seekReadTaggedIdx CustomAttributeTypeTag 3 catBigness &addr let seekReadStringIdx (addr: byref) = seekReadIdx stringsBigness &addr let seekReadGuidIdx (addr: byref) = seekReadIdx guidsBigness &addr let seekReadBlobIdx (addr: byref) = seekReadIdx blobsBigness &addr @@ -5692,7 +5695,7 @@ module internal AssemblyReader = | tag when tag = ImplementationTag.File -> ILScopeRef.Module (seekReadFile idx) | tag when tag = ImplementationTag.AssemblyRef -> ILScopeRef.Assembly (seekReadAssemblyRef idx) | tag when tag = ImplementationTag.ExportedType -> failwith "seekReadImplAsScopeRef" - | _ -> failwith "seekReadImplAsScopeRef" + | c -> failwithf "seekReadImplAsScopeRef %O" c and seekReadTypeRefScope (TaggedIndex(tag, idx) ): ILTypeRefScope = match tag with @@ -5700,7 +5703,7 @@ module internal AssemblyReader = | tag when tag = ResolutionScopeTag.ModuleRef -> ILTypeRefScope.Top(ILScopeRef.Module (seekReadModuleRef idx)) | tag when tag = ResolutionScopeTag.AssemblyRef -> ILTypeRefScope.Top(ILScopeRef.Assembly (seekReadAssemblyRef idx)) | tag when tag = ResolutionScopeTag.TypeRef -> ILTypeRefScope.Nested (seekReadTypeRef idx) - | _ -> failwith "seekReadTypeRefScope" + | c -> failwithf "seekReadTypeRefScope %O" c and seekReadOptionalTypeDefOrRef numtypars boxity idx = if idx = TaggedIndex(TypeDefOrRefOrSpecTag.TypeDef, 0) then None @@ -5808,8 +5811,8 @@ module internal AssemblyReader = let lobounds, sigptr = sigptrFold sigptrGetZInt32 numLoBounded bytes sigptr let shape = let dim i = - (if i < numLoBounded then Some lobounds[i] else None), - (if i < numSized then Some sizes[i] else None) + (if i < numLoBounded then USome lobounds[i] else UNone), + (if i < numSized then USome sizes[i] else UNone) ILArrayShape (Array.init rank dim) ILType.Array (shape, typ), sigptr @@ -6420,7 +6423,7 @@ module internal AssemblyReader = | :? Type as ty -> encodeCustomAttrString ty.FullName | :? (obj[]) as elems -> [| yield! i32AsBytes elems.Length; for elem in elems do yield! encodeCustomAttrPrimValue elem |] - | _ -> failwith "unexpected value in custom attribute" + | c -> failwithf "unexpected value in custom attribute (%O)" c and encodeCustomAttrValue ty (c: obj) = match ty, c with @@ -6561,7 +6564,7 @@ module internal AssemblyReader = step() drop() - Some(ILArrayShape(Array.create rank (Some 0, None))) + Some(ILArrayShape(Array.create rank (USome 0, UNone))) else None @@ -6688,7 +6691,7 @@ module internal AssemblyReader = (argty, box (char n)), sigptr | ILType.Value tspec when tspec.Namespace = USome "System" && tspec.Name = "Boolean" -> let n, sigptr = sigptr_get_byte bytes sigptr - (argty, box (not (n = 0))), sigptr + (argty, box (n <> 0)), sigptr | ILType.Boxed tspec when tspec.Namespace = USome "System" && tspec.Name = "String" -> //printfn "parsing string, sigptr = %d" sigptr let n, sigptr = sigptr_get_serstring_possibly_null bytes sigptr @@ -6805,7 +6808,7 @@ module internal AssemblyReader = // Auto-clear the cache every 30.0 seconds. // We would use System.Runtime.Caching but some version constraints make this difficult. - let enableAutoClear = try Environment.GetEnvironmentVariable("FSHARP_TPREADER_AUTOCLEAR_OFF") = null with _ -> true + let enableAutoClear = try isNull (Environment.GetEnvironmentVariable "FSHARP_TPREADER_AUTOCLEAR_OFF") with _ -> true let clearSpanDefault = 30000 let clearSpan = try (match Environment.GetEnvironmentVariable("FSHARP_TPREADER_AUTOCLEAR_SPAN") with null -> clearSpanDefault | s -> int32 s) with _ -> clearSpanDefault let lastAccessLock = obj() @@ -6954,9 +6957,9 @@ namespace ProviderImplementation.ProvidedTypes type TxTable<'T2>() = let tab = Dictionary() member __.Get inp f = - if tab.ContainsKey inp then - tab[inp] - else + match tab.TryGetValue inp with + | true, tabVal -> tabVal + | false, _ -> let res = f() tab[inp] <- res res @@ -7525,7 +7528,7 @@ namespace ProviderImplementation.ProvidedTypes // See bug https://github.com/fsprojects/FSharp.TypeProviders.SDK/issues/236 override __.IsSZArray = match kind with - | TypeSymbolKind.SDArray _ -> true + | TypeSymbolKind.SDArray -> true | _ -> false #endif override this.GetMember(_name, _mt, _bindingFlags) = notRequired this "GetMember" this.Name @@ -8028,7 +8031,7 @@ namespace ProviderImplementation.ProvidedTypes override __.GetEnumUnderlyingType() = if this.IsEnum then txILType ([| |], [| |]) ilGlobals.typ_Int32 // TODO: in theory the assumption of "Int32" is not accurate for all enums, however in practice .NET only uses enums with backing field Int32 - else failwithf "not enum type" + else failwithf "not enum type %O" this override __.IsArrayImpl() = false override __.IsByRefImpl() = false @@ -8099,6 +8102,9 @@ namespace ProviderImplementation.ProvidedTypes txTable.Get inp.Token (fun () -> // We never create target types for the types of primitive values that are accepted by the F# compiler as Expr.Value nodes, // which fortunately also correspond to element types. We just use the design-time types instead. + // See convertConstExpr in the compiler, e.g. + // https://github.com/Microsoft/visualfsharp/blob/44fa027b308681a1b78a089e44fa1ab35ff77b41/src/fsharp/MethodCalls.fs#L842 + // for the accepted types. match inp.Namespace, inp.Name with //| USome "System", "Void"-> typeof (* @@ -8987,7 +8993,7 @@ namespace ProviderImplementation.ProvidedTypes if i < 0 then let msg = if toTgt then sprintf "The design-time type '%O' utilized by a type provider was not found in the target reference assembly set '%A'. You may be referencing a profile which contains fewer types than those needed by the type provider you are using." t (getTargetAssemblies() |> Seq.toList) - elif getSourceAssemblies() |> Seq.length = 0 then sprintf "A failure occurred while determining compilation references" + elif getSourceAssemblies() |> Seq.isEmpty then sprintf "A failure occurred while determining compilation references" else sprintf "The target type '%O' utilized by a type provider was not found in the design-time assembly set '%A'. Please report this problem to the project site for the type provider." t (getSourceAssemblies() |> Seq.toList) failwith msg else @@ -9552,10 +9558,10 @@ namespace ProviderImplementation.ProvidedTypes /// Check that the data held at a fixup is some special magic value, as a sanity check /// to ensure the fixup is being placed at a ood location. let checkFixup32 (data: byte[]) offset exp = - if data[offset + 3] <> b3 exp then failwith "fixup sanity check failed" - if data[offset + 2] <> b2 exp then failwith "fixup sanity check failed" - if data[offset + 1] <> b1 exp then failwith "fixup sanity check failed" - if data[offset] <> b0 exp then failwith "fixup sanity check failed" + if data.[offset + 3] <> b3 exp then failwithf "fixup sanity check failed at %O" offset + if data.[offset + 2] <> b2 exp then failwithf "fixup sanity check failed at %O" offset + if data.[offset + 1] <> b1 exp then failwithf "fixup sanity check failed at %O" offset + if data.[offset] <> b0 exp then failwithf "fixup sanity check failed at %O" offset let applyFixup32 (data:byte[]) offset v = data[offset] <- b0 v @@ -9983,9 +9989,9 @@ namespace ProviderImplementation.ProvidedTypes let splitNameAt (nm:string) idx = - if idx < 0 then failwith "splitNameAt: idx < 0"; + if idx < 0 then failwithf "splitNameAt: idx < 0: %O" idx; let last = nm.Length - 1 - if idx > last then failwith "splitNameAt: idx > last"; + if idx > last then failwithf "splitNameAt: idx > last: %O %O" idx last; (nm.Substring(0, idx)), (if idx < last then nm.Substring (idx+1, last - idx) else "") @@ -10157,13 +10163,13 @@ namespace ProviderImplementation.ProvidedTypes // REVIEW: write into an accumulating buffer let EmitArrayShape (bb: ByteBuffer) (ILArrayShape shape) = - let sized = Array.filter (function (_, Some _) -> true | _ -> false) shape - let lobounded = Array.filter (function (Some _, _) -> true | _ -> false) shape + let sized = Array.filter (function (_, USome _) -> true | _ -> false) shape + let lobounded = Array.filter (function (USome _, _) -> true | _ -> false) shape bb.EmitZ32 shape.Length bb.EmitZ32 sized.Length - sized |> Array.iter (function (_, Some sz) -> bb.EmitZ32 sz | _ -> failwith "?") + sized |> Array.iter (function (_, USome sz) -> bb.EmitZ32 sz | c -> failwithf "%O ?" c) bb.EmitZ32 lobounded.Length - lobounded |> Array.iter (function (Some low, _) -> bb.EmitZ32 low | _ -> failwith "?") + lobounded |> Array.iter (function (USome low, _) -> bb.EmitZ32 low | c -> failwithf "%O ?" c) let hasthisToByte hasthis = match hasthis with @@ -10672,8 +10678,8 @@ namespace ProviderImplementation.ProvidedTypes | _ -> () UnsharedRow - [| HasCustomAttribute (fst hca, snd hca) - CustomAttributeType (fst cat, snd cat) + [| HasCustomAttribute hca + CustomAttributeType cat Blob (GetCustomAttrDataAsBlobIdx cenv attr.Data) |] @@ -10937,8 +10943,9 @@ namespace ProviderImplementation.ProvidedTypes if not (origAvailBrFixups.ContainsKey tg) then printfn "%s" ("branch target " + formatCodeLabel tg + " not found in code") let origDest = - if origAvailBrFixups.ContainsKey tg then origAvailBrFixups[tg] - else 666666 + match origAvailBrFixups.TryGetValue tg with + | true, oaVal -> oaVal + | false, _ -> 666666 let origRelOffset = origDest - origEndOfInstr -128 <= origRelOffset && origRelOffset <= 127 end @@ -11246,7 +11253,7 @@ namespace ProviderImplementation.ProvidedTypes | DT_R4 -> i_stind_r4 | DT_R8 -> i_stind_r8 | DT_REF -> i_stind_ref - | _ -> failwith "stelem") + | x -> failwithf "stelem %O" x) | I_switch labs -> codebuf.RecordReqdBrFixups (i_switch, None) labs @@ -11278,12 +11285,12 @@ namespace ProviderImplementation.ProvidedTypes | (tag, idx) when tag = TypeDefOrRefOrSpecTag.TypeDef -> getUncodedToken ILTableNames.TypeDef idx | (tag, idx) when tag = TypeDefOrRefOrSpecTag.TypeRef -> getUncodedToken ILTableNames.TypeRef idx | (tag, idx) when tag = TypeDefOrRefOrSpecTag.TypeSpec -> getUncodedToken ILTableNames.TypeSpec idx - | _ -> failwith "?" + | x -> failwithf "%O ?" x | ILToken.ILMethod mspec -> match GetMethodSpecAsMethodDefOrRef cenv env (mspec, None) with | (tag, idx) when tag = MethodDefOrRefTag.MethodDef -> getUncodedToken ILTableNames.Method idx | (tag, idx) when tag = MethodDefOrRefTag.MemberRef -> getUncodedToken ILTableNames.MemberRef idx - | _ -> failwith "?" + | x -> failwithf "%O ?" x | ILToken.ILField fspec -> match GetFieldSpecAsFieldDefOrRef cenv env fspec with @@ -11466,7 +11473,7 @@ namespace ProviderImplementation.ProvidedTypes let pc2pos = Array.zeroCreate (instrs.Length+1) let pc2labs = Dictionary() for (KeyValue(lab, pc)) in code.Labels do - if pc2labs.ContainsKey pc then pc2labs[pc] <- lab :: pc2labs[pc] else pc2labs[pc] <- [lab] + match pc2labs.TryGetValue pc with | true, pcVal -> pc2labs.[pc] <- lab :: pcVal | false, _ -> pc2labs.[pc] <- [lab] // Emit the instructions for pc = 0 to instrs.Length do @@ -11690,14 +11697,14 @@ namespace ProviderImplementation.ProvidedTypes SharedRow [| UShort (uint16 idx) UShort (uint16 flags) - TypeOrMethodDef (fst owner, snd owner) + TypeOrMethodDef owner StringE (GetStringHeapIdx cenv gp.Name) TypeDefOrRefOrSpec (TypeDefOrRefOrSpecTag.TypeDef, 0) (* empty kind field in deprecated metadata *) |] else SharedRow [| UShort (uint16 idx) UShort (uint16 flags) - TypeOrMethodDef (fst owner, snd owner) + TypeOrMethodDef owner StringE (GetStringHeapIdx cenv gp.Name) |] and GenTypeAsGenericParamConstraintRow cenv env gpidx ty = @@ -12026,7 +12033,7 @@ namespace ProviderImplementation.ProvidedTypes [| data ULong (match r.Access with ILResourceAccess.Public -> 0x01 | ILResourceAccess.Private -> 0x02) StringE (GetStringHeapIdx cenv r.Name) - Implementation (fst impl, snd impl) |] + Implementation impl |] and GenResourcePass3 cenv r = let idx = AddUnsharedRow cenv ILTableNames.ManifestResource (GetResourceAsManifestResourceRow cenv r) @@ -12124,7 +12131,7 @@ namespace ProviderImplementation.ProvidedTypes ULong 0x0 nelem nselem - Implementation (fst impl, snd impl) |]) + Implementation impl |]) GenCustomAttrsPass3Or4 cenv (HasCustomAttributeTag.ExportedType, cidx) ce.CustomAttrs GenNestedExportedTypesPass3 cenv cidx ce.Nested @@ -12168,8 +12175,9 @@ namespace ProviderImplementation.ProvidedTypes // Record the entrypoint decl if needed. match m.EntrypointElsewhere with | Some mref -> - if cenv.entrypoint <> None then failwith "duplicate entrypoint" - else cenv.entrypoint <- Some (false, GetModuleRefAsIdx cenv mref) + match cenv.entrypoint with + | Some e -> failwithf "duplicate entrypoint %O" e + | None -> cenv.entrypoint <- Some (false, GetModuleRefAsIdx cenv mref) | None -> () and newGuid (modul: ILModuleDef) = @@ -13928,7 +13936,7 @@ namespace ProviderImplementation.ProvidedTypes |> Array.tryFind (fun x -> x.Name = name - && x.ReturnType = returnType + && Type.(=)(x.ReturnType, returnType) && (x.GetParameters() |> Array.map (fun i -> i.ParameterType)) = tps) @@ -14174,13 +14182,13 @@ namespace ProviderImplementation.ProvidedTypes let pop () = ilg.Emit(I_pop) let popIfEmptyExpected s = if isEmpty s then pop() let emitConvIfNecessary t1 = - if t1 = typeof then + if Type.(=)(t1, typeof) then ilg.Emit(I_conv DT_I2) - elif t1 = typeof then + elif Type.(=)(t1, typeof) then ilg.Emit(I_conv DT_U2) - elif t1 = typeof then + elif Type.(=)(t1, typeof) then ilg.Emit(I_conv DT_I1) - elif t1 = typeof then + elif Type.(=)(t1, typeof) then ilg.Emit(I_conv DT_U1) // emits given expression to corresponding IL match expr with @@ -14854,7 +14862,7 @@ namespace ProviderImplementation.ProvidedTypes |> Array.tryFind (fun x -> x.Name = "op_Explicit" - && x.ReturnType = rtTgt + && Type.(=)(x.ReturnType, rtTgt) && (x.GetParameters() |> Array.map (fun i -> i.ParameterType)) = [|t1|]) match m with | None -> @@ -15086,7 +15094,7 @@ namespace ProviderImplementation.ProvidedTypes | false, true -> // method produced something, but we don't need it pop() - | true, false when expr.Type = typeof -> + | true, false when Type.(=)(expr.Type, typeof) -> // if we need result and method produce void and result should be unit - push null as unit value on stack ilg.Emit(I_ldnull) | _ -> () @@ -15122,7 +15130,7 @@ namespace ProviderImplementation.ProvidedTypes | :? float32 as x -> ilg.Emit(I_ldc (DT_R4, ILConst.R4 x)) | :? float as x -> ilg.Emit(I_ldc(DT_R8, ILConst.R8 x)) #if !FX_NO_GET_ENUM_UNDERLYING_TYPE - | :? Enum as x when x.GetType().GetEnumUnderlyingType() = typeof -> ilg.Emit(mk_ldc (unbox v)) + | :? Enum as x when Type.(=) (x.GetType().GetEnumUnderlyingType(), typeof) -> ilg.Emit(mk_ldc (unbox v)) #endif | :? Type as ty -> ilg.Emit(I_ldtoken (ILToken.ILType (transType ty))) @@ -15319,7 +15327,7 @@ namespace ProviderImplementation.ProvidedTypes and transTypeRefScope (ty: Type): ILTypeRefScope = match ty.DeclaringType with | null -> - if ty.Assembly = null then failwithf "null assembly for type %s" ty.FullName + if isNull ty.Assembly then failwithf "null assembly for type %s" ty.FullName ILTypeRefScope.Top (transScopeRef ty.Assembly) | dt -> ILTypeRefScope.Nested (transTypeRef dt) @@ -15439,7 +15447,7 @@ namespace ProviderImplementation.ProvidedTypes let otb, _ = ((None, ""), ns) ||> List.fold (fun (otb:ILTypeBuilder option, fullName) n -> let fullName = if fullName = "" then n else fullName + "." + n - let priorType = if typeMapExtra.ContainsKey(fullName) then Some typeMapExtra[fullName] else None + let priorType = match typeMapExtra.TryGetValue fullName with | true, typeVal -> Some typeVal | false, _ -> None let tb = match priorType with | Some tbb -> tbb @@ -15512,21 +15520,23 @@ namespace ProviderImplementation.ProvidedTypes | :? ProvidedMethod as pminfo when not (methMap.ContainsKey pminfo) -> let mb = tb.DefineMethod(minfo.Name, minfo.Attributes, transType minfo.ReturnType, [| for p in minfo.GetParameters() -> transType p.ParameterType |]) + let ctorTy1 = typeof + let ctor1 = ctorTy1.GetConstructor([|typeof|]) + let ctorTgt1 = context.ConvertSourceConstructorRefToTarget ctor1 + + let ctorTy2 = typeof + let ctor2 = ctorTy2.GetConstructor([||]) + let ctorTgt2 = context.ConvertSourceConstructorRefToTarget ctor2 + for (i, p) in minfo.GetParameters() |> Seq.mapi (fun i x -> (i, x :?> ProvidedParameter)) do let pb = mb.DefineParameter(i+1, p.Attributes, p.Name) if p.HasDefaultParameterValue then - let ctorTy = typeof - let ctor = ctorTy.GetConstructor([|typeof|]) - let ctorTgt = context.ConvertSourceConstructorRefToTarget ctor - let ca = mkILCustomAttribMethRef (transCtorSpec ctorTgt, [p.RawDefaultValue], [], []) + let ca = mkILCustomAttribMethRef (transCtorSpec ctorTgt1, [p.RawDefaultValue], [], []) pb.SetCustomAttribute ca - let ctorTy = typeof - let ctor = ctorTy.GetConstructor([||]) - let ctorTgt = context.ConvertSourceConstructorRefToTarget ctor - let ca = mkILCustomAttribMethRef (transCtorSpec ctorTgt, [], [], []) + let ca = mkILCustomAttribMethRef (transCtorSpec ctorTgt2, [], [], []) pb.SetCustomAttribute ca pb.SetConstant p.RawDefaultValue @@ -15766,7 +15776,7 @@ namespace ProviderImplementation.ProvidedTypes failwithf "expected identical assembly name keys '%s' and '%s'" origAssemblyName newAssemblyName // check the type really exists - if t.Assembly.GetType(tyName) = null then + if isNull (t.Assembly.GetType tyName) then failwithf "couldn't find type '%s' in assembly '%O'" tyName t.Assembly t @@ -15903,7 +15913,7 @@ namespace ProviderImplementation.ProvidedTypes | :? ProvidedMethod as mT when (match methodBaseT.DeclaringType with :? ProvidedTypeDefinition as pt -> pt.IsErased | _ -> true) -> match mT.GetInvokeCode with | Some _ when methodBaseT.DeclaringType.IsInterface -> - failwith "The provided type definition is an interface; therefore, it should not define an implementation for its members." + failwithf "The provided type definition is an interface; therefore, it should not define an implementation for its members. %O" methodBaseT.DeclaringType (* NOTE: These checks appear to fail for generative abstract and virtual methods. | Some _ when mT.IsAbstract -> failwith "The provided method is defined as abstract; therefore, it should not define an implementation." From c4d36d699c52121cf2933314dac02b84a1a5a87a Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Thu, 23 Jan 2025 06:55:51 -0800 Subject: [PATCH 30/49] Pass restore config file arg to bootstrap build (#18260) * Versioning for 17.14 and 9.0.300 (#18222) * Pass restore config file arg to bootstrap build --------- Co-authored-by: Vlad Zarytovskii Co-authored-by: Petr Co-authored-by: Petr Pokorny --- eng/DotNetBuild.props | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eng/DotNetBuild.props b/eng/DotNetBuild.props index d1681803391..b44b8bae3b4 100644 --- a/eng/DotNetBuild.props +++ b/eng/DotNetBuild.props @@ -31,6 +31,7 @@ --tfm $(SourceBuildBootstrapTfm) false + /p:RestoreConfigFile=$(RestoreConfigFile) From a3bf3c96e5f85cea5fa2f53feb60eaeb8b7b1868 Mon Sep 17 00:00:00 2001 From: Jakub Majocha <1760221+majocha@users.noreply.github.com> Date: Mon, 27 Jan 2025 11:09:45 +0100 Subject: [PATCH 31/49] Tests: Fix flaky `AssemblyVersion` tests (#18268) --- DEVGUIDE.md | 10 ++++++ .../AttributeUsage/AttributeUsage.fs | 32 ++++++++++--------- 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/DEVGUIDE.md b/DEVGUIDE.md index 2ca137ba100..28b511fac04 100644 --- a/DEVGUIDE.md +++ b/DEVGUIDE.md @@ -243,6 +243,16 @@ or > Please note, that by default, **Release** version of IL baseline tests will be running in CI, so when updating baseline (.bsl) files, make sure to add `-c Release` flag to the build command. +### Parallel execution of tests + +Tests utilizing xUnit framework by default run in parallel. If your tests depend on some shared state or are time-critical, you can add the module to predefined `NotThreadSafeResourceCollection` to prevent parallel execution. +For example: +```fsharp +[] +module TimeCritical = +``` + + ### Updating FCS surface area baselines ```bash diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/AttributeUsage.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/AttributeUsage.fs index 9b7cdc5a053..a28d6175642 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/AttributeUsage.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/AttributeUsage.fs @@ -34,21 +34,23 @@ module CustomAttributes_AttributeUsage = |> verifyCompileAndRun |> shouldSucceed - // SOURCE=AssemblyVersion03.fs # AssemblyVersion03.fs - [] - let ``AssemblyVersion03_fs`` compilation = - compilation - |> withOptions ["--nowarn:52"] - |> verifyCompileAndRun - |> shouldSucceed - - // SOURCE=AssemblyVersion04.fs # AssemblyVersion04.fs - [] - let ``AssemblyVersion04_fs`` compilation = - compilation - |> withOptions ["--nowarn:52"] - |> verifyCompileAndRun - |> shouldSucceed + [] + module TimeCritical = + // SOURCE=AssemblyVersion03.fs # AssemblyVersion03.fs + [] + let ``AssemblyVersion03_fs`` compilation = + compilation + |> withOptions ["--nowarn:52"] + |> verifyCompileAndRun + |> shouldSucceed + + // SOURCE=AssemblyVersion04.fs # AssemblyVersion04.fs + [] + let ``AssemblyVersion04_fs`` compilation = + compilation + |> withOptions ["--nowarn:52"] + |> verifyCompileAndRun + |> shouldSucceed // SOURCE=AttributeTargetsIsCtor01.fs # AttributeTargetsIsCtor01.fs [] From 013c9982b7d1de552975f4efee71ccfdde98aed6 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Mon, 27 Jan 2025 05:11:06 -0500 Subject: [PATCH 32/49] =?UTF-8?q?Replace=20internal=20option=E2=80=93vopti?= =?UTF-8?q?on=20conversions=20with=20FSharp.Core=20funcs=20(#18269)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Compiler/Service/IncrementalBuild.fs | 5 ----- src/Compiler/TypedTree/TypedTree.fs | 6 +++--- src/Compiler/TypedTree/TypedTreeOps.fs | 6 +++--- src/Compiler/Utilities/illib.fs | 12 ------------ src/Compiler/Utilities/illib.fsi | 6 ------ .../src/FSharp.Editor/Common/Extensions.fs | 13 ------------- .../CodeFixes/CodeFixTestFramework.fs | 10 ---------- 7 files changed, 6 insertions(+), 52 deletions(-) diff --git a/src/Compiler/Service/IncrementalBuild.fs b/src/Compiler/Service/IncrementalBuild.fs index 872b27fdcd9..0cdc4b9235e 100644 --- a/src/Compiler/Service/IncrementalBuild.fs +++ b/src/Compiler/Service/IncrementalBuild.fs @@ -229,11 +229,6 @@ type TcInfoExtras = member x.TcSymbolUses = x.tcSymbolUses -module ValueOption = - let toOption = function - | ValueSome x -> Some x - | _ -> None - type private SingleFileDiagnostics = (PhasedDiagnostic * FSharpDiagnosticSeverity) array type private TypeCheck = TcInfo * TcResultsSinkImpl * CheckedImplFile option * string * SingleFileDiagnostics diff --git a/src/Compiler/TypedTree/TypedTree.fs b/src/Compiler/TypedTree/TypedTree.fs index 11ff117cc25..d2af320b8de 100644 --- a/src/Compiler/TypedTree/TypedTree.fs +++ b/src/Compiler/TypedTree/TypedTree.fs @@ -2122,7 +2122,7 @@ type ModuleOrNamespaceType(kind: ModuleOrNamespaceKind, vals: QueueList, en |> List.tryFind (fun v -> match key.TypeForLinkage with | None -> true | Some keyTy -> ccu.MemberSignatureEquality(keyTy, v.Type)) - |> ValueOptionInternal.ofOption + |> ValueOption.ofOption /// Get a table of values indexed by logical name member _.AllValsByLogicalName = @@ -4237,7 +4237,7 @@ type UnionCaseRef = /// Try to dereference the reference member x.TryUnionCase = x.TyconRef.TryDeref - |> ValueOptionInternal.bind (fun tcref -> tcref.GetUnionCaseByName x.CaseName |> ValueOptionInternal.ofOption) + |> ValueOption.bind (fun tcref -> tcref.GetUnionCaseByName x.CaseName |> ValueOption.ofOption) /// Get the attributes associated with the union case member x.Attribs = x.UnionCase.Attribs @@ -4300,7 +4300,7 @@ type RecdFieldRef = /// Try to dereference the reference member x.TryRecdField = x.TyconRef.TryDeref - |> ValueOptionInternal.bind (fun tcref -> tcref.GetFieldByName x.FieldName |> ValueOptionInternal.ofOption) + |> ValueOption.bind (fun tcref -> tcref.GetFieldByName x.FieldName |> ValueOption.ofOption) /// Get the attributes associated with the compiled property of the record field member x.PropertyAttribs = x.RecdField.PropertyAttribs diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index d4f58881b19..909d6f437a8 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -3526,11 +3526,11 @@ let IsMatchingFSharpAttributeOpt g attrOpt (Attrib(tcref2, _, _, _, _, _, _)) = [] let (|ExtractAttribNamedArg|_|) nm args = - args |> List.tryPick (function AttribNamedArg(nm2, _, _, v) when nm = nm2 -> Some v | _ -> None) |> ValueOptionInternal.ofOption - + args |> List.tryPick (function AttribNamedArg(nm2, _, _, v) when nm = nm2 -> Some v | _ -> None) |> ValueOption.ofOption + [] let (|ExtractILAttributeNamedArg|_|) nm (args: ILAttributeNamedArg list) = - args |> List.tryPick (function nm2, _, _, v when nm = nm2 -> Some v | _ -> None) |> ValueOptionInternal.ofOption + args |> List.tryPick (function nm2, _, _, v when nm = nm2 -> Some v | _ -> None) |> ValueOption.ofOption [] let (|StringExpr|_|) = function Expr.Const (Const.String n, _, _) -> ValueSome n | _ -> ValueNone diff --git a/src/Compiler/Utilities/illib.fs b/src/Compiler/Utilities/illib.fs index e09c650e39b..5e32e3b8699 100644 --- a/src/Compiler/Utilities/illib.fs +++ b/src/Compiler/Utilities/illib.fs @@ -715,18 +715,6 @@ module Span = state -module ValueOptionInternal = - - let inline ofOption x = - match x with - | Some x -> ValueSome x - | None -> ValueNone - - let inline bind ([] f) x = - match x with - | ValueSome x -> f x - | ValueNone -> ValueNone - module String = let make (n: int) (c: char) : string = String(c, n) diff --git a/src/Compiler/Utilities/illib.fsi b/src/Compiler/Utilities/illib.fsi index be4edea38f9..03525593188 100644 --- a/src/Compiler/Utilities/illib.fsi +++ b/src/Compiler/Utilities/illib.fsi @@ -243,12 +243,6 @@ module internal ResizeArray = module internal Span = val inline exists: predicate: ('T -> bool) -> span: Span<'T> -> bool -module internal ValueOptionInternal = - - val inline ofOption: x: 'a option -> 'a voption - - val inline bind: f: ('a -> 'b voption) -> x: 'a voption -> 'b voption - module internal String = val make: n: int -> c: char -> string diff --git a/vsintegration/src/FSharp.Editor/Common/Extensions.fs b/vsintegration/src/FSharp.Editor/Common/Extensions.fs index b0eb7305713..5b154deab73 100644 --- a/vsintegration/src/FSharp.Editor/Common/Extensions.fs +++ b/vsintegration/src/FSharp.Editor/Common/Extensions.fs @@ -327,19 +327,6 @@ module Option = else None -[] -module ValueOption = - - let inline ofOption o = - match o with - | Some v -> ValueSome v - | _ -> ValueNone - - let inline toOption o = - match o with - | ValueSome v -> Some v - | _ -> None - [] module IEnumerator = let chooseV f (e: IEnumerator<'T>) = diff --git a/vsintegration/tests/FSharp.Editor.Tests/CodeFixes/CodeFixTestFramework.fs b/vsintegration/tests/FSharp.Editor.Tests/CodeFixes/CodeFixTestFramework.fs index 55920c294ed..d5f2dbd3988 100644 --- a/vsintegration/tests/FSharp.Editor.Tests/CodeFixes/CodeFixTestFramework.fs +++ b/vsintegration/tests/FSharp.Editor.Tests/CodeFixes/CodeFixTestFramework.fs @@ -33,16 +33,6 @@ type Mode = | WithSettings of CodeFixesOptions module ValueOption = - let inline toOption o = - match o with - | ValueSome v -> Some v - | _ -> None - - let inline ofOption o = - match o with - | Some v -> ValueSome v - | _ -> ValueNone - let inline either f y o = match o with | ValueSome v -> f v From 06e27edfc2766184f44df0b83f7b0debd6560627 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Mon, 27 Jan 2025 05:11:56 -0500 Subject: [PATCH 33/49] Add reminder to check /.dotnet dir when tests fail to find SDK (#18271) --- tests/FSharp.Test.Utilities/Utilities.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/FSharp.Test.Utilities/Utilities.fs b/tests/FSharp.Test.Utilities/Utilities.fs index f48c0eac880..fec1da0895c 100644 --- a/tests/FSharp.Test.Utilities/Utilities.fs +++ b/tests/FSharp.Test.Utilities/Utilities.fs @@ -239,7 +239,7 @@ let main argv = 0""" Project directory: %s{projectDirectory} STDOUT: %s{output} STDERR: %s{errors} -An error occurred getting netcoreapp references: %A{e} +An error occurred getting netcoreapp references (compare the output of `dotnet --list-sdks` and/or the contents of the local `/.dotnet` directory against what is in `global.json`): %A{e} """ raise (Exception (message, e)) finally From 2edab1216843f20a00a7d8f171aca52cbc35d7fd Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Mon, 27 Jan 2025 05:07:13 -0800 Subject: [PATCH 34/49] Add GH action to manage servicing branch codeflow. (#18267) --- .config/feature-lsp-branch-merge.json | 8 ++++++++ .config/service-branch-merge.json | 13 +++++++++++++ .github/workflows/branch-merge.yml | 22 ++++++++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 .config/feature-lsp-branch-merge.json create mode 100644 .config/service-branch-merge.json create mode 100644 .github/workflows/branch-merge.yml diff --git a/.config/feature-lsp-branch-merge.json b/.config/feature-lsp-branch-merge.json new file mode 100644 index 00000000000..e8ad87bc5d8 --- /dev/null +++ b/.config/feature-lsp-branch-merge.json @@ -0,0 +1,8 @@ +{ + "merge-flow-configurations": { + "main": { + "MergeToBranch": "feature/lsp", + "ExtraSwitches": "-QuietComments" + } + } +} \ No newline at end of file diff --git a/.config/service-branch-merge.json b/.config/service-branch-merge.json new file mode 100644 index 00000000000..0c9d996e850 --- /dev/null +++ b/.config/service-branch-merge.json @@ -0,0 +1,13 @@ +{ + "merge-flow-configurations": { + // regular branch flow + "release/dev17.13": { + "MergeToBranch": "main", + "ExtraSwitches": "-QuietComments" + }, + "main": { + "MergeToBranch": "release/dev17.14", + "ExtraSwitches": "-QuietComments" + } + } +} \ No newline at end of file diff --git a/.github/workflows/branch-merge.yml b/.github/workflows/branch-merge.yml new file mode 100644 index 00000000000..24b3989856c --- /dev/null +++ b/.github/workflows/branch-merge.yml @@ -0,0 +1,22 @@ +# Merges any changes from servicing branches forward. + +name: Flow servicing changes to main +on: + push: + branches: + - 'release/*' + - 'main' + +permissions: + contents: write + pull-requests: write + +jobs: + servicing-flow: + uses: dotnet/arcade/.github/workflows/inter-branch-merge-base.yml@main + with: + configuration_file_path: '.config/service-branch-merge.json' + feature-lsp-flow: + uses: dotnet/arcade/.github/workflows/inter-branch-merge-base.yml@main + with: + configuration_file_path: '.config/feature-lsp-branch-merge.json' \ No newline at end of file From a9f59cd4e55d7853e1f05e88e7a3d1ac2479c674 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Wed, 29 Jan 2025 02:25:06 -0800 Subject: [PATCH 35/49] Add ILVerification to test framework (#18255) --- .config/dotnet-tools.json | 16 +-- .../Events/Basic/Basic.fs | 19 ++- .../ClassTypeInitialization.fs | 109 +++++++++++++++++- .../ClassTypeVisibilityModuleRoot.fs | 85 +++++++++++++- .../ClassTypeVisibilityNamespaceRoot.fs | 70 +++++++++++ tests/FSharp.Test.Utilities/Compiler.fs | 48 ++++++-- tests/FSharp.Test.Utilities/CompilerAssert.fs | 2 + .../FSharp.Test.Utilities.fsproj | 4 +- .../FSharp.Test.Utilities/ILVerifierModule.fs | 78 +++++++++++++ tests/FSharp.Test.Utilities/Peverifier.fs | 80 ------------- tests/FSharp.Test.Utilities/TestFramework.fs | 16 +-- ...y_FSharp.Compiler.Service_Debug_net9.0.bsl | 17 --- ....Compiler.Service_Debug_netstandard2.0.bsl | 17 --- ...FSharp.Compiler.Service_Release_net9.0.bsl | 12 -- ...ompiler.Service_Release_netstandard2.0.bsl | 12 -- 15 files changed, 399 insertions(+), 186 deletions(-) create mode 100644 tests/FSharp.Test.Utilities/ILVerifierModule.fs delete mode 100644 tests/FSharp.Test.Utilities/Peverifier.fs diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 88f8c3d1576..46cb8a756ca 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -44,19 +44,19 @@ ], "rollForward": true }, - "dotnet-ilverify": { - "version": "9.0.0-rc.2.24473.5", - "commands": [ - "ilverify" - ], - "rollForward": true - }, "fantomas": { "version": "6.2.3", "commands": [ "fantomas" ], "rollForward": true + }, + "dotnet-ilverify": { + "version": "9.0.0", + "commands": [ + "ilverify" + ], + "rollForward": false } } -} +} \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/Events/Basic/Basic.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/Events/Basic/Basic.fs index caede79cd6b..590e707751d 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/Events/Basic/Basic.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/Events/Basic/Basic.fs @@ -80,20 +80,15 @@ module Events = |> verifyCompileAndRun |> shouldSucceed - // NoMT SOURCE=SanityCheck02.fs # SanityCheck02.fs - [] - let ``SanityCheck02_fs`` compilation = - compilation - |> verifyCompileAndRun - |> shouldSucceed - -#if false && !NETCOREAPP && !NETSTANDARD // SOURCE=SanityCheck02.fs PEVER=/MD # SanityCheck02.fs - /MD [] - let ``SanityCheck02_fs_peverify`` compilation = + let ``SanityCheck02`` compilation = compilation |> asExe |> withOptions ["--nowarn:988"] - |> PEVerifier.verifyPEFile - |> PEVerifier.shouldSucceed -#endif + |> verifyCompileAndRun + |> shouldSucceed + |> verifyPEFileWithSystemDlls + |> withOutputContainsAllInOrderWithWildcards [ + "All Classes and Methods in*SanityCheck02.exe Verified." + ] diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/RealInternalSignature/ClassTypeInitialization.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/RealInternalSignature/ClassTypeInitialization.fs index fd9eb1848d4..981b2e5d95a 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/RealInternalSignature/ClassTypeInitialization.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/RealInternalSignature/ClassTypeInitialization.fs @@ -34,6 +34,7 @@ module MyModule = printfn "Hello from main method" 0 """ + |> withName "SimpleTypesInNamespace" |> withRealInternalSignature realSig |> compileExeAndRun |> shouldSucceed @@ -42,6 +43,11 @@ module MyModule = "Hello, World from MyLibrary.MySecondType" "Hello from main method" ] + |> verifyPEFileWithSystemDlls + |> withOutputContainsAllInOrderWithWildcards [ + "All Classes and Methods in*SimpleTypesInNamespace.exe Verified." + ] + [] // RealSig @@ -60,6 +66,7 @@ type MySecondType = printfn "Hello from implicit main method" """ + |> withName "SimpleTypesInImplicitMain" |> withRealInternalSignature realSig |> compileExeAndRun |> shouldSucceed @@ -68,6 +75,10 @@ printfn "Hello from implicit main method" "Hello, World from MyProgram.MySecondType" "Hello from implicit main method" ] + |> verifyPEFileWithSystemDlls + |> withOutputContainsAllInOrderWithWildcards [ + "All Classes and Methods in*SimpleTypesInImplicitMain.exe Verified." + ] [] // RealSig @@ -91,6 +102,7 @@ module MyModule = printfn "Hello from main method" 0 """ + |> withName "SimpleTypeOneAndTypeTwoInNamespace" |> withRealInternalSignature realSig |> compileExeAndRun |> withStdOutContainsAllInOrder [ @@ -99,6 +111,10 @@ module MyModule = "Hello from main method" ] |> shouldSucceed + |> verifyPEFileWithSystemDlls + |> withOutputContainsAllInOrderWithWildcards [ + "All Classes and Methods in*SimpleTypeOneAndTypeTwoInNamespace.exe Verified." + ] [] // RealSig [] // Regular @@ -130,12 +146,17 @@ module doit = FSharpSource.CreateFromFile("Hello") |> ignore printfn "Main program" """ + |> withName "PublicTypePublicCtor" |> withRealInternalSignature realSig |> compileExeAndRun |> shouldSucceed |> withStdOutContainsAllInOrder [ "Main program" ] + |> verifyPEFileWithSystemDlls + |> withOutputContainsAllInOrderWithWildcards [ + "All Classes and Methods in*PublicTypePublicCtor.exe Verified." + ] [] // RealSig @@ -168,12 +189,17 @@ module doit = FSharpSource.CreateFromFile("Hello") |> ignore printfn "Main program" """ + |> withName "PublicTypeInternalCtor" |> withRealInternalSignature realSig |> compileExeAndRun |> shouldSucceed |> withStdOutContainsAllInOrder [ "Main program" ] + |> verifyPEFileWithSystemDlls + |> withOutputContainsAllInOrderWithWildcards [ + "All Classes and Methods in*PublicTypeInternalCtor.exe Verified." + ] [] // RealSig @@ -206,12 +232,17 @@ module doit = FSharpSource.CreateFromFile("Hello") |> ignore printfn "Main program" """ + |> withName "PublicTypePrivateCtor" |> withRealInternalSignature realSig |> compileExeAndRun |> shouldSucceed |> withStdOutContainsAllInOrder [ "Main program" ] + |> verifyPEFileWithSystemDlls + |> withOutputContainsAllInOrderWithWildcards [ + "All Classes and Methods in*PublicTypePrivateCtor.exe Verified." + ] [] // RealSig [] // Regular @@ -243,12 +274,17 @@ module doit = FSharpSource.CreateFromFile("Hello") |> ignore printfn "Main program" """ + |> withName "PublicTypeUnspecifiedCtor" |> withRealInternalSignature realSig |> compileExeAndRun |> shouldSucceed |> withStdOutContainsAllInOrder [ "Main program" ] + |> verifyPEFileWithSystemDlls + |> withOutputContainsAllInOrderWithWildcards [ + "All Classes and Methods in*PublicTypeUnspecifiedCtor.exe Verified." + ] [] // RealSig [] // Regular @@ -280,13 +316,17 @@ module doit = FSharpSource.CreateFromFile("Hello") |> ignore printfn "Main program" """ + |> withName "PrivateTypePublicCtor" |> withRealInternalSignature realSig |> compileExeAndRun |> shouldSucceed |> withStdOutContainsAllInOrder [ "Main program" ] - + |> verifyPEFileWithSystemDlls + |> withOutputContainsAllInOrderWithWildcards [ + "All Classes and Methods in*PrivateTypePublicCtor.exe Verified." + ] [] // RealSig [] // Regular @@ -318,12 +358,17 @@ module doit = FSharpSource.CreateFromFile("Hello") |> ignore printfn "Main program" """ + |> withName "PrivateTypeInternalCtor" |> withRealInternalSignature realSig |> compileExeAndRun |> withStdOutContainsAllInOrder [ "Main program" ] |> shouldSucceed + |> verifyPEFileWithSystemDlls + |> withOutputContainsAllInOrderWithWildcards [ + "All Classes and Methods in*PrivateTypeInternalCtor.exe Verified." + ] [] // RealSig [] // Regular @@ -362,12 +407,17 @@ type FSharpSource with module doit = printfn "Main program" """ + |> withName "PrivateTypePrivateCtor" |> withRealInternalSignature realSig |> compileExeAndRun |> shouldSucceed |> withStdOutContainsAllInOrder [ "Main program" ] + |> verifyPEFileWithSystemDlls + |> withOutputContainsAllInOrderWithWildcards [ + "All Classes and Methods in*PrivateTypePrivateCtor.exe Verified." + ] [] // RealSig [] // Regular @@ -399,12 +449,17 @@ module doit = FSharpSource.CreateFromFile("Hello") |> ignore printfn "Main program" """ + |> withName "PrivateTypeUnspecifiedCtor" |> withRealInternalSignature realSig |> compileExeAndRun |> shouldSucceed |> withStdOutContainsAllInOrder [ "Main program" ] + |> verifyPEFileWithSystemDlls + |> withOutputContainsAllInOrderWithWildcards [ + "All Classes and Methods in*PrivateTypeUnspecifiedCtor.exe Verified." + ] [] // RealSig [] // Regular @@ -439,12 +494,17 @@ let message = FSharpSourceFromFile.SetIt ("Here is something") printfn $"{message}" """ + |> withName "StaticInitializationNoInlinePrivateField" |> withRealInternalSignature realSig |> compileExeAndRun |> shouldSucceed |> withStdOutContainsAllInOrder [ "Here is something" ] + |> verifyPEFileWithSystemDlls + |> withOutputContainsAllInOrderWithWildcards [ + "All Classes and Methods in*StaticInitializationNoInlinePrivateField.exe Verified." + ] [] // RealSig [] // Regular @@ -476,6 +536,7 @@ type MyClass = printfn "%A" (MyClass.result()) """ + |> withName "ComputationExpressionAccessPrivateBinding" |> withRealInternalSignature realSig |> withNoOptimize |> compileExeAndRun @@ -483,7 +544,10 @@ printfn "%A" (MyClass.result()) |> withStdOutContainsAllInOrder [ "Some 3" ] - + |> verifyPEFileWithSystemDlls + |> withOutputContainsAllInOrderWithWildcards [ + "All Classes and Methods in*ComputationExpressionAccessPrivateBinding.exe Verified." + ] [] // RealSig Optimize [] // RealSig NoOptimize @@ -495,11 +559,16 @@ printfn "%A" (MyClass.result()) let source = File.ReadAllText (path) FSharp source + |> withName "NestedGenericClosure" |> asExe |> withRealInternalSignature realSig |> withOptimization optimize |> compileAndRun |> shouldSucceed + |> verifyPEFileWithSystemDlls + |> withOutputContainsAllInOrderWithWildcards [ + "All Classes and Methods in*NestedGenericClosure.exe Verified." + ] [] // RealSig Optimize [] // RealSig NoOptimize @@ -538,11 +607,16 @@ module doIt = for i in enumerator.MoveNext() do printfn "%A" i """ + |> withName "GenericClassWithClosureWithConstraints" |> asExe |> withRealInternalSignature realSig |> withOptimization optimize |> compileAndRun |> shouldSucceed + |> verifyPEFileWithSystemDlls + |> withOutputContainsAllInOrderWithWildcards [ + "All Classes and Methods in*GenericClassWithClosureWithConstraints.exe Verified." + ] [] // RealSig Optimize [] // RealSig NoOptimize @@ -700,11 +774,16 @@ type internal AgedLookup<'Token, 'Key, 'Value when 'Value: not struct>(keepStron let keep = FilterAndHold(tok) AssignWithStrength(tok, keep) """ + |> withName "AgedLookup" |> asLibrary |> withRealInternalSignature realSig |> withOptimization optimize |> compile |> shouldSucceed + |> verifyPEFileWithSystemDlls + |> withOutputContainsAllInOrderWithWildcards [ + "All Classes and Methods in*AgedLookup.dll Verified." + ] [] // RealSig Optimize [] // RealSig NoOptimize @@ -718,11 +797,16 @@ namespace Equality type BigGenericTuple<'a> = BigGenericTuple of int * 'a * byte * int * 'a * byte """ + |> withName "BigTuples" |> asLibrary |> withRealInternalSignature realSig |> withOptimization optimize |> compile |> shouldSucceed + |> verifyPEFileWithSystemDlls + |> withOutputContainsAllInOrderWithWildcards [ + "All Classes and Methods in*BigTuples.dll Verified." + ] [] // RealSig Optimize [] // RealSig NoOptimize @@ -735,14 +819,18 @@ type BigGenericTuple<'a> = BigGenericTuple of int * 'a * byte * int * 'a * byte module GroupByTest let ``for _ in Array groupBy id [||] do ...`` () = [|for _ in Array.groupBy id [||] do 0|] """ + |> withName "ArrayGroupById" |> asLibrary |> withRealInternalSignature realSig |> withOptimization optimize |> compile |> shouldSucceed + |> verifyPEFileWithSystemDlls + |> withOutputContainsAllInOrderWithWildcards [ + "All Classes and Methods in*ArrayGroupById.dll Verified." + ] - - let roundTripWithInterfaceGeneration(realsig, optimize, implementationFile) = + let roundTripWithInterfaceGeneration(realsig, optimize, implementationFile, name) = let generatedSignature = Fs implementationFile @@ -751,6 +839,7 @@ let ``for _ in Array groupBy id [||] do ...`` () = [|for _ in Array.groupBy id [ |> printSignatures Fsi generatedSignature + |> withName name |> asLibrary |> withAdditionalSourceFile (FsSource implementationFile) |> withRealInternalSignature realsig @@ -774,7 +863,11 @@ type IMonad<'a> = abstract bind : #IMonad<'a> -> ('a -> #IMonad<'b>) -> IMonad<'b> end""" - roundTripWithInterfaceGeneration(realsig, optimize, implementationFile) + roundTripWithInterfaceGeneration(realsig, optimize, implementationFile, "GenericParameterOrderRoundtrip") + |> verifyPEFileWithSystemDlls + |> withOutputContainsAllInOrderWithWildcards [ + "All Classes and Methods in*GenericParameterOrderRoundtrip.dll Verified." + ] [] // RealSig Optimize [] // RealSig NoOptimize @@ -803,4 +896,8 @@ namespace GenericInterfaceTest new(x) = { store = x } end""" - roundTripWithInterfaceGeneration(realsig, optimize, implementationFile) + roundTripWithInterfaceGeneration(realsig, optimize, implementationFile, "MembersBasicRoundtrip") + |> verifyPEFileWithSystemDlls + |> withOutputContainsAllInOrderWithWildcards [ + "All Classes and Methods in*MembersBasicRoundtrip.dll Verified." + ] diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/RealInternalSignature/ClassTypeVisibilityModuleRoot.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/RealInternalSignature/ClassTypeVisibilityModuleRoot.fs index 763bbc9c33e..a7ba195e02f 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/RealInternalSignature/ClassTypeVisibilityModuleRoot.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/RealInternalSignature/ClassTypeVisibilityModuleRoot.fs @@ -24,9 +24,14 @@ type public TypeTwo internal () = class end type public TypeThree private () = class end type public TypeFour () = class end """ + |> withName "PublicTypeConstructors" |> asLibrary |> withRealInternalSignature realSig |> compile + |> verifyPEFileWithSystemDlls + |> withOutputContainsAllInOrderWithWildcards [ + "All Classes and Methods in*PublicTypeConstructors.dll Verified." + ] |> withILContains [ if realSig then """ .class auto ansi serializable nested public TypeOne @@ -91,9 +96,14 @@ type private TypeOne public () = class end type private TypeTwo internal () = class end type private TypeThree private () = class end type private TypeFour () = class end""" + |> withName "PrivateTypeConstructors" |> asLibrary |> withRealInternalSignature realSig |> compile + |> verifyPEFileWithSystemDlls + |> withOutputContainsAllInOrderWithWildcards [ + "All Classes and Methods in*PrivateTypeConstructors.dll Verified." + ] |> withILContains [ if realSig then """ @@ -254,9 +264,14 @@ type public TestType () = member private _.PrivateMethod() = () member _.DefaultMethod() = () """ + |> withName "PublicTypeInstanceMethods" |> asLibrary |> withRealInternalSignature realSig |> compile + |> verifyPEFileWithSystemDlls + |> withOutputContainsAllInOrderWithWildcards [ + "All Classes and Methods in*PublicTypeInstanceMethods.dll Verified." + ] |> withILContains [ if realSig then ".method public hidebysig instance void PublicMethod() cil managed" @@ -285,9 +300,14 @@ type public TestType () = member private _.PrivateMethod() = () member _.DefaultMethod() = () """ + |> withName "PrivateTypeInstanceMethods" |> asLibrary |> withRealInternalSignature realSig |> compile + |> verifyPEFileWithSystemDlls + |> withOutputContainsAllInOrderWithWildcards [ + "All Classes and Methods in*PrivateTypeInstanceMethods.dll Verified." + ] |> withILContains [ if realSig then ".method public hidebysig instance void PublicMethod() cil managed" @@ -317,9 +337,14 @@ type public TestType () = member val private PrivateProperty = 0 with get, set member val DefaultProperty = 0 with get, set """ + |> withName "PublicTypeInstanceProperties" |> asLibrary |> withRealInternalSignature realSig |> compile + |> verifyPEFileWithSystemDlls + |> withOutputContainsAllInOrderWithWildcards [ + "All Classes and Methods in*PublicTypeInstanceProperties.dll Verified." + ] |> withILContains [ if realSig then ".method public hidebysig specialname instance int32 get_PublicProperty() cil managed" @@ -357,9 +382,14 @@ type public TestType () = member val private PrivateProperty = 0 with get, set member val DefaultProperty = 0 with get, set """ + |> withName "PrivateTypeInstanceMixedProperties" |> asLibrary |> withRealInternalSignature realSig |> compile + |> verifyPEFileWithSystemDlls + |> withOutputContainsAllInOrderWithWildcards [ + "All Classes and Methods in*PrivateTypeInstanceMixedProperties.dll Verified." + ] |> withILContains [ if realSig then ".method public hidebysig specialname instance int32 get_PublicProperty() cil managed" @@ -405,9 +435,14 @@ type public TestType () = member _.MixedPropertyEleven with internal get() = 0 and set (_:int) = () member _.MixedPropertyTwelve with private get() = 0 and set (_:int) = () """ + |> withName "PublicTypeInstanceMixedProperties" |> asLibrary |> withRealInternalSignature realSig |> compile + |> verifyPEFileWithSystemDlls + |> withOutputContainsAllInOrderWithWildcards [ + "All Classes and Methods in*PublicTypeInstanceMixedProperties.dll Verified." + ] |> withILContains [ if realSig then ".method public hidebysig specialname instance int32 get_MixedPropertyOne() cil managed" @@ -460,7 +495,6 @@ type public TestType () = ".method public hidebysig specialname instance void set_MixedPropertyEleven(int32 _arg11) cil managed" ".method assembly hidebysig specialname instance int32 get_MixedPropertyTwelve() cil managed" ".method public hidebysig specialname instance void set_MixedPropertyTwelve(int32 _arg12) cil managed" - ] |> shouldSucceed @@ -485,9 +519,14 @@ type private TestType () = member _.MixedPropertyEleven with internal get() = 0 and set (_:int) = () member _.MixedPropertyTwelve with private get() = 0 and set (_:int) = () """ + |> withName "PrivateTypeInstanceMixedProperties" |> asLibrary |> withRealInternalSignature realSig |> compile + |> verifyPEFileWithSystemDlls + |> withOutputContainsAllInOrderWithWildcards [ + "All Classes and Methods in*PrivateTypeInstanceMixedProperties.dll Verified." + ] |> withILContains [ if realSig then ".method public hidebysig specialname instance int32 get_MixedPropertyOne() cil managed" @@ -557,9 +596,14 @@ type public TestType () = static member private PrivateMethod() = () static member DefaultMethod() = () """ + |> withName "PublicTypeStaticMethods" |> asLibrary |> withRealInternalSignature realSig |> compile + |> verifyPEFileWithSystemDlls + |> withOutputContainsAllInOrderWithWildcards [ + "All Classes and Methods in*PublicTypeStaticMethods.dll Verified." + ] |> withILContains [ if realSig then ".method public static void PublicMethod() cil managed" @@ -589,16 +633,20 @@ type private TestType () = static member private PrivateMethod() = () static member DefaultMethod() = () """ + |> withName "PrivateTypeStaticMethods" |> asLibrary |> withRealInternalSignature realSig |> compile + |> verifyPEFileWithSystemDlls + |> withOutputContainsAllInOrderWithWildcards [ + "All Classes and Methods in*PrivateTypeStaticMethods.dll Verified." + ] |> withILContains [ if realSig then ".method public static void PublicMethod() cil managed" ".method assembly static void InternalMethod() cil managed" ".method private static void PrivateMethod() cil managed" ".method public static void DefaultMethod() cil managed" - else ".method assembly static void PublicMethod() cil managed" ".method assembly static void InternalMethod() cil managed" @@ -620,9 +668,14 @@ type public TestType () = static member val internal InternalProperty = 0 with get, set static member val private PrivateProperty = 0 with get, set static member val DefaultProperty = 0 with get, set""" + |> withName "PublicTypeStaticProperties" |> asLibrary |> withRealInternalSignature realSig |> compile + |> verifyPEFileWithSystemDlls + |> withOutputContainsAllInOrderWithWildcards [ + "All Classes and Methods in*PublicTypeStaticProperties.dll Verified." + ] |> withILContains [ if realSig then ".method public specialname static int32 get_PublicProperty() cil managed" @@ -658,9 +711,14 @@ type private TestType () = static member val internal InternalProperty = 0 with get, set static member val private PrivateProperty = 0 with get, set static member val DefaultProperty = 0 with get, set""" + |> withName "PrivateTypeStaticProperties" |> asLibrary |> withRealInternalSignature realSig |> compile + |> verifyPEFileWithSystemDlls + |> withOutputContainsAllInOrderWithWildcards [ + "All Classes and Methods in*PrivateTypeStaticProperties.dll Verified." + ] |> withILContains [ if realSig then ".method public specialname static int32 get_PublicProperty() cil managed" @@ -705,9 +763,14 @@ type public TestType () = static member MixedPropertyEleven with internal get() = 0 and set (_:int) = () static member MixedPropertyTwelve with private get() = 0 and set (_:int) = () """ + |> withName "PublicTypeStaticMixedProperties" |> asLibrary |> withRealInternalSignature realSig |> compile + |> verifyPEFileWithSystemDlls + |> withOutputContainsAllInOrderWithWildcards [ + "All Classes and Methods in*PublicTypeStaticMixedProperties.dll Verified." + ] |> withILContains [ if realSig then ".method public specialname static int32 get_MixedPropertyOne() cil managed" @@ -785,9 +848,14 @@ type private TestType () = static member MixedPropertyEleven with internal get() = 0 and set (_:int) = () static member MixedPropertyTwelve with private get() = 0 and set (_:int) = () """ + |> withName "PrivateTypeStaticMixedProperties" |> asLibrary |> withRealInternalSignature realSig |> compile + |> verifyPEFileWithSystemDlls + |> withOutputContainsAllInOrderWithWildcards [ + "All Classes and Methods in*PrivateTypeStaticMixedProperties.dll Verified." + ] |> withILContains [ if realSig then ".method public specialname static int32 get_MixedPropertyOne() cil managed" @@ -844,12 +912,12 @@ type private TestType () = ] |> shouldSucceed - [] // RealSig - [] // Regular + [] // RealSig + [] // Regular [] // RealSig [] // Regular - [] // RealSig - [] // Regular + [] // RealSig + [] // Regular [] let ``lazy operation - member with various visibilities`` (realSig, scope) = FSharp $""" @@ -858,8 +926,13 @@ module internal SR = let getLazyThing () = lazyThing.Force() SR.getLazyThing () """ + |> withName "LazyOperationMemberWithVariousVisibilities" |> asExe |> withOptimize |> withRealInternalSignature realSig |> compileExeAndRun |> shouldSucceed + |> verifyPEFileWithSystemDlls + |> withOutputContainsAllInOrderWithWildcards [ + "All Classes and Methods in*LazyOperationMemberWithVariousVisibilities.exe Verified." + ] diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/RealInternalSignature/ClassTypeVisibilityNamespaceRoot.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/RealInternalSignature/ClassTypeVisibilityNamespaceRoot.fs index 695d6cd8ba2..bfddf645779 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/RealInternalSignature/ClassTypeVisibilityNamespaceRoot.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/RealInternalSignature/ClassTypeVisibilityNamespaceRoot.fs @@ -24,9 +24,14 @@ type public TypeTwo internal () = class end type public TypeThree private () = class end type public TypeFour () = class end """ + |> withName "PublicTypeConstructors" |> asLibrary |> withRealInternalSignature realSig |> compile + |> verifyPEFileWithSystemDlls + |> withOutputContainsAllInOrderWithWildcards [ + "All Classes and Methods in*PublicTypeConstructors.dll Verified." + ] |> withILContains [ if realSig then """ @@ -189,9 +194,14 @@ type private TypeTwo internal () = class end type private TypeThree private () = class end type private TypeFour () = class end """ + |> withName "PrivateTypeConstructors" |> asLibrary |> withRealInternalSignature realSig |> compile + |> verifyPEFileWithSystemDlls + |> withOutputContainsAllInOrderWithWildcards [ + "All Classes and Methods in*PrivateTypeConstructors.dll Verified." + ] |> withILContains [ """ .class private auto ansi serializable RealInternalSignature.TypeOne @@ -282,9 +292,14 @@ type public TestType () = member private _.PrivateMethod() = () member _.DefaultMethod() = () """ + |> withName "PublicTypeInstanceMethods" |> asLibrary |> withRealInternalSignature realSig |> compile + |> verifyPEFileWithSystemDlls + |> withOutputContainsAllInOrderWithWildcards [ + "All Classes and Methods in*PublicTypeInstanceMethods.dll Verified." + ] |> withILContains [ if realSig then ".method public hidebysig instance void PublicMethod() cil managed" @@ -313,9 +328,14 @@ type private TestType () = member private _.PrivateMethod() = () member _.DefaultMethod() = () """ + |> withName "PrivateTypeInstanceMethods" |> asLibrary |> withRealInternalSignature realSig |> compile + |> verifyPEFileWithSystemDlls + |> withOutputContainsAllInOrderWithWildcards [ + "All Classes and Methods in*PrivateTypeInstanceMethods.dll Verified." + ] |> withILContains [ if realSig then ".method public hidebysig instance void PublicMethod() cil managed" @@ -345,9 +365,14 @@ type public TestType () = member val private PrivateProperty = 0 with get, set member val DefaultProperty = 0 with get, set """ + |> withName "PrivateTypeInstanceMethods" |> asLibrary |> withRealInternalSignature realSig |> compile + |> verifyPEFileWithSystemDlls + |> withOutputContainsAllInOrderWithWildcards [ + "All Classes and Methods in*PrivateTypeInstanceMethods.dll Verified." + ] |> withILContains [ if realSig then ".method public hidebysig specialname instance int32 get_PublicProperty() cil managed" @@ -385,9 +410,14 @@ type public TestType () = member val private PrivateProperty = 0 with get, set member val DefaultProperty = 0 with get, set """ + |> withName "PrivateTypeInstanceProperties" |> asLibrary |> withRealInternalSignature realSig |> compile + |> verifyPEFileWithSystemDlls + |> withOutputContainsAllInOrderWithWildcards [ + "All Classes and Methods in*PrivateTypeInstanceProperties.dll Verified." + ] |> withILContains [ if realSig then ".method public hidebysig specialname instance int32 get_PublicProperty() cil managed" @@ -433,9 +463,14 @@ type public TestType () = member _.MixedPropertyEleven with internal get() = 0 and set (_:int) = () member _.MixedPropertyTwelve with private get() = 0 and set (_:int) = () """ + |> withName "PublicTypeInstanceMixedProperties" |> asLibrary |> withRealInternalSignature realSig |> compile + |> verifyPEFileWithSystemDlls + |> withOutputContainsAllInOrderWithWildcards [ + "All Classes and Methods in*PublicTypeInstanceMixedProperties.dll Verified." + ] |> withILContains [ if realSig then ".method public specialname rtspecialname instance void .ctor() cil managed" @@ -515,9 +550,14 @@ type private TestType () = member _.MixedPropertyEleven with internal get() = 0 and set (_:int) = () member _.MixedPropertyTwelve with private get() = 0 and set (_:int) = () """ + |> withName "PrivateTypeInstanceMixedProperties" |> asLibrary |> withRealInternalSignature realSig |> compile + |> verifyPEFileWithSystemDlls + |> withOutputContainsAllInOrderWithWildcards [ + "All Classes and Methods in*PrivateTypeInstanceMixedProperties.dll Verified." + ] |> withILContains [ if realSig then ".method public hidebysig specialname instance int32 get_MixedPropertyOne() cil managed" @@ -586,9 +626,14 @@ type public TestType () = static member private PrivateMethod() = () static member DefaultMethod() = () """ + |> withName "PublicTypeStaticMethods" |> asLibrary |> withRealInternalSignature realSig |> compile + |> verifyPEFileWithSystemDlls + |> withOutputContainsAllInOrderWithWildcards [ + "All Classes and Methods in*PublicTypeStaticMethods.dll Verified." + ] |> withILContains [ if realSig then ".method public static void PublicMethod() cil managed" @@ -617,9 +662,14 @@ type public TestType () = static member private PrivateMethod() = () static member DefaultMethod() = () """ + |> withName "PrivateTypeStaticMethods" |> asLibrary |> withRealInternalSignature realSig |> compile + |> verifyPEFileWithSystemDlls + |> withOutputContainsAllInOrderWithWildcards [ + "All Classes and Methods in*PrivateTypeStaticMethods.dll Verified." + ] |> withILContains [ if realSig then ".method public static void PublicMethod() cil managed" @@ -648,9 +698,14 @@ type public TestType () = static member val internal InternalProperty = 0 with get, set static member val private PrivateProperty = 0 with get, set static member val DefaultProperty = 0 with get, set""" + |> withName "PublicTypeStaticProperties" |> asLibrary |> withRealInternalSignature realSig |> compile + |> verifyPEFileWithSystemDlls + |> withOutputContainsAllInOrderWithWildcards [ + "All Classes and Methods in*PublicTypeStaticProperties.dll Verified." + ] |> withILContains [ if realSig then ".method public specialname static int32 get_PublicProperty() cil managed" @@ -687,9 +742,14 @@ type private TestType () = static member val internal InternalProperty = 0 with get, set static member val private PrivateProperty = 0 with get, set static member val DefaultProperty = 0 with get, set""" + |> withName "PrivateTypeStaticProperties" |> asLibrary |> withRealInternalSignature realSig |> compile + |> verifyPEFileWithSystemDlls + |> withOutputContainsAllInOrderWithWildcards [ + "All Classes and Methods in*PrivateTypeStaticProperties.dll Verified." + ] |> withILContains [ if realSig then ".method public specialname static int32 get_PublicProperty() cil managed" @@ -735,9 +795,14 @@ type public TestType () = static member MixedPropertyEleven with internal get() = 0 and set (_:int) = () static member MixedPropertyTwelve with private get() = 0 and set (_:int) = () """ + |> withName "PublicTypeStatiMixedProperties" |> asLibrary |> withRealInternalSignature realSig |> compile + |> verifyPEFileWithSystemDlls + |> withOutputContainsAllInOrderWithWildcards [ + "All Classes and Methods in*PublicTypeStatiMixedProperties.dll Verified." + ] |> withILContains [ if realSig then ".method public specialname static int32 get_MixedPropertyOne() cil managed" @@ -815,9 +880,14 @@ type private TestType () = static member MixedPropertyEleven with internal get() = 0 and set (_:int) = () static member MixedPropertyTwelve with private get() = 0 and set (_:int) = () """ + |> withName "PrivateTypeStatiMixedProperties" |> asLibrary |> withRealInternalSignature realSig |> compile + |> verifyPEFileWithSystemDlls + |> withOutputContainsAllInOrderWithWildcards [ + "All Classes and Methods in*PrivateTypeStatiMixedProperties.dll Verified." + ] |> withILContains [ if realSig then ".method public specialname static int32 get_MixedPropertyOne() cil managed" diff --git a/tests/FSharp.Test.Utilities/Compiler.fs b/tests/FSharp.Test.Utilities/Compiler.fs index 7de76521d83..1c9fca26592 100644 --- a/tests/FSharp.Test.Utilities/Compiler.fs +++ b/tests/FSharp.Test.Utilities/Compiler.fs @@ -204,6 +204,8 @@ module rec Compiler = with member this.Output = match this with Success o | Failure o -> o member this.RunOutput = this.Output.Output + member this.Compilation = this.Output.Compilation + member this.OutputPath = this.Output.OutputPath type ExecutionPlatform = | Anycpu = 0 @@ -1468,7 +1470,6 @@ Actual: failwith $"Expected imports are different from PDB.\nExpected:\n%A{expectedScope}\nActual:%A{imports}" let private verifySequencePoints (reader: MetadataReader) expectedSequencePoints = - let sequencePoints = [ for sp in reader.MethodDebugInformation do let mdi = reader.GetMethodDebugInformation sp @@ -1480,7 +1481,6 @@ Actual: failwith $"Expected sequence points are different from PDB.\nExpected: %A{expectedSequencePoints}\nActual: %A{sequencePoints}" let private verifyDocuments (reader: MetadataReader) expectedDocuments = - let documents = [ for doc in reader.Documents do if not doc.IsNil then @@ -1819,7 +1819,20 @@ Actual: | _ -> failwith "Cannot check exit code on this run result." result - let private checkOutputInOrder (category: string) (substrings: string list) (selector: ExecutionOutput -> string) (result: CompilationResult) : CompilationResult = + let private getMatch (input: string) (pattern: string) useWildcards= + // Escape special characters and replace wildcards with regex equivalents + if useWildcards then + let input = input.Replace("\r\n", "\n") + let pattern = $"""^{Regex.Escape(pattern).Replace("\\*", ".*").Replace("\\?", ".")}$""" + let m = Regex(pattern, RegexOptions.Multiline).Match(input) + if m.Success then + m.Index + else + -1 + else + input.IndexOf(pattern) + + let private checkOutputInOrderCore useWildcards (category: string) (substrings: string list) (selector: ExecutionOutput -> string) (result: CompilationResult) : CompilationResult = match result.RunOutput with | None -> printfn "Execution output is missing cannot check \"%A\"" category @@ -1827,20 +1840,23 @@ Actual: | Some o -> match o with | ExecutionOutput e -> - let where = selector e + let input = selector e let mutable searchPos = 0 for substring in substrings do - match where.IndexOf(substring, searchPos) with - | -1 -> failwith (sprintf "\nThe following substring:\n %A\nwas not found in the %A\nOutput:\n %A" substring category where) + match getMatch (input.Substring(searchPos)) substring useWildcards with + | -1 -> failwith (sprintf "\nThe following substring:\n %A\nwas not found in the %A\nOutput:\n %A" substring category input) | pos -> searchPos <- pos + substring.Length | _ -> failwith "Cannot check output on this run result." result + let private checkOutputInOrder category substrings selector result = + checkOutputInOrderCore false category substrings selector result + let withOutputContainsAllInOrder (substrings: string list) (result: CompilationResult) : CompilationResult = checkOutputInOrder "STDERR/STDOUT" substrings (fun o -> o.StdOut + "\n" + o.StdErr) result let withStdOutContains (substring: string) (result: CompilationResult) : CompilationResult = - checkOutputInOrder "STDOUT" [substring] (fun o -> o.StdOut) result + checkOutputInOrder "STDOUT" [substring] (fun o -> o.StdOut) result let withStdOutContainsAllInOrder (substrings: string list) (result: CompilationResult) : CompilationResult = checkOutputInOrder "STDOUT" substrings (fun o -> o.StdOut) result @@ -1851,6 +1867,24 @@ Actual: let withStdErrContains (substring: string) (result: CompilationResult) : CompilationResult = checkOutputInOrder "STDERR" [substring] (fun o -> o.StdErr) result + let private checkOutputInOrderWithWildcards category substrings selector result = + checkOutputInOrderCore true category substrings selector result + + let withOutputContainsAllInOrderWithWildcards (substrings: string list) (result: CompilationResult) : CompilationResult = + checkOutputInOrderWithWildcards "STDERR/STDOUT" substrings (fun o -> o.StdOut + "\n" + o.StdErr) result + + let withStdOutContainsWithWildcards (substring: string) (result: CompilationResult) : CompilationResult = + checkOutputInOrderWithWildcards "STDOUT" [substring] (fun o -> o.StdOut) result + + let withStdOutContainsAllInOrderWithWildcards (substrings: string list) (result: CompilationResult) : CompilationResult = + checkOutputInOrderWithWildcards "STDOUT" substrings (fun o -> o.StdOut) result + + let withStdErrContainsAllInOrderWithWildcards (substrings: string list) (result: CompilationResult) : CompilationResult = + checkOutputInOrderWithWildcards "STDERR" substrings (fun o -> o.StdErr) result + + let withStdErrContainsWithWildcards (substring: string) (result: CompilationResult) : CompilationResult = + checkOutputInOrderWithWildcards "STDERR" [substring] (fun o -> o.StdErr) result + let private assertEvalOutput (selector: FsiValue -> 'T) (value: 'T) (result: CompilationResult) : CompilationResult = match result.RunOutput with | None -> failwith "Execution output is missing cannot check value." diff --git a/tests/FSharp.Test.Utilities/CompilerAssert.fs b/tests/FSharp.Test.Utilities/CompilerAssert.fs index cc5fb4c3e9b..0f7baf597fb 100644 --- a/tests/FSharp.Test.Utilities/CompilerAssert.fs +++ b/tests/FSharp.Test.Utilities/CompilerAssert.fs @@ -59,6 +59,8 @@ module AssemblyResolver = match found() with | None -> Unchecked.defaultof | Some name -> Assembly.Load(name) ) + + do addResolver() #endif type ExecutionOutcome = diff --git a/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj b/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj index 192783edd57..37c1940b7a9 100644 --- a/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj +++ b/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj @@ -40,7 +40,7 @@ - + @@ -106,7 +106,7 @@ - + diff --git a/tests/FSharp.Test.Utilities/ILVerifierModule.fs b/tests/FSharp.Test.Utilities/ILVerifierModule.fs new file mode 100644 index 00000000000..8610476f217 --- /dev/null +++ b/tests/FSharp.Test.Utilities/ILVerifierModule.fs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. +namespace FSharp.Test + +open FSharp.Test.Compiler +open System +open System.IO +open TestFramework + +[] +module ILVerifierModule = + let config = initializeSuite () + + let fsharpCoreReference = $"--reference \"{typeof.Assembly.Location}\"" + + let private systemDllReferences = + // Get the path containing mecorlib.dll or System.Core.Private.dll + let refs = + let systemPath = Path.GetDirectoryName(typeof.Assembly.Location) + DirectoryInfo(systemPath).GetFiles("*.dll") + |> Array.map (fun dll -> $"--reference \"{Path.Combine(systemPath, dll.FullName)}\"") + |> Array.toList + (fsharpCoreReference :: refs) + + let private exec (dotnetExe: string) args workingDirectory = + let arguments = args |> String.concat " " + let exitCode, _output, errors = Commands.executeProcess dotnetExe arguments workingDirectory + let errors = errors |> String.concat Environment.NewLine + errors, exitCode + + let private verifyPEFileCore peverifierArgs (dllFilePath: string) = + let nuget_packages = + match Environment.GetEnvironmentVariable("NUGET_PACKAGES") with + | null -> + let profile = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + $"""{profile}/.nuget/packages""" + | path -> path + let peverifyFullArgs = [ yield "exec"; yield $"""{nuget_packages}/dotnet-ilverify/9.0.0/tools/net9.0/any/ILVerify.dll"""; yield "--verbose"; yield dllFilePath; yield! peverifierArgs ] + let workingDirectory = Path.GetDirectoryName dllFilePath + let _, exitCode = + let peverifierCommandPath = Path.ChangeExtension(dllFilePath, ".peverifierCommandPath.cmd") + let args = peverifyFullArgs |> Seq.fold(fun a acc -> $"{a} " + acc) "" + File.WriteAllLines(peverifierCommandPath, [| $"{args}" |] ) + File.Copy(typeof.Assembly.Location, Path.GetDirectoryName(dllFilePath) ++ "FSharp.Core.dll", true) + exec config.DotNetExe peverifyFullArgs workingDirectory + + // Grab output + let outputText = File.ReadAllText(Path.Combine(workingDirectory, "StandardOutput.txt")) + let errorText = File.ReadAllText(Path.Combine(workingDirectory, "StandardError.txt")) + + match exitCode with + | 0 -> {Outcome = NoExitCode; StdOut = outputText; StdErr = errorText } + | _ -> {Outcome = ExitCode exitCode; StdOut = outputText; StdErr = errorText } + + let private verifyPEFileAux (compilationResult: CompilationResult) args = + let result = + match compilationResult.Compilation with + | FS _ -> + match compilationResult, compilationResult.OutputPath with + | CompilationResult.Success result, Some name -> + let verifyResult = verifyPEFileCore args name + match verifyResult.Outcome with + | NoExitCode -> CompilationResult.Success {result with Output = Some (ExecutionOutput verifyResult)} + | ExitCode _ -> CompilationResult.Failure {result with Output = Some (ExecutionOutput verifyResult)} + | failed -> failwith $"Compilation must succeed in order to verify IL.{failed}" + | failed -> + failwith $"""Compilation must succeed in order to verify IL.{failed}""" + | _ -> + failwith "PEVerify is only supported for F#." + result + + let verifyPEFile compilationResult = + verifyPEFileAux compilationResult [| fsharpCoreReference |] + + let verifyPEFileWithArgs compilationResult args = + verifyPEFileAux compilationResult (fsharpCoreReference :: args) + + let verifyPEFileWithSystemDlls compilationResult = + verifyPEFileAux compilationResult systemDllReferences diff --git a/tests/FSharp.Test.Utilities/Peverifier.fs b/tests/FSharp.Test.Utilities/Peverifier.fs deleted file mode 100644 index 0591a435484..00000000000 --- a/tests/FSharp.Test.Utilities/Peverifier.fs +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -namespace FSharp.Test - -open FSharp.Test.Compiler -open System -open System.IO -open TestFramework - -type PEVerifyOutput = - { - ExitCode: int - Lines: string array - } - -[] -type PEVerifyResult = - | Success of PEVerifyOutput - | Failure of PEVerifyOutput - -[] -module PEVerifier = - - let config = initializeSuite () - - let private exec exe args = - let arguments = args |> String.concat " " - let exitCode, _output, errors = Commands.executeProcess exe arguments "" - let errors = errors |> String.concat Environment.NewLine - errors, exitCode - - let private verifyPEFileCore peverifierArgs dllFilePath = - let mutable errors = ResizeArray () - let peverifierPath = config.PEVERIFY - let peverifyFullArgs = [ yield dllFilePath; yield "/NOLOGO"; yield! peverifierArgs ] - let stdErr, exitCode = - let peverifierCommandPath = Path.ChangeExtension(dllFilePath, ".peverifierCommandPath") - File.WriteAllLines(peverifierCommandPath, [| $"{peverifierPath} {peverifyFullArgs}" |] ) - File.Copy(typeof.Assembly.Location, Path.GetDirectoryName(dllFilePath) ++ "FSharp.Core.dll", true) - exec peverifierPath peverifyFullArgs - - if exitCode <> 0 then - errors.Add (sprintf "PEVERIFIER failed with error code: %d" exitCode) - - if not (String.IsNullOrWhiteSpace stdErr) then - errors.Add (sprintf "PEVERIFIER stderr is not empty:\n %s" stdErr) - - let error = { ExitCode=exitCode; Lines = errors.ToArray() } - - match errors.Count with - | 0 -> PEVerifyResult.Success error - | _ -> PEVerifyResult.Failure error - - let private verifyPEFileAux cUnit args = - let result = - match cUnit with - | FS fs -> - match compile cUnit, fs.OutputFileName with - | CompilationResult.Success _, Some name -> - verifyPEFileCore args name - | failed -> - failwith $"""Compilation must succeed in order to verify IL.{failed}""" - | _ -> - failwith "PEVerify is only supported for F#." - result - - let verifyPEFile cUnit = - verifyPEFileAux cUnit [||] - - let verifyPEFileWithArgs cUnit args = - verifyPEFileCore cUnit args - - let shouldFail result = - match result with - | PEVerifyResult.Success _ -> failwith $"Expected to Fail - {result}" - | PEVerifyResult.Failure _ -> () - - let shouldSucceed result = - match result with - | PEVerifyResult.Success _ -> () - | PEVerifyResult.Failure _ -> failwith $"Expected to Succeed - {result}" diff --git a/tests/FSharp.Test.Utilities/TestFramework.fs b/tests/FSharp.Test.Utilities/TestFramework.fs index 38976846a4a..06b454005c2 100644 --- a/tests/FSharp.Test.Utilities/TestFramework.fs +++ b/tests/FSharp.Test.Utilities/TestFramework.fs @@ -14,12 +14,12 @@ let getShortId() = Guid.NewGuid().ToString().[..7] // Temporary directory is TempPath + "/FSharp.Test.Utilities/xxxxxxx/" let tempDirectoryOfThisTestRun = - let temp = Path.GetTempPath() - lazy DirectoryInfo(temp).CreateSubdirectory($"FSharp.Test.Utilities/{getShortId()}") + let temp = DirectoryInfo(Path.Combine(__SOURCE_DIRECTORY__, @"../../artifacts/Temp/FSharp.Test.Utilities", $"{getShortId()}")) + lazy (temp.Create(); temp) let cleanUpTemporaryDirectoryOfThisTestRun () = if tempDirectoryOfThisTestRun.IsValueCreated then - try tempDirectoryOfThisTestRun.Value.Delete(true) with _ -> () + ()//try tempDirectoryOfThisTestRun.Value.Delete(true) with _ -> () let createTemporaryDirectory () = tempDirectoryOfThisTestRun.Value @@ -87,10 +87,13 @@ module Commands = psi.RedirectStandardError <- true psi.Arguments <- arguments psi.CreateNoWindow <- true + // When running tests, we want to roll forward to minor versions (including previews). psi.EnvironmentVariables["DOTNET_ROLL_FORWARD"] <- "LatestMajor" psi.EnvironmentVariables["DOTNET_ROLL_FORWARD_TO_PRERELEASE"] <- "1" - psi.EnvironmentVariables.Remove("MSBuildSDKsPath") // Host can sometimes add this, and it can break things + + // Host can sometimes add this, and it can break things + psi.EnvironmentVariables.Remove("MSBuildSDKsPath") psi.UseShellExecute <- false use p = new Process() @@ -103,7 +106,7 @@ module Commands = p.BeginOutputReadLine() p.BeginErrorReadLine() p.WaitForExit() -#if DEBUG + let workingDir' = if workingDir = "" then @@ -118,7 +121,6 @@ module Commands = File.WriteAllLines(Path.Combine(workingDir', "StandardOutput.txt"), outputList) File.WriteAllLines(Path.Combine(workingDir', "StandardError.txt"), errorsList) ) -#endif p.ExitCode, outputList.ToArray(), errorsList.ToArray() let getfullpath workDir (path:string) = @@ -329,7 +331,7 @@ let config configurationName envVars = let ILASM_EXE = if operatingSystem = "win" then "ilasm.exe" else "ilasm" let ILASM = requirePackage (("runtime." + operatingSystem + "-" + architectureMoniker + ".Microsoft.NETCore.ILAsm") ++ coreClrRuntimePackageVersion ++ "runtimes" ++ (operatingSystem + "-" + architectureMoniker) ++ "native" ++ ILASM_EXE) //let PEVERIFY_EXE = if operatingSystem = "win" then "PEVerify.exe" elif operatingSystem = "osx" then "PEVerify.dll" else "PEVerify" - let PEVERIFY = "dummy" //requireArtifact ("PEVerify" ++ configurationName ++ peverifyArchitecture ++ PEVERIFY_EXE) + let PEVERIFY = "ilverify" //requireArtifact ("PEVerify" ++ configurationName ++ peverifyArchitecture ++ PEVERIFY_EXE) // let FSI_FOR_SCRIPTS = artifactsBinPath ++ "fsi" ++ configurationName ++ fsiArchitecture ++ "fsi.exe" let FSharpBuild = requireArtifact ("FSharp.Build" ++ configurationName ++ fsharpBuildArchitecture ++ "FSharp.Build.dll") let FSharpCompilerInteractiveSettings = requireArtifact ("FSharp.Compiler.Interactive.Settings" ++ configurationName ++ fsharpCompilerInteractiveSettingsArchitecture ++ "FSharp.Compiler.Interactive.Settings.dll") diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl index d301673c927..41e393f5f30 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl @@ -71,20 +71,3 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.IO.FileSystemUtils::trimQuotes(string)][offset 0x00000014][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Internal.Utilities.Library.String::lowerCaseFirstChar(string)][offset 0x0000003F][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Internal.Utilities.Library.Array+loop@276-4::Invoke(int32)][offset 0x00000012][found Byte] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel::Choose([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, !!0[])][offset 0x000000A0][found Byte] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel::Filter([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, !!0[])][offset 0x00000029][found Byte] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel::Partition([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, !!0[])][offset 0x00000038][found Byte] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel+Pipe #2 input at line 2241@2245-1::Invoke(int32, [System.Threading.Tasks.Parallel]System.Threading.Tasks.ParallelLoopState, int32)][offset 0x00000030][found Boolean] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel+Pipe #2 input at line 2571@2575-1::Invoke(int32, [System.Threading.Tasks.Parallel]System.Threading.Tasks.ParallelLoopState, int32)][offset 0x00000022][found Boolean] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.StringModule::Map([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, string)][offset 0x00000020][found Short] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.StringModule::Map([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, string)][offset 0x00000031][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.StringModule::MapIndexed([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, string)][offset 0x00000029][found Short] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.StringModule::MapIndexed([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, string)][offset 0x00000033][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.StringModule::Filter([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, string)][offset 0x00000075][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.Operators::castToString(!!0)][offset 0x00000001][found value 'T'][expected ref 'string'] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.LanguagePrimitives::retype(!!0)][offset 0x00000001][found value 'T'][expected value 'TResult'] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.LanguagePrimitives+HashCompare::GenericEqualityCharArray(char[], char[])][offset 0x0000001C][found Short] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.LanguagePrimitives+HashCompare::GenericEqualityCharArray(char[], char[])][offset 0x00000023][found Short] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.BasicInlinedOperations::castclassPrim(object)][offset 0x00000006][found ref 'T'][expected value 'T'] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.BasicInlinedOperations::notnullPrim(!!0)][offset 0x00000002][found Nullobjref 'NullReference'][expected value 'T'] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.BasicInlinedOperations::iscastPrim(object)][offset 0x00000006][found ref 'T'][expected value 'T'] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl index 81cc143b139..23bfed609bb 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl @@ -96,20 +96,3 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.IO.FileSystemUtils::trimQuotes(string)][offset 0x00000014][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Internal.Utilities.Library.String::lowerCaseFirstChar(string)][offset 0x0000003F][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Internal.Utilities.Library.Array+loop@276-4::Invoke(int32)][offset 0x00000012][found Byte] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel::Choose([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, !!0[])][offset 0x000000A0][found Byte] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel::Filter([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, !!0[])][offset 0x00000029][found Byte] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel::Partition([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, !!0[])][offset 0x00000038][found Byte] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel+Pipe #2 input at line 2241@2245-1::Invoke(int32, [System.Threading.Tasks.Parallel]System.Threading.Tasks.ParallelLoopState, int32)][offset 0x00000030][found Boolean] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel+Pipe #2 input at line 2571@2575-1::Invoke(int32, [System.Threading.Tasks.Parallel]System.Threading.Tasks.ParallelLoopState, int32)][offset 0x00000022][found Boolean] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.StringModule::Map([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, string)][offset 0x00000020][found Short] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.StringModule::Map([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, string)][offset 0x00000031][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.StringModule::MapIndexed([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, string)][offset 0x00000029][found Short] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.StringModule::MapIndexed([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, string)][offset 0x00000033][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.StringModule::Filter([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, string)][offset 0x00000075][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.Operators::castToString(!!0)][offset 0x00000001][found value 'T'][expected ref 'string'] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.LanguagePrimitives::retype(!!0)][offset 0x00000001][found value 'T'][expected value 'TResult'] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.LanguagePrimitives+HashCompare::GenericEqualityCharArray(char[], char[])][offset 0x0000001C][found Short] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.LanguagePrimitives+HashCompare::GenericEqualityCharArray(char[], char[])][offset 0x00000023][found Short] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.BasicInlinedOperations::castclassPrim(object)][offset 0x00000006][found ref 'T'][expected value 'T'] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.BasicInlinedOperations::notnullPrim(!!0)][offset 0x00000002][found Nullobjref 'NullReference'][expected value 'T'] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.BasicInlinedOperations::iscastPrim(object)][offset 0x00000006][found ref 'T'][expected value 'T'] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl index 8c2b6a97465..d1ac4690f8b 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl @@ -97,15 +97,3 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.IO.FileSystemUtils::trimQuotes(string)][offset 0x00000014][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Internal.Utilities.Library.String::lowerCaseFirstChar(string)][offset 0x0000003A][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Internal.Utilities.Library.Array::loop@275-3(bool[], int32)][offset 0x00000008][found Byte] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel::Choose([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, !!0[])][offset 0x00000081][found Byte] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel::Filter([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, !!0[])][offset 0x00000029][found Byte] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel::Partition([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, !!0[])][offset 0x00000038][found Byte] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel+Choose@2245-2::Invoke(int32, [System.Threading.Tasks.Parallel]System.Threading.Tasks.ParallelLoopState, int32)][offset 0x00000030][found Boolean] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel+countAndCollectTrueItems@2575-1::Invoke(int32, [System.Threading.Tasks.Parallel]System.Threading.Tasks.ParallelLoopState, int32)][offset 0x00000022][found Boolean] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.StringModule::Map([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, string)][offset 0x0000001E][found Short] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.StringModule::Map([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, string)][offset 0x0000002D][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.StringModule::MapIndexed([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, string)][offset 0x00000029][found Short] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.StringModule::MapIndexed([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, string)][offset 0x00000033][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.StringModule::Filter([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, string)][offset 0x0000006C][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.LanguagePrimitives+HashCompare::GenericEqualityCharArray(char[], char[])][offset 0x0000001C][found Short] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.LanguagePrimitives+HashCompare::GenericEqualityCharArray(char[], char[])][offset 0x00000023][found Short] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl index 588f29f5a96..15bc7aba394 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl @@ -123,15 +123,3 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.IO.FileSystemUtils::trimQuotes(string)][offset 0x00000014][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Internal.Utilities.Library.String::lowerCaseFirstChar(string)][offset 0x0000003A][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Internal.Utilities.Library.Array::loop@275-3(bool[], int32)][offset 0x00000008][found Byte] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel::Choose([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, !!0[])][offset 0x00000081][found Byte] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel::Filter([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, !!0[])][offset 0x00000029][found Byte] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel::Partition([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, !!0[])][offset 0x00000038][found Byte] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel+Choose@2245-2::Invoke(int32, [System.Threading.Tasks.Parallel]System.Threading.Tasks.ParallelLoopState, int32)][offset 0x00000030][found Boolean] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel+countAndCollectTrueItems@2575-1::Invoke(int32, [System.Threading.Tasks.Parallel]System.Threading.Tasks.ParallelLoopState, int32)][offset 0x00000022][found Boolean] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.StringModule::Map([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, string)][offset 0x0000001E][found Short] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.StringModule::Map([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, string)][offset 0x0000002D][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.StringModule::MapIndexed([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, string)][offset 0x00000029][found Short] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.StringModule::MapIndexed([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, string)][offset 0x00000033][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.StringModule::Filter([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, string)][offset 0x0000006C][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.LanguagePrimitives+HashCompare::GenericEqualityCharArray(char[], char[])][offset 0x0000001C][found Short] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.LanguagePrimitives+HashCompare::GenericEqualityCharArray(char[], char[])][offset 0x00000023][found Short] Unexpected type on the stack. From afb15f068045802ae0155e003562d44c185b76bc Mon Sep 17 00:00:00 2001 From: Jakub Majocha <1760221+majocha@users.noreply.github.com> Date: Wed, 29 Jan 2025 14:00:24 +0100 Subject: [PATCH 36/49] remove redundant ifdef (#18284) --- src/Compiler/TypedTree/TypeProviders.fs | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/Compiler/TypedTree/TypeProviders.fs b/src/Compiler/TypedTree/TypeProviders.fs index be22209a27a..acef34047ca 100644 --- a/src/Compiler/TypedTree/TypeProviders.fs +++ b/src/Compiler/TypedTree/TypeProviders.fs @@ -122,7 +122,6 @@ let CreateTypeProvider ( // Create the TypeProviderConfig to pass to the type provider constructor let e = -#if FSHARPCORE_USE_PACKAGE TypeProviderConfig(systemRuntimeContainsType, ReferencedAssemblies=getReferencedAssemblies(), ResolutionFolder=resolutionEnvironment.ResolutionFolder, @@ -131,16 +130,7 @@ let CreateTypeProvider ( IsInvalidationSupported=isInvalidationSupported, IsHostedExecution= isInteractive, SystemRuntimeAssemblyVersion = systemRuntimeAssemblyVersion) -#else - TypeProviderConfig(systemRuntimeContainsType, - ReferencedAssemblies=getReferencedAssemblies(), - ResolutionFolder=resolutionEnvironment.ResolutionFolder, - RuntimeAssembly=runtimeAssemblyPath, - TemporaryFolder=resolutionEnvironment.TemporaryFolder, - IsInvalidationSupported=isInvalidationSupported, - IsHostedExecution= isInteractive, - SystemRuntimeAssemblyVersion = systemRuntimeAssemblyVersion) -#endif + protect (fun () -> !!(Activator.CreateInstance(typeProviderImplementationType, [| box e|])) :?> ITypeProvider ) elif not(isNull(typeProviderImplementationType.GetConstructor [| |])) then From 58560f8ce35a691415e10dd2b0189322d21afdfc Mon Sep 17 00:00:00 2001 From: Eugene Auduchinok Date: Wed, 29 Jan 2025 22:24:03 +0900 Subject: [PATCH 37/49] Cancellable: only cancel on OCE with own token (#18277) --- docs/release-notes/.FSharp.Compiler.Service/9.0.300.md | 1 + src/Compiler/Checking/CheckDeclarations.fs | 2 +- src/Compiler/Utilities/Cancellable.fs | 5 +++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md index 52b92207001..5c444bd4fd3 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md @@ -2,6 +2,7 @@ * Fix Realsig+ generates nested closures with incorrect Generic ([Issue #17797](https://github.com/dotnet/fsharp/issues/17797), [PR #17877](https://github.com/dotnet/fsharp/pull/17877)) * Fix internal error when missing measure attribute in an unsolved measure typar. ([Issue #7491](https://github.com/dotnet/fsharp/issues/7491), [PR #18234](https://github.com/dotnet/fsharp/pull/18234)== * Set `Cancellable.token` from async computation ([Issue #18235](https://github.com/dotnet/fsharp/issues/18235), [PR #18238](https://github.com/dotnet/fsharp/pull/18238)) +* Cancellable: only cancel on OCE with own token ([PR #18277](https://github.com/dotnet/fsharp/pull/18277)) ### Added * Added missing type constraints in FCS. ([PR #18241](https://github.com/dotnet/fsharp/pull/18241)) diff --git a/src/Compiler/Checking/CheckDeclarations.fs b/src/Compiler/Checking/CheckDeclarations.fs index 23c547b36b8..af3e712a8db 100644 --- a/src/Compiler/Checking/CheckDeclarations.fs +++ b/src/Compiler/Checking/CheckDeclarations.fs @@ -5479,7 +5479,7 @@ let rec TcModuleOrNamespaceElementNonMutRec (cenv: cenv) parent typeNames scopem and [] TcModuleOrNamespaceElementsNonMutRec cenv parent typeNames endm (defsSoFar, env, envAtEnd) (moreDefs: SynModuleDecl list) (ct: CancellationToken) = if ct.IsCancellationRequested then - ValueOrCancelled.Cancelled (OperationCanceledException()) + ValueOrCancelled.Cancelled(OperationCanceledException ct) else match moreDefs with | [] -> diff --git a/src/Compiler/Utilities/Cancellable.fs b/src/Compiler/Utilities/Cancellable.fs index 9ec81438ca4..ad739b5039e 100644 --- a/src/Compiler/Utilities/Cancellable.fs +++ b/src/Compiler/Utilities/Cancellable.fs @@ -68,8 +68,9 @@ module Cancellable = try use _ = Cancellable.UsingToken(ct) oper ct - with :? OperationCanceledException as e -> - ValueOrCancelled.Cancelled(OperationCanceledException e.CancellationToken) + with + | :? OperationCanceledException as e when ct.IsCancellationRequested -> ValueOrCancelled.Cancelled e + | :? OperationCanceledException as e -> InvalidOperationException("Wrong cancellation token", e) |> raise let fold f acc seq = Cancellable(fun ct -> From 5b910afd674f62377d3c054dd1709201378dc7ed Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Mon, 3 Feb 2025 13:27:52 +0100 Subject: [PATCH 38/49] Bugfix :: Fix optimizer bug where field.Index included compiler generated static fields (#18280) * Fix optimizer bug where field.Index included compiler generated static fields * notes added --- .../.FSharp.Compiler.Service/9.0.300.md | 1 + src/Compiler/TypedTree/TypedTree.fs | 20 ++++++++++++++----- .../StaticLet/RecordOptimizerRegression.fs | 14 +++++++++++++ .../StaticLet/StaticLetInUnionsAndRecords.fs | 10 ++++++++++ 4 files changed, 40 insertions(+), 5 deletions(-) create mode 100644 tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/StaticLet/RecordOptimizerRegression.fs diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md index 5c444bd4fd3..e3beae168a3 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md @@ -1,5 +1,6 @@ ### Fixed * Fix Realsig+ generates nested closures with incorrect Generic ([Issue #17797](https://github.com/dotnet/fsharp/issues/17797), [PR #17877](https://github.com/dotnet/fsharp/pull/17877)) +* Fix optimizer internal error for records with static fields ([Issue #18165](https://github.com/dotnet/fsharp/issues/18165), [PR #18280](https://github.com/dotnet/fsharp/pull/18280)) * Fix internal error when missing measure attribute in an unsolved measure typar. ([Issue #7491](https://github.com/dotnet/fsharp/issues/7491), [PR #18234](https://github.com/dotnet/fsharp/pull/18234)== * Set `Cancellable.token` from async computation ([Issue #18235](https://github.com/dotnet/fsharp/issues/18235), [PR #18238](https://github.com/dotnet/fsharp/pull/18238)) * Cancellable: only cancel on OCE with own token ([PR #18277](https://github.com/dotnet/fsharp/pull/18277)) diff --git a/src/Compiler/TypedTree/TypedTree.fs b/src/Compiler/TypedTree/TypedTree.fs index d2af320b8de..27e80d396be 100644 --- a/src/Compiler/TypedTree/TypedTree.fs +++ b/src/Compiler/TypedTree/TypedTree.fs @@ -4273,6 +4273,19 @@ type UnionCaseRef = override x.ToString() = x.CaseName +let findLogicalFieldIndexOfRecordField (tcref:TyconRef) (id:string) = + let arr = tcref.AllFieldsArray + + // We are skipping compiler generated fields such as "init@5" from index calculation + let rec go originalIdx skippedItems = + if originalIdx >= arr.Length then error(InternalError(sprintf "field %s not found in type %s" id tcref.LogicalName, tcref.Range)) + else + let currentItem = arr[originalIdx] + if currentItem.LogicalName = id then (originalIdx-skippedItems) + else go (originalIdx + 1) (skippedItems + (if currentItem.IsCompilerGenerated && currentItem.IsStatic then 1 else 0)) + + go 0 0 + /// Represents a reference to a field in a record, class or struct [] type RecdFieldRef = @@ -4316,11 +4329,8 @@ type RecdFieldRef = member x.Index = let (RecdFieldRef(tcref, id)) = x - try - // REVIEW: this could be faster, e.g. by storing the index in the NameMap - tcref.AllFieldsArray |> Array.findIndex (fun rfspec -> rfspec.LogicalName = id) - with :? KeyNotFoundException -> - error(InternalError(sprintf "field %s not found in type %s" id tcref.LogicalName, tcref.Range)) + findLogicalFieldIndexOfRecordField tcref id + [] member x.DebugText = x.ToString() diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/StaticLet/RecordOptimizerRegression.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/StaticLet/RecordOptimizerRegression.fs new file mode 100644 index 00000000000..1ecbe38c6f8 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/StaticLet/RecordOptimizerRegression.fs @@ -0,0 +1,14 @@ +module Test + +// https://github.com/dotnet/fsharp/issues/18165 + +type FooBar = + { xyz : string } + static let staticLet = 1 + +let doThing (foo : FooBar) = + let bar = { foo with xyz = foo.xyz } + let baz = { bar with xyz = bar.xyz } + printf "%O" baz + +doThing { xyz = "" } \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/StaticLet/StaticLetInUnionsAndRecords.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/StaticLet/StaticLetInUnionsAndRecords.fs index 17c7c03c808..5ce43b8db72 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/StaticLet/StaticLetInUnionsAndRecords.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/StaticLet/StaticLetInUnionsAndRecords.fs @@ -95,6 +95,16 @@ init R 2 1 2""" +[] +let ``Static let - record optimizer regression`` compilation = + compilation + |> withOptimize + |> verifyCompileAndRun + |> shouldSucceed + |> withStdOutContains """{ xyz = "" }""" + + + [] let ``Static let - lowercase DU`` compilation = compilation From 319504116eba950686f94b74cdcf6bdc8720ecad Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Mon, 3 Feb 2025 13:29:14 +0100 Subject: [PATCH 39/49] Bugfix :: Support for 'use' on a nullable IDisposable (#18262) * Support for 'use' on a nullable IDisposable * release notes --- .../.FSharp.Compiler.Service/9.0.300.md | 1 + .../Checking/Expressions/CheckExpressions.fs | 6 +++--- .../Checking/Expressions/CheckExpressionsOps.fs | 2 +- src/Compiler/Optimize/LowerComputedCollections.fs | 2 +- src/Compiler/TypedTree/TcGlobals.fs | 1 + src/Compiler/TypedTree/TcGlobals.fsi | 2 ++ .../Nullness/NullableReferenceTypesTests.fs | 13 +++++++++++++ 7 files changed, 22 insertions(+), 5 deletions(-) diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md index e3beae168a3..859bd0e3c31 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md @@ -7,6 +7,7 @@ ### Added * Added missing type constraints in FCS. ([PR #18241](https://github.com/dotnet/fsharp/pull/18241)) +* The 'use' keyword can be used on IDisposable|null without nullness warnings ([PR #18262](https://github.com/dotnet/fsharp/pull/18262)) ### Changed diff --git a/src/Compiler/Checking/Expressions/CheckExpressions.fs b/src/Compiler/Checking/Expressions/CheckExpressions.fs index 9987f02759c..f33c7239063 100644 --- a/src/Compiler/Checking/Expressions/CheckExpressions.fs +++ b/src/Compiler/Checking/Expressions/CheckExpressions.fs @@ -3097,7 +3097,7 @@ let BuildDisposableCleanup (cenv: cenv) env m (v: Val) = else mkUnit g m else - let disposeObjVar, disposeObjExpr = mkCompGenLocal m "objectToDispose" g.system_IDisposable_ty + let disposeObjVar, disposeObjExpr = mkCompGenLocal m "objectToDispose" g.system_IDisposableNull_ty let disposeExpr, _ = BuildPossiblyConditionalMethodCall cenv env PossiblyMutates m false disposeMethod NormalValUse [] [disposeObjExpr] [] None let inputExpr = mkCoerceExpr(exprForVal v.Range v, g.obj_ty_ambivalent, m, v.Type) mkIsInstConditional g m g.system_IDisposable_ty inputExpr disposeObjVar disposeExpr (mkUnit g m) @@ -6811,7 +6811,7 @@ and TcCtorCall isNaked cenv env tpenv (overallTy: OverallTy) objTy mObjTyOpt ite match item, args with | Item.CtorGroup(methodName, minfos), _ -> let meths = List.map (fun minfo -> minfo, None) minfos - if isNaked && TypeFeasiblySubsumesType 0 g cenv.amap mWholeCall g.system_IDisposable_ty NoCoerce objTy then + if isNaked && TypeFeasiblySubsumesType 0 g cenv.amap mWholeCall g.system_IDisposableNull_ty NoCoerce objTy then warning(Error(FSComp.SR.tcIDisposableTypeShouldUseNew(), mWholeCall)) // Check the type is not abstract @@ -11603,7 +11603,7 @@ and TcLetBinding (cenv: cenv) isUse env containerInfo declKind tpenv (synBinds, let isDiscarded = match checkedPat2 with TPat_wild _ -> true | _ -> false let allValsDefinedByPattern = if isDiscarded then [patternInputTmp] else allValsDefinedByPattern (allValsDefinedByPattern, (bodyExpr, bodyExprTy)) ||> List.foldBack (fun v (bodyExpr, bodyExprTy) -> - AddCxTypeMustSubsumeType ContextInfo.NoContext denv cenv.css v.Range NoTrace g.system_IDisposable_ty v.Type + AddCxTypeMustSubsumeType ContextInfo.NoContext denv cenv.css v.Range NoTrace g.system_IDisposableNull_ty v.Type let cleanupE = BuildDisposableCleanup cenv env m v mkTryFinally g (bodyExpr, cleanupE, m, bodyExprTy, DebugPointAtTry.No, DebugPointAtFinally.No), bodyExprTy) else diff --git a/src/Compiler/Checking/Expressions/CheckExpressionsOps.fs b/src/Compiler/Checking/Expressions/CheckExpressionsOps.fs index 17572c86e4f..3552b1345f7 100644 --- a/src/Compiler/Checking/Expressions/CheckExpressionsOps.fs +++ b/src/Compiler/Checking/Expressions/CheckExpressionsOps.fs @@ -297,7 +297,7 @@ let mkSeqEmpty (cenv: TcFileState) env m genTy = let mkSeqUsing (cenv: TcFileState) (env: TcEnv) m resourceTy genTy resourceExpr lam = let g = cenv.g - AddCxTypeMustSubsumeType ContextInfo.NoContext env.DisplayEnv cenv.css m NoTrace g.system_IDisposable_ty resourceTy + AddCxTypeMustSubsumeType ContextInfo.NoContext env.DisplayEnv cenv.css m NoTrace g.system_IDisposableNull_ty resourceTy let genResultTy = NewInferenceType g UnifyTypes cenv env m genTy (mkSeqTy cenv.g genResultTy) mkCallSeqUsing cenv.g m resourceTy genResultTy resourceExpr lam diff --git a/src/Compiler/Optimize/LowerComputedCollections.fs b/src/Compiler/Optimize/LowerComputedCollections.fs index 1f224ea499c..4e74722e1bf 100644 --- a/src/Compiler/Optimize/LowerComputedCollections.fs +++ b/src/Compiler/Optimize/LowerComputedCollections.fs @@ -35,7 +35,7 @@ let BuildDisposableCleanup tcVal (g: TcGlobals) infoReader m (v: Val) = disposeExpr else - let disposeObjVar, disposeObjExpr = mkCompGenLocal m "objectToDispose" g.system_IDisposable_ty + let disposeObjVar, disposeObjExpr = mkCompGenLocal m "objectToDispose" g.system_IDisposableNull_ty let disposeExpr, _ = BuildMethodCall tcVal g infoReader.amap PossiblyMutates m false disposeMethod NormalValUse [] [disposeObjExpr] [] None let inputExpr = mkCoerceExpr(exprForVal v.Range v, g.obj_ty_ambivalent, m, v.Type) mkIsInstConditional g m g.system_IDisposable_ty inputExpr disposeObjVar disposeExpr (mkUnit g m) diff --git a/src/Compiler/TypedTree/TcGlobals.fs b/src/Compiler/TypedTree/TcGlobals.fs index 4f4a45c735e..d8b95566717 100644 --- a/src/Compiler/TypedTree/TcGlobals.fs +++ b/src/Compiler/TypedTree/TcGlobals.fs @@ -1369,6 +1369,7 @@ type TcGlobals( member val system_Array_ty = mkSysNonGenericTy sys "Array" member val system_Object_ty = mkSysNonGenericTy sys "Object" member val system_IDisposable_ty = mkSysNonGenericTy sys "IDisposable" + member val system_IDisposableNull_ty = mkNonGenericTyWithNullness (findSysTyconRef sys "IDisposable") v_knownWithNull member val system_RuntimeHelpers_ty = mkSysNonGenericTy sysCompilerServices "RuntimeHelpers" member val system_Value_ty = mkSysNonGenericTy sys "ValueType" member val system_Delegate_ty = mkSysNonGenericTy sys "Delegate" diff --git a/src/Compiler/TypedTree/TcGlobals.fsi b/src/Compiler/TypedTree/TcGlobals.fsi index 73d26a64b62..772bc6b96d7 100644 --- a/src/Compiler/TypedTree/TcGlobals.fsi +++ b/src/Compiler/TypedTree/TcGlobals.fsi @@ -1199,6 +1199,8 @@ type internal TcGlobals = member system_IDisposable_ty: FSharp.Compiler.TypedTree.TType + member system_IDisposableNull_ty: FSharp.Compiler.TypedTree.TType + member system_IFormattable_tcref: FSharp.Compiler.TypedTree.EntityRef member system_IFormattable_ty: FSharp.Compiler.TypedTree.TType diff --git a/tests/FSharp.Compiler.ComponentTests/Language/Nullness/NullableReferenceTypesTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/Nullness/NullableReferenceTypesTests.fs index 819bd475152..7eec0ba8054 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/Nullness/NullableReferenceTypesTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/Nullness/NullableReferenceTypesTests.fs @@ -173,6 +173,19 @@ let safeHolder : IDisposable = |> typeCheckWithStrictNullness |> shouldSucceed +[] +let ``Can _use_ a nullable IDisposable`` () = + FSharp """module TestLib +open System +let workWithResource (getD:int -> (IDisposable|null)) = + use _ = getD 15 + 15 + + """ + |> asLibrary + |> typeCheckWithStrictNullness + |> shouldSucceed + [] let ``Does not duplicate warnings`` () = FSharp """ From 4583331935edb7fe06d3bfd9b7ca76f890ed9802 Mon Sep 17 00:00:00 2001 From: Eugene Auduchinok Date: Tue, 4 Feb 2025 01:41:53 +0900 Subject: [PATCH 40/49] Cancellable: set token in more places (#18283) --- docs/release-notes/.FSharp.Compiler.Service/9.0.300.md | 1 + src/Compiler/Service/BackgroundCompiler.fs | 2 ++ src/Compiler/Service/ServiceAnalysis.fs | 3 +++ .../ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl | 2 +- .../ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl | 2 +- .../ilverify_FSharp.Compiler.Service_Release_net9.0.bsl | 2 +- ...ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl | 2 +- 7 files changed, 10 insertions(+), 4 deletions(-) diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md index 859bd0e3c31..a981aa6e79e 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md @@ -4,6 +4,7 @@ * Fix internal error when missing measure attribute in an unsolved measure typar. ([Issue #7491](https://github.com/dotnet/fsharp/issues/7491), [PR #18234](https://github.com/dotnet/fsharp/pull/18234)== * Set `Cancellable.token` from async computation ([Issue #18235](https://github.com/dotnet/fsharp/issues/18235), [PR #18238](https://github.com/dotnet/fsharp/pull/18238)) * Cancellable: only cancel on OCE with own token ([PR #18277](https://github.com/dotnet/fsharp/pull/18277)) +* Cancellable: set token in more places ([PR #18283](https://github.com/dotnet/fsharp/pull/18283)) ### Added * Added missing type constraints in FCS. ([PR #18241](https://github.com/dotnet/fsharp/pull/18241)) diff --git a/src/Compiler/Service/BackgroundCompiler.fs b/src/Compiler/Service/BackgroundCompiler.fs index 8f119f2fd60..da04b6ebb83 100644 --- a/src/Compiler/Service/BackgroundCompiler.fs +++ b/src/Compiler/Service/BackgroundCompiler.fs @@ -503,6 +503,8 @@ type internal BackgroundCompiler match tryGetBuilder options with | Some getBuilder -> async { + do! Cancellable.UseToken() + match! getBuilder with | builderOpt, creationDiags when builderOpt.IsNone || not builderOpt.Value.IsReferencesInvalidated -> return builderOpt, creationDiags diff --git a/src/Compiler/Service/ServiceAnalysis.fs b/src/Compiler/Service/ServiceAnalysis.fs index 26b2ea1f7a2..1347751d167 100644 --- a/src/Compiler/Service/ServiceAnalysis.fs +++ b/src/Compiler/Service/ServiceAnalysis.fs @@ -6,6 +6,7 @@ open System open System.Collections.Generic open System.Runtime.CompilerServices open Internal.Utilities.Library +open FSharp.Compiler open FSharp.Compiler.CodeAnalysis open FSharp.Compiler.Symbols open FSharp.Compiler.Syntax.PrettyNaming @@ -301,6 +302,8 @@ module UnusedOpens = /// Async to allow cancellation. let getUnusedOpens (checkFileResults: FSharpCheckFileResults, getSourceLineStr: int -> string) : Async = async { + do! Cancellable.UseToken() + if checkFileResults.OpenDeclarations.Length = 0 then return [] else diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl index 41e393f5f30..60c5f6e4b5f 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl @@ -21,7 +21,7 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x00000082][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x0000008B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+MagicAssemblyResolution::ResolveAssemblyCore([FSharp.Compiler.Service]Internal.Utilities.Library.CompilationThreadToken, [FSharp.Compiler.Service]FSharp.Compiler.Text.Range, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, [FSharp.Compiler.Service]FSharp.Compiler.CompilerImports+TcImports, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompiler, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiConsoleOutput, string)][offset 0x00000015][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3510-786::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001E5][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3510-788::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001E5][found Char] Unexpected type on the stack. [IL]: Error [UnmanagedPointer]: : FSharp.Compiler.Interactive.Shell+Utilities+pointerToNativeInt@110::Invoke(object)][offset 0x00000007] Unmanaged pointers are not a verifiable type. [IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+dataTipOfReferences@2205::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000084][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-508::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl index 23bfed609bb..1e0df962a05 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl @@ -28,7 +28,7 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x0000008B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+FsiStdinSyphon::GetLine(string, int32)][offset 0x00000039][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+MagicAssemblyResolution::ResolveAssemblyCore([FSharp.Compiler.Service]Internal.Utilities.Library.CompilationThreadToken, [FSharp.Compiler.Service]FSharp.Compiler.Text.Range, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, [FSharp.Compiler.Service]FSharp.Compiler.CompilerImports+TcImports, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompiler, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiConsoleOutput, string)][offset 0x00000015][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3510-786::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001E5][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3510-788::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001E5][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+FsiInteractionProcessor::CompletionsForPartialLID([FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompilerState, string)][offset 0x0000001B][found Char] Unexpected type on the stack. [IL]: Error [UnmanagedPointer]: : FSharp.Compiler.Interactive.Shell+Utilities+pointerToNativeInt@110::Invoke(object)][offset 0x00000007] Unmanaged pointers are not a verifiable type. [IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+dataTipOfReferences@2205::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000084][found Char] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl index d1ac4690f8b..1a088c5a702 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl @@ -21,7 +21,7 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x00000082][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x0000008B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+MagicAssemblyResolution::ResolveAssemblyCore([FSharp.Compiler.Service]Internal.Utilities.Library.CompilationThreadToken, [FSharp.Compiler.Service]FSharp.Compiler.Text.Range, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, [FSharp.Compiler.Service]FSharp.Compiler.CompilerImports+TcImports, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompiler, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiConsoleOutput, string)][offset 0x00000015][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3510-830::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001C7][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3510-832::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001C7][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+GetReferenceResolutionStructuredToolTipText@2205::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000076][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-529::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-529::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl index 15bc7aba394..48af8ec2f2f 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl @@ -28,7 +28,7 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x0000008B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+FsiStdinSyphon::GetLine(string, int32)][offset 0x00000032][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+MagicAssemblyResolution::ResolveAssemblyCore([FSharp.Compiler.Service]Internal.Utilities.Library.CompilationThreadToken, [FSharp.Compiler.Service]FSharp.Compiler.Text.Range, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, [FSharp.Compiler.Service]FSharp.Compiler.CompilerImports+TcImports, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompiler, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiConsoleOutput, string)][offset 0x00000015][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3510-830::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001C7][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3510-832::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001C7][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+FsiInteractionProcessor::CompletionsForPartialLID([FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompilerState, string)][offset 0x00000024][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+GetReferenceResolutionStructuredToolTipText@2205::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000076][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseMemberFunctionAndValues@176::Invoke([FSharp.Compiler.Service]FSharp.Compiler.Symbols.FSharpMemberOrFunctionOrValue)][offset 0x0000002B][found Char] Unexpected type on the stack. From d3bd7584d6aad7ab50cb7a52ded044ad086068be Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 09:32:05 -0800 Subject: [PATCH 41/49] [main] Update dependencies from dotnet/source-build-reference-packages (#18281) * Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20250128.6 Microsoft.SourceBuild.Intermediate.source-build-reference-packages From Version 9.0.0-alpha.1.25066.1 -> To Version 9.0.0-alpha.1.25078.6 * Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20250131.6 Microsoft.SourceBuild.Intermediate.source-build-reference-packages From Version 9.0.0-alpha.1.25066.1 -> To Version 9.0.0-alpha.1.25081.6 --------- Co-authored-by: dotnet-maestro[bot] Co-authored-by: Petr --- eng/Version.Details.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index e0c968cbe09..7071e352237 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,9 +1,9 @@ - + https://github.com/dotnet/source-build-reference-packages - 93a3395781d30f69201367371c28cfc5005c0264 + 1cec3b4a8fb07138136a1ca1e04763bfcf7841db From 0263870af420926318dd7c69849c584162207154 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 09:32:48 -0800 Subject: [PATCH 42/49] Update dependencies from https://github.com/dotnet/arcade build 20250127.4 (#18282) Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.25065.2 -> To Version 9.0.0-beta.25077.4 Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 8 ++++---- eng/common/internal/Tools.csproj | 10 ---------- global.json | 2 +- 3 files changed, 5 insertions(+), 15 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 7071e352237..c7056f9a86d 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -42,14 +42,14 @@ - + https://github.com/dotnet/arcade - c4bbc67763bf0c5a868862df874079380e647d61 + bac7e1caea791275b7c3ccb4cb75fd6a04a26618 - + https://github.com/dotnet/arcade - c4bbc67763bf0c5a868862df874079380e647d61 + bac7e1caea791275b7c3ccb4cb75fd6a04a26618 diff --git a/eng/common/internal/Tools.csproj b/eng/common/internal/Tools.csproj index 32f79dfb340..feaa6d20812 100644 --- a/eng/common/internal/Tools.csproj +++ b/eng/common/internal/Tools.csproj @@ -15,16 +15,6 @@ - - - - https://devdiv.pkgs.visualstudio.com/_packaging/dotnet-core-internal-tooling/nuget/v3/index.json; - - - $(RestoreSources); - https://devdiv.pkgs.visualstudio.com/_packaging/VS/nuget/v3/index.json; - - diff --git a/global.json b/global.json index 8fe04b02ff8..5ba1a798140 100644 --- a/global.json +++ b/global.json @@ -17,7 +17,7 @@ "perl": "5.38.2.2" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.25065.2", + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.25077.4", "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.23255.2" } } From bacc1605ee79b97de69ad5e275ab90c7017c9305 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Tue, 4 Feb 2025 11:10:43 +0100 Subject: [PATCH 43/49] Bugfix: Warn when upcast drops nullness via FindUniqueFeasibleSupertype (#18261) * Warn when upcast drops nullness via FindUniqueFeasibleSupertype * temporary null shutuops before `use` is softened * notes added --- .../.FSharp.Compiler.Service/9.0.300.md | 1 + src/Compiler/Checking/TypeRelations.fs | 12 ++++++++++-- src/Compiler/Utilities/Activity.fs | 6 +++--- .../Nullness/NullableReferenceTypesTests.fs | 14 ++++++++++++++ 4 files changed, 28 insertions(+), 5 deletions(-) diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md index a981aa6e79e..7b1942196b9 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md @@ -3,6 +3,7 @@ * Fix optimizer internal error for records with static fields ([Issue #18165](https://github.com/dotnet/fsharp/issues/18165), [PR #18280](https://github.com/dotnet/fsharp/pull/18280)) * Fix internal error when missing measure attribute in an unsolved measure typar. ([Issue #7491](https://github.com/dotnet/fsharp/issues/7491), [PR #18234](https://github.com/dotnet/fsharp/pull/18234)== * Set `Cancellable.token` from async computation ([Issue #18235](https://github.com/dotnet/fsharp/issues/18235), [PR #18238](https://github.com/dotnet/fsharp/pull/18238)) +* Fix missing nullness warning when static upcast dropped nullness ([Issue #18232](https://github.com/dotnet/fsharp/issues/18232), [PR #18261](https://github.com/dotnet/fsharp/pull/18261)) * Cancellable: only cancel on OCE with own token ([PR #18277](https://github.com/dotnet/fsharp/pull/18277)) * Cancellable: set token in more places ([PR #18283](https://github.com/dotnet/fsharp/pull/18283)) diff --git a/src/Compiler/Checking/TypeRelations.fs b/src/Compiler/Checking/TypeRelations.fs index d180bb778dd..2cb5dd4057a 100644 --- a/src/Compiler/Checking/TypeRelations.fs +++ b/src/Compiler/Checking/TypeRelations.fs @@ -341,5 +341,13 @@ let IteratedAdjustLambdaToMatchValReprInfo g amap valReprInfo lambdaExpr = /// "Single Feasible Type" inference /// Look for the unique supertype of ty2 for which ty2 :> ty1 might feasibly hold let FindUniqueFeasibleSupertype g amap m ty1 ty2 = - let supertypes = Option.toList (GetSuperTypeOfType g amap m ty2) @ (GetImmediateInterfacesOfType SkipUnrefInterfaces.Yes g amap m ty2) - supertypes |> List.tryFind (TypeFeasiblySubsumesType 0 g amap m ty1 NoCoerce) + let n2 = nullnessOfTy g ty2 + let nullify t = addNullnessToTy n2 t + + let supertypes = + Option.toList (GetSuperTypeOfType g amap m ty2) @ + (GetImmediateInterfacesOfType SkipUnrefInterfaces.Yes g amap m ty2) + + supertypes + |> List.tryFind (TypeFeasiblySubsumesType 0 g amap m ty1 NoCoerce) + |> Option.map nullify diff --git a/src/Compiler/Utilities/Activity.fs b/src/Compiler/Utilities/Activity.fs index b6fafe1c1b9..2403f00d3de 100644 --- a/src/Compiler/Utilities/Activity.fs +++ b/src/Compiler/Utilities/Activity.fs @@ -93,14 +93,14 @@ module internal Activity = let activity = activitySource.CreateActivity(name, ActivityKind.Internal) match activity with - | null -> activity + | null -> !!activity //TODO change retTy to |null after PR #18262 is merged!! | activity -> for key, value in tags do activity.AddTag(key, value) |> ignore activity.Start() - let startNoTags (name: string) : IDisposable = activitySource.StartActivity name + let startNoTags (name: string) : IDisposable = !! (activitySource.StartActivity name) //TODO change retTy to |null after PR #18262 is merged!! let addEvent name = match Activity.Current with @@ -122,7 +122,7 @@ module internal Activity = let private profiledSource = new ActivitySource(ActivityNames.ProfiledSourceName) - let startAndMeasureEnvironmentStats (name: string) : IDisposable = profiledSource.StartActivity(name) + let startAndMeasureEnvironmentStats (name: string) : IDisposable = !!(profiledSource.StartActivity(name)) //TODO change retTy to |null after PR #18262 is merged!! type private GCStats = int[] diff --git a/tests/FSharp.Compiler.ComponentTests/Language/Nullness/NullableReferenceTypesTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/Nullness/NullableReferenceTypesTests.fs index 7eec0ba8054..7dbe3527fbf 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/Nullness/NullableReferenceTypesTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/Nullness/NullableReferenceTypesTests.fs @@ -17,6 +17,20 @@ let typeCheckWithStrictNullness cu = |> withNullnessOptions |> typecheck +[] +let ``Warning on nullness hidden behind interface upcast`` () = + FSharp """module Test + +open System.IO +open System + +// This is bad - input is nullable, output is not = must warn +let whatisThis (s:Stream|null) : IDisposable = + s""" + |> asLibrary + |> typeCheckWithStrictNullness + |> shouldFail + |> withDiagnostics [Error 3261, Line 8, Col 5, Line 8, Col 6, "Nullness warning: The types 'IDisposable' and 'IDisposable | null' do not have compatible nullability."] [] let ``Report warning when applying anon record to a nullable generic return value`` () = From 1f9b0ce1da85aa2e7bbfc6112a595623e0cad7c7 Mon Sep 17 00:00:00 2001 From: Eugene Auduchinok Date: Tue, 4 Feb 2025 19:59:15 +0900 Subject: [PATCH 44/49] Cancellable: remove UsingToken usages in tests (#18276) * Remove Cancellable.UsingToken from tests The token is now always set inside the cancellable computation * Release notes --------- Co-authored-by: Kevin Ransom (msft) --- .../.FSharp.Compiler.Service/9.0.300.md | 1 + .../ModuleReaderCancellationTests.fs | 14 +++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md index 7b1942196b9..683c8dc0f5c 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md @@ -15,5 +15,6 @@ * FSharpCheckFileResults.ProjectContext.ProjectOptions will not be available when using the experimental Transparent Compiler feature. ([PR #18205](https://github.com/dotnet/fsharp/pull/18205)) * Update `Obsolete` attribute checking to account for `DiagnosticId` and `UrlFormat` properties. ([PR #18224](https://github.com/dotnet/fsharp/pull/18224)) +* Remove `Cancellable.UsingToken` from tests ([PR #18276](https://github.com/dotnet/fsharp/pull/18276)) ### Breaking Changes diff --git a/tests/FSharp.Compiler.Service.Tests/ModuleReaderCancellationTests.fs b/tests/FSharp.Compiler.Service.Tests/ModuleReaderCancellationTests.fs index 62e36de58b9..981c4dda14b 100644 --- a/tests/FSharp.Compiler.Service.Tests/ModuleReaderCancellationTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/ModuleReaderCancellationTests.fs @@ -22,7 +22,6 @@ let mutable private wasCancelled = false let runCancelFirstTime f = let mutable requestCount = 0 fun () -> - use _ = Cancellable.UsingToken cts.Token if requestCount = 0 then cts.Cancel() @@ -150,12 +149,17 @@ let referenceReaderProject getPreTypeDefs (cancelOnModuleAccess: bool) (options: let parseAndCheck path source options = cts <- new CancellationTokenSource() wasCancelled <- false - use _ = Cancellable.UsingToken cts.Token try - match Async.RunSynchronously(checker.ParseAndCheckFileInProject(path, 0, SourceText.ofString source, options), cancellationToken = cts.Token) with - | fileResults, FSharpCheckFileAnswer.Aborted -> None - | fileResults, FSharpCheckFileAnswer.Succeeded results -> Some results + let checkFileAsync = checker.ParseAndCheckFileInProject(path, 0, SourceText.ofString source, options) + let result = + match Async.RunSynchronously(checkFileAsync, cancellationToken = cts.Token) with + | _, FSharpCheckFileAnswer.Aborted -> None + | _, FSharpCheckFileAnswer.Succeeded results -> Some results + + Cancellable.HasCancellationToken |> shouldEqual false + result + with :? OperationCanceledException -> wasCancelled <- true None From 10b812b91e05da57c264660b1fe45a18cba3a38a Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Tue, 4 Feb 2025 14:03:01 +0100 Subject: [PATCH 45/49] Bugfix :: Flexible types should subsume nullable version of equivalent CoarcesTo constraints (#18266) --- .../.FSharp.Compiler.Service/9.0.300.md | 1 + src/Compiler/Checking/ConstraintSolver.fs | 18 ++++++++- .../Nullness/NullableReferenceTypesTests.fs | 40 ++++++++++++++++++- .../Signatures/SeqTests.fs | 16 ++++++++ 4 files changed, 73 insertions(+), 2 deletions(-) diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md index 683c8dc0f5c..de19496f010 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md @@ -1,6 +1,7 @@ ### Fixed * Fix Realsig+ generates nested closures with incorrect Generic ([Issue #17797](https://github.com/dotnet/fsharp/issues/17797), [PR #17877](https://github.com/dotnet/fsharp/pull/17877)) * Fix optimizer internal error for records with static fields ([Issue #18165](https://github.com/dotnet/fsharp/issues/18165), [PR #18280](https://github.com/dotnet/fsharp/pull/18280)) +* Fix nullness warning with flexible types ([Issue #18056](https://github.com/dotnet/fsharp/issues/18056), [PR #18266](https://github.com/dotnet/fsharp/pull/18266)) * Fix internal error when missing measure attribute in an unsolved measure typar. ([Issue #7491](https://github.com/dotnet/fsharp/issues/7491), [PR #18234](https://github.com/dotnet/fsharp/pull/18234)== * Set `Cancellable.token` from async computation ([Issue #18235](https://github.com/dotnet/fsharp/issues/18235), [PR #18238](https://github.com/dotnet/fsharp/pull/18238)) * Fix missing nullness warning when static upcast dropped nullness ([Issue #18232](https://github.com/dotnet/fsharp/issues/18232), [PR #18261](https://github.com/dotnet/fsharp/pull/18261)) diff --git a/src/Compiler/Checking/ConstraintSolver.fs b/src/Compiler/Checking/ConstraintSolver.fs index 82141080743..902bf331d85 100644 --- a/src/Compiler/Checking/ConstraintSolver.fs +++ b/src/Compiler/Checking/ConstraintSolver.fs @@ -1609,7 +1609,10 @@ and SolveTyparSubtypeOfType (csenv: ConstraintSolverEnv) ndeep m2 trace tp ty1 = elif isSealedTy g ty1 then SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace (mkTyparTy tp) ty1 else - AddConstraint csenv ndeep m2 trace tp (TyparConstraint.CoercesTo(ty1, csenv.m)) + if SubtypeConstraintImplied g tp.Constraints ty1 then + CompleteD + else + AddConstraint csenv ndeep m2 trace tp (TyparConstraint.CoercesTo(ty1, csenv.m)) and DepthCheck ndeep m = if ndeep > 300 then @@ -2490,6 +2493,19 @@ and CheckConstraintImplication (csenv: ConstraintSolverEnv) tpc1 tpc2 = and CheckConstraintsImplication csenv existingConstraints newConstraint = existingConstraints |> List.exists (fun tpc2 -> CheckConstraintImplication csenv tpc2 newConstraint) +and SubtypeConstraintImplied g existingConstraints newCoarceToTy = + if g.checkNullness then + let canBeNull t = (nullnessOfTy g t).Evaluate() = NullnessInfo.WithNull + let newTyIsWithoutNull = canBeNull newCoarceToTy |> not + let typeCoversNewConstraint existingTy = + typeEquiv g existingTy newCoarceToTy + && not (newTyIsWithoutNull && canBeNull existingTy) // :> T? cannot imply :>T, since non-nullable is a stricter constraint. + + existingConstraints + |> List.exists (function | TyparConstraint.CoercesTo(ty2,_) when typeCoversNewConstraint ty2 -> true | _ -> false) + else + false + // Ensure constraint conforms with existing constraints // NOTE: QUADRATIC and EnforceConstraintSetConsistency csenv ndeep m2 trace retry allCxs i cxs = diff --git a/tests/FSharp.Compiler.ComponentTests/Language/Nullness/NullableReferenceTypesTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/Nullness/NullableReferenceTypesTests.fs index 7dbe3527fbf..85b872d01a2 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/Nullness/NullableReferenceTypesTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/Nullness/NullableReferenceTypesTests.fs @@ -1003,7 +1003,45 @@ looseFunc(maybeTuple2) |> ignore Error 3261, Line 29, Col 12, Line 29, Col 19, "Nullness warning: The type 'MyDu | null' supports 'null' but a non-null type is expected." Error 3261, Line 30, Col 12, Line 30, Col 21, "Nullness warning: The type 'MyRecord | null' supports 'null' but a non-null type is expected." Error 43, Line 40, Col 36, Line 40, Col 40, "The type 'Maybe' does not have 'null' as a proper value"] - + + +[] +let ``Nullness support for flexible types`` () = + FSharp """module MyLibrary +open System +let dispose (x: IDisposable | null) : unit = + match x with + | null -> () + | d -> d.Dispose() + +let useThing (thing: #IDisposable) = + try + printfn "%O" thing + finally + dispose thing // Warning used to be here, should not warn! """ + |> asLibrary + |> typeCheckWithStrictNullness + |> shouldSucceed + +[] +let ``Nullness support for flexible types - opposite`` () = + FSharp """module MyLibrary +open System +let dispose (x: IDisposable) : unit = + x.Dispose() + +let useThing (thing: #IDisposable | null) = + try + printfn "%O" thing + finally + dispose thing // Warning should be here, because 'thing' can be null! + """ + |> asLibrary + |> typeCheckWithStrictNullness + |> shouldFail + |> withDiagnostics [Error 3261, Line 10, Col 17, Line 10, Col 22, "Nullness warning: The types 'IDisposable' and ''a | null' do not have compatible nullability."] + + [] let ``Static member on Record with null arg`` () = FSharp """module MyLibrary diff --git a/tests/FSharp.Compiler.ComponentTests/Signatures/SeqTests.fs b/tests/FSharp.Compiler.ComponentTests/Signatures/SeqTests.fs index 10a0d0b3a25..fdca6035783 100644 --- a/tests/FSharp.Compiler.ComponentTests/Signatures/SeqTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Signatures/SeqTests.fs @@ -2,6 +2,8 @@ open Xunit open Signatures.TestHelpers +open FSharp.Test +open FSharp.Test.Compiler [] let ``int seq`` () = @@ -14,3 +16,17 @@ let ``tuple seq`` () = assertSingleSignatureBinding "let s = seq { yield (1, 'b', 2.) }" "val s: (int * char * float) seq" + +[] +let ``seq transpose`` () = + let encodeFs = + FsSource """module Program +let transpose (source: seq<#seq<'T>>) = + source |> Seq.collect Seq.indexed |> Seq.groupBy fst |> Seq.map (snd >> (Seq.map snd))""" + + Fsi """module Program +val transpose: source: seq<'Collection> -> seq> when 'Collection :> seq<'T>""" + |> withAdditionalSourceFile encodeFs + |> withLangVersionPreview + |> compile + |> shouldSucceed From adb02dc702cf86ec1bfe4e14ef34e5dcfa6ee125 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Tue, 4 Feb 2025 14:03:31 +0100 Subject: [PATCH 46/49] Bugfix:: Add missing codegen for mapping of overlapped struct DU fields and read it in fslib reflection (#18274) --- .../.FSharp.Compiler.Service/9.0.300.md | 1 + docs/release-notes/.FSharp.Core/9.0.300.md | 8 + src/Compiler/AbstractIL/ilx.fsi | 2 + src/Compiler/CodeGen/IlxGen.fs | 47 +++++- src/Compiler/TypedTree/TypedTreeOps.fs | 3 - src/Compiler/TypedTree/TypedTreeOps.fsi | 2 - src/Compiler/Utilities/illib.fs | 8 + src/Compiler/Utilities/illib.fsi | 2 + src/FSharp.Core/prim-types.fs | 2 +- src/FSharp.Core/prim-types.fsi | 2 +- src/FSharp.Core/reflect.fs | 148 +++++++++--------- tests/AheadOfTime/Trimming/check.ps1 | 4 +- .../Types/UnionTypes/UnionStructTypes.fs | 71 +++++++++ .../FSharpReflection.fs | 18 ++- ...FSharp.Compiler.Service_Release_net9.0.bsl | 4 +- ...ompiler.Service_Release_netstandard2.0.bsl | 4 +- 16 files changed, 230 insertions(+), 96 deletions(-) create mode 100644 docs/release-notes/.FSharp.Core/9.0.300.md diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md index de19496f010..32ae2560ab0 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md @@ -19,3 +19,4 @@ * Remove `Cancellable.UsingToken` from tests ([PR #18276](https://github.com/dotnet/fsharp/pull/18276)) ### Breaking Changes +* Struct unions with overlapping fields now generate mappings needed for reading via reflection ([Issue #18121](https://github.com/dotnet/fsharp/issues/17797), [PR #18274](https://github.com/dotnet/fsharp/pull/17877)) \ No newline at end of file diff --git a/docs/release-notes/.FSharp.Core/9.0.300.md b/docs/release-notes/.FSharp.Core/9.0.300.md new file mode 100644 index 00000000000..87d3502539c --- /dev/null +++ b/docs/release-notes/.FSharp.Core/9.0.300.md @@ -0,0 +1,8 @@ +### Fixed + +### Added + +### Changed + +### Breaking Changes +* Struct unions with overlapping fields now generate mappings needed for reading via reflection ([Issue #18121](https://github.com/dotnet/fsharp/issues/17797), [PR #18274](https://github.com/dotnet/fsharp/pull/17877)). Previous versions of FSharp.Core returned incomplete mapping between fields and cases, these older fslib versions will now report an exception. diff --git a/src/Compiler/AbstractIL/ilx.fsi b/src/Compiler/AbstractIL/ilx.fsi index bb4a7344d84..28122885f8e 100644 --- a/src/Compiler/AbstractIL/ilx.fsi +++ b/src/Compiler/AbstractIL/ilx.fsi @@ -162,6 +162,8 @@ val mkILFormalCloRef: ILGenericParameterDefs -> IlxClosureRef -> useStaticField: // MS-ILX: Unions // -------------------------------------------------------------------- +val mkLowerName: nm: string -> string + val actualTypOfIlxUnionField: IlxUnionSpec -> int -> int -> ILType val mkILFreeVar: string * bool * ILType -> IlxClosureFreeVar diff --git a/src/Compiler/CodeGen/IlxGen.fs b/src/Compiler/CodeGen/IlxGen.fs index 861caeea4ab..ff0859486d7 100644 --- a/src/Compiler/CodeGen/IlxGen.fs +++ b/src/Compiler/CodeGen/IlxGen.fs @@ -601,6 +601,29 @@ let voidCheck m g permits ty = error (InternalError("System.Void unexpectedly detected in IL code generation. This should not occur.", m)) #endif +[] +type DuFieldCoordinates = { CaseIdx: int; FieldIdx: int } + +/// Structure for maintaining field reuse across struct unions +type UnionFieldReuseMap = MultiMap + +let unionFieldReuseMapping thisUnionTy (cases: UnionCase[]) : UnionFieldReuseMap = + + if not (isStructTyconRef thisUnionTy) then + Map.empty + else + let fieldKey (f: RecdField) = mkLowerName f.LogicalName + + [ + for i = 0 to cases.Length - 1 do + let fields = cases[i].RecdFieldsArray + + for j = 0 to fields.Length - 1 do + let f = fields[j] + yield fieldKey f, { CaseIdx = i; FieldIdx = j } + ] + |> MultiMap.ofList + /// When generating parameter and return types generate precise .NET IL pointer types. /// These can't be generated for generic instantiations, since .NET generics doesn't /// permit this. But for 'naked' values (locals, parameters, return values etc.) machine @@ -702,18 +725,24 @@ and GenTypeAux cenv m (tyenv: TypeReprEnv) voidOK ptrsOK ty = //-------------------------------------------------------------------------- // Generate ILX references to closures, classunions etc. given a tyenv //-------------------------------------------------------------------------- - -and GenUnionCaseRef (cenv: cenv) m tyenv i (fspecs: RecdField[]) = +and GenUnionCaseRef (cenv: cenv) m tyenv (reuseMap: UnionFieldReuseMap) i (fspecs: RecdField[]) = let g = cenv.g + let fieldMarker = int SourceConstructFlags.Field + fspecs |> Array.mapi (fun j fspec -> let ilFieldDef = mkILInstanceField (fspec.LogicalName, GenType cenv m tyenv fspec.FormalType, None, ILMemberAccess.Public) // These properties on the "field" of an alternative end up going on a property generated by cu_erase.fs - let attrs = - (mkCompilationMappingAttrWithVariantNumAndSeqNum g (int SourceConstructFlags.Field) i j) - :: GenAdditionalAttributesForTy g fspec.FormalType + let mappingAttrs = + match reuseMap |> MultiMap.find (mkLowerName fspec.LogicalName) with + | [] -> [ mkCompilationMappingAttrWithVariantNumAndSeqNum g fieldMarker i j ] + | mappings -> + mappings + |> List.map (fun m -> mkCompilationMappingAttrWithVariantNumAndSeqNum g fieldMarker m.CaseIdx m.FieldIdx) + + let attrs = mappingAttrs @ GenAdditionalAttributesForTy g fspec.FormalType IlxUnionCaseField(ilFieldDef.With(customAttrs = mkILCustomAttrs attrs))) @@ -731,13 +760,15 @@ and GenUnionRef (cenv: cenv) m (tcref: TyconRef) = match tcref.CompiledRepresentation with | CompiledTypeRepr.ILAsmOpen _ -> failwith "GenUnionRef m: unexpected ASM tyrep" | CompiledTypeRepr.ILAsmNamed(tref, _, _) -> + let fieldReuseMap = unionFieldReuseMapping tcref tycon.UnionCasesArray + let alternatives = tycon.UnionCasesArray |> Array.mapi (fun i cspec -> { altName = cspec.CompiledName altCustomAttrs = emptyILCustomAttrs - altFields = GenUnionCaseRef cenv m tyenvinner i cspec.RecdFieldsArray + altFields = GenUnionCaseRef cenv m tyenvinner fieldReuseMap i cspec.RecdFieldsArray }) let nullPermitted = IsUnionTypeWithNullAsTrueValue g tycon @@ -11658,11 +11689,13 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon: Tycon) : ILTypeRef option | _ -> false) -> let alternatives = + let fieldReuseMap = unionFieldReuseMapping tcref tycon.UnionCasesArray + tycon.UnionCasesArray |> Array.mapi (fun i ucspec -> { altName = ucspec.CompiledName - altFields = GenUnionCaseRef cenv m eenvinner.tyenv i ucspec.RecdFieldsArray + altFields = GenUnionCaseRef cenv m eenvinner.tyenv fieldReuseMap i ucspec.RecdFieldsArray altCustomAttrs = mkILCustomAttrs ( GenAttrs cenv eenv ucspec.Attribs diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index 909d6f437a8..ebe42db34fe 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -8337,9 +8337,6 @@ let IsMatchingSignatureDataVersionAttr (version: ILVersionInfo) cattr = warning(Failure(FSComp.SR.tastUnexpectedDecodeOfInterfaceDataVersionAttribute())) false -let mkCompilerGeneratedAttr (g: TcGlobals) n = - mkILCustomAttribute (tref_CompilationMappingAttr g, [mkILNonGenericValueTy (tref_SourceConstructFlags g)], [ILAttribElem.Int32 n], []) - //-------------------------------------------------------------------------- // tupled lambda --> method/function with a given valReprInfo specification. // diff --git a/src/Compiler/TypedTree/TypedTreeOps.fsi b/src/Compiler/TypedTree/TypedTreeOps.fsi index 3bca5cdb21e..3a4a1ca4c0a 100755 --- a/src/Compiler/TypedTree/TypedTreeOps.fsi +++ b/src/Compiler/TypedTree/TypedTreeOps.fsi @@ -2380,8 +2380,6 @@ val mkCompilationSourceNameAttr: TcGlobals -> string -> ILAttribute val mkSignatureDataVersionAttr: TcGlobals -> ILVersionInfo -> ILAttribute -val mkCompilerGeneratedAttr: TcGlobals -> int -> ILAttribute - //------------------------------------------------------------------------- // More common type construction //------------------------------------------------------------------------- diff --git a/src/Compiler/Utilities/illib.fs b/src/Compiler/Utilities/illib.fs index 5e32e3b8699..9ed400f3ab8 100644 --- a/src/Compiler/Utilities/illib.fs +++ b/src/Compiler/Utilities/illib.fs @@ -1307,6 +1307,14 @@ module MultiMap = let initBy f xs : MultiMap<_, _> = xs |> Seq.groupBy f |> Seq.map (fun (k, v) -> (k, List.ofSeq v)) |> Map.ofSeq + let ofList (xs: ('a * 'b) list) : MultiMap<'a,'b> = + (Map.empty, xs) + ||> List.fold (fun m (k, v) -> + m |> Map.change k (function + | None -> Some [v] + | Some vs -> Some (v :: vs))) + |> Map.map (fun _ values -> List.rev values) + type LayeredMap<'Key, 'Value when 'Key: comparison> = Map<'Key, 'Value> [] diff --git a/src/Compiler/Utilities/illib.fsi b/src/Compiler/Utilities/illib.fsi index 03525593188..2b23de7de2e 100644 --- a/src/Compiler/Utilities/illib.fsi +++ b/src/Compiler/Utilities/illib.fsi @@ -570,6 +570,8 @@ module internal MultiMap = val initBy: f: ('a -> 'b) -> xs: seq<'a> -> MultiMap<'b, 'a> when 'b: comparison + val ofList: xs: ('a * 'b) list -> MultiMap<'a,'b> when 'a: comparison + type internal LayeredMap<'Key, 'Value when 'Key: comparison> = Map<'Key, 'Value> [] diff --git a/src/FSharp.Core/prim-types.fs b/src/FSharp.Core/prim-types.fs index 7f1b0a122ad..1fc9e799ab4 100644 --- a/src/FSharp.Core/prim-types.fs +++ b/src/FSharp.Core/prim-types.fs @@ -221,7 +221,7 @@ namespace Microsoft.FSharp.Core member _.Minor = minor member _.Release = release - [] + [] [] type CompilationMappingAttribute(sourceConstructFlags:SourceConstructFlags, variantNumber:int, diff --git a/src/FSharp.Core/prim-types.fsi b/src/FSharp.Core/prim-types.fsi index a992a0204e0..15326559354 100644 --- a/src/FSharp.Core/prim-types.fsi +++ b/src/FSharp.Core/prim-types.fsi @@ -657,7 +657,7 @@ namespace Microsoft.FSharp.Core /// their original forms. It is not intended for use from user code. /// /// Attributes - [] + [] [] type CompilationMappingAttribute = inherit Attribute diff --git a/src/FSharp.Core/reflect.fs b/src/FSharp.Core/reflect.fs index f8c8e57d695..32811ae604c 100644 --- a/src/FSharp.Core/reflect.fs +++ b/src/FSharp.Core/reflect.fs @@ -266,108 +266,103 @@ module internal Impl = //----------------------------------------------------------------- // ATTRIBUTE DECOMPILATION - let tryFindCompilationMappingAttribute (attrs: obj array) = + let findCompilationMappingAttributeAllowMultiple (attrs: obj array) = match attrs with - | null - | [||] -> None - | [| res |] -> - let a = (res :?> CompilationMappingAttribute) - Some(a.SourceConstructFlags, a.SequenceNumber, a.VariantNumber) - | _ -> invalidOp (SR.GetString(SR.multipleCompilationMappings)) - - let findCompilationMappingAttribute (attrs: obj array) = - match tryFindCompilationMappingAttribute attrs with - | None -> failwith "no compilation mapping attribute" - | Some a -> a + | null -> [||] + | attrs -> + attrs + |> Array.map (fun res -> + let a = (res :?> CompilationMappingAttribute) + (a.SourceConstructFlags, a.SequenceNumber, a.VariantNumber)) let cmaName = typeof.FullName let assemblyName = typeof.Assembly.GetName().Name let _ = assert (assemblyName = "FSharp.Core") - let tryFindCompilationMappingAttributeFromData (attrs: IList) = + let findCompilationMappingAttributeFromDataAllowMultiple (attrs: IList) = match attrs with - | null -> None + | null -> [||] | _ -> - let mutable res = None - - for a in attrs do - if a.Constructor.DeclaringType.FullName = cmaName then - let args = a.ConstructorArguments - - let flags = - match args.Count with - | 1 -> - let arg0 = args.[0] - let v0 = arg0.Value :?> SourceConstructFlags - (v0, 0, 0) - | 2 -> - let arg0 = args.[0] - let v0 = arg0.Value :?> SourceConstructFlags - let arg1 = args.[1] - let v1 = arg1.Value :?> int - (v0, v1, 0) - | 3 -> - let arg0 = args.[0] - let v0 = arg0.Value :?> SourceConstructFlags - let arg1 = args.[1] - let v1 = arg1.Value :?> int - let arg2 = args.[2] - let v2 = arg2.Value :?> int - (v0, v1, v2) - | _ -> (enum 0, 0, 0) - - res <- Some flags - - res - - let findCompilationMappingAttributeFromData attrs = - match tryFindCompilationMappingAttributeFromData attrs with - | None -> failwith "no compilation mapping attribute" - | Some a -> a + let filtered = + attrs + |> Array.ofSeq + |> Array.filter (fun a -> a.Constructor.DeclaringType.FullName = cmaName) + + filtered + |> Array.map (fun a -> + let args = a.ConstructorArguments + + match args.Count with + | 1 -> + let arg0 = args.[0] + let v0 = arg0.Value :?> SourceConstructFlags + (v0, 0, 0) + | 2 -> + let arg0 = args.[0] + let v0 = arg0.Value :?> SourceConstructFlags + let arg1 = args.[1] + let v1 = arg1.Value :?> int + (v0, v1, 0) + | 3 -> + let arg0 = args.[0] + let v0 = arg0.Value :?> SourceConstructFlags + let arg1 = args.[1] + let v1 = arg1.Value :?> int + let arg2 = args.[2] + let v2 = arg2.Value :?> int + (v0, v1, v2) + | _ -> (enum 0, 0, 0)) let tryFindCompilationMappingAttributeFromType (typ: Type) = let assem = typ.Assembly if (not (isNull assem)) && assem.ReflectionOnly then - tryFindCompilationMappingAttributeFromData (typ.GetCustomAttributesData()) - else - tryFindCompilationMappingAttribute (typ.GetCustomAttributes(typeof, false)) - - let tryFindCompilationMappingAttributeFromMemberInfo (info: MemberInfo) = - let assem = info.DeclaringType.Assembly - - if (not (isNull assem)) && assem.ReflectionOnly then - tryFindCompilationMappingAttributeFromData (info.GetCustomAttributesData()) + findCompilationMappingAttributeFromDataAllowMultiple (typ.GetCustomAttributesData()) else - tryFindCompilationMappingAttribute (info.GetCustomAttributes(typeof, false)) + findCompilationMappingAttributeAllowMultiple ( + typ.GetCustomAttributes(typeof, false) + ) let findCompilationMappingAttributeFromMemberInfo (info: MemberInfo) = let assem = info.DeclaringType.Assembly if (not (isNull assem)) && assem.ReflectionOnly then - findCompilationMappingAttributeFromData (info.GetCustomAttributesData()) + findCompilationMappingAttributeFromDataAllowMultiple (info.GetCustomAttributesData()) else - findCompilationMappingAttribute (info.GetCustomAttributes(typeof, false)) + findCompilationMappingAttributeAllowMultiple ( + info.GetCustomAttributes(typeof, false) + ) let sequenceNumberOfMember (x: MemberInfo) = - let (_, n, _) = findCompilationMappingAttributeFromMemberInfo x in n + let (_, n, _) = findCompilationMappingAttributeFromMemberInfo x |> Array.head + n + + let sequenceNumberOfUnionCaseField (x: MemberInfo) caseTag = + findCompilationMappingAttributeFromMemberInfo x + |> Array.tryFind (fun (_, _, vn) -> vn = caseTag) + |> Option.map (fun (_, sn, _) -> sn) + |> Option.defaultValue Int32.MaxValue - let variantNumberOfMember (x: MemberInfo) = - let (_, _, vn) = findCompilationMappingAttributeFromMemberInfo x in vn + let belongsToCase (x: MemberInfo) caseTag = + findCompilationMappingAttributeFromMemberInfo x + |> Array.exists (fun (_, _, vn) -> vn = caseTag) let sortFreshArray f arr = Array.sortInPlaceWith f arr arr let isFieldProperty (prop: PropertyInfo) = - match tryFindCompilationMappingAttributeFromMemberInfo prop with - | None -> false - | Some(flags, _n, _vn) -> (flags &&& SourceConstructFlags.KindMask) = SourceConstructFlags.Field + match findCompilationMappingAttributeFromMemberInfo prop with + | [||] -> false + | arr -> + let (flags, _, _) = arr |> Array.head + (flags &&& SourceConstructFlags.KindMask) = SourceConstructFlags.Field let tryFindSourceConstructFlagsOfType (typ: Type) = match tryFindCompilationMappingAttributeFromType typ with - | None -> None - | Some(flags, _n, _vn) -> Some flags + | [||] -> None + | [| flags, _n, _vn |] -> Some flags + | _ -> invalidOp (SR.GetString(SR.multipleCompilationMappings)) //----------------------------------------------------------------- // UNION DECOMPILATION @@ -379,9 +374,11 @@ module internal Impl = | null -> typ.GetMethods(staticMethodFlags ||| bindingFlags) |> Array.choose (fun minfo -> - match tryFindCompilationMappingAttributeFromMemberInfo minfo with - | None -> None - | Some(flags, n, _vn) -> + match findCompilationMappingAttributeFromMemberInfo minfo with + | [||] -> None + | arr -> + let (flags, n, _) = arr |> Array.head + if (flags &&& SourceConstructFlags.KindMask) = SourceConstructFlags.UnionCase then let nm = minfo.Name // chop "get_" or "New" off the front @@ -510,8 +507,9 @@ module internal Impl = caseTyp.GetProperties(instancePropertyFlags ||| bindingFlags) |> Array.filter isFieldProperty - |> Array.filter (fun prop -> variantNumberOfMember prop = tag) - |> sortFreshArray (fun p1 p2 -> compare (sequenceNumberOfMember p1) (sequenceNumberOfMember p2)) + |> Array.filter (fun prop -> belongsToCase prop tag) + |> sortFreshArray (fun p1 p2 -> + compare (sequenceNumberOfUnionCaseField p1 tag) (sequenceNumberOfUnionCaseField p2 tag)) let getUnionCaseRecordReader (typ: Type, tag: int, bindingFlags) = let props = fieldsPropsOfUnionCase (typ, tag, bindingFlags) diff --git a/tests/AheadOfTime/Trimming/check.ps1 b/tests/AheadOfTime/Trimming/check.ps1 index b1380ede186..50a8a9e6422 100644 --- a/tests/AheadOfTime/Trimming/check.ps1 +++ b/tests/AheadOfTime/Trimming/check.ps1 @@ -43,7 +43,7 @@ function CheckTrim($root, $tfm, $outputfile, $expected_len) { # error NETSDK1124: Trimming assemblies requires .NET Core 3.0 or higher. # Check net7.0 trimmed assemblies -CheckTrim -root "SelfContained_Trimming_Test" -tfm "net9.0" -outputfile "FSharp.Core.dll" -expected_len 299008 +CheckTrim -root "SelfContained_Trimming_Test" -tfm "net9.0" -outputfile "FSharp.Core.dll" -expected_len 300032 # Check net8.0 trimmed assemblies -CheckTrim -root "StaticLinkedFSharpCore_Trimming_Test" -tfm "net9.0" -outputfile "StaticLinkedFSharpCore_Trimming_Test.dll" -expected_len 9149952 +CheckTrim -root "StaticLinkedFSharpCore_Trimming_Test" -tfm "net9.0" -outputfile "StaticLinkedFSharpCore_Trimming_Test.dll" -expected_len 9150976 diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/UnionTypes/UnionStructTypes.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/UnionTypes/UnionStructTypes.fs index b3801e113f5..0ec6dc99632 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/UnionTypes/UnionStructTypes.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/UnionTypes/UnionStructTypes.fs @@ -805,6 +805,77 @@ printf $"{result1};{result2}" |> run |> verifyOutput "333;666" + [] + let ``Struct DU with field overlap can be reflected`` () = + Fsx """module Test +open Microsoft.FSharp.Reflection + +[] +type MySharedStructDu = + | A of a:int64 + | B of a:int64 + | C of a:int64 * s:char + | D of s:char * a:int64 + +printf "Size=%i;" (sizeof) +for value in [A 1L; B 2L;D('x',3L)] do + let caseInfo, inner = FSharpValue.GetUnionFields(value, typeof) + printf $"%s{caseInfo.Name}=%A{inner};" + + """ + |> asExe + |> compile + |> shouldSucceed + |> run + |> verifyOutput """Size=16;A=[|1L|];B=[|2L|];D=[|'x'; 3L|];""" + + [] + let ``Field overlap does carry attributes for all cases`` () = + Fsx """module Test + +[] +type MySharedStructDu = + | A of a:int64 + | B of a:int64 + | C of a:int64 * s:char + | D of s:char * a:int64 + + """ + |> asLibrary + |> compile + |> verifyIL [ // Prop "a" is mapped 4x, for cases 0,1,2,3. For case 3/D, it comes at position one. Prop "s" is mapped to two cases. + """ + .property instance int64 a() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32, + int32) = ( 01 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32, + int32) = ( 01 00 04 00 00 00 01 00 00 00 00 00 00 00 00 00 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32, + int32) = ( 01 00 04 00 00 00 02 00 00 00 00 00 00 00 00 00 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32, + int32) = ( 01 00 04 00 00 00 03 00 00 00 01 00 00 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 ) + .get instance int64 Test/MySharedStructDu::get_a() + } + .property instance char s() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32, + int32) = ( 01 00 04 00 00 00 02 00 00 00 01 00 00 00 00 00 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32, + int32) = ( 01 00 04 00 00 00 03 00 00 00 00 00 00 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 ) + .get instance char Test/MySharedStructDu::get_s() + } """ ] + [] let ``Custom ValueOption keeps working`` () = Fsx """ diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Reflection/FSharpReflection.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Reflection/FSharpReflection.fs index 95de124e9f5..56fd8a0a1b1 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Reflection/FSharpReflection.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Reflection/FSharpReflection.fs @@ -51,10 +51,12 @@ type DiscUnionType<'T> = | B of 'T * DiscUnionType<'T> option | C of float * string +[] type DiscStructUnionType<'T> = | A // No data associated with tag | B of 'T - | C of float * string + | Evil_C of f:float // This is sharing the field "f" in the struct + | C of f:float * s:string exception ExceptionInt of int @@ -1204,6 +1206,11 @@ type UnionCaseInfoTests() = let ((discUnionInfoC:UnionCaseInfo), discvaluearray) = FSharpValue.GetUnionFields(discUniontypeC, typeof>) let ((recDiscCaseinfo:UnionCaseInfo), recDiscCasevaluearray) = FSharpValue.GetUnionFields(recDiscUniontypeB, typeof>) + + let ((sharedstructUnionInfoA:UnionCaseInfo), _) = FSharpValue.GetUnionFields(DiscStructUnionType.A, typeof>) + let ((sharedstructUnionInfoB:UnionCaseInfo), _) = FSharpValue.GetUnionFields(DiscStructUnionType.B(15), typeof>) + let ((sharedstructUnionInfoC:UnionCaseInfo), _) = FSharpValue.GetUnionFields(DiscStructUnionType.C(15.,"x"), typeof>) + let ((sharedstructUnionInfoEvilC:UnionCaseInfo), _) = FSharpValue.GetUnionFields(DiscStructUnionType.Evil_C(15.), typeof>) [] member _.Equals() = @@ -1266,6 +1273,15 @@ type UnionCaseInfoTests() = // rec disc union let recdiscFieldInfo = (recDiscCaseinfo.GetFields()).[0] Assert.AreEqual(recdiscFieldInfo.PropertyType , typeof) + + + Assert.AreEqual(sharedstructUnionInfoA.GetFields().Length ,0) + Assert.AreEqual(sharedstructUnionInfoB.GetFields().[0].PropertyType ,typeof) + + Assert.AreEqual(sharedstructUnionInfoC.GetFields().[0].PropertyType ,typeof) + Assert.AreEqual(sharedstructUnionInfoC.GetFields().[1].PropertyType ,typeof) + + Assert.AreEqual(sharedstructUnionInfoEvilC.GetFields().[0].PropertyType ,typeof) [] member _.GetHashCode() = diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl index 1a088c5a702..bc7e03d8154 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl @@ -43,8 +43,8 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.ParseAndCheckInputs+CheckMultipleInputsUsingGraphMode@1865::Invoke(int32)][offset 0x0000003A][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerConfig+TcConfig::.ctor([FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, bool)][offset 0x0000059C][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerConfig+TcConfig::.ctor([FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, bool)][offset 0x000005A5][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.IlxGen::HashRangeSorted([S.P.CoreLib]System.Collections.Generic.IDictionary`2>)][offset 0x00000011][found ref '[FSharp.Compiler.Service]FSharp.Compiler.IlxGen+HashRangeSorted@1859-1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,int32>'] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.IlxGen::HashRangeSorted([S.P.CoreLib]System.Collections.Generic.IDictionary`2>)][offset 0x00000012][found ref '[FSharp.Compiler.Service]FSharp.Compiler.IlxGen+HashRangeSorted@1859'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,T0>'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.IlxGen::HashRangeSorted([S.P.CoreLib]System.Collections.Generic.IDictionary`2>)][offset 0x00000011][found ref '[FSharp.Compiler.Service]FSharp.Compiler.IlxGen+HashRangeSorted@1890-1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,int32>'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.IlxGen::HashRangeSorted([S.P.CoreLib]System.Collections.Generic.IDictionary`2>)][offset 0x00000012][found ref '[FSharp.Compiler.Service]FSharp.Compiler.IlxGen+HashRangeSorted@1890'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,T0>'] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.PatternMatchCompilation::isProblematicClause([FSharp.Compiler.Service]FSharp.Compiler.PatternMatchCompilation+MatchClause)][offset 0x00000040][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$FSharp.Compiler.PatternMatchCompilation::.cctor()][offset 0x0000000B][found Boolean] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.TypeProviders::ValidateExpectedName([FSharp.Compiler.Service]FSharp.Compiler.Text.Range, string[], string, [FSharp.Compiler.Service]FSharp.Compiler.Tainted`1)][offset 0x000000A8][found Char] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl index 48af8ec2f2f..88e5b423f24 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl @@ -61,8 +61,8 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerImports+TcConfig-TryResolveLibWithDirectories@558-1::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x0000003B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerConfig+TcConfig::.ctor([FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, bool)][offset 0x0000059C][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerConfig+TcConfig::.ctor([FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, bool)][offset 0x000005A5][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.IlxGen::HashRangeSorted([S.P.CoreLib]System.Collections.Generic.IDictionary`2>)][offset 0x00000011][found ref '[FSharp.Compiler.Service]FSharp.Compiler.IlxGen+HashRangeSorted@1859-1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,int32>'] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.IlxGen::HashRangeSorted([S.P.CoreLib]System.Collections.Generic.IDictionary`2>)][offset 0x00000012][found ref '[FSharp.Compiler.Service]FSharp.Compiler.IlxGen+HashRangeSorted@1859'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,T0>'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.IlxGen::HashRangeSorted([S.P.CoreLib]System.Collections.Generic.IDictionary`2>)][offset 0x00000011][found ref '[FSharp.Compiler.Service]FSharp.Compiler.IlxGen+HashRangeSorted@1890-1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,int32>'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.IlxGen::HashRangeSorted([S.P.CoreLib]System.Collections.Generic.IDictionary`2>)][offset 0x00000012][found ref '[FSharp.Compiler.Service]FSharp.Compiler.IlxGen+HashRangeSorted@1890'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,T0>'] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.PatternMatchCompilation::isProblematicClause([FSharp.Compiler.Service]FSharp.Compiler.PatternMatchCompilation+MatchClause)][offset 0x00000040][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$FSharp.Compiler.PatternMatchCompilation::.cctor()][offset 0x0000000B][found Boolean] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.NicePrint+TastDefinitionPrinting+meths@2092-3::Invoke([FSharp.Compiler.Service]FSharp.Compiler.Infos+MethInfo)][offset 0x000000B3][found Char] Unexpected type on the stack. From 5ef029b5b6e5a8ad8ac62054ffdad94a1cf93ffc Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Wed, 5 Feb 2025 10:47:22 +0100 Subject: [PATCH 47/49] Add missing project reference from FSharpSuite to fsc project (#18291) * Add missing project reference from FSharpSuite to fsc project * fix --- tests/fsharp/FSharpSuite.Tests.fsproj | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/fsharp/FSharpSuite.Tests.fsproj b/tests/fsharp/FSharpSuite.Tests.fsproj index 753af0ce4aa..fdbec7e88a6 100644 --- a/tests/fsharp/FSharpSuite.Tests.fsproj +++ b/tests/fsharp/FSharpSuite.Tests.fsproj @@ -113,6 +113,9 @@ + + false + From 674e099690a8b20c40901ee8151ef2066cf04f92 Mon Sep 17 00:00:00 2001 From: Eugene Auduchinok Date: Wed, 5 Feb 2025 18:49:16 +0900 Subject: [PATCH 48/49] Symbols: Add FSharpAssembly.IsFSharp (#18290) * Symbols: add FSharpAssembly.IsFSharp * Surface area * Release notes --- .../.FSharp.Compiler.Service/9.0.300.md | 1 + src/Compiler/Symbols/Symbols.fs | 2 ++ src/Compiler/Symbols/Symbols.fsi | 3 +++ ...ervice.SurfaceArea.netstandard20.debug.bsl | 20 ++++++++++--------- ...vice.SurfaceArea.netstandard20.release.bsl | 20 ++++++++++--------- 5 files changed, 28 insertions(+), 18 deletions(-) diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md index 32ae2560ab0..368513722c9 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md @@ -11,6 +11,7 @@ ### Added * Added missing type constraints in FCS. ([PR #18241](https://github.com/dotnet/fsharp/pull/18241)) * The 'use' keyword can be used on IDisposable|null without nullness warnings ([PR #18262](https://github.com/dotnet/fsharp/pull/18262)) +* Symbols: Add FSharpAssembly.IsFSharp ([PR #18290](https://github.com/dotnet/fsharp/pull/18290)) ### Changed diff --git a/src/Compiler/Symbols/Symbols.fs b/src/Compiler/Symbols/Symbols.fs index 470327f59cd..f12e9de6321 100644 --- a/src/Compiler/Symbols/Symbols.fs +++ b/src/Compiler/Symbols/Symbols.fs @@ -2991,6 +2991,8 @@ type FSharpAssembly internal (cenv, ccu: CcuThunk) = member _.SimpleName = ccu.AssemblyName + member _.IsFSharp = ccu.IsFSharp + #if !NO_TYPEPROVIDERS member _.IsProviderGenerated = ccu.IsProviderGenerated #endif diff --git a/src/Compiler/Symbols/Symbols.fsi b/src/Compiler/Symbols/Symbols.fsi index 49742673d58..a3eda6ecd3a 100644 --- a/src/Compiler/Symbols/Symbols.fsi +++ b/src/Compiler/Symbols/Symbols.fsi @@ -159,6 +159,9 @@ type FSharpAssembly = /// The simple name for the assembly member SimpleName: string + + member IsFSharp: bool + #if !NO_TYPEPROVIDERS /// Indicates if the assembly was generated by a type provider and is due for static linking member IsProviderGenerated: bool diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl index e85b3022c96..198dcde56b2 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl @@ -2836,6 +2836,10 @@ FSharp.Compiler.Diagnostics.ExtendedData+FieldNotContainedDiagnosticExtendedData FSharp.Compiler.Diagnostics.ExtendedData+FieldNotContainedDiagnosticExtendedData: FSharp.Compiler.Symbols.FSharpField SignatureField FSharp.Compiler.Diagnostics.ExtendedData+FieldNotContainedDiagnosticExtendedData: FSharp.Compiler.Symbols.FSharpField get_ImplementationField() FSharp.Compiler.Diagnostics.ExtendedData+FieldNotContainedDiagnosticExtendedData: FSharp.Compiler.Symbols.FSharpField get_SignatureField() +FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: System.String DiagnosticId +FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: System.String UrlFormat +FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: System.String get_DiagnosticId() +FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: System.String get_UrlFormat() FSharp.Compiler.Diagnostics.ExtendedData+TypeMismatchDiagnosticExtendedData: DiagnosticContextInfo ContextInfo FSharp.Compiler.Diagnostics.ExtendedData+TypeMismatchDiagnosticExtendedData: DiagnosticContextInfo get_ContextInfo() FSharp.Compiler.Diagnostics.ExtendedData+TypeMismatchDiagnosticExtendedData: FSharp.Compiler.Symbols.FSharpDisplayContext DisplayContext @@ -2854,13 +2858,9 @@ FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedDa FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+ExpressionIsAFunctionExtendedData FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+FieldNotContainedDiagnosticExtendedData FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+IFSharpDiagnosticExtendedData +FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+TypeMismatchDiagnosticExtendedData FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+ValueNotContainedDiagnosticExtendedData -FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: System.String DiagnosticId -FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: System.String UrlFormat -FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: System.String get_DiagnosticId() -FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: System.String get_UrlFormat() -FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData FSharp.Compiler.Diagnostics.FSharpDiagnostic: FSharp.Compiler.Diagnostics.FSharpDiagnostic Create(FSharp.Compiler.Diagnostics.FSharpDiagnosticSeverity, System.String, Int32, FSharp.Compiler.Text.Range, Microsoft.FSharp.Core.FSharpOption`1[System.String], Microsoft.FSharp.Core.FSharpOption`1[System.String]) FSharp.Compiler.Diagnostics.FSharpDiagnostic: FSharp.Compiler.Diagnostics.FSharpDiagnosticSeverity Severity FSharp.Compiler.Diagnostics.FSharpDiagnostic: FSharp.Compiler.Diagnostics.FSharpDiagnosticSeverity get_Severity() @@ -5102,7 +5102,9 @@ FSharp.Compiler.Symbols.FSharpAnonRecordTypeDetails: System.String CompiledName FSharp.Compiler.Symbols.FSharpAnonRecordTypeDetails: System.String get_CompiledName() FSharp.Compiler.Symbols.FSharpAnonRecordTypeDetails: System.String[] SortedFieldNames FSharp.Compiler.Symbols.FSharpAnonRecordTypeDetails: System.String[] get_SortedFieldNames() +FSharp.Compiler.Symbols.FSharpAssembly: Boolean IsFSharp FSharp.Compiler.Symbols.FSharpAssembly: Boolean IsProviderGenerated +FSharp.Compiler.Symbols.FSharpAssembly: Boolean get_IsFSharp() FSharp.Compiler.Symbols.FSharpAssembly: Boolean get_IsProviderGenerated() FSharp.Compiler.Symbols.FSharpAssembly: FSharp.Compiler.Symbols.FSharpAssemblySignature Contents FSharp.Compiler.Symbols.FSharpAssembly: FSharp.Compiler.Symbols.FSharpAssemblySignature get_Contents() @@ -5390,6 +5392,7 @@ FSharp.Compiler.Symbols.FSharpGenericParameter: System.Collections.Generic.IList FSharp.Compiler.Symbols.FSharpGenericParameter: System.String Name FSharp.Compiler.Symbols.FSharpGenericParameter: System.String ToString() FSharp.Compiler.Symbols.FSharpGenericParameter: System.String get_Name() +FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean IsAllowsRefStructConstraint FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean IsCoercesToConstraint FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean IsComparisonConstraint FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean IsDefaultsToConstraint @@ -5398,13 +5401,13 @@ FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean IsEnumConstrai FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean IsEqualityConstraint FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean IsMemberConstraint FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean IsNonNullableValueTypeConstraint +FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean IsNotSupportsNullConstraint FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean IsReferenceTypeConstraint FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean IsRequiresDefaultConstructorConstraint FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean IsSimpleChoiceConstraint FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean IsSupportsNullConstraint FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean IsUnmanagedConstraint -FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean IsNotSupportsNullConstraint -FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean IsAllowsRefStructConstraint +FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean get_IsAllowsRefStructConstraint() FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean get_IsCoercesToConstraint() FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean get_IsComparisonConstraint() FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean get_IsDefaultsToConstraint() @@ -5413,13 +5416,12 @@ FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean get_IsEnumCons FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean get_IsEqualityConstraint() FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean get_IsMemberConstraint() FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean get_IsNonNullableValueTypeConstraint() +FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean get_IsNotSupportsNullConstraint() FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean get_IsReferenceTypeConstraint() FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean get_IsRequiresDefaultConstructorConstraint() FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean get_IsSimpleChoiceConstraint() FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean get_IsSupportsNullConstraint() FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean get_IsUnmanagedConstraint() -FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean get_IsNotSupportsNullConstraint() -FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean get_IsAllowsRefStructConstraint() FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: FSharp.Compiler.Symbols.FSharpGenericParameterDefaultsToConstraint DefaultsToConstraintData FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: FSharp.Compiler.Symbols.FSharpGenericParameterDefaultsToConstraint get_DefaultsToConstraintData() FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: FSharp.Compiler.Symbols.FSharpGenericParameterDelegateConstraint DelegateConstraintData diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl index e85b3022c96..198dcde56b2 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl @@ -2836,6 +2836,10 @@ FSharp.Compiler.Diagnostics.ExtendedData+FieldNotContainedDiagnosticExtendedData FSharp.Compiler.Diagnostics.ExtendedData+FieldNotContainedDiagnosticExtendedData: FSharp.Compiler.Symbols.FSharpField SignatureField FSharp.Compiler.Diagnostics.ExtendedData+FieldNotContainedDiagnosticExtendedData: FSharp.Compiler.Symbols.FSharpField get_ImplementationField() FSharp.Compiler.Diagnostics.ExtendedData+FieldNotContainedDiagnosticExtendedData: FSharp.Compiler.Symbols.FSharpField get_SignatureField() +FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: System.String DiagnosticId +FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: System.String UrlFormat +FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: System.String get_DiagnosticId() +FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: System.String get_UrlFormat() FSharp.Compiler.Diagnostics.ExtendedData+TypeMismatchDiagnosticExtendedData: DiagnosticContextInfo ContextInfo FSharp.Compiler.Diagnostics.ExtendedData+TypeMismatchDiagnosticExtendedData: DiagnosticContextInfo get_ContextInfo() FSharp.Compiler.Diagnostics.ExtendedData+TypeMismatchDiagnosticExtendedData: FSharp.Compiler.Symbols.FSharpDisplayContext DisplayContext @@ -2854,13 +2858,9 @@ FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedDa FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+ExpressionIsAFunctionExtendedData FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+FieldNotContainedDiagnosticExtendedData FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+IFSharpDiagnosticExtendedData +FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+TypeMismatchDiagnosticExtendedData FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+ValueNotContainedDiagnosticExtendedData -FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: System.String DiagnosticId -FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: System.String UrlFormat -FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: System.String get_DiagnosticId() -FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: System.String get_UrlFormat() -FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData FSharp.Compiler.Diagnostics.FSharpDiagnostic: FSharp.Compiler.Diagnostics.FSharpDiagnostic Create(FSharp.Compiler.Diagnostics.FSharpDiagnosticSeverity, System.String, Int32, FSharp.Compiler.Text.Range, Microsoft.FSharp.Core.FSharpOption`1[System.String], Microsoft.FSharp.Core.FSharpOption`1[System.String]) FSharp.Compiler.Diagnostics.FSharpDiagnostic: FSharp.Compiler.Diagnostics.FSharpDiagnosticSeverity Severity FSharp.Compiler.Diagnostics.FSharpDiagnostic: FSharp.Compiler.Diagnostics.FSharpDiagnosticSeverity get_Severity() @@ -5102,7 +5102,9 @@ FSharp.Compiler.Symbols.FSharpAnonRecordTypeDetails: System.String CompiledName FSharp.Compiler.Symbols.FSharpAnonRecordTypeDetails: System.String get_CompiledName() FSharp.Compiler.Symbols.FSharpAnonRecordTypeDetails: System.String[] SortedFieldNames FSharp.Compiler.Symbols.FSharpAnonRecordTypeDetails: System.String[] get_SortedFieldNames() +FSharp.Compiler.Symbols.FSharpAssembly: Boolean IsFSharp FSharp.Compiler.Symbols.FSharpAssembly: Boolean IsProviderGenerated +FSharp.Compiler.Symbols.FSharpAssembly: Boolean get_IsFSharp() FSharp.Compiler.Symbols.FSharpAssembly: Boolean get_IsProviderGenerated() FSharp.Compiler.Symbols.FSharpAssembly: FSharp.Compiler.Symbols.FSharpAssemblySignature Contents FSharp.Compiler.Symbols.FSharpAssembly: FSharp.Compiler.Symbols.FSharpAssemblySignature get_Contents() @@ -5390,6 +5392,7 @@ FSharp.Compiler.Symbols.FSharpGenericParameter: System.Collections.Generic.IList FSharp.Compiler.Symbols.FSharpGenericParameter: System.String Name FSharp.Compiler.Symbols.FSharpGenericParameter: System.String ToString() FSharp.Compiler.Symbols.FSharpGenericParameter: System.String get_Name() +FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean IsAllowsRefStructConstraint FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean IsCoercesToConstraint FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean IsComparisonConstraint FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean IsDefaultsToConstraint @@ -5398,13 +5401,13 @@ FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean IsEnumConstrai FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean IsEqualityConstraint FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean IsMemberConstraint FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean IsNonNullableValueTypeConstraint +FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean IsNotSupportsNullConstraint FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean IsReferenceTypeConstraint FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean IsRequiresDefaultConstructorConstraint FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean IsSimpleChoiceConstraint FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean IsSupportsNullConstraint FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean IsUnmanagedConstraint -FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean IsNotSupportsNullConstraint -FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean IsAllowsRefStructConstraint +FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean get_IsAllowsRefStructConstraint() FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean get_IsCoercesToConstraint() FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean get_IsComparisonConstraint() FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean get_IsDefaultsToConstraint() @@ -5413,13 +5416,12 @@ FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean get_IsEnumCons FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean get_IsEqualityConstraint() FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean get_IsMemberConstraint() FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean get_IsNonNullableValueTypeConstraint() +FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean get_IsNotSupportsNullConstraint() FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean get_IsReferenceTypeConstraint() FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean get_IsRequiresDefaultConstructorConstraint() FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean get_IsSimpleChoiceConstraint() FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean get_IsSupportsNullConstraint() FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean get_IsUnmanagedConstraint() -FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean get_IsNotSupportsNullConstraint() -FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: Boolean get_IsAllowsRefStructConstraint() FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: FSharp.Compiler.Symbols.FSharpGenericParameterDefaultsToConstraint DefaultsToConstraintData FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: FSharp.Compiler.Symbols.FSharpGenericParameterDefaultsToConstraint get_DefaultsToConstraintData() FSharp.Compiler.Symbols.FSharpGenericParameterConstraint: FSharp.Compiler.Symbols.FSharpGenericParameterDelegateConstraint DelegateConstraintData From 25db8cf520bb7cf98a613f93ca76f736558d1749 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Pokorn=C3=BD?= Date: Thu, 6 Feb 2025 15:21:18 +0100 Subject: [PATCH 49/49] comment out jaeger export for workspace tests --- .../CompilerService/FSharpWorkspace.fs | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/CompilerService/FSharpWorkspace.fs b/tests/FSharp.Compiler.ComponentTests/CompilerService/FSharpWorkspace.fs index a111dd6da5c..fd3aa628ab5 100644 --- a/tests/FSharp.Compiler.ComponentTests/CompilerService/FSharpWorkspace.fs +++ b/tests/FSharp.Compiler.ComponentTests/CompilerService/FSharpWorkspace.fs @@ -19,13 +19,13 @@ open System.IO // System.Diagnostics.DiagnosticSource seems to be missing in NET FW. Might investigate this later #if !NETFRAMEWORK -type FilteredJaegerExporter(predicate) = +//type FilteredJaegerExporter(predicate) = - inherit SimpleActivityExportProcessor(new JaegerExporter(new JaegerExporterOptions())) +// inherit SimpleActivityExportProcessor(new JaegerExporter(new JaegerExporterOptions())) - override _.OnEnd(activity: System.Diagnostics.Activity) = - if predicate activity then - base.OnEnd activity +// override _.OnEnd(activity: System.Diagnostics.Activity) = +// if predicate activity then +// base.OnEnd activity /// Wrapper for FSharpWorkspace to use in tests. Provides OpenTelemetry tracing. type TestingWorkspace(testName) as _this = @@ -33,13 +33,13 @@ type TestingWorkspace(testName) as _this = let debugGraphPath = __SOURCE_DIRECTORY__ ++ $"{testName}.md" - let tracerProvider = - Sdk - .CreateTracerProviderBuilder() - .AddSource("fsc") - .SetResourceBuilder(ResourceBuilder.CreateDefault().AddService(serviceName="F#", serviceVersion = "1")) - .AddProcessor(new FilteredJaegerExporter(_.DisplayName >> (<>) "DiagnosticsLogger.StackGuard.Guard")) - .Build() + //let tracerProvider = + // Sdk + // .CreateTracerProviderBuilder() + // .AddSource("fsc") + // .SetResourceBuilder(ResourceBuilder.CreateDefault().AddService(serviceName="F#", serviceVersion = "1")) + // .AddProcessor(new FilteredJaegerExporter(_.DisplayName >> (<>) "DiagnosticsLogger.StackGuard.Guard")) + // .Build() let activity = Activity.start $"Test FSharpWorkspace {testName}" [] @@ -50,8 +50,8 @@ type TestingWorkspace(testName) as _this = interface IDisposable with member _.Dispose() = activity.Dispose() - tracerProvider.ForceFlush() |> ignore - tracerProvider.Dispose() + //tracerProvider.ForceFlush() |> ignore + //tracerProvider.Dispose() [] let ``Add project to workspace`` () =