Question: Lets say i have a variable

```
val allF = (Some(1), "some string", 2.99, "another string", 1, Some(30))

```

Now i want to declare a few more variables of type same as `allF` i.e. `(Some[Int], String, Double, String, Int, Some[Int])`. I can do

```
var a1: (Some[Int], String, Double, String, Int, Some[Int]) = _
var a2: (Some[Int], String, Double, String, Int, Some[Int]) = _
... and so on

```

or i can do

```
type T = (Some[Int], String, Double, String, Int, Some[Int])
var a1: T = _
var a2: T = _
.. and do on

```

Is there some way i can use the variable `allF` to get its type and declare variables `a1`, `a2`, `a3`, ... like this

```
val allF = (Some(1), "some string", 2.99, "another string", 1, Some(30))
var a1: typeof(allF) = _
var a2: typeof(allF) = _
...

```

**UPDATE -**
Also for situations like this

```
val allF = (Some(1), "some string", 2.99, "another string", 1, Some(30))
 xyz match {
   case y: (???)\\ if y is of the same type as allF
}

```

Answer: 
It depends on what you mean.

If you literally want to declare all of the variables in the same scope, as per your example, you can do that:

```
  var a, b, c = (5,4,3,2,1) // All have the same type and value

```

But if you are saying that you want to create a variable which has the same type as a variable whose type you don't know at compile time (maybe an `AnyRef` passed as a parameter), then you are subject to the same restrictions as in Java (or any other statically-typed language). You can create the variable via reflection, but you can only act on it as an object.
If you want default value of same ref type just define a fun and use it as follows:

```
def dval[T >: Null](x : T): T  = { null }

val a1 = dval(allF)

```