ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:101939] [Ruby master Bug#17512] ostruct super regression
@ 2021-01-05 20:24 adamhess1991
  2021-01-05 23:05 ` [ruby-core:101941] " hsbt
  2021-01-06  0:43 ` [ruby-core:101942] " marcandre-ruby-core
  0 siblings, 2 replies; 3+ messages in thread
From: adamhess1991 @ 2021-01-05 20:24 UTC (permalink / raw)
  To: ruby-core

Issue #17512 has been reported by HParker (Adam Hess).

----------------------------------------
Bug #17512: ostruct super regression
https://bugs.ruby-lang.org/issues/17512

* Author: HParker (Adam Hess)
* Status: Open
* Priority: Normal
* ruby -v: 3.0.0
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
In ruby 3.0, Calling super on ostruct always returns nil. This is a regression in ruby 3.0 introduced when fixing another issue.

introduced by: 
- https://bugs.ruby-lang.org/issues/12136
- https://github.com/ruby/ruby/commit/e026e186f4a01aa3f6cd02ae6ef33f44f129361c

This unintentionally changed `super` behavior in classes that inherit from OpenStruct.

```ruby
require 'ostruct'

class Foo < OpenStruct
  def foo
    super
  end
end

p Foo.new(foo: 123).foo
```

```
Ruby 3.0:
=> nil
Ruby 2.7:
=> 123
```

Potential fix is to bring back some of the behavior reverted in issue #12136 to allow method missing to sometimes respond to methods with zero arguments.

This is implemented in: https://github.com/ruby/ruby/pull/4028 and included as a patch attached to this issue.

---Files--------------------------------
0001-Allow-ostruct-to-return-a-value-on-super.patch (1.7 KB)


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

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

* [ruby-core:101941] [Ruby master Bug#17512] ostruct super regression
  2021-01-05 20:24 [ruby-core:101939] [Ruby master Bug#17512] ostruct super regression adamhess1991
@ 2021-01-05 23:05 ` hsbt
  2021-01-06  0:43 ` [ruby-core:101942] " marcandre-ruby-core
  1 sibling, 0 replies; 3+ messages in thread
From: hsbt @ 2021-01-05 23:05 UTC (permalink / raw)
  To: ruby-core

Issue #17512 has been updated by hsbt (Hiroshi SHIBATA).

Assignee set to marcandre (Marc-Andre Lafortune)
Status changed from Open to Assigned

----------------------------------------
Bug #17512: ostruct super regression
https://bugs.ruby-lang.org/issues/17512#change-89788

* Author: HParker (Adam Hess)
* Status: Assigned
* Priority: Normal
* Assignee: marcandre (Marc-Andre Lafortune)
* ruby -v: 3.0.0
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
In ruby 3.0, Calling super on ostruct always returns nil. This is a regression in ruby 3.0 introduced when fixing another issue.

introduced by: 
- https://bugs.ruby-lang.org/issues/12136
- https://github.com/ruby/ruby/commit/e026e186f4a01aa3f6cd02ae6ef33f44f129361c

This unintentionally changed `super` behavior in classes that inherit from OpenStruct.

```ruby
require 'ostruct'

class Foo < OpenStruct
  def foo
    super
  end
end

p Foo.new(foo: 123).foo
```

```
Ruby 3.0:
=> nil
Ruby 2.7:
=> 123
```

Potential fix is to bring back some of the behavior reverted in issue #12136 to allow method missing to sometimes respond to methods with zero arguments.

This is implemented in: https://github.com/ruby/ruby/pull/4028 and included as a patch attached to this issue.

---Files--------------------------------
0001-Allow-ostruct-to-return-a-value-on-super.patch (1.7 KB)


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

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

* [ruby-core:101942] [Ruby master Bug#17512] ostruct super regression
  2021-01-05 20:24 [ruby-core:101939] [Ruby master Bug#17512] ostruct super regression adamhess1991
  2021-01-05 23:05 ` [ruby-core:101941] " hsbt
@ 2021-01-06  0:43 ` marcandre-ruby-core
  1 sibling, 0 replies; 3+ messages in thread
From: marcandre-ruby-core @ 2021-01-06  0:43 UTC (permalink / raw)
  To: ruby-core

Issue #17512 has been updated by marcandre (Marc-Andre Lafortune).

Status changed from Assigned to Closed

Fixed and released as 0.3.2, thanks!

----------------------------------------
Bug #17512: ostruct super regression
https://bugs.ruby-lang.org/issues/17512#change-89789

* Author: HParker (Adam Hess)
* Status: Closed
* Priority: Normal
* Assignee: marcandre (Marc-Andre Lafortune)
* ruby -v: 3.0.0
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
In ruby 3.0, Calling super on ostruct always returns nil. This is a regression in ruby 3.0 introduced when fixing another issue.

introduced by: 
- https://bugs.ruby-lang.org/issues/12136
- https://github.com/ruby/ruby/commit/e026e186f4a01aa3f6cd02ae6ef33f44f129361c

This unintentionally changed `super` behavior in classes that inherit from OpenStruct.

```ruby
require 'ostruct'

class Foo < OpenStruct
  def foo
    super
  end
end

p Foo.new(foo: 123).foo
```

```
Ruby 3.0:
=> nil
Ruby 2.7:
=> 123
```

Potential fix is to bring back some of the behavior reverted in issue #12136 to allow method missing to sometimes respond to methods with zero arguments.

This is implemented in: https://github.com/ruby/ruby/pull/4028 and included as a patch attached to this issue.

---Files--------------------------------
0001-Allow-ostruct-to-return-a-value-on-super.patch (1.7 KB)


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

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

end of thread, other threads:[~2021-01-06  0:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-05 20:24 [ruby-core:101939] [Ruby master Bug#17512] ostruct super regression adamhess1991
2021-01-05 23:05 ` [ruby-core:101941] " hsbt
2021-01-06  0:43 ` [ruby-core:101942] " marcandre-ruby-core

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).