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

[X] Warn on non compiled bindings #19360

Merged
merged 3 commits into from Dec 20, 2023
Merged

[X] Warn on non compiled bindings #19360

merged 3 commits into from Dec 20, 2023

Conversation

StephaneDelcroix
Copy link
Contributor

@StephaneDelcroix StephaneDelcroix commented Dec 12, 2023

Description of Change

When XamlC can't compile a Binding due to missing x:DataType, log a
warning.

If you use TreatWarningsAsErrors, add XC0022 and XC0023 to WarningsNotAsErrors to
avoid the build failing

Issues Fixed

! this is based on top of #19337. Merge that one then rebase.

Fixes #

@StephaneDelcroix StephaneDelcroix force-pushed the WarnOnNonCompiledBindings branch 5 times, most recently from f965259 to 5c3394e Compare December 15, 2023 08:07
simonrozsival
simonrozsival previously approved these changes Dec 15, 2023
@@ -389,13 +389,18 @@ static IEnumerable<Instruction> CompileBindingPath(ElementNode node, ILContext c
n = n.Parent as IElementNode;
}

if (dataTypeNode is null)
if (dataTypeNode is null) {
context.LoggingHelper.LogWarningOrError(10101, context.XamlFilePath, node.LineNumber, node.LinePosition, 0, 0, $"Binding could be compiled if x:DataType is specified", null);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these codes be documented somewhere ? or references from a static that has documentation about these numbers?

@rmarinho
Copy link
Member

@StephaneDelcroix I think this needs another rebase now right?

@StephaneDelcroix
Copy link
Contributor Author

@rmarinho y, done

@rmarinho
Copy link
Member

/rebase

@rmarinho
Copy link
Member

/rebase

When XamlC can't compile a Binding due to missing x:DataType, log a
warning.

If you use TreatWarningsAsErrors, add XC10101 to WarningsNotAsErrors to
avoid the build failing
@rmarinho rmarinho merged commit 6d6c9cb into main Dec 20, 2023
47 checks passed
@rmarinho rmarinho deleted the WarnOnNonCompiledBindings branch December 20, 2023 10:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/perf 🏎️ Startup / Runtime performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants