class A : IFoo { } ... A[] arrayOfA = new A[10]; if(arrayOfA is IFoo[]) { // this is not called }
Q1: Why is arrayOfA not an array of IFoos?
Q2: Why can’t I cast arrayOfA to IFoo[]?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
arrayOfAisIFoo[].There must be something else wrong with your program.
You seem to have mocked up some code to show the problem, but in fact your code (see below) works as you expect. Try updating this question with the real code – or as close to real as you can – and we can take another look.