Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
9a7920d
Ease restrictions on static members and static let in union and recor…
dsyme Oct 18, 2022
c6cd691
Ease restrictions on static members and static let in union and recor…
dsyme Oct 18, 2022
4c6386d
fix generation of .cctor for unions
dsyme Oct 19, 2022
838052d
Merge branch 'main' of https://github.com/dotnet/fsharp into ease1
dsyme Oct 19, 2022
509f16d
fix build
dsyme Oct 19, 2022
3ba36c3
fix formatting
dsyme Oct 19, 2022
821a9d4
Merge branch 'main' into ease1
dsyme Oct 26, 2022
56f6b91
Merge branch 'main' into ease1
T-Gro Jun 8, 2023
4f0a310
Automated command ran: fantomas
github-actions[bot] Jun 8, 2023
1c37ab0
Build issues resolved
T-Gro Jun 8, 2023
6adc132
surface area changed
T-Gro Jun 8, 2023
a28c57e
Test ideas for static let
T-Gro Jun 9, 2023
23c43f3
tests
T-Gro Jun 9, 2023
7e70ac2
Merge branch 'main' into ease1
T-Gro Jun 9, 2023
801b5c1
More tests
T-Gro Jun 12, 2023
1bdca37
Merge branch 'main' into ease1
T-Gro Jun 12, 2023
3098102
file reorg after @KevinRansom restructuring of component tests
T-Gro Jun 12, 2023
58a7eec
records, generic records, plain enums
T-Gro Jun 12, 2023
98050b1
Static let in generic union
T-Gro Jun 12, 2023
c7e4515
recursive records with static let
T-Gro Jun 12, 2023
65f5745
recursive DU
T-Gro Jun 13, 2023
f6cffd9
Merge branch 'main' into ease1
T-Gro Jun 13, 2023
d4f3cfa
Negative tests for F# below 7
T-Gro Jun 13, 2023
69565fc
Merge branch 'main' into ease1
T-Gro Jun 14, 2023
1fcfa1e
augmentation regressions
T-Gro Jun 14, 2023
0b51dbe
Update CheckDeclarations.fs
T-Gro Jun 14, 2023
b30d469
Merge branch 'main' into ease1
T-Gro Jun 14, 2023
a3ef0c1
Merge branch 'main' into ease1
T-Gro Jun 15, 2023
7b77db3
internalerror with MakeValueAssign fixed?
T-Gro Jun 16, 2023
dc2d520
IL baselines changed (just reordered)
T-Gro Jun 16, 2023
3915139
making AbstractMemberNotAllowedInAugmentation for records an error
T-Gro Jun 16, 2023
935d811
handle errors from both .fs and .fsi in a single test
T-Gro Jun 16, 2023
e1beb20
Merge branch 'main' into ease1
T-Gro Jun 16, 2023
097a742
remove empty line
T-Gro Jun 16, 2023
235f905
.fsproj clean (no idea how it came to be)
T-Gro Jun 16, 2023
c8987ad
IL test fixup
T-Gro Jun 19, 2023
26d6316
IL test fixup
T-Gro Jun 19, 2023
d3a109b
xx
T-Gro Jun 19, 2023
5b4d5b8
Release IL fixup
T-Gro Jun 19, 2023
add7eae
error code update
T-Gro Jun 19, 2023
6573da6
error code fix
T-Gro Jun 19, 2023
4ccd656
baseline - typar generalization.
T-Gro Jun 19, 2023
1a48b0a
Merge branch 'main' into ease1
T-Gro Jun 19, 2023
b4968fc
Fixing typeprovider tests
T-Gro Jun 19, 2023
bf7be00
Trying to resolve 'here was a mismatch between the processor architec…
T-Gro Jun 19, 2023
bdeb26f
one more atempt
T-Gro Jun 19, 2023
baa244b
Merge branch 'main' into ease1
KevinRansom Jun 19, 2023
11c1cb1
PR feedback
T-Gro Jun 20, 2023
abf71ea
Merge branch 'main' into ease1
T-Gro Jun 20, 2023
ccae157
fantomas whitespace
T-Gro Jun 20, 2023
d66f1a7
multi-file static init test added
T-Gro Jun 20, 2023
d51ca8b
PR feedback
T-Gro Jun 20, 2023
64a7e41
Raise error if Fsharp.Core is compiled with features that need new p…
T-Gro Jun 20, 2023
54be671
Merge branch 'main' into ease1
T-Gro Jun 20, 2023
42aa50d
Merge branch 'main' into ease1
T-Gro Jun 21, 2023
7a7b83a
Hard fail pickling when fsharp.core uses new constructs
T-Gro Jun 21, 2023
f3c6fe6
Merge branch 'ease1' of https://github.com/dotnet/fsharp into ease1
T-Gro Jun 21, 2023
f3de169
Merge branch 'main' into ease1
T-Gro Jun 21, 2023
80071ce
IL tests for static let init
T-Gro Jun 26, 2023
e600dba
Merge branch 'main' into ease1
T-Gro Jun 26, 2023
aaff4ba
change error code
T-Gro Jun 26, 2023
bbdae31
Merge branch 'main' into ease1
T-Gro Jul 19, 2023
a730ec0
whitespace formatting
T-Gro Jul 19, 2023
c68b86d
fixing build
T-Gro Jul 19, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 60 additions & 10 deletions src/Compiler/AbstractIL/il.fs
Original file line number Diff line number Diff line change
Expand Up @@ -184,20 +184,22 @@ type LazyOrderedMultiMap<'Key, 'Data when 'Key: equality>(keyf: 'Data -> 'Key, l

