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

Some built in functions are saying they return any instead of their appropriate return type in the LSP #384

Open
McJones opened this issue Feb 1, 2024 · 0 comments

Comments

@McJones
Copy link
Collaborator

McJones commented Feb 1, 2024

The following yarn should be valid:

<<declare $str = "">>
<<set $str = string(1)>>
<<set $str = format_invariant(1)>>
<<set $str = format("{1}", 1)>>

<<declare $bool = true>>
<<set $bool = bool(1)>>
<<set $bool = visited("node")>>

<<declare $num = 1>>
<<set $num = visited_count("node")>>
<<set $num = number(1)>>
<<set $num = random()>>
<<set $num = random_range(0, 9)>>
<<set $num = dice(6)>>
<<set $num = round(1.5)>>
<<set $num = round_places(1.5, 1)>>
<<set $num = floor(1.5)>>
<<set $num = ceil(1.5)>>
<<set $num = inc(1.5)>>
<<set $num = dec(1.5)>>
<<set $num = decimal(1.5)>>
<<set $num = int(1.5)>>

And inside Unity this compiles without error, but inside vscode only format, visited, and visited_count work, all others are reporting their return type is any.
This happens on both the current and WIP 3 branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants