Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
for i in {1..1000}; do printf 'object bar { val foo = '$i'}; \nimport bar.foo\n foo\n val foo = ""\n foo\n'; done | scala
Welcome to Scala 2.13.1 (OpenJDK 64-Bit Server VM, Java 1.8.0_212).
Type in expressions for evaluation. Or try :help.
scala> object bar { val foo = 1};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res0: Int = 1
scala> val foo = ""
foo: String = ""
scala> foo
res1: String = ""
scala> object bar { val foo = 2};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res2: Int = 2
scala> val foo = ""
foo: String = ""
scala> foo
res3: String = ""
scala> object bar { val foo = 3};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res4: Int = 3
scala> val foo = ""
foo: String = ""
scala> foo
res5: String = ""
scala> object bar { val foo = 4};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res6: Int = 4
scala> val foo = ""
foo: String = ""
scala> foo
res7: String = ""
scala> object bar { val foo = 5};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res8: Int = 5
scala> val foo = ""
foo: String = ""
scala> foo
res9: String = ""
scala> object bar { val foo = 6};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res10: Int = 6
scala> val foo = ""
foo: String = ""
scala> foo
res11: String = ""
scala> object bar { val foo = 7};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res12: Int = 7
scala> val foo = ""
foo: String = ""
scala> foo
res13: String = ""
scala> object bar { val foo = 8};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res14: Int = 8
scala> val foo = ""
foo: String = ""
scala> foo
res15: String = ""
scala> object bar { val foo = 9};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res16: Int = 9
scala> val foo = ""
foo: String = ""
scala> foo
res17: String = ""
scala> object bar { val foo = 10};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res18: Int = 10
scala> val foo = ""
foo: String = ""
scala> foo
res19: String = ""
scala> object bar { val foo = 11};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res20: Int = 11
scala> val foo = ""
foo: String = ""
scala> foo
res21: String = ""
scala> object bar { val foo = 12};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res22: Int = 12
scala> val foo = ""
foo: String = ""
scala> foo
res23: String = ""
scala> object bar { val foo = 13};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res24: Int = 13
scala> val foo = ""
foo: String = ""
scala> foo
res25: String = ""
scala> object bar { val foo = 14};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res26: Int = 14
scala> val foo = ""
foo: String = ""
scala> foo
res27: String = ""
scala> object bar { val foo = 15};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res28: Int = 15
scala> val foo = ""
foo: String = ""
scala> foo
res29: String = ""
scala> object bar { val foo = 16};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res30: Int = 16
scala> val foo = ""
foo: String = ""
scala> foo
res31: String = ""
scala> object bar { val foo = 17};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res32: Int = 17
scala> val foo = ""
foo: String = ""
scala> foo
res33: String = ""
scala> object bar { val foo = 18};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res34: Int = 18
scala> val foo = ""
foo: String = ""
scala> foo
res35: String = ""
scala> object bar { val foo = 19};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res36: Int = 19
scala> val foo = ""
foo: String = ""
scala> foo
res37: String = ""
scala> object bar { val foo = 20};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res38: Int = 20
scala> val foo = ""
foo: String = ""
scala> foo
res39: String = ""
scala> object bar { val foo = 21};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res40: Int = 21
scala> val foo = ""
foo: String = ""
scala> foo
res41: String = ""
scala> object bar { val foo = 22};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res42: Int = 22
scala> val foo = ""
foo: String = ""
scala> foo
res43: String = ""
scala> object bar { val foo = 23};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res44: Int = 23
scala> val foo = ""
foo: String = ""
scala> foo
res45: String = ""
scala> object bar { val foo = 24};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res46: Int = 24
scala> val foo = ""
foo: String = ""
scala> foo
res47: String = ""
scala> object bar { val foo = 25};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res48: Int = 25
scala> val foo = ""
foo: String = ""
scala> foo
res49: String = ""
scala> object bar { val foo = 26};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res50: Int = 26
scala> val foo = ""
foo: String = ""
scala> foo
res51: String = ""
scala> object bar { val foo = 27};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res52: Int = 27
scala> val foo = ""
foo: String = ""
scala> foo
res53: String = ""
scala> object bar { val foo = 28};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res54: Int = 28
scala> val foo = ""
foo: String = ""
scala> foo
res55: String = ""
scala> object bar { val foo = 29};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res56: Int = 29
scala> val foo = ""
foo: String = ""
scala> foo
res57: String = ""
scala> object bar { val foo = 30};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res58: Int = 30
scala> val foo = ""
foo: String = ""
scala> foo
res59: String = ""
scala> object bar { val foo = 31};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res60: Int = 31
scala> val foo = ""
foo: String = ""
scala> foo
res61: String = ""
scala> object bar { val foo = 32};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res62: Int = 32
scala> val foo = ""
foo: String = ""
scala> foo
res63: String = ""
scala> object bar { val foo = 33};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res64: Int = 33
scala> val foo = ""
foo: String = ""
scala> foo
res65: String = ""
scala> object bar { val foo = 34};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res66: Int = 34
scala> val foo = ""
foo: String = ""
scala> foo
res67: String = ""
scala> object bar { val foo = 35};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res68: Int = 35
scala> val foo = ""
foo: String = ""
scala> foo
res69: String = ""
scala> object bar { val foo = 36};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res70: Int = 36
scala> val foo = ""
foo: String = ""
scala> foo
res71: String = ""
scala> object bar { val foo = 37};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res72: Int = 37
scala> val foo = ""
foo: String = ""
scala> foo
res73: String = ""
scala> object bar { val foo = 38};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res74: Int = 38
scala> val foo = ""
foo: String = ""
scala> foo
res75: String = ""
scala> object bar { val foo = 39};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res76: Int = 39
scala> val foo = ""
foo: String = ""
scala> foo
res77: String = ""
scala> object bar { val foo = 40};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res78: Int = 40
scala> val foo = ""
foo: String = ""
scala> foo
res79: String = ""
scala> object bar { val foo = 41};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res80: Int = 41
scala> val foo = ""
foo: String = ""
scala> foo
res81: String = ""
scala> object bar { val foo = 42};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res82: Int = 42
scala> val foo = ""
foo: String = ""
scala> foo
res83: String = ""
scala> object bar { val foo = 43};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res84: Int = 43
scala> val foo = ""
foo: String = ""
scala> foo
res85: String = ""
scala> object bar { val foo = 44};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res86: Int = 44
scala> val foo = ""
foo: String = ""
scala> foo
res87: String = ""
scala> object bar { val foo = 45};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res88: Int = 45
scala> val foo = ""
foo: String = ""
scala> foo
res89: String = ""
scala> object bar { val foo = 46};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res90: Int = 46
scala> val foo = ""
foo: String = ""
scala> foo
res91: String = ""
scala> object bar { val foo = 47};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res92: Int = 47
scala> val foo = ""
foo: String = ""
scala> foo
res93: String = ""
scala> object bar { val foo = 48};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res94: Int = 48
scala> val foo = ""
foo: String = ""
scala> foo
res95: String = ""
scala> object bar { val foo = 49};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res96: Int = 49
scala> val foo = ""
foo: String = ""
scala> foo
res97: String = ""
scala> object bar { val foo = 50};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res98: Int = 50
scala> val foo = ""
foo: String = ""
scala> foo
res99: String = ""
scala> object bar { val foo = 51};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res100: Int = 51
scala> val foo = ""
foo: String = ""
scala> foo
res101: String = ""
scala> object bar { val foo = 52};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res102: Int = 52
scala> val foo = ""
foo: String = ""
scala> foo
res103: String = ""
scala> object bar { val foo = 53};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res104: Int = 53
scala> val foo = ""
foo: String = ""
scala> foo
res105: String = ""
scala> object bar { val foo = 54};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res106: Int = 54
scala> val foo = ""
foo: String = ""
scala> foo
res107: String = ""
scala> object bar { val foo = 55};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res108: Int = 55
scala> val foo = ""
foo: String = ""
scala> foo
res109: String = ""
scala> object bar { val foo = 56};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res110: Int = 56
scala> val foo = ""
foo: String = ""
scala> foo
res111: String = ""
scala> object bar { val foo = 57};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res112: Int = 57
scala> val foo = ""
foo: String = ""
scala> foo
res113: String = ""
scala> object bar { val foo = 58};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res114: Int = 58
scala> val foo = ""
foo: String = ""
scala> foo
res115: String = ""
scala> object bar { val foo = 59};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res116: Int = 59
scala> val foo = ""
foo: String = ""
scala> foo
res117: String = ""
scala> object bar { val foo = 60};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res118: Int = 60
scala> val foo = ""
foo: String = ""
scala> foo
res119: String = ""
scala> object bar { val foo = 61};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res120: Int = 61
scala> val foo = ""
foo: String = ""
scala> foo
res121: String = ""
scala> object bar { val foo = 62};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res122: Int = 62
scala> val foo = ""
foo: String = ""
scala> foo
res123: String = ""
scala> object bar { val foo = 63};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res124: Int = 63
scala> val foo = ""
foo: String = ""
scala> foo
res125: String = ""
scala> object bar { val foo = 64};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res126: Int = 64
scala> val foo = ""
foo: String = ""
scala> foo
res127: String = ""
scala> object bar { val foo = 65};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res128: Int = 65
scala> val foo = ""
foo: String = ""
scala> foo
res129: String = ""
scala> object bar { val foo = 66};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res130: Int = 66
scala> val foo = ""
foo: String = ""
scala> foo
res131: String = ""
scala> object bar { val foo = 67};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res132: Int = 67
scala> val foo = ""
foo: String = ""
scala> foo
res133: String = ""
scala> object bar { val foo = 68};
defined object bar
scala> import bar.foo
import bar.foo
scala> foo
res134: Int = 68
scala> val foo = ""
foo: String = ""
scala> foo
res135: String = ""
scala> object bar { val foo = 69};
defined object bar
scala> import bar.foo
import bar.foo
java.lang.OutOfMemoryError: GC overhead limit exceeded
at scala.reflect.internal.Types$TypeRef$.apply(Types.scala:2748)
at scala.reflect.internal.Types.copyTypeRef(Types.scala:4058)
at scala.reflect.internal.Types.copyTypeRef$(Types.scala:4050)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.