Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for reason on [Constant] attribute. #696

Open
TimothyJCowen opened this issue Jan 27, 2021 · 0 comments
Open

Add support for reason on [Constant] attribute. #696

TimothyJCowen opened this issue Jan 27, 2021 · 0 comments

Comments

@TimothyJCowen
Copy link
Contributor

As @j3parker said at https://github.com/Brightspace/D2L.CodeStyle/pull/687/files#r555181048:

Having part of this be customizable @ the parameter defn would be neat. Like why does it need to be constant? etc.
Not in this PR, could just open an issue for later.

public static readonly DiagnosticDescriptor NonConstantPassedToConstantParameter = new DiagnosticDescriptor(
	id: "D2L0074",
	title: "Constant parameter cannot be passed a non-constant value.",
	messageFormat: "Parameter \"{0}\" is marked with the [Constant] attribute, and so cannot be passed a non-constant value.",
	category: "Safety",
	defaultSeverity: DiagnosticSeverity.Error,
	isEnabledByDefault: true,
	description: "The method being called has declared that this parameter must receive a constant, but a non-constant value is being passed."
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant