Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Rider Ambiguous invocation error from ECS samples

Discussion in 'Data Oriented Technology Stack' started by Arkade, Apr 28, 2019.

  1. Arkade

    Arkade

    Joined:
    Oct 11, 2012
    Posts:
    569
    The code seems fine in Unity 2019.1.0f2 but in Rider 2018.3.4 (obviously with latest Unity plugin), Rider shows the following errors suggesting a conflict in extension method Schedule() between JobChunkExtensions and JobForEachExtensions:

    <HelloCube>\Assets\EntityComponentSystemSamples\HelloECS\HelloCube_03_IJobChunk\RotationSpeedSystem.cs (1 error)
    <HelloCube>\Assets\EntityComponentSystemSamples\HelloECS\HelloCube_03_IJobChunk\RotationSpeedSystem.cs:2626 Ambiguous invocation:
    Unity.Jobs.JobHandle Schedule<RotationSpeedJob>(this Samples.HelloCube_03.RotationSpeedSystem.RotationSpeedJob, Unity.Entities.EntityQuery, Unity.Jobs.JobHandle) (in class JobChunkExtensions)
    Unity.Jobs.JobHandle Schedule<RotationSpeedJob>(this Samples.HelloCube_03.RotationSpeedSystem.RotationSpeedJob, Unity.Entities.EntityQuery, Unity.Jobs.JobHandle) (in class JobForEachExtensions)
    match
    <Samples.Boids>\Assets\EntityComponentSystemSamples\Advanced\Boids\Scripts\BoidSystem.cs (6 errors)
    <Samples.Boids>\Assets\EntityComponentSystemSamples\Advanced\Boids\Scripts\BoidSystem.cs:12332 Ambiguous invocation:
    Unity.Jobs.JobHandle Schedule<CopyHeadings>(this Samples.Boids.BoidSystem.CopyHeadings, Unity.Entities.EntityQuery, Unity.Jobs.JobHandle) (in class JobChunkExtensions)
    Unity.Jobs.JobHandle Schedule<CopyHeadings>(this Samples.Boids.BoidSystem.CopyHeadings, Unity.Entities.EntityQuery, Unity.Jobs.JobHandle) (in class JobForEachExtensions)
    match
    <Samples.Boids>\Assets\EntityComponentSystemSamples\Advanced\Boids\Scripts\BoidSystem.cs:12594 Ambiguous invocation:
    Unity.Jobs.JobHandle Schedule<CopyPositions>(this Samples.Boids.BoidSystem.CopyPositions, Unity.Entities.EntityQuery, Unity.Jobs.JobHandle) (in class JobChunkExtensions)
    Unity.Jobs.JobHandle Schedule<CopyPositions>(this Samples.Boids.BoidSystem.CopyPositions, Unity.Entities.EntityQuery, Unity.Jobs.JobHandle) (in class JobForEachExtensions)
    match
    <Samples.Boids>\Assets\EntityComponentSystemSamples\Advanced\Boids\Scripts\BoidSystem.cs:12855 Ambiguous invocation:
    Unity.Jobs.JobHandle Schedule<CopyPositions>(this Samples.Boids.BoidSystem.CopyPositions, Unity.Entities.EntityQuery, Unity.Jobs.JobHandle) (in class JobChunkExtensions)
    Unity.Jobs.JobHandle Schedule<CopyPositions>(this Samples.Boids.BoidSystem.CopyPositions, Unity.Entities.EntityQuery, Unity.Jobs.JobHandle) (in class JobForEachExtensions)
    match
    <Samples.Boids>\Assets\EntityComponentSystemSamples\Advanced\Boids\Scripts\BoidSystem.cs:13126 Ambiguous invocation:
    Unity.Jobs.JobHandle Schedule<CopyPositions>(this Samples.Boids.BoidSystem.CopyPositions, Unity.Entities.EntityQuery, Unity.Jobs.JobHandle) (in class JobChunkExtensions)
    Unity.Jobs.JobHandle Schedule<CopyPositions>(this Samples.Boids.BoidSystem.CopyPositions, Unity.Entities.EntityQuery, Unity.Jobs.JobHandle) (in class JobForEachExtensions)
    match
    <Samples.Boids>\Assets\EntityComponentSystemSamples\Advanced\Boids\Scripts\BoidSystem.cs:15160 Ambiguous invocation:
    Unity.Jobs.JobHandle Schedule<HashPositions>(this Samples.Boids.BoidSystem.HashPositions, Unity.Entities.EntityQuery, Unity.Jobs.JobHandle) (in class JobChunkExtensions)
    Unity.Jobs.JobHandle Schedule<HashPositions>(this Samples.Boids.BoidSystem.HashPositions, Unity.Entities.EntityQuery, Unity.Jobs.JobHandle) (in class JobForEachExtensions)
    match
    <Samples.Boids>\Assets\EntityComponentSystemSamples\Advanced\Boids\Scripts\BoidSystem.cs:17629 Ambiguous invocation:
    Unity.Jobs.JobHandle Schedule<Steer>(this Samples.Boids.BoidSystem.Steer, Unity.Entities.EntityQuery, Unity.Jobs.JobHandle) (in class JobChunkExtensions)
    Unity.Jobs.JobHandle Schedule<Steer>(this Samples.Boids.BoidSystem.Steer, Unity.Entities.EntityQuery, Unity.Jobs.JobHandle) (in class JobForEachExtensions)
    match
     
  2. starikcetin

    starikcetin

    Joined:
    Dec 7, 2017
    Posts:
    224
    You need to instruct Rider that you are using C# 7.3
     
    Arkade likes this.
  3. Arkade

    Arkade

    Joined:
    Oct 11, 2012
    Posts:
    569
    Oh! Thanks!
    I guessed this was via the Rider Unity Plugin setting in Unity Preferences and that seems to work. LMK if I should have done elsewhere?
    Thanks again.
     

    Attached Files:

    davenirline likes this.
  4. thelebaron

    thelebaron

    Joined:
    Jun 2, 2013
    Posts:
    261
    I have this issue too, setting to 7.3 in the unity plugin doesn't appear to do anything for me
     
  5. Kuptsevych-Yuriy

    Kuptsevych-Yuriy

    Joined:
    Oct 1, 2008
    Posts:
    10
    change lang version to 7.3 in files HelloCube.csproj and Samples.Boids.csproj
     

    Attached Files: