@@ -2323,33 +2323,33 @@ let mkILMethRef (tref, callconv, nm, gparams, args, rty) =
23232323 mrefArgs= args
23242324 mrefReturn= rty}
23252325
2326- let mkILMethSpecForMethRefInTy ( mref , typ , minst ) =
2326+ let mkILMethSpecForMethRefInTy ( mref , ty , minst ) =
23272327{ mspecMethodRef= mref
2328- mspecDeclaringType= typ
2328+ mspecDeclaringType= ty
23292329 mspecMethodInst= minst}
23302330
23312331let mkILMethSpec ( mref , vc , tinst , minst ) = mkILMethSpecForMethRefInTy( mref, mkILNamedTy vc mref.DeclaringTypeRef tinst, minst)
23322332
23332333let mkILMethSpecInTypeRef ( tref , vc , cc , nm , args , rty , tinst , minst ) =
23342334 mkILMethSpec( mkILMethRef( tref, cc, nm, List.length minst, args, rty), vc, tinst, minst)
23352335
2336- let mkILMethSpecInTy ( typ : ILType , cc , nm , args , rty , minst : ILGenericArgs ) =
2337- mkILMethSpecForMethRefInTy( mkILMethRef( typ .TypeRef, cc, nm, minst.Length, args, rty), typ , minst)
2336+ let mkILMethSpecInTy ( ty : ILType , cc , nm , args , rty , minst : ILGenericArgs ) =
2337+ mkILMethSpecForMethRefInTy( mkILMethRef( ty .TypeRef, cc, nm, minst.Length, args, rty), ty , minst)
23382338
2339- let mkILNonGenericMethSpecInTy ( typ , cc , nm , args , rty ) =
2340- mkILMethSpecInTy( typ , cc, nm, args, rty, [])
2339+ let mkILNonGenericMethSpecInTy ( ty , cc , nm , args , rty ) =
2340+ mkILMethSpecInTy( ty , cc, nm, args, rty, [])
23412341
2342- let mkILInstanceMethSpecInTy ( typ : ILType , nm , args , rty , minst ) =
2343- mkILMethSpecInTy( typ , ILCallingConv.Instance, nm, args, rty, minst)
2342+ let mkILInstanceMethSpecInTy ( ty : ILType , nm , args , rty , minst ) =
2343+ mkILMethSpecInTy( ty , ILCallingConv.Instance, nm, args, rty, minst)
23442344
2345- let mkILNonGenericInstanceMethSpecInTy ( typ : ILType , nm , args , rty ) =
2346- mkILInstanceMethSpecInTy( typ , nm, args, rty, [])
2345+ let mkILNonGenericInstanceMethSpecInTy ( ty : ILType , nm , args , rty ) =
2346+ mkILInstanceMethSpecInTy( ty , nm, args, rty, [])
23472347
2348- let mkILStaticMethSpecInTy ( typ , nm , args , rty , minst ) =
2349- mkILMethSpecInTy( typ , ILCallingConv.Static, nm, args, rty, minst)
2348+ let mkILStaticMethSpecInTy ( ty , nm , args , rty , minst ) =
2349+ mkILMethSpecInTy( ty , ILCallingConv.Static, nm, args, rty, minst)
23502350
2351- let mkILNonGenericStaticMethSpecInTy ( typ , nm , args , rty ) =
2352- mkILStaticMethSpecInTy( typ , nm, args, rty, [])
2351+ let mkILNonGenericStaticMethSpecInTy ( ty , nm , args , rty ) =
2352+ mkILStaticMethSpecInTy( ty , nm, args, rty, [])
23532353
23542354let mkILCtorMethSpec ( tref , args , cinst ) =
23552355 mkILMethSpecInTypeRef( tref, AsObject, ILCallingConv.Instance, " .ctor" , args, ILType.Void, cinst, [])
@@ -2368,8 +2368,8 @@ let mkILFieldRef(tref, nm, ty) = { DeclaringTypeRef=tref; Name=nm; Type=ty}
23682368
23692369let mkILFieldSpec ( tref , ty ) = { FieldRef= tref; DeclaringType= ty}
23702370
2371- let mkILFieldSpecInTy ( typ : ILType , nm , fty ) =
2372- mkILFieldSpec( mkILFieldRef( typ .TypeRef, nm, fty), typ )
2371+ let mkILFieldSpecInTy ( ty : ILType , nm , fty ) =
2372+ mkILFieldSpec( mkILFieldRef( ty .TypeRef, nm, fty), ty )
23732373
23742374
23752375let andTailness x y =
@@ -2686,22 +2686,22 @@ let rec rescopeILTypeSpec scoref (tspec1:ILTypeSpec) =
26862686let tinst2 = rescopeILTypes scoref tinst1
26872687 ILTypeSpec.Create( tref2, tinst2)
26882688
2689- and rescopeILType scoreftyp =
2690- match typ with
2689+ and rescopeILType scorefty =
2690+ match ty with
26912691| ILType.Ptr t-> ILType.Ptr( rescopeILType scoref t)
26922692| ILType.FunctionPointer t-> ILType.FunctionPointer( rescopeILCallSig scoref t)
26932693| ILType.Byref t-> ILType.Byref( rescopeILType scoref t)
26942694| ILType.Boxed cr1->
26952695let cr2 = rescopeILTypeSpec scoref cr1
2696- if cr1=== cr2then typ else
2696+ if cr1=== cr2then ty else
26972697 mkILBoxedType cr2
26982698| ILType.Array( s, ety1) ->
26992699let ety2 = rescopeILType scoref ety1
2700- if ety1=== ety2then typ else
2700+ if ety1=== ety2then ty else
27012701 ILType.Array( s, ety2)
27022702| ILType.Value cr1->
27032703let cr2 = rescopeILTypeSpec scoref cr1
2704- if cr1=== cr2then typ else
2704+ if cr1=== cr2then ty else
27052705 ILType.Value cr2
27062706| ILType.Modified( b, tref, ty) -> ILType.Modified( b, rescopeILTypeRef scoref tref, rescopeILType scoref ty)
27072707| x-> x
@@ -2733,8 +2733,8 @@ let rescopeILFieldRef scoref x =
27332733let rec instILTypeSpecAux numFree inst ( tspec : ILTypeSpec ) =
27342734 ILTypeSpec.Create( tspec.TypeRef, instILGenericArgsAux numFree inst tspec.GenericArgs)
27352735
2736- and instILTypeAux numFree ( inst : ILGenericArgs ) typ =
2737- match typ with
2736+ and instILTypeAux numFree ( inst : ILGenericArgs ) ty =
2737+ match ty with
27382738| ILType.Ptr t-> ILType.Ptr( instILTypeAux numFree inst t)
27392739| ILType.FunctionPointer t-> ILType.FunctionPointer( instILCallSigAux numFree inst t)
27402740| ILType.Array( a, t) -> ILType.Array( a, instILTypeAux numFree inst t)
@@ -2744,7 +2744,7 @@ and instILTypeAux numFree (inst:ILGenericArgs) typ =
27442744| ILType.TypeVar v->
27452745let v = int v
27462746let top = inst.Length
2747- if v< numFreethen typ else
2747+ if v< numFreethen ty else
27482748if v- numFree>= topthen
27492749 ILType.TypeVar( uint16( v- top))
27502750else
@@ -2833,10 +2833,10 @@ let mkILCtor (access, args, impl) =
28332833// Do-nothing ctor, just pass on to monomorphic superclass
28342834// --------------------------------------------------------------------
28352835
2836- let mkCallBaseConstructor ( typ , args : ILType list ) =
2836+ let mkCallBaseConstructor ( ty , args : ILType list ) =
28372837[ mkLdarg0] @
28382838 List.mapi( fun i _ -> mkLdarg( uint16( i+ 1 ))) args@
2839- [ mkNormalCall( mkILCtorMethSpecForTy( typ , [])) ]
2839+ [ mkNormalCall( mkILCtorMethSpecForTy( ty , [])) ]
28402840
28412841let mkNormalStfld fspec = I_ stfld( Aligned, Nonvolatile, fspec)
28422842let mkNormalStsfld fspec = I_ stsfld( Nonvolatile, fspec)
@@ -2889,8 +2889,8 @@ let mkILClassCtor impl =
28892889// (i.e. overrides by name/signature)
28902890// --------------------------------------------------------------------
28912891
2892- let mk_ospec ( typ : ILType , callconv , nm , genparams , formal_args , formal_ret ) =
2893- OverridesSpec( mkILMethRef( typ .TypeRef, callconv, nm, genparams, formal_ args, formal_ ret), typ )
2892+ let mk_ospec ( ty : ILType , callconv , nm , genparams , formal_args , formal_ret ) =
2893+ OverridesSpec( mkILMethRef( ty .TypeRef, callconv, nm, genparams, formal_ args, formal_ ret), ty )
28942894
28952895let mkILGenericVirtualMethod ( nm , access , genparams , actual_args , actual_ret , impl ) =
28962896 ILMethodDef( name= nm,
@@ -3082,7 +3082,7 @@ let emptyILMethodImpls = mkILMethodImpls []
30823082// them in fields. preblock is how to call the superclass constructor....
30833083// --------------------------------------------------------------------
30843084
3085- let mkILStorageCtorWithParamNames ( tag , preblock , typ , extraParams , flds , access ) =
3085+ let mkILStorageCtorWithParamNames ( tag , preblock , ty , extraParams , flds , access ) =
30863086 mkILCtor( access,
30873087( flds|> List.map( fun ( pnm , _ , ty ) -> mkILParamNamed( pnm, ty))) @ extraParams,
30883088 mkMethodBody
@@ -3091,29 +3091,29 @@ let mkILStorageCtorWithParamNames(tag, preblock, typ, extraParams, flds, access)
30913091begin
30923092( match tagwith Some x-> [ I_ seqpoint x] | None-> []) @
30933093 preblock@
3094- List.concat( List.mapi( fun n ( _pnm , nm , ty ) ->
3094+ List.concat( List.mapi( fun n ( _pnm , nm , fieldTy ) ->
30953095[ mkLdarg0
30963096 mkLdarg( uint16( n+ 1 ))
3097- mkNormalStfld( mkILFieldSpecInTy( typ , nm, ty ))
3097+ mkNormalStfld( mkILFieldSpecInTy( ty , nm, fieldTy ))
30983098]) flds)
30993099end , tag))
31003100
3101- let mkILSimpleStorageCtorWithParamNames ( tag , base_tspec , typ , extraParams , flds , access ) =
3101+ let mkILSimpleStorageCtorWithParamNames ( tag , baseTySpec , ty , extraParams , flds , access ) =
31023102let preblock =
3103- match base _ tspec with
3103+ match baseTySpec with
31043104 None-> []
31053105| Some tspec->
31063106([ mkLdarg0
31073107 mkNormalCall( mkILCtorMethSpecForTy( mkILBoxedType tspec, [])) ])
3108- mkILStorageCtorWithParamNames( tag, preblock, typ , extraParams, flds, access)
3108+ mkILStorageCtorWithParamNames( tag, preblock, ty , extraParams, flds, access)
31093109
31103110let addParamNames flds =
31113111 flds|> List.map( fun ( nm , ty ) -> ( nm, nm, ty))
31123112
3113- let mkILSimpleStorageCtor ( tag , base_tspec , typ , extraParams , flds , access ) =
3114- mkILSimpleStorageCtorWithParamNames( tag, base _ tspec , typ , extraParams, addParamNames flds, access)
3113+ let mkILSimpleStorageCtor ( tag , baseTySpec , ty , extraParams , flds , access ) =
3114+ mkILSimpleStorageCtorWithParamNames( tag, baseTySpec , ty , extraParams, addParamNames flds, access)
31153115
3116- let mkILStorageCtor ( tag , preblock , typ , flds , access ) = mkILStorageCtorWithParamNames( tag, preblock, typ , [], addParamNames flds, access)
3116+ let mkILStorageCtor ( tag , preblock , ty , flds , access ) = mkILStorageCtorWithParamNames( tag, preblock, ty , [], addParamNames flds, access)
31173117
31183118
31193119let mkILGenericClass ( nm , access , genparams , extends , impl , methods , fields , nestedTypes , props , events , attrs , init ) =
@@ -3237,9 +3237,9 @@ let mkILDelegateMethods (access) (ilg: ILGlobals) (iltyp_AsyncCallback, iltyp_IA
32373237 one" EndInvoke" [ mkILParamNamed( " result" , iltyp_ IAsyncResult)] rty]
32383238
32393239
3240- let mkCtorMethSpecForDelegate ( ilg : ILGlobals ) ( typ : ILType , useUIntPtr ) =
3241- let scoref = typ .TypeRef.Scope
3242- mkILInstanceMethSpecInTy( typ , " .ctor" , [ rescopeILType scoref ilg.typ_ Object; rescopeILType scoref( if useUIntPtrthen ilg.typ_ UIntPtrelse ilg.typ_ IntPtr)], ILType.Void, emptyILGenericArgsList)
3240+ let mkCtorMethSpecForDelegate ( ilg : ILGlobals ) ( ty : ILType , useUIntPtr ) =
3241+ let scoref = ty .TypeRef.Scope
3242+ mkILInstanceMethSpecInTy( ty , " .ctor" , [ rescopeILType scoref ilg.typ_ Object; rescopeILType scoref( if useUIntPtrthen ilg.typ_ UIntPtrelse ilg.typ_ IntPtr)], ILType.Void, emptyILGenericArgsList)
32433243
32443244type ILEnumInfo =
32453245{ enumValues: ( string * ILFieldInit ) list
@@ -3594,8 +3594,8 @@ let mkPermissionSet (ilg: ILGlobals) (action, attributes: list<(ILTypeRef * (str
35943594yield ! encodeCustomAttrString tref.QualifiedName
35953595let bytes =
35963596[| yield ! z_ unsigned_ int props.Length
3597- for ( nm, typ , value) in propsdo
3598- yield ! encodeCustomAttrNamedArg ilg( nm, typ , true , value)|]
3597+ for ( nm, ty , value) in propsdo
3598+ yield ! encodeCustomAttrNamedArg ilg( nm, ty , true , value)|]
35993599yield ! z_ unsigned_ int bytes.Length
36003600yield ! bytes|]
36013601
@@ -3898,17 +3898,17 @@ let rec refs_of_typ s x =
38983898| ILType.Value tr| ILType.Boxed tr-> refs_ of_ tspec s tr
38993899| ILType.FunctionPointer mref-> refs_ of_ callsig s mref
39003900
3901- and refs_of_inst s i = refs _ of _ typs s i
3901+ and refs_of_inst s i = refs _ of _ tys s i
39023902and refs_of_tspec s ( x : ILTypeSpec ) = refs_ of_ tref s x.TypeRef; refs_ of_ inst s x.GenericArgs
3903- and refs_of_callsig s csig = refs _ of _ typs s csig.ArgTypes; refs_ of_ typ s csig.ReturnType
3904- and refs_of_genparam s x = refs _ of _ typs s x.Constraints
3903+ and refs_of_callsig s csig = refs _ of _ tys s csig.ArgTypes; refs_ of_ typ s csig.ReturnType
3904+ and refs_of_genparam s x = refs _ of _ tys s x.Constraints
39053905and refs_of_genparams s b = List.iter( refs_ of_ genparam s) b
39063906
39073907and refs_of_dloc s ts = refs_ of_ tref s ts
39083908
39093909and refs_of_mref s ( x : ILMethodRef ) =
39103910 refs_ of_ dloc s x.DeclaringTypeRef
3911- refs _ of _ typs s x.mrefArgs
3911+ refs _ of _ tys s x.mrefArgs
39123912 refs_ of_ typ s x.mrefReturn
39133913
39143914and refs_of_fref s x = refs_ of_ tref s x.DeclaringTypeRef; refs_ of_ typ s x.Type
@@ -3922,7 +3922,7 @@ and refs_of_fspec s x =
39223922 refs_ of_ fref s x.FieldRef
39233923 refs_ of_ typ s x.DeclaringType
39243924
3925- and refs_of_typs s l = List.iter( refs_ of_ typ s) l
3925+ and refs_of_tys s l = List.iter( refs_ of_ typ s) l
39263926
39273927and refs_of_token s x =
39283928match xwith
@@ -3933,7 +3933,7 @@ and refs_of_token s x =
39333933and refs_of_custom_attr s x = refs_ of_ mspec s x.Method
39343934
39353935and refs_of_custom_attrs s ( cas : ILAttributes ) = List.iter( refs_ of_ custom_ attr s) cas.AsList
3936- and refs_of_varargs s tyso = Option.iter( refs _ of _ typs s) tyso
3936+ and refs_of_varargs s tyso = Option.iter( refs _ of _ tys s) tyso
39373937and refs_of_instr s x =
39383938match xwith
39393939| I_ call(_, mr, varargs) | I_ newobj( mr, varargs) | I_ callvirt(_, mr, varargs) ->
@@ -4011,7 +4011,7 @@ and refs_of_property_def s (pd: ILPropertyDef) =
40114011 Option.iter( refs_ of_ mref s) pd.SetMethod
40124012 Option.iter( refs_ of_ mref s) pd.GetMethod
40134013 refs_ of_ typ s pd.PropertyType
4014- refs _ of _ typs s pd.Args
4014+ refs _ of _ tys s pd.Args
40154015 refs_ of_ custom_ attrs s pd.CustomAttrs
40164016
40174017and refs_of_properties s ( x : ILPropertyDefs ) = List.iter( refs_ of_ property_ def s) x.AsList
@@ -4033,7 +4033,7 @@ and refs_of_tdef_kind _s _k = ()
40334033and refs_of_tdef s ( td : ILTypeDef ) =
40344034 refs_ of_ types s td.NestedTypes
40354035 refs_ of_ genparams s td.GenericParams
4036- refs _ of _ typs s td.Implements
4036+ refs _ of _ tys s td.Implements
40374037 Option.iter( refs_ of_ typ s) td.Extends
40384038 refs_ of_ mdefs s td.Methods
40394039 refs_ of_ fields s td.Fields.AsList
@@ -4133,8 +4133,8 @@ let rec unscopeILTypeSpec (tspec:ILTypeSpec) =
41334133let tref = unscopeILTypeRef tref
41344134 ILTypeSpec.Create( tref, unscopeILTypes tinst)
41354135
4136- and unscopeILType typ =
4137- match typ with
4136+ and unscopeILType ty =
4137+ match ty with
41384138| ILType.Ptr t-> ILType.Ptr( unscopeILType t)
41394139| ILType.FunctionPointer t-> ILType.FunctionPointer( unscopeILCallSig t)
41404140| ILType.Byref t-> ILType.Byref( unscopeILType t)