Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

T[] cast to IList<BaseT> throw exception

Discussion in 'iOS and tvOS' started by sheng319, Aug 6, 2015.

  1. sheng319

    sheng319

    Joined:
    Jun 23, 2014
    Posts:
    34
    My unity version: 4.6.7p3. Example as follows:

    Base class:
    Code (CSharp):
    1. public class PlayerBase { }
    Inherited class:
    Code (CSharp):
    1. public class PlayerDB : PlayerBase { }
    Test code:
    Code (CSharp):
    1. void Start()
    2. {
    3.     var array = new PlayerDB[0];
    4.     Debug.Log(array is IList<PlayerBase>);
    5. }
    Result:
    Editor -> true
    Android -> true
    IOS -> false

    And test on version 4.6.2, result:
    Editor -> true
    Android -> true
    IOS -> true

    Could you fix this issue high priority? Thanks.
     
  2. sheng319

    sheng319

    Joined:
    Jun 23, 2014
    Posts:
    34
    Report Case 717904.
     
  3. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,778
    @sheng319

    We are investigating this now, thanks for reporting it.
     
  4. sheng319

    sheng319

    Joined:
    Jun 23, 2014
    Posts:
    34
    Thanks a lot.