@@ -408,8 +408,6 @@ type ILAssemblyRef(data) =
408408
409409 ILAssemblyRef.Create( aname.Name, None, publicKey, retargetable, version, locale)
410410
411-
412-
413411 member aref.QualifiedName =
414412 let b = new System.Text.StringBuilder( 100 )
415413 let add ( s : string ) = ( b.Append( s) |> ignore)
@@ -478,13 +476,6 @@ type ILScopeRef =
478476 member x.AssemblyRef = match x with ILScopeRef.Assembly x -> x | _ -> failwith " not an assembly reference"
479477
480478 member scoref.QualifiedName =
481- match scoref with
482- | ILScopeRef.Local -> " "
483- | ILScopeRef.Module mref -> " module " ^ mref.Name
484- | ILScopeRef.Assembly aref when aref.Name = " mscorlib" -> " "
485- | ILScopeRef.Assembly aref -> aref.QualifiedName
486-
487- member scoref.QualifiedNameWithNoShortPrimaryAssembly =
488479 match scoref with
489480 | ILScopeRef.Local -> " "
490481 | ILScopeRef.Module mref -> " module " + mref.Name
@@ -602,18 +593,12 @@ type ILTypeRef =
602593 member tref.BasicQualifiedName =
603594 ( String.concat " +" ( tref.Enclosing @ [ tref.Name ] )) .Replace( " ," , @" \," )
604595
605- member tref.AddQualifiedNameExtensionWithNoShortPrimaryAssembly ( basic ) =
606- let sco = tref.Scope.QualifiedNameWithNoShortPrimaryAssembly
607- if sco = " " then basic else String.concat " , " [ basic; sco]
608-
609- member tref.QualifiedNameWithNoShortPrimaryAssembly =
610- tref.AddQualifiedNameExtensionWithNoShortPrimaryAssembly( tref.BasicQualifiedName)
611-
612- member tref.QualifiedName =
613- let basic = tref.BasicQualifiedName
596+ member tref.AddQualifiedNameExtension ( basic ) =
614597 let sco = tref.Scope.QualifiedName
615598 if sco = " " then basic else String.concat " , " [ basic; sco]
616599
600+ member tref.QualifiedName =
601+ tref.AddQualifiedNameExtension( tref.BasicQualifiedName)
617602
618603 override x.ToString () = x.FullName
619604
@@ -624,22 +609,30 @@ and
624609 { tspecTypeRef: ILTypeRef ;
625610 /// The type instantiation if the type is generic.
626611 tspecInst: ILGenericArgs }
612+
627613 member x.TypeRef = x.tspecTypeRef
614+
628615 member x.Scope = x.TypeRef.Scope
616+
629617 member x.Enclosing = x.TypeRef.Enclosing
618+
630619 member x.Name = x.TypeRef.Name
620+
631621 member x.GenericArgs = x.tspecInst
622+
632623 static member Create ( tref , inst ) = { tspecTypeRef = tref; tspecInst= inst }
624+
633625 override x.ToString () = x.TypeRef.ToString() + if isNil x.GenericArgs then " " else " <...>"
626+
634627 member x.BasicQualifiedName =
635628 let tc = x.TypeRef.BasicQualifiedName
636629 if isNil x.GenericArgs then
637630 tc
638631 else
639- tc + " [" + String.concat " ," ( x.GenericArgs |> List.map ( fun arg -> " [" + arg.QualifiedNameWithNoShortPrimaryAssembly + " ]" )) + " ]"
632+ tc + " [" + String.concat " ," ( x.GenericArgs |> List.map ( fun arg -> " [" + arg.QualifiedName + " ]" )) + " ]"
640633
641- member x.AddQualifiedNameExtensionWithNoShortPrimaryAssembly ( basic ) =
642- x.TypeRef.AddQualifiedNameExtensionWithNoShortPrimaryAssembly ( basic)
634+ member x.AddQualifiedNameExtension ( basic ) =
635+ x.TypeRef.AddQualifiedNameExtension ( basic)
643636
644637 member x.FullName = x.TypeRef.FullName
645638
@@ -666,19 +659,19 @@ and [<RequireQualifiedAccess; StructuralEquality; StructuralComparison>]
666659 | ILType.Byref _ ty -> failwith " unexpected byref type"
667660 | ILType.FunctionPointer _ mref -> failwith " unexpected function pointer type"
668661
669- member x.AddQualifiedNameExtensionWithNoShortPrimaryAssembly ( basic ) =
662+ member x.AddQualifiedNameExtension ( basic ) =
670663 match x with
671664 | ILType.TypeVar _ n -> basic
672- | ILType.Modified(_,_ ty1, ty2) -> ty2.AddQualifiedNameExtensionWithNoShortPrimaryAssembly ( basic)
673- | ILType.Array ( ILArrayShape(_ s), ty) -> ty.AddQualifiedNameExtensionWithNoShortPrimaryAssembly ( basic)
674- | ILType.Value tr | ILType.Boxed tr -> tr.AddQualifiedNameExtensionWithNoShortPrimaryAssembly ( basic)
665+ | ILType.Modified(_,_ ty1, ty2) -> ty2.AddQualifiedNameExtension ( basic)
666+ | ILType.Array ( ILArrayShape(_ s), ty) -> ty.AddQualifiedNameExtension ( basic)
667+ | ILType.Value tr | ILType.Boxed tr -> tr.AddQualifiedNameExtension ( basic)
675668 | ILType.Void -> failwith " void"
676669 | ILType.Ptr _ ty -> failwith " unexpected pointer type"
677670 | ILType.Byref _ ty -> failwith " unexpected byref type"
678671 | ILType.FunctionPointer _ mref -> failwith " unexpected function pointer type"
679672
680- member x.QualifiedNameWithNoShortPrimaryAssembly =
681- x.AddQualifiedNameExtensionWithNoShortPrimaryAssembly ( x.BasicQualifiedName)
673+ member x.QualifiedName =
674+ x.AddQualifiedNameExtension ( x.BasicQualifiedName)
682675
683676 member x.TypeSpec =
684677 match x with
@@ -3301,7 +3294,7 @@ let rec encodeCustomAttrElemType x =
33013294 | ILType.Boxed tspec when tspec.Name = tname_ String -> [| et_ STRING |]
33023295 | ILType.Boxed tspec when tspec.Name = tname_ Object -> [| 0x51 uy |]
33033296 | ILType.Boxed tspec when tspec.Name = tname_ Type -> [| 0x50 uy |]
3304- | ILType.Value tspec -> Array.append [| 0x55 uy |] ( encodeCustomAttrString tspec.TypeRef.QualifiedNameWithNoShortPrimaryAssembly )
3297+ | ILType.Value tspec -> Array.append [| 0x55 uy |] ( encodeCustomAttrString tspec.TypeRef.QualifiedName )
33053298 | ILType.Array ( shape, elemType) when shape = ILArrayShape.SingleDimensional ->
33063299 Array.append [| et_ SZARRAY |] ( encodeCustomAttrElemType elemType)
33073300 | _ -> failwith " encodeCustomAttrElemType: unrecognized custom element type"
@@ -3372,8 +3365,8 @@ let rec encodeCustomAttrPrimValue ilg c =
33723365 | ILAttribElem.UInt64 x -> u64AsBytes x
33733366 | ILAttribElem.Single x -> ieee32AsBytes x
33743367 | ILAttribElem.Double x -> ieee64AsBytes x
3375- | ILAttribElem.Type ( Some ty) -> encodeCustomAttrString ty.QualifiedNameWithNoShortPrimaryAssembly
3376- | ILAttribElem.TypeRef ( Some tref) -> encodeCustomAttrString tref.QualifiedNameWithNoShortPrimaryAssembly
3368+ | ILAttribElem.Type ( Some ty) -> encodeCustomAttrString ty.QualifiedName
3369+ | ILAttribElem.TypeRef ( Some tref) -> encodeCustomAttrString tref.QualifiedName
33773370 | ILAttribElem.Array (_, elems) ->
33783371 [| yield ! i32AsBytes elems.Length; for elem in elems do yield ! encodeCustomAttrPrimValue ilg elem |]
33793372
@@ -3427,7 +3420,7 @@ let mkPermissionSet (ilg: ILGlobals) (action,attributes: list<(ILTypeRef * (stri
34273420 [| yield ( byte '.' );
34283421 yield ! z_ unsigned_ int attributes.Length;
34293422 for ( tref: ILTypeRef, props) in attributes do
3430- yield ! encodeCustomAttrString tref.QualifiedNameWithNoShortPrimaryAssembly
3423+ yield ! encodeCustomAttrString tref.QualifiedName
34313424 let bytes =
34323425 [| yield ! z_ unsigned_ int props.Length;
34333426 for ( nm, typ, value) in props do
0 commit comments