Project

General

Profile

Actions

Bug #18960

closed

Module#using raises RuntimeError when called at toplevel from wrapped script

Added by shioyama (Chris Salzberg) over 2 years ago. Updated about 2 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:109456]

Description

I noticed that this file works when loaded with load, but fails if you pass true (or a module) as the wrap argument.

# using.rb
using Module.new

This works:

load "./using.rb"

This doesn't:

load "./using.rb", true
# raises RuntimeError (main.using is permitted only at toplevel)

I believe the latter should work.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0