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

Returning ref of void crashes the IDE #2125

Closed
disarray2077 opened this issue Feb 1, 2025 · 1 comment
Closed

Returning ref of void crashes the IDE #2125

disarray2077 opened this issue Feb 1, 2025 · 1 comment

Comments

@disarray2077
Copy link
Contributor

disarray2077 commented Feb 1, 2025

The following code causes a divide by zero crash on compilation:

using System;

namespace simple_test;

class Program
{

	public static ref T Test<T>() where T : var
	{
		static T dummy = default;
		return ref dummy;
	}

	static void Main()
	{
		Test<void>();
	}
}

Tested with: cce1611

@bfiete
Copy link
Collaborator

bfiete commented Feb 1, 2025

It was actually the static local that triggered the problem.
Fixed at 1a187de

@bfiete bfiete closed this as completed Feb 1, 2025
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

2 participants