Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
a213194a
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,发现更多精彩内容 >>
未验证
提交
a213194a
编写于
1月 08, 2018
作者:
J
Jason Malinowski
提交者:
GitHub
1月 08, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #24107 from dotnet/master
Snap master into dev15.6.x
上级
4d92b18a
5fc3f73b
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
91 addition
and
6 deletion
+91
-6
build/Targets/Packages.props
build/Targets/Packages.props
+1
-1
build/Targets/RepoToolset/SymStore.targets
build/Targets/RepoToolset/SymStore.targets
+1
-1
build/Targets/SourcePackage.targets
build/Targets/SourcePackage.targets
+2
-3
build/ToolsetPackages/RoslynToolset.csproj
build/ToolsetPackages/RoslynToolset.csproj
+1
-1
src/ExpressionEvaluator/CSharp/Source/ExpressionCompiler/CompilationContext.cs
...or/CSharp/Source/ExpressionCompiler/CompilationContext.cs
+5
-0
src/ExpressionEvaluator/CSharp/Test/ExpressionCompiler/LocalsTests.cs
...onEvaluator/CSharp/Test/ExpressionCompiler/LocalsTests.cs
+40
-0
src/ExpressionEvaluator/VisualBasic/Source/ExpressionCompiler/CompilationContext.vb
...sualBasic/Source/ExpressionCompiler/CompilationContext.vb
+4
-0
src/ExpressionEvaluator/VisualBasic/Test/ExpressionCompiler/LocalsTests.vb
...luator/VisualBasic/Test/ExpressionCompiler/LocalsTests.vb
+37
-0
未找到文件。
build/Targets/Packages.props
浏览文件 @
a213194a
...
...
@@ -141,7 +141,7 @@
<NuGetVisualStudioVersion>
4.0.0-rc-2048
</NuGetVisualStudioVersion>
<NuSpecReferenceGeneratorVersion>
1.4.2
</NuSpecReferenceGeneratorVersion>
<OctokitVersion>
0.23.0
</OctokitVersion>
<
Pdb2PdbVersion>
1.1.0-beta1-62301-01
</
Pdb2PdbVersion>
<
MicrosoftDiaSymReaderPdb2PdbVersion>
1.1.0-beta1-62506-02
</MicrosoftDiaSymReader
Pdb2PdbVersion>
<RestSharpVersion>
105.2.3
</RestSharpVersion>
<RoslynBuildUtilVersion>
0.9.8-beta
</RoslynBuildUtilVersion>
<RoslynDependenciesOptimizationDataVersion>
2.6.0-beta1-62205-01
</RoslynDependenciesOptimizationDataVersion>
...
...
build/Targets/RepoToolset/SymStore.targets
浏览文件 @
a213194a
...
...
@@ -59,7 +59,7 @@ Update this file only if the change to RepoToolset gets approved and merged.
Condition="'$(PublishOutputToSymStore)' == 'true' and ('$(DebugType)' == 'portable' or '$(DebugType)' == 'embedded')">
<PropertyGroup>
<_PdbConverterPath>$(NuGetPackageRoot)
pdb2pdb\$(
Pdb2PdbVersion)\tools\Pdb2Pdb.exe</_PdbConverterPath>
<_PdbConverterPath>$(NuGetPackageRoot)
microsoft.diasymreader.pdb2pdb\$(MicrosoftDiaSymReader
Pdb2PdbVersion)\tools\Pdb2Pdb.exe</_PdbConverterPath>
<_PdbConverterCommandLineArgs>"$(TargetPath)" /out "$(_SymStorePdbPath)" /verbose</_PdbConverterCommandLineArgs>
</PropertyGroup>
...
...
build/Targets/SourcePackage.targets
浏览文件 @
a213194a
...
...
@@ -40,15 +40,14 @@
<_RelativePath>
$([MSBuild]::MakeRelative($(RepoRoot), $(MSBuildProjectDirectory)))
</_RelativePath>
<!-- TODO: Proper URL escaping -->
<_RawUrl>
$(RepositoryRawUrl)/$(GitHeadSha)/$(_RelativePath.Replace('\', '/'))
</_RawUrl>
<_RawUrl>
$(RepositoryRawUrl)/$(GitHeadSha)/$(_RelativePath.Replace('\', '/'))
/*
</_RawUrl>
<_Content>
<![CDATA[<?xml version="1.0" encoding="utf-8"?>
<Project
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
>
<ItemGroup>
<SourceRoot
Include=
"%24([System.IO.Path]::GetFullPath('%24(MSBuildThisFileDirectory)..\contentFiles\cs\%24(TargetFramework)\'))"
RawUrl=
"$(_RawUrl)"
UniqueName=
"%24(MSBuildThisFileName)"
/>
SourceLinkUrl=
"$(_RawUrl)"
/>
</ItemGroup>
</Project>
]]>
</_Content>
...
...
build/ToolsetPackages/RoslynToolset.csproj
浏览文件 @
a213194a
...
...
@@ -17,7 +17,7 @@
<PackageReference
Include=
"xunit.analyzers"
Version=
"$(xunitanalyzersVersion)"
ExcludeAssets=
"all"
/>
<PackageReference
Include=
"xunit.runner.console"
Version=
"$(xunitrunnerconsoleVersion)"
ExcludeAssets=
"all"
/>
<PackageReference
Include=
"RoslynTools.ReferenceAssemblies"
Version=
"$(RoslynToolsReferenceAssembliesVersion)"
ExcludeAssets=
"all"
/>
<PackageReference
Include=
"
pdb2pdb"
Version=
"$(
Pdb2PdbVersion)"
ExcludeAssets=
"all"
/>
<PackageReference
Include=
"
Microsoft.DiaSymReader.Pdb2Pdb"
Version=
"$(MicrosoftDiaSymReader
Pdb2PdbVersion)"
ExcludeAssets=
"all"
/>
</ItemGroup>
<ItemGroup
Condition=
"'$(TargetFramework)' == 'net461'"
>
<PackageReference
Include=
"FakeSign"
Version=
"$(FakeSignVersion)"
ExcludeAssets=
"all"
/>
...
...
src/ExpressionEvaluator/CSharp/Source/ExpressionCompiler/CompilationContext.cs
浏览文件 @
a213194a
...
...
@@ -331,6 +331,11 @@ private static string GetNextMethodName(ArrayBuilder<MethodSymbol> builder)
_currentFrame
,
sourceAssembly
,
alias
);
// Skip pseudo-variables with errors.
if
(
local
.
GetUseSiteDiagnostic
()?.
Severity
==
DiagnosticSeverity
.
Error
)
{
continue
;
}
var
methodName
=
GetNextMethodName
(
methodBuilder
);
var
syntax
=
SyntaxFactory
.
IdentifierName
(
SyntaxFactory
.
MissingToken
(
SyntaxKind
.
IdentifierToken
));
var
aliasMethod
=
this
.
CreateMethod
(
...
...
src/ExpressionEvaluator/CSharp/Test/ExpressionCompiler/LocalsTests.cs
浏览文件 @
a213194a
...
...
@@ -3848,6 +3848,46 @@ static void DummySequencePoint()
});
}
/// <summary>
/// CompileGetLocals should skip locals with errors.
/// </summary>
[
WorkItem
(
535899
,
"https://devdiv.visualstudio.com/DevDiv/_workitems?id=535899"
)]
[
Fact
]
public
void
SkipPseudoVariablesWithUseSiteErrors
()
{
var
source
=
@"class C
{
static void M(object x)
{
object y;
}
}"
;
var
compilation0
=
CreateStandardCompilation
(
source
,
options
:
TestOptions
.
DebugDll
);
WithRuntimeInstance
(
compilation0
,
runtime
=>
{
var
context
=
CreateMethodContext
(
runtime
,
"C.M"
);
var
aliases
=
ImmutableArray
.
Create
(
ReturnValueAlias
(
1
,
"UnknownType, UnknownAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
));
var
locals
=
ArrayBuilder
<
LocalAndMethod
>.
GetInstance
();
string
typeName
;
var
diagnostics
=
DiagnosticBag
.
GetInstance
();
var
testData
=
new
CompilationTestData
();
context
.
CompileGetLocals
(
locals
,
argumentsOnly
:
false
,
aliases
:
aliases
,
diagnostics
:
diagnostics
,
typeName
:
out
typeName
,
testData
:
testData
);
diagnostics
.
Verify
();
diagnostics
.
Free
();
Assert
.
Equal
(
locals
.
Count
,
2
);
VerifyLocal
(
testData
,
typeName
,
locals
[
0
],
"<>m0"
,
"x"
);
VerifyLocal
(
testData
,
typeName
,
locals
[
1
],
"<>m1"
,
"y"
);
locals
.
Free
();
});
}
private
static
void
GetLocals
(
RuntimeInstance
runtime
,
string
methodName
,
bool
argumentsOnly
,
ArrayBuilder
<
LocalAndMethod
>
locals
,
int
count
,
out
string
typeName
,
out
CompilationTestData
testData
)
{
var
context
=
CreateMethodContext
(
runtime
,
methodName
);
...
...
src/ExpressionEvaluator/VisualBasic/Source/ExpressionCompiler/CompilationContext.vb
浏览文件 @
a213194a
...
...
@@ -242,6 +242,10 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.ExpressionEvaluator
Dim
methodName
=
GetNextMethodName
(
methodBuilder
)
Dim
syntax
=
SyntaxFactory
.
IdentifierName
(
SyntaxFactory
.
MissingToken
(
SyntaxKind
.
IdentifierToken
))
Dim
local
=
PlaceholderLocalSymbol
.
Create
(
typeNameDecoder
,
_currentFrame
,
[
alias
]
)
' Skip pseudo-variables with errors.
If
local
.
GetUseSiteErrorInfo
()
?
.
Severity
=
DiagnosticSeverity
.
Error
Then
Continue
For
End
If
Dim
aliasMethod
=
Me
.
CreateMethod
(
container
,
methodName
,
...
...
src/ExpressionEvaluator/VisualBasic/Test/ExpressionCompiler/LocalsTests.vb
浏览文件 @
a213194a
...
...
@@ -3284,6 +3284,43 @@ End Class"
End
Sub
)
End
Sub
''' <summary>
''' CompileGetLocals should skip locals with errors.
''' </summary>
<
WorkItem
(
535899
,
"https://devdiv.visualstudio.com/DevDiv/_workitems?id=535899"
)
>
<
Fact
>
Public
Sub
SkipPseudoVariablesWithUseSiteErrors
()
Const
source
=
"Class C
Shared Sub M(x As Object)
Dim y As Object
End Sub
End Class"
Dim
comp
=
CreateCompilationWithMscorlib
({
source
},
options
:
=
TestOptions
.
DebugDll
)
WithRuntimeInstance
(
comp
,
Sub
(
runtime
)
Dim
context
=
CreateMethodContext
(
runtime
,
"C.M"
)
Dim
aliases
=
ImmutableArray
.
Create
(
ReturnValueAlias
(
1
,
"UnknownType, UnknownAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
))
Dim
locals
=
ArrayBuilder
(
Of
LocalAndMethod
).
GetInstance
()
Dim
typeName
As
String
=
Nothing
Dim
diagnostics
=
DiagnosticBag
.
GetInstance
()
Dim
testData
=
New
CompilationTestData
()
context
.
CompileGetLocals
(
locals
,
argumentsOnly
:
=
False
,
aliases
:
=
aliases
,
diagnostics
:
=
diagnostics
,
typeName
:
=
typeName
,
testData
:
=
testData
)
diagnostics
.
Verify
()
diagnostics
.
Free
()
Assert
.
Equal
(
2
,
locals
.
Count
)
VerifyLocal
(
testData
,
typeName
,
locals
(
0
),
"<>m0"
,
"x"
)
VerifyLocal
(
testData
,
typeName
,
locals
(
1
),
"<>m1"
,
"y"
)
locals
.
Free
()
End
Sub
)
End
Sub
Private
Shared
Sub
GetLocals
(
runtime
As
RuntimeInstance
,
methodName
As
String
,
argumentsOnly
As
Boolean
,
locals
As
ArrayBuilder
(
Of
LocalAndMethod
),
count
As
Integer
,
ByRef
typeName
As
String
,
ByRef
testData
As
CompilationTestData
)
Dim
context
=
CreateMethodContext
(
runtime
,
methodName
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录