ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:109456] [Ruby master Bug#18960] Module#using raises RuntimeError when called at toplevel from wrapped script
@ 2022-08-09 13:38 shioyama (Chris Salzberg)
  2022-08-09 13:44 ` [ruby-core:109457] " shioyama (Chris Salzberg)
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: shioyama (Chris Salzberg) @ 2022-08-09 13:38 UTC (permalink / raw)
  To: ruby-core

Issue #18960 has been reported by shioyama (Chris Salzberg).

----------------------------------------
Bug #18960: Module#using raises RuntimeError when called at toplevel from wrapped script
https://bugs.ruby-lang.org/issues/18960

* Author: shioyama (Chris Salzberg)
* Status: Open
* Priority: Normal
* Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN
----------------------------------------
I noticed that this file works when loaded with `load`, but fails if you pass `true` (or a module) as the `wrap` argument.

```ruby
# using.rb
using Module.new
```

This works:

```ruby
load "./using.rb"
```

This doesn't:
```ruby
load "./using.rb", true
# raises RuntimeError (main.using is permitted only at toplevel)
```

I believe the latter should work.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2022-09-23 10:28 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-09 13:38 [ruby-core:109456] [Ruby master Bug#18960] Module#using raises RuntimeError when called at toplevel from wrapped script shioyama (Chris Salzberg)
2022-08-09 13:44 ` [ruby-core:109457] " shioyama (Chris Salzberg)
2022-08-22  4:30 ` [ruby-core:109623] " shioyama (Chris Salzberg)
2022-08-22  5:02 ` [ruby-core:109624] " jeremyevans0 (Jeremy Evans)
2022-08-22  6:19 ` [ruby-core:109625] " shugo (Shugo Maeda)
2022-08-22  7:48 ` [ruby-core:109626] " shioyama (Chris Salzberg)
2022-09-22 22:39 ` [ruby-core:110010] " mame (Yusuke Endoh)
2022-09-22 23:41 ` [ruby-core:110017] " shioyama (Chris Salzberg)
2022-09-22 23:55 ` [ruby-core:110019] " shugo (Shugo Maeda)
2022-09-23  1:25 ` [ruby-core:110021] " shioyama (Chris Salzberg)
2022-09-23  1:30 ` [ruby-core:110022] " shioyama (Chris Salzberg)
2022-09-23  1:36 ` [ruby-core:110023] " shioyama (Chris Salzberg)
2022-09-23  2:51 ` [ruby-core:110026] " shugo (Shugo Maeda)
2022-09-23  5:58 ` [ruby-core:110031] " shioyama (Chris Salzberg)
2022-09-23 10:28 ` [ruby-core:110043] " shugo (Shugo Maeda)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).