From b587beba40b52714057f7a0ae36c9566a4d6d0a3 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Fri, 4 Jun 2021 18:33:14 +0200 Subject: [PATCH 1/3] Build compiler with 5.0.300 and see if __SOURCE_DIRECTORY__ is broken there. --- azure-pipelines.yml | 2 +- global.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4c120bbab01..05059c09203 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -57,7 +57,7 @@ variables: - name: VisualStudioDropName value: Products/$(System.TeamProject)/$(Build.Repository.Name)/$(Build.SourceBranchName)/$(Build.BuildNumber) - name: DotNetSdkVersion - value: '5.0.100' + value: '5.0.300' - ${{ if and(eq(variables['System.TeamProject'], 'public'), eq(variables['Build.Reason'], 'PullRequest')) }}: - name: RunningAsPullRequest value: true diff --git a/global.json b/global.json index d4ad6f0eb3b..714ed164497 100644 --- a/global.json +++ b/global.json @@ -1,10 +1,10 @@ { "sdk": { - "version": "5.0.100", + "version": "5.0.300", "rollForward": "minor" }, "tools": { - "dotnet": "5.0.100", + "dotnet": "5.0.300", "vs": { "version": "16.8", "components": [ From 1b2186cab2b1cde362280679c061478442f4eec7 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Mon, 7 Jun 2021 12:13:25 +0200 Subject: [PATCH 2/3] Added test to check that SourceIdentifier is acceptable as type parameter --- tests/fsharp/typeProviders/helloWorld/test.fsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/fsharp/typeProviders/helloWorld/test.fsx b/tests/fsharp/typeProviders/helloWorld/test.fsx index 1a38103ba6a..891fa7fdbe1 100644 --- a/tests/fsharp/typeProviders/helloWorld/test.fsx +++ b/tests/fsharp/typeProviders/helloWorld/test.fsx @@ -760,6 +760,9 @@ module String = check "vlkrrevpojvr1" FSharp.HelloWorld.HelloWorldTypeWithStaticStringParameter<"10000">.StaticProperty1 "You got a static property" + check "vlkrrevpojvr1c" + FSharp.HelloWorld.HelloWorldTypeWithStaticStringParameter<__SOURCE_DIRECTORY__>.StaticProperty1 + "You got a static property" module Bool = check "vlkrrevpojvr1" From a737840060ad8216e8018368f328d03016049078 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Mon, 7 Jun 2021 13:05:40 +0200 Subject: [PATCH 3/3] Add SourceIdentifier as valid static argument to provided types --- src/fsharp/CheckExpressions.fs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/fsharp/CheckExpressions.fs b/src/fsharp/CheckExpressions.fs index 294757143c5..521b7d860ca 100644 --- a/src/fsharp/CheckExpressions.fs +++ b/src/fsharp/CheckExpressions.fs @@ -4422,7 +4422,8 @@ and TcStaticConstantParameter cenv (env: TcEnv) tpenv kind (StripParenTypes v) i | SynConst.Single n when typeEquiv g g.float32_ty kind -> record(g.float32_ty); box (n: single) | SynConst.Double n when typeEquiv g g.float_ty kind -> record(g.float_ty); box (n: double) | SynConst.Char n when typeEquiv g g.char_ty kind -> record(g.char_ty); box (n: char) - | SynConst.String (s, _, _) when s <> null && typeEquiv g g.string_ty kind -> record(g.string_ty); box (s: string) + | SynConst.String (s, _, _) + | SynConst.SourceIdentifier (_, s, _) when s <> null && typeEquiv g g.string_ty kind -> record(g.string_ty); box (s: string) | SynConst.Bool b when typeEquiv g g.bool_ty kind -> record(g.bool_ty); box (b: bool) | _ -> fail() v, tpenv