Skip to content

Commit 810f420

Browse files
committed
disable typar ident overwrite in extensions when deterministic
1 parent 43f0a78 commit 810f420

File tree

7 files changed

+12
-3
lines changed

7 files changed

+12
-3
lines changed

src/Compiler/Checking/CheckDeclarations.fs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4218,7 +4218,8 @@ module TcDeclarations =
42184218
| Result res ->
42194219
// Update resolved type parameters with the names from the source.
42204220
let _, tcref, _ = res
4221-
if tcref.TyparsNoRange.Length = synTypars.Length then
4221+
4222+
if (not g.deterministic) && tcref.TyparsNoRange.Length = synTypars.Length then
42224223
(tcref.TyparsNoRange, synTypars)
42234224
||> List.zip
42244225
|> List.iter (fun (typar, SynTyparDecl.SynTyparDecl (typar = tp)) ->

src/Compiler/Driver/CompilerImports.fs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2606,6 +2606,7 @@ and [<Sealed>] TcImports
26062606
tcConfig.pathMap,
26072607
tcConfig.langVersion,
26082608
tcConfig.realsig,
2609+
tcConfig.deterministic,
26092610
tcConfig.compilationMode
26102611
)
26112612

src/Compiler/Service/IncrementalBuild.fs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,7 @@ type FrameworkImportsCache(size) =
573573
tcGlobals.pathMap,
574574
tcConfig.langVersion,
575575
tcConfig.realsig,
576+
tcConfig.deterministic,
576577
tcConfig.compilationMode
577578
)
578579

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

src/Compiler/TypedTree/TcGlobals.fs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ type TcGlobals(
198198
pathMap: PathMap,
199199
langVersion: LanguageVersion,
200200
realsig: bool,
201+
deterministic: bool,
201202
compilationMode: CompilationMode) =
202203

203204
let v_langFeatureNullness = langVersion.SupportsFeature LanguageFeature.NullnessChecking
@@ -1847,6 +1848,8 @@ type TcGlobals(
18471848
/// Are we assuming all code gen is for F# interactive, with no static linking
18481849
member _.isInteractive=isInteractive
18491850

1851+
member val deterministic = deterministic
1852+
18501853
member val compilationMode = compilationMode
18511854

18521855
/// Indicates if we are generating witness arguments for SRTP constraints. Only done if the FSharp.Core

src/Compiler/TypedTree/TcGlobals.fsi

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ type internal TcGlobals =
157157
pathMap: Internal.Utilities.PathMap *
158158
langVersion: FSharp.Compiler.Features.LanguageVersion *
159159
realsig: bool *
160+
deterministic: bool *
160161
compilationMode: CompilationMode ->
161162
TcGlobals
162163

@@ -826,6 +827,8 @@ type internal TcGlobals =
826827
/// Are we assuming all code gen is for F# interactive, with no static linking
827828
member isInteractive: bool
828829

830+
member deterministic: bool
831+
829832
member compilationMode: CompilationMode
830833

831834
member isnull_info: IntrinsicValRef

0 commit comments

Comments
 (0)