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

Static Initialization for Non-Byte Spans #3379

Open
ds5678 opened this issue Jan 23, 2025 · 0 comments · May be fixed by #3380
Open

Static Initialization for Non-Byte Spans #3379

ds5678 opened this issue Jan 23, 2025 · 0 comments · May be fixed by #3380
Labels
Bug Decompiler The decompiler engine itself

Comments

@ds5678
Copy link

ds5678 commented Jan 23, 2025

Input code

internal class Class
{
	public static ReadOnlySpan<int> Data => new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
}

Erroneous output

internal class Class
{
	public static ReadOnlySpan<int> Data => RuntimeHelpers.CreateSpan<int>((RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
}

Details

  • Product in use: ILSpy
  • Version in use: 9.0 (the latest release)
  • SDK: 9.0.200-preview.0.25057.12 (the latest preview of .NET 9)
  • I'm open to contributing a fix, but I may need some guidance on how it should be implemented into the codebase. I understand the IL side of things, but I'm unfamiliar with the structure of ILSpy.
@ds5678 ds5678 added Bug Decompiler The decompiler engine itself labels Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Decompiler The decompiler engine itself
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant