aboutsummaryrefslogtreecommitdiff
path: root/tests/pos/i1045.scala
blob: f0cf1df90f8a6fa1d22ddb99ffcec0dda8038dd7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import scala.collection._

object EmptyHashMap extends mutable.HashMap[Nothing, Nothing]
object T {
  val newSymbolMap: mutable.HashMap[String, mutable.HashMap[Int, Double]] = mutable.HashMap.empty
  val map = newSymbolMap.getOrElse("a", mutable.HashMap.empty)
  map.put(1, 0.0)
  newSymbolMap.put("a", map)

   /** A map storing free variables of functions and classes */
//  type SymSet = Set[Symbol]
//  private val free = new collection.mutable.LinkedHashMap[Symbol, SymSet]
//  def freeVars(sym: Symbol): List[Symbol] = free.getOrElse(sym, Nil).toList

  class Tree[X >: Null] { def tpe: X = null }
  class Ident[X >: Null] extends Tree[X]
  class Apply[X >: Null] extends Tree[X]

  val x: Ident[Symbol] | Apply[Symbol] = ???
  val y = x.tpe
  val z: Symbol = y


}