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: 
I understood the question to be, is there a convenient compiler directive to define the type of a variable *b* to be the same as the type inferred for the variable *a*. If this is correctly understood then I think the answer is simply no. 

It is possible to name a type explicitly, or have the type inferred at compile time, but it is not possible to define a variable by referring to the type inferred for a different variable. Scala doesn't have any language constructs for doing this. (I actually don't know about any language that supports this.)

It is possible to force the two variables to be of the same type by simply assigning the value of *a* to *b*, and then reassigning *b* with the right value. But it might be best to just define the type explicitly and refer to it by name - the code would almost certainly be more maintainable in the long run, if that is a concern. And if *a* and *b* are vals then this assignment trick will obviously not work.
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)

```