diff --git a/src/Compilers/VisualBasic/Portable/Binding/Binder_Expressions.vb b/src/Compilers/VisualBasic/Portable/Binding/Binder_Expressions.vb index 0f325a8e77e4b..05ce01707bbf6 100644 --- a/src/Compilers/VisualBasic/Portable/Binding/Binder_Expressions.vb +++ b/src/Compilers/VisualBasic/Portable/Binding/Binder_Expressions.vb @@ -759,21 +759,15 @@ Namespace Microsoft.CodeAnalysis.VisualBasic Dim operand = BindRValue(node.Expression, diagnostics, isOperandOfConditionalBranch:=False) Dim operandType = operand.Type - Dim operatorIsIsNot = (node.Kind = SyntaxKind.TypeOfIsNotExpression) Dim resultType As TypeSymbol = GetSpecialType(SpecialType.System_Boolean, node, diagnostics) - Dim target_type = TryCast(node.Type, TypeSyntax) Dim target_types = TryCast(node.Type, TypeArgumentListSyntax) - If target_type IsNot Nothing Then - Return BindTypeOfOneExpression(node, diagnostics, operand, operandType, operatorIsIsNot, resultType, target_type) - ElseIf target_types IsNot Nothing Then - Return BindTypeOfManyExpression(node, diagnostics, operand, operandType, operatorIsIsNot, resultType, target_types) - Else - ' Report invald syntax - Return ReportDiagnosticAndProduceBadExpression(diagnostics, node.Type, ERRID.ERR_Syntax) - End If + If target_type IsNot Nothing Then Return BindTypeOfOneExpression(node, diagnostics, operand, operandType, operatorIsIsNot, resultType, target_type) + If target_types IsNot Nothing Then Return BindTypeOfManyExpression(node, diagnostics, operand, operandType, operatorIsIsNot, resultType, target_types) + ' Report invald syntax + Return ReportDiagnosticAndProduceBadExpression(diagnostics, node.Type, ERRID.ERR_Syntax) End Function Private Function BindTypeOfManyExpression( @@ -841,7 +835,11 @@ Namespace Microsoft.CodeAnalysis.VisualBasic Return New BoundTypeOf(node, targetType, operand, operatorIsIsNot, resultType) End Function - Private function ValidateConversionIsPossible(Of TNode As SyntaxNode)(node As TNode, operandType As TypeSymbol, targetType As TypeSymbol, diagnostics As DiagnosticBag) As TNode + Private function ValidateConversionIsPossible(Of TNode As SyntaxNode)( node As TNode, + operandType As TypeSymbol, + targetType As TypeSymbol, + diagnostics As DiagnosticBag + ) As TNode Dim useSiteDiagnostics As HashSet(Of DiagnosticInfo) = Nothing Dim convKind As ConversionKind = Conversions.ClassifyTryCastConversion(operandType, targetType, useSiteDiagnostics) If diagnostics.Add(node, useSiteDiagnostics) Then @@ -853,29 +851,251 @@ Namespace Microsoft.CodeAnalysis.VisualBasic Return node End function - Private Function ApplyPossibleImplicitConversion(node As TypeOfExpressionSyntax, operandType As TypeSymbol, operand As BoundExpression, diagnostics As DiagnosticBag) As BoundExpression + Private Function ApplyPossibleImplicitConversion( node As TypeOfExpressionSyntax, + operandType As TypeSymbol, + operand As BoundExpression, + diagnostics As DiagnosticBag + ) As BoundExpression If operandType.IsTypeParameter() Then operand = ApplyImplicitConversion(node, GetSpecialType(SpecialType.System_Object, node.Expression, diagnostics), operand, diagnostics) End If return operand End Function + Function BindIntoVariableExpression( node as IntoVariableExpressionSyntax, + diagnostics As DiagnosticBag + ) As BoundExpression + ' selectExpression As BoundExpression, + ' convertCaseElements As Boolean, + ' locals As ArrayBuilder(Of LocalSymbol), + ' typeCaseTypes As ArrayBuilder(Of TypeSymbol), + ' diagnostics As DiagnosticBag + ') As BoundCaseClause + + Dim typeofExpr = TryCast(node.Expression, TypeOfExpressionSyntax) + + If typeofexpr Is Nothing Then Return ReportDiagnosticAndProduceBadExpression(diagnostics, node.Expression, ERRID.ERR_Syntax) + + Dim btypeofExpr =DirectCast( BindTypeOfExpression(typeofExpr, diagnostics), BoundTypeOf) + + + Dim matchType = btypeofexpr.TargetType + Dim ident =node.Variable.Identifier + Dim local = GetLocalForDeclaration(ident) + + ' locals.Add(local) + VerifyLocalSymbolNameAndSetType(local, matchType, node, ident, diagnostics) + Dim boundLocal As New BoundLocal(node, local, matchType) + + Dim condition As BoundExpression + + Dim sourceType As TypeSymbol = btypeofexpr.Operand.Type + + Debug.Assert((sourceType IsNot Nothing AndAlso matchType IsNot Nothing) AndAlso + (sourceType.IsErrorType() OrElse sourceType.IsValueType OrElse sourceType.IsReferenceType OrElse sourceType.IsTypeParameter()) AndAlso + (matchType.IsErrorType() OrElse matchType.IsValueType OrElse matchType.IsReferenceType OrElse matchType.IsTypeParameter())) + + Dim objectType = GetSpecialType(SpecialType.System_Object, node, diagnostics) + Dim booleanType = GetSpecialType(SpecialType.System_Boolean, node, diagnostics) + + Dim sourceTypeToTest As TypeSymbol + + Dim hasErrors As Boolean = False + + ' True binding. + If sourceType.IsErrorType() OrElse matchType.IsErrorType() Then + + hasErrors = True + + ElseIf matchType.IsNullableType() Then + + ReportDiagnostic(diagnostics, node.Variable, ERRID.ERR_UnnecessaryNullableType) + hasErrors = True - Friend Function BindIntoVariableExpression(node as IntoVariableExpressionSyntax, diagnostics As DiagnosticBag) As BoundExpression - Dim BLExpr = BindExpression(node.Expression, diagnostics) - If TypeOf BLExpr Is BoundTypeOf Then - Dim BTExpr = DirectCast(BLExpr, BoundTypeOf) - Dim BRExpr = BindAssignmentTarget(node.Variable, diagnostics) - Return New BoundExpressionIntoVariable(node, BtExpr, BRExpr, GetSpecialType(SpecialType.System_Boolean, node, diagnostics)) ' BTExpr.TargetType) Else - Return New BoundBadExpression(node, - LookupResultKind.NotCreatable, - ImmutableArray(Of Symbol).Empty, - ImmutableArray(Of BoundExpression).Empty, - Nothing, - hasErrors:=True) + + If sourceType.IsReferenceType Then + sourceTypeToTest = sourceType + ElseIf sourceType.IsNullableType() Then + sourceTypeToTest = sourceType.GetNullableUnderlyingType() + ElseIf sourceType.IsValueType Then + sourceTypeToTest = sourceType + ElseIf sourceType.IsTypeParameter() Then + sourceTypeToTest = objectType + Else + Throw ExceptionUtilities.Unreachable + End If + + Dim useSiteDiagnostics As HashSet(Of DiagnosticInfo) = Nothing + + If Not Conversions.ConversionExists(Conversions.ClassifyDirectCastConversion(sourceTypeToTest, matchType, useSiteDiagnostics)) Then + ReportDiagnostic(diagnostics, node.Variable, ERRID.ERR_NoConversion, matchType, sourceType) + hasErrors = True + End If + + If useSiteDiagnostics IsNot Nothing Then + hasErrors = True + End If + + diagnostics.Add(node, useSiteDiagnostics) + End If + + '' Warnings. + 'If Not hasErrors Then + ' For Each previousType In typeCaseTypes + ' Dim useSiteDiagnostics As HashSet(Of DiagnosticInfo) = Nothing + + ' If matchType.Equals(previousType) Then + + ' ReportDiagnostic(diagnostics, node.AsClause.Type, ERRID.WRN_TypeCaseDuplicateCase, matchType) + ' Exit For + + ' ElseIf previousType.IsBaseTypeOrInterfaceOf(matchType, useSiteDiagnostics) OrElse + ' (matchType.IsInterfaceType() AndAlso previousType.Equals(objectType)) Then + + ' ReportDiagnostic(diagnostics, node.AsClause.Type, ERRID.WRN_TypeCaseOverlappingCase, matchType, previousType) + ' Exit For + + ' End If + ' Next + + ' typeCaseTypes.Add(matchType) + 'End If + + ' Compute condition. + If hasErrors Then + condition = New BoundBadExpression(node, LookupResultKind.Empty, ImmutableArray(Of Symbol).Empty, ImmutableArray(Of BoundExpression).Empty, ErrorTypeSymbol.UnknownResultType, hasErrors:=True) + Else + + If sourceType.IsReferenceType AndAlso matchType.IsReferenceType Then + + ' condition: (Var v = TryCast(e, T) : v IsNot Nothing) + condition = BindIsExpression( + BindAssignment( + node, + boundLocal, + ApplyTryCastConversion(node, btypeofexpr.Operand, matchType, diagnostics), + diagnostics + ), + New BoundLiteral(node, ConstantValue.Nothing, Nothing), + node, + isNot:=True, + diagnostics:=diagnostics + ) + + ElseIf sourceType.IsNullableType AndAlso matchType.Equals(sourceType.GetNullableUnderlyingType()) Then + + ' condition = (Var v = e.GetValueOrDefault() : e.HasValue) + + Dim getValueOrDefaultMethod = + DirectCast(DirectCast(sourceType, SubstitutedNamedType).GetMemberForDefinition(GetSpecialTypeMember(SpecialMember.System_Nullable_T_GetValueOrDefault, node, diagnostics)), + MethodSymbol) + + condition = New BoundSequence(node, + ImmutableArray(Of LocalSymbol).Empty, + ImmutableArray.Create(Of BoundExpression)( + BindAssignment( + node, + boundLocal, + New BoundCall(node, + getValueOrDefaultMethod, + Nothing, + btypeofexpr.Operand, + ImmutableArray(Of BoundExpression).Empty, + Nothing, + matchType, + suppressObjectClone:=True), + diagnostics + ) + ), + BindIsExpression( + btypeofexpr.Operand, + New BoundLiteral(node, ConstantValue.Nothing, Nothing), + node, + isNot:=True, + diagnostics:=diagnostics), + booleanType) + + ElseIf sourceType.IsValueType AndAlso matchType.Equals(sourceType) Then + + ' condition = (Var v = e : True) + condition = New BoundSequence(node, + ImmutableArray(Of LocalSymbol).Empty, + ImmutableArray.Create(Of BoundExpression)(BindAssignment( + node, + boundLocal, + btypeofexpr.Operand, + diagnostics + )), + New BoundLiteral(node, ConstantValue.True, GetSpecialType(SpecialType.System_Boolean, node, diagnostics)), + booleanType) + Else + ' condition: (Var $boxed = CObj(e) : Var $success = TypeOf $boxed Is T : Var v = If($success, DirectCast($boxed, T), Nothing) : $success) + + ' Dim $boxed As Object + Dim boxedTemp As New SynthesizedLocal(ContainingMember, objectType, SynthesizedLocalKind.LoweringTemp) + Dim boundBoxedTemp As New BoundLocal(node, boxedTemp, objectType) + boundBoxedTemp.SetWasCompilerGenerated() + + Dim sideEffects = ArrayBuilder(Of BoundExpression).GetInstance() + + ' $boxed = CObj(e) + sideEffects.Add(BindAssignment(node, boundBoxedTemp, ApplyDirectCastConversion(node, btypeofexpr.Operand, objectType, diagnostics), diagnostics)) + + ' Dim $success As Boolean + Dim successTemp As New SynthesizedLocal(ContainingMember, booleanType, SynthesizedLocalKind.LoweringTemp) + Dim boundSuccessTemp As New BoundLocal(node, successTemp, booleanType) + boundSuccessTemp.SetWasCompilerGenerated() + + ' $success = TypeOf $boxed Is T + sideEffects.Add(BindAssignment(node, boundSuccessTemp, New BoundTypeOf(node, matchType, boundBoxedTemp, False, booleanType), diagnostics)) + + ' local = If($success, DirectCast($boxed, T), Nothing) + sideEffects.Add(BindAssignment(node, + boundLocal, + New BoundTernaryConditionalExpression( + node, + boundSuccessTemp.MakeRValue(), + ApplyDirectCastConversion(node, boundBoxedTemp.MakeRValue(), matchType, diagnostics), + ApplyImplicitConversion(node, matchType, New BoundLiteral(node, ConstantValue.Nothing, Nothing), diagnostics), + Nothing, + matchType + ), + diagnostics)) + + ' $success + condition = New BoundSequence(node, + ImmutableArray.Create(Of LocalSymbol)(boxedTemp, successTemp), + sideEffects.ToImmutableAndFree(), + boundSuccessTemp.MakeRValue(), + booleanType) + End If + End If + + condition.SetWasCompilerGenerated() + + Return New BoundExpressionIntoVariable(node, btypeofexpr, local, condition, booleanType) + End Function + 'Friend Function BindIntoVariableExpression( node as IntoVariableExpressionSyntax, + ' diagnostics As DiagnosticBag + ' ) As BoundExpression + + ' Dim BLExpr = BindExpression(node.Expression, diagnostics) + + ' If TypeOf BLExpr IsNot BoundTypeOf Then Return New BoundBadExpression( node, + ' LookupResultKind.NotCreatable, + ' ImmutableArray(Of Symbol).Empty, + ' ImmutableArray(Of BoundExpression).Empty, + ' Nothing, + ' hasErrors:=True) + + ' Dim BTExpr = DirectCast(BLExpr, BoundTypeOf) + ' Dim BRExpr = BindAssignmentTarget(node.Variable, diagnostics) + ' Return New BoundExpressionIntoVariable(node, BtExpr, BRExpr, GetSpecialType(SpecialType.System_Boolean, node, diagnostics)) + 'End Function + ''' ''' BindValue evaluates the node and returns a BoundExpression. BindValue snaps expressions to values. For now that means that method groups ''' become invocations. diff --git a/src/Compilers/VisualBasic/Portable/BoundTree/BoundNodes.xml b/src/Compilers/VisualBasic/Portable/BoundTree/BoundNodes.xml index d2195e415294f..3cc00687b8eec 100644 --- a/src/Compilers/VisualBasic/Portable/BoundTree/BoundNodes.xml +++ b/src/Compilers/VisualBasic/Portable/BoundTree/BoundNodes.xml @@ -552,7 +552,8 @@ - + + diff --git a/src/Compilers/VisualBasic/Portable/BoundTree/Expression.vb b/src/Compilers/VisualBasic/Portable/BoundTree/Expression.vb index a9b5b715a950d..c2860f165bdd1 100644 --- a/src/Compilers/VisualBasic/Portable/BoundTree/Expression.vb +++ b/src/Compilers/VisualBasic/Portable/BoundTree/Expression.vb @@ -224,7 +224,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic Partial Friend Class BoundExpressionIntoVariable Protected Overrides ReadOnly Property Children As ImmutableArray(Of BoundNode) Get - Return ImmutableArray.Create(Of BoundNode)(Me.Expression, Me.Variable) + Return ImmutableArray.Create(Of BoundNode)(Me.Expression) End Get End Property End Class diff --git a/src/Compilers/VisualBasic/Portable/Errors/Errors.vb b/src/Compilers/VisualBasic/Portable/Errors/Errors.vb index bb9fea20a179e..7f6b4c1cc9438 100644 --- a/src/Compilers/VisualBasic/Portable/Errors/Errors.vb +++ b/src/Compilers/VisualBasic/Portable/Errors/Errors.vb @@ -2037,5 +2037,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic FEATURE_CommentsAfterLineContinuation FEATURE_TypeOfMany FEATURE_IntoVariable + ERR_UnnecessaryNullableType + ERR_NoConversion End Enum End Namespace diff --git a/src/Compilers/VisualBasic/Portable/Generated/BoundNodes.xml.Generated.vb b/src/Compilers/VisualBasic/Portable/Generated/BoundNodes.xml.Generated.vb index 0213f88b0a1a1..3a837efd11c35 100644 --- a/src/Compilers/VisualBasic/Portable/Generated/BoundNodes.xml.Generated.vb +++ b/src/Compilers/VisualBasic/Portable/Generated/BoundNodes.xml.Generated.vb @@ -2538,14 +2538,15 @@ Namespace Microsoft.CodeAnalysis.VisualBasic Partial Friend NotInheritable Class BoundExpressionIntoVariable Inherits BoundExpression - Public Sub New(syntax As SyntaxNode, expression As BoundExpression, variable As BoundExpression, type As TypeSymbol, Optional hasErrors As Boolean = False) - MyBase.New(BoundKind.ExpressionIntoVariable, syntax, type, hasErrors OrElse expression.NonNullAndHasErrors() OrElse variable.NonNullAndHasErrors()) + Public Sub New(syntax As SyntaxNode, expression As BoundExpression, variable As LocalSymbol, conditionOpt As BoundExpression, type As TypeSymbol, Optional hasErrors As Boolean = False) + MyBase.New(BoundKind.ExpressionIntoVariable, syntax, type, hasErrors OrElse expression.NonNullAndHasErrors() OrElse conditionOpt.NonNullAndHasErrors()) Debug.Assert(expression IsNot Nothing, "Field 'expression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") Debug.Assert(variable IsNot Nothing, "Field 'variable' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") Me._Expression = expression Me._Variable = variable + Me._ConditionOpt = conditionOpt End Sub @@ -2556,21 +2557,28 @@ Namespace Microsoft.CodeAnalysis.VisualBasic End Get End Property - Private ReadOnly _Variable As BoundExpression - Public ReadOnly Property Variable As BoundExpression + Private ReadOnly _Variable As LocalSymbol + Public ReadOnly Property Variable As LocalSymbol Get Return _Variable End Get End Property + Private ReadOnly _ConditionOpt As BoundExpression + Public ReadOnly Property ConditionOpt As BoundExpression + Get + Return _ConditionOpt + End Get + End Property + Public Overrides Function Accept(visitor as BoundTreeVisitor) As BoundNode Return visitor.VisitExpressionIntoVariable(Me) End Function - Public Function Update(expression As BoundExpression, variable As BoundExpression, type As TypeSymbol) As BoundExpressionIntoVariable - If expression IsNot Me.Expression OrElse variable IsNot Me.Variable OrElse type IsNot Me.Type Then - Dim result = New BoundExpressionIntoVariable(Me.Syntax, expression, variable, type, Me.HasErrors) + Public Function Update(expression As BoundExpression, variable As LocalSymbol, conditionOpt As BoundExpression, type As TypeSymbol) As BoundExpressionIntoVariable + If expression IsNot Me.Expression OrElse variable IsNot Me.Variable OrElse conditionOpt IsNot Me.ConditionOpt OrElse type IsNot Me.Type Then + Dim result = New BoundExpressionIntoVariable(Me.Syntax, expression, variable, conditionOpt, type, Me.HasErrors) result.CopyAttributes(Me) Return result End If @@ -11405,7 +11413,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic Public Overrides Function VisitExpressionIntoVariable(node As BoundExpressionIntoVariable) As BoundNode Me.Visit(node.Expression) - Me.Visit(node.Variable) + Me.Visit(node.ConditionOpt) Return Nothing End Function @@ -12412,9 +12420,9 @@ Namespace Microsoft.CodeAnalysis.VisualBasic Public Overrides Function VisitExpressionIntoVariable(node As BoundExpressionIntoVariable) As BoundNode Dim expression As BoundExpression = DirectCast(Me.Visit(node.Expression), BoundExpression) - Dim variable As BoundExpression = DirectCast(Me.Visit(node.Variable), BoundExpression) + Dim conditionOpt As BoundExpression = DirectCast(Me.Visit(node.ConditionOpt), BoundExpression) Dim type as TypeSymbol = Me.VisitType(node.Type) - Return node.Update(expression, variable, type) + Return node.Update(expression, node.Variable, conditionOpt, type) End Function Public Overrides Function VisitSequencePoint(node As BoundSequencePoint) As BoundNode @@ -13612,7 +13620,8 @@ Namespace Microsoft.CodeAnalysis.VisualBasic Public Overrides Function VisitExpressionIntoVariable(node As BoundExpressionIntoVariable, arg As Object) As TreeDumperNode Return New TreeDumperNode("expressionIntoVariable", Nothing, New TreeDumperNode() { New TreeDumperNode("expression", Nothing, new TreeDumperNode() {Visit(node.Expression, Nothing)}), - New TreeDumperNode("variable", Nothing, new TreeDumperNode() {Visit(node.Variable, Nothing)}), + New TreeDumperNode("variable", node.Variable, Nothing), + New TreeDumperNode("conditionOpt", Nothing, new TreeDumperNode() {Visit(node.ConditionOpt, Nothing)}), New TreeDumperNode("type", node.Type, Nothing) }) End Function diff --git a/src/Compilers/VisualBasic/Portable/Lowering/LocalRewriter/LocalRewriter_TypeOf.vb b/src/Compilers/VisualBasic/Portable/Lowering/LocalRewriter/LocalRewriter_TypeOf.vb index 12292448a0186..feeaaa757fe2f 100644 --- a/src/Compilers/VisualBasic/Portable/Lowering/LocalRewriter/LocalRewriter_TypeOf.vb +++ b/src/Compilers/VisualBasic/Portable/Lowering/LocalRewriter/LocalRewriter_TypeOf.vb @@ -85,146 +85,159 @@ Namespace Microsoft.CodeAnalysis.VisualBasic Return result End Function -#Region "TypeOf ... In ..." - - Public Overrides Function VisitExpressionIntoVariable(node As BoundExpressionIntoVariable) As BoundNode - ' Currently only TypeOfExpression is supported. - ' Other expression maybe supported in the future. - If TypeOf node.Expression Is BoundTypeOf Then - Return Rewrite_TypeOfExpression_Into_Variable(node, DirectCast(node.Expression, BoundTypeOf)) - Else - Return MyBase.VisitExpressionIntoVariable(node) - End If - End Function - - Private Function Can_ConvertTo(f As SyntheticBoundNodeFactory, node as BoundExpression, type As TypeSymbol, byref convkind As ConversionKind) As Boolean - Dim conversion =ClassifyConversion(f.Compilation, node.Type, type) - convkind = Conversion.Kind - Return conversion.Exists - End Function - - Private Function Rewrite_TypeOfExpression_Into_Variable(node As BoundExpressionIntoVariable, typeofexpr As BoundTypeOf) As BoundNode - Dim targetType = typeofexpr.TargetType - Dim factory As New SyntheticBoundNodeFactory(_topMethod, _currentMethodOrLambda, node.Syntax, _compilationState, _diagnostics) - Dim convKind As ConversionKind = Nothing - If Not Can_ConvertTo(factory, typeofexpr.Operand, typeofexpr.TargetType, convKind) Then Return factory.BadExpression() - - Dim convkind1 As ConversionKind = nothing - If Not Can_ConvertTo(factory, typeofexpr.Operand, node.Variable.Type, convKind1) Then Return factory.BadExpression() - - ' Depending on the type kind of the target type, different lowering are created. - If targetType.IsNullableType Then - Return factory.BadExpression() - 'Return Rewrite_TypeOf_Into_Variable_With_Nullable(factory, targetType, node, typeofexpr) - Else If targetType.IsStructureType Then - Return Rewrite_TypeOf_Into_Variable_With_Structure(factory, targetType, node, typeofexpr) - Else - Return Rewrite_TypeOf_Into_Variable_With_Class(factory, targetType, node, typeofexpr) - End If - End Function - - Private Function Rewrite_TypeOf_Into_Variable_With_Nullable(factory As SyntheticBoundNodeFactory, - targetType As TypeSymbol, - intoExpr As BoundExpressionIntoVariable, - typeofexpr As BoundTypeOf) As BoundNode - 'Function TypeofIntoNullable(Of T0 As Structure, T1 As Structure)(input As T0?, ByRef output As T1?) As Boolean - ' output = If(input.HasValue, Microsoft.VisualBasic.CompilerServices.Conversions.ToGenericParameter_T_Object Ctype(Ctype(input.value, Object), T1) ,Nothing) - ' Return output.HasValue - 'End Function - Dim input = VisitExpression(typeofexpr.Operand) - Dim output = VisitExpression(intoExpr.Variable) - With factory - Dim _inlineIf_ = .TernaryConditionalExpression( - .Call(input, DirectCast(.SpecialMember(SpecialMember.System_Nullable_T_get_HasValue), MethodSymbol)), - .Call(Nothing, - .WellKnownMember(of MethodSymbol)(WellKnownMember.Microsoft_VisualBasic_CompilerServices_Conversions__ToGenericParameter_T_Object), - .Call(input, DirectCast(.SpecialMember(SpecialMember.System_Nullable_T_get_Value), MethodSymbol))), - .Null).MakeRValue - Dim _passback_ = .ReferenceAssignment(DirectCast(output.ExpressionSymbol,LocalSymbol), _inlineIf_) - Dim _hasValue_ = .Call( _passback_.MakeRValue, DirectCast(.SpecialMember(SpecialMember.System_Nullable_T_get_HasValue), MethodSymbol)) - Return _hasvalue_.MakeCompilerGenerated - End With - End Function - - Private Function Rewrite_TypeOf_Into_Variable_With_Class(f As SyntheticBoundNodeFactory, - targettype As TypeSymbol, - node As BoundExpressionIntoVariable, - typeofexpr As BoundTypeOf) As BoundNode - ' - ' The lowering of:= - ' TypeOf expression Is type Into variable - ' Should be equivalent to calling the following function. - ' => Is(Of type)(expression, variable) - ' - ' Function [Is](Of T As Class)( expression As Object, ByRef output As T ) As Boolean - ' Dim output = TryCast(expression, targetType) - ' Return output IsNot nothing - ' End Function - ' + 'Public Overrides Function VisitExpressionIntoVariable(node As BoundExpressionIntoVariable) As BoundNode + ' ' Currently only TypeOfExpression is supported. + ' ' Other expression maybe supported in the future. + ' If TypeOf node.Expression Is BoundTypeOf Then + ' Return Rewrite_TypeOfExpression_Into_Variable(node, DirectCast(node.Expression, BoundTypeOf)) + ' Else + ' Return MyBase.VisitExpressionIntoVariable(node) + ' End If + 'End Function - Dim resultOfTryCast = f.TryCast(Make_DirectCastToObject(f, node.Syntax, typeofexpr.Operand), targettype) - Dim target = node.Variable - ' Construct the assignment that passes back the result of the try cast. - Dim passback = f.AssignmentExpression(target, resultOfTryCast) - ' Construct the result of passback isnot nothing. - Dim result = f.ReferenceIsNotNothing(resultOfTryCast) - ' Finally construct the sequence of code. - Dim code_sequence = f.Sequence(resultOfTryCast, passback, result) - Return code_sequence.MakeCompilerGenerated - End Function - - Private Function Make_DirectCastToObject(f As SyntheticBoundNodeFactory, node As SyntaxNode, expression As BoundExpression) As BoundExpression - ' Construct: DirectCast( expression, Object) - Return New BoundDirectCast(node, expression, Conversions.ClassifyDirectCastConversion(expression.Type, f.[Object], Nothing), f.[Object]) - End Function - - Private Function Rewrite_TypeOf_Into_Variable_With_Structure(f As SyntheticBoundNodeFactory, - targettype As TypeSymbol, - node As BoundExpressionIntoVariable, - typeofexpr As BoundTypeOf, - Optional isNullable As Boolean = False, - Optional convKind As ConversionKind = Nothing) As BoundNode - ' - ' The lowering of:= - ' TypeOf expression Is type Into variable - ' Should be equivalent to calling the following function. - ' => Is(Of type)(expression, variable) - ' - ' Function Is(Of T As Structure)( expression As Object, ByRef output As T ) As Boolean ' non-Nullable value type - ' Dim tmp As T? = DirectCast(expression, T?) - ' output = tmp.GetValueOrDefault() - ' Return tmp.HasValue - ' End Function - ' - - ' Define the type of Nullable(Of T) - Dim nullableOf_T = f.NullableOf(targettype) - - ' Define a temporary variable of type Nullable(Of T). - Dim tmp_variable = f.SynthesizedLocal(nullableOf_T) - - ' Construct the DirectCast( expression, Object) - Dim expression_as_object = Make_DirectCastToObject(f, node.Syntax, typeofexpr.Operand).MakeCompilerGenerated - - Dim conv = Conversions.ClassifyDirectCastConversion(expression_as_object.Type, nullableOf_T, Nothing) - ' Construct the assignment to the temporary variable with DirectCast( expression_as_object, Nullable(Of T)) - Dim assigment = f.AssignmentExpression(f.Local(tmp_variable, True), - New BoundDirectCast(node.Syntax, expression_as_object, conv, nullableOf_T)).MakeCompilerGenerated - Dim value = f.Call(f.Local(tmp_variable, False), - GetNullableMethod(node.Syntax, nullableOf_T, SpecialMember.System_Nullable_T_GetValueOrDefault)).MakeCompilerGenerated - ' Construct the assignment that passes back the value or the default value from the temporary variable. - Dim result As BoundExpression = f.Call(assigment, GetNullableMethod(node.Syntax, nullableOf_T, SpecialMember.System_Nullable_T_get_HasValue)).MakeCompilerGenerated - Dim passback = f.AssignmentExpression(node.Variable, value.MakeRValue()).MakeCompilerGenerated - - ' Construct the result which check that the temporary variable has value. +#Region "TypeOf ... In ..." - ' Finally construct the sequence of code. - Dim code_sequence = f.Sequence(tmp_variable, assigment, passback, result) - Return code_sequence.MakeCompilerGenerated - End Function + 'Public Overrides Function VisitExpressionIntoVariable(node As BoundExpressionIntoVariable) As BoundNode + ' ' Currently only TypeOfExpression is supported. + ' ' Other expression maybe supported in the future. + ' If TypeOf node.Expression Is BoundTypeOf Then + ' Return Rewrite_TypeOfExpression_Into_Variable(node, DirectCast(node.Expression, BoundTypeOf)) + ' Else + ' Return MyBase.VisitExpressionIntoVariable(node) + ' End If + 'End Function + + 'Private Function Can_ConvertTo(f As SyntheticBoundNodeFactory, node as BoundExpression, type As TypeSymbol, byref convkind As ConversionKind) As Boolean + ' Dim conversion =ClassifyConversion(f.Compilation, node.Type, type) + ' convkind = Conversion.Kind + ' Return conversion.Exists + 'End Function + + 'Private Function Rewrite_TypeOfExpression_Into_Variable(node As BoundExpressionIntoVariable, typeofexpr As BoundTypeOf) As BoundNode + ' Dim targetType = typeofexpr.TargetType + ' Dim factory As New SyntheticBoundNodeFactory(_topMethod, _currentMethodOrLambda, node.Syntax, _compilationState, _diagnostics) + ' Dim convKind As ConversionKind = Nothing + ' If Not Can_ConvertTo(factory, typeofexpr.Operand, typeofexpr.TargetType, convKind) Then Return factory.BadExpression() + + ' Dim convkind1 As ConversionKind = nothing + ' If Not Can_ConvertTo(factory, typeofexpr.Operand, node.Variable.Type, convKind1) Then Return factory.BadExpression() + + ' ' Depending on the type kind of the target type, different lowering are created. + ' If targetType.IsNullableType Then + ' Return factory.BadExpression() + ' 'Return Rewrite_TypeOf_Into_Variable_With_Nullable(factory, targetType, node, typeofexpr) + ' Else If targetType.IsStructureType Then + ' Return Rewrite_TypeOf_Into_Variable_With_Structure(factory, targetType, node, typeofexpr) + ' Else + ' Return Rewrite_TypeOf_Into_Variable_With_Class(factory, targetType, node, typeofexpr) + ' End If + 'End Function + + 'Private Function Rewrite_TypeOf_Into_Variable_With_Nullable(factory As SyntheticBoundNodeFactory, + ' targetType As TypeSymbol, + ' intoExpr As BoundExpressionIntoVariable, + ' typeofexpr As BoundTypeOf) As BoundNode + ' 'Function TypeofIntoNullable(Of T0 As Structure, T1 As Structure)(input As T0?, ByRef output As T1?) As Boolean + ' ' output = If(input.HasValue, Microsoft.VisualBasic.CompilerServices.Conversions.ToGenericParameter_T_Object Ctype(Ctype(input.value, Object), T1) ,Nothing) + ' ' Return output.HasValue + ' 'End Function + ' Dim input = VisitExpression(typeofexpr.Operand) + ' Dim output = VisitExpression(intoExpr.Variable) + ' With factory + ' Dim _inlineIf_ = .TernaryConditionalExpression( + ' .Call(input, DirectCast(.SpecialMember(SpecialMember.System_Nullable_T_get_HasValue), MethodSymbol)), + ' .Call(Nothing, + ' .WellKnownMember(of MethodSymbol)(WellKnownMember.Microsoft_VisualBasic_CompilerServices_Conversions__ToGenericParameter_T_Object), + ' .Call(input, DirectCast(.SpecialMember(SpecialMember.System_Nullable_T_get_Value), MethodSymbol))), + ' .Null).MakeRValue + ' Dim _passback_ = .ReferenceAssignment(DirectCast(output.ExpressionSymbol,LocalSymbol), _inlineIf_) + ' Dim _hasValue_ = .Call( _passback_.MakeRValue, DirectCast(.SpecialMember(SpecialMember.System_Nullable_T_get_HasValue), MethodSymbol)) + ' Return _hasvalue_.MakeCompilerGenerated + ' End With + 'End Function + + 'Private Function Rewrite_TypeOf_Into_Variable_With_Class(f As SyntheticBoundNodeFactory, + ' targettype As TypeSymbol, + ' node As BoundExpressionIntoVariable, + ' typeofexpr As BoundTypeOf) As BoundNode + ' ' + ' ' The lowering of:= + ' ' TypeOf expression Is type Into variable + ' ' Should be equivalent to calling the following function. + ' ' => Is(Of type)(expression, variable) + ' ' + ' ' Function [Is](Of T As Class)( expression As Object, ByRef output As T ) As Boolean + ' ' Dim output = TryCast(expression, targetType) + ' ' Return output IsNot nothing + ' ' End Function + ' ' + + ' Dim resultOfTryCast = f.TryCast(Make_DirectCastToObject(f, node.Syntax, typeofexpr.Operand), targettype) + + ' Dim target = node.Variable + ' ' Construct the assignment that passes back the result of the try cast. + ' Dim passback = f.AssignmentExpression(target, resultOfTryCast) + + ' ' Construct the result of passback isnot nothing. + ' Dim result = f.ReferenceIsNotNothing(resultOfTryCast) + + ' ' Finally construct the sequence of code. + ' Dim code_sequence = f.Sequence(resultOfTryCast, passback, result) + ' Return code_sequence.MakeCompilerGenerated + 'End Function + + 'Private Function Make_DirectCastToObject(f As SyntheticBoundNodeFactory, node As SyntaxNode, expression As BoundExpression) As BoundExpression + ' ' Construct: DirectCast( expression, Object) + ' Return New BoundDirectCast(node, expression, Conversions.ClassifyDirectCastConversion(expression.Type, f.[Object], Nothing), f.[Object]) + 'End Function + + 'Private Function Rewrite_TypeOf_Into_Variable_With_Structure(f As SyntheticBoundNodeFactory, + ' targettype As TypeSymbol, + ' node As BoundExpressionIntoVariable, + ' typeofexpr As BoundTypeOf, + ' Optional isNullable As Boolean = False, + ' Optional convKind As ConversionKind = Nothing) As BoundNode + ' ' + ' ' The lowering of:= + ' ' TypeOf expression Is type Into variable + ' ' Should be equivalent to calling the following function. + ' ' => Is(Of type)(expression, variable) + ' ' + ' ' Function Is(Of T As Structure)( expression As Object, ByRef output As T ) As Boolean ' non-Nullable value type + ' ' Dim tmp As T? = DirectCast(expression, T?) + ' ' output = tmp.GetValueOrDefault() + ' ' Return tmp.HasValue + ' ' End Function + ' ' + + ' ' Define the type of Nullable(Of T) + ' Dim nullableOf_T = f.NullableOf(targettype) + + ' ' Define a temporary variable of type Nullable(Of T). + ' Dim tmp_variable = f.SynthesizedLocal(nullableOf_T) + + ' ' Construct the DirectCast( expression, Object) + ' Dim expression_as_object = Make_DirectCastToObject(f, node.Syntax, typeofexpr.Operand).MakeCompilerGenerated + + ' Dim conv = Conversions.ClassifyDirectCastConversion(expression_as_object.Type, nullableOf_T, Nothing) + ' ' Construct the assignment to the temporary variable with DirectCast( expression_as_object, Nullable(Of T)) + ' Dim assigment = f.AssignmentExpression(f.Local(tmp_variable, True), + ' New BoundDirectCast(node.Syntax, expression_as_object, conv, nullableOf_T)).MakeCompilerGenerated + ' Dim value = f.Call(f.Local(tmp_variable, False), + ' GetNullableMethod(node.Syntax, nullableOf_T, SpecialMember.System_Nullable_T_GetValueOrDefault)).MakeCompilerGenerated + ' ' Construct the assignment that passes back the value or the default value from the temporary variable. + ' Dim result As BoundExpression = f.Call(assigment, GetNullableMethod(node.Syntax, nullableOf_T, SpecialMember.System_Nullable_T_get_HasValue)).MakeCompilerGenerated + ' Dim passback = f.AssignmentExpression(node.Variable, value.MakeRValue()).MakeCompilerGenerated + + ' ' Construct the result which check that the temporary variable has value. + + ' ' Finally construct the sequence of code. + ' Dim code_sequence = f.Sequence(tmp_variable, assigment, passback, result) + ' Return code_sequence.MakeCompilerGenerated + 'End Function #End Region diff --git a/src/Compilers/VisualBasic/Portable/VBResources.resx b/src/Compilers/VisualBasic/Portable/VBResources.resx index dd3b1f42f01c1..32ea26450426b 100644 --- a/src/Compilers/VisualBasic/Portable/VBResources.resx +++ b/src/Compilers/VisualBasic/Portable/VBResources.resx @@ -5589,4 +5589,10 @@ TypeOf Many + + No conversion exists from {0} to {1} + + + Unnecessary Nullable Type + \ No newline at end of file diff --git a/src/Compilers/VisualBasic/Portable/xlf/VBResources.cs.xlf b/src/Compilers/VisualBasic/Portable/xlf/VBResources.cs.xlf index 15b278bfca2b3..40962acdd2b28 100644 --- a/src/Compilers/VisualBasic/Portable/xlf/VBResources.cs.xlf +++ b/src/Compilers/VisualBasic/Portable/xlf/VBResources.cs.xlf @@ -22,6 +22,11 @@ Ve stejném adresáři nemůže být více konfiguračních souborů analyzátoru ({0}). + + No conversion exists from {0} to {1} + No conversion exists from {0} to {1} + + Type '{0}' cannot be embedded because it has a re-abstraction of a member from base interface. Consider setting the 'Embed Interop Types' property to false. Typ {0} nemůže být vložený, protože má reabstrakci člena ze základního rozhraní. Zvažte nastavení vlastnosti Vložit typy spolupráce na hodnotu false. @@ -42,6 +47,11 @@ TypeOf expression using IsNot doesn't support feature {0} + + Unnecessary Nullable Type + Unnecessary Nullable Type + + comments after line continuation komentáře po pokračování řádku diff --git a/src/Compilers/VisualBasic/Portable/xlf/VBResources.de.xlf b/src/Compilers/VisualBasic/Portable/xlf/VBResources.de.xlf index aacc4318ce62c..71f43520caac5 100644 --- a/src/Compilers/VisualBasic/Portable/xlf/VBResources.de.xlf +++ b/src/Compilers/VisualBasic/Portable/xlf/VBResources.de.xlf @@ -22,6 +22,11 @@ Dasselbe Verzeichnis ({0}) darf nicht mehrere Konfigurationsdateien des Analysetools enthalten. + + No conversion exists from {0} to {1} + No conversion exists from {0} to {1} + + Type '{0}' cannot be embedded because it has a re-abstraction of a member from base interface. Consider setting the 'Embed Interop Types' property to false. Der Typ "{0}" kann nicht eingebettet werden, weil er eine Neuabstraktion eines Members aus der Basisschnittstelle aufweist. Legen Sie die Eigenschaft "Interoptypen einbetten" ggf. auf FALSE fest. @@ -42,6 +47,11 @@ TypeOf expression using IsNot doesn't support feature {0} + + Unnecessary Nullable Type + Unnecessary Nullable Type + + comments after line continuation Kommentare nach Zeilenfortsetzung diff --git a/src/Compilers/VisualBasic/Portable/xlf/VBResources.es.xlf b/src/Compilers/VisualBasic/Portable/xlf/VBResources.es.xlf index d48b161da4d39..a512fb76d46fc 100644 --- a/src/Compilers/VisualBasic/Portable/xlf/VBResources.es.xlf +++ b/src/Compilers/VisualBasic/Portable/xlf/VBResources.es.xlf @@ -22,6 +22,11 @@ No es posible que un mismo directorio ("{0}") contenga varios archivos de configuración del analizador. + + No conversion exists from {0} to {1} + No conversion exists from {0} to {1} + + Type '{0}' cannot be embedded because it has a re-abstraction of a member from base interface. Consider setting the 'Embed Interop Types' property to false. El tipo "{0}" no se puede insertar porque tiene una reabstracción de un miembro de la interfaz base. Puede establecer la propiedad "Incrustar tipos de interoperabilidad" en false. @@ -42,6 +47,11 @@ TypeOf expression using IsNot doesn't support feature {0} + + Unnecessary Nullable Type + Unnecessary Nullable Type + + comments after line continuation comentarios después de la continuación de línea diff --git a/src/Compilers/VisualBasic/Portable/xlf/VBResources.fr.xlf b/src/Compilers/VisualBasic/Portable/xlf/VBResources.fr.xlf index 65d484f2d30c3..1cd40927fc83c 100644 --- a/src/Compilers/VisualBasic/Portable/xlf/VBResources.fr.xlf +++ b/src/Compilers/VisualBasic/Portable/xlf/VBResources.fr.xlf @@ -22,6 +22,11 @@ Plusieurs fichiers config d'analyseur ne peuvent pas figurer dans le même répertoire ('{0}'). + + No conversion exists from {0} to {1} + No conversion exists from {0} to {1} + + Type '{0}' cannot be embedded because it has a re-abstraction of a member from base interface. Consider setting the 'Embed Interop Types' property to false. Impossible d'incorporer le type '{0}', car il a une nouvelle abstraction d'un membre de l'interface de base. Affectez la valeur false à la propriété 'Incorporer les types interop'. @@ -42,6 +47,11 @@ TypeOf expression using IsNot doesn't support feature {0} + + Unnecessary Nullable Type + Unnecessary Nullable Type + + comments after line continuation commentaires après la continuation de la ligne diff --git a/src/Compilers/VisualBasic/Portable/xlf/VBResources.it.xlf b/src/Compilers/VisualBasic/Portable/xlf/VBResources.it.xlf index 30f4d867df72c..fa2eaa4ddcd58 100644 --- a/src/Compilers/VisualBasic/Portable/xlf/VBResources.it.xlf +++ b/src/Compilers/VisualBasic/Portable/xlf/VBResources.it.xlf @@ -22,6 +22,11 @@ La stessa directory ('{0}') non può contenere più file di configurazione dell'analizzatore. + + No conversion exists from {0} to {1} + No conversion exists from {0} to {1} + + Type '{0}' cannot be embedded because it has a re-abstraction of a member from base interface. Consider setting the 'Embed Interop Types' property to false. Non è possibile incorporare il tipo '{0}' perché contiene una nuova astrazione di un membro dell'interfaccia di base. Provare a impostare la proprietà 'Incorpora tipi di interoperabilità' su false. @@ -42,6 +47,11 @@ TypeOf expression using IsNot doesn't support feature {0} + + Unnecessary Nullable Type + Unnecessary Nullable Type + + comments after line continuation commenti dopo la continuazione di riga diff --git a/src/Compilers/VisualBasic/Portable/xlf/VBResources.ja.xlf b/src/Compilers/VisualBasic/Portable/xlf/VBResources.ja.xlf index 3dae6acf797ba..dbd7756928536 100644 --- a/src/Compilers/VisualBasic/Portable/xlf/VBResources.ja.xlf +++ b/src/Compilers/VisualBasic/Portable/xlf/VBResources.ja.xlf @@ -22,6 +22,11 @@ 複数のアナライザー構成ファイルを同じディレクトリに入れることはできません ('{0}')。 + + No conversion exists from {0} to {1} + No conversion exists from {0} to {1} + + Type '{0}' cannot be embedded because it has a re-abstraction of a member from base interface. Consider setting the 'Embed Interop Types' property to false. 型 '{0}' には基底インターフェイスからのメンバーの再抽象化があるため、この型を埋め込むことはできません。'相互運用型の埋め込み' プロパティを false に設定することをご検討ください。 @@ -42,6 +47,11 @@ TypeOf expression using IsNot doesn't support feature {0} + + Unnecessary Nullable Type + Unnecessary Nullable Type + + comments after line continuation 行連結後のコメント diff --git a/src/Compilers/VisualBasic/Portable/xlf/VBResources.ko.xlf b/src/Compilers/VisualBasic/Portable/xlf/VBResources.ko.xlf index bb6f0e9e2c43d..5e473b163b668 100644 --- a/src/Compilers/VisualBasic/Portable/xlf/VBResources.ko.xlf +++ b/src/Compilers/VisualBasic/Portable/xlf/VBResources.ko.xlf @@ -22,6 +22,11 @@ 분석기 구성 파일 여러 개가 동일한 디렉터리('{0}')에 있을 수 없습니다. + + No conversion exists from {0} to {1} + No conversion exists from {0} to {1} + + Type '{0}' cannot be embedded because it has a re-abstraction of a member from base interface. Consider setting the 'Embed Interop Types' property to false. '{0}' 형식에는 기본 인터페이스 멤버의 재추상화가 있으므로 해당 형식을 포함할 수 없습니다. 'Interop 형식 포함' 속성을 false로 설정해 보세요. @@ -42,6 +47,11 @@ TypeOf expression using IsNot doesn't support feature {0} + + Unnecessary Nullable Type + Unnecessary Nullable Type + + comments after line continuation 줄 연속 뒤 주석 diff --git a/src/Compilers/VisualBasic/Portable/xlf/VBResources.pl.xlf b/src/Compilers/VisualBasic/Portable/xlf/VBResources.pl.xlf index 9ea23e4b401f2..769424650630d 100644 --- a/src/Compilers/VisualBasic/Portable/xlf/VBResources.pl.xlf +++ b/src/Compilers/VisualBasic/Portable/xlf/VBResources.pl.xlf @@ -22,6 +22,11 @@ Wiele plików konfiguracji analizatora nie może znajdować się w tym samym katalogu („{0}”). + + No conversion exists from {0} to {1} + No conversion exists from {0} to {1} + + Type '{0}' cannot be embedded because it has a re-abstraction of a member from base interface. Consider setting the 'Embed Interop Types' property to false. Nie można osadzić typu „{0}”, ponieważ zawiera ponowną abstrakcję składowej z interfejsu podstawowego. Rozważ ustawienie właściwości „Osadź typy międzyoperacyjne” na wartość false. @@ -42,6 +47,11 @@ TypeOf expression using IsNot doesn't support feature {0} + + Unnecessary Nullable Type + Unnecessary Nullable Type + + comments after line continuation komentarze po kontynuacji wiersza diff --git a/src/Compilers/VisualBasic/Portable/xlf/VBResources.pt-BR.xlf b/src/Compilers/VisualBasic/Portable/xlf/VBResources.pt-BR.xlf index 33543e6b3935b..614606a33d0ee 100644 --- a/src/Compilers/VisualBasic/Portable/xlf/VBResources.pt-BR.xlf +++ b/src/Compilers/VisualBasic/Portable/xlf/VBResources.pt-BR.xlf @@ -22,6 +22,11 @@ Não é possível que haja vários arquivos de configuração do analisador no mesmo diretório ('{0}'). + + No conversion exists from {0} to {1} + No conversion exists from {0} to {1} + + Type '{0}' cannot be embedded because it has a re-abstraction of a member from base interface. Consider setting the 'Embed Interop Types' property to false. O tipo '{0}' não pode ser inserido porque tem uma nova abstração de um membro da interface base. Considere a configuração da propriedade 'Embed Interop Types' como false. @@ -42,6 +47,11 @@ TypeOf expression using IsNot doesn't support feature {0} + + Unnecessary Nullable Type + Unnecessary Nullable Type + + comments after line continuation comentários após a continuação da linha diff --git a/src/Compilers/VisualBasic/Portable/xlf/VBResources.ru.xlf b/src/Compilers/VisualBasic/Portable/xlf/VBResources.ru.xlf index 8daef795ee2a1..dfb851612b2d9 100644 --- a/src/Compilers/VisualBasic/Portable/xlf/VBResources.ru.xlf +++ b/src/Compilers/VisualBasic/Portable/xlf/VBResources.ru.xlf @@ -22,6 +22,11 @@ В одном каталоге ("{0}") не может находиться несколько файлов конфигурации анализатора. + + No conversion exists from {0} to {1} + No conversion exists from {0} to {1} + + Type '{0}' cannot be embedded because it has a re-abstraction of a member from base interface. Consider setting the 'Embed Interop Types' property to false. Невозможно внедрить тип "{0}", так как он переопределяет абстракцию элемента базового интерфейса. Попробуйте задать для свойства "Внедрить типы взаимодействия" значение false (ложь). @@ -42,6 +47,11 @@ TypeOf expression using IsNot doesn't support feature {0} + + Unnecessary Nullable Type + Unnecessary Nullable Type + + comments after line continuation комментарии после продолжения строки diff --git a/src/Compilers/VisualBasic/Portable/xlf/VBResources.tr.xlf b/src/Compilers/VisualBasic/Portable/xlf/VBResources.tr.xlf index 44b50f230853b..d53e1e7b3ecd4 100644 --- a/src/Compilers/VisualBasic/Portable/xlf/VBResources.tr.xlf +++ b/src/Compilers/VisualBasic/Portable/xlf/VBResources.tr.xlf @@ -22,6 +22,11 @@ Birden çok çözümleyici yapılandırma dosyası aynı dizinde ('{0}') olamaz. + + No conversion exists from {0} to {1} + No conversion exists from {0} to {1} + + Type '{0}' cannot be embedded because it has a re-abstraction of a member from base interface. Consider setting the 'Embed Interop Types' property to false. '{0}' türünün temel arabirimden yeniden soyutlanmış bir üyesi olduğundan bu tür eklenemiyor. 'Embed Interop Types' özelliğini false olarak ayarlamayı deneyin. @@ -42,6 +47,11 @@ TypeOf expression using IsNot doesn't support feature {0} + + Unnecessary Nullable Type + Unnecessary Nullable Type + + comments after line continuation satır devamı sonrası açıklamalar diff --git a/src/Compilers/VisualBasic/Portable/xlf/VBResources.zh-Hans.xlf b/src/Compilers/VisualBasic/Portable/xlf/VBResources.zh-Hans.xlf index 9977b3349f841..9e57cef4d3399 100644 --- a/src/Compilers/VisualBasic/Portable/xlf/VBResources.zh-Hans.xlf +++ b/src/Compilers/VisualBasic/Portable/xlf/VBResources.zh-Hans.xlf @@ -22,6 +22,11 @@ 多个分析器配置文件不能位于同一目录({0})中。 + + No conversion exists from {0} to {1} + No conversion exists from {0} to {1} + + Type '{0}' cannot be embedded because it has a re-abstraction of a member from base interface. Consider setting the 'Embed Interop Types' property to false. 无法嵌入类型“{0}”,因为它有基本接口成员的重新抽象。请考虑将“嵌入互操作类型”属性设置为 false。 @@ -42,6 +47,11 @@ TypeOf expression using IsNot doesn't support feature {0} + + Unnecessary Nullable Type + Unnecessary Nullable Type + + comments after line continuation 行继续符之后的注释 diff --git a/src/Compilers/VisualBasic/Portable/xlf/VBResources.zh-Hant.xlf b/src/Compilers/VisualBasic/Portable/xlf/VBResources.zh-Hant.xlf index 70446db8db2f3..fc8896111ab52 100644 --- a/src/Compilers/VisualBasic/Portable/xlf/VBResources.zh-Hant.xlf +++ b/src/Compilers/VisualBasic/Portable/xlf/VBResources.zh-Hant.xlf @@ -22,6 +22,11 @@ 多個分析器組態檔無法處於相同目錄 ('{0}') 中。 + + No conversion exists from {0} to {1} + No conversion exists from {0} to {1} + + Type '{0}' cannot be embedded because it has a re-abstraction of a member from base interface. Consider setting the 'Embed Interop Types' property to false. 因為類型 '{0}' 有重新抽象成員 (來自基底介面),所以無法內嵌。請考慮將 [內嵌 Interop 類型] 屬性設為 false。 @@ -42,6 +47,11 @@ TypeOf expression using IsNot doesn't support feature {0} + + Unnecessary Nullable Type + Unnecessary Nullable Type + + comments after line continuation 行接續符號後註解