Skip to content

Commit

Permalink
Implement Required Members for VB (#66084)
Browse files Browse the repository at this point in the history
* Add and implement IPropertySymbol.IsRequired and IFieldSymbol.IsRequired.

* Add and implement NamedTypeSymbol.AllRequiredMembers.

* Implement MethodSymbol.HasSetsRequiredMembers

* Implement checking required members in constructors, sketch out test methods.

* Implement remaining errors:

* Block inheriting from types with required members
* Block calling constructors with invalid required member lists
* Block substituting types with required members in As New, unless the parameterless ctor has SetsRequiredMembers.

* Fill out all tests

* PR feedback

* PR feedback#

* PR Feedback

* Compile errors, missed feedback item.

* Fix compile errors, add a few more tests.

* Addressed a number of PR feedback comments. Lots of new tests, fixed a few revealed bugs, handle Nothing converted to a struct with required members.

* PR feedback

* Remove Nothing handling to align with C#.
* Remove suppressions of cascading errors.
* Expand unbound test coverage.
* Expand tuple test coverage.

* Pass correct containing type in local rewriting of tuples.

* Fix test baseline

* Simplify EnsureRequiredMembersCalcuated.

* Add additional test verification.

* Remove unnecessary imports

* Tighten retargeting asserts and add a test

* Fix C# equivalent code.
  • Loading branch information
333fred authored May 10, 2023
1 parent 61a197a commit 974bb4e
Show file tree
Hide file tree
Showing 79 changed files with 4,305 additions and 224 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This document lists known breaking changes in Roslyn after .NET 6 all the way to .NET 7.

## `RequiredMembersAttribute` cannot be manually applied

**Introduced in VS 17.6**

As part of implementing VB support for consuming `required` APIs, it is now an error to manually apply `RequiredMembersAttribute` in
source. VB will now correctly interpret these attributes in metadata and allow instanciating types with required members.
Loading

0 comments on commit 974bb4e

Please sign in to comment.