Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in T::Struct#validate_prop_name #2556

Closed
hdoan741 opened this issue Jan 28, 2020 · 4 comments
Closed

Error in T::Struct#validate_prop_name #2556

hdoan741 opened this issue Jan 28, 2020 · 4 comments
Labels
bug Something isn't working runtime Related to the sorbet-runtime gem

Comments

@hdoan741
Copy link
Contributor

Input

  class WizardName < T::Struct
    const :name, String
  end

Observed output

Failure/Error: const :name, String
NoMethodError:
  undefined method `match?' for :name:Symbol
  Did you mean?  match
# /home/travis/.rvm/gems/ruby-2.3.8/gems/sorbet-runtime-0.5.5295/lib/types/props/decorator.rb:252:in `validate_prop_name'
# /home/travis/.rvm/gems/ruby-2.3.8/gems/sorbet-runtime-0.5.5295/lib/types/private/methods/call_validation.rb:126:in `call'
# /home/travis/.rvm/gems/ruby-2.3.8/gems/sorbet-runtime-0.5.5295/lib/types/private/methods/call_validation.rb:126:in `validate_call'
# /home/travis/.rvm/gems/ruby-2.3.8/gems/sorbet-runtime-0.5.5295/lib/types/private/methods/_methods.rb:238:in `block in _on_method_added'
# /home/travis/.rvm/gems/ruby-2.3.8/gems/sorbet-runtime-0.5.5295/lib/types/props/decorator.rb:213:in `prop_validate_definition!'
# /home/travis/.rvm/gems/ruby-2.3.8/gems/sorbet-runtime-0.5.5295/lib/types/private/methods/_methods.rb:240:in `call'
# /home/travis/.rvm/gems/ruby-2.3.8/gems/sorbet-runtime-0.5.5295/lib/types/private/methods/_methods.rb:240:in `block in _on_method_added'
# /home/travis/.rvm/gems/ruby-2.3.8/gems/sorbet-runtime-0.5.5295/lib/types/props/optional.rb:55:in `prop_validate_definition!'
# /home/travis/.rvm/gems/ruby-2.3.8/gems/sorbet-runtime-0.5.5295/lib/types/props/serializable.rb:317:in `prop_validate_definition!'
# /home/travis/.rvm/gems/ruby-2.3.8/gems/sorbet-runtime-0.5.5295/lib/types/props/decorator.rb:357:in `prop_defined'
# /home/travis/.rvm/gems/ruby-2.3.8/gems/sorbet-runtime-0.5.5295/lib/types/private/methods/_methods.rb:240:in `call'
# /home/travis/.rvm/gems/ruby-2.3.8/gems/sorbet-runtime-0.5.5295/lib/types/private/methods/_methods.rb:240:in `block in _on_method_added'
# /home/travis/.rvm/gems/ruby-2.3.8/gems/sorbet-runtime-0.5.5295/lib/types/props/_props.rb:109:in `prop'
# /home/travis/.rvm/gems/ruby-2.3.8/gems/sorbet-runtime-0.5.5295/lib/types/props/_props.rb:140:in `const'
# /home/travis/.rvm/gems/ruby-2.3.8/gems/sorbet-runtime-0.5.5295/lib/types/private/methods/call_validation.rb:126:in `call'
# /home/travis/.rvm/gems/ruby-2.3.8/gems/sorbet-runtime-0.5.5295/lib/types/private/methods/call_validation.rb:126:in `validate_call'
# /home/travis/.rvm/gems/ruby-2.3.8/gems/sorbet-runtime-0.5.5295/lib/types/private/methods/_methods.rb:238:in `block in _on_method_added'
# ./spec/pluck_to_tstruct_spec.rb:20:in `<class:WizardName>'
# ./spec/pluck_to_tstruct_spec.rb:19:in `block in <top (required)>'
# ./spec/pluck_to_tstruct_spec.rb:4:in `<top (required)>'
# /home/travis/.rvm/gems/ruby-2.3.8/gems/activesupport-5.1.7/lib/active_support/dependencies.rb:286:in `load'
# /home/travis/.rvm/gems/ruby-2.3.8/gems/activesupport-5.1.7/lib/active_support/dependencies.rb:286:in `block in load'
# /home/travis/.rvm/gems/ruby-2.3.8/gems/activesupport-5.1.7/lib/active_support/dependencies.rb:258:in `load_dependency'
# /home/travis/.rvm/gems/ruby-2.3.8/gems/activesupport-5.1.7/lib/active_support/dependencies.rb:286:in `load'

Expected behavior

There should be no error.

Seems to be introduced by this change:
68c732e#diff-296495687573a8a72557282b673db5f5R243


@hdoan741 hdoan741 added bug Something isn't working unconfirmed This issue has not yet been confirmed by the Sorbet team labels Jan 28, 2020
@hdoan741
Copy link
Contributor Author

Looks like this is an issue on Ruby 2.3 only, because match? is introduced in 2.4

@elliottt elliottt removed the unconfirmed This issue has not yet been confirmed by the Sorbet team label Jan 28, 2020
@hdoan741
Copy link
Contributor Author

What are the Ruby versions you plan to support with Sorbet? I might remove Ruby 2.3 from our watch list if it's not in your supported list.

@DarkDimius
Copy link
Collaborator

The runtime support is actively tested on 2.6(the version Stripe runs) all other versions are under community support. Unless someone wants to step up and support +1, let's remove 2.3 from the list.

@jez
Copy link
Collaborator

jez commented Oct 18, 2020

Ruby 2.3 and 2.4 are no longer actively maintained, and Sorbet has no plans to test or support them going forwards.

@jez jez closed this as completed Oct 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working runtime Related to the sorbet-runtime gem
Projects
None yet
Development

No branches or pull requests

5 participants