Skip to content

ExpectedWarning doesn't check for warnings on constructors #2446

@jtschuster

Description

@jtschuster

ExpectedWarning attribute will not check for warnings when on a static constructor. For example, the following test will pass:
RequiresCapability.cs:

class ClassWithConstructors
{
	[ExpectedWarning ("WarningThatNeverComes", "LoremIpsum")]
	static ClassWithConstructors()
	{
	}

	[ExpectedWarning("NoWarningWillCome", "asdfjkl;")]
	public ClassWithConstructors() { }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions