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

lint for var with a numeric literal without a type #27

Open
paperclover opened this issue Nov 6, 2024 · 0 comments
Open

lint for var with a numeric literal without a type #27

paperclover opened this issue Nov 6, 2024 · 0 comments
Labels
A-linter Area - linter and lint rules C-rule Category - Lint rule suggestion

Comments

@paperclover
Copy link

paperclover commented Nov 6, 2024

A common compile error I run into that a linter could catch faster than the non-incremental compiler.

Outside of comptime, this code is invalid.

pub fn etc() void {
  var hello = 0; // fail

  comptime { var goodbye = 0; } // ok
}

const y = brk: {
  var y = 0; // ok
  y = 1;
  break :brk y;  
};
@DonIsaac DonIsaac added A-linter Area - linter and lint rules C-rule Category - Lint rule suggestion labels Nov 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linter Area - linter and lint rules C-rule Category - Lint rule suggestion
Projects
None yet
Development

No branches or pull requests

2 participants