Skip to content

Commit f9b7206

Browse files
authored
code cleanup (#13106)
* cleanup * cleanup * cleanup * cleanup * cleanup * cleanup
1 parent 870b816 commit f9b7206

File tree

94 files changed

+4872
-4470
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+4872
-4470
lines changed

.editorconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
root = true
2+
3+
[*.fs]
4+
fsharp_newline_between_type_definition_and_members=true
5+
6+
[*.fsi]
7+
fsharp_newline_between_type_definition_and_members=true

src/fsharp/AccessibilityLogic.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ open FSharp.Compiler.TypedTreeBasics
1414
open FSharp.Compiler.TypedTreeOps
1515

1616
#if !NO_TYPEPROVIDERS
17-
open FSharp.Compiler.ExtensionTyping
17+
open FSharp.Compiler.TypeProviders
1818
#endif
1919

2020
/// Represents the 'keys' a particular piece of code can use to access other constructs?.

src/fsharp/AttributeChecking.fs

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ open FSharp.Compiler.TypedTree
1717
open FSharp.Compiler.TypedTreeOps
1818

1919
#if !NO_TYPEPROVIDERS
20-
open FSharp.Compiler.ExtensionTyping
20+
open FSharp.Compiler.TypeProviders
2121
open FSharp.Core.CompilerServices
2222
#endif
2323

@@ -26,46 +26,46 @@ exception ObsoleteError of string * range
2626

2727
let fail() = failwith "This custom attribute has an argument that can not yet be converted using this API"
2828

29-
let rec private evalILAttribElem e =
30-
match e with
31-
| ILAttribElem.String (Some x) -> box x
32-
| ILAttribElem.String None -> null
33-
| ILAttribElem.Bool x -> box x
34-
| ILAttribElem.Char x -> box x
35-
| ILAttribElem.SByte x -> box x
36-
| ILAttribElem.Int16 x -> box x
37-
| ILAttribElem.Int32 x -> box x
38-
| ILAttribElem.Int64 x -> box x
39-
| ILAttribElem.Byte x -> box x
40-
| ILAttribElem.UInt16 x -> box x
41-
| ILAttribElem.UInt32 x -> box x
42-
| ILAttribElem.UInt64 x -> box x
43-
| ILAttribElem.Single x -> box x
44-
| ILAttribElem.Double x -> box x
45-
| ILAttribElem.Null -> null
46-
| ILAttribElem.Array (_, a) -> box [| for i in a -> evalILAttribElem i |]
29+
let rec private evalILAttribElem elem =
30+
match elem with
31+
| ILAttribElem.String (Some x) -> box x
32+
| ILAttribElem.String None -> null
33+
| ILAttribElem.Bool x -> box x
34+
| ILAttribElem.Char x -> box x
35+
| ILAttribElem.SByte x -> box x
36+
| ILAttribElem.Int16 x -> box x
37+
| ILAttribElem.Int32 x -> box x
38+
| ILAttribElem.Int64 x -> box x
39+
| ILAttribElem.Byte x -> box x
40+
| ILAttribElem.UInt16 x -> box x
41+
| ILAttribElem.UInt32 x -> box x
42+
| ILAttribElem.UInt64 x -> box x
43+
| ILAttribElem.Single x -> box x
44+
| ILAttribElem.Double x -> box x
45+
| ILAttribElem.Null -> null
46+
| ILAttribElem.Array (_, a) -> box [| for i in a -> evalILAttribElem i |]
4747
// TODO: typeof<..> in attribute values
48-
| ILAttribElem.Type (Some _t) -> fail()
49-
| ILAttribElem.Type None -> null
48+
| ILAttribElem.Type (Some _t) -> fail()
49+
| ILAttribElem.Type None -> null
5050
| ILAttribElem.TypeRef (Some _t) -> fail()
51-
| ILAttribElem.TypeRef None -> null
51+
| ILAttribElem.TypeRef None -> null
5252

53-
let rec private evalFSharpAttribArg g e =
54-
match stripDebugPoints e with
53+
let rec private evalFSharpAttribArg g attribExpr =
54+
match stripDebugPoints attribExpr with
5555
| Expr.Const (c, _, _) ->
5656
match c with
5757
| Const.Bool b -> box b
58-
| Const.SByte i -> box i
59-
| Const.Int16 i -> box i
60-
| Const.Int32 i -> box i
61-
| Const.Int64 i -> box i
62-
| Const.Byte i -> box i
63-
| Const.UInt16 i -> box i
64-
| Const.UInt32 i -> box i
65-
| Const.UInt64 i -> box i
66-
| Const.Single i -> box i
58+
| Const.SByte i -> box i
59+
| Const.Int16 i -> box i
60+
| Const.Int32 i -> box i
61+
| Const.Int64 i -> box i
62+
| Const.Byte i -> box i
63+
| Const.UInt16 i -> box i
64+
| Const.UInt32 i -> box i
65+
| Const.UInt64 i -> box i
66+
| Const.Single i -> box i
6767
| Const.Double i -> box i
68-
| Const.Char i -> box i
68+
| Const.Char i -> box i
6969
| Const.Zero -> null
7070
| Const.String s -> box s
7171
| _ -> fail()
@@ -233,7 +233,7 @@ let private CheckILAttributes (g: TcGlobals) isByrefLikeTyconRef cattrs m =
233233
match TryDecodeILAttribute tref cattrs with
234234
| Some ([ILAttribElem.String (Some msg) ], _) when not isByrefLikeTyconRef ->
235235
WarnD(ObsoleteWarning(msg, m))
236-
| Some ([ILAttribElem.String (Some msg); ILAttribElem.Bool isError ], _) when not isByrefLikeTyconRef ->
236+
| Some ([ILAttribElem.String (Some msg); ILAttribElem.Bool isError ], _) when not isByrefLikeTyconRef ->
237237
if isError then
238238
ErrorD (ObsoleteError(msg, m))
239239
else
@@ -313,7 +313,7 @@ let private CheckProvidedAttributes (g: TcGlobals) m (provAttribs: Tainted<IProv
313313
let (AttribInfo(tref, _)) = g.attrib_SystemObsolete
314314
match provAttribs.PUntaint((fun a -> a.GetAttributeConstructorArgs(provAttribs.TypeProvider.PUntaintNoFailure(id), tref.FullName)), m) with
315315
| Some ([ Some (:? string as msg) ], _) -> WarnD(ObsoleteWarning(msg, m))
316-
| Some ([ Some (:? string as msg); Some (:?bool as isError) ], _) ->
316+
| Some ([ Some (:? string as msg); Some (:?bool as isError) ], _) ->
317317
if isError then
318318
ErrorD (ObsoleteError(msg, m))
319319
else

src/fsharp/AttributeChecking.fsi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ exception ObsoleteError of string * range
2020
type AttribInfo =
2121
| FSAttribInfo of TcGlobals * Attrib
2222
| ILAttribInfo of TcGlobals * Import.ImportMap * ILScopeRef * ILAttribute * range
23+
2324
member ConstructorArguments: (TType * obj) list
2425
member NamedArguments: (TType * string * bool * obj) list
2526
member Range: range

src/fsharp/AugmentWithHashCompare.fs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@ let mkShr g m acce n = mkAsmExpr ([ AI_shr ], [], [acce; mkInt g m n], [g.int_ty
9999
let mkAdd (g: TcGlobals) m e1 e2 = mkAsmExpr ([ AI_add ], [], [e1;e2], [g.int_ty], m)
100100

101101
let mkAddToHashAcc g m e accv acce =
102-
mkValSet m accv (mkAdd g m (mkInt g m 0x9e3779b9)
103-
(mkAdd g m e
104-
(mkAdd g m (mkShl g m acce 6) (mkShr g m acce 2))))
105-
102+
mkValSet m accv
103+
(mkAdd g m (mkInt g m 0x9e3779b9)
104+
(mkAdd g m e
105+
(mkAdd g m (mkShl g m acce 6) (mkShr g m acce 2))))
106106

107107
let mkCombineHashGenerators g m exprs accv acce =
108108
(acce, exprs) ||> List.fold (fun tm e -> mkCompGenSequential m (mkAddToHashAcc g m e accv acce) tm)

0 commit comments

Comments
 (0)