diff --git a/CodeConverter/CSharp/ExpressionNodeVisitor.cs b/CodeConverter/CSharp/ExpressionNodeVisitor.cs index 2de4609ee..813f839b1 100644 --- a/CodeConverter/CSharp/ExpressionNodeVisitor.cs +++ b/CodeConverter/CSharp/ExpressionNodeVisitor.cs @@ -1884,7 +1884,9 @@ private RefConversion NeedsVariableForArgument(VBasic.Syntax.ArgumentSyntax node RefConversion GetRefConversion(VBSyntax.ExpressionSyntax expression) { var symbolInfo = GetSymbolInfoInDocument(expression); - if (symbolInfo is IPropertySymbol propertySymbol) { + if (symbolInfo is IPropertySymbol propertySymbol + // a property in VB.NET code can be ReturnsByRef if it's defined in a C# assembly the VB.NET code references + && !propertySymbol.ReturnsByRef && !propertySymbol.ReturnsByRefReadonly) { return propertySymbol.IsReadOnly ? RefConversion.PreAssigment : RefConversion.PreAndPostAssignment; } else if (symbolInfo is IFieldSymbol { IsConst: true } or ILocalSymbol { IsConst: true }) { @@ -1912,7 +1914,16 @@ RefConversion GetRefConversion(VBSyntax.ExpressionSyntax expression) bool IsRefArrayAcces(VBSyntax.ExpressionSyntax expression) { if (!(expression is VBSyntax.InvocationExpressionSyntax ies)) return false; - return _semanticModel.GetOperation(ies).IsArrayElementAccess() && GetRefConversion(ies.Expression) == RefConversion.Inline; + var op = _semanticModel.GetOperation(ies); + return (op.IsArrayElementAccess() || IsReturnsByRefPropertyElementAccess(op)) + && GetRefConversion(ies.Expression) == RefConversion.Inline; + + static bool IsReturnsByRefPropertyElementAccess(IOperation op) + { + return op.IsPropertyElementAccess() + && op is IPropertyReferenceOperation { Property: { } prop } + && (prop.ReturnsByRef || prop.ReturnsByRefReadonly); + } } } diff --git a/CodeConverter/CSharp/OperationExtensions.cs b/CodeConverter/CSharp/OperationExtensions.cs index 495e4f6f5..8ffbd3375 100644 --- a/CodeConverter/CSharp/OperationExtensions.cs +++ b/CodeConverter/CSharp/OperationExtensions.cs @@ -56,9 +56,10 @@ public static bool IsAssignableExpression(this IOperation operation) case OperationKind.DynamicMemberReference: return true; - //Just documenting since it's the only one mentioning reference that can't necessarily be assigned to AFAIK case OperationKind.PropertyReference: - return false; + //a property might be RefReturn, if it's defined in a referenced C# assembly + var prop = ((IPropertyReferenceOperation)operation).Property; + return prop.ReturnsByRef || prop.ReturnsByRefReadonly; } return false; diff --git a/Tests/CSharp/MultiFileSolutionAndProjectTests.cs b/Tests/CSharp/MultiFileSolutionAndProjectTests.cs index 343def9af..38fd61434 100644 --- a/Tests/CSharp/MultiFileSolutionAndProjectTests.cs +++ b/Tests/CSharp/MultiFileSolutionAndProjectTests.cs @@ -18,16 +18,22 @@ public MultiFileSolutionAndProjectTests(MultiFileTestFixture multiFileTestFixtur _multiFileTestFixture = multiFileTestFixture; } - [Fact] /* enable for executing locally */ + [Fact] public async Task ConvertWholeSolutionAsync() { await _multiFileTestFixture.ConvertProjectsWhereAsync(p => true, Language.CS); } - [Fact] /* enable for executing locally */ + [Fact] public async Task ConvertVbLibraryOnlyAsync() { await _multiFileTestFixture.ConvertProjectsWhereAsync(p => p.Name == "VbLibrary", Language.CS); } + + [Fact(Skip= "Roslyn bugs mean we can't run this test: https://github.com/icsharpcode/CodeConverter/pull/1116#issuecomment-2242645546")] + public async Task ConvertVbUsingCSharpRefReturnOnlyAsync() + { + await _multiFileTestFixture.ConvertProjectsWhereAsync(p => p.Name == "VisualBasicUsingCSharpRefReturn", Language.CS); + } } \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/CSharpRefReturn/CSharpRefReturn.csproj b/Tests/TestData/MultiFileCharacterization/SourceFiles/CSharpRefReturn/CSharpRefReturn.csproj new file mode 100644 index 000000000..71e958a13 --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/CSharpRefReturn/CSharpRefReturn.csproj @@ -0,0 +1,48 @@ + + + + + Debug + AnyCPU + {8B843547-F49D-40A2-8C4E-1B81D8C5D589} + Library + Properties + CSharpRefReturn + CSharpRefReturn + v4.8 + 512 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/CSharpRefReturn/Properties/AssemblyInfo.cs b/Tests/TestData/MultiFileCharacterization/SourceFiles/CSharpRefReturn/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..c6a300242 --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/CSharpRefReturn/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("CSharpRefReturn")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("CSharpRefReturn")] +[assembly: AssemblyCopyright("Copyright © 2024")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("8b843547-f49d-40a2-8c4e-1b81d8c5d589")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/CSharpRefReturn/RefReturnList.cs b/Tests/TestData/MultiFileCharacterization/SourceFiles/CSharpRefReturn/RefReturnList.cs new file mode 100644 index 000000000..db4e66c00 --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/CSharpRefReturn/RefReturnList.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CSharpRefReturn +{ + public class RefReturnList + { + private T dummy; + public ref T this[int i] { + get { + return ref dummy; + } + } + + public ref T RefProperty + { + get + { + return ref dummy; + } + } + } +} diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/VisualBasicUsesCSharpRefReturn/ByRefArgument.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/VisualBasicUsesCSharpRefReturn/ByRefArgument.vb new file mode 100644 index 000000000..5e0b94173 --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/VisualBasicUsesCSharpRefReturn/ByRefArgument.vb @@ -0,0 +1,22 @@ +Public Class ByRefArgument + Sub UseArr() + Dim arrObj() As Object + Modify(arrObj(0)) + + Dim arrInt() As Integer + Modify(arrInt(0)) + End Sub + + Sub UseRefReturn() + Dim lstObj As CSharpRefReturn.RefReturnList(Of Object) + Modify(lstObj(0)) + Modify(lstObj.RefProperty) + + Dim lstInt As CSharpRefReturn.RefReturnList(Of Integer) + Modify(lstInt(0)) + Modify(lstInt.RefProperty) + End Sub + + Sub Modify(ByRef o As Object) + End Sub +End Class diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/VisualBasicUsesCSharpRefReturn/My Project/Application.Designer.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/VisualBasicUsesCSharpRefReturn/My Project/Application.Designer.vb new file mode 100644 index 000000000..88dd01c78 --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/VisualBasicUsesCSharpRefReturn/My Project/Application.Designer.vb @@ -0,0 +1,13 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.42000 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/VisualBasicUsesCSharpRefReturn/My Project/Application.myapp b/Tests/TestData/MultiFileCharacterization/SourceFiles/VisualBasicUsesCSharpRefReturn/My Project/Application.myapp new file mode 100644 index 000000000..758895def --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/VisualBasicUsesCSharpRefReturn/My Project/Application.myapp @@ -0,0 +1,10 @@ + + + false + false + 0 + true + 0 + 1 + true + diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/VisualBasicUsesCSharpRefReturn/My Project/AssemblyInfo.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/VisualBasicUsesCSharpRefReturn/My Project/AssemblyInfo.vb new file mode 100644 index 000000000..c1b7374d9 --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/VisualBasicUsesCSharpRefReturn/My Project/AssemblyInfo.vb @@ -0,0 +1,35 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' General Information about an assembly is controlled through the following +' set of attributes. Change these attribute values to modify the information +' associated with an assembly. + +' Review the values of the assembly attributes + + + + + + + + + + +'The following GUID is for the ID of the typelib if this project is exposed to COM + + +' Version information for an assembly consists of the following four values: +' +' Major Version +' Minor Version +' Build Number +' Revision +' +' You can specify all the values or you can default the Build and Revision Numbers +' by using the '*' as shown below: +' + + + diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/VisualBasicUsesCSharpRefReturn/My Project/Resources.Designer.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/VisualBasicUsesCSharpRefReturn/My Project/Resources.Designer.vb new file mode 100644 index 000000000..73c6c9ec1 --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/VisualBasicUsesCSharpRefReturn/My Project/Resources.Designer.vb @@ -0,0 +1,62 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.42000 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My.Resources + + 'This class was auto-generated by the StronglyTypedResourceBuilder + 'class via a tool like ResGen or Visual Studio. + 'To add or remove a member, edit your .ResX file then rerun ResGen + 'with the /str option, or rebuild your VS project. + ''' + ''' A strongly-typed resource class, for looking up localized strings, etc. + ''' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ''' + ''' Returns the cached ResourceManager instance used by this class. + ''' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("VisualBasicUsesCSharpRefReturn.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ''' + ''' Overrides the current thread's CurrentUICulture property for all + ''' resource lookups using this strongly typed resource class. + ''' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set(ByVal value As Global.System.Globalization.CultureInfo) + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/VisualBasicUsesCSharpRefReturn/My Project/Resources.resx b/Tests/TestData/MultiFileCharacterization/SourceFiles/VisualBasicUsesCSharpRefReturn/My Project/Resources.resx new file mode 100644 index 000000000..af7dbebba --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/VisualBasicUsesCSharpRefReturn/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/VisualBasicUsesCSharpRefReturn/My Project/Settings.Designer.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/VisualBasicUsesCSharpRefReturn/My Project/Settings.Designer.vb new file mode 100644 index 000000000..a72a4de3d --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/VisualBasicUsesCSharpRefReturn/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.42000 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) + +#Region "My.Settings Auto-Save Functionality" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global.VisualBasicUsesCSharpRefReturn.My.MySettings + Get + Return Global.VisualBasicUsesCSharpRefReturn.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/VisualBasicUsesCSharpRefReturn/My Project/Settings.settings b/Tests/TestData/MultiFileCharacterization/SourceFiles/VisualBasicUsesCSharpRefReturn/My Project/Settings.settings new file mode 100644 index 000000000..85b890b3c --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/VisualBasicUsesCSharpRefReturn/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/VisualBasicUsesCSharpRefReturn/Resources.resx b/Tests/TestData/MultiFileCharacterization/SourceFiles/VisualBasicUsesCSharpRefReturn/Resources.resx new file mode 100644 index 000000000..af7dbebba --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/VisualBasicUsesCSharpRefReturn/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/VisualBasicUsesCSharpRefReturn/VisualBasicUsingCSharpRefReturn.vbproj b/Tests/TestData/MultiFileCharacterization/SourceFiles/VisualBasicUsesCSharpRefReturn/VisualBasicUsingCSharpRefReturn.vbproj new file mode 100644 index 000000000..7ca971866 --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/VisualBasicUsesCSharpRefReturn/VisualBasicUsingCSharpRefReturn.vbproj @@ -0,0 +1,111 @@ + + + + + Debug + AnyCPU + {6266982D-4807-4619-A71D-1440D0B6B6F4} + Library + VisualBasicUsesCSharpRefReturn + VisualBasicUsesCSharpRefReturn + 512 + Windows + v4.8 + true + + + true + full + true + true + bin\Debug\ + VisualBasicUsesCSharpRefReturn.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + pdbonly + false + true + true + bin\Release\ + VisualBasicUsesCSharpRefReturn.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + On + + + Binary + + + Off + + + On + + + + + + + + + + + + + + + + + + + + + + + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + {8b843547-f49d-40a2-8c4e-1b81d8c5d589} + CSharpRefReturn + + + + \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/VisualBasicUsesCSharpRefReturn/WithRefReturnStructure.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/VisualBasicUsesCSharpRefReturn/WithRefReturnStructure.vb new file mode 100644 index 000000000..1e22cf70a --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/VisualBasicUsesCSharpRefReturn/WithRefReturnStructure.vb @@ -0,0 +1,30 @@ +Public Class WithRefReturnStructure + Sub UseArr() + Dim arr() As SomeStruct + Dim s As String + + With arr(0) + .P = s + s = .P + End With + End Sub + + Sub UseRefReturn() + Dim lst As CSharpRefReturn.RefReturnList(Of SomeStruct) + Dim s As String + + With lst(0) + .P = s + s = .P + End With + + With lst.RefProperty + .P = s + s = .P + End With + End Sub + + Structure SomeStruct + Public Property P As String + End Structure +End Class diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/CharacterizationTestSolution.sln b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/CharacterizationTestSolution.sln new file mode 100644 index 000000000..acd902558 --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/CharacterizationTestSolution.sln @@ -0,0 +1,90 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.9.34321.82 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "WindowsAppVb", "WindowsAppVb\WindowsAppVb.vbproj", "{D18AB89D-1897-4779-A937-F48661E0B6B8}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSharpConsoleApp", "ConsoleApp2\CSharpConsoleApp.csproj", "{B7602E54-8F45-4DC4-88B5-E11CDC7E8B41}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetCore", "NetCore\NetCore.csproj", "{73BF583C-DD55-486C-9D0F-15D3D8CC72D9}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{5E8B06A8-42BC-4D2A-A769-66A2352F215E}" + ProjectSection(SolutionItems) = preProject + ユニコード.txt = ユニコード.txt + EndProjectSection +EndProject +Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "VbLibrary", "VbLibrary\VbLibrary.vbproj", "{23195658-FBE7-4A3E-B79D-91AAC2D428E7}" +EndProject +Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "VbNetStandardLib", "VbNetStandardLib\VbNetStandardLib.vbproj", "{FBFBE639-A532-408A-960D-288E05FEEB0E}" +EndProject +Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "ConsoleApp4", "ConsoleApp4\ConsoleApp4.vbproj", "{68361F37-56E9-4B49-AFF3-F1AF9938A97F}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CSharpNetStandardLib", "CSharpNetStandardLib\CSharpNetStandardLib.csproj", "{4DE39D59-19C6-4E1E-910C-5EA8BA55348B}" +EndProject +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Prefix.VbLibrary", "Prefix.VbLibrary\Prefix.VbLibrary.vbproj", "{CFAB82CD-BA17-4F08-99E2-403FADB0C46A}" +EndProject +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "VisualBasicConsoleApp", "ConsoleApp1\VisualBasicConsoleApp.vbproj", "{C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSharpRefReturn", "CSharpRefReturn\CSharpRefReturn.csproj", "{8B843547-F49D-40A2-8C4E-1B81D8C5D589}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VisualBasicUsingCSharpRefReturn", "VisualBasicUsesCSharpRefReturn\VisualBasicUsingCSharpRefReturn.csproj", "{D0421946-845F-09E8-2545-DE3EB2218254}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D18AB89D-1897-4779-A937-F48661E0B6B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D18AB89D-1897-4779-A937-F48661E0B6B8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D18AB89D-1897-4779-A937-F48661E0B6B8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D18AB89D-1897-4779-A937-F48661E0B6B8}.Release|Any CPU.Build.0 = Release|Any CPU + {B7602E54-8F45-4DC4-88B5-E11CDC7E8B41}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B7602E54-8F45-4DC4-88B5-E11CDC7E8B41}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B7602E54-8F45-4DC4-88B5-E11CDC7E8B41}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B7602E54-8F45-4DC4-88B5-E11CDC7E8B41}.Release|Any CPU.Build.0 = Release|Any CPU + {73BF583C-DD55-486C-9D0F-15D3D8CC72D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {73BF583C-DD55-486C-9D0F-15D3D8CC72D9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {73BF583C-DD55-486C-9D0F-15D3D8CC72D9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {73BF583C-DD55-486C-9D0F-15D3D8CC72D9}.Release|Any CPU.Build.0 = Release|Any CPU + {23195658-FBE7-4A3E-B79D-91AAC2D428E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {23195658-FBE7-4A3E-B79D-91AAC2D428E7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {23195658-FBE7-4A3E-B79D-91AAC2D428E7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {23195658-FBE7-4A3E-B79D-91AAC2D428E7}.Release|Any CPU.Build.0 = Release|Any CPU + {FBFBE639-A532-408A-960D-288E05FEEB0E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FBFBE639-A532-408A-960D-288E05FEEB0E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FBFBE639-A532-408A-960D-288E05FEEB0E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FBFBE639-A532-408A-960D-288E05FEEB0E}.Release|Any CPU.Build.0 = Release|Any CPU + {68361F37-56E9-4B49-AFF3-F1AF9938A97F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {68361F37-56E9-4B49-AFF3-F1AF9938A97F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {68361F37-56E9-4B49-AFF3-F1AF9938A97F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {68361F37-56E9-4B49-AFF3-F1AF9938A97F}.Release|Any CPU.Build.0 = Release|Any CPU + {4DE39D59-19C6-4E1E-910C-5EA8BA55348B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4DE39D59-19C6-4E1E-910C-5EA8BA55348B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4DE39D59-19C6-4E1E-910C-5EA8BA55348B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4DE39D59-19C6-4E1E-910C-5EA8BA55348B}.Release|Any CPU.Build.0 = Release|Any CPU + {CFAB82CD-BA17-4F08-99E2-403FADB0C46A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CFAB82CD-BA17-4F08-99E2-403FADB0C46A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CFAB82CD-BA17-4F08-99E2-403FADB0C46A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CFAB82CD-BA17-4F08-99E2-403FADB0C46A}.Release|Any CPU.Build.0 = Release|Any CPU + {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}.Release|Any CPU.Build.0 = Release|Any CPU + {8B843547-F49D-40A2-8C4E-1B81D8C5D589}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8B843547-F49D-40A2-8C4E-1B81D8C5D589}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8B843547-F49D-40A2-8C4E-1B81D8C5D589}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8B843547-F49D-40A2-8C4E-1B81D8C5D589}.Release|Any CPU.Build.0 = Release|Any CPU + {D0421946-845F-09E8-2545-DE3EB2218254}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D0421946-845F-09E8-2545-DE3EB2218254}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D0421946-845F-09E8-2545-DE3EB2218254}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D0421946-845F-09E8-2545-DE3EB2218254}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {417600E1-EB0F-4AF6-9C2D-9F542F6AEE7A} + EndGlobalSection +EndGlobal diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/ByRefArgument.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/ByRefArgument.cs new file mode 100644 index 000000000..d0bc1dcd2 --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/ByRefArgument.cs @@ -0,0 +1,39 @@ +using Microsoft.VisualBasic.CompilerServices; + +namespace VisualBasicUsesCSharpRefReturn +{ + public class ByRefArgument + { + public void UseArr() + { + var arrObj = default(object[]); + Modify(ref arrObj[0]); + + var arrInt = default(int[]); + var tmp = arrInt; + object argo = tmp[0]; + Modify(ref argo); + tmp[0] = Conversions.ToInteger(argo); + } + + public void UseRefReturn() + { + var lstObj = default(CSharpRefReturn.RefReturnList); + Modify(ref lstObj[0]); + Modify(ref lstObj.RefProperty); + + var lstInt = default(CSharpRefReturn.RefReturnList); + var tmp = lstInt; + object argo = tmp[0]; + Modify(ref argo); + tmp[0] = Conversions.ToInteger(argo); + object argo1 = lstInt.RefProperty; + Modify(ref argo1); + lstInt.RefProperty = Conversions.ToInteger(argo1); + } + + public void Modify(ref object o) + { + } + } +} \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/Application.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/Application.Designer.cs new file mode 100644 index 000000000..5e9e2a074 --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/Application.Designer.cs @@ -0,0 +1,11 @@ +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ + + diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/AssemblyInfo.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/AssemblyInfo.cs new file mode 100644 index 000000000..c10fc5b96 --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System; +using System.Reflection; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. + +// Review the values of the assembly attributes + +[assembly: AssemblyTitle("VisualBasicUsesCSharpRefReturn")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("VisualBasicUsesCSharpRefReturn")] +[assembly: AssemblyCopyright("Copyright © 2024")] +[assembly: AssemblyTrademark("")] + +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("47520bc8-6837-4f63-9aef-0a252d368f05")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// + +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/MyNamespace.Static.1.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/MyNamespace.Static.1.Designer.cs new file mode 100644 index 000000000..259c509e1 --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/MyNamespace.Static.1.Designer.cs @@ -0,0 +1,468 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Diagnostics; +using Microsoft.VisualBasic; + +/* TODO ERROR: Skipped IfDirectiveTrivia +#If TARGET = "module" AndAlso _MYTYPE = "" Then +*//* TODO ERROR: Skipped DisabledTextTrivia +#Const _MYTYPE="Empty" +*//* TODO ERROR: Skipped EndIfDirectiveTrivia +#End If +*/ +/* TODO ERROR: Skipped IfDirectiveTrivia +#If _MYTYPE = "WindowsForms" Then +*//* TODO ERROR: Skipped DisabledTextTrivia + +#Const _MYFORMS = True +#Const _MYWEBSERVICES = True +#Const _MYUSERTYPE = "Windows" +#Const _MYCOMPUTERTYPE = "Windows" +#Const _MYAPPLICATIONTYPE = "WindowsForms" + +*//* TODO ERROR: Skipped ElifDirectiveTrivia +#ElseIf _MYTYPE = "WindowsFormsWithCustomSubMain" Then +*//* TODO ERROR: Skipped DisabledTextTrivia + +#Const _MYFORMS = True +#Const _MYWEBSERVICES = True +#Const _MYUSERTYPE = "Windows" +#Const _MYCOMPUTERTYPE = "Windows" +#Const _MYAPPLICATIONTYPE = "Console" + +*//* TODO ERROR: Skipped ElifDirectiveTrivia +#ElseIf _MYTYPE = "Windows" OrElse _MYTYPE = "" Then +*/ +/* TODO ERROR: Skipped DefineDirectiveTrivia +#Const _MYWEBSERVICES = True +*//* TODO ERROR: Skipped DefineDirectiveTrivia +#Const _MYUSERTYPE = "Windows" +*//* TODO ERROR: Skipped DefineDirectiveTrivia +#Const _MYCOMPUTERTYPE = "Windows" +*//* TODO ERROR: Skipped DefineDirectiveTrivia +#Const _MYAPPLICATIONTYPE = "Windows" +*/ +/* TODO ERROR: Skipped ElifDirectiveTrivia +#ElseIf _MYTYPE = "Console" Then +*//* TODO ERROR: Skipped DisabledTextTrivia + +#Const _MYWEBSERVICES = True +#Const _MYUSERTYPE = "Windows" +#Const _MYCOMPUTERTYPE = "Windows" +#Const _MYAPPLICATIONTYPE = "Console" + +*//* TODO ERROR: Skipped ElifDirectiveTrivia +#ElseIf _MYTYPE = "Web" Then +*//* TODO ERROR: Skipped DisabledTextTrivia + +#Const _MYFORMS = False +#Const _MYWEBSERVICES = False +#Const _MYUSERTYPE = "Web" +#Const _MYCOMPUTERTYPE = "Web" + +*//* TODO ERROR: Skipped ElifDirectiveTrivia +#ElseIf _MYTYPE = "WebControl" Then +*//* TODO ERROR: Skipped DisabledTextTrivia + +#Const _MYFORMS = False +#Const _MYWEBSERVICES = True +#Const _MYUSERTYPE = "Web" +#Const _MYCOMPUTERTYPE = "Web" + +*//* TODO ERROR: Skipped ElifDirectiveTrivia +#ElseIf _MYTYPE = "Custom" Then +*//* TODO ERROR: Skipped DisabledTextTrivia + +*//* TODO ERROR: Skipped ElifDirectiveTrivia +#ElseIf _MYTYPE <> "Empty" Then +*//* TODO ERROR: Skipped DisabledTextTrivia + +#Const _MYTYPE = "Empty" + +*//* TODO ERROR: Skipped EndIfDirectiveTrivia +#End If +*/ +/* TODO ERROR: Skipped IfDirectiveTrivia +#If _MYTYPE <> "Empty" Then +*/ +namespace VisualBasicUsesCSharpRefReturn.My +{ + + /* TODO ERROR: Skipped IfDirectiveTrivia + #If _MYAPPLICATIONTYPE = "WindowsForms" OrElse _MYAPPLICATIONTYPE = "Windows" OrElse _MYAPPLICATIONTYPE = "Console" Then + */ + [System.CodeDom.Compiler.GeneratedCode("MyTemplate", "11.0.0.0")] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + + /* TODO ERROR: Skipped IfDirectiveTrivia + #If _MYAPPLICATIONTYPE = "WindowsForms" Then + *//* TODO ERROR: Skipped DisabledTextTrivia + Inherits Global.Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase + #If TARGET = "winexe" Then + _ + Friend Shared Sub Main(ByVal Args As String()) + Try + Global.System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(MyApplication.UseCompatibleTextRendering()) + Finally + End Try + My.Application.Run(Args) + End Sub + #End If + + *//* TODO ERROR: Skipped ElifDirectiveTrivia + #ElseIf _MYAPPLICATIONTYPE = "Windows" Then + */ + internal partial class MyApplication : Microsoft.VisualBasic.ApplicationServices.ApplicationBase + { + /* TODO ERROR: Skipped ElifDirectiveTrivia + #ElseIf _MYAPPLICATIONTYPE = "Console" Then + *//* TODO ERROR: Skipped DisabledTextTrivia + Inherits Global.Microsoft.VisualBasic.ApplicationServices.ConsoleApplicationBase + *//* TODO ERROR: Skipped EndIfDirectiveTrivia + #End If '_MYAPPLICATIONTYPE = "WindowsForms" + */ + } + + /* TODO ERROR: Skipped EndIfDirectiveTrivia + #End If '#If _MYAPPLICATIONTYPE = "WindowsForms" Or _MYAPPLICATIONTYPE = "Windows" or _MYAPPLICATIONTYPE = "Console" + */ + /* TODO ERROR: Skipped IfDirectiveTrivia + #If _MYCOMPUTERTYPE <> "" Then + */ + [System.CodeDom.Compiler.GeneratedCode("MyTemplate", "11.0.0.0")] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + + /* TODO ERROR: Skipped IfDirectiveTrivia + #If _MYCOMPUTERTYPE = "Windows" Then + */ + internal partial class MyComputer : Microsoft.VisualBasic.Devices.Computer + { + /* TODO ERROR: Skipped ElifDirectiveTrivia + #ElseIf _MYCOMPUTERTYPE = "Web" Then + *//* TODO ERROR: Skipped DisabledTextTrivia + Inherits Global.Microsoft.VisualBasic.Devices.ServerComputer + *//* TODO ERROR: Skipped EndIfDirectiveTrivia + #End If + */ + [DebuggerHidden()] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public MyComputer() : base() + { + } + } + /* TODO ERROR: Skipped EndIfDirectiveTrivia + #End If + */ + [HideModuleName()] + [System.CodeDom.Compiler.GeneratedCode("MyTemplate", "11.0.0.0")] + internal static class MyProject + { + + /* TODO ERROR: Skipped IfDirectiveTrivia + #If _MYCOMPUTERTYPE <> "" Then + */ + [System.ComponentModel.Design.HelpKeyword("My.Computer")] + internal static MyComputer Computer + { + [DebuggerHidden()] + get + { + return m_ComputerObjectProvider.GetInstance; + } + } + + private readonly static ThreadSafeObjectProvider m_ComputerObjectProvider = new ThreadSafeObjectProvider(); + /* TODO ERROR: Skipped EndIfDirectiveTrivia + #End If + */ + /* TODO ERROR: Skipped IfDirectiveTrivia + #If _MYAPPLICATIONTYPE = "Windows" Or _MYAPPLICATIONTYPE = "WindowsForms" Or _MYAPPLICATIONTYPE = "Console" Then + */ + [System.ComponentModel.Design.HelpKeyword("My.Application")] + internal static MyApplication Application + { + [DebuggerHidden()] + get + { + return m_AppObjectProvider.GetInstance; + } + } + private readonly static ThreadSafeObjectProvider m_AppObjectProvider = new ThreadSafeObjectProvider(); + /* TODO ERROR: Skipped EndIfDirectiveTrivia + #End If + */ + /* TODO ERROR: Skipped IfDirectiveTrivia + #If _MYUSERTYPE = "Windows" Then + */ + [System.ComponentModel.Design.HelpKeyword("My.User")] + internal static Microsoft.VisualBasic.ApplicationServices.User User + { + [DebuggerHidden()] + get + { + return m_UserObjectProvider.GetInstance; + } + } + private readonly static ThreadSafeObjectProvider m_UserObjectProvider = new ThreadSafeObjectProvider(); + /* TODO ERROR: Skipped ElifDirectiveTrivia + #ElseIf _MYUSERTYPE = "Web" Then + *//* TODO ERROR: Skipped DisabledTextTrivia + _ + Friend ReadOnly Property User() As Global.Microsoft.VisualBasic.ApplicationServices.WebUser + _ + Get + Return m_UserObjectProvider.GetInstance() + End Get + End Property + Private ReadOnly m_UserObjectProvider As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.ApplicationServices.WebUser) + *//* TODO ERROR: Skipped EndIfDirectiveTrivia + #End If + */ + /* TODO ERROR: Skipped IfDirectiveTrivia + #If _MYFORMS = True Then + *//* TODO ERROR: Skipped DisabledTextTrivia + + #Const STARTUP_MY_FORM_FACTORY = "My.MyProject.Forms" + + _ + Friend ReadOnly Property Forms() As MyForms + _ + Get + Return m_MyFormsObjectProvider.GetInstance() + End Get + End Property + + _ + _ + Friend NotInheritable Class MyForms + _ + Private Shared Function Create__Instance__(Of T As {New, Global.System.Windows.Forms.Form})(ByVal Instance As T) As T + If Instance Is Nothing OrElse Instance.IsDisposed Then + If m_FormBeingCreated IsNot Nothing Then + If m_FormBeingCreated.ContainsKey(GetType(T)) = True Then + Throw New Global.System.InvalidOperationException(Global.Microsoft.VisualBasic.CompilerServices.Utils.GetResourceString("WinForms_RecursiveFormCreate")) + End If + Else + m_FormBeingCreated = New Global.System.Collections.Hashtable() + End If + m_FormBeingCreated.Add(GetType(T), Nothing) + Try + Return New T() + Catch ex As Global.System.Reflection.TargetInvocationException When ex.InnerException IsNot Nothing + Dim BetterMessage As String = Global.Microsoft.VisualBasic.CompilerServices.Utils.GetResourceString("WinForms_SeeInnerException", ex.InnerException.Message) + Throw New Global.System.InvalidOperationException(BetterMessage, ex.InnerException) + Finally + m_FormBeingCreated.Remove(GetType(T)) + End Try + Else + Return Instance + End If + End Function + + _ + Private Sub Dispose__Instance__(Of T As Global.System.Windows.Forms.Form)(ByRef instance As T) + instance.Dispose() + instance = Nothing + End Sub + + _ + _ + Public Sub New() + MyBase.New() + End Sub + + Private Shared m_FormBeingCreated As Global.System.Collections.Hashtable + + Public Overrides Function Equals(ByVal o As Object) As Boolean + Return MyBase.Equals(o) + End Function + Public Overrides Function GetHashCode() As Integer + Return MyBase.GetHashCode + End Function + _ + Friend Overloads Function [GetType]() As Global.System.Type + Return GetType(MyForms) + End Function + Public Overrides Function ToString() As String + Return MyBase.ToString + End Function + End Class + + Private m_MyFormsObjectProvider As New ThreadSafeObjectProvider(Of MyForms) + + *//* TODO ERROR: Skipped EndIfDirectiveTrivia + #End If + */ + /* TODO ERROR: Skipped IfDirectiveTrivia + #If _MYWEBSERVICES = True Then + */ + [System.ComponentModel.Design.HelpKeyword("My.WebServices")] + internal static MyWebServices WebServices + { + [DebuggerHidden()] + get + { + return m_MyWebServicesObjectProvider.GetInstance; + } + } + + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + [MyGroupCollection("System.Web.Services.Protocols.SoapHttpClientProtocol", "Create__Instance__", "Dispose__Instance__", "")] + internal sealed class MyWebServices + { + + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + [DebuggerHidden()] + public override bool Equals(object o) + { + return base.Equals(o); + } + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + [DebuggerHidden()] + public override int GetHashCode() + { + return base.GetHashCode(); + } + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + [DebuggerHidden()] + internal new Type GetType() + { + return typeof(MyWebServices); + } + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + [DebuggerHidden()] + public override string ToString() + { + return base.ToString(); + } + + [DebuggerHidden()] + private static T Create__Instance__(T instance) where T : new() + { + if (instance is null) + { + return new T(); + } + else + { + return instance; + } + } + + [DebuggerHidden()] + private void Dispose__Instance__(ref T instance) + { + instance = default(T); + } + + [DebuggerHidden()] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public MyWebServices() : base() + { + } + } + + private readonly static ThreadSafeObjectProvider m_MyWebServicesObjectProvider = new ThreadSafeObjectProvider(); + /* TODO ERROR: Skipped EndIfDirectiveTrivia + #End If + */ + /* TODO ERROR: Skipped IfDirectiveTrivia + #If _MYTYPE = "Web" Then + *//* TODO ERROR: Skipped DisabledTextTrivia + + _ + Friend ReadOnly Property Request() As Global.System.Web.HttpRequest + _ + Get + Dim CurrentContext As Global.System.Web.HttpContext = Global.System.Web.HttpContext.Current + If CurrentContext IsNot Nothing Then + Return CurrentContext.Request + End If + Return Nothing + End Get + End Property + + _ + Friend ReadOnly Property Response() As Global.System.Web.HttpResponse + _ + Get + Dim CurrentContext As Global.System.Web.HttpContext = Global.System.Web.HttpContext.Current + If CurrentContext IsNot Nothing Then + Return CurrentContext.Response + End If + Return Nothing + End Get + End Property + + _ + Friend ReadOnly Property Log() As Global.Microsoft.VisualBasic.Logging.AspLog + _ + Get + Return m_LogObjectProvider.GetInstance() + End Get + End Property + + Private ReadOnly m_LogObjectProvider As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.Logging.AspLog) + + *//* TODO ERROR: Skipped EndIfDirectiveTrivia + #End If '_MYTYPE="Web" + */ + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + [System.Runtime.InteropServices.ComVisible(false)] + internal sealed class ThreadSafeObjectProvider where T : new() + { + internal T GetInstance + { + /* TODO ERROR: Skipped IfDirectiveTrivia + #If TARGET = "library" Then + */ + [DebuggerHidden()] + get + { + var Value = m_Context.Value; + if (Value is null) + { + Value = new T(); + m_Context.Value = Value; + } + return Value; + } + /* TODO ERROR: Skipped ElseDirectiveTrivia + #Else + *//* TODO ERROR: Skipped DisabledTextTrivia + _ + Get + If m_ThreadStaticValue Is Nothing Then m_ThreadStaticValue = New T + Return m_ThreadStaticValue + End Get + *//* TODO ERROR: Skipped EndIfDirectiveTrivia + #End If + */ + } + + [DebuggerHidden()] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public ThreadSafeObjectProvider() : base() + { + } + + /* TODO ERROR: Skipped IfDirectiveTrivia + #If TARGET = "library" Then + */ + private readonly Microsoft.VisualBasic.MyServices.Internal.ContextValue m_Context = new Microsoft.VisualBasic.MyServices.Internal.ContextValue(); + /* TODO ERROR: Skipped ElseDirectiveTrivia + #Else + *//* TODO ERROR: Skipped DisabledTextTrivia + Private Shared m_ThreadStaticValue As T + *//* TODO ERROR: Skipped EndIfDirectiveTrivia + #End If + */ + } + } +} +/* TODO ERROR: Skipped EndIfDirectiveTrivia +#End If +*/ \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/MyNamespace.Static.2.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/MyNamespace.Static.2.Designer.cs new file mode 100644 index 000000000..01e385026 --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/MyNamespace.Static.2.Designer.cs @@ -0,0 +1,242 @@ +using System.Collections; +using System.Collections.Generic; +using System.Data; +using System.Diagnostics; +using System.Linq; +using System.Xml.Linq; +using Microsoft.VisualBasic; +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +// See Compiler::LoadXmlSolutionExtension +namespace VisualBasicUsesCSharpRefReturn.My +{ + [Embedded()] + [DebuggerNonUserCode()] + [System.Runtime.CompilerServices.CompilerGenerated()] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + internal sealed class InternalXmlHelper + { + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + private InternalXmlHelper() + { + } + public static string get_Value(IEnumerable source) + { + foreach (XElement item in source) + return item.Value; + return null; + } + + public static void set_Value(IEnumerable source, string value) + { + foreach (XElement item in source) + { + item.Value = value; + break; + } + } + public static string get_AttributeValue(IEnumerable source, XName name) + { + foreach (XElement item in source) + return (string)item.Attribute(name); + return null; + } + + public static void set_AttributeValue(IEnumerable source, XName name, string value) + { + foreach (XElement item in source) + { + item.SetAttributeValue(name, value); + break; + } + } + public static string get_AttributeValue(XElement source, XName name) + { + return (string)source.Attribute(name); + } + + public static void set_AttributeValue(XElement source, XName name, string value) + { + source.SetAttributeValue(name, value); + } + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public static XAttribute CreateAttribute(XName name, object value) + { + if (value is null) + { + return null; + } + return new XAttribute(name, value); + } + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public static XAttribute CreateNamespaceAttribute(XName name, XNamespace ns) + { + var a = new XAttribute(name, ns.NamespaceName); + a.AddAnnotation(ns); + return a; + } + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public static object RemoveNamespaceAttributes(string[] inScopePrefixes, XNamespace[] inScopeNs, List attributes, object obj) + { + if (obj is not null) + { + XElement elem = obj as XElement; + if (elem is not null) + { + return RemoveNamespaceAttributes(inScopePrefixes, inScopeNs, attributes, elem); + } + else + { + IEnumerable elems = obj as IEnumerable; + if (elems is not null) + { + return RemoveNamespaceAttributes(inScopePrefixes, inScopeNs, attributes, elems); + } + } + } + return obj; + } + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public static IEnumerable RemoveNamespaceAttributes(string[] inScopePrefixes, XNamespace[] inScopeNs, List attributes, IEnumerable obj) + { + if (obj is not null) + { + IEnumerable elems = obj as IEnumerable; + if (elems is not null) + { + return elems.Select(new RemoveNamespaceAttributesClosure(inScopePrefixes, inScopeNs, attributes).ProcessXElement); + } + else + { + return obj.Cast().Select(new RemoveNamespaceAttributesClosure(inScopePrefixes, inScopeNs, attributes).ProcessObject); + } + } + return obj; + } + [DebuggerNonUserCode()] + [System.Runtime.CompilerServices.CompilerGenerated()] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + private sealed class RemoveNamespaceAttributesClosure + { + private readonly string[] m_inScopePrefixes; + private readonly XNamespace[] m_inScopeNs; + private readonly List m_attributes; + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + internal RemoveNamespaceAttributesClosure(string[] inScopePrefixes, XNamespace[] inScopeNs, List attributes) + { + m_inScopePrefixes = inScopePrefixes; + m_inScopeNs = inScopeNs; + m_attributes = attributes; + } + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + internal XElement ProcessXElement(XElement elem) + { + return RemoveNamespaceAttributes(m_inScopePrefixes, m_inScopeNs, m_attributes, elem); + } + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + internal object ProcessObject(object obj) + { + XElement elem = obj as XElement; + if (elem is not null) + { + return RemoveNamespaceAttributes(m_inScopePrefixes, m_inScopeNs, m_attributes, elem); + } + else + { + return obj; + } + } + } + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public static XElement RemoveNamespaceAttributes(string[] inScopePrefixes, XNamespace[] inScopeNs, List attributes, XElement e) + { + if (e is not null) + { + var a = e.FirstAttribute; + + while (a is not null) + { + var nextA = a.NextAttribute; + + if (a.IsNamespaceDeclaration) + { + var ns = a.Annotation(); + string prefix = a.Name.LocalName; + + if (ns is not null) + { + if (inScopePrefixes is not null && inScopeNs is not null) + { + int lastIndex = inScopePrefixes.Length - 1; + + for (int i = 0, loopTo = lastIndex; i <= loopTo; i++) + { + string currentInScopePrefix = inScopePrefixes[i]; + var currentInScopeNs = inScopeNs[i]; + if (prefix.Equals(currentInScopePrefix)) + { + if (ns == currentInScopeNs) + { + // prefix and namespace match. Remove the unneeded ns attribute + a.Remove(); + } + + // prefix is in scope but refers to something else. Leave the ns attribute. + a = null; + break; + } + } + } + + if (a is not null) + { + // Prefix is not in scope + // Now check whether it's going to be in scope because it is in the attributes list + + if (attributes is not null) + { + int lastIndex = attributes.Count - 1; + for (int i = 0, loopTo1 = lastIndex; i <= loopTo1; i++) + { + var currentA = attributes[i]; + string currentInScopePrefix = currentA.Name.LocalName; + var currentInScopeNs = currentA.Annotation(); + if (currentInScopeNs is not null) + { + if (prefix.Equals(currentInScopePrefix)) + { + if (ns == currentInScopeNs) + { + // prefix and namespace match. Remove the unneeded ns attribute + a.Remove(); + } + + // prefix is in scope but refers to something else. Leave the ns attribute. + a = null; + break; + } + } + } + } + + if (a is not null) + { + // Prefix is definitely not in scope + a.Remove(); + // namespace is not defined either. Add this attributes list + attributes.Add(a); + } + } + } + } + + a = nextA; + } + } + return e; + } + + } +} \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/MyNamespace.Static.3.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/MyNamespace.Static.3.Designer.cs new file mode 100644 index 000000000..e39b42043 --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/MyNamespace.Static.3.Designer.cs @@ -0,0 +1,16 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; + +namespace Microsoft.VisualBasic +{ + [Embedded()] + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Module | AttributeTargets.Assembly, Inherited = false)] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + [System.Runtime.CompilerServices.CompilerGenerated()] + internal sealed class Embedded : Attribute + { + } +} \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/Settings.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/Settings.Designer.cs new file mode 100644 index 000000000..4023833b9 --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/Settings.Designer.cs @@ -0,0 +1,88 @@ +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ + +using System.Diagnostics; +using Microsoft.VisualBasic; + + +namespace VisualBasicUsesCSharpRefReturn.My +{ + + [System.Runtime.CompilerServices.CompilerGenerated()] + [System.CodeDom.Compiler.GeneratedCode("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)] + internal sealed partial class MySettings : System.Configuration.ApplicationSettingsBase + { + + private static MySettings defaultInstance = (MySettings)Synchronized(new MySettings()); + + #region My.Settings Auto-Save Functionality + /* TODO ERROR: Skipped IfDirectiveTrivia + #If _MyType = "WindowsForms" Then + *//* TODO ERROR: Skipped DisabledTextTrivia + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub + *//* TODO ERROR: Skipped EndIfDirectiveTrivia + #End If + */ + #endregion + + public static MySettings Default + { + get + { + + /* TODO ERROR: Skipped IfDirectiveTrivia + #If _MyType = "WindowsForms" Then + *//* TODO ERROR: Skipped DisabledTextTrivia + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If + *//* TODO ERROR: Skipped EndIfDirectiveTrivia + #End If + */ + return defaultInstance; + } + } + } +} + +namespace VisualBasicUsesCSharpRefReturn.My +{ + + [HideModuleName()] + [DebuggerNonUserCode()] + [System.Runtime.CompilerServices.CompilerGenerated()] + internal static class MySettingsProperty + { + + [System.ComponentModel.Design.HelpKeyword("My.Settings")] + internal static MySettings Settings + { + get + { + return MySettings.Default; + } + } + } +} \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/Resources.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/Resources.Designer.cs new file mode 100644 index 000000000..480dcb9a8 --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/Resources.Designer.cs @@ -0,0 +1,70 @@ +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ + +using System.Diagnostics; +using Microsoft.VisualBasic; + + +namespace VisualBasicUsesCSharpRefReturn.My.Resources +{ + + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + [System.CodeDom.Compiler.GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [DebuggerNonUserCode()] + [System.Runtime.CompilerServices.CompilerGenerated()] + [HideModuleName()] + internal static class Resources + { + + private static System.Resources.ResourceManager resourceMan; + + private static System.Globalization.CultureInfo resourceCulture; + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)] + internal static System.Resources.ResourceManager ResourceManager + { + get + { + if (ReferenceEquals(resourceMan, null)) + { + var temp = new System.Resources.ResourceManager("VisualBasicUsesCSharpRefReturn.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)] + internal static System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/Resources.resx b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/Resources.resx new file mode 100644 index 000000000..af7dbebba --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/VisualBasicUsingCSharpRefReturn.csproj b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/VisualBasicUsingCSharpRefReturn.csproj new file mode 100644 index 000000000..8b2a8df24 --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/VisualBasicUsingCSharpRefReturn.csproj @@ -0,0 +1,115 @@ + + + + + Debug + AnyCPU + {D0421946-845F-09E8-2545-DE3EB2218254} + Library + VisualBasicUsesCSharpRefReturn + VisualBasicUsesCSharpRefReturn + 512 + Windows + v4.8 + true + $(DefaultItemExcludes);$(ProjectDir)**\*.vb + latest + + + true + full + bin\Debug\ + bin\Debug\VisualBasicUsesCSharpRefReturn.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + TRACE;DEBUG + + + pdbonly + true + bin\Release\ + bin\Release\VisualBasicUsesCSharpRefReturn.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + TRACE + + + On + + + Binary + + + Off + + + On + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + + ResXFileCodeGenerator + Resources.Designer.cs + VisualBasicUsesCSharpRefReturn.My.Resources + Designer + + + + + MyApplicationCodeGenerator + Application.Designer.cs + + + SettingsSingleFileGenerator + VisualBasicUsesCSharpRefReturn.My + Settings.Designer.cs + + + + + {8b843547-f49d-40a2-8c4e-1b81d8c5d589} + CSharpRefReturn + + + + \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/WithRefReturnStructure.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/WithRefReturnStructure.cs new file mode 100644 index 000000000..64b3cd197 --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/WithRefReturnStructure.cs @@ -0,0 +1,41 @@ + +namespace VisualBasicUsesCSharpRefReturn +{ + public class WithRefReturnStructure + { + public void UseArr() + { + var arr = default(SomeStruct[]); + var s = default(string); + + { + ref var withBlock = ref arr[0]; + withBlock.P = s; + s = withBlock.P; + } + } + + public void UseRefReturn() + { + var lst = default(CSharpRefReturn.RefReturnList); + var s = default(string); + + { + ref var withBlock = ref lst[0]; + withBlock.P = s; + s = withBlock.P; + } + + { + ref var withBlock1 = ref lst.RefProperty; + withBlock1.P = s; + s = withBlock1.P; + } + } + + public struct SomeStruct + { + public string P { get; set; } + } + } +} \ No newline at end of file diff --git a/Tests/VB/MultiFileSolutionAndProjectTests.cs b/Tests/VB/MultiFileSolutionAndProjectTests.cs index 4adb543d2..a19dd3154 100644 --- a/Tests/VB/MultiFileSolutionAndProjectTests.cs +++ b/Tests/VB/MultiFileSolutionAndProjectTests.cs @@ -21,7 +21,8 @@ public MultiFileSolutionAndProjectTests(MultiFileTestFixture multiFileTestFixtur [Fact] /* enable for executing locally */ public async Task ConvertWholeSolutionAsync() { - await _multiFileTestFixture.ConvertProjectsWhereAsync(p => true, Language.VB); + //the `CSharpRefReturn` project is excluded because it has ref return properties which are not supported in VB + await _multiFileTestFixture.ConvertProjectsWhereAsync(p => p.Name != "CSharpRefReturn", Language.VB); } [Fact] /* enable for executing locally */