-
-
Notifications
You must be signed in to change notification settings - Fork 40
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
(MatchError) no match of right hand side value
in main module of an application
#558
Comments
Pretty much exactly this same happening for me on a different project. Currently debugging it, I'll share if I find anything interesting. |
I believe this is due to a change in debug info representation in 1.18. @jonatanklosko I think there is a new Is this a regression or private api that I should fix? The offending code looks like this {:ok, {_, [{~c"Dbgi", bin}]}} = :beam_lib.chunks(bytecode, [~c"Dbgi"])
{:debug_info_v1, _, {_, %{line: line, struct: struct}, _}} = :erlang.binary_to_term(bin) |
If there is something in which I can help for debugging, don't hesitate to ask me! Thank you both for your fast response! |
@mhanberg yeah it was intentional, now there is @josevalim I believe we looked around if it was used, I guess we missed this one? |
I can just work around it, wanted confirmation and direction on how to get the line from the anno structure. Thanks! |
@jonatanklosko related, also seeing now that the struct definition from a module (fetched via Module.get_definition(mod, {name, arity}) is reporting the line number as 0. Previously it was being reported as the line of the call to |
The code currently says:
So it was added to improve the usage of tools like |
The line will be fixed in v1.18.2. |
Thanks @josevalim! |
Thank you very much to everyone for working on this issue! |
Hi!
First, thank you for your work on NextLS and the elixir-tools ecosystem.
I am having a strange issue that I don't get to solve it.
Environment
Both, Erlang/OTP and Elixir, installed using Homebrew.
Issue
I have a simple Phoenix app named
:api
, so the main modules areApi
andApiWeb
. In the case of the first one, once I save one file for the first time (let's say change something indevice_json.ex
as shown in the stacktrace), there is aMatchError
inapi.ex
file. This file is an empty module:The
MatchError
appears in the samedefmodule
and shows the next stacktrace:Another important detail is that Visual Studio Code shows a notification saying "Failed to format lib/api_web/controllers/device_json.ex". If I hover any code, doesn't show anything unless there is an error or a warning marked and if I don't remember wrong, it should show the docs for the function you hover.
To be honest, I have not idea of what may be happening in this case. I keep thinking in this issue and if I discover something more I will include in this issue. Of course, feel free to change the title of the issue if you have one more suitable 😅 .
Full stacktrace
This stacktrace shows all the process done after change and save
device_json.ex
, of course, as I mentioned before, it happens changing and saving any file, it is not an specific issue with this file.The text was updated successfully, but these errors were encountered: