ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:119533] [Ruby master Bug#20799] Bug in forwarding to struct methods
@ 2024-10-21  8:50 tenderlovemaking (Aaron Patterson) via ruby-core
  0 siblings, 0 replies; only message in thread
From: tenderlovemaking (Aaron Patterson) via ruby-core @ 2024-10-21  8:50 UTC (permalink / raw)
  To: ruby-core; +Cc: tenderlovemaking (Aaron Patterson)

Issue #20799 has been reported by tenderlovemaking (Aaron Patterson).

----------------------------------------
Bug #20799: Bug in forwarding to struct methods
https://bugs.ruby-lang.org/issues/20799

* Author: tenderlovemaking (Aaron Patterson)
* Status: Closed
* Assignee: tenderlovemaking (Aaron Patterson)
* ruby -v: ruby 3.4.0dev (2024-10-15T18:34:24Z master f45eb3dcb9) +PRISM [arm64-darwin24]
* Backport: 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONTNEED
----------------------------------------
This program crashes:

```ruby
Thing = Struct.new(:value)

Obj = Thing.new("ok")

def delegate(...)
  Obj.value(...)
end

def no_args
  delegate
end

def splat_args(*args)
  delegate(*args)
end

no_args
splat_args
```

It's crashing because we're forwarding to a struct method without taking in to account the forwarding IC.  I have a patch prepared, but I am filing this ticket to track it.



-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-10-21  8:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-21  8:50 [ruby-core:119533] [Ruby master Bug#20799] Bug in forwarding to struct methods tenderlovemaking (Aaron Patterson) via 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 NNTP newsgroup(s).