Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dotNET Platform
fsharp
提交
e2d83009
F
fsharp
项目概览
dotNET Platform
/
fsharp
12 个月 前同步成功
通知
0
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
fsharp
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e2d83009
编写于
12月 05, 2018
作者:
P
Phillip Carter
提交者:
Kevin Ransom (msft)
12月 05, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove some asses from the codebase (#5975)
* Remove some asses from the codebase * Remove more asses
上级
5a54ebd3
变更
24
隐藏空白更改
内联
并排
Showing
24 changed file
with
91 addition
and
91 deletion
+91
-91
fcs/docsrc/content/ja/symbols.fsx
fcs/docsrc/content/ja/symbols.fsx
+2
-2
fcs/docsrc/content/symbols.fsx
fcs/docsrc/content/symbols.fsx
+2
-2
src/absil/il.fs
src/absil/il.fs
+6
-6
src/absil/il.fsi
src/absil/il.fsi
+1
-1
src/absil/ilprint.fs
src/absil/ilprint.fs
+2
-2
src/fsharp/CompileOps.fs
src/fsharp/CompileOps.fs
+13
-13
src/fsharp/DetupleArgs.fs
src/fsharp/DetupleArgs.fs
+5
-5
src/fsharp/FSharp.Core/quotations.fs
src/fsharp/FSharp.Core/quotations.fs
+9
-9
src/fsharp/LowerCallsAndSeqs.fs
src/fsharp/LowerCallsAndSeqs.fs
+4
-4
src/fsharp/QuotationPickler.fs
src/fsharp/QuotationPickler.fs
+3
-3
src/fsharp/QuotationTranslator.fs
src/fsharp/QuotationTranslator.fs
+2
-2
src/fsharp/SimulatedMSBuildReferenceResolver.fs
src/fsharp/SimulatedMSBuildReferenceResolver.fs
+2
-2
src/fsharp/TcGlobals.fs
src/fsharp/TcGlobals.fs
+1
-1
src/fsharp/import.fs
src/fsharp/import.fs
+3
-3
src/fsharp/service/IncrementalBuild.fs
src/fsharp/service/IncrementalBuild.fs
+1
-1
src/fsharp/service/service.fs
src/fsharp/service/service.fs
+13
-13
src/ilx/ilxsettings.fs
src/ilx/ilxsettings.fs
+2
-2
tests/EndToEndBuildTests/ProvidedTypes/ProvidedTypes.fs
tests/EndToEndBuildTests/ProvidedTypes/ProvidedTypes.fs
+2
-2
tests/fsharp/core/attributes/test.fsx
tests/fsharp/core/attributes/test.fsx
+4
-4
tests/fsharp/core/libtest/test.fsx
tests/fsharp/core/libtest/test.fsx
+2
-2
tests/fsharp/core/members/absil.fsi
tests/fsharp/core/members/absil.fsi
+6
-6
tests/fsharp/core/resources/test.fs
tests/fsharp/core/resources/test.fs
+2
-2
tests/service/CSharpProjectAnalysis.fs
tests/service/CSharpProjectAnalysis.fs
+2
-2
vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.References.fs
...sts/LegacyProjectSystem/Tests.ProjectSystem.References.fs
+2
-2
未找到文件。
fcs/docsrc/content/ja/symbols.fsx
浏览文件 @
e2d83009
...
...
@@ -175,8 +175,8 @@ argTy1c.TypeDefinition.CompiledName // "Int32"
*)
let
projectContext
=
checkFileResults
.
ProjectContext
for
ass
in
projectContext
.
GetReferencedAssemblies
()
do
match
ass
.
FileName
with
for
ass
embly
in
projectContext
.
GetReferencedAssemblies
()
do
match
ass
embly
.
FileName
with
|
None
->
printfn
"コンパイル時にファイルの存在しないアセンブリを参照しました"
|
Some
s
->
printfn
"コンパイル時にアセンブリ '%s' を参照しました"
s
...
...
fcs/docsrc/content/symbols.fsx
浏览文件 @
e2d83009
...
...
@@ -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
ass
embly
in
projectContext
.
GetReferencedAssemblies
()
do
match
ass
embly
.
FileName
with
|
None
->
printfn
"compilation referenced an assembly without a file"
|
Some
s
->
printfn
"compilation references assembly '%s'"
s
...
...
src/absil/il.fs
浏览文件 @
e2d83009
...
...
@@ -2330,7 +2330,7 @@ let mkILNonGenericValueTy tref = mkILNamedTy AsValue tref []
let
mkILNonGenericBoxedTy
tref
=
mkILNamedTy
AsObject
tref
[]
let
mkSimpleAssRef
n
=
let
mkSimpleAss
embly
Ref
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
ass
n
ame
modname
dll
subsystemVersion
useHighEntropyVA
tdefs
hashalg
locale
flags
exportedTypes
metadataVersion
=
let
mkILSimpleModule
ass
emblyN
ame
modname
dll
subsystemVersion
useHighEntropyVA
tdefs
hashalg
locale
flags
exportedTypes
metadataVersion
=
let
manifest
=
{
Name
=
ass
n
ame
{
Name
=
ass
emblyN
ame
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_ass
r
ef
(
s
:
ILReferencesAccumulator
)
x
=
s
.
refsA
.
Add
x
|>
ignore
let
refs_of_ass
emblyR
ef
(
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
ass
ref
->
refs_of_assref
s
assr
ef
|
ILScopeRef
.
Assembly
ass
emblyRef
->
refs_of_assemblyRef
s
assemblyR
ef
|
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_ass
r
ef
s
aref
|
ILResourceLocation
.
Assembly
aref
->
refs_of_ass
emblyR
ef
s
aref
and
refs_of_resource
s
x
=
refs_of_resource_where
s
x
.
Location
...
...
src/absil/il.fsi
浏览文件 @
e2d83009
...
...
@@ -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
mkSimpleAss
embly
Ref
:
string
->
ILAssemblyRef
val
mkSimpleModRef
:
string
->
ILModuleRef
...
...
src/absil/ilprint.fs
浏览文件 @
e2d83009
...
...
@@ -986,7 +986,7 @@ let output_publickeyinfo os = function
|
PublicKey
k
->
output_publickey
os
k
|
PublicKeyToken
k
->
output_publickeytoken
os
k
let
output_ass
r
ef
os
(
aref
:
ILAssemblyRef
)
=
let
output_ass
emblyR
ef
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_ass
r
ef
os
x
;
output_string
os
"
\n
"
)
refs
.
AssemblyReferences
;
List
.
iter
(
fun
x
->
output_ass
emblyR
ef
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
=
...
...
src/fsharp/CompileOps.fs
浏览文件 @
e2d83009
...
...
@@ -2674,9 +2674,9 @@ type AssemblyResolution =
member
this
.
GetILAssemblyRef
(
ctok
,
reduceMemoryUsage
,
tryGetMetadataSnapshot
)
=
cancellable
{
match
!
this
.
ilAssemblyRef
with
|
Some
(
ass
ref
)
->
return
assr
ef
|
Some
(
ass
emblyRef
)
->
return
assemblyR
ef
|
None
->
let
!
assRefOpt
=
let
!
ass
embly
RefOpt
=
cancellable
{
match
this
.
ProjectReference
with
|
Some
r
->
...
...
@@ -2689,8 +2689,8 @@ type AssemblyResolution =
|
_
->
return
None
|
None
->
return
None
}
let
assRef
=
match
assRefOpt
with
let
ass
embly
Ref
=
match
ass
embly
RefOpt
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
(
ass
embly
Ref
)
return
ass
embly
Ref
}
//----------------------------------------------------------------------------
...
...
@@ -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
,
ass
r
ef
)
=
member
tcResolution
.
TryFindByExactILAssemblyRef
(
ctok
,
ass
emblyR
ef
)
=
results
|>
List
.
tryFind
(
fun
ar
->
let
r
=
ar
.
GetILAssemblyRef
(
ctok
,
tcConfig
.
reduceMemoryUsage
,
tcConfig
.
tryGetMetadataSnapshot
)
|>
Cancellable
.
runWithoutCancellation
r
=
ass
r
ef
)
r
=
ass
emblyR
ef
)
/// 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
,
ass
r
ef
:
ILAssemblyRef
)
=
member
tcImports
.
FindCcuFromAssemblyRef
(
ctok
,
m
,
ass
emblyR
ef
:
ILAssemblyRef
)
=
CheckDisposed
()
match
tcImports
.
FindCcuInfo
(
ctok
,
m
,
ass
r
ef
.
Name
,
lookupOnly
=
false
)
with
match
tcImports
.
FindCcuInfo
(
ctok
,
m
,
ass
emblyR
ef
.
Name
,
lookupOnly
=
false
)
with
|
ResolvedImportedAssembly
(
importedAssembly
)
->
ResolvedCcu
(
importedAssembly
.
FSharpViewOfMetadata
)
|
UnresolvedImportedAssembly
_
->
UnresolvedCcu
(
ass
r
ef
.
QualifiedName
)
|
UnresolvedImportedAssembly
_
->
UnresolvedCcu
(
ass
emblyR
ef
.
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
,
ass
r
ef
:
ILAssemblyRef
)
:
string
option
=
resolutions
.
TryFindByExactILAssemblyRef
(
ctok
,
ass
r
ef
)
|>
Option
.
map
(
fun
r
->
r
.
resolvedPath
)
member
tcImports
.
TryFindExistingFullyQualifiedPathByExactAssemblyRef
(
ctok
,
ass
emblyR
ef
:
ILAssemblyRef
)
:
string
option
=
resolutions
.
TryFindByExactILAssemblyRef
(
ctok
,
ass
emblyR
ef
)
|>
Option
.
map
(
fun
r
->
r
.
resolvedPath
)
member
tcImports
.
TryResolveAssemblyReference
(
ctok
,
assemblyReference
:
AssemblyReference
,
mode
:
ResolveAssemblyReferenceMode
)
:
OperationResult
<
AssemblyResolution
list
>
=
let
tcConfig
=
tcConfigP
.
Get
(
ctok
)
...
...
src/fsharp/DetupleArgs.fs
浏览文件 @
e2d83009
...
...
@@ -850,11 +850,11 @@ let postTransformExpr (penv:penv) expr =
|
_
->
None
let
passImplFile
penv
ass
=
ass
|>
RewriteImplFile
{
PreIntercept
=
None
PreInterceptBinding
=
None
PostTransform
=
postTransformExpr
penv
IsUnderQuotations
=
false
}
let
passImplFile
penv
ass
embly
=
ass
embly
|>
RewriteImplFile
{
PreIntercept
=
None
PreInterceptBinding
=
None
PostTransform
=
postTransformExpr
penv
IsUnderQuotations
=
false
}
//-------------------------------------------------------------------------
...
...
src/fsharp/FSharp.Core/quotations.fs
浏览文件 @
e2d83009
...
...
@@ -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
,
ass
embly
:
Assembly
)
=
match
ass
embly
.
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
(
ass
embly
.
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
,
ass
embly
.
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_ass
r
ef
st
=
u_string
st
let
u_ass
emblyR
ef
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
|
ass
embly
->
assembly
let
u_NamedType
st
=
let
a
,
b
=
u_tup2
u_string
u_ass
r
ef
st
let
a
,
b
=
u_tup2
u_string
u_ass
emblyR
ef
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
ass
r
ef
=
decodeAssemblyRef
st
b
mkNamedTycon
(
escapedTcName
,
ass
r
ef
)
let
ass
emblyR
ef
=
decodeAssemblyRef
st
b
mkNamedTycon
(
escapedTcName
,
ass
emblyR
ef
)
let
u_tyconstSpec
st
=
let
tag
=
u_byte_as_int
st
...
...
src/fsharp/LowerCallsAndSeqs.fs
浏览文件 @
e2d83009
...
...
@@ -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
ass
embly
=
RewriteImplFile
{
PreIntercept
=
Some
(
InterceptExpr
g
)
PreInterceptBinding
=
None
PostTransform
=
(
fun
_
->
None
)
IsUnderQuotations
=
false
}
ass
IsUnderQuotations
=
false
}
ass
embly
//----------------------------------------------------------------------------
...
...
@@ -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�. Fo
r example consider this:
//
// let rec rwalk x = { yield x
// yield! rwalk (x + rand()) }
//
// This is the moral equivalent of a tailcall optimization. These also don
t
compile well
// This is the moral equivalent of a tailcall optimization. These also don
�t
compile well
// in the C# compilation model
|
arbitrarySeqExpr
->
...
...
src/fsharp/QuotationPickler.fs
浏览文件 @
e2d83009
...
...
@@ -304,12 +304,12 @@ module SimplePickle =
open
SimplePickle
let
p_assref
x
st
=
p_string
x
st
let
p_ass
embly
ref
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
,
a
ss
)
->
p_tup2
p_string
p_assref
(
nm
,
ass
)
st
|
Idx
n
->
p_tup2
p_string
p_ass
embly
ref
(
string
n
,
""
)
st
|
Named
(
nm
,
a
)
->
p_tup2
p_string
p_assemblyref
(
nm
,
a
)
st
let
p_tycon
x
st
=
match
x
with
...
...
src/fsharp/QuotationTranslator.fs
浏览文件 @
e2d83009
...
...
@@ -978,12 +978,12 @@ and ConvILTypeRef cenv (tr:ILTypeRef) =
QP
.
Idx
idx
|
QuotationSerializationFormat
.
FSharp_20_Plus
->
let
ass
r
ef
=
let
ass
emblyR
ef
=
match
tr
.
Scope
with
|
ILScopeRef
.
Local
->
"."
|
_
->
tr
.
Scope
.
QualifiedName
QP
.
Named
(
tr
.
BasicQualifiedName
,
ass
r
ef
)
QP
.
Named
(
tr
.
BasicQualifiedName
,
ass
emblyR
ef
)
and
ConvVoidType
cenv
m
=
QP
.
mkILNamedTy
(
ConvTyconRef
cenv
cenv
.
g
.
system_Void_tcref
m
,
[]
)
...
...
src/fsharp/SimulatedMSBuildReferenceResolver.fs
浏览文件 @
e2d83009
...
...
@@ -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 ass
embly
= mb |> Option.bind (fun _ -> try Assembly.Load(sprintf "
FSharp
.
Compiler
.
Service
.
MSBuild
.
v
%
s
" v) |> Option.ofObj with _ -> None)
let ty = ass
embly |> 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
...
...
src/fsharp/TcGlobals.fs
浏览文件 @
e2d83009
...
...
@@ -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
(
mkSimpleAss
embly
Ref
(
dummyAssemblyNameCarryingUsefulErrorInformation
path
typeName
))
|
Some
ccu
->
ccu
.
ILScopeRef
mkILTyRef
(
scoref
,
nm
)
...
...
src/fsharp/import.fs
浏览文件 @
e2d83009
...
...
@@ -62,13 +62,13 @@ let CanImportILScopeRef (env:ImportMap) m scoref =
match
scoref
with
|
ILScopeRef
.
Local
->
true
|
ILScopeRef
.
Module
_
->
true
|
ILScopeRef
.
Assembly
ass
r
ef
->
|
ILScopeRef
.
Assembly
ass
emblyR
ef
->
// 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
,
ass
r
ef
)
with
match
env
.
assemblyLoader
.
FindCcuFromAssemblyRef
(
ctok
,
m
,
ass
emblyR
ef
)
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
ass
ref
->
env
.
assemblyLoader
.
FindCcuFromAssemblyRef
(
ctok
,
m
,
assr
ef
)
// NOTE: only assemblyLoader callsite
|
ILScopeRef
.
Assembly
ass
emblyRef
->
env
.
assemblyLoader
.
FindCcuFromAssemblyRef
(
ctok
,
m
,
assemblyR
ef
)
// 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.
...
...
src/fsharp/service/IncrementalBuild.fs
浏览文件 @
e2d83009
...
...
@@ -1496,7 +1496,7 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput
tcState
.
Ccu
.
Deref
.
Contents
<-
oldContents
with
e
->
errorRecoveryNoRange
e
mkSimpleAssRef
assemblyName
,
None
,
None
mkSimpleAss
embly
Ref
assemblyName
,
None
,
None
let
finalAccWithErrors
=
{
finalAcc
with
...
...
src/fsharp/service/service.fs
浏览文件 @
e2d83009
...
...
@@ -1159,22 +1159,22 @@ type TypeCheckInfo
match
item
.
Item
with
|
Item
.
CtorGroup
(_,
(
ILMeth
(_,
ilinfo
,_))
::
_)
->
match
ilinfo
.
MetadataScope
with
|
ILScopeRef
.
Assembly
ass
r
ef
->
|
ILScopeRef
.
Assembly
ass
emblyR
ef
->
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
(
ass
r
ef
.
Name
,
externalSym
))
FSharpFindDeclResult
.
ExternalDecl
(
ass
emblyR
ef
.
Name
,
externalSym
))
|
_
->
None
|
Item
.
MethodGroup
(
name
,
(
ILMeth
(_,
ilinfo
,_))
::
_,
_)
->
match
ilinfo
.
MetadataScope
with
|
ILScopeRef
.
Assembly
ass
r
ef
->
|
ILScopeRef
.
Assembly
ass
emblyR
ef
->
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
(
ass
r
ef
.
Name
,
externalSym
))
FSharpFindDeclResult
.
ExternalDecl
(
ass
emblyR
ef
.
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
ass
r
ef
->
|
ILScopeRef
.
Assembly
ass
emblyR
ef
->
let
externalSym
=
ExternalSymbol
.
Property
(
methInfo
.
ILMethodRef
.
DeclaringTypeRef
.
FullName
,
name
)
Some
(
FSharpFindDeclResult
.
ExternalDecl
(
ass
r
ef
.
Name
,
externalSym
))
Some
(
FSharpFindDeclResult
.
ExternalDecl
(
ass
emblyR
ef
.
Name
,
externalSym
))
|
_
->
None
|
None
->
None
|
Item
.
ILField
(
ILFieldInfo
(
typeInfo
,
fieldDef
))
when
not
typeInfo
.
TyconRefOfRawMetadata
.
IsLocalRef
->
match
typeInfo
.
ILScopeRef
with
|
ILScopeRef
.
Assembly
ass
r
ef
->
|
ILScopeRef
.
Assembly
ass
emblyR
ef
->
let
externalSym
=
ExternalSymbol
.
Field
(
typeInfo
.
ILTypeRef
.
FullName
,
fieldDef
.
Name
)
Some
(
FSharpFindDeclResult
.
ExternalDecl
(
ass
r
ef
.
Name
,
externalSym
))
Some
(
FSharpFindDeclResult
.
ExternalDecl
(
ass
emblyR
ef
.
Name
,
externalSym
))
|
_
->
None
|
Item
.
Event
(
ILEvent
(
ILEventInfo
(
typeInfo
,
eventDef
)))
when
not
typeInfo
.
TyconRefOfRawMetadata
.
IsLocalRef
->
match
typeInfo
.
ILScopeRef
with
|
ILScopeRef
.
Assembly
ass
r
ef
->
|
ILScopeRef
.
Assembly
ass
emblyR
ef
->
let
externalSym
=
ExternalSymbol
.
Event
(
typeInfo
.
ILTypeRef
.
FullName
,
eventDef
.
Name
)
Some
(
FSharpFindDeclResult
.
ExternalDecl
(
ass
r
ef
.
Name
,
externalSym
))
Some
(
FSharpFindDeclResult
.
ExternalDecl
(
ass
emblyR
ef
.
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
ass
r
ef
,
_,
_)),
Some
(
PubPath
parts
)
->
|
TILObjectRepr
(
TILObjectReprData
(
ILScopeRef
.
Assembly
ass
emblyR
ef
,
_,
_)),
Some
(
PubPath
parts
)
->
let
fullName
=
parts
|>
String
.
concat
"."
Some
(
FSharpFindDeclResult
.
ExternalDecl
(
ass
r
ef
.
Name
,
ExternalSymbol
.
Type
fullName
))
Some
(
FSharpFindDeclResult
.
ExternalDecl
(
ass
emblyR
ef
.
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
,
mkSimpleAss
embly
Ref
"stdin"
,
tcState
.
TcEnvFromImpls
.
AccessRights
,
None
,
dependencyFiles
))
parseResults
,
typeCheckResults
,
projectResults
|
_
->
...
...
src/ilx/ilxsettings.fs
浏览文件 @
e2d83009
...
...
@@ -22,7 +22,7 @@ let ilxFsharpCoreLibScopeRef () =
if
!
ilxCompilingFSharpCoreLib
then
ILScopeRef
.
Local
else
let
ass
r
ef
=
let
ass
emblyR
ef
=
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
ass
r
ef
ILScopeRef
.
Assembly
ass
emblyR
ef
let
ilxNamespace
()
=
"Microsoft.FSharp.Core"
\ No newline at end of file
tests/EndToEndBuildTests/ProvidedTypes/ProvidedTypes.fs
浏览文件 @
e2d83009
...
...
@@ -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 ass
embly
Ref = 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 ass
embly
Ref)
else
None
with _ -> None )
...
...
tests/fsharp/core/attributes/test.fsx
浏览文件 @
e2d83009
...
...
@@ -206,12 +206,12 @@ end
do
()
type
dummy
=
Dummy
let
ass
=
typeof
<
dummy
>.
Assembly
let
ass
embly
=
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
=
ass
embly
.
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
ass
embly
=
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
=
ass
embly
.
GetCustomAttributes
(
typeof
<
AttributeWithArrayArgAttribute
>,
false
)
let
_
=
check
"ce99pj32cweq"
(
Array
.
length
ca
)
1
#
endif
end
...
...
tests/fsharp/core/libtest/test.fsx
浏览文件 @
e2d83009
...
...
@@ -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_ass
r
ef
n
=
let
mk_simple_ass
emblyR
ef
n
=
{
assemRefName
=
n
;
assemRefHash
=
None
;
assemRefPublicKeyToken
=
None
;
assemRefPublicKey
=
None
;
assemRefVersion
=
None
;
assemRefLocale
=
None
;
}
let
mscorlib_aref
=
mk_simple_ass
r
ef
mscorlib_assembly_name
let
mscorlib_aref
=
mk_simple_ass
emblyR
ef
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
)
...
...
tests/fsharp/core/members/absil.fsi
浏览文件 @
e2d83009
...
...
@@ -1271,7 +1271,7 @@ type modul =
val
manifest_of_mainmod
:
modul
->
manifest
val
module_is_mainmod
:
modul
->
bool
val
ass
n
ame_of_mainmod
:
modul
->
AssemblyName
val
ass
emblyN
ame_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_ass
r
ef
:
AssemblyName
->
AssemblyRef
val
mk_simple_ass
emblyR
ef
:
AssemblyName
->
AssemblyRef
val
mk_simple_modref
:
ModuleName
->
ModuleRef
val
mk_simple_scoref_from_ass
n
ame
:
AssemblyName
->
ScopeRef
val
mk_simple_scoref_from_ass
r
ef
:
AssemblyRef
->
ScopeRef
val
mk_simple_scoref_from_ass
emblyN
ame
:
AssemblyName
->
ScopeRef
val
mk_simple_scoref_from_ass
emblyR
ef
:
AssemblyRef
->
ScopeRef
val
ass
r
ef_for_manifest
:
manifest
->
AssemblyRef
val
ass
r
ef_for_mainmod
:
modul
->
AssemblyRef
val
ass
emblyR
ef_for_manifest
:
manifest
->
AssemblyRef
val
ass
emblyR
ef_for_mainmod
:
modul
->
AssemblyRef
(* --------------------------------------------------------------------
* Take apart MethodSpecs
...
...
tests/fsharp/core/resources/test.fs
浏览文件 @
e2d83009
...
...
@@ -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
ass
embly
=
(
typeof
<
Resources
>).
Assembly
in
Printf
.
printf
"ass
embly = %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
...
...
tests/service/CSharpProjectAnalysis.fs
浏览文件 @
e2d83009
...
...
@@ -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
ass
embly
=
table
.[
"CSharp_Analysis"
]
let
search
=
ass
embly
.
Contents
.
Entities
|>
Seq
.
tryFind
(
fun
e
->
e
.
DisplayName
=
"CSharpClass"
)
Assert
.
True
search
.
IsSome
let
found
=
search
.
Value
// this is no F# thing
...
...
vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.References.fs
浏览文件 @
e2d83009
...
...
@@ -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
ass
embly
Name
=
new
AssemblyName
(
typeof
<
System
.
Windows
.
Forms
.
Form
>.
Assembly
.
FullName
)
let
selectorData
=
new
VSCOMPONENTSELECTORDATA
(
``type``
=
VSCOMPONENTTYPE
.
VSCOMPONENTTYPE_ComPlus
,
bstrFile
=
"*"
+
ass
embly
Name
.
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录