t)

member self.Entries() = lazyItems.Force()
member _.Entries() = lazyItems.Force()

member self.Add y =
member _.Add y =
new LazyOrderedMultiMap<'Key, 'Data>(keyf, lazyItems |> lazyMap (fun x -> y :: x))

member self.Filter f =
member _.Filter f =
new LazyOrderedMultiMap<'Key, 'Data>(keyf, lazyItems |> lazyMap (List.filter f))

member self.Item
member _.Item
with get x =
match quickMap.Force().TryGetValue x with
| true, v -> v
| _ -> []

override _.ToString() = "<table>"

//---------------------------------------------------------------------
// SHA1 hash-signing algorithm. Used to get the public key token from
// the public key.
Expand Down Expand Up @@ -422,6 +424,8 @@ type AssemblyRefData =
assemRefLocale: Locale option
}

override x.ToString() = x.assemRefName

/// Global state: table of all assembly references keyed by AssemblyRefData.
let AssemblyRefUniqueStampGenerator = UniqueStampGenerator<AssemblyRefData>()

Expand Down Expand Up @@ -578,6 +582,8 @@ type ILModuleRef =

member x.Hash = x.hash

override x.ToString() = x.Name

[<StructuralEquality; StructuralComparison>]
[<RequireQualifiedAccess>]
type ILScopeRef =
Expand Down Expand Up @@ -667,6 +673,9 @@ type ILCallingConv =

static member Static = ILCallingConvStatics.Static

override x.ToString() =
if x.IsStatic then "static" else "instance"

/// Static storage to amortize the allocation of <c>ILCallingConv.Instance</c> and <c>ILCallingConv.Static</c>.
and ILCallingConvStatics() =

Expand Down Expand Up @@ -986,7 +995,8 @@ type ILMethodRef =

member x.ReturnType = x.mrefReturn

member x.CallingSignature = mkILCallSig (x.CallingConv, x.ArgTypes, x.ReturnType)
member x.GetCallingSignature() =
mkILCallSig (x.CallingConv, x.ArgTypes, x.ReturnType)

static member Create(enclosingTypeRef, callingConv, name, genericArity, argTypes, returnType) =
{
Expand Down Expand Up @@ -1115,6 +1125,8 @@ type ILSourceDocument =

member x.File = x.sourceFile

override x.ToString() = x.File

[<StructuralEquality; StructuralComparison; StructuredFormatDisplay("{DebugText}")>]
type ILDebugPoint =
{
Expand Down Expand Up @@ -1451,6 +1463,10 @@ type ILLocalDebugInfo =
DebugMappings: ILLocalDebugMapping list
}

override x.ToString() =
let firstLabel, secondLabel = x.Range
sprintf "%i-%i" firstLabel secondLabel

[<RequireQualifiedAccess; NoEquality; NoComparison>]
type ILCode =
{
Expand All @@ -1460,6 +1476,8 @@ type ILCode =
Locals: ILLocalDebugInfo list
}

override x.ToString() = "<code>"

[<RequireQualifiedAccess; NoComparison; NoEquality>]
type ILLocal =
{
Expand All @@ -1468,6 +1486,8 @@ type ILLocal =
DebugInfo: (string * int * int) option
}

override x.ToString() = "<local>"

type ILLocals = ILLocal list

[<RequireQualifiedAccess; NoEquality; NoComparison>]
Expand All @@ -1484,6 +1504,8 @@ type ILDebugImports =
Imports: ILDebugImport[]
}

override x.ToString() = "<imports>"

[<RequireQualifiedAccess; NoEquality; NoComparison>]
type ILMethodBody =
{
Expand All @@ -1497,6 +1519,8 @@ type ILMethodBody =
DebugImports: ILDebugImports option
}

override x.ToString() = "<method body>"

[<RequireQualifiedAccess>]
type ILMemberAccess =
| Assembly
Expand Down Expand Up @@ -1737,6 +1761,8 @@ type PInvokeMethod =
CharBestFit: PInvokeCharBestFit
}

override x.ToString() = x.Name

[<RequireQualifiedAccess; NoEquality; NoComparison>]
type ILParameter =
{
Expand All @@ -1753,6 +1779,9 @@ type ILParameter =

member x.CustomAttrs = x.CustomAttrsStored.GetCustomAttrs x.MetadataIndex

override x.ToString() =
x.Name |> Option.defaultValue "<no name>"

type ILParameters = ILParameter list

[<RequireQualifiedAccess; NoEquality; NoComparison>]
Expand All @@ -1764,6 +1793,8 @@ type ILReturn =
MetadataIndex: int32
}

override x.ToString() = "<return>"

