Roslyn: [x64](3.0.100-preview-010184) Switch expression bug

Created on 1 Feb 2019  路  6Comments  路  Source: dotnet/roslyn

Hi

Looks like the new pattern matching feature broke old style switch expression

https://github.com/rds1983/StbImageSharp/blob/master/src/StbImageSharp/PngDecoder.cs#L714

Doesn't compile anymore

  PngDecoder.cs(714, 38): [CS1003] Syntax error, ':' expected
  PngDecoder.cs(714, 70): [CS1002] ; expected
  PngDecoder.cs(714, 70): [CS1513] } expected
  PngDecoder.cs(718, 39): [CS1003] Syntax error, ',' expected
  PngDecoder.cs(774, 39): [CS1003] Syntax error, ',' expected
  PngDecoder.cs(793, 39): [CS1003] Syntax error, ',' expected
  PngDecoder.cs(842, 39): [CS1003] Syntax error, ',' expected
  PngDecoder.cs(878, 39): [CS1003] Syntax error, ',' expected
Area-Compilers Bug

Most helpful comment

All 6 comments

@gafter @jaredpar Does this belong in dotnet/roslyn?

@gafter can you verify this is a dupe of the switch bugs you've already fixed?

@jaredpar I do not believe this has been fixed

As a workaround, declare a named local constant to hold the constant value you are using for the switch case.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MadsTorgersen picture MadsTorgersen  路  3Comments

orthoxerox picture orthoxerox  路  3Comments

AdamSpeight2008 picture AdamSpeight2008  路  3Comments

OndrejPetrzilka picture OndrejPetrzilka  路  3Comments

nlwolf picture nlwolf  路  3Comments