Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
96c26036
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,发现更多精彩内容 >>
提交
96c26036
编写于
2月 26, 2015
作者:
A
Andrew Casey
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix broken VB EC tests.
上级
f1bb6ffc
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
13 addition
and
10 deletion
+13
-10
src/ExpressionEvaluator/VisualBasic/Source/ExpressionCompiler/Binders/PlaceholderLocalBinder.vb
...urce/ExpressionCompiler/Binders/PlaceholderLocalBinder.vb
+6
-4
src/ExpressionEvaluator/VisualBasic/Source/ExpressionCompiler/Rewriters/LocalDeclarationRewriter.vb
.../ExpressionCompiler/Rewriters/LocalDeclarationRewriter.vb
+1
-1
src/ExpressionEvaluator/VisualBasic/Test/ExpressionCompiler/DeclarationTests.vb
...r/VisualBasic/Test/ExpressionCompiler/DeclarationTests.vb
+4
-4
src/ExpressionEvaluator/VisualBasic/Test/ExpressionCompiler/PseudoVariableTests.vb
...isualBasic/Test/ExpressionCompiler/PseudoVariableTests.vb
+2
-1
未找到文件。
src/ExpressionEvaluator/VisualBasic/Source/ExpressionCompiler/Binders/PlaceholderLocalBinder.vb
浏览文件 @
96c26036
...
...
@@ -76,14 +76,16 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.ExpressionEvaluator
Dim
typeChar
As
String
=
Nothing
Dim
specialType
=
GetSpecialTypeForTypeCharacter
(
identifier
.
GetTypeCharacter
(),
typeChar
)
Dim
type
=
Compilation
.
GetSpecialType
(
If
(
specialType
=
SpecialType
.
None
,
SpecialType
.
System_Object
,
specialType
))
' NOTE: Don't create the local with the canonical name since we want it to have the user's text in diagnostic messages.
' TODO (acasey): don't canonicalize name (GH #878)
Dim
canonicalName
=
Canonicalize
(
identifier
.
GetIdentifierText
())
Dim
local
=
LocalSymbol
.
Create
(
_containingMethod
,
Me
,
identifier
,
LocalDeclarationKind
.
ImplicitVariable
,
type
)
_implicitDeclarations
.
Add
(
Canonicalize
(
local
.
Name
),
local
)
type
,
canonicalName
)
_implicitDeclarations
.
Add
(
canonicalName
,
local
)
If
local
.
Name
.
StartsWith
(
"$"
,
StringComparison
.
Ordinal
)
Then
diagnostics
.
Add
(
ERRID
.
ERR_IllegalChar
,
identifier
.
GetLocation
())
End
If
...
...
@@ -132,7 +134,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.ExpressionEvaluator
End
Select
End
Function
Friend
Shared
Function
Canonicalize
(
name
As
String
)
As
String
Private
Shared
Function
Canonicalize
(
name
As
String
)
As
String
Return
CaseInsensitiveComparison
.
ToLower
(
name
)
End
Function
...
...
src/ExpressionEvaluator/VisualBasic/Source/ExpressionCompiler/Rewriters/LocalDeclarationRewriter.vb
浏览文件 @
96c26036
...
...
@@ -60,7 +60,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.ExpressionEvaluator
' CreateVariable(type As Type, name As String)
Dim
method
=
PlaceholderLocalSymbol
.
GetIntrinsicMethod
(
compilation
,
ExpressionCompilerConstants
.
CreateVariableMethodName
)
Dim
type
=
New
BoundGetType
(
syntax
,
New
BoundTypeExpression
(
syntax
,
local
.
Type
),
typeType
)
Dim
name
=
New
BoundLiteral
(
syntax
,
ConstantValue
.
Create
(
PlaceholderLocalBinder
.
Canonicalize
(
local
.
Name
)
),
stringType
)
Dim
name
=
New
BoundLiteral
(
syntax
,
ConstantValue
.
Create
(
local
.
Name
),
stringType
)
Dim
expr
=
New
BoundCall
(
syntax
,
method
,
...
...
src/ExpressionEvaluator/VisualBasic/Test/ExpressionCompiler/DeclarationTests.vb
浏览文件 @
96c26036
...
...
@@ -819,7 +819,7 @@ End Class"
// Code size 16 (0x10)
.maxstack 1
IL_0000: ldstr
""
x
""
IL_0005: call
""
Function
<>x.<>
GetObjectByAlias(String) As Object
""
IL_0005: call
""
Function
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetObjectByAlias(String) As Object
""
IL_000a: castclass
""
String
""
IL_000f: ret
}
...
...
@@ -861,11 +861,11 @@ End Class"
IL_0000: ldtoken
""
Object
""
IL_0005: call
""
Function System.Type.GetTypeFromHandle(System.RuntimeTypeHandle) As System.Type
""
IL_000a: ldstr
""
x
""
IL_000f: call
""
Sub
<>x.<>
CreateVariable(System.Type, String)
""
IL_000f: call
""
Sub
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
CreateVariable(System.Type, String)
""
IL_0014: ldstr
""
x
""
IL_0019: call
""
Function
<>x.<>
GetVariableAddress(Of Object)(String) As Object
""
IL_0019: call
""
Function
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetVariableAddress(Of Object)(String) As Object
""
IL_001e: ldstr
""
x
""
IL_0023: call
""
Function
<>x.<>
GetObjectByAlias(String) As Object
""
IL_0023: call
""
Function
Microsoft.VisualStudio.Debugger.Clr.IntrinsicMethods.
GetObjectByAlias(String) As Object
""
IL_0028: call
""
Function System.Runtime.CompilerServices.RuntimeHelpers.GetObjectValue(Object) As Object
""
IL_002d: stind.ref
IL_002e: ret
...
...
src/ExpressionEvaluator/VisualBasic/Test/ExpressionCompiler/PseudoVariableTests.vb
浏览文件 @
96c26036
...
...
@@ -462,7 +462,8 @@ End Class"
expr
:
=
"$ReturnValue(Of Object)"
,
resultProperties
:
=
resultProperties
,
errorMessage
:
=
errorMessage
)
Assert
.
Equal
(
"(1) : error BC32045: '$ReturnValue' has no type parameters and so cannot have type arguments."
,
errorMessage
)
' TODO (acasey): don't canonicalize name (GH #878)
Assert
.
Equal
(
"(1) : error BC32045: '$returnvalue' has no type parameters and so cannot have type arguments."
,
errorMessage
)
Const
source
=
"
Class C
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录