Skip to content

Some usages of Contains no longer compile (optional argument in LINQ expression trees) #35547

Description

@NikolaMilosavljevic

Here are the errors encountered when we tried to enable building tests in VMR:

C:\git\dotnet\src\efcore\test\EFCore.Specification.Tests\Query\PrimitiveCollectionsQueryTestBase.cs(23,67): error CS0854: An expression tree may not contain a call or invocation that uses optional arguments [C:\git\dotnet\src\efcore\test\EFCore.Specification.Tests\EFCore.Specification.Tests.csproj]
C:\git\dotnet\src\efcore\test\EFCore.Specification.Tests\Query\PrimitiveCollectionsQueryTestBase.cs(30,67): error CS0854: An expression tree may not contain a call or invocation that uses optional arguments [C:\git\dotnet\src\efcore\test\EFCore.Specification.Tests\EFCore.Specification.Tests.csproj]
C:\git\dotnet\src\efcore\test\EFCore.Specification.Tests\Query\PrimitiveCollectionsQueryTestBase.cs(406,67): error CS0854: An expression tree may not contain a call or invocation that uses optional arguments [C:\git\dotnet\src\efcore\test\EFCore.Specification.Tests\EFCore.Specification.Tests.csproj]
C:\git\dotnet\src\efcore\test\EFCore.Specification.Tests\Query\PrimitiveCollectionsQueryTestBase.cs(409,68): error CS0854: An expression tree may not contain a call or invocation that uses optional arguments [C:\git\dotnet\src\efcore\test\EFCore.Specification.Tests\EFCore.Specification.Tests.csproj]
C:\git\dotnet\src\efcore\test\EFCore.Specification.Tests\Query\PrimitiveCollectionsQueryTestBase.cs(420,67): error CS0854: An expression tree may not contain a call or invocation that uses optional arguments [C:\git\dotnet\src\efcore\test\EFCore.Specification.Tests\EFCore.Specification.Tests.csproj]
C:\git\dotnet\src\efcore\test\EFCore.Specification.Tests\Query\PrimitiveCollectionsQueryTestBase.cs(423,68): error CS0854: An expression tree may not contain a call or invocation that uses optional arguments [C:\git\dotnet\src\efcore\test\EFCore.Specification.Tests\EFCore.Specification.Tests.csproj]
C:\git\dotnet\src\efcore\test\EFCore.Specification.Tests\Query\PrimitiveCollectionsQueryTestBase.cs(625,67): error CS0854: An expression tree may not contain a call or invocation that uses optional arguments [C:\git\dotnet\src\efcore\test\EFCore.Specification.Tests\EFCore.Specification.Tests.csproj]
C:\git\dotnet\src\efcore\test\EFCore.Specification.Tests\Query\PrimitiveCollectionsQueryTestBase.cs(689,67): error CS0854: An expression tree may not contain a call or invocation that uses optional arguments [C:\git\dotnet\src\efcore\test\EFCore.Specification.Tests\EFCore.Specification.Tests.csproj]
C:\git\dotnet\src\efcore\test\EFCore.Specification.Tests\Query\PrimitiveCollectionsQueryTestBase.cs(696,67): error CS0854: An expression tree may not contain a call or invocation that uses optional arguments [C:\git\dotnet\src\efcore\test\EFCore.Specification.Tests\EFCore.Specification.Tests.csproj]
C:\git\dotnet\src\efcore\test\EFCore.Specification.Tests\Query\NorthwindWhereQueryTestBase.cs(1633,29): error CS0854: An expression tree may not contain a call or invocation that uses optional arguments [C:\git\dotnet\src\efcore\test\EFCore.Specification.Tests\EFCore.Specification.Tests.csproj]
C:\git\dotnet\src\efcore\test\EFCore.Specification.Tests\Query\NorthwindWhereQueryTestBase.cs(1707,29): error CS0854: An expression tree may not contain a call or invocation that uses optional arguments [C:\git\dotnet\src\efcore\test\EFCore.Specification.Tests\EFCore.Specification.Tests.csproj]
C:\git\dotnet\src\efcore\test\EFCore.Specification.Tests\Query\NorthwindAggregateOperatorsQueryTestBase.cs(950,49): error CS0854: An expression tree may not contain a call or invocation that uses optional arguments [C:\git\dotnet\src\efcore\test\EFCore.Specification.Tests\EFCore.Specification.Tests.csproj]
C:\git\dotnet\src\efcore\test\EFCore.Specification.Tests\Query\NorthwindAggregateOperatorsQueryTestBase.cs(956,49): error CS0854: An expression tree may not contain a call or invocation that uses optional arguments [C:\git\dotnet\src\efcore\test\EFCore.Specification.Tests\EFCore.Specification.Tests.csproj]
C:\git\dotnet\src\efcore\test\EFCore.Specification.Tests\Query\NorthwindAggregateOperatorsQueryTestBase.cs(1350,52): error CS0854: An expression tree may not contain a call or invocation that uses optional arguments [C:\git\dotnet\src\efcore\test\EFCore.Specification.Tests\EFCore.Specification.Tests.csproj]
C:\git\dotnet\src\efcore\test\EFCore.Specification.Tests\Query\NorthwindAggregateOperatorsQueryTestBase.cs(1361,52): error CS0854: An expression tree may not contain a call or invocation that uses optional arguments [C:\git\dotnet\src\efcore\test\EFCore.Specification.Tests\EFCore.Specification.Tests.csproj]
C:\git\dotnet\src\efcore\test\EFCore.Specification.Tests\Query\GearsOfWarQueryTestBase.cs(5982,54): error CS0854: An expression tree may not contain a call or invocation that uses optional arguments [C:\git\dotnet\src\efcore\test\EFCore.Specification.Tests\EFCore.Specification.Tests.csproj]

For repro, add /p:DotNetBuildTests=true to your Windows VMR build command, i.e.: build -prepareMachine -c Release /p:TargetOS=windows /p:TargetArchitecture=x64 /bl /p:DotNetBuildTests=true

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions