maui icon indicating copy to clipboard operation
maui copied to clipboard

Enforce CA1854 performance analyzer

Open symbiogenesis opened this issue 1 year ago • 13 comments

This is hopefully a straightforward change. Similar to https://github.com/dotnet/maui/pull/22092

See: CA1854

symbiogenesis avatar Apr 28 '24 02:04 symbiogenesis

/azp run

jsuarezruiz avatar Apr 29 '24 05:04 jsuarezruiz

Azure Pipelines successfully started running 3 pipeline(s).

azure-pipelines[bot] avatar Apr 29 '24 05:04 azure-pipelines[bot]

Not compiling. Needs more changes in the ApplyPropertiesVisitor class.

Fixed.

symbiogenesis avatar Apr 29 '24 15:04 symbiogenesis

@Eilon

danmoseley avatar May 03 '24 19:05 danmoseley

/azp run

Eilon avatar May 06 '24 20:05 Eilon

Azure Pipelines successfully started running 3 pipeline(s).

azure-pipelines[bot] avatar May 06 '24 20:05 azure-pipelines[bot]

Looks like I should add the Tizen workload locally. Fixed those builds.

symbiogenesis avatar May 06 '24 20:05 symbiogenesis

/azp run

Eilon avatar May 06 '24 21:05 Eilon

Azure Pipelines successfully started running 3 pipeline(s).

azure-pipelines[bot] avatar May 06 '24 21:05 azure-pipelines[bot]

Some more errors 😢

D:\a\_work\1\s\src\Core\src\Platform\Tizen\StackNavigationManager.cs(205,8): error CS0128: A local variable or function named 'naviPage' is already defined in this scope [D:\a\_work\1\s\src\Core\src\Core.csproj::TargetFramework=net8.0-tizen]
D:\a\_work\1\s\src\Core\src\Platform\Tizen\StackNavigationManager.cs(211,21): error CS8601: Possible null reference assignment. [D:\a\_work\1\s\src\Core\src\Core.csproj::TargetFramework=net8.0-tizen]
D:\a\_work\1\s\src\Core\src\Platform\Tizen\StackNavigationManager.cs(213,11): error CS8603: Possible null reference return. [D:\a\_work\1\s\src\Core\src\Core.csproj::TargetFramework=net8.0-tizen]

Eilon avatar May 06 '24 21:05 Eilon

/azp run

Eilon avatar May 06 '24 21:05 Eilon

Azure Pipelines successfully started running 3 pipeline(s).

azure-pipelines[bot] avatar May 06 '24 21:05 azure-pipelines[bot]

Rerun failed tests?

symbiogenesis avatar May 08 '24 01:05 symbiogenesis

Rerun failed tests?

Yup trying now.

Eilon avatar May 08 '24 17:05 Eilon

This test seems to be failing consistently:

Expected string length 21 but was 12. Strings differ at index 0.
Expected: "parameterless factory"
But was:  "default ctor"
-----------^

Stack trace
   at Microsoft.Maui.Controls.Xaml.UnitTests.FactoryMethods.Tests.TestArgumentlessFactoryMethod(Boolean useCompiledXaml) in /Users/builder/azdo/_work/3/s/src/Controls/tests/Xaml.UnitTests/FactoryMethods.xaml.cs:line 109
   at InvokeStub_Tests.TestArgumentlessFactoryMethod(Object, Span`1)

1)    at Microsoft.Maui.Controls.Xaml.UnitTests.FactoryMethods.Tests.TestArgumentlessFactoryMethod(Boolean useCompiledXaml) in /Users/builder/azdo/_work/3/s/src/Controls/tests/Xaml.UnitTests/FactoryMethods.xaml.cs:line 109
   at InvokeStub_Tests.TestArgumentlessFactoryMethod(Object, Span`1)

So maybe there's some problem in the change itself?

Eilon avatar May 08 '24 18:05 Eilon

Given that this PR does change code to do with finding factory methods, and that this particular test has failed multiple times in the PR, I think it warrants an investigation of the code in the PR. Maybe there's some subtle change in terms of how the code now locates matches for constructors somehow?

Eilon avatar May 08 '24 18:05 Eilon