Skip to content

static Local Functions are not being emitted as static #38143

@333fred

Description

@333fred
using System;
public class C {
	static void M()
	{
  		static void localFunction() { }
        Action a = localFunction;
	}
}

Capturing the local function in an Action is causing it to be emitted as an instance function on an inner class, instead of being a static method.
https://sharplab.io/#v2:EYLgtghgzgLgpgJwDQxASwDZICYgNQA+AAgEwCMAsAFBEDMABKfQML0De1AkEWQGyMAWegFkAFAEouHKvXqdufQfQwB7AMYQMRAKww0KgHYT29AL7VZlyzxL0I9ALzL1mnXsMBuLuaqmgA==

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions