-
I have this situation: public abstract class History {
public class Single : History { … }
public class Multi : History {
public List<Single> Positions { get; }
}
public static Multi Add(History last, Single next)
=> last switch {
Single s // IDE0059 : Unnecessary assignment of a value to 's'
=> new() { // but : new Multi() here works well
Positions = {
s, // CS0103 : The name 's' does not exist in the current context
next,
}
},
Multi m => …
};
} Sharplab.io |
Beta Was this translation helpful? Give feedback.
Answered by
alrz
Jul 25, 2021
Replies: 1 comment
-
Duplicate of dotnet/roslyn#54193 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
FaustVX
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Duplicate of dotnet/roslyn#54193