Created
July 2, 2016 14:07
-
-
Save taku0/e0da85dff15c8120e4a3b7c6a6c43fc2 to your computer and use it in GitHub Desktop.
Exponential type checking
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Tuple<T, R> { | |
} | |
class Bar<T> { | |
public Bar<Tuple<T, T>> d() { | |
return null; | |
} | |
public void bar() { | |
Bar<Integer> x = d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d(); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Bar[T] { | |
def d(): Bar[(T, T)] = null | |
def bar() { | |
val x: Bar[Integer] = d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d().d() | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Foo<T, R> { | |
public <T> Foo<T, T> d(T t) { | |
return null; | |
} | |
public void foo() { | |
Foo<Integer, Integer> foo = d(d(d(d(d(d(d(d(d(dd(d(d(d(d(d(d(d(d(d(d(d(d(d(d(d(d(d(d(d(1))))))))))))))))))))))))))))); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// scalac -J-Xmx4G -J-server exp.scala | |
class Foo { | |
val t0 = (0, 0) | |
val t1 = (t0, t0) | |
val t2 = (t1, t1) | |
val t3 = (t2, t2) | |
val t4 = (t3, t3) | |
val t5 = (t4, t4) | |
val t6 = (t5, t5) | |
val t7 = (t6, t6) | |
val t8 = (t7, t7) | |
val t9 = (t8, t8) | |
val t10 = (t9, t9) | |
val t11 = (t10, t10) | |
val t12 = (t11, t11) | |
val t13 = (t12, t12) | |
val t14 = (t13, t13) | |
val t15 = (t14, t14) | |
val t16 = (t15, t15) | |
val t17 = (t16, t16) | |
val t18 = (t17, t17) | |
val t19 = (t18, t18) | |
val t20 = (t19, t19) | |
val t21 = (t20, t20) | |
val t22 = (t21, t21) | |
val t23 = (t22, t22) | |
val t24 = (t23, t23) | |
val t25: (Int, Int) = (t24, t24) | |
// val t26 = (t25, t25) | |
// val t27 = (t26, t26) | |
// val t28 = (t27, t27) | |
// val t29 = (t28, t28) | |
// val t30 = (t29, t29) | |
// val t31 = (t30, t30) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment