Giter Club home page Giter Club logo

Comments (8)

gingerBill avatar gingerBill commented on August 29, 2024

So this is kind of a chicken and egg problem. It's saying it is not used because it technically isn't. But it cannot know that because non_existing doesn't exist.

from odin.

thetarnav avatar thetarnav commented on August 29, 2024

It can be confusing, which is why I'm reporting it. But I understand that the solution might not be trivial. It actually happens frequently so maybe I'll just get used to it, or stop using the flag.

here is another example:

for val, i in non_existing {
	fmt.println(val, i)
}
odin-bug/main.odin(6:16) Error: Undeclared name: non_existing 
	for val, i in non_existing { 
	              ^~~~~~~~~~~^ 
 
odin-bug/main.odin(7:15) Error: Undeclared name: val 
	fmt.println(val, i) 
	            ^~^ 
 
odin-bug/main.odin(7:20) Error: Undeclared name: i 
	fmt.println(val, i) 
	                 ^ 

from odin.

laytan avatar laytan commented on August 29, 2024

A possible solution is only showing vet errors when there are 0 actual compiler errors. Is that a good solution? Maybe.

from odin.

flysand7 avatar flysand7 commented on August 29, 2024

There is a compiler error though, which is the whole premise of the issue.

from odin.

laytan avatar laytan commented on August 29, 2024

There is a compiler error though, which is the whole premise of the issue.

Which is why a solution is to not show vet errors when there are compiler errors.

In this case it would only show the compiler error about using an undeclared variable, and not the vet errors about an unused variable.

from odin.

thetarnav avatar thetarnav commented on August 29, 2024

the errors in my last example are not from vet flags actually, so that's not a full solution.
Also it wouldn't be fun to compile, see few errors, correct them, and compile again only to see more errors that got ignored on the first run.

from odin.

laytan avatar laytan commented on August 29, 2024

I don't think there's an (actionable) solution to this then

from odin.

flysand7 avatar flysand7 commented on August 29, 2024

^ I actually like laytan's proposal to only show vet errors only when there are no compiler errors

The more generic version of this problem is showing inter-dependent errors which I don't think can be solved by patching in one or two lines of code, it has to be done on a case-by-case basis.

from odin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.