Skip to content

JRuby mistakes != for a setter #9681

Description

@rkh

Environment Information

$ mise x ruby@jruby -- ruby -v
jruby 10.1.1.0 (4.0.0) 2026-07-22 aaa95d57e1 OpenJDK 64-Bit Server VM 26.0.2+10-55 on 26.0.2+10-55 +indy +jit [arm64-darwin]
$ mise x ruby@jruby-dev -- ruby -v
jruby 10.1.2.0-SNAPSHOT (4.0.0) 2026-09-13 336fd7701b OpenJDK 64-Bit Server VM 26.0.2+10-55 on 26.0.2+10-55 +indy +jit [arm64-darwin]

Input script

class Example
  def !=(other) = true
end

Expected Behavior

Script should exit successully without any error.

Actual Behavior

An exception is raised:

SyntaxError: not_setter.rb:3: setter method cannot be defined in an endless method definition

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions