Announcement

Collapse
No announcement yet.

Convert.ToInt32 returns object

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

    Convert.ToInt32 returns object

    In previous version Convert.ToInt32(1) was translated to
    System.Convert.toInt32(Bridge.box(1, System.Int32))
    In new version it is translated to
    Bridge.box(System.Convert.toInt32(1), System.Int32)
    and so it returns an object
    Last edited by geoffrey.mcgill; 2017-05-15 @ 09:45 PM.

    #2
    Hi,

    Can you provide test sample which reproduces the issue?
    Here is my test case
    https://deck.net/48831caaa137008d06fa297472418998

    Comment


      #3
      I got the problem I sucked into.
      Vladimir, what's the way to make the following;
      public void ReflectionTypeCasting (Type type, object value) {
          var unboxed = ....;   // here I want to get unboxed value
      }
      I C# .NET Convert.ChangeType can be used. But in Bridge I can't find the way.

      Comment


        #4
        Just cast to required type

        Comment


          #5
          The required type is stored in the variable

          Comment


            #6
            You can use the following approach
            https://deck.net/2402d19dca4696eceebb7c2a1f362690

            Comment


              #7
              Thanks! This solution does go!

              Comment


                #8
                Moving to Help forum.

                Comment

                Working...
                X