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

Real variables can't be assigned the result of abs function #11

Closed
danilociaffi opened this issue Dec 3, 2020 · 7 comments
Closed

Real variables can't be assigned the result of abs function #11

danilociaffi opened this issue Dec 3, 2020 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@danilociaffi
Copy link

I am using a real variable and I am experiencing the following error at save:

[KSP] ":=" : not compatible type (Real := Void)

I tried stripping down the code as much as I could to find my mistake and indeed I get this error even in toy examples as this:

on init
  declare ~real_test
  ~real_test := abs(1.0)
end on

Love this extension btw, I hope this can be fixed soon :)

@r-koubou r-koubou self-assigned this Dec 3, 2020
@r-koubou r-koubou added the bug Something isn't working label Dec 3, 2020
@r-koubou
Copy link
Owner

r-koubou commented Dec 3, 2020

Done.
Please update vscode extension 👍

r-koubou added a commit that referenced this issue Dec 3, 2020
シンボル定義の戻り値の型が不足していた
@danilociaffi
Copy link
Author

Thanks, that works! Unfortunately now I get [KSP] := not compatible type (Integer := Void) with the real_to_int() and int_to_real() functions (I swear it's not on purpose to bring int to real back and forth, I needed it in my script).

on init
	declare $real_test
	$real_test := real_to_int(1.0)
end on

@r-koubou
Copy link
Owner

r-koubou commented Dec 3, 2020

Thank you, I think it's the same cause as the abs function, so please wait.
I will check the other functions and update vscode extension again in a few days.

@r-koubou
Copy link
Owner

r-koubou commented Dec 3, 2020

If you want to work around the int_to_real and real_to_int bugs right away, you can do so in the following steps.

1: Download commands.txt

commands.txt

2: Copy commands.txt to the following location

Windows

C:\Users\<UserName>\.vscode\extensions\rkoubou.ksp-0.7.14\kspparser\data\symbols

macOS

~/.vscode/extensions/rkoubou.ksp-0.7.14/kspparser/data/symbols

3: restart vscode

@danilociaffi
Copy link
Author

Thank you!

@r-koubou
Copy link
Owner

r-koubou commented Dec 5, 2020

Uploaded vscode extension. Please update to latest version 0.7.15.

@danilociaffi
Copy link
Author

Awesome, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants