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
I just started using ols with VS Code and noticed some cases where the code can't compile but no error appears on screen:
#+privatepackage odin_test
main :: proc() {
return1
}
No error appears but odin check shows:
odin-test/main.odin(7:10) Error: No return values expected
return 1
^
If I change the signature of main to return an int:
#+privatepackage odin_test
main :: proc() -> int {
return1
}
There won't be any errors on the screen but odin check shows:
odin-test/main.odin(4:1) Error: Procedure type of 'main' was expected to be 'proc()', got proc() -> int
main :: proc() -> int {
^
If I call a procedure that doesn't exist, it won't appear on intellisense (obviously) but no error or warning appears saying I'm calling something that isn't real:
#+privatepackage odin_test
main :: proc() {
foo()
}
The same thing happens to "calling methods" or trying to access inexistent fields:
#+privatepackage odin_test
import"core:fmt"
main :: proc() {
x := 0
x.foo()
x->bar()
fmt.println(x.etc)
}
odin check shows:
odin-test/main.odin(8:3) Error: 'x' of type 'int' has no field 'foo'
x.foo()
^
odin-test/main.odin(9:3) Error: 'x' of type 'int' has no field 'bar'
x->bar()
^
odin-test/main.odin(10:15) Error: 'x' of type 'int' has no field 'etc'
fmt.println(x.etc)
^
The text was updated successfully, but these errors were encountered:
I can't reproduce it. You will have to describe the exact project configuration. Your ols.json for odin check configuration. How you call the odin check manually.
Ideally to get the exact same odin check you need to set up in ols.json:
main.odin is located in the same directory as the config file. All other files shouldn't affect how ols behaves because it's just some vscode settings to change what files are displayed in the explorer and a .gitignore file.
I just started using ols with VS Code and noticed some cases where the code can't compile but no error appears on screen:
No error appears but
odin check
shows:If I change the signature of
main
to return anint
:There won't be any errors on the screen but
odin check
shows:If I call a procedure that doesn't exist, it won't appear on intellisense (obviously) but no error or warning appears saying I'm calling something that isn't real:
odin check
shows:The same thing happens to "calling methods" or trying to access inexistent fields:
odin check
shows:The text was updated successfully, but these errors were encountered: