Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
b4fc0360
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,发现更多精彩内容 >>
提交
b4fc0360
编写于
5月 07, 2017
作者:
J
Jonathon Marolf
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixing implicit comversion errors
上级
4d3d313e
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
19 addition
and
19 deletion
+19
-19
src/Compilers/VisualBasic/Portable/BasicCodeAnalysis.vbproj
src/Compilers/VisualBasic/Portable/BasicCodeAnalysis.vbproj
+1
-1
src/Compilers/VisualBasic/Portable/Compilation/VisualBasicCompilation.vb
...isualBasic/Portable/Compilation/VisualBasicCompilation.vb
+2
-2
src/Compilers/VisualBasic/Portable/Emit/EditAndContinue/VisualBasicSymbolMatcher.vb
...Portable/Emit/EditAndContinue/VisualBasicSymbolMatcher.vb
+1
-1
src/Compilers/VisualBasic/Portable/Symbols/Source/SourceLambdaSymbol.vb
...VisualBasic/Portable/Symbols/Source/SourceLambdaSymbol.vb
+1
-1
src/Compilers/VisualBasic/Portable/Symbols/Source/SourceMethodSymbol.vb
...VisualBasic/Portable/Symbols/Source/SourceMethodSymbol.vb
+1
-1
src/Compilers/VisualBasic/Portable/Symbols/SynthesizedSymbols/SynthesizedMethodBase.vb
...table/Symbols/SynthesizedSymbols/SynthesizedMethodBase.vb
+1
-1
src/Scripting/VisualBasicTest/BasicScriptingTest.vbproj
src/Scripting/VisualBasicTest/BasicScriptingTest.vbproj
+1
-1
src/Scripting/VisualBasicTest/InteractiveSessionTests.vb
src/Scripting/VisualBasicTest/InteractiveSessionTests.vb
+6
-6
src/Scripting/VisualBasicTest/ScriptTests.vb
src/Scripting/VisualBasicTest/ScriptTests.vb
+5
-5
未找到文件。
src/Compilers/VisualBasic/Portable/BasicCodeAnalysis.vbproj
浏览文件 @
b4fc0360
...
...
@@ -10,7 +10,7 @@
<AssemblyName>
Microsoft.CodeAnalysis.VisualBasic
</AssemblyName>
<TargetFramework>
netstandard1.3
</TargetFramework>
<ServiceablePackage>
true
</ServiceablePackage>
<NoWarn>
$(NoWarn);42014;40057
;42016;41999
</NoWarn>
<NoWarn>
$(NoWarn);42014;40057
</NoWarn>
<CodeAnalysisRuleSet>
..\BasicCodeAnalysisRules.ruleset
</CodeAnalysisRuleSet>
<!-- This is required to prevent downgrade references from CscCore/VbcCode since we must
reference Microsoft.NETCore.App to target the shared framework (bug
...
...
src/Compilers/VisualBasic/Portable/Compilation/VisualBasicCompilation.vb
浏览文件 @
b4fc0360
...
...
@@ -245,7 +245,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
Debug
.
Assert
(
tree
IsNot
VisualBasicSyntaxTree
.
Dummy
)
Debug
.
Assert
(
tree
.
IsMyTemplate
)
Interlocked
.
CompareExchange
(
_lazyMyTemplate
,
tree
,
VisualBasicSyntaxTree
.
Dummy
)
Interlocked
.
CompareExchange
(
Of
SyntaxTree
)(
_lazyMyTemplate
,
tree
,
VisualBasicSyntaxTree
.
Dummy
)
Else
' we need to make one.
Dim
text
As
String
=
EmbeddedResources
.
VbMyTemplateText
...
...
@@ -260,7 +260,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
Throw
ExceptionUtilities
.
Unreachable
End
If
If
Interlocked
.
CompareExchange
(
_lazyMyTemplate
,
tree
,
VisualBasicSyntaxTree
.
Dummy
)
Is
VisualBasicSyntaxTree
.
Dummy
Then
If
Interlocked
.
CompareExchange
(
Of
SyntaxTree
)(
_lazyMyTemplate
,
tree
,
VisualBasicSyntaxTree
.
Dummy
)
Is
VisualBasicSyntaxTree
.
Dummy
Then
' set global cache
s_myTemplateCache
(
parseOptions
)
=
tree
End
If
...
...
src/Compilers/VisualBasic/Portable/Emit/EditAndContinue/VisualBasicSymbolMatcher.vb
浏览文件 @
b4fc0360
...
...
@@ -134,7 +134,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Emit
typesByName
.
Add
(
type
.
Name
,
type
)
End
If
Next
Interlocked
.
CompareExchange
(
Me
.
_lazyTopLevelTypes
,
typesByName
,
Nothing
)
Interlocked
.
CompareExchange
(
Of
IReadOnlyDictionary
(
Of
String
,
Cci
.
INamespaceTypeDefinition
))(
Me
.
_lazyTopLevelTypes
,
typesByName
,
Nothing
)
End
If
Return
Me
.
_lazyTopLevelTypes
End
Function
...
...
src/Compilers/VisualBasic/Portable/Symbols/Source/SourceLambdaSymbol.vb
浏览文件 @
b4fc0360
...
...
@@ -55,7 +55,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
Get
If
Me
.
_lazyAnonymousDelegateSymbol
Is
ErrorTypeSymbol
.
UnknownResultType
Then
Dim
newValue
As
NamedTypeSymbol
=
MakeAssociatedAnonymousDelegate
()
Dim
oldValue
As
NamedTypeSymbol
=
Interlocked
.
CompareExchange
(
Me
.
_lazyAnonymousDelegateSymbol
,
newValue
,
ErrorTypeSymbol
.
UnknownResultType
)
Dim
oldValue
As
NamedTypeSymbol
=
Interlocked
.
CompareExchange
(
Of
NamedTypeSymbol
)(
Me
.
_lazyAnonymousDelegateSymbol
,
newValue
,
ErrorTypeSymbol
.
UnknownResultType
)
Debug
.
Assert
(
oldValue
Is
ErrorTypeSymbol
.
UnknownResultType
OrElse
oldValue
Is
newValue
)
End
If
Return
Me
.
_lazyAnonymousDelegateSymbol
...
...
src/Compilers/VisualBasic/Portable/Symbols/Source/SourceMethodSymbol.vb
浏览文件 @
b4fc0360
...
...
@@ -1296,7 +1296,7 @@ lReportErrorOnTwoTokens:
meParameter
=
Nothing
Else
If
_lazyMeParameter
Is
Nothing
Then
Interlocked
.
CompareExchange
(
_lazyMeParameter
,
New
MeParameterSymbol
(
Me
),
Nothing
)
Interlocked
.
CompareExchange
(
Of
ParameterSymbol
)(
_lazyMeParameter
,
New
MeParameterSymbol
(
Me
),
Nothing
)
End
If
meParameter
=
_lazyMeParameter
...
...
src/Compilers/VisualBasic/Portable/Symbols/SynthesizedSymbols/SynthesizedMethodBase.vb
浏览文件 @
b4fc0360
...
...
@@ -178,7 +178,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
meParameter
=
Nothing
Else
If
_lazyMeParameter
Is
Nothing
Then
Interlocked
.
CompareExchange
(
_lazyMeParameter
,
New
MeParameterSymbol
(
Me
),
Nothing
)
Interlocked
.
CompareExchange
(
Of
ParameterSymbol
)(
_lazyMeParameter
,
New
MeParameterSymbol
(
Me
),
Nothing
)
End
If
meParameter
=
_lazyMeParameter
...
...
src/Scripting/VisualBasicTest/BasicScriptingTest.vbproj
浏览文件 @
b4fc0360
...
...
@@ -12,7 +12,7 @@
<TargetFramework>
netstandard1.3
</TargetFramework>
<PackageTargetFallback>
portable-net452
</PackageTargetFallback>
<RoslynProjectType>
UnitTestDesktop
</RoslynProjectType>
<NoWarn>
$(NoWarn);40057
;42016
</NoWarn>
<NoWarn>
$(NoWarn);40057
</NoWarn>
</PropertyGroup>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'"
/>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)' == 'Release|AnyCPU'"
/>
...
...
src/Scripting/VisualBasicTest/InteractiveSessionTests.vb
浏览文件 @
b4fc0360
...
...
@@ -19,7 +19,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Scripting.UnitTests
ContinueWith
(
"Dim y As Integer = 2"
).
ContinueWith
(
"?x + y"
)
Assert
.
Equal
(
3
,
s
.
ReturnValue
)
Assert
.
Equal
(
3
,
CType
(
s
.
ReturnValue
,
Integer
)
)
End
Function
<
Fact
>
...
...
@@ -27,7 +27,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Scripting.UnitTests
Dim
source
=
"
?1 _
"
Assert
.
Equal
(
1
,
VisualBasicScript
.
EvaluateAsync
(
source
).
Result
)
Assert
.
Equal
(
1
,
CType
(
VisualBasicScript
.
EvaluateAsync
(
source
).
Result
,
Integer
)
)
End
Sub
<
Fact
>
...
...
@@ -35,7 +35,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Scripting.UnitTests
Dim
source
=
"
?1
"
Assert
.
Equal
(
1
,
VisualBasicScript
.
EvaluateAsync
(
source
).
Result
)
Assert
.
Equal
(
1
,
CType
(
VisualBasicScript
.
EvaluateAsync
(
source
).
Result
,
Integer
)
)
End
Sub
<
Fact
>
...
...
@@ -61,7 +61,7 @@ End If
?x + 1
"
Assert
.
Equal
(
6
,
VisualBasicScript
.
EvaluateAsync
(
source
).
Result
)
Assert
.
Equal
(
6
,
CType
(
VisualBasicScript
.
EvaluateAsync
(
source
).
Result
,
Integer
)
)
End
Sub
<
Fact
>
...
...
@@ -81,7 +81,7 @@ Dim d = New With { Key .F = 777 }
&
""
""
& (a.GetType() Is b.GetType()).ToString() _
&
""
""
& (b.GetType() is d.GetType()).ToString()
"
)
Assert
.
Equal
(
"True False True"
,
script
.
EvaluateAsync
().
Result
)
Assert
.
Equal
(
"True False True"
,
CType
(
script
.
EvaluateAsync
().
Result
,
String
)
)
End
Sub
<
Fact
>
...
...
@@ -107,7 +107,7 @@ Dim d = Function () As Integer
&
""
""
& (b.GetType() is d.GetType()).ToString()
"
)
Assert
.
Equal
(
"True False True"
,
script
.
EvaluateAsync
().
Result
)
Assert
.
Equal
(
"True False True"
,
CType
(
script
.
EvaluateAsync
().
Result
,
String
)
)
End
Sub
End
Class
...
...
src/Scripting/VisualBasicTest/ScriptTests.vb
浏览文件 @
b4fc0360
...
...
@@ -22,14 +22,14 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Scripting.UnitTests
<
Fact
>
Public
Sub
TestEvalScript
()
Dim
value
=
VisualBasicScript
.
EvaluateAsync
(
"? 1 + 2"
,
s_defaultOptions
)
Assert
.
Equal
(
3
,
value
.
Result
)
Dim
value
=
CType
(
VisualBasicScript
.
EvaluateAsync
(
"? 1 + 2"
,
s_defaultOptions
).
Result
,
Integer
)
Assert
.
Equal
(
3
,
value
)
End
Sub
<
Fact
>
Public
Async
Function
TestRunScript
()
As
Task
Dim
state
=
Await
VisualBasicScript
.
RunAsync
(
"? 1 + 2"
,
s_defaultOptions
)
Assert
.
Equal
(
3
,
state
.
ReturnValue
)
Assert
.
Equal
(
3
,
CType
(
state
.
ReturnValue
,
Integer
)
)
End
Function
<
Fact
>
...
...
@@ -37,13 +37,13 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Scripting.UnitTests
Dim
script
=
VisualBasicScript
.
Create
(
"? 1 + 2"
,
s_defaultOptions
)
Dim
state
=
Await
script
.
RunAsync
()
Assert
.
Same
(
script
,
state
.
Script
)
Assert
.
Equal
(
3
,
state
.
ReturnValue
)
Assert
.
Equal
(
3
,
CType
(
state
.
ReturnValue
,
Integer
)
)
End
Function
<
Fact
>
Public
Async
Function
TestRunScriptWithSpecifiedReturnType
()
As
Task
Dim
state
=
Await
VisualBasicScript
.
RunAsync
(
"? 1 + 2"
,
s_defaultOptions
)
Assert
.
Equal
(
3
,
state
.
ReturnValue
)
Assert
.
Equal
(
3
,
CType
(
state
.
ReturnValue
,
Integer
)
)
End
Function
<
Fact
>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录