@@ -408,8 +408,6 @@ type ILAssemblyRef(data) =
408408
409409 ILAssemblyRef.Create( aname.Name, None, publicKey, retargetable, version, locale)
410410
411-
412-
413411member aref.QualifiedName =
414412let b = new System.Text.StringBuilder( 100 )
415413let add ( s : string ) = ( b.Append( s) |> ignore)
@@ -478,13 +476,6 @@ type ILScopeRef =
478476member x.AssemblyRef = match xwith ILScopeRef.Assembly x-> x| _ -> failwith" not an assembly reference"
479477
480478member scoref.QualifiedName =
481- match scorefwith
482- | ILScopeRef.Local-> " "
483- | ILScopeRef.Module mref-> " module" ^ mref.Name
484- | ILScopeRef.Assembly arefwhen aref.Name= " mscorlib" -> " "
485- | ILScopeRef.Assembly aref-> aref.QualifiedName
486-
487- member scoref.QualifiedNameWithNoShortPrimaryAssembly =
488479match scorefwith
489480| ILScopeRef.Local-> " "
490481| ILScopeRef.Module mref-> " module" + mref.Name
@@ -602,18 +593,12 @@ type ILTypeRef =
602593member 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 basicelse 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 ) =
614597let sco = tref.Scope.QualifiedName
615598if sco= " " then basicelse String.concat" ," [ basic; sco]
616599
600+ member tref.QualifiedName =
601+ tref.AddQualifiedNameExtension( tref.BasicQualifiedName)
617602
618603override 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+
627613member x.TypeRef = x.tspecTypeRef
614+
628615member x.Scope = x.TypeRef.Scope
616+
629617member x.Enclosing = x.TypeRef.Enclosing
618+
630619member x.Name = x.TypeRef.Name
620+
631621member x.GenericArgs = x.tspecInst
622+
632623static member Create ( tref , inst ) = { tspecTypeRef= tref; tspecInst= inst}
624+
633625override x.ToString () = x.TypeRef.ToString() + if isNil x.GenericArgsthen " " else " <...>"
626+
634627member x.BasicQualifiedName =
635628let tc = x.TypeRef.BasicQualifiedName
636629if isNil x.GenericArgsthen
637630 tc
638631else
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
644637member 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 ) =
670663match xwith
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
683676member x.TypeSpec =
684677match xwith
@@ -3301,7 +3294,7 @@ let rec encodeCustomAttrElemType x =
33013294| ILType.Boxed tspecwhen tspec.Name= tname_ String-> [| et_ STRING|]
33023295| ILType.Boxed tspecwhen tspec.Name= tname_ Object-> [| 0x51 uy|]
33033296| ILType.Boxed tspecwhen 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 elemin elemsdo yield ! encodeCustomAttrPrimValue ilg elem|]
33793372
@@ -3427,7 +3420,7 @@ let mkPermissionSet (ilg: ILGlobals) (action,attributes: list<(ILTypeRef * (stri
34273420[| yield ( byte'.' );
34283421yield ! z_ unsigned_ int attributes.Length;
34293422for ( tref: ILTypeRef, props) in attributesdo
3430- yield ! encodeCustomAttrString tref.QualifiedNameWithNoShortPrimaryAssembly
3423+ yield ! encodeCustomAttrString tref.QualifiedName
34313424let bytes =
34323425[| yield ! z_ unsigned_ int props.Length;
34333426for ( nm, typ, value) in propsdo