mirror of
https://github.com/github/codeql.git
synced 2025-12-17 17:23:36 +01:00
30 lines
416 B
C#
30 lines
416 B
C#
using System;
|
|
|
|
class T { }
|
|
|
|
class ParenthesizedPattern
|
|
{
|
|
void M1(object o)
|
|
{
|
|
if (o is {} p1)
|
|
{
|
|
}
|
|
|
|
if (o is ({} p2))
|
|
{
|
|
}
|
|
}
|
|
|
|
void M2(object o)
|
|
{
|
|
var r = o switch
|
|
{
|
|
1 => 1,
|
|
(2) => 2,
|
|
T t when t is {} => 3,
|
|
(object o1) when o1 is ({}) => 4,
|
|
(string _) => 5
|
|
};
|
|
}
|
|
}
|