topazproject / topaz

A high performance ruby, written in RPython
topazruby.com
BSD 3-Clause "New" or "Revised" License
1k stars 84 forks source link

Mutually recursive require breaks with SystemStackError #837

Open codeZeilen opened 10 years ago

codeZeilen commented 10 years ago

With two files modulea.rb and moduleb.rb the following happens:

# modulea.rb
$LOAD_PATH << Dir.pwd
require moduleb
print "a done\n"

# moduleb.rb
$LOAD_PATH << Dir.pwd
require modulea
print "b done\n"

# Using Ruby 1.9.3p194
>>a done
>>b done
>>a done

# Using topaz
/code/rpython/babelsberg-r/lib-topaz/enumerable.rb:115:in `include?': stack level too deep (SystemStackError)
from /home/patrick/Documents/code/rpython/minimalRecursiveModules/moduleb.rb:2:in `require'
from /home/patrick/Documents/code/rpython/minimalRecursiveModules/moduleb.rb:2:in `<main>'
from /home/patrick/Documents/code/rpython/minimalRecursiveModules/modulea.rb:2:in `require'
from /home/patrick/Documents/code/rpython/minimalRecursiveModules/modulea.rb:2:in `<main>'
...