Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/CodeStyle/VisualBasic/Analyzers/BasicCodeStyle.vbproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<AssemblyName>Microsoft.CodeAnalysis.VisualBasic.CodeStyle</AssemblyName>
<TargetFramework>netstandard1.3</TargetFramework>
<PackageTargetFallback>portable-net45+win8;dotnet</PackageTargetFallback>
<NoWarn>$(NoWarn);40057</NoWarn>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmarolf Could you open an issue so that we turn it back on when the fix is in the product

</PropertyGroup>
<ItemGroup Label="Project References">
<ProjectReference Include="..\..\..\Compilers\Core\Portable\CodeAnalysis.csproj">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<AssemblyName>Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes</AssemblyName>
<TargetFramework>netstandard1.3</TargetFramework>
<PackageTargetFallback>portable-net45+win8;dotnet</PackageTargetFallback>
<NoWarn>$(NoWarn);40057</NoWarn>
</PropertyGroup>
<ItemGroup Label="Project References">
<ProjectReference Include="..\..\..\Compilers\Core\Portable\CodeAnalysis.csproj">
Expand Down
1 change: 1 addition & 0 deletions src/CodeStyle/VisualBasic/Tests/BasicCodeStyleTests.vbproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<TargetFramework>netstandard1.3</TargetFramework>
<PackageTargetFallback>portable-net45+win8;dotnet</PackageTargetFallback>
<RoslynProjectType>UnitTestPortable</RoslynProjectType>
<NoWarn>$(NoWarn);40057</NoWarn>
</PropertyGroup>
<ItemGroup Label="Project References">
<ProjectReference Include="..\..\..\Compilers\Core\Portable\CodeAnalysis.csproj">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<AssemblyName>Microsoft.CodeAnalysis.VisualBasic</AssemblyName>
<TargetFramework>netstandard1.3</TargetFramework>
<ServiceablePackage>true</ServiceablePackage>
<NoWarn>$(NoWarn);42014</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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<OutputType>Library</OutputType>
<AssemblyName>Microsoft.CodeAnalysis.VisualBasic.ExpressionEvaluator.ExpressionCompiler</AssemblyName>
<TargetFramework>netstandard1.3</TargetFramework>
<NoWarn>$(NoWarn);40057</NoWarn>
<PackageTargetFallback>portable-net46</PackageTargetFallback>
<!-- Don't transitively copy output files, since everything builds to the same folder. -->
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<OutputType>Library</OutputType>
<AssemblyName>Microsoft.CodeAnalysis.VisualBasic.ExpressionEvaluator.ResultProvider</AssemblyName>
<TargetFramework>net20</TargetFramework>
<NoWarn>$(NoWarn);40057</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<TargetFramework>netstandard1.3</TargetFramework>
<PackageTargetFallback>portable-net45+win8</PackageTargetFallback>
<DisableImplicitFrameworkReferences>false</DisableImplicitFrameworkReferences>
<NoWarn>$(NoWarn);40057</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'" />
Expand Down
1 change: 1 addition & 0 deletions src/Features/VisualBasic/Portable/BasicFeatures.vbproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<AssemblyName>Microsoft.CodeAnalysis.VisualBasic.Features</AssemblyName>
<TargetFramework>netstandard1.3</TargetFramework>
<PackageTargetFallback>portable-net45+win8;dotnet</PackageTargetFallback>
<NoWarn>$(NoWarn);40057</NoWarn>
</PropertyGroup>
<ItemGroup Label="Project References">
<ProjectReference Include="..\..\..\Compilers\Core\Portable\CodeAnalysis.csproj">
Expand Down
1 change: 1 addition & 0 deletions src/Interactive/VbiCore/VbiCore.vbproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<RuntimeIdentifiers>win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;osx.10.12-x64</RuntimeIdentifiers>
<PackageTargetFallback>portable-net452</PackageTargetFallback>
<NoStdLib>true</NoStdLib>
<NoWarn>$(NoWarn);40057</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<PackageTargetFallback>portable-net45+win8;dotnet</PackageTargetFallback>
<GeneratePkgDefFile>false</GeneratePkgDefFile>
<OptionStrict>Off</OptionStrict>
<NoWarn>$(NoWarn);41999,42016,42017,42018,42019,42020,42021,42022,42032,42036</NoWarn>
<NoWarn>$(NoWarn);41999,42016,42017,42018,42019,42020,42021,42022,42032,42036;40057</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'" />
Expand Down
1 change: 1 addition & 0 deletions src/Scripting/VisualBasic/BasicScripting.vbproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<AssemblyName>Microsoft.CodeAnalysis.VisualBasic.Scripting</AssemblyName>
<TargetFramework>netstandard1.3</TargetFramework>
<PackageTargetFallback>portable-net452</PackageTargetFallback>
<NoWarn>$(NoWarn);40057</NoWarn>
</PropertyGroup>
<ItemGroup Label="Project References">
<ProjectReference Include="..\..\Compilers\Core\Portable\CodeAnalysis.csproj">
Expand Down
1 change: 1 addition & 0 deletions src/Scripting/VisualBasicTest/BasicScriptingTest.vbproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<TargetFramework>netstandard1.3</TargetFramework>
<PackageTargetFallback>portable-net452</PackageTargetFallback>
<RoslynProjectType>UnitTestDesktop</RoslynProjectType>
<NoWarn>$(NoWarn);40057</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'" />
Expand Down
12 changes: 6 additions & 6 deletions src/Scripting/VisualBasicTest/InteractiveSessionTests.vb
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,23 @@ 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>
Public Sub StatementExpressions_LineContinuation()
Dim source = "
?1 _
"
Assert.Equal(1, VisualBasicScript.EvaluateAsync(source).Result)
Assert.Equal(1, CType(VisualBasicScript.EvaluateAsync(source).Result, Integer))
End Sub

<Fact>
Public Sub StatementExpressions_IntLiteral()
Dim source = "
?1
"
Assert.Equal(1, VisualBasicScript.EvaluateAsync(source).Result)
Assert.Equal(1, CType(VisualBasicScript.EvaluateAsync(source).Result, Integer))
End Sub

<Fact>
Expand All @@ -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>
Expand All @@ -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>
Expand All @@ -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

Expand Down
10 changes: 5 additions & 5 deletions src/Scripting/VisualBasicTest/ScriptTests.vb
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,28 @@ 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>
Public Async Function TestCreateAndRunScript() As Task
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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<TargetFramework>netcoreapp1.1</TargetFramework>
<RuntimeIdentifiers>win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;osx.10.12-x64</RuntimeIdentifiers>
<NonShipping>true</NonShipping>
<NoWarn>$(NoWarn);40057</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<TargetFramework>netcoreapp1.1</TargetFramework>
<RuntimeIdentifiers>win7-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;osx.10.12-x64</RuntimeIdentifiers>
<NonShipping>true</NonShipping>
<NoWarn>$(NoWarn);40057</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" />
Expand Down
1 change: 1 addition & 0 deletions src/Workspaces/VisualBasic/Portable/BasicWorkspace.vbproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<TargetFramework>netstandard1.3</TargetFramework>
<PackageTargetFallback>portable-net45+win8;dotnet</PackageTargetFallback>
<ServiceablePackage>true</ServiceablePackage>
<NoWarn>$(NoWarn);40057</NoWarn>
</PropertyGroup>
<ItemGroup Label="Project References">
<ProjectReference Include="..\..\..\Compilers\Core\Portable\CodeAnalysis.csproj">
Expand Down