Skip to content

Commit ed87f3c

Browse files
committed
integrate visualfsharp master --> fsharp master
2 parents 212c335 + 6a68e46 commit ed87f3c

File tree

17 files changed

+61442
-31
lines changed

17 files changed

+61442
-31
lines changed

src/absil/il.fs

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4685,7 +4685,7 @@ type ILTypeSigParser(tstring : string) =
46854685
let ilty = x.ParseType()
46864686
ILAttribElem.Type(Some(ilty))
46874687

4688-
let decodeILAttribData ilg (ca: ILAttribute) scope =
4688+
let decodeILAttribData ilg (ca: ILAttribute) =
46894689
let bytes = ca.Data
46904690
let sigptr = 0
46914691
let bb0,sigptr = sigptr_get_byte bytes sigptr
@@ -4779,15 +4779,19 @@ let decodeILAttribData ilg (ca: ILAttribute) scope =
47794779
let et,sigptr = sigptr_get_u8 bytes sigptr
47804780
// We have a named value
47814781
let ty,sigptr =
4782-
// REVIEW: Post-M3, consider removing the restriction for scope - it's unnecessary
4783-
// because you can reconstruct scope using the qualified name from the CA Blob
4784-
if (0x50 = (int et) || 0x55 = (int et)) && Option.isSome scope then
4782+
if (0x50 = (int et) || 0x55 = (int et)) then
47854783
let qualified_tname,sigptr = sigptr_get_serstring bytes sigptr
4786-
// we're already getting the qualified name from the binary blob
4787-
// if we don't split out the unqualified name from the qualified name,
4788-
// we'll write the qualified assembly reference string twice to the binary blob
4789-
let unqualified_tname = qualified_tname.Split([|','|]).[0]
4790-
let scoref = Option.get scope
4784+
let unqualified_tname, rest =
4785+
let pieces = qualified_tname.Split(',')
4786+
if pieces.Length > 1 then
4787+
pieces.[0], Some (String.concat "," pieces.[1..])
4788+
else
4789+
pieces.[0], None
4790+
let scoref =
4791+
match rest with
4792+
| Some aname -> ILScopeRef.Assembly(ILAssemblyRef.FromAssemblyName(System.Reflection.AssemblyName(aname)))
4793+
| None -> ilg.traits.ScopeRef
4794+
47914795
let tref = mkILTyRef (scoref,unqualified_tname)
47924796
let tspec = mkILNonGenericTySpec tref
47934797
ILType.Value(tspec),sigptr

src/absil/il.fsi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1797,11 +1797,9 @@ val destTypeDefsWithGlobalFunctionsFirst: ILGlobals -> ILTypeDefs -> ILTypeDef l
17971797
/// Note: not all custom attribute data can be decoded without binding types. In particular
17981798
/// enums must be bound in order to discover the size of the underlying integer.
17991799
/// The following assumes enums have size int32.
1800-
/// It also does not completely decode System.Type attributes
18011800
val decodeILAttribData:
18021801
ILGlobals ->
18031802
ILAttribute ->
1804-
ILScopeRef option ->
18051803
ILAttribElem list * (* fixed args *)
18061804
ILAttributeNamedArg list (* named args: values and flags indicating if they are fields or properties *)
18071805

src/absil/ilmorph.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ let cattr_typ2typ ilg f c =
292292
// dev11 M3 defensive coding: if anything goes wrong with attribute decoding or encoding, then back out.
293293
if morphCustomAttributeData then
294294
try
295-
let elems,namedArgs = IL.decodeILAttribData ilg c (Some(meth.MethodRef.EnclosingTypeRef.Scope))
295+
let elems,namedArgs = IL.decodeILAttribData ilg c
296296
let elems = elems |> List.map (celem_typ2typ f)
297297
let namedArgs = namedArgs |> List.map (cnamedarg_typ2typ f)
298298
IL.mkILCustomAttribMethRef ilg (meth, elems, namedArgs)

src/fsharp/FSharp.Core.Unittests/FSharp.Core.Unittests.fsproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@
115115
<Compile Include="FSharp.Core\Microsoft.FSharp.Collections\CollectionModulesConsistency.fs" Condition="'$(TargetFramework)' != 'portable47' AND '$(TargetFramework)' != 'net20'" />
116116
<Compile Include="FSharp.Core\Microsoft.FSharp.Collections\StringModule.fs" />
117117
<Compile Include="FSharp.Core\PrimTypes.fs" />
118+
<Compile Include="FSharp.Core\ComparersRegression.fs" />
118119
<Compile Include="FSharp.Core\DiscrimantedUnionType.fs" />
119120
<Compile Include="FSharp.Core\Microsoft.FSharp.Core\BigIntType.fs" />
120121
<Compile Include="FSharp.Core\Microsoft.FSharp.Core\IntConversions.fs" />

0 commit comments

Comments
 (0)