Skip to content

Commit

Permalink
Merge remote-tracking branch 'dotnet/features/ioperation' into conver…
Browse files Browse the repository at this point in the history
…sion-expression-rewrite

* dotnet/features/ioperation:
  Tagging VB/C# Ioperation tests (dotnet#21310)
  • Loading branch information
333fred committed Aug 8, 2017
2 parents 901b072 + f7b0555 commit d4d8834
Show file tree
Hide file tree
Showing 48 changed files with 1,253 additions and 130 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace Microsoft.CodeAnalysis.CSharp.UnitTests
{
public partial class IOperationTests : SemanticModelTestBase
{
[CompilerTrait(CompilerFeature.IOperation)]
[Fact]
[WorkItem(382240, "https://devdiv.visualstudio.com/DevDiv/_workitems?id=382240")]
public void NullInPlaceOfParamArray()
Expand Down Expand Up @@ -70,6 +71,7 @@ static void Test2(int y, params int[] x)
OutConversion: null");
}

[CompilerTrait(CompilerFeature.IOperation)]
[Fact]
public void DeconstructionAssignmentFromTuple()
{
Expand Down Expand Up @@ -113,6 +115,7 @@ public void Deconstruct(out int a, out int b, out int c)
Assert.False(operation3 is ISimpleAssignmentExpression);
}

[CompilerTrait(CompilerFeature.IOperation)]
[Fact]
public void TestClone()
{
Expand All @@ -125,6 +128,7 @@ public void TestClone()
VerifyClone(model);
}

[CompilerTrait(CompilerFeature.IOperation)]
[Fact]
public void TestParentOperations()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace Microsoft.CodeAnalysis.CSharp.UnitTests
{
public partial class IOperationTests : SemanticModelTestBase
{
[CompilerTrait(CompilerFeature.IOperation)]
[Fact]
public void NoArgument()
{
Expand All @@ -33,6 +34,7 @@ static void M2() { }
VerifyOperationTreeAndDiagnosticsForTest<InvocationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics);
}

[CompilerTrait(CompilerFeature.IOperation)]
[Fact]
public void PositionalArgument()
{
Expand Down Expand Up @@ -65,6 +67,7 @@ static void M2(int x, double y) { }
VerifyOperationTreeAndDiagnosticsForTest<InvocationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics);
}

[CompilerTrait(CompilerFeature.IOperation)]
[Fact]
public void PositionalArgumentWithDefaultValue()
{
Expand Down Expand Up @@ -97,6 +100,7 @@ static void M2(int x, double y = 0.0) { }
VerifyOperationTreeAndDiagnosticsForTest<InvocationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics);
}

[CompilerTrait(CompilerFeature.IOperation)]
[Fact]
public void NamedArgumentListedInParameterOrder()
{
Expand Down Expand Up @@ -129,6 +133,7 @@ static void M2(int x, double y = 0.0) { }
VerifyOperationTreeAndDiagnosticsForTest<InvocationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics);
}

[CompilerTrait(CompilerFeature.IOperation)]
[Fact]
public void NamedArgumentListedOutOfParameterOrder()
{
Expand Down Expand Up @@ -190,6 +195,7 @@ static void M2(int x = 1, int y = 2, int z = 3) { }
VerifyOperationTreeAndDiagnosticsForTest<InvocationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics);
}

[CompilerTrait(CompilerFeature.IOperation)]
[Fact]
public void NamedArgumentOutOfParameterOrderWithDefaultValue()
{
Expand Down Expand Up @@ -226,6 +232,7 @@ static void M2(int x = 1, int y = 2, int z = 3) { }
VerifyOperationTreeAndDiagnosticsForTest<InvocationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics);
}

[CompilerTrait(CompilerFeature.IOperation)]
[Fact]
public void NamedAndPositionalArgumentsWithDefaultValue()
{
Expand Down Expand Up @@ -263,6 +270,7 @@ static void M2(int x = 1, int y = 2, int z = 3) { }
VerifyOperationTreeAndDiagnosticsForTest<ExpressionStatementSyntax>(source, expectedOperationTree, expectedDiagnostics);
}

