Skip to content

Commit 0876464

Browse files
committed
fix suppress of debug poin
1 parent eccd14e commit 0876464

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

src/Compiler/Checking/CheckExpressions.fs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4773,6 +4773,9 @@ and CrackStaticConstantArgs (cenv: cenv) env tpenv (staticParameters: Tainted<Pr
47734773
argsInStaticParameterOrderIncludingDefaults
47744774

47754775
and TcProvidedTypeAppToStaticConstantArgs (cenv: cenv) env generatedTypePathOpt tpenv (tcref: TyconRef) (args: SynType list) m =
4776+
// Static argument expressions should not get debug points
4777+
let env = { env with eIsControlFlow = false }
4778+
47764779
let typeBeforeArguments =
47774780
match tcref.TypeReprInfo with
47784781
| TProvidedTypeRepr info -> info.ProvidedType
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#r "nuget: FSharp.Data, 4.2.10"
2+
3+
open FSharp.Data
4+
5+
[<Literal>]
6+
let url = "https://en.wikipedia.org/wiki/F_Sharp_(programming_language)"
7+
8+
// Works
9+
let html = new HtmlProvider<url>()
10+
11+
type System.Object with
12+
13+
// Works
14+
member x.Html1 = new HtmlProvider<"https://en.wikipedia.org/wiki/F_Sharp_(programming_language)">()
15+
16+
// Error: FS0267 This is not a valid constant expression or custom attribute value
17+
member x.Html2 = new HtmlProvider<url>()

tests/fsharp/tests.fs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2157,6 +2157,9 @@ module RegressionTests =
21572157
[<Test >]
21582158
let ``12383-FSC_OPTIMIZED`` () = singleTestBuildAndRun "regression/12383" FSC_OPTIMIZED
21592159

2160+
[<Test>]
2161+
let ``13219-bug-FSI`` () = singleTestBuildAndRun "regression/13219" FSI
2162+
21602163
[<Test >]
21612164
let ``4715-optimized`` () =
21622165
let cfg = testConfig "regression/4715"

0 commit comments

Comments
 (0)