@@ -4691,7 +4691,7 @@ type ILTypeSigParser(tstring : string) =
46914691 let ilty = x.ParseType()
46924692 ILAttribElem.Type( Some( ilty))
46934693
4694- let decodeILAttribData ilg ( ca : ILAttribute ) scope =
4694+ let decodeILAttribData ilg ( ca : ILAttribute ) =
46954695 let bytes = ca.Data
46964696 let sigptr = 0
46974697 let bb0 , sigptr = sigptr_ get_ byte bytes sigptr
@@ -4785,15 +4785,19 @@ let decodeILAttribData ilg (ca: ILAttribute) scope =
47854785 let et , sigptr = sigptr_ get_ u8 bytes sigptr
47864786 // We have a named value
47874787 let ty , sigptr =
4788- // REVIEW: Post-M3, consider removing the restriction for scope - it's unnecessary
4789- // because you can reconstruct scope using the qualified name from the CA Blob
4790- if ( 0x50 = ( int et) || 0x55 = ( int et)) && Option.isSome scope then
4788+ if ( 0x50 = ( int et) || 0x55 = ( int et)) then
47914789 let qualified_tname , sigptr = sigptr_ get_ serstring bytes sigptr
4792- // we're already getting the qualified name from the binary blob
4793- // if we don't split out the unqualified name from the qualified name,
4794- // we'll write the qualified assembly reference string twice to the binary blob
4795- let unqualified_tname = qualified_ tname.Split([| ',' |]).[ 0 ]
4796- let scoref = Option.get scope
4790+ let unqualified_tname , rest =
4791+ let pieces = qualified_ tname.Split( ',' )
4792+ if pieces.Length > 1 then
4793+ pieces.[ 0 ], Some ( String.concat " ," pieces.[ 1 ..])
4794+ else
4795+ pieces.[ 0 ], None
4796+ let scoref =
4797+ match rest with
4798+ | Some aname -> ILScopeRef.Assembly( ILAssemblyRef.FromAssemblyName( System.Reflection.AssemblyName( aname)))
4799+ | None -> ilg.traits.ScopeRef
4800+
47974801 let tref = mkILTyRef ( scoref, unqualified_ tname)
47984802 let tspec = mkILNonGenericTySpec tref
47994803 ILType.Value( tspec), sigptr
0 commit comments