You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RCS1220 "Use pattern matching instead of combination of 'is' operator and cast operator." is triggered, which is correct. However, it produces a broken suggestion:
if(valueisEnumenum)// Does not compilereturnenum;
enum is a keyword, so this code does not compile. The same happens with other keywords, for example if you were to create a class named Static, it produces this code:
if(valueisStaticstatic)// Does not compilereturnstatic;
string (or String) seems to work correctly:
if(valueisstringx)// OKreturnx;
Actual Behavior:
if(valueisEnumenum)returnenum;
Expected Behavior:
if(valueisEnum@enum)return@enum;
or
if(valueisEnumx)returnx;
The text was updated successfully, but these errors were encountered:
Product and Version Used:
Roslynator.Analyzers 4.1.1
Steps to Reproduce:
Consider this method:
RCS1220 "Use pattern matching instead of combination of 'is' operator and cast operator."
is triggered, which is correct. However, it produces a broken suggestion:enum
is a keyword, so this code does not compile. The same happens with other keywords, for example if you were to create a class namedStatic
, it produces this code:string
(orString
) seems to work correctly:Actual Behavior:
Expected Behavior:
or
The text was updated successfully, but these errors were encountered: