Search Unity

IL2CPP generated code does not compile when using "as" operator with a Nullable Type

Discussion in 'iOS and tvOS' started by CPXTom, Feb 11, 2016.

  1. CPXTom

    CPXTom

    Joined:
    Apr 24, 2010
    Posts:
    113
    Example:
    Code (csharp):
    1. int? nullableInt = 0 as int?;
    When you make an XCode build this causes a compile error in the generated IL2CPP code. The error is, "No matching function for call to 'UnBoxNullable"
    Another issue is that this code will crash the editor when executed.
    Here's the Case# 769585.
     
    Last edited: Feb 11, 2016
  2. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    @CPXTom

    Thanks for reporting this, we will investigate.
     
    CPXTom likes this.