[CompilerTrait(CompilerFeature.IOperation)]
[Fact]
public void PositionalRefAndOutArguments()
{
Expand Down Expand Up @@ -297,6 +305,7 @@ void M1()
VerifyOperationTreeAndDiagnosticsForTest<InvocationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics);
}

[CompilerTrait(CompilerFeature.IOperation)]
[Fact]
public void NamedRefAndOutArgumentsInParameterOrder()
{
Expand Down Expand Up @@ -330,6 +339,7 @@ void M1()
VerifyOperationTreeAndDiagnosticsForTest<InvocationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics);
}

[CompilerTrait(CompilerFeature.IOperation)]
[Fact]
public void NamedRefAndOutArgumentsOutOfParameterOrder()
{
Expand Down Expand Up @@ -364,6 +374,7 @@ void M1()
VerifyOperationTreeAndDiagnosticsForTest<InvocationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics);
}

[CompilerTrait(CompilerFeature.IOperation)]
[Fact]
public void DefaultValueOfNewStruct()
{
Expand Down Expand Up @@ -393,6 +404,7 @@ struct S { }
VerifyOperationTreeAndDiagnosticsForTest<InvocationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics);
}

[CompilerTrait(CompilerFeature.IOperation)]
[Fact]
public void DefaultValueOfDefaultStruct()
{
Expand Down Expand Up @@ -422,6 +434,7 @@ struct S { }
VerifyOperationTreeAndDiagnosticsForTest<InvocationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics);
}

[CompilerTrait(CompilerFeature.IOperation)]
[Fact]
public void DefaultValueOfConstant()
{
Expand Down Expand Up @@ -451,6 +464,7 @@ void M2(double s = Pi) { }
VerifyOperationTreeAndDiagnosticsForTest<InvocationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics);
}

[CompilerTrait(CompilerFeature.IOperation)]
[Fact]
public void PositionalArgumentForExtensionMethod()
{
Expand Down Expand Up @@ -491,6 +505,7 @@ public static void E1(this P p, int x = 0, int y = 0)
VerifyOperationTreeAndDiagnosticsForTest<InvocationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics);
}

[CompilerTrait(CompilerFeature.IOperation)]
[Fact]
public void NamedArgumentOutOfParameterOrderForExtensionMethod()
{
Expand Down Expand Up @@ -532,6 +547,7 @@ public static void E1(this P p, int x = 0, int y = 0)
VerifyOperationTreeAndDiagnosticsForTest<ExpressionStatementSyntax>(source, expectedOperationTree, expectedDiagnostics);
}

[CompilerTrait(CompilerFeature.IOperation)]
[Fact]
public void NamedArgumentWithDefaultValueForExtensionMethod()
{
Expand Down Expand Up @@ -572,6 +588,7 @@ public static void E1(this P p, int x = 0, int y = 0)
VerifyOperationTreeAndDiagnosticsForTest<InvocationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics);
}

[CompilerTrait(CompilerFeature.IOperation)]
[Fact]
public void ParamsArrayArgumentInNormalForm()
{
Expand Down Expand Up @@ -605,6 +622,7 @@ void M2(int x, params double[] array) { }
VerifyOperationTreeAndDiagnosticsForTest<InvocationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics);
}

[CompilerTrait(CompilerFeature.IOperation)]
[Fact]
public void ParamsArrayArgumentInExpandedForm()
{
Expand Down Expand Up @@ -643,6 +661,7 @@ Element Values(2):
VerifyOperationTreeAndDiagnosticsForTest<InvocationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics);
}

[CompilerTrait(CompilerFeature.IOperation)]
[Fact]
public void ParamsArrayArgumentInExpandedFormWithNoArgument()
{
Expand Down Expand Up @@ -679,6 +698,7 @@ Element Values(0)
VerifyOperationTreeAndDiagnosticsForTest<InvocationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics);
}

[CompilerTrait(CompilerFeature.IOperation)]
[Fact]
public void DefaultValueAndParamsArrayArgumentInExpandedFormWithNoArgument()
{
Expand Down Expand Up @@ -716,6 +736,7 @@ Element Values(0)
VerifyOperationTreeAndDiagnosticsForTest<InvocationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics);
}

