43 references to BadDefaultValue
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (43)
Semantics\PrimaryConstructorTests.cs (43)
7341("0709", BadReference | NotUsedWarning | BadDefaultValue, "static void M(int x = p1) {}"),
7342("0717", BadReference | NotUsedWarning | BadDefaultValue, "void M(int x = p1) {}"),
7343("0724", BadReference | NotUsedWarning | BadDefaultValue, "int this[int y, int x = p1] { get { return x; } }"),
7344("0730", BadReference | NotUsedWarning | BadDefaultValue, "public C1(int y, int x = p1) : this(0) {}"),
7345("0731", BadReference | NotUsedWarning | BadDefaultValue, "class Nested(int y, int x = p1) { public int F = x + y; }"),
7348("0809", BadReference | NotUsedWarning | BadDefaultValue, "class Nested { static void M(int x = p1) {} }"),
7349("0817", BadReference | NotUsedWarning | BadDefaultValue, "class Nested { void M(int x = p1) {} }"),
7350("0824", BadReference | NotUsedWarning | BadDefaultValue, "class Nested { int this[int y, int x = p1] { get { return x; } } }"),
7351("0830", BadReference | NotUsedWarning | BadDefaultValue, "class Nested { public Nested(int x = p1) {} }"),
7352("0831", BadReference | NotUsedWarning | BadDefaultValue, "class Nested { class Nested2(int y, int x = p1) { public int F = x + y; } }"),
7563("2201", BadReference | BadDefaultValue | Shadows, "public System.Action F = () => { void local(int x = p1){} local(); };"),
7564("2202", BadReference | BadDefaultValue | Shadows, "public System.Action P {get;} = () => { void local(int x = p1){} local(); };"),
7565("2203", BadReference | BadDefaultValue | Shadows, "public event System.Action E = () => { void local(int x = p1){} local(); };"),
7566("2204", BadReference | NotUsedWarning | BadDefaultValue | Shadows, "public static System.Action F = () => { void local(int x = p1){} local(); };"),
7567("2206", BadReference | NotUsedWarning | BadDefaultValue | Shadows, "public static System.Action P {get;} = () => { void local(int x = p1){} local(); };"),
7568("2207", BadReference | NotUsedWarning | BadDefaultValue | Shadows, "public static event System.Action E = () => { void local(int x = p1){} local(); };"),
7569("2208", BadReference | NotUsedWarning | BadDefaultValue, "static C1() { void local(int x = p1){} local(); }"),
7570("2209", BadReference | NotUsedWarning | BadDefaultValue, "static void M() { void local(int x = p1){} local(); }"),
7571("2211", BadReference | NotUsedWarning | BadDefaultValue, "static int P { get { void local(int x = p1){} local(); return 0; } }"),
7572("2212", BadReference | NotUsedWarning | BadDefaultValue, "static int P { set { void local(int x = p1){} local(); } }"),
7573("2213", BadReference | NotUsedWarning | BadDefaultValue, "static int P { set {} get { void local(int x = p1){} local(); return 0; } }"),
7574("2214", BadReference | NotUsedWarning | BadDefaultValue, "static int P { get => 0; set { void local(int x = p1){} local(); } }"),
7575("2215", BadReference | NotUsedWarning | BadDefaultValue, "static event System.Action E { add { void local(int x = p1){} local(); } remove {} }"),
7576("2216", BadReference | NotUsedWarning | BadDefaultValue, "static event System.Action E { add {} remove { void local(int x = p1){} local(); } }"),
7577("2217", BadReference | NotUsedWarning | BadDefaultValue, "void M() { void local(int x = p1){} local(); }"),
7578("2218", BadReference | NotUsedWarning | BadDefaultValue, "int P { get { void local(int x = p1){} local(); return 0; } }"),
7579("2219", BadReference | NotUsedWarning | BadDefaultValue, "int P { set { void local(int x = p1){} local(); } }"),
7580("2220", BadReference | NotUsedWarning | BadDefaultValue, "int P { set {} get { void local(int x = p1){} local(); return 0; } }"),
7581("2221", BadReference | NotUsedWarning | BadDefaultValue, "int P { get => 0; set { void local(int x = p1){} local(); } }"),
7582("2222", BadReference | NotUsedWarning | BadDefaultValue, "event System.Action E { add { void local(int x = p1){} local(); } remove {} }"),
7583("2223", BadReference | NotUsedWarning | BadDefaultValue, "event System.Action E { add {} remove { void local(int x = p1){} local(); } }"),
7584("2224", BadReference | NotUsedWarning | BadDefaultValue, "int this[int x] { get { void local(int x = p1){} local(); return 0; } }"),
7585("2225", BadReference | NotUsedWarning | BadDefaultValue, "int this[int x] { set { void local(int x = p1){} local(); } }"),
7586("2226", BadReference | NotUsedWarning | BadDefaultValue, "int this[int x] { set {} get { void local(int x = p1){} local(); return 0; } }"),
7587("2227", BadReference | NotUsedWarning | BadDefaultValue, "int this[int x] { get => 0; set { void local(int x = p1){} local(); } }"),
7588("2228", BadReference | NotUsedWarning | BadDefaultValue, "~C1() { void local(int x = p1){} local(); }"),
7589("2229", BadReference | NotUsedWarning | BadDefaultValue, "public C1() : this(() => { void local(int x = p1){} local(); }) {} C1(System.Action x) : this(0) {}"),
7590("2230", BadReference | NotUsedWarning | BadDefaultValue, "public C1() : this(0) { void local(int x = p1){} local(); }"),
7591("2235", BadReference | NotUsedWarning | BadDefaultValue, "class Nested() : NestedBase(() => { void local(int x = p1){} local(); }) {} class NestedBase(System.Action x) { object F = x; } "),
7902if ((flags & TestFlags.BadDefaultValue) != 0)
7932if ((flags & TestFlags.BadDefaultValue) != 0 &&
7943if ((flags & (TestFlags.BadDefaultValue)) != 0 &&
7954if ((flags & (TestFlags.BadReference | TestFlags.BadDefaultValue | TestFlags.BadAttributeValue)) != 0)