member x.CustomAttrs = x.CustomAttrsStored.GetCustomAttrs x.MetadataIndex

member x.WithCustomAttrs(customAttrs) =
Expand All @@ -1778,6 +1809,9 @@ type ILOverridesSpec =

member x.DeclaringType = let (OverridesSpec (_mr, ty)) = x in ty

override x.ToString() =
"overrides " + x.DeclaringType.ToString() + "::" + x.MethodRef.ToString()

type ILMethodVirtualInfo =
{
IsFinal: bool
Expand All @@ -1800,7 +1834,7 @@ type MethodCodeKind =
| Native
| Runtime

let typesOfILParams (ps: ILParameters) : ILTypes = ps |> List.map (fun p -> p.Type)
let typesOfILParams (ps: ILParameters) = ps |> List.map (fun p -> p.Type)

[<StructuralEquality; StructuralComparison>]
type ILGenericVariance =
Expand Down Expand Up @@ -1985,7 +2019,7 @@ type ILMethodDef

member x.IsZeroInit = x.MethodBody.IsZeroInit

member md.CallingSignature =
member md.GetCallingSignature() =
mkILCallSig (md.CallingConv, md.ParameterTypes, md.Return.Type)

member x.IsClassInitializer = x.Name = ".cctor"
Expand Down Expand Up @@ -2149,7 +2183,7 @@ type ILMethodDefs(f: unit -> ILMethodDef[]) =

member x.TryFindInstanceByNameAndCallingSignature(nm, callingSig) =
x.FindByName nm
|> List.tryFind (fun x -> not x.IsStatic && x.CallingSignature = callingSig)
|> List.tryFind (fun x -> not x.IsStatic && x.GetCallingSignature() = callingSig)

[<NoComparison; NoEquality; StructuredFormatDisplay("{DebugText}")>]
type ILEventDef
Expand Down Expand Up @@ -2232,6 +2266,8 @@ type ILEventDefs =

member x.LookupByName s = let (ILEvents t) = x in t[s]

override x.ToString() = "<events>"

[<NoComparison; NoEquality; StructuredFormatDisplay("{DebugText}")>]
type ILPropertyDef
(
Expand Down Expand Up @@ -2310,6 +2346,8 @@ type ILPropertyDefs =

member x.LookupByName s = let (ILProperties t) = x in t[s]

override x.ToString() = "<properties>"

let convertFieldAccess (ilMemberAccess: ILMemberAccess) =
match ilMemberAccess with
| ILMemberAccess.Assembly -> FieldAttributes.Assembly
Expand Down Expand Up @@ -2424,6 +2462,8 @@ type ILFieldDefs =

member x.LookupByName s = let (ILFields t) = x in t[s]

override x.ToString() = "<fields>"

type ILMethodImplDef =
{
Overrides: ILOverridesSpec
Expand Down Expand Up @@ -2804,10 +2844,10 @@ and [<Sealed>] ILTypeDefs(f: unit -> ILPreTypeDef[]) =

ReadOnlyDictionary t)

member x.AsArray() =
member _.AsArray() =
[| for pre in array.Value -> pre.GetTypeDef() |]

member x.AsList() =
member _.AsList() =
[ for pre in array.Value -> pre.GetTypeDef() ]

interface IEnumerable with
Expand Down Expand Up @@ -2870,6 +2910,8 @@ type ILNestedExportedType =

member x.CustomAttrs = x.CustomAttrsStored.GetCustomAttrs x.MetadataIndex

override x.ToString() = "exported type " + x.Name

and ILNestedExportedTypes =
| ILNestedExportedTypes of Lazy<Map<string, ILNestedExportedType>>

Expand All @@ -2892,6 +2934,8 @@ and [<NoComparison; NoEquality>] ILExportedTypeOrForwarder =

member x.CustomAttrs = x.CustomAttrsStored.GetCustomAttrs x.MetadataIndex

override x.ToString() = "exported type " + x.Name

and ILExportedTypesAndForwarders =
| ILExportedTypesAndForwarders of Lazy<Map<string, ILExportedTypeOrForwarder>>

Expand Down Expand Up @@ -2930,6 +2974,8 @@ type ILResource =

member x.CustomAttrs = x.CustomAttrsStored.GetCustomAttrs x.MetadataIndex

override x.ToString() = "resource " + x.Name

type ILResources =
| ILResources of ILResource list

Expand Down Expand Up @@ -2977,6 +3023,8 @@ type ILAssemblyManifest =

member x.SecurityDecls = x.SecurityDeclsStored.GetSecurityDecls x.MetadataIndex

override x.ToString() = "assembly manifest " + x.Name

[<RequireQualifiedAccess>]
type ILNativeResource =
| In of fileName: string * linkedResourceBase: int * linkedResourceStart: int * linkedResourceLength: int
Expand Down Expand Up @@ -3020,6 +3068,8 @@ type ILModuleDef =

member x.CustomAttrs = x.CustomAttrsStored.GetCustomAttrs x.MetadataIndex

override x.ToString() = "assembly " + x.Name

// --------------------------------------------------------------------
// Add fields and types to tables, with decent error messages
// when clashes occur...
Expand Down
Loading