<div dir="ltr"><div class="markdown-here-wrapper" style=""><p style="margin:0px 0px 1.2em!important">That seems pretty close to Rust’s <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">derive</code>. Why not invent a similar syntax in Swift? Otherwise it will make us look through all the sources to make sure deriving is used.</p>
<pre style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px"><code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline;white-space:pre;overflow:auto;border-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block!important">enum Option: @derive Equatable {
    ...
}
</code></pre><p style="margin:0px 0px 1.2em!important">Also, we can get better looking compilation errors, like:</p>
<pre style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px"><code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline;white-space:pre;overflow:auto;border-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block!important">ERROR at line 1, col 14: could not derive Equatable for Option
enum Option: @derive Equatable {
             ^~~~~~~~~~~~~~~~~
</code></pre><div title="MDH:PGRpdiBjbGFzcz0iZ21haWxfZXh0cmEiPlRoYXQgc2VlbXMgcHJldHR5IGNsb3NlIHRvIFJ1c3Qn
cyBgZGVyaXZlYC4gV2h5IG5vdCBpbnZlbnQgYSBzaW1pbGFyIHN5bnRheCBpbiBTd2lmdD8gT3Ro
ZXJ3aXNlIGl0IHdpbGwgbWFrZSB1cyBsb29rI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