[CompilerTrait(CompilerFeature.IOperation)]
[Fact]
public void DefaultValueAndNamedParamsArrayArgumentInNormalForm()
{
Expand Down Expand Up @@ -749,6 +770,7 @@ void M2(int x = 0, params double[] array) { }
VerifyOperationTreeAndDiagnosticsForTest<InvocationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics);
}

[CompilerTrait(CompilerFeature.IOperation)]
[Fact]
public void DefaultValueAndNamedParamsArrayArgumentInExpandedForm()
{
Expand Down Expand Up @@ -788,6 +810,7 @@ Element Values(1):
VerifyOperationTreeAndDiagnosticsForTest<InvocationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics);
}

[CompilerTrait(CompilerFeature.IOperation)]
[Fact]
public void PositionalArgumentAndNamedParamsArrayArgumentInNormalForm()
{
Expand Down Expand Up @@ -821,6 +844,7 @@ void M2(int x = 0, params double[] array) { }
VerifyOperationTreeAndDiagnosticsForTest<InvocationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics);
}

[CompilerTrait(CompilerFeature.IOperation)]
[Fact]
public void PositionalArgumentAndNamedParamsArrayArgumentInExpandedForm()
{
Expand Down Expand Up @@ -860,6 +884,7 @@ Element Values(1):
VerifyOperationTreeAndDiagnosticsForTest<InvocationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics);
}

[CompilerTrait(CompilerFeature.IOperation)]
[Fact]
public void NamedArgumentAndNamedParamsArrayArgumentInNormalFormOutOfParameterOrder()
{
Expand Down Expand Up @@ -894,6 +919,7 @@ void M2(int x = 0, params double[] array) { }
VerifyOperationTreeAndDiagnosticsForTest<ExpressionStatementSyntax>(source, expectedOperationTree, expectedDiagnostics);
}

[CompilerTrait(CompilerFeature.IOperation)]
[Fact]
public void NamedArgumentAndNamedParamsArrayArgumentInExpandedFormOutOfParameterOrder()
{
Expand Down Expand Up @@ -933,6 +959,7 @@ Element Values(1):
VerifyOperationTreeAndDiagnosticsForTest<InvocationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics);
}

[CompilerTrait(CompilerFeature.IOperation)]
[Fact]
public void CallerInfoAttributesInvokedInMethod()
{
Expand Down Expand Up @@ -975,6 +1002,7 @@ void M2(
VerifyOperationTreeAndDiagnosticsForTest<InvocationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics, additionalReferences: new[] { MscorlibRef_v46 });
}

[CompilerTrait(CompilerFeature.IOperation)]
[Fact]
public void CallerInfoAttributesInvokedInProperty()
{
Expand Down Expand Up @@ -1016,6 +1044,7 @@ bool M2(
VerifyOperationTreeAndDiagnosticsForTest<InvocationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics, additionalReferences: new[] { MscorlibRef_v46 });
}

[CompilerTrait(CompilerFeature.IOperation)]
[Fact]
public void CallerInfoAttributesInvokedInFieldInitializer()
{
Expand Down Expand Up @@ -1057,6 +1086,7 @@ static bool M2(
VerifyOperationTreeAndDiagnosticsForTest<InvocationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics, additionalReferences: new[] { MscorlibRef_v46 });
}

[CompilerTrait(CompilerFeature.IOperation)]
[Fact]
public void CallerInfoAttributesInvokedInEventMethods()
{
Expand Down Expand Up @@ -1110,6 +1140,7 @@ static bool M2(
VerifyOperationTreeAndDiagnosticsForTest<InvocationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics, additionalReferences: new[] { MscorlibRef_v46 });
}

[CompilerTrait(CompilerFeature.IOperation)]
[Fact]
public void ExtraArgument()
{
Expand Down Expand Up @@ -1147,6 +1178,7 @@ void M2(int x = 0)
VerifyOperationTreeAndDiagnosticsForTest<InvocationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics);
}

[CompilerTrait(CompilerFeature.IOperation)]
[Fact]
public void WrongArgumentType()
{
Expand Down Expand Up @@ -1181,6 +1213,7 @@ void M2(string x )
VerifyOperationTreeAndDiagnosticsForTest<InvocationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics);
}

