From 649133f345469b6b30643254456d22933a4a8c8e Mon Sep 17 00:00:00 2001 From: Gen Lu Date: Thu, 31 Aug 2017 11:15:32 -0700 Subject: [PATCH] Add test for new get in/out conversion extension methods --- .../IOperation/IOperationTests_IArgument.vb | 40 +++++++++++++++++-- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IArgument.vb b/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IArgument.vb index dcefbfed482..a4b963c67a5 100644 --- a/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IArgument.vb +++ b/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IArgument.vb @@ -1,4 +1,4 @@ -' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. Imports Microsoft.CodeAnalysis.VisualBasic.Syntax Imports Microsoft.CodeAnalysis.Test.Utilities @@ -868,7 +868,6 @@ Class C Return 0 End Operator - Public Shared Narrowing Operator CType(ByVal i As Integer) As C Return New C() End Operator @@ -908,7 +907,6 @@ Class C Return 0 End Operator - Public Shared Narrowing Operator CType(ByVal i As Integer) As C Return New C() End Operator @@ -973,5 +971,41 @@ BC33037: Cannot copy the value of 'ByRef' parameter 'a' back to the matching arg ]]>.Value VerifyOperationTreeAndDiagnosticsForTest(Of InvocationExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub + + + + Public Sub TestCloneInOutConversion() + Dim source = .Value + + Dim fileName = "a.vb" + Dim syntaxTree = Parse(source, fileName, options:=Nothing) + + Dim compilation = CreateCompilationWithMscorlib45AndVBRuntime({syntaxTree}, DefaultVbReferences.Concat({ValueTupleRef, SystemRuntimeFacadeRef})) + Dim tree = (From t In compilation.SyntaxTrees Where t.FilePath = fileName).Single() + Dim model = compilation.GetSemanticModel(tree) + + VerifyClone(model) + End Sub End Class End Namespace -- GitLab