Announcement

Collapse
No announcement yet.

[CLOSED] [#913] [1.11] Nullable DateTime greater than comparison returning incorrect results

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    [CLOSED] [#913] [1.11] Nullable DateTime greater than comparison returning incorrect results

    When using a greater than or greater than or equal comparison to compare a DateTime to null the generated code will always return true, however in C# the result will always be false. For example I would expect the following code to alert
    gt: false lt: false
    but instead it alerts
    gt: true lt: false
    .

    using System;
    using Bridge.Html5;
    
    namespace BridgeTest1._10._4
    {
        public class App
        {
    
            [Ready]
            public static void Main()
            {
                DateTime? a = DateTime.Now;
                DateTime? b = null;
    
                var gt = a > b;
                var lt = a < b;
                Global.Alert("gt: " + gt + " lt: " + lt);
            }
        }
    }

    #2
    Hi danw,

    I have verified the defect and will create a GitHub Issue.

    Bridge:
    http://live.bridge.net/#957319844cc133aca5e3

    C#:
    https://dotnetfiddle.net/j8CP6C

    Comment


      #3
      Issue #913 has been created.

      We'll try to sneak this into the upcoming release of Bridge 1.11.

      Comment


        #4
        Hi danw,

        We fixed the issue in 1.11 release.

        Comment

        Working...
        X