Advertisement
tobast

instantiate-param-type-2.scala

Dec 28th, 2015
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.22 KB | None | 0 0
  1. class UselessClass(a : Int) {
  2.     val b = a+1
  3. }
  4. class T[A]() {
  5.    def m() : A = {
  6.        new A()
  7.    }
  8. }
  9. object Main {
  10.     def main(args: Array[String]) {
  11.         val tObj = new T[UselessClass]();
  12.         val impossibleStuff = tObj.m()
  13.     }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement