# Function parameter as unknown type

**URL:** <https://forum.kirupa.com/t/function-parameter-as-unknown-type/314228>\
**Category:** flash\
**Created:** [September 22, 2010, 10:33am UTC](https://forum.kirupa.com/t/function-parameter-as-unknown-type/314228 "2010-09-22T10:33:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kissa](https://avatars.discourse-cdn.com/v4/letter/k/a4c791/32.png) [@kissa](https://forum.kirupa.com/u/kissa)\
**Post date:** [September 22, 2010, 10:33am UTC](https://forum.kirupa.com/t/function-parameter-as-unknown-type/314228/1 "2010-09-22T10:33:39Z")

</div>

I’m trying to convert some C# code I have and one problem I can’t find a solution for is to have a function take parameters of unknown types.

C# code:

```php

public T Maximum<T>(T v1, T v2)
{
   return v1 > v2 != null ? v1 : v2;
}

```

A straight translation to AS3 would look something like this, for making it easier to understand for people that might be confused by C# syntax.

```php

public function Maximum<T>(v1:T, v2:T):T
{
   return v1 > v2 != null ? v1 : v2;
}

```

This way you can send in anything as the parameters (notice the \<T\>), be different classes for example, depending on what situation you want to use it, instead of writing a lot of duplicate functions for every possible parameter type.

Is there a way to do this in AS3?

Edit: Seems like I managed to find a solution right after I wrote this. Seems like one can use “\*” as parameter type.
