tobast

instantiate-param-type.scala

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