Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

System.Collections.Generic.SortedSet<T>.TreeSubSet Min and Max work incorrectly after updating _underlying set #55760

Closed

Description

@kzrnm

Description

Reproduce

below code

using System;
using System.Collections.Generic;

var set = new SortedSet<int>();
var view = set.GetViewBetween(0, 5);

set.UnionWith(new[] { 1, 2, 3, 4 });
Console.WriteLine($"Min:{view.Min} Max:{view.Max}");
view.Add(1);
Console.WriteLine($"Min:{view.Min} Max:{view.Max}");

expected

Min:1 Max:4
Min:1 Max:4

actual

Min:0 Max:0
Min:1 Max:4

Configuration

I run on main branch and .NET Core 2.1, .NET 5

Regression?

This works fine with .NET framework 4.8.

Other information

Activity

  1. ghost added
    untriaged
    on Jul 15, 2021
  2. changed the title [-]TreeSubSet.Min and TreeSubSet.Max work incorrectly after updating _underlying set[/-] [+]System.Collections.Generic.SortedSet<T>.TreeSubSet Min and Max work incorrectly after updating _underlying set[/+] on Jul 15, 2021
  3. ghost added
    in-pr
    on Jul 15, 2021
  4. added and removed
    untriaged
    on Jul 15, 2021
  5. eiriktsarpalis commented on Jul 15, 2021

    @eiriktsarpalis
    Member

    Can confirm this is a regression from .NET framework, possibly introduced by dotnet/corefx#16771

  6. added this to the 6.0.0 milestone on Jul 15, 2021
  7. danmoseley commented on Jul 17, 2021

    @danmoseley
    Contributor

    @mjp41 in case he is interested 4 years later😀

  8. ghost removed
    in-pr
    on Jul 18, 2021
  9. ghost locked as resolved and limited conversation to collaborators on Aug 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions