microlith57
microlith57
CC#
Created by microlith57 on 9/14/2024 in #help
✅ ImmutableArray<T>.Contains(T, IEqualityComparer<T>) exists in one thread, but not another
is there some way to mark this thread resolved?
10 replies
CC#
Created by microlith57 on 9/14/2024 in #help
✅ ImmutableArray<T>.Contains(T, IEqualityComparer<T>) exists in one thread, but not another
thanks very much, downgrading roslyn to a version compatible with the System.Collections.Immutable i'm using worked! i guess the threading thing threw me off the more mundane cause haha
10 replies
CC#
Created by microlith57 on 9/14/2024 in #help
✅ ImmutableArray<T>.Contains(T, IEqualityComparer<T>) exists in one thread, but not another
i believe the Contains call throwing the exception is this one, though i'm not familiar enough with roslyn's structure to be sure
10 replies
CC#
Created by microlith57 on 9/14/2024 in #help
✅ ImmutableArray<T>.Contains(T, IEqualityComparer<T>) exists in one thread, but not another
i then noticed that when i attach a debugger and test this method in the main thread it exists:
System.Collections.Immutable.ImmutableArray.Create("Red", "Green", "Blue").Contains("Yellow", System.Collections.Generic.EqualityComparer<string>.Default);
// -> false
System.Collections.Immutable.ImmutableArray.Create("Red", "Green", "Blue").Contains("Yellow", System.Collections.Generic.EqualityComparer<string>.Default);
// -> false
but, pausing on that exception in the worker thread, the same method no longer exists:
System.Collections.Immutable.ImmutableArray.Create("Red", "Green", "Blue").Contains("Yellow", System.Collections.Generic.EqualityComparer<string>.Default);
// -> error CS1501: No overload for method 'Contains' takes 2 arguments
System.Collections.Immutable.ImmutableArray.Create("Red", "Green", "Blue").Contains("Yellow", System.Collections.Generic.EqualityComparer<string>.Default);
// -> error CS1501: No overload for method 'Contains' takes 2 arguments
i have verified that these ImmutableArray types are both from the same System.Collections.Immutable.dll path, so i don't understand how the debugger / runtime can find the method in one thread and not another.
10 replies