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

Problem passing virtual REF variable to function #363

Closed
cpyrgas opened this issue Apr 17, 2020 · 2 comments
Closed

Problem passing virtual REF variable to function #363

cpyrgas opened this issue Apr 17, 2020 · 2 comments

Comments

@cpyrgas
Copy link

cpyrgas commented Apr 17, 2020

In the code below, the OUT version compiles fine, but the compiler for the REF syntax complains:

error XS9002: Parser: unexpected input '_'

FUNCTION Start() AS VOID
	MyFuncOut(1, 2, OUT VAR _ )
	MyFuncOut(1, 2, OUT _ AS STRING)
	MyFuncOut(1, 2, OUT NULL)
	
	MyFuncRef(1, 2, REF VAR _ )
	MyFuncRef(1, 2, REF _ AS STRING)
	MyFuncRef(1, 2, REF NULL)
RETURN

FUNCTION MyFuncOut(n AS INT,m AS INT,c OUT STRING) AS VOID
c := "asd"
FUNCTION MyFuncRef(n AS INT,m AS INT,c REF STRING) AS VOID
c := "asd"
@cpyrgas cpyrgas added this to To do in Compiler via automation Apr 17, 2020
@RobertvanderHulst
Copy link
Member

I did some reading and Roslyn does not support this for REF variables. The idea behind this is that REF variables HAVE to be initialized before they are used. In theory we could still support this and initialize the variables automatically by the compiler, but I think we have more important things on our todo list

@RobertvanderHulst RobertvanderHulst added this to the Later milestone Apr 19, 2020
@cpyrgas
Copy link
Author

cpyrgas commented Apr 19, 2020

Agreed!

Compiler automation moved this from To do to Done May 24, 2020
@RobertvanderHulst RobertvanderHulst self-assigned this Jul 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Compiler
  
Done
Development

No branches or pull requests

2 participants