[CompilerTrait(CompilerFeature.IOperation)]
[Fact]
public void VarArgsCall()
{
Expand Down Expand Up @@ -1239,6 +1272,7 @@ void M()
VerifyOperationTreeAndDiagnosticsForTest<InvocationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics);
}

[CompilerTrait(CompilerFeature.IOperation)]
[Fact]
public void InvalidConversionForDefaultArgument_InSource()
{
Expand Down Expand Up @@ -1272,6 +1306,7 @@ void M2(int x = ""string"")
VerifyOperationTreeAndDiagnosticsForTest<InvocationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics);
}

[CompilerTrait(CompilerFeature.IOperation)]
[Fact]
public void AssigningToIndexer()
{
Expand Down Expand Up @@ -1305,6 +1340,7 @@ void M1()
VerifyOperationTreeAndDiagnosticsForTest<ElementAccessExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics, AdditionalOperationTreeVerifier: IndexerAccessArgumentVerifier.Verify);
}

[CompilerTrait(CompilerFeature.IOperation)]
[Fact]
public void ReadingFromIndexer()
{
Expand Down Expand Up @@ -1338,6 +1374,7 @@ void M1()
VerifyOperationTreeAndDiagnosticsForTest<ElementAccessExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics, AdditionalOperationTreeVerifier: IndexerAccessArgumentVerifier.Verify);
}

[CompilerTrait(CompilerFeature.IOperation)]
[Fact]
public void DefaultArgumentForIndexerGetter()
{
Expand Down Expand Up @@ -1376,6 +1413,7 @@ void M1()
VerifyOperationTreeAndDiagnosticsForTest<ElementAccessExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics, AdditionalOperationTreeVerifier: IndexerAccessArgumentVerifier.Verify);
}

[CompilerTrait(CompilerFeature.IOperation)]
[Fact]
public void ReadingFromWriteOnlyIndexer()
{
Expand Down Expand Up @@ -1412,6 +1450,7 @@ void M1()
VerifyOperationTreeAndDiagnosticsForTest<ElementAccessExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics, AdditionalOperationTreeVerifier: IndexerAccessArgumentVerifier.Verify);
}

[CompilerTrait(CompilerFeature.IOperation)]
[Fact]
public void AssigningToReadOnlyIndexer()
{
Expand Down Expand Up @@ -1449,6 +1488,7 @@ void M1()
VerifyOperationTreeAndDiagnosticsForTest<ElementAccessExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics, AdditionalOperationTreeVerifier: IndexerAccessArgumentVerifier.Verify);
}

[CompilerTrait(CompilerFeature.IOperation)]
[Fact]
public void OverridingIndexerWithDefaultArgument()
{
Expand Down Expand Up @@ -1501,6 +1541,7 @@ static void Main()
CompileAndVerify(new[] { source }, new[] { SystemRef }, expectedOutput: expectedOutput);
}

[CompilerTrait(CompilerFeature.IOperation)]
[Fact]
public void OmittedParamArrayArgumentInIndexerAccess()
{
Expand Down Expand Up @@ -1541,6 +1582,7 @@ Element Values(0)
VerifyOperationTreeAndDiagnosticsForTest<ElementAccessExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics, AdditionalOperationTreeVerifier: IndexerAccessArgumentVerifier.Verify);
}

[CompilerTrait(CompilerFeature.IOperation)]
[Fact]
public void AssigningToReturnsByRefIndexer()
{
Expand Down Expand Up @@ -2066,6 +2108,7 @@ static void M2(int x, S s = 0)
VerifyOperationTreeAndDiagnosticsForTest<InvocationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics);
}

[CompilerTrait(CompilerFeature.IOperation)]
[Fact]
[WorkItem(18722, "https://github.com/dotnet/roslyn/issues/18722")]
public void DefaultValueForGenericWithUndefinedTypeArgument()
Expand Down Expand Up @@ -2112,6 +2155,7 @@ class G<T>
VerifyOperationTreeAndDiagnosticsForTest<InvocationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics);
}

[CompilerTrait(CompilerFeature.IOperation)]
[Fact]
[WorkItem(18722, "https://github.com/dotnet/roslyn/issues/18722")]
public void DefaultValueForNullableGenericWithUndefinedTypeArgument()
Expand Down
Loading

0 comments on commit d4d8834

Please sign in to comment.