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

[XamlC] supports enum and consts in x:Static #369

Merged
merged 1 commit into from Sep 23, 2016

Conversation

Projects
None yet
5 participants
@StephaneDelcroix
Member

StephaneDelcroix commented Sep 21, 2016

Description of Change

Since 1.3.3, x:Static markups are evaluated at compile time and compiled instead of being resolved by reflection at runtime. Some tests weren't correctly running with XamlC and so some edge cases like enum or const values weren't correctly handled.

This awesome PR fixes that. And the broken tests too.

Bugs Fixed

Behavioral Changes

This makes the world a better place.

PR Checklist

  • Has tests (if omitted, state reason in description)
  • Rebased on top of master at time of PR
  • Changes adhere to coding standard
  • Consolidate commits as makes sense
return new [] { Instruction.Create(OpCodes.Ldc_I4, (uint)fieldDef.Constant) };
//everything else will cast just fine to an int
return new [] { Instruction.Create(OpCodes.Ldc_I4, (int)fieldDef.Constant) };
}
}

This comment has been minimized.

@StephaneDelcroix

StephaneDelcroix Sep 21, 2016

Member

is it HasConstant() and is not a predefined type or an enum, I don't know what it could be. So I don't do anything :)

@StephaneDelcroix

StephaneDelcroix Sep 21, 2016

Member

is it HasConstant() and is not a predefined type or an enum, I don't know what it could be. So I don't do anything :)

namespace Xamarin.Forms.Xaml.UnitTests
{
[TestFixture]
public class StaticExtensionTests : BaseTestFixture

This comment has been minimized.

@StephaneDelcroix

StephaneDelcroix Sep 21, 2016

Member

All those tests are now ported to be executed with both XamlC on and off

@StephaneDelcroix

StephaneDelcroix Sep 21, 2016

Member

All those tests are now ported to be executed with both XamlC on and off

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>

This comment has been minimized.

@StephaneDelcroix

StephaneDelcroix Sep 21, 2016

Member

Can you spot the difference ?

@StephaneDelcroix

StephaneDelcroix Sep 21, 2016

Member

Can you spot the difference ?

@@ -5,7 +5,7 @@
namespace Xamarin.Forms.Xaml
{
[ContentProperty("Member")]
[ContentProperty(nameof(Member))]

This comment has been minimized.

@StephaneDelcroix

StephaneDelcroix Sep 21, 2016

Member

that's beautiful

@StephaneDelcroix

StephaneDelcroix Sep 21, 2016

Member

that's beautiful

var fieldDef = fieldRef?.Resolve();

This comment has been minimized.

@campersau

campersau Sep 21, 2016

Why not put this inside of the if below?

@campersau

campersau Sep 21, 2016

Why not put this inside of the if below?

@jassmith jassmith merged commit 1076e73 into master Sep 23, 2016

4 of 5 checks passed

iOS10-UITests Finished TeamCity Build Xamarin.Forms :: Debug :: Cycle8 :: UI Tests :: OSX Test Cloud Package - Run iOS Unified iOS10 : Tests failed: 30 …
Details
Android-UITests Finished TeamCity Build Xamarin.Forms :: Debug :: Cycle8 :: UI Tests :: OSX Test Cloud Package - Run Android 6.0.1 : Tests passed: 346, ig…
Details
OSX-Debug-C8 Finished TeamCity Build Xamarin.Forms :: Debug :: Cycle8 :: OSX Debug : Running
Details
Windows-Debug-C8 Finished TeamCity Build Xamarin.Forms :: Debug :: Cycle8 :: Windows Debug : Tests passed: 3444, ignored: 8
Details
iOS9-UITests Finished TeamCity Build Xamarin.Forms :: Debug :: Cycle8 :: UI Tests :: OSX Test Cloud Package - Run iOS Unified iOS9 : Tests passed: 342,…
Details

@samhouts samhouts added this to the 2.3.4 milestone Jun 27, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment