mirror of
https://github.com/github/codeql.git
synced 2025-12-17 17:23:36 +01:00
29 lines
453 B
C#
29 lines
453 B
C#
class DefaultLiterals
|
|
{
|
|
void f()
|
|
{
|
|
int x = default, y = default(int);
|
|
if (x == default)
|
|
;
|
|
switch (x)
|
|
{
|
|
case var _: break;
|
|
}
|
|
x = default;
|
|
string s = default;
|
|
bool b = default;
|
|
double d = default;
|
|
}
|
|
}
|
|
|
|
class IsConstants
|
|
{
|
|
void f()
|
|
{
|
|
bool b;
|
|
b = new object() is "abc";
|
|
b = "" is null;
|
|
b = b is true;
|
|
}
|
|
}
|