Skip to content

Delegate class ArgumentError #8146

@segiddins

Description

@segiddins

This looks like a redux of #1370

Environment Information

Provide at least:

  • JRuby version: 9.4
  • Operating system and platform: Darwin sr-71 23.2.0 Darwin Kernel Version 23.2.0: Wed Nov 15 21:55:06 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T6020 arm64

Repro script:

#!/usr/bin/env ruby
# frozen_string_literal: true

require 'bundler/inline'
require 'delegate'

gemfile do
  source "https://rubygems.org"
  gem 'sigstore_protobuf_specs'
end

class D < DelegateClass(Sigstore::TrustRoot::V1::TrustedRoot)
  def self.something
    new Sigstore::TrustRoot::V1::TrustedRoot.decode_json('{}')
  end
end

D.something

Expected Behavior

No error, neither truffleruby nor mri raise

Actual Behavior

ArgumentError: not delegated
        __getobj__ at /Users/segiddins/.rubies/jruby-9.4.3.0/lib/ruby/stdlib/delegate.rb:405
  delegating_block at /Users/segiddins/.rubies/jruby-9.4.3.0/lib/ruby/stdlib/delegate.rb:348
               new at org/jruby/RubyClass.java:897
            <main> at Untitled.rb:18

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions