generics and c# in iPhone unity

Im using lastest iPhone version...works in regular Unity.

I cut and pasted this script from the wiki. http://www.unifycommunity.com/wiki/index.php?title=Particle_Spiral_Effect

It give me the error CS1002: Expecting ';'

It happens of every line that uses a generic, like ParticleAnimator animator = emitter.transform.GetComponent();

Can anyone explain what is different here or what the problem is when using the iPhone version of Unity? Looks like it may be a limitation of ParticleEmitter and ParticleAnimator types in iPhone or something.

Adding to what Mike said, here are some generic methods I compiled together for the iPhone.

using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class GM { // GM = Generic Methods

    public static T[] FindObjectsOfType<T>() { 
       T[] objects = UnityEngine.Object.FindObjectsOfType(typeof(T)) as T[]; 
       return objects; 
    }

    public static T GetComponent<T>(Component caller) where T : Component
    {
        T t = caller.GetComponent(typeof(T)) as T;
        return t;
    }

    public static T AddComponent<T>(GameObject parent) where T : Component  
    {
        T t = parent.AddComponent(typeof(T)) as T;

        return t;
    }

    public static T[] GetComponentsInChildren<T>(Component parent) where T : Component
    {
        Component[] componentArray = parent.GetComponentsInChildren(typeof(T));

        T[] tArray = System.Array.ConvertAll<Component, T>( componentArray, delegate(Component component)   {return component as T;}); 
        return tArray;
    }

   public static T[] GetComponentsInChildren<T>(GameObject parent) where T : Component
   {
        Component[] componentArray = parent.GetComponentsInChildren(typeof(T));

        T[] tArray = System.Array.ConvertAll<Component, T>( componentArray, delegate(Component component)   {return component as T;}); 
        return tArray;
    }
}

I couldn't extend the component or gameObject classes with these so you simply have to add the object as a passed value, and the class is GM instead of gameObject or Component. Performance wise, I haven't done any benchmark tests. I don't believe they are any faster than 1.1 casting methods because that is how they work. If anything, they might be a little slower, but any of these functions wouldn't be called very often so it doesn't make much difference.

So this

GetComponent(typeof(MeshRenderer)) as MeshRenderer;

becomes this:

GM.GetComponent<MeshRenderer>(this);

and this:

gameObject.AddComponent("GUITexture");

becomes

GM.AddComponent<GUITexture>(gameObject);

IPhone does support generics, but it hasn't got some of the helper functions as generic yet. GetComponent for example hasn't been updated to allow generics.

I assume this is probably because it's still possible to compile against the older version of .NET, so generics in the API would stop it from compiling

The only solution would be to provide your own generics wrapper for GetComponent, or just use the non generic function