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

Nullable reference types #121

Merged
merged 10 commits into from
Jun 5, 2024
Merged

Conversation

MrJul
Copy link
Contributor

@MrJul MrJul commented May 22, 2024

This PR enables nullable reference types in all XamlX projects.

Most Avalonia projects now use nullable annotations, but some core ones such as Markup.Xaml.Loader can't because XamlX isn't nullable aware. This PR fixes that.

Notable changes:

  • A couple classes with non-nullable members and a default constructor now have a constructor with parameters instead.
  • DeclaringType is now non-null and exposed on IXamlMember directly.
  • GetMethod overloads matching the FindMethod ones have been added and used in place of FindMethod, as most places in emit code expected methods to actually be found.
  • TypeReferenceResolver.ResolveType returns a non null type. There were some code paths accepting null, but at the end of the day ResolveTypeCore was called which throws if the type couldn't be resolved, which callers expected.
  • CecilType.GetEnumUnderlyingType and CecilField.GetLiteralValue now throw instead of returning null for non-enum/literal. This matches the SRE implementation.

@MrJul MrJul force-pushed the feature/nullable-enable branch from ec27507 to 9bd23ce Compare May 22, 2024 21:33
@maxkatz6 maxkatz6 merged commit 14fed0c into kekekeks:master Jun 5, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants