AssertionMethodAttribute and related attributes missing

When generating code with ReSharper - Options - Code Annotations - Copy default implementation to clipboard under ReSharper 7.1, the AssertionMethod and AssertionCondition attributes are missing (along with AssertionConditionType).

This is a problem, as we've got those attributes scattered throughout our code.

Was this intentional? What's the recommended way going forward?

It would be nice if backward compatibility were preserved for code annotations. This would prevent ReSharper upgrades from causing breaking changes in production code.

(ReSharper 7.1 C# Edition, Build 7.1.25.234.)

0
2 comments
Avatar
Permanently deleted user

You can use the ContractAnnotationAttribute to replace your
AssertionConditionAttribute.

Kind regards,
Henning

"Bill Sorensen"  wrote in message
news:28815899.23261354823440846.JavaMail.devnet@confluence.jetbrains.net...

When generating code with ReSharper - Options - Code Annotations - Copy
default implementation to clipboard under ReSharper 7.1, the AssertionMethod
and AssertionCondition attributes are missing (along with
AssertionConditionType).

This is a problem, as we've got those attributes scattered throughout our
code.

Was this intentional? What's the recommended way going forward?

It would be nice if backward compatibility were preserved for code
annotations. This would prevent ReSharper upgrades from causing breaking
changes in production code.

(ReSharper 7.1 C# Edition, Build 7.1.25.234.)

---
Original message URL: http://devnet.jetbrains.net/message/5473419#5473419

0

ContractAnnotation is the new way of specifying that methods will assert or terminate a program (and much more besides). However, the old AssertionMethod and AssertionCondition attributes are still analysed, so if you are still using those attributes within your existing codebase, they will continue to work.

Thanks
Matt

0

Please sign in to leave a comment.