Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
Fixes a code generation bug in the enum converter that was outputting duplicate namespace qualifiers in generated XAML source code. The issue caused malformed code like global::Microsoft.Maui.Layouts.FlexDirection.Microsoft.Maui.Layouts.FlexDirection.Row instead of the correct global::Microsoft.Maui.Layouts.FlexDirection.Row.
- Fixed enum converter to use
.Nameproperty instead of string interpolation of the entire field symbol - Added comprehensive unit test to verify correct enum conversion behavior and prevent regression
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/Controls/src/SourceGen/TypeConverters/EnumConverter.cs |
Fixed the core bug by using detectedEnumValue.Name instead of string interpolating the field symbol directly |
src/Controls/tests/SourceGen.UnitTests/KnownTypeConvertersTests.cs |
Added test case validating that FlexDirection enum generates correct code without duplicate namespaces |
src/Controls/tests/SourceGen.UnitTests/KnownTypeConvertersTests.cs
Outdated
Show resolved
Hide resolved
…s.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
StephaneDelcroix
approved these changes
Sep 20, 2025
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Change
Enum source generator generated invalid code with the namespace repeated twice, for example:
/cc @davidortinau