---
title: "Discussion on \"Decompiling yield return: how iterator blocks become state machines\" | Hashnode"
description: "Discussion on \"Decompiling yield return: how iterator blocks become state machines\". Some C# constructs compile to a single IL instruction. yield return compiles to an entire class. There is no \"yield\" opcode in the CLR, so when you write an iterator method, the compiler rewrites the"
url: "https://hashnode.com/posts/decompiling-yield-return-how-iterator-blocks-become-state-machines/6af32794d8636ec41a9f2885"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Decompiling yield return: how iterator blocks become state machines](https://delta1labs.hashnode.dev/decompiling-yield-return-how-iterator-blocks-become-state-machines?utm_source=hashnode&utm_medium=feed)

Some C# constructs compile to a single IL instruction. yield return compiles to an entire class. There is no "yield" opcode in the CLR, so when you write an iterator method, the compiler rewrites the

3d ago · 6 min read · delta1labs.hashnode.dev  
Updated 2h ago  
Read the article

-   [#decompilation](https://hashnode.com/tag/decompilation)
-   [#dotnet](https://hashnode.com/tag/dotnet)
-   [#deepdive](https://hashnode.com/tag/deepdive)

## Written by

[Zero Heartbeat](https://hashnode.com/@clustron)

@clustron

  
[View profile](https://hashnode.com/@clustron)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
