Skip to content

Conversation

@ericstj
Copy link
Member

@ericstj ericstj commented Sep 9, 2021

Needed for installer validation. Manually ran:

darc update-dependencies --id 107680

@ghost
Copy link

ghost commented Sep 9, 2021

Tagging subscribers to this area: @Anipik, @safern, @ViktorHofer
See info in area-owners.md if you want to be subscribed.

Issue Details

Needed for installer validation. Manually ran:

darc update-dependencies --id 107680
Author: ericstj
Assignees: -
Labels:

area-Infrastructure-libraries

Milestone: -

@ViktorHofer
Copy link
Member

Hmm there are issues in the build. Probably a break in the Arcade SDK

@ericstj
Copy link
Member Author

ericstj commented Sep 9, 2021

Ah, I didn't get the fix for that, which merged later that day. Let me pick a different build.

@ericstj
Copy link
Member Author

ericstj commented Sep 9, 2021

Hmm, it looks like it had the fix dotnet/arcade@89db4b3 but needed a follow up one dotnet/arcade#7870

@ericstj ericstj mentioned this pull request Sep 9, 2021
1 task
@ViktorHofer
Copy link
Member

The compiler errors are appearing because of a roslyn update: dotnet/arcade@ae0ffc2. cc @stephentoub

@stephentoub
Copy link
Member

The compiler errors are appearing because of a roslyn update

@cston, @jaredpar, is this fallout from the delegate inference changes? These tests now failing to compile with ambiguity haven't been touched in a long time.

@stephentoub
Copy link
Member

@cston, @jaredpar, here's a repro:

using System;

var source = new C<int>();
source.Aggregate(() => 0, (i, j) => i, (i, j) => i, i => i);

class C<T> { }

static class Extensions
{
    public static TResult Aggregate<TSource, TAccumulate, TResult>(
        this C<TSource> source,
        Func<TAccumulate> seedFactory,
        Func<TAccumulate, TSource, TAccumulate> updateAccumulatorFunc,
        Func<TAccumulate, TAccumulate, TAccumulate> combineAccumulatorsFunc,
        Func<TAccumulate, TResult> resultSelector) => default!;

    public static TResult Aggregate<TSource, TAccumulate, TResult>(
        this C<TSource> source,
        TAccumulate seed,
        Func<TAccumulate, TSource, TAccumulate> updateAccumulatorFunc,
        Func<TAccumulate, TAccumulate, TAccumulate> combineAccumulatorsFunc,
        Func<TAccumulate, TResult> resultSelector) => default!;
}

That compiles fine with LangVersion 9.0. It fails with the following now on LangVersion 10.0:

error CS0121: The call is ambiguous between the following methods or properties: 'Extensions.Aggregate<TSource, TAccumulate, TResult>(C<TSource>, Func<TAccumulate>, Func<TAccumulate, TSource, TAccumulate>, Func<TAccumulate, TAccumulate, TAccumulate>, Func<TAccumulate, TResult>)' and 'Extensions.Aggregate<TSource, TAccumulate, TResult>(C<TSource>, TAccumulate, Func<TAccumulate, TSource, TAccumulate>, Func<TAccumulate, TAccumulate, TAccumulate>, Func<TAccumulate, TResult>)'

@cston
Copy link
Contributor

cston commented Sep 10, 2021

@stephentoub, thanks for the repro.

Yes, the ambiguities are a result of the compiler changes for lambda expressions. In your repro, method type inference is inferring TAccumulate = System.Func<int> from the argument () => 0 for the second overload (previously, that argument would have been ignored in type inference), so both overloads are applicable but neither overload is preferred over the other.

I will create a PR to update the tests.

@ericstj
Copy link
Member Author

ericstj commented Sep 10, 2021

Disregard this PR (and deleted comment). I confused this with #58865. That seems to be progressing. Closing this.

@ericstj ericstj closed this Sep 10, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Oct 10, 2021
@danmoseley danmoseley added area-codeflow for labeling automated codeflow and removed area-Infrastructure-libraries labels Apr 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-codeflow for labeling automated codeflow

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants