Open cafrias opened 7 years ago
+1 here, I'm following the same course and have the same issue.
+1, same problem. elixirlinter giving this error but the code compiles fine with iex -S mix (elixir 1.4.0 if this can help)
+1, me too, with elixir 1.5.1
+1,me too,CompileError in sublime3 like this: but it work well in terminal:
+1
Anyone figure this out>?
Wow so yeah got the same thing. Im sorta wondering if its a permissions thing. Im using win10 and sorta wondering if everyone else was using windows. I should mention iex -S mix does not work with mine.
Edited: So I think I worked it out but I am having trouble testing it as elixir seems to be remember things from the terminal. As I looked through the error I felt like it had an issue with the struct being populated or something. I had not done allot of the command line parts of the class and Im assuming neither did the folks on this thread. So I went back and did them and low and behold everything worked. Thing is I could not for the life of me get it to misbehave again. I believe the issue is in the code he had us do "defstruct hex: nil" and then later in the command line he shows how it can be changed and does a "defstruct hex: []" changing it to a list which is then what our program feeds it. When we actually do the "%Identicon.Image{hex: hex}" at the end since hex was a list and it had been defined as a list it was fine but when we had it defined as nil it did not work. Unfortunately as I said once I did it, it worked and I even tried backing up the original project and creating a new one and copying over the lib files to get it to fail but darned if it would not fail. If someone comes across this or is still wrestling with it what I would like you to do is change the "nil" to "[]" in the code and I think then it might work without any command line additions. If someone can do this then please respond back if that is the case. I don't feel like going crazy and reinstalling elixir to get the error back.
Changing "nil" to "[]" did not seem to help with this issue. Same error:
== Compilation error in file lib/identicon.ex == ** (CompileError) lib/identicon.ex:12: Identicon.Image.__struct__/0 is undefined, cannot expand struct Identicon.Image lib/identicon.ex:12: (module)
Has anyone found a solution to this? I'm following the same course and have the exact same issue
Hello there!
I have two modules defined in different files, one is using the struct defined in the other, as the following code explains:
The exact error I get from
elixirlinter
is the following:Error: Identicon.Image.__struct__/0 is undefined, cannot expand struct Identicon.Image
The application is running perfectly when executed using
iex -S mix
.It seems that I can't load external dependencies for the current file. My question is how to do that? Is there any better approach?
Thanks in advance!