Skip to content

Commit 15fbf8f

Browse files
committed
disable cosmetic typar overwrite in type extensions
it needs to be made compatible with parallel checking
1 parent 45ffedc commit 15fbf8f

4 files changed

Lines changed: 21 additions & 16 deletions

File tree

src/Compiler/Checking/CheckDeclarations.fs

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4218,18 +4218,20 @@ module TcDeclarations =
42184218
| Result res ->
42194219
// Update resolved type parameters with the names from the source.
42204220
let _, tcref, _ = res
4221+
4222+
// Disabled to allow deterministic parallel type checking. See https://github.com/dotnet/fsharp/issues/19033
4223+
// TODO: mutating typar here can lead to a race during parallel type checking.
4224+
// Some type extensions can end up with a wrong type argument name.
4225+
// This will break deterministic builds.
42214226

4222-
if tcref.TyparsNoRange.Length = synTypars.Length then
4223-
(tcref.TyparsNoRange, synTypars)
4224-
||> List.zip
4225-
|> List.iter (fun (typar, SynTyparDecl.SynTyparDecl (typar = tp)) ->
4226-
let (SynTypar(ident = untypedIdent; staticReq = sr)) = tp
4227-
if typar.StaticReq = sr then
4228-
// TODO: mutating typar here can lead to a race during parallel type checking.
4229-
// Some type extensions can end up with a wrong type argument name.
4230-
// This will break deterministic builds.
4231-
typar.SetIdent(untypedIdent)
4232-
)
4227+
//if tcref.TyparsNoRange.Length = synTypars.Length then
4228+
// (tcref.TyparsNoRange, synTypars)
4229+
// ||> List.zip
4230+
// |> List.iter (fun (typar, SynTyparDecl.SynTyparDecl (typar = tp)) ->
4231+
// let (SynTypar(ident = untypedIdent; staticReq = sr)) = tp
4232+
// if typar.StaticReq = sr then
4233+
// typar.SetIdent(untypedIdent)
4234+
// )
42334235

42344236
tcref
42354237

src/Compiler/SyntaxTree/UnicodeLexing.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ open Internal.Utilities.Text.Lexing
88

99
type Lexbuf = LexBuffer<char>
1010

11-
type LexBuffer<'Char> with
11+
type LexBuffer<'char> with
1212

1313
member lexbuf.GetLocalData<'T when 'T: not null>(key: string, initializer) =
1414
match lexbuf.BufferLocalStore.TryGetValue key with

src/Compiler/SyntaxTree/UnicodeLexing.fsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ open Internal.Utilities.Text.Lexing
99

1010
type Lexbuf = LexBuffer<char>
1111

12-
type LexBuffer<'Char> with
12+
type LexBuffer<'char> with
1313
member GetLocalData<'T when 'T: not null> : key: string * initializer: (unit -> 'T) -> 'T
1414
member TryGetLocalData<'T when 'T: not null> : key: string -> 'T option
1515

tests/FSharp.Compiler.ComponentTests/Signatures/TypeTests.fs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ namespace Foo.Types
7676
7777
val EndColumn: int"""
7878

79-
[<Fact>]
79+
// See https://github.com/dotnet/fsharp/issues/19033
80+
[<Fact(Skip="needs fixing")>]
8081
let ``Type extension uses type parameters names from source`` () =
8182
FSharp """
8283
module Extensions
@@ -93,7 +94,8 @@ type List<'E> with
9394
9495
member X: 'E"""
9596

96-
[<Fact>]
97+
// See https://github.com/dotnet/fsharp/issues/19033
98+
[<Fact(Skip="needs fixing")>]
9799
let ``Type extension with constraints uses type parameters names from source`` () =
98100
FSharp """
99101
module Extensions
@@ -110,7 +112,8 @@ type Map<'K,'V when 'K: comparison> with
110112
111113
member X: t: 'T -> k: 'K -> 'K option * ({| n: 'K array |} * int) when 'K: comparison"""
112114

113-
[<Fact>]
115+
// See https://github.com/dotnet/fsharp/issues/19033
116+
[<Fact(Skip="needs fixing")>]
114117
let ``Type extension with lowercase type parameters names from source`` () =
115118
FSharp """
116119
module Extensions

0 commit comments

Comments
 (0)