You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Error: undefined method `value' for :call:Symbol #1434
Hey @chimpanstache - any chance you could share your users_controller.rb file? If not, could you potentially try to format it while removing private content and get it down to a small reproduction? I can't do anything without a little more information unfortunately.
Hey @kddnewton, there are only 2 contexts where value is appearing in that file, which are very same:
result =
estimate_duration.call(
params: params,
)
if result.success?
duration = result.value!
estimate_duration being an instance of this class:
class EstimateDuration
include Wisper::Publisher
include Dry::Monads[:result]
extend Dry::Initializer
def call(params:)
...
copilot explanation here if helpful:
Dry::Monads::Result can be either a Success or a Failure object. Both Success and Failure objects respond to the value! method.
In the case of a Success object, value! will return the value that the Success object is wrapping. However, if result is a Failure object, calling value! will raise an error.
Let me know if a larger code sample is necessary, thank you for helping me
value in this case is a method being called within syntax tree, it doesn't have to do with your file specifically. I imagine there's some place in your code that is calling something like:
Activity
kddnewton commentedon Apr 23, 2024
Hey @chimpanstache - any chance you could share your users_controller.rb file? If not, could you potentially try to format it while removing private content and get it down to a small reproduction? I can't do anything without a little more information unfortunately.
chimpanstache commentedon Apr 23, 2024
Hey @kddnewton, there are only 2 contexts where
valueis appearing in that file, which are very same:estimate_durationbeing an instance of this class:copilot explanation here if helpful:
Let me know if a larger code sample is necessary, thank you for helping me
kddnewton commentedon Apr 23, 2024
valuein this case is a method being called within syntax tree, it doesn't have to do with your file specifically. I imagine there's some place in your code that is calling something like:Do you see anything like that?
chimpanstache commentedon Apr 23, 2024
Indeed, here it is:
kddnewton commentedon Apr 23, 2024
Great! Now that we've found that, can you tell me the version of the
syntax_treegem that you have installed? That performs the actual formatting.chimpanstache commentedon Apr 23, 2024
Nice, there it is:
kddnewton commentedon Apr 23, 2024
Is there anywhere else in that file that has calls like that? I'm still not quite able to reproduce here. (Thank you for your patience!)
kddnewton commentedon Apr 23, 2024
Actually even better, could you run
stree format path/to/fileand give me the backtrace? That would be super helpful.chimpanstache commentedon Apr 23, 2024
No worries! No, it's the only place in that file. Here is the full backtrace :
kddnewton commentedon Apr 23, 2024
Ah-ha! Found it. Thanks! That'll be fixed in the next release
chimpanstache commentedon Apr 23, 2024
Fantastic! Thank you for your help. Looking forward the next release
kddnewton commentedon Apr 23, 2024
In the meantime you can take the following steps:
Dry::Matcher::ResultMatcher.call(result) do |m|# stree-ignorecomment before the line with the issuechimpanstache commentedon Apr 23, 2024
# stree-ignorefor the win!