-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Description
Version Used: de9d72e
Steps to Reproduce:
[Fact]
public void CompoundAssignment()
{
var source = """
var c = new C();
c.P += "a" + c.P;
System.Console.WriteLine(c.P);
class C
{
public string P { get; set; } = "x";
}
""";
CompileAndVerify(source, expectedOutput: "xax").VerifyDiagnostics();
}This assert fails:
roslyn/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_StringConcat.cs
Lines 221 to 223 in d92fd99
| Debug.Assert(visitedCompoundAssignmentLeftRead is | |
| not (BoundCall or BoundConversion { ConversionKind: ConversionKind.Boxing, Type.SpecialType: SpecialType.System_Object, Operand.Type.SpecialType: SpecialType.System_Char }) | |
| and { ConstantValueOpt: null }); |
The assert was introduced in #76955.