Skip to content

Ambiguous method warning when submitting a Runnable to an Executor #3263

@blinsay

Description

@blinsay

This is a followup to #2065. Submitting a class that includes java.lang.Runnable to an executor generates an ambiguous method warning on 9.0.0.0.

java_import java.util.concurrent.Executors
e = Executors.new_fixed_thread_pool(1)

class Foo
  include java.lang.Runnable

  def run
    sleep 2
    puts "hi"
  end
end
e.submit(Foo.new)
# (pry):11: warning: ambiguous Java methods found, using submit(java.lang.Runnable)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions