Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/dotnet/fsharp into ft15
Browse files Browse the repository at this point in the history
  • Loading branch information
dsyme committed May 20, 2022
2 parents 1d29dd0 + e8fc5fb commit 0f1e266
Show file tree
Hide file tree
Showing 32 changed files with 3,150 additions and 3,245 deletions.
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
root = true

[*.fs]
max_line_length=140
fsharp_newline_between_type_definition_and_members=true
fsharp_max_infix_operator_expression=80
fsharp_max_array_or_list_width=80
Expand Down
4 changes: 0 additions & 4 deletions .fantomasignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ src/Compiler/Symbols/**/*.fs
src/Compiler/SyntaxTree/**/*.fs
src/Compiler/TypedTree/**/*.fs
src/Compiler/Utilities/**/*.fs
src/fsc/**/*.fs
src/fscAnyCpu/**/*.fs
src/FSharp.Compiler.Server.Shared/**/*.fs
src/FSharp.DependencyManager.Nuget/**/*.fs
src/Microsoft.FSharp.Compiler/**/*.fs

# Fantomas limitations on implementation files in FSharp.Core (to investigate)
Expand Down
23 changes: 17 additions & 6 deletions src/Compiler/Checking/CheckDeclarations.fs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ open Internal.Utilities.Library.Extras
open Internal.Utilities.Library.ResultOrException
open FSharp.Compiler
open FSharp.Compiler.AbstractIL.IL
open FSharp.Compiler.AbstractIL.Diagnostics
open FSharp.Compiler.AccessibilityLogic
open FSharp.Compiler.AttributeChecking
open FSharp.Compiler.CheckExpressions
open FSharp.Compiler.CheckComputationExpressions
open FSharp.Compiler.CheckExpressions
open FSharp.Compiler.CheckPatterns
open FSharp.Compiler.CompilerGlobalState
open FSharp.Compiler.ConstraintSolver
open FSharp.Compiler.DiagnosticsLogger
Expand Down Expand Up @@ -758,7 +758,9 @@ module IncrClassChecking =

// Type check arguments by processing them as 'simple' patterns
// NOTE: if we allow richer patterns here this is where we'd process those patterns
let ctorArgNames, (_, names, _) = TcSimplePatsOfUnknownType cenv true CheckCxs env tpenv (SynSimplePats.SimplePats (spats, m))
let ctorArgNames, patEnv = TcSimplePatsOfUnknownType cenv true CheckCxs env tpenv (SynSimplePats.SimplePats (spats, m))

let (TcPatLinearEnv(_, names, _)) = patEnv

// Create the values with the given names
let _, vspecs = MakeAndPublishSimpleVals cenv env names
Expand Down Expand Up @@ -3232,7 +3234,10 @@ module EstablishTypeDefinitionCores =
match implicitCtorSynPats with
| None -> ()
| Some spats ->
let ctorArgNames, (_, names, _) = TcSimplePatsOfUnknownType cenv true NoCheckCxs env tpenv spats
let ctorArgNames, patEnv = TcSimplePatsOfUnknownType cenv true NoCheckCxs env tpenv spats

let (TcPatLinearEnv(_, names, _)) = patEnv

for arg in ctorArgNames do
let ty = names[arg].Type
let m = names[arg].Ident.idRange
Expand Down Expand Up @@ -4113,7 +4118,10 @@ module EstablishTypeDefinitionCores =
()
| Some spats ->
if tycon.IsFSharpStructOrEnumTycon then
let ctorArgNames, (_, names, _) = TcSimplePatsOfUnknownType cenv true CheckCxs envinner tpenv spats
let ctorArgNames, patEnv = TcSimplePatsOfUnknownType cenv true CheckCxs envinner tpenv spats

let (TcPatLinearEnv(_, names, _)) = patEnv

for arg in ctorArgNames do
let ty = names[arg].Type
let id = names[arg].Ident
Expand Down Expand Up @@ -5575,7 +5583,6 @@ let rec TcModuleOrNamespaceElementNonMutRec (cenv: cenv) parent typeNames scopem

| SynModuleDecl.NamespaceFragment(SynModuleOrNamespace(longId, isRec, kind, defs, xml, attribs, vis, m, _)) ->

if progress then dprintn ("Typecheck implementation " + textOfLid longId)
let endm = m.EndRange

do for id in longId do
Expand Down Expand Up @@ -6002,6 +6009,8 @@ let CheckOneImplFile
let cenv =
cenv.Create (g, isScript, niceNameGen, amap, thisCcu, false, Option.isSome rootSigOpt,
conditionalDefines, tcSink, (LightweightTcValForUsingInBuildMethodCall g), isInternalTestSpanStackReferring,
tcPat=TcPat,
tcSimplePats=TcSimplePats,
tcSequenceExpressionEntry=TcSequenceExpressionEntry,
tcArrayOrListSequenceExpression=TcArrayOrListComputedExpression,
tcComputationExpression=TcComputationExpression)
Expand Down Expand Up @@ -6128,6 +6137,8 @@ let CheckOneSigFile (g, niceNameGen, amap, thisCcu, checkForErrors, conditionalD
cenv.Create
(g, false, niceNameGen, amap, thisCcu, true, false, conditionalDefines, tcSink,
(LightweightTcValForUsingInBuildMethodCall g), isInternalTestSpanStackReferring,
tcPat=TcPat,
tcSimplePats=TcSimplePats,
tcSequenceExpressionEntry=TcSequenceExpressionEntry,
tcArrayOrListSequenceExpression=TcArrayOrListComputedExpression,
tcComputationExpression=TcComputationExpression)
Expand Down
Loading

0 comments on commit 0f1e266

Please sign in to comment.