-
Notifications
You must be signed in to change notification settings - Fork 536
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Microsoft.Android.Sdk.Analysis] fix global types (#9680)
Context: https://github.com/dotnet/maui/blob/961863afdf603879cfc92def4aa0c362bdcfcb30/src/TestUtils/src/DeviceTests.Runners.SourceGen/RunnerGenerator.cs#L105 We are seeing the following error in dotnet/maui's tests: error DNAA0001: Application class 'MainApplication' does not have an Activation Constructor 'MainApplication(IntPtr handle, JniHandleOwnership transfer)'. Note that this is normally a warning, but they have `$(TreatWarningsAsErrors)` set. The error (warning) is because they are using `global::Android.Runtime.JniHandleOwnership` rather than `Android.Runtime.JniHandleOwnership`. This causes our string comparisons to fail to we report a false error message. Rather than using `.ToString()` we should switch over to using `QualifiedNameSyntax` and `IdentifierNameSyntax` to get the name of the class. This allows us to remove some string comparisons as we can now get the name of the class without the full namespace if it has a `global::` prefix.
- Loading branch information
1 parent
0475a60
commit 9f5dc78
Showing
3 changed files
with
20 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters