提交 e2d83009 编写于 作者: P Phillip Carter 提交者: Kevin Ransom (msft)

Remove some asses from the codebase (#5975)

* Remove some asses from the codebase

* Remove more asses
上级 5a54ebd3
......@@ -175,8 +175,8 @@ argTy1c.TypeDefinition.CompiledName // "Int32"
*)
let projectContext = checkFileResults.ProjectContext
for ass in projectContext.GetReferencedAssemblies() do
match ass.FileName with
for assembly in projectContext.GetReferencedAssemblies() do
match assembly.FileName with
| None -> printfn "コンパイル時にファイルの存在しないアセンブリを参照しました"
| Some s -> printfn "コンパイル時にアセンブリ '%s' を参照しました" s
......
......@@ -168,8 +168,8 @@ used in the compilation, called the `ProjectContext`:
*)
let projectContext = checkFileResults.ProjectContext
for ass in projectContext.GetReferencedAssemblies() do
match ass.FileName with
for assembly in projectContext.GetReferencedAssemblies() do
match assembly.FileName with
| None -> printfn "compilation referenced an assembly without a file"
| Some s -> printfn "compilation references assembly '%s'" s
......
......@@ -2330,7 +2330,7 @@ let mkILNonGenericValueTy tref = mkILNamedTy AsValue tref []
let mkILNonGenericBoxedTy tref = mkILNamedTy AsObject tref []
let mkSimpleAssRef n =
let mkSimpleAssemblyRef n =
ILAssemblyRef.Create(n, None, None, false, None, None)
let mkSimpleModRef n =
......@@ -3191,9 +3191,9 @@ let destTypeDefsWithGlobalFunctionsFirst ilg (tdefs: ILTypeDefs) =
let top2 = if isNil top then [ mkILTypeDefForGlobalFunctions ilg (emptyILMethods, emptyILFields) ] else top
top2@nontop
let mkILSimpleModule assname modname dll subsystemVersion useHighEntropyVA tdefs hashalg locale flags exportedTypes metadataVersion =
let mkILSimpleModule assemblyName modname dll subsystemVersion useHighEntropyVA tdefs hashalg locale flags exportedTypes metadataVersion =
let manifest =
{ Name=assname
{ Name=assemblyName
AuxModuleHashAlgorithm= match hashalg with | Some(alg) -> alg | _ -> 0x8004 // SHA1
SecurityDeclsStored=emptyILSecurityDeclsStored
PublicKey= None
......@@ -3921,13 +3921,13 @@ let emptyILRefs =
ModuleReferences = [] }
(* Now find references. *)
let refs_of_assref (s:ILReferencesAccumulator) x = s.refsA.Add x |> ignore
let refs_of_assemblyRef (s:ILReferencesAccumulator) x = s.refsA.Add x |> ignore
let refs_of_modref (s:ILReferencesAccumulator) x = s.refsM.Add x |> ignore
let refs_of_scoref s x =
match x with
| ILScopeRef.Local -> ()
| ILScopeRef.Assembly assref -> refs_of_assref s assref
| ILScopeRef.Assembly assemblyRef -> refs_of_assemblyRef s assemblyRef
| ILScopeRef.Module modref -> refs_of_modref s modref
let refs_of_tref s (x:ILTypeRef) = refs_of_scoref s x.Scope
......@@ -4099,7 +4099,7 @@ and refs_of_resource_where s x =
| ILResourceLocation.LocalIn _ -> ()
| ILResourceLocation.LocalOut _ -> ()
| ILResourceLocation.File (mref, _) -> refs_of_modref s mref
| ILResourceLocation.Assembly aref -> refs_of_assref s aref
| ILResourceLocation.Assembly aref -> refs_of_assemblyRef s aref
and refs_of_resource s x =
refs_of_resource_where s x.Location
......
......@@ -1605,7 +1605,7 @@ val decodeILAttribData:
ILAttributeNamedArg list (* named args: values and flags indicating if they are fields or properties *)
/// Generate simple references to assemblies and modules.
val mkSimpleAssRef: string -> ILAssemblyRef
val mkSimpleAssemblyRef: string -> ILAssemblyRef
val mkSimpleModRef: string -> ILModuleRef
......
......@@ -986,7 +986,7 @@ let output_publickeyinfo os = function
| PublicKey k -> output_publickey os k
| PublicKeyToken k -> output_publickeytoken os k
let output_assref os (aref:ILAssemblyRef) =
let output_assemblyRef os (aref:ILAssemblyRef) =
output_string os " .assembly extern ";
output_sqstring os aref.Name;
if aref.Retargetable then output_string os " retargetable ";
......@@ -1056,7 +1056,7 @@ let output_module_fragment os (ilg: ILGlobals) modul =
refs
let output_module_refs os refs =
List.iter (fun x -> output_assref os x; output_string os "\n") refs.AssemblyReferences;
List.iter (fun x -> output_assemblyRef os x; output_string os "\n") refs.AssemblyReferences;
List.iter (fun x -> output_modref os x; output_string os "\n") refs.ModuleReferences
let goutput_module_manifest env os modul =
......
......@@ -2674,9 +2674,9 @@ type AssemblyResolution =
member this.GetILAssemblyRef(ctok, reduceMemoryUsage, tryGetMetadataSnapshot) =
cancellable {
match !this.ilAssemblyRef with
| Some(assref) -> return assref
| Some(assemblyRef) -> return assemblyRef
| None ->
let! assRefOpt =
let! assemblyRefOpt =
cancellable {
match this.ProjectReference with
| Some r ->
......@@ -2689,8 +2689,8 @@ type AssemblyResolution =
| _ -> return None
| None -> return None
}
let assRef =
match assRefOpt with
let assemblyRef =
match assemblyRefOpt with
| Some aref -> aref
| None ->
let readerSettings : ILReaderOptions =
......@@ -2701,8 +2701,8 @@ type AssemblyResolution =
tryGetMetadataSnapshot = tryGetMetadataSnapshot }
use reader = OpenILModuleReader this.resolvedPath readerSettings
mkRefToILAssembly reader.ILModuleDef.ManifestOfAssembly
this.ilAssemblyRef := Some(assRef)
return assRef
this.ilAssemblyRef := Some(assemblyRef)
return assemblyRef
}
//----------------------------------------------------------------------------
......@@ -3655,10 +3655,10 @@ type TcAssemblyResolutions(tcConfig: TcConfig, results: AssemblyResolution list,
member tcResolutions.TryFindByOriginalReference(assemblyReference:AssemblyReference) = originalReferenceToResolution.TryFind assemblyReference.Text
/// This doesn't need to be cancellable, it is only used by F# Interactive
member tcResolution.TryFindByExactILAssemblyRef (ctok, assref) =
member tcResolution.TryFindByExactILAssemblyRef (ctok, assemblyRef) =
results |> List.tryFind (fun ar->
let r = ar.GetILAssemblyRef(ctok, tcConfig.reduceMemoryUsage, tcConfig.tryGetMetadataSnapshot) |> Cancellable.runWithoutCancellation
r = assref)
r = assemblyRef)
/// This doesn't need to be cancellable, it is only used by F# Interactive
member tcResolution.TryFindBySimpleAssemblyName (ctok, simpleAssemName) =
......@@ -4026,11 +4026,11 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti
| ResolvedImportedAssembly(importedAssembly) -> ResolvedCcu(importedAssembly.FSharpViewOfMetadata)
| UnresolvedImportedAssembly(assemblyName) -> UnresolvedCcu(assemblyName)
member tcImports.FindCcuFromAssemblyRef(ctok, m, assref:ILAssemblyRef) =
member tcImports.FindCcuFromAssemblyRef(ctok, m, assemblyRef:ILAssemblyRef) =
CheckDisposed()
match tcImports.FindCcuInfo(ctok, m, assref.Name, lookupOnly=false) with
match tcImports.FindCcuInfo(ctok, m, assemblyRef.Name, lookupOnly=false) with
| ResolvedImportedAssembly(importedAssembly) -> ResolvedCcu(importedAssembly.FSharpViewOfMetadata)
| UnresolvedImportedAssembly _ -> UnresolvedCcu(assref.QualifiedName)
| UnresolvedImportedAssembly _ -> UnresolvedCcu(assemblyRef.QualifiedName)
#if !NO_EXTENSIONTYPING
......@@ -4641,8 +4641,8 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti
resolutions.TryFindBySimpleAssemblyName (ctok, simpleAssemName) |> Option.map (fun r -> r.resolvedPath)
/// This doesn't need to be cancellable, it is only used by F# Interactive
member tcImports.TryFindExistingFullyQualifiedPathByExactAssemblyRef(ctok, assref:ILAssemblyRef) : string option =
resolutions.TryFindByExactILAssemblyRef (ctok, assref) |> Option.map (fun r -> r.resolvedPath)
member tcImports.TryFindExistingFullyQualifiedPathByExactAssemblyRef(ctok, assemblyRef:ILAssemblyRef) : string option =
resolutions.TryFindByExactILAssemblyRef (ctok, assemblyRef) |> Option.map (fun r -> r.resolvedPath)
member tcImports.TryResolveAssemblyReference(ctok, assemblyReference:AssemblyReference, mode:ResolveAssemblyReferenceMode) : OperationResult<AssemblyResolution list> =
let tcConfig = tcConfigP.Get(ctok)
......
......@@ -850,8 +850,8 @@ let postTransformExpr (penv:penv) expr =
| _ -> None
let passImplFile penv ass =
ass |> RewriteImplFile {PreIntercept =None
let passImplFile penv assembly =
assembly |> RewriteImplFile {PreIntercept =None
PreInterceptBinding=None
PostTransform= postTransformExpr penv
IsUnderQuotations=false }
......
......@@ -1322,19 +1322,19 @@ module Patterns =
// typeof<int>.MakeArrayType(1) returns "Int[*]" but we need "Int[]"
| _ -> invalidArg "tys" (SR.GetString(SR.QexpectedOneType))
let mkNamedTycon (tcName,ass:Assembly) =
match ass.GetType(tcName) with
let mkNamedTycon (tcName,assembly:Assembly) =
match assembly.GetType(tcName) with
| null ->
// For some reason we can get 'null' returned here even when a type with the right name exists... Hence search the slow way...
match (ass.GetTypes() |> Array.tryFind (fun a -> a.FullName = tcName)) with
match (assembly.GetTypes() |> Array.tryFind (fun a -> a.FullName = tcName)) with
| Some ty -> ty
| None -> invalidArg "tcName" (String.Format(SR.GetString(SR.QfailedToBindTypeInAssembly), tcName, ass.FullName)) // "Available types are:\n%A" tcName ass (ass.GetTypes() |> Array.map (fun a -> a.FullName))
| None -> invalidArg "tcName" (String.Format(SR.GetString(SR.QfailedToBindTypeInAssembly), tcName, assembly.FullName)) // "Available types are:\n%A" tcName assembly (assembly.GetTypes() |> Array.map (fun a -> a.FullName))
| ty -> ty
let decodeNamedTy tc tsR = mkNamedType(tc,tsR)
let mscorlib = typeof<System.Int32>.Assembly
let u_assref st = u_string st
let u_assemblyRef st = u_string st
let decodeAssemblyRef st a =
if a = "" then mscorlib
elif a = "." then st.localAssembly
......@@ -1345,10 +1345,10 @@ module Patterns =
match System.Reflection.Assembly.Load(a) with
#endif
| null -> raise <| System.InvalidOperationException(String.Format(SR.GetString(SR.QfailedToBindAssembly), a.ToString()))
| ass -> ass
| assembly -> assembly
let u_NamedType st =
let a,b = u_tup2 u_string u_assref st
let a,b = u_tup2 u_string u_assemblyRef st
let mutable idx = 0
// From FSharp.Core for F# 4.0+ (4.4.0.0+), referenced type definitions can be integer indexes into a table of type definitions provided on quotation
// deserialization, avoiding the need for System.Reflection.Assembly.Load
......@@ -1358,8 +1358,8 @@ module Patterns =
// escape commas found in type name, which are not already escaped
// '\' is not valid in a type name except as an escape character, so logic can be pretty simple
let escapedTcName = System.Text.RegularExpressions.Regex.Replace(a, @"(?<!\\),", @"\,")
let assref = decodeAssemblyRef st b
mkNamedTycon (escapedTcName, assref)
let assemblyRef = decodeAssemblyRef st b
mkNamedTycon (escapedTcName, assemblyRef)
let u_tyconstSpec st =
let tag = u_byte_as_int st
......
......@@ -52,11 +52,11 @@ let InterceptExpr g cont expr =
/// known arity to lambda expressions and beta-var-reduces to bind
/// any known arguments. The results are later optimized by the peephole
/// optimizer in opt.fs
let LowerImplFile g ass =
let LowerImplFile g assembly =
RewriteImplFile { PreIntercept = Some(InterceptExpr g)
PreInterceptBinding=None
PostTransform= (fun _ -> None)
IsUnderQuotations=false } ass
IsUnderQuotations=false } assembly
//----------------------------------------------------------------------------
......@@ -512,12 +512,12 @@ let LowerSeqExpr g amap overallExpr =
// Note, however, this leads to a loss of tailcalls: the case not
// handled correctly yet is sequence expressions that use yield! in the last position
// This can give rise to infinite iterator chains when implemented by the naive expansion to
// for x in e yield e. For example consider this:
// �for x in e yield e�. For example consider this:
//
// let rec rwalk x = { yield x
// yield! rwalk (x + rand()) }
//
// This is the moral equivalent of a tailcall optimization. These also dont compile well
// This is the moral equivalent of a tailcall optimization. These also don�t compile well
// in the C# compilation model
| arbitrarySeqExpr ->
......
......@@ -304,12 +304,12 @@ module SimplePickle =
open SimplePickle
let p_assref x st = p_string x st
let p_assemblyref x st = p_string x st
let p_NamedType x st =
match x with
| Idx n -> p_tup2 p_string p_assref (string n, "") st
| Named (nm,ass) -> p_tup2 p_string p_assref (nm, ass) st
| Idx n -> p_tup2 p_string p_assemblyref (string n, "") st
| Named (nm,a) -> p_tup2 p_string p_assemblyref (nm, a) st
let p_tycon x st =
match x with
......
......@@ -978,12 +978,12 @@ and ConvILTypeRef cenv (tr:ILTypeRef) =
QP.Idx idx
| QuotationSerializationFormat.FSharp_20_Plus ->
let assref =
let assemblyRef =
match tr.Scope with
| ILScopeRef.Local -> "."
| _ -> tr.Scope.QualifiedName
QP.Named(tr.BasicQualifiedName, assref)
QP.Named(tr.BasicQualifiedName, assemblyRef)
and ConvVoidType cenv m = QP.mkILNamedTy(ConvTyconRef cenv cenv.g.system_Void_tcref m, [])
......
......@@ -186,8 +186,8 @@ let internal GetBestAvailableResolver() =
let tryMSBuild v =
// Detect if MSBuild is on the machine, if so use the resolver from there
let mb = try Assembly.Load(sprintf "Microsoft.Build.Framework, Version=%s.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" v) |> Option.ofObj with _ -> None
let ass = mb |> Option.bind (fun _ -> try Assembly.Load(sprintf "FSharp.Compiler.Service.MSBuild.v%s" v) |> Option.ofObj with _ -> None)
let ty = ass |> Option.bind (fun ass -> ass.GetType("Microsoft.FSharp.Compiler.MSBuildReferenceResolver") |> Option.ofObj)
let assembly = mb |> Option.bind (fun _ -> try Assembly.Load(sprintf "FSharp.Compiler.Service.MSBuild.v%s" v) |> Option.ofObj with _ -> None)
let ty = assembly |> Option.bind (fun a -> a.GetType("Microsoft.FSharp.Compiler.MSBuildReferenceResolver") |> Option.ofObj)
let obj = ty |> Option.bind (fun ty -> ty.InvokeMember("get_Resolver",BindingFlags.Static ||| BindingFlags.Public ||| BindingFlags.InvokeMethod ||| BindingFlags.NonPublic, null, null, [| |]) |> Option.ofObj)
let resolver = obj |> Option.bind (fun obj -> match obj with :? Resolver as r -> Some r | _ -> None)
resolver
......
......@@ -255,7 +255,7 @@ type public TcGlobals(compilingFslib: bool, ilg:ILGlobals, fslibCcu: CcuThunk, d
let path, typeName = splitILTypeName nm
let scoref =
match tryFindSysTypeCcu path typeName with
| None -> ILScopeRef.Assembly (mkSimpleAssRef (dummyAssemblyNameCarryingUsefulErrorInformation path typeName))
| None -> ILScopeRef.Assembly (mkSimpleAssemblyRef (dummyAssemblyNameCarryingUsefulErrorInformation path typeName))
| Some ccu -> ccu.ILScopeRef
mkILTyRef (scoref, nm)
......
......@@ -62,13 +62,13 @@ let CanImportILScopeRef (env:ImportMap) m scoref =
match scoref with
| ILScopeRef.Local -> true
| ILScopeRef.Module _ -> true
| ILScopeRef.Assembly assref ->
| ILScopeRef.Assembly assemblyRef ->
// Explanation: This represents an unchecked invariant in the hosted compiler: that any operations
// which import types (and resolve assemblies from the tcImports tables) happen on the compilation thread.
let ctok = AssumeCompilationThreadWithoutEvidence()
match env.assemblyLoader.FindCcuFromAssemblyRef (ctok, m, assref) with
match env.assemblyLoader.FindCcuFromAssemblyRef (ctok, m, assemblyRef) with
| UnresolvedCcu _ -> false
| ResolvedCcu _ -> true
......@@ -84,7 +84,7 @@ let ImportTypeRefData (env:ImportMap) m (scoref,path,typeName) =
match scoref with
| ILScopeRef.Local -> error(InternalError("ImportILTypeRef: unexpected local scope",m))
| ILScopeRef.Module _ -> error(InternalError("ImportILTypeRef: reference found to a type in an auxiliary module",m))
| ILScopeRef.Assembly assref -> env.assemblyLoader.FindCcuFromAssemblyRef (ctok, m, assref) // NOTE: only assemblyLoader callsite
| ILScopeRef.Assembly assemblyRef -> env.assemblyLoader.FindCcuFromAssemblyRef (ctok, m, assemblyRef) // NOTE: only assemblyLoader callsite
// Do a dereference of a fake tcref for the type just to check it exists in the target assembly and to find
// the corresponding Tycon.
......
......@@ -1496,7 +1496,7 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput
tcState.Ccu.Deref.Contents <- oldContents
with e ->
errorRecoveryNoRange e
mkSimpleAssRef assemblyName, None, None
mkSimpleAssemblyRef assemblyName, None, None
let finalAccWithErrors =
{ finalAcc with
......
......@@ -1159,22 +1159,22 @@ type TypeCheckInfo
match item.Item with
| Item.CtorGroup (_, (ILMeth (_,ilinfo,_)) :: _) ->
match ilinfo.MetadataScope with
| ILScopeRef.Assembly assref ->
| ILScopeRef.Assembly assemblyRef ->
let typeVarNames = getTypeVarNames ilinfo
ParamTypeSymbol.tryOfILTypes typeVarNames ilinfo.ILMethodRef.ArgTypes
|> Option.map (fun args ->
let externalSym = ExternalSymbol.Constructor (ilinfo.ILMethodRef.DeclaringTypeRef.FullName, args)
FSharpFindDeclResult.ExternalDecl (assref.Name, externalSym))
FSharpFindDeclResult.ExternalDecl (assemblyRef.Name, externalSym))
| _ -> None
| Item.MethodGroup (name, (ILMeth (_,ilinfo,_)) :: _, _) ->
match ilinfo.MetadataScope with
| ILScopeRef.Assembly assref ->
| ILScopeRef.Assembly assemblyRef ->
let typeVarNames = getTypeVarNames ilinfo
ParamTypeSymbol.tryOfILTypes typeVarNames ilinfo.ILMethodRef.ArgTypes
|> Option.map (fun args ->
let externalSym = ExternalSymbol.Method (ilinfo.ILMethodRef.DeclaringTypeRef.FullName, name, args, ilinfo.ILMethodRef.GenericArity)
FSharpFindDeclResult.ExternalDecl (assref.Name, externalSym))
FSharpFindDeclResult.ExternalDecl (assemblyRef.Name, externalSym))
| _ -> None
| Item.Property (name, ILProp propInfo :: _) ->
......@@ -1186,24 +1186,24 @@ type TypeCheckInfo
match methInfo with
| Some methInfo ->
match methInfo.MetadataScope with
| ILScopeRef.Assembly assref ->
| ILScopeRef.Assembly assemblyRef ->
let externalSym = ExternalSymbol.Property (methInfo.ILMethodRef.DeclaringTypeRef.FullName, name)
Some (FSharpFindDeclResult.ExternalDecl (assref.Name, externalSym))
Some (FSharpFindDeclResult.ExternalDecl (assemblyRef.Name, externalSym))
| _ -> None
| None -> None
| Item.ILField (ILFieldInfo (typeInfo, fieldDef)) when not typeInfo.TyconRefOfRawMetadata.IsLocalRef ->
match typeInfo.ILScopeRef with
| ILScopeRef.Assembly assref ->
| ILScopeRef.Assembly assemblyRef ->
let externalSym = ExternalSymbol.Field (typeInfo.ILTypeRef.FullName, fieldDef.Name)
Some (FSharpFindDeclResult.ExternalDecl (assref.Name, externalSym))
Some (FSharpFindDeclResult.ExternalDecl (assemblyRef.Name, externalSym))
| _ -> None
| Item.Event (ILEvent (ILEventInfo (typeInfo, eventDef))) when not typeInfo.TyconRefOfRawMetadata.IsLocalRef ->
match typeInfo.ILScopeRef with
| ILScopeRef.Assembly assref ->
| ILScopeRef.Assembly assemblyRef ->
let externalSym = ExternalSymbol.Event (typeInfo.ILTypeRef.FullName, eventDef.Name)
Some (FSharpFindDeclResult.ExternalDecl (assref.Name, externalSym))
Some (FSharpFindDeclResult.ExternalDecl (assemblyRef.Name, externalSym))
| _ -> None
| Item.ImplicitOp(_, {contents = Some(TraitConstraintSln.FSMethSln(_, _vref, _))}) ->
......@@ -1214,9 +1214,9 @@ type TypeCheckInfo
| Item.Types (_, [ AppTy g (tr, _) ]) when not tr.IsLocalRef ->
match tr.TypeReprInfo, tr.PublicPath with
| TILObjectRepr(TILObjectReprData (ILScopeRef.Assembly assref, _, _)), Some (PubPath parts) ->
| TILObjectRepr(TILObjectReprData (ILScopeRef.Assembly assemblyRef, _, _)), Some (PubPath parts) ->
let fullName = parts |> String.concat "."
Some (FSharpFindDeclResult.ExternalDecl (assref.Name, ExternalSymbol.Type fullName))
Some (FSharpFindDeclResult.ExternalDecl (assemblyRef.Name, ExternalSymbol.Type fullName))
| _ -> None
| _ -> None
match result with
......@@ -3341,7 +3341,7 @@ type FsiInteractiveChecker(legacyReferenceResolver, reactorOps: IReactorOperatio
let projectResults =
FSharpCheckProjectResults (filename, Some tcConfig, keepAssemblyContents, errors,
Some(tcGlobals, tcImports, tcFileInfo.ThisCcu, tcFileInfo.CcuSigForFile,
[tcFileInfo.ScopeSymbolUses], None, None, mkSimpleAssRef "stdin",
[tcFileInfo.ScopeSymbolUses], None, None, mkSimpleAssemblyRef "stdin",
tcState.TcEnvFromImpls.AccessRights, None, dependencyFiles))
parseResults, typeCheckResults, projectResults
| _ ->
......
......@@ -22,7 +22,7 @@ let ilxFsharpCoreLibScopeRef () =
if !ilxCompilingFSharpCoreLib then
ILScopeRef.Local
else
let assref =
let assemblyRef =
match !ilxFsharpCoreLibAssemRef with
| Some o -> o
| None ->
......@@ -34,6 +34,6 @@ let ilxFsharpCoreLibScopeRef () =
Some (PublicKeyToken(Bytes.ofInt32Array [| 0xb0; 0x3f; 0x5f; 0x7f; 0x11; 0xd5; 0x0a; 0x3a |])),
false,
Some (IL.parseILVersion "0.0.0.0"), None)
ILScopeRef.Assembly assref
ILScopeRef.Assembly assemblyRef
let ilxNamespace () = "Microsoft.FSharp.Core"
\ No newline at end of file
......@@ -8409,8 +8409,8 @@ namespace ProviderImplementation.ProvidedTypes
| None -> None
| Some _ ->
let m = mdef.ManifestOfAssembly
let assRef = ILAssemblyRef(m.Name, UNone, (match m.PublicKey with USome k -> USome (PublicKey.KeyAsToken(k)) | UNone -> UNone), m.Retargetable, m.Version, m.Locale)
Some (ILScopeRef.Assembly assRef)
let assemblyRef = ILAssemblyRef(m.Name, UNone, (match m.PublicKey with USome k -> USome (PublicKey.KeyAsToken(k)) | UNone -> UNone), m.Retargetable, m.Version, m.Locale)
Some (ILScopeRef.Assembly assemblyRef)
else
None
with _ -> None )
......
......@@ -206,12 +206,12 @@ end
do ()
type dummy = Dummy
let ass = typeof<dummy>.Assembly
let assembly = typeof<dummy>.Assembly
// Assembly attributes are currently ignored by F# Interactive, so this test
// fails. We ignore the failure.
#if COMPILED
let ca = ass.GetCustomAttributes(typeof<System.Reflection.AssemblyTitleAttribute>,false)
let ca = assembly.GetCustomAttributes(typeof<System.Reflection.AssemblyTitleAttribute>,false)
do if Array.length ca <> 1 then failwith "could not find CA on assembly"
#endif
......@@ -809,12 +809,12 @@ module Bug1437_PS_FSharp1_0_AttributesWithArrayArguments = begin
[<assembly:AttributeWithArrayArg ([|0;1;2|])>]
do ()
let ass = typeof<AttributeWithArrayArgAttribute>.Assembly
let assembly = typeof<AttributeWithArrayArgAttribute>.Assembly
// Assembly attributes are currently ignored by F# Interactive, so this test
// fails. We ignore the failure.
#if COMPILED
let ca = ass.GetCustomAttributes(typeof<AttributeWithArrayArgAttribute>,false)
let ca = assembly.GetCustomAttributes(typeof<AttributeWithArrayArgAttribute>,false)
let _ = check "ce99pj32cweq" (Array.length ca) 1
#endif
end
......
......@@ -1872,14 +1872,14 @@ let mk_empty_gactuals = ([]: genactuals)
let mk_mono_tspec tref = TypeSpec (tref, mk_empty_gactuals)
let mscorlib_assembly_name = "mscorlib"
let mscorlib_module_name = "CommonLanguageRuntimeLibrary"
let mk_simple_assref n =
let mk_simple_assemblyRef n =
{ assemRefName=n;
assemRefHash=None;
assemRefPublicKeyToken=None;
assemRefPublicKey=None;
assemRefVersion=None;
assemRefLocale=None; }
let mscorlib_aref = mk_simple_assref mscorlib_assembly_name
let mscorlib_aref = mk_simple_assemblyRef mscorlib_assembly_name
let mscorlib_scoref = ScopeRef(mscorlib_aref,None)
let mk_nested_tref (scope,l,nm) = TypeRef (scope,l,nm)
let mk_tref (scope,nm) = mk_nested_tref (scope,[],nm)
......
......@@ -1271,7 +1271,7 @@ type modul =
val manifest_of_mainmod: modul -> manifest
val module_is_mainmod: modul -> bool
val assname_of_mainmod: modul -> AssemblyName
val assemblyName_of_mainmod: modul -> AssemblyName
(* ====================================================================
* PART 2
......@@ -1285,14 +1285,14 @@ val assname_of_mainmod: modul -> AssemblyName
* Generate references to existing assemblies and modules
* -------------------------------------------------------------------- *)
val mk_simple_assref: AssemblyName -> AssemblyRef
val mk_simple_assemblyRef: AssemblyName -> AssemblyRef
val mk_simple_modref: ModuleName -> ModuleRef
val mk_simple_scoref_from_assname: AssemblyName -> ScopeRef
val mk_simple_scoref_from_assref: AssemblyRef -> ScopeRef
val mk_simple_scoref_from_assemblyName: AssemblyName -> ScopeRef
val mk_simple_scoref_from_assemblyRef: AssemblyRef -> ScopeRef
val assref_for_manifest: manifest -> AssemblyRef
val assref_for_mainmod: modul -> AssemblyRef
val assemblyRef_for_manifest: manifest -> AssemblyRef
val assemblyRef_for_mainmod: modul -> AssemblyRef
(* --------------------------------------------------------------------
* Take apart MethodSpecs
......
......@@ -13,8 +13,8 @@ let foreachE (e : System.Collections.IEnumerator) (f : 'a -> unit) =
let main() =
let ass = (typeof<Resources>).Assembly in
Printf.printf "ass = %s\n" (ass.ToString());
let assembly = (typeof<Resources>).Assembly in
Printf.printf "assembly = %s\n" (assembly.ToString());
let args = System.Environment.GetCommandLineArgs() in
let rname = if Array.length args > 1 then args.[1] else "Resources" in
let resourceMan = new System.Resources.ResourceManager(rname, (typeof<Resources>).Assembly) in
......
......@@ -67,8 +67,8 @@ let internal getProjectReferences (content, dllFiles, libDirs, otherFlags) =
let ``Test that csharp references are recognized as such`` () =
let csharpAssembly = PathRelativeToTestAssembly "CSharp_Analysis.dll"
let _, table = getProjectReferences("""module M""", [csharpAssembly], None, None)
let ass = table.["CSharp_Analysis"]
let search = ass.Contents.Entities |> Seq.tryFind (fun e -> e.DisplayName = "CSharpClass")
let assembly = table.["CSharp_Analysis"]
let search = assembly.Contents.Entities |> Seq.tryFind (fun e -> e.DisplayName = "CSharpClass")
Assert.True search.IsSome
let found = search.Value
// this is no F# thing
......
......@@ -70,8 +70,8 @@ type References() =
DoWithTempFile "Test.fsproj" (fun projFile ->
File.AppendAllText(projFile, TheTests.SimpleFsprojText([], [], ""))
use project = TheTests.CreateProject(projFile)
let assName = new AssemblyName(typeof<System.Windows.Forms.Form>.Assembly.FullName)
let selectorData = new VSCOMPONENTSELECTORDATA(``type`` = VSCOMPONENTTYPE.VSCOMPONENTTYPE_ComPlus, bstrFile = "*" + assName.FullName)
let assemblyName = new AssemblyName(typeof<System.Windows.Forms.Form>.Assembly.FullName)
let selectorData = new VSCOMPONENTSELECTORDATA(``type`` = VSCOMPONENTTYPE.VSCOMPONENTTYPE_ComPlus, bstrFile = "*" + assemblyName.FullName)
let refContainer = GetReferenceContainerNode(project)
refContainer.AddReferenceFromSelectorData(selectorData) |> Assert.IsNotNull
let l = new List<AssemblyReferenceNode>()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册