Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
fbad195c
R
roslyn
项目概览
lwm1986
/
roslyn
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
roslyn
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
fbad195c
编写于
4月 15, 2015
作者:
C
Charles Stoner
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'upstream/master' into 1618
上级
460dc82e
ceb33c0f
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
75 addition
and
36 deletion
+75
-36
src/Compilers/CSharp/Portable/Compiler/MethodCompiler.cs
src/Compilers/CSharp/Portable/Compiler/MethodCompiler.cs
+1
-0
src/Compilers/CSharp/Portable/Emitter/Model/PEModuleBuilder.cs
...ompilers/CSharp/Portable/Emitter/Model/PEModuleBuilder.cs
+10
-0
src/Compilers/CSharp/Portable/Lowering/AsyncRewriter/AsyncRewriter.cs
...s/CSharp/Portable/Lowering/AsyncRewriter/AsyncRewriter.cs
+3
-1
src/Compilers/Core/CodeAnalysisTest/Text/EncodedStringTextTests.cs
...lers/Core/CodeAnalysisTest/Text/EncodedStringTextTests.cs
+4
-3
src/Compilers/Core/Desktop/EncodedStringText.cs
src/Compilers/Core/Desktop/EncodedStringText.cs
+2
-2
src/Compilers/VisualBasic/Desktop/CommandLine/CommandLineParser.vb
...lers/VisualBasic/Desktop/CommandLine/CommandLineParser.vb
+8
-8
src/Compilers/VisualBasic/Portable/BasicCodeAnalysis.vbproj
src/Compilers/VisualBasic/Portable/BasicCodeAnalysis.vbproj
+1
-0
src/Compilers/VisualBasic/Portable/Binding/IgnoreAccessibilityBinder.vb
...VisualBasic/Portable/Binding/IgnoreAccessibilityBinder.vb
+8
-1
src/Compilers/VisualBasic/Portable/Emit/PEModuleBuilder.vb
src/Compilers/VisualBasic/Portable/Emit/PEModuleBuilder.vb
+11
-0
src/Compilers/VisualBasic/Portable/Lowering/AsyncRewriter/AsyncRewriter.vb
...ualBasic/Portable/Lowering/AsyncRewriter/AsyncRewriter.vb
+12
-19
src/Compilers/VisualBasic/Portable/Lowering/Rewriter.vb
src/Compilers/VisualBasic/Portable/Lowering/Rewriter.vb
+3
-0
src/ExpressionEvaluator/CSharp/Source/ExpressionCompiler/EEAssemblyBuilder.cs
...tor/CSharp/Source/ExpressionCompiler/EEAssemblyBuilder.cs
+5
-0
src/ExpressionEvaluator/VisualBasic/Source/ExpressionCompiler/BasicExpressionCompiler.vbproj
.../Source/ExpressionCompiler/BasicExpressionCompiler.vbproj
+0
-1
src/ExpressionEvaluator/VisualBasic/Source/ExpressionCompiler/EEAssemblyBuilder.vb
...isualBasic/Source/ExpressionCompiler/EEAssemblyBuilder.vb
+6
-0
src/ExpressionEvaluator/VisualBasic/Test/ExpressionCompiler/ExpressionCompilerTests.vb
...lBasic/Test/ExpressionCompiler/ExpressionCompilerTests.vb
+1
-1
未找到文件。
src/Compilers/CSharp/Portable/Compiler/MethodCompiler.cs
浏览文件 @
fbad195c
...
...
@@ -581,6 +581,7 @@ private void CompileSynthesizedMethods(ImmutableArray<NamedTypeSymbol> additiona
private
void
CompileSynthesizedMethods
(
TypeCompilationState
compilationState
)
{
Debug
.
Assert
(
_moduleBeingBuiltOpt
!=
null
);
Debug
.
Assert
(
compilationState
.
ModuleBuilderOpt
==
_moduleBeingBuiltOpt
);
if
(!
compilationState
.
HasSynthesizedMethods
)
{
...
...
src/Compilers/CSharp/Portable/Emitter/Model/PEModuleBuilder.cs
浏览文件 @
fbad195c
...
...
@@ -324,6 +324,16 @@ private Location GetSmallestSourceLocationOrNull(Symbol symbol)
return
result
;
}
/// <summary>
/// Ignore accessibility when resolving well-known type
/// members, in particular for generic type arguments
/// (e.g.: binding to internal types in the EE).
/// </summary>
internal
virtual
bool
IgnoreAccessibility
{
get
{
return
false
;
}
}
internal
virtual
VariableSlotAllocator
TryCreateVariableSlotAllocator
(
MethodSymbol
method
)
{
return
null
;
...
...
src/Compilers/CSharp/Portable/Lowering/AsyncRewriter/AsyncRewriter.cs
浏览文件 @
fbad195c
...
...
@@ -13,6 +13,7 @@ internal partial class AsyncRewriter : StateMachineRewriter
private
readonly
AsyncMethodBuilderMemberCollection
_asyncMethodBuilderMemberCollection
;
private
readonly
bool
_constructedSuccessfully
;
private
readonly
int
_methodOrdinal
;
private
readonly
bool
_ignoreAccessibility
;
private
FieldSymbol
_builderField
;
...
...
@@ -37,6 +38,7 @@ internal partial class AsyncRewriter : StateMachineRewriter
}
_methodOrdinal
=
methodOrdinal
;
_ignoreAccessibility
=
compilationState
.
ModuleBuilderOpt
.
IgnoreAccessibility
;
}
/// <summary>
...
...
@@ -166,7 +168,7 @@ protected override BoundStatement GenerateStateMachineCreation(LocalSymbol state
bodyBuilder
.
Add
(
F
.
Assignment
(
F
.
Field
(
F
.
Local
(
stateMachineVariable
),
_builderField
.
AsMember
(
frameType
)),
F
.
StaticCall
(
BinderFlags
.
IgnoreAccessibility
,
methodScopeAsyncMethodBuilderMemberCollection
.
BuilderType
,
"Create"
,
ImmutableArray
<
TypeSymbol
>.
Empty
)));
F
.
StaticCall
(
_ignoreAccessibility
?
BinderFlags
.
IgnoreAccessibility
:
BinderFlags
.
None
,
methodScopeAsyncMethodBuilderMemberCollection
.
BuilderType
,
"Create"
,
ImmutableArray
<
TypeSymbol
>.
Empty
)));
// local.$stateField = NotStartedStateMachine
bodyBuilder
.
Add
(
...
...
src/Compilers/Core/CodeAnalysisTest/Text/EncodedStringTextTests.cs
浏览文件 @
fbad195c
...
...
@@ -97,8 +97,9 @@ public void CheckSum_SHA256()
public
void
Decode_NonUtf8
()
{
var
utf8
=
new
UTF8Encoding
(
false
,
true
);
var
text
=
"abc def baz aeiouy "
+
Encoding
.
Default
.
GetString
(
new
byte
[]
{
0x80
,
0x92
,
0xA4
,
0xB6
,
0xC9
,
0xDB
,
0xED
,
0xFF
});
var
bytes
=
Encoding
.
Default
.
GetBytesWithPreamble
(
text
);
var
encoding
=
Encoding
.
GetEncoding
(
name
:
"Latin1"
);
var
text
=
"abc def baz aeiouy "
+
encoding
.
GetString
(
new
byte
[]
{
0x80
,
0x92
,
0xA4
,
0xB6
,
0xC9
,
0xDB
,
0xED
,
0xFF
});
var
bytes
=
encoding
.
GetBytesWithPreamble
(
text
);
// Encoding.Default should not decode to UTF-8
using
(
var
stream
=
new
MemoryStream
(
bytes
))
...
...
@@ -116,7 +117,7 @@ public void Decode_NonUtf8()
{
var
sourceText
=
EncodedStringText
.
Create
(
stream
);
Assert
.
Equal
(
text
,
sourceText
.
ToString
());
Assert
.
Equal
(
Encoding
.
Default
,
sourceText
.
Encoding
);
Assert
.
Equal
(
encoding
,
sourceText
.
Encoding
);
Assert
.
True
(
stream
.
CanRead
);
}
}
...
...
src/Compilers/Core/Desktop/EncodedStringText.cs
浏览文件 @
fbad195c
...
...
@@ -23,7 +23,7 @@ internal static class EncodedStringText
/// from <see cref="SourceText.From(Stream, Encoding, SourceHashAlgorithm, bool)"/> in two ways:
/// 1. It attempts to minimize allocations by trying to read the stream into a byte array.
/// 2. If <paramref name="defaultEncoding"/> is null, it will first try UTF8 and, if that fails, it will
/// try extended ASCII (code page
1252
).
/// try extended ASCII (code page
Latin1
).
/// </summary>
/// <param name="stream">The stream containing encoded text.</param>
/// <param name="defaultEncoding">
...
...
@@ -57,7 +57,7 @@ internal static SourceText Create(Stream stream, Encoding defaultEncoding = null
try
{
return
Decode
(
stream
,
defaultEncoding
??
Encoding
.
GetEncoding
(
codepage
:
1252
),
checksumAlgorithm
,
throwIfBinaryDetected
:
detectEncoding
);
return
Decode
(
stream
,
defaultEncoding
??
Encoding
.
GetEncoding
(
name
:
"Latin1"
),
checksumAlgorithm
,
throwIfBinaryDetected
:
detectEncoding
);
}
catch
(
DecoderFallbackException
e
)
{
...
...
src/Compilers/VisualBasic/Desktop/CommandLine/CommandLineParser.vb
浏览文件 @
fbad195c
...
...
@@ -1051,12 +1051,12 @@ lVbRuntimePlus:
End
If
' Locate default 'mscorlib.dll' or 'System.Runtime.dll', if any.
Dim
defaultCoreLibraryReference
As
CommandLineReference
?
=
LoadCoreLibraryReference
(
sdkPaths
,
baseDirectory
)
Dim
defaultCoreLibraryReference
As
CommandLineReference
?
=
LoadCoreLibraryReference
(
sdkPaths
,
baseDirectory
,
sdkDirectory
)
' If /nostdlib is not specified, load System.dll
' Dev12 does it through combination of CompilerHost::InitStandardLibraryList and CompilerProject::AddStandardLibraries.
If
Not
noStdLib
Then
Dim
systemDllPath
As
String
=
FindFileInSdkPath
(
sdkPaths
,
"System.dll"
,
baseDirectory
)
Dim
systemDllPath
As
String
=
FindFileInSdkPath
(
sdkPaths
,
"System.dll"
,
baseDirectory
,
sdkDirectory
)
If
systemDllPath
Is
Nothing
Then
AddDiagnostic
(
diagnostics
,
ERRID
.
WRN_CannotFindStandardLibrary1
,
"System.dll"
)
Else
...
...
@@ -1069,7 +1069,7 @@ lVbRuntimePlus:
' Add reference to 'Microsoft.VisualBasic.dll' if needed
If
includeVbRuntimeReference
Then
If
vbRuntimePath
Is
Nothing
Then
Dim
msVbDllPath
As
String
=
FindFileInSdkPath
(
sdkPaths
,
"Microsoft.VisualBasic.dll"
,
baseDirectory
)
Dim
msVbDllPath
As
String
=
FindFileInSdkPath
(
sdkPaths
,
"Microsoft.VisualBasic.dll"
,
baseDirectory
,
sdkDirectory
)
If
msVbDllPath
Is
Nothing
Then
AddDiagnostic
(
diagnostics
,
ERRID
.
ERR_LibNotFound
,
"Microsoft.VisualBasic.dll"
)
Else
...
...
@@ -1209,7 +1209,7 @@ lVbRuntimePlus:
}
End
Function
Private
Function
LoadCoreLibraryReference
(
sdkPaths
As
List
(
Of
String
),
baseDirectory
As
String
)
As
CommandLineReference
?
Private
Function
LoadCoreLibraryReference
(
sdkPaths
As
List
(
Of
String
),
baseDirectory
As
String
,
sdkDirectory
As
String
)
As
CommandLineReference
?
' Load Core library in Dev11:
' Traditionally VB compiler has hard-coded the name of mscorlib.dll. In the Immersive profile the
' library is called System.Runtime.dll. Ideally we should get rid of the dependency on the name and
...
...
@@ -1219,8 +1219,8 @@ lVbRuntimePlus:
' There is an extra check to only pick an assembly with no other assembly refs. This is so that is an
' user drops a user-defined binary called System.runtime.dll into the fx directory we still want to pick
' mscorlib.
Dim
msCorLibPath
As
String
=
FindFileInSdkPath
(
sdkPaths
,
"mscorlib.dll"
,
baseDirectory
)
Dim
systemRuntimePath
As
String
=
FindFileInSdkPath
(
sdkPaths
,
"System.Runtime.dll"
,
baseDirectory
)
Dim
msCorLibPath
As
String
=
FindFileInSdkPath
(
sdkPaths
,
"mscorlib.dll"
,
baseDirectory
,
sdkDirectory
)
Dim
systemRuntimePath
As
String
=
FindFileInSdkPath
(
sdkPaths
,
"System.Runtime.dll"
,
baseDirectory
,
sdkDirectory
)
If
systemRuntimePath
IsNot
Nothing
Then
If
msCorLibPath
Is
Nothing
Then
...
...
@@ -1252,9 +1252,9 @@ lVbRuntimePlus:
Return
Nothing
End
Function
Private
Function
FindFileInSdkPath
(
sdkPaths
As
List
(
Of
String
),
fileName
As
String
,
baseDirectory
As
String
)
As
String
Private
Function
FindFileInSdkPath
(
sdkPaths
As
List
(
Of
String
),
fileName
As
String
,
baseDirectory
As
String
,
sdkDirectory
As
String
)
As
String
For
Each
path
In
sdkPaths
Dim
absolutePath
=
FileUtilities
.
ResolveRelativePath
(
If
(
path
,
RuntimeEnvironment
.
GetRuntimeDirectory
()
),
baseDirectory
)
Dim
absolutePath
=
FileUtilities
.
ResolveRelativePath
(
If
(
path
,
sdkDirectory
),
baseDirectory
)
If
absolutePath
IsNot
Nothing
Then
Dim
filePath
=
PathUtilities
.
CombineAbsoluteAndRelativePaths
(
absolutePath
,
fileName
)
If
File
.
Exists
(
filePath
)
Then
...
...
src/Compilers/VisualBasic/Portable/BasicCodeAnalysis.vbproj
浏览文件 @
fbad195c
...
...
@@ -181,6 +181,7 @@
<Compile
Include=
"Binding\ForOrForEachBlockBinder.vb"
/>
<Compile
Include=
"Binding\ForEachEnumeratorInfo.vb"
/>
<Compile
Include=
"Binding\GetTypeBinder.vb"
/>
<Compile
Include=
"Binding\IgnoreAccessibilityBinder.vb"
/>
<Compile
Include=
"Binding\IgnoreBaseClassesBinder.vb"
/>
<Compile
Include=
"Binding\ImplicitVariableBinder.vb"
/>
<Compile
Include=
"Binding\ImportAliasesBinder.vb"
/>
...
...
src/
ExpressionEvaluator/VisualBasic/Source/ExpressionCompiler/Binders
/IgnoreAccessibilityBinder.vb
→
src/
Compilers/VisualBasic/Portable/Binding
/IgnoreAccessibilityBinder.vb
浏览文件 @
fbad195c
' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
Namespace
Microsoft.CodeAnalysis.VisualBasic.ExpressionEvaluator
Imports
System.Runtime.InteropServices
Imports
Microsoft.CodeAnalysis.VisualBasic.Symbols
Namespace
Microsoft.CodeAnalysis.VisualBasic
Friend
NotInheritable
Class
IgnoreAccessibilityBinder
Inherits
Binder
...
...
@@ -11,5 +14,9 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.ExpressionEvaluator
Friend
Overrides
Function
BinderSpecificLookupOptions
(
options
As
LookupOptions
)
As
LookupOptions
Return
ContainingBinder
.
BinderSpecificLookupOptions
(
options
)
Or
LookupOptions
.
IgnoreAccessibility
End
Function
Public
Overrides
Function
CheckAccessibility
(
sym
As
Symbol
,
<
[
In
]
>
<
Out
>
ByRef
useSiteDiagnostics
As
HashSet
(
Of
DiagnosticInfo
),
Optional
accessThroughType
As
TypeSymbol
=
Nothing
,
Optional
basesBeingResolved
As
ConsList
(
Of
Symbol
)
=
Nothing
)
As
AccessCheckResult
Return
AccessCheckResult
.
Accessible
End
Function
End
Class
End
Namespace
src/Compilers/VisualBasic/Portable/Emit/PEModuleBuilder.vb
浏览文件 @
fbad195c
...
...
@@ -300,6 +300,17 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Emit
Return
result
End
Function
''' <summary>
''' Ignore accessibility when resolving well-known type
''' members, in particular for generic type arguments
''' (e.g.: binding to internal types in the EE).
''' </summary>
Friend
Overridable
ReadOnly
Property
IgnoreAccessibility
As
Boolean
Get
Return
False
End
Get
End
Property
Friend
Overridable
Function
TryCreateVariableSlotAllocator
(
method
As
MethodSymbol
)
As
VariableSlotAllocator
Return
Nothing
End
Function
...
...
src/Compilers/VisualBasic/Portable/Lowering/AsyncRewriter/AsyncRewriter.vb
浏览文件 @
fbad195c
...
...
@@ -2,14 +2,9 @@
Imports
System.Collections.Generic
Imports
System.Collections.Immutable
Imports
System.Runtime.CompilerServices
Imports
System.Runtime.InteropServices
Imports
System.Threading
Imports
Microsoft.Cci
Imports
Microsoft.CodeAnalysis
Imports
Microsoft.CodeAnalysis.CodeGen
Imports
Microsoft.CodeAnalysis.Collections
Imports
Microsoft.CodeAnalysis.Text
Imports
Microsoft.CodeAnalysis.VisualBasic.Symbols
Imports
Microsoft.CodeAnalysis.VisualBasic.Syntax
...
...
@@ -19,6 +14,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
Inherits
StateMachineRewriter
(
Of
CapturedSymbolOrExpression
)
Private
ReadOnly
_binder
As
Binder
Private
ReadOnly
_lookupOptions
As
LookupOptions
Private
ReadOnly
_asyncMethodKind
As
AsyncMethodKind
Private
ReadOnly
_builderType
As
NamedTypeSymbol
Private
ReadOnly
_resultType
As
TypeSymbol
...
...
@@ -37,6 +33,12 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
MyBase
.
New
(
body
,
method
,
stateMachineType
,
slotAllocatorOpt
,
compilationState
,
diagnostics
)
Me
.
_binder
=
CreateMethodBinder
(
method
)
Me
.
_lookupOptions
=
LookupOptions
.
AllMethodsOfAnyArity
Or
LookupOptions
.
IgnoreExtensionMethods
Or
LookupOptions
.
NoBaseClassLookup
If
compilationState
.
ModuleBuilderOpt
.
IgnoreAccessibility
Then
Me
.
_binder
=
New
IgnoreAccessibilityBinder
(
Me
.
_binder
)
Me
.
_lookupOptions
=
Me
.
_lookupOptions
Or
LookupOptions
.
IgnoreAccessibility
End
If
Debug
.
Assert
(
asyncKind
<>
AsyncMethodKind
.
None
)
Debug
.
Assert
(
asyncKind
=
GetAsyncMethodKind
(
method
))
...
...
@@ -498,19 +500,12 @@ lCaptureRValue:
typeArgs
As
ImmutableArray
(
Of
TypeSymbol
),
ParamArray
arguments
As
BoundExpression
())
As
BoundExpression
Dim
anyArgumentsWithErrors
=
False
' Check if we have any bad arguments.
For
Each
a
In
arguments
If
a
.
HasErrors
Then
anyArgumentsWithErrors
=
True
End
If
Next
' Get the method group
Dim
methodGroup
=
FindMethodAndReturnMethodGroup
(
receiver
,
type
,
methodName
,
typeArgs
)
If
methodGroup
Is
Nothing
OrElse
anyArgumentsWithErrors
OrElse
(
receiver
IsNot
Nothing
AndAlso
receiver
.
HasErrors
)
Then
If
methodGroup
Is
Nothing
OrElse
arguments
.
Any
(
Function
(
a
)
a
.
HasErrors
)
OrElse
(
receiver
IsNot
Nothing
AndAlso
receiver
.
HasErrors
)
Then
Return
Me
.
F
.
BadExpression
(
arguments
)
End
If
...
...
@@ -534,9 +529,8 @@ lCaptureRValue:
Dim
group
As
BoundMethodGroup
=
Nothing
Dim
result
=
LookupResult
.
GetInstance
()
Dim
options
As
LookupOptions
=
LookupOptions
.
AllMethodsOfAnyArity
Or
LookupOptions
.
IgnoreExtensionMethods
Or
LookupOptions
.
NoBaseClassLookup
Dim
useSiteDiagnostics
As
HashSet
(
Of
DiagnosticInfo
)
=
Nothing
Me
.
_binder
.
LookupMember
(
result
,
type
,
methodName
,
arity
:
=
0
,
options
:
=
o
ptions
,
useSiteDiagnostics
:
=
useSiteDiagnostics
)
Me
.
_binder
.
LookupMember
(
result
,
type
,
methodName
,
arity
:
=
0
,
options
:
=
_lookupO
ptions
,
useSiteDiagnostics
:
=
useSiteDiagnostics
)
Me
.
Diagnostics
.
Add
(
Me
.
F
.
Syntax
,
useSiteDiagnostics
)
If
result
.
IsGood
Then
...
...
@@ -594,9 +588,8 @@ lCaptureRValue:
Dim
group
As
BoundPropertyGroup
=
Nothing
Dim
result
=
LookupResult
.
GetInstance
()
Dim
options
As
LookupOptions
=
LookupOptions
.
AllMethodsOfAnyArity
Or
LookupOptions
.
IgnoreExtensionMethods
Or
LookupOptions
.
NoBaseClassLookup
Dim
useSiteDiagnostics
As
HashSet
(
Of
DiagnosticInfo
)
=
Nothing
Me
.
_binder
.
LookupMember
(
result
,
type
,
propertyName
,
arity
:
=
0
,
options
:
=
o
ptions
,
useSiteDiagnostics
:
=
useSiteDiagnostics
)
Me
.
_binder
.
LookupMember
(
result
,
type
,
propertyName
,
arity
:
=
0
,
options
:
=
_lookupO
ptions
,
useSiteDiagnostics
:
=
useSiteDiagnostics
)
Me
.
Diagnostics
.
Add
(
Me
.
F
.
Syntax
,
useSiteDiagnostics
)
If
result
.
IsGood
Then
...
...
src/Compilers/VisualBasic/Portable/Lowering/Rewriter.vb
浏览文件 @
fbad195c
...
...
@@ -24,6 +24,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
isBodySynthesized
As
Boolean
)
As
BoundBlock
Debug
.
Assert
(
Not
body
.
HasErrors
)
Debug
.
Assert
(
compilationState
.
ModuleBuilderOpt
IsNot
Nothing
)
' performs node-specific lowering.
Dim
sawLambdas
As
Boolean
...
...
@@ -89,6 +90,8 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
slotAllocatorOpt
As
VariableSlotAllocator
,
<
Out
>
ByRef
stateMachineTypeOpt
As
StateMachineTypeSymbol
)
As
BoundBlock
Debug
.
Assert
(
compilationState
.
ModuleBuilderOpt
IsNot
Nothing
)
Dim
iteratorStateMachine
As
IteratorStateMachine
=
Nothing
Dim
bodyWithoutIterators
=
IteratorRewriter
.
Rewrite
(
bodyWithoutLambdas
,
method
,
...
...
src/ExpressionEvaluator/CSharp/Source/ExpressionCompiler/EEAssemblyBuilder.cs
浏览文件 @
fbad195c
...
...
@@ -61,6 +61,11 @@ protected override IModuleReference TranslateModule(ModuleSymbol symbol, Diagnos
return
base
.
TranslateModule
(
symbol
,
diagnostics
);
}
internal
override
bool
IgnoreAccessibility
{
get
{
return
true
;
}
}
public
override
int
CurrentGenerationOrdinal
=>
0
;
internal
override
VariableSlotAllocator
TryCreateVariableSlotAllocator
(
MethodSymbol
symbol
)
...
...
src/ExpressionEvaluator/VisualBasic/Source/ExpressionCompiler/BasicExpressionCompiler.vbproj
浏览文件 @
fbad195c
...
...
@@ -66,7 +66,6 @@
</ItemGroup>
<ItemGroup>
<Compile
Include=
"Binders\EENamedTypeBinder.vb"
/>
<Compile
Include=
"Binders\IgnoreAccessibilityBinder.vb"
/>
<Compile
Include=
"Binders\ParametersAndLocalsBinder.vb"
/>
<Compile
Include=
"Binders\SuppressObsoleteDiagnosticsBinder.vb"
/>
<Compile
Include=
"CompilationContext.vb"
/>
...
...
src/ExpressionEvaluator/VisualBasic/Source/ExpressionCompiler/EEAssemblyBuilder.vb
浏览文件 @
fbad195c
...
...
@@ -60,6 +60,12 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.ExpressionEvaluator
Return
MyBase
.
TranslateModule
(
symbol
,
diagnostics
)
End
Function
Friend
Overrides
ReadOnly
Property
IgnoreAccessibility
As
Boolean
Get
Return
True
End
Get
End
Property
Public
Overrides
ReadOnly
Property
CurrentGenerationOrdinal
As
Integer
Get
Return
0
...
...
src/ExpressionEvaluator/VisualBasic/Test/ExpressionCompiler/ExpressionCompilerTests.vb
浏览文件 @
fbad195c
...
...
@@ -4154,7 +4154,7 @@ End Class"
''' Ignore accessibility in async rewriter.
''' </summary>
<
WorkItem
(
1813
,
"https://github.com/dotnet/roslyn/issues/1813"
)
>
<
Fact
(
Skip
:
=
"1813"
)
>
<
Fact
>
Public
Sub
AsyncRewriterIgnoreAccessibility
()
Const
source
=
"Imports System
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录