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

Support ref locals/refturn #155

Closed
5 tasks done
adrianoc opened this issue Feb 25, 2022 · 0 comments
Closed
5 tasks done

Support ref locals/refturn #155

adrianoc opened this issue Feb 25, 2022 · 0 comments

Comments

@adrianoc
Copy link
Owner

adrianoc commented Feb 25, 2022

It looks like we already have a lot of support; i.e, code like

using System;
class Foo
{
	int field;
	ref int M(ref int i) => ref field;

	ref int Local() 
	{
		ref int l = ref field;
		return ref l;
	}

	ref int Property
	{
		get
		{
			ref int l = ref field;
			return ref l;
		}
	}
}

Looks to be generating correct code.

Tasks

  • Add tests (if we don't have any) and fix any failures

Cover

  • Ref return
  • Local refs
  • Methods returning refs
  • Property returning refs

MSDN Docs

https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/ref-returns

@adrianoc adrianoc mentioned this issue Feb 25, 2022
100 tasks
adrianoc added a commit that referenced this issue Mar 14, 2022
the following was already supported:
* Ref locals
* Methods returning refs
* ref return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant