mirror of
https://github.com/github/codeql.git
synced 2025-12-17 17:23:36 +01:00
31 lines
503 B
C#
31 lines
503 B
C#
// semmle-extractor-options: /langversion:latest
|
|
|
|
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;
|
|
}
|
|
}
|