{"id":476490,"date":"2026-04-18T18:46:24","date_gmt":"2026-04-18T18:46:24","guid":{"rendered":"https:\/\/savepearlharbor.com\/?p=476490"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=476490","title":{"rendered":"DU \u043d\u0430\u00a0\u0434\u0438\u0435\u0442\u0435: \u0427\u0442\u043e\u00a0\u043d\u0435\u00a0\u0442\u0430\u043a \u0441\u00a0\u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f\u043c\u0438 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439 \u0432\u00a0C#?"},"content":{"rendered":"<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/8af\/4bc\/bce\/8af4bcbce1bd55f1d483182aeb3f1516.jpg\" width=\"2103\" height=\"1124\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/8af\/4bc\/bce\/8af4bcbce1bd55f1d483182aeb3f1516.jpg 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/8af\/4bc\/bce\/8af4bcbce1bd55f1d483182aeb3f1516.jpg 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0412\u00a0\u0436\u0438\u0437\u043d\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e C# \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430 \u0440\u0430\u043d\u043e \u0438\u043b\u0438\u00a0\u043f\u043e\u0437\u0434\u043d\u043e \u043d\u0430\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u043c\u043e\u043c\u0435\u043d\u0442, \u043a\u043e\u0433\u0434\u0430 <code>switch<\/code> \u043f\u043e <code>object<\/code> \u0438\u043b\u0438\u00a0\u0438\u0435\u0440\u0430\u0440\u0445\u0438\u044f \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442 \u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043a\u043e\u0441\u0442\u044b\u043b\u044f\u043c\u0438. \u0425\u043e\u0447\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u00ab\u043b\u0438\u0431\u043e \u0442\u043e,\u00a0\u043b\u0438\u0431\u043e \u0434\u0440\u0443\u0433\u043e\u0435\u00bb. \u0412\u00a0F# \u0438\u043b\u0438\u00a0Rust \u044d\u0442\u043e \u0431\u0430\u0437\u0430, \u0430\u00a0\u0432\u00a0C#\u00a0\u2014 \u0432\u0435\u0447\u043d\u043e\u0435 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0435.<\/p>\n<p>\u041f\u043e\u043a\u0430 Microsoft \u043e\u0431\u0435\u0449\u0430\u0435\u0442, \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e \u043f\u043b\u043e\u0434\u0438\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u041d\u043e\u00a0\u043f\u043e\u0447\u0435\u043c\u0443 \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435 \u043e\u043d\u0438\u00a0\u2014 \u044d\u0442\u043e\u00a0\u043b\u0438\u0431\u043e \u0443\u0434\u0430\u0440 \u043f\u043e\u00a0\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438,\u00a0\u043b\u0438\u0431\u043e \u043d\u0435\u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0435 \u043c\u0435\u0441\u0438\u0432\u043e? \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c\u0441\u044f, \u043a\u0430\u043a\u00a0\u0443\u0441\u0442\u0440\u043e\u0435\u043d\u044b DU \u043f\u043e\u0434\u00a0\u043a\u0430\u043f\u043e\u0442\u043e\u043c, \u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435\u00a0\u0441\u0442\u044b\u0434\u043d\u043e \u0437\u0430\u0441\u0443\u043d\u0443\u0442\u044c \u0432\u00a0\u0432\u044b\u0441\u043e\u043a\u043e\u043d\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0438\u043b\u0438\u00a0Unity\u2011\u0438\u0433\u0440\u0443.<\/p>\n<h2>\u0423\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e DU \u0432\u00a0\u0434\u0440\u0443\u0433\u0438\u0445 \u044f\u0437\u044b\u043a\u0430\u0445<\/h2>\n<h4>\u0421\u0438<\/h4>\n<p>\u041e\u0434\u043d\u0438\u043c \u0438\u0437\u00a0\u0441\u0430\u043c\u044b\u0445 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0431\u0435\u0437 \u00ab\u043d\u043e\u00bb \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0421\u0438. \u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u043c\u0435\u0435\u0442 \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e union, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u00a0\u043e\u0434\u0438\u043d \u0443\u0447\u0430\u0441\u0442\u043e\u043a \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0430\u043b\u043e\u0436\u0438\u0442\u044c \u0442\u0438\u043f\u044b. \u042d\u0442\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441\u00a0enum \u0438\u043b\u0438\u00a0int \u0442\u0435\u0433\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u0442\u044c, \u0447\u0442\u043e\u00a0\u043c\u044b \u0437\u0430\u043f\u0438\u0441\u0430\u043b\u0438. <\/p>\n<p>\u0422\u0430\u043a\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0430\u043c\u044b\u043c \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c, \u0432\u0435\u0434\u044c \u043e\u0432\u0435\u0440\u0445\u0435\u0434 \u0438\u0434\u0451\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u00a0\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0442\u0435\u0433\u0430, \u0430\u00a0\u0437\u0430\u043f\u0438\u0441\u044c \u0438 \u0447\u0442\u0435\u043d\u0438\u0435 \u0438\u0434\u0443\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u00a0\u043f\u0430\u043c\u044f\u0442\u0438<\/p>\n<p>\u041a\u043e\u0434 \u043d\u0438\u0436\u0435\u00a0\u2014 \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u043d\u0430\u00a0\u044f\u0437\u044b\u043a\u0435 \u0421\u0438<\/p>\n<pre><code class=\"cpp\">enum ShapeType { CIRCLE, RECT };struct Shape {    enum ShapeType kind;    union {        double radius;        struct { double w, h; } rect;    } data;};<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:87px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e\u00a0\u044d\u0442\u043e \u0441\u0430\u043c\u044b\u0439 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0438 \u0432\u00a0C# \u0442\u043e\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434, \u043d\u043e\u00a0\u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430: \u0412\u00a0\u0421\u0438 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c \u0434\u0440\u0443\u0433 \u043d\u0430\u00a0\u0434\u0440\u0443\u0433\u0430 \u043b\u044e\u0431\u044b\u0435 \u0442\u0438\u043f\u044b, \u0430\u00a0\u0432\u00a0C# \u0441\u0440\u0435\u0434\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0434\u043e\u043b\u0436\u043d\u0430 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0447\u0442\u043e\u00a0\u0441\u0441\u044b\u043b\u043e\u0447\u043d\u044b\u0439 \u0442\u0438\u043f \u043d\u0435\u00a0\u043d\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u00a0\u0437\u043d\u0430\u0447\u0438\u043c\u044b\u0439 \u0442\u0438\u043f, \u043f\u0440\u0438\u00a0\u043d\u0430\u0440\u0443\u0448\u0435\u043d\u0438\u0438 \u043e\u0448\u0438\u0431\u043a\u0430 <code>TypeLoadException<\/code> \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0435\u0442 \u043d\u0435\u00a0\u043d\u0430\u00a0\u044d\u0442\u0430\u043f\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438, \u0430\u00a0\u043f\u0440\u0438\u00a0\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0442\u0438\u043f\u0430.<\/p>\n<p>\u041a\u043e\u0434 \u043d\u0438\u0436\u0435 \u043d\u0430\u00a0C# \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u0442 \u043b\u043e\u0433\u0438\u043a\u0443 \u043a\u043e\u0434\u0430 \u043d\u0430\u00a0\u0421\u0438.<\/p>\n<pre><code class=\"cs\">public enum ShapeType : byte { Circle, Rect }[StructLayout(LayoutKind.Explicit)]public struct ShapeUnion{    [FieldOffset(0)] public ShapeType Kind;    [FieldOffset(1)] public double Radius;    [FieldOffset(1)] public (double Width, double Height) Rect;}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<h4>F#<\/h4>\n<p>\u0412\u00a0\u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043e\u043d\u0446\u0435\u043f\u0442\u0443\u0430\u043b\u044c\u043d\u043e \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432\u043e\u0437\u044c\u043c\u0451\u043c F#. \u0412\u00a0\u043d\u0451\u043c DU\u00a0\u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u0438\u043f\u043e\u0432. \u041f\u0440\u0438\u00a0\u044d\u0442\u043e\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442, \u0447\u0442\u043e\u00a0\u0434\u0440\u0443\u0433\u0438\u0445 \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u043e\u0432 \u0443\u00a0\u0442\u0438\u043f\u0430 \u043d\u0435\u0442. \u0423\u0434\u043e\u0431\u0441\u0442\u0432\u043e \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432\u00a0\u0442\u043e\u043c, \u0447\u0442\u043e\u00a0\u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0438\u043c\u0435\u044e\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>match<\/code> \u0438 <code>switch<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u0432\u0441\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043e\u043a.<\/p>\n<p>\u041d\u0438\u0436\u0435 \u043e\u0447\u0435\u043d\u044c \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u044b\u0439 \u043a\u043e\u0434 \u0434\u043b\u044f\u00a0\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f<\/p>\n<pre><code class=\"fsharp\">type Shape =    | Circle of radius: double    | Rect of width: double * height: double<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0445\u043e\u0440\u043e\u0448\u043e, \u043f\u043e\u0447\u0435\u043c\u0443\u00a0\u0431\u044b \u043d\u0435\u00a0\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e \u0432\u0441\u0435\u0433\u0434\u0430? \u0414\u0435\u043b\u043e \u0432\u00a0\u0442\u043e\u043c, \u0447\u0442\u043e\u00a0\u043a\u0430\u0436\u0434\u043e\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 \u0442\u0430\u043a\u043e\u0433\u043e \u0442\u0438\u043f\u0430\u00a0\u2014 \u044d\u0442\u043e \u0430\u043b\u043b\u043e\u043a\u0430\u0446\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0432\u00a0\u043a\u0443\u0447\u0435. \u0411\u0430\u043d\u0430\u043b\u044c\u043d\u043e \u044d\u0442\u043e \u043d\u0435\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e. \u0414\u043b\u044f\u00a0\u0441\u0444\u0435\u0440\u044b \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 (F#) \u044d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u0435\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u043d\u043e\u00a0\u0434\u043b\u044f\u00a0\u0442\u043e\u0433\u043e\u00a0\u0436\u0435 \u0432\u0435\u0431 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f (C#)\u00a0\u2014 \u044d\u0442\u043e\u00a0\u0431\u044b\u043b\u043e\u00a0\u0431\u044b \u043d\u0435\u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e.<\/p>\n<h2>\u0421\u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u0443\u0435\u043c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443<\/h2>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432\u00a0\u0442\u043e\u043c, \u0447\u0442\u043e\u00a0\u0434\u043b\u044f\u00a0C# \u043d\u0435\u0442 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435\u00a0\u0431\u044b \u043f\u043e\u0434\u043e\u0448\u043b\u043e \u0432\u0441\u0435\u043c.<\/p>\n<ul>\n<li>\n<p>\u041f\u043e\u0434\u0445\u043e\u0434 \u043a\u0430\u043a\u00a0\u0432\u00a0\u0421\u0438: \u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u0441\u0440\u0435\u0434\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0434\u0445\u043e\u0434 \u043a\u0430\u043a\u00a0\u0432\u00a0F#: \u041d\u0438\u0437\u043a\u0430\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c<\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u0430\u0438\u0432\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434, \u043f\u0440\u0438\u00a0\u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0442\u0435\u0433 \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b. \u041e\u043d \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <code>Composition<\/code>.<\/p>\n<pre><code class=\"cs\">public enum ShapeType : byte { Circle, Rect }public struct Shape{    public ShapeType tag;    public double radius;    public (double Width, double Height) Rect;}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u042f \u0434\u0443\u043c\u0430\u044e \u0432\u044b \u0443\u0436\u0435 \u043e\u0436\u0438\u0434\u0430\u0435\u0442\u0435, \u0447\u0442\u043e\u00a0\u0431\u0443\u0434\u0435\u0442 \u043a\u0430\u043a\u043e\u0439\u2011\u0442\u043e \u043f\u043e\u0434\u0432\u043e\u0445. \u041e\u043d \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432\u00a0\u0442\u043e\u043c, \u0447\u0442\u043e\u00a0\u0442\u0430\u043a\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0438\u043c\u0435\u0435\u0442 \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0438\u0439 \u0438\u0437\u00a0\u0432\u0441\u0435\u0445 \u0440\u0430\u0437\u043c\u0435\u0440, \u0432\u0435\u0434\u044c \u043c\u044b \u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u0443\u0435\u043c \u043c\u0435\u0441\u0442\u043e \u043f\u043e\u0434\u00a0\u043a\u0430\u0436\u0434\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u0430\u00a0\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043f\u043e\u00a0\u0444\u0430\u043a\u0442\u0443 \u0442\u043e\u043b\u044c\u043a\u043e 1. \u041a\u0430\u0437\u0430\u043b\u043e\u0441\u044c\u00a0\u0431\u044b,\u00a0\u043b\u0438\u0448\u043d\u0438\u0435 20\u00a0\u0431\u0430\u0439\u0442 \u043f\u043e\u0433\u043e\u0434\u044b \u043d\u0435\u00a0\u0441\u0434\u0435\u043b\u0430\u044e\u0442, \u043d\u043e\u00a0\u0442\u0430\u043a\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0441\u00a0\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c \u043e\u0431\u0440\u0435\u0447\u0435\u043d\u0430 \u043d\u0435\u00a0\u0432\u043b\u0430\u0437\u0438\u0442\u044c \u0432\u00a0\u043a\u044d\u0448\u2011\u043b\u0438\u043d\u0438\u044e \u0438 \u0438\u043c\u0435\u0442\u044c \u043e\u0432\u0435\u0440\u0445\u0435\u0434 \u043d\u0430\u00a0\u043e\u0431\u043d\u0443\u043b\u0435\u043d\u0438\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u043e\u043b\u044f.<\/p>\n<p>\u0423\u0436\u0435 \u043c\u043e\u0436\u043d\u043e\u00a0\u0431\u044b\u043b\u043e \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c, \u0447\u0442\u043e\u00a0\u0435\u0441\u0442\u044c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 3\u00a0\u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u0438 \u0438\u043d\u0430\u0447\u0435 \u043d\u0438\u043a\u0430\u043a, \u043d\u043e\u00a0\u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u0434\u043b\u044f\u00a0\u0434\u043e\u0441\u0442\u0438\u0436\u0435\u043d\u0438\u044f \u043d\u0443\u0436\u043d\u044b\u0445 \u0446\u0435\u043b\u0435\u0439.<\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u0443\u044e \u0438\u00a0\u0431\u044b\u0441\u0442\u0440\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0441\u00a0\u0442\u0430\u043a\u0438\u043c \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u043e\u043c:<\/p>\n<ul>\n<li>\n<p>\u0412\u0441\u0435 \u0437\u043d\u0430\u0447\u0438\u043c\u044b\u0435 \u0442\u0438\u043f\u044b \u043d\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u043c \u0434\u0440\u0443\u0433 \u043d\u0430\u00a0\u0434\u0440\u0443\u0433\u0430<\/p>\n<\/li>\n<li>\n<p>\u0412\u0441\u0435 \u0441\u0441\u044b\u043b\u043e\u0447\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u043a\u0430\u0441\u0442\u044f\u0442\u0441\u044f \u043a <code>object<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434\u00a0\u0431\u044b\u0441\u0442\u0440\u044b\u0439, \u043d\u043e\u00a0\u043f\u043e\u00a0\u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0435\u00a0\u0438\u0434\u0435\u0430\u043b\u0435\u043d, \u0445\u043e\u0442\u044f \u0432\u0441\u0451 \u0435\u0449\u0451 \u043b\u0443\u0447\u0448\u0435 \u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u0438.<\/p>\n<p>\u041d\u0435\u00a0\u0441\u043f\u0435\u0448\u0438\u0442\u0435. \u0412\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0432\u043e\u043f\u0440\u043e\u0441: \u043a\u0430\u043a\u00a0\u044d\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c? \u041d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434 \u0434\u043b\u044f\u00a0\u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0441\u043b\u0443\u0447\u0430\u044f \u043b\u0435\u0433\u043a\u043e, \u043d\u043e\u00a0\u0447\u0442\u043e\u00a0\u0434\u0435\u043b\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u043d\u0443\u0436\u0435\u043d \u0448\u0430\u0431\u043b\u043e\u043d? \u0422\u0443\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0442 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438, \u0432\u0435\u0434\u044c \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u043a\u0430\u043a\u0438\u0435 \u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f, \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0448\u0438\u0442\u044c, \u0433\u0434\u0435 \u0438 \u043a\u0430\u043a\u00a0\u0438\u0445 \u0445\u0440\u0430\u043d\u0438\u0442\u044c. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0442\u0438\u043f <code>T<\/code> \u043d\u0435\u043b\u044c\u0437\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u00a0\u044f\u0432\u043d\u043e\u043c \u0432\u0438\u0434\u0435, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0435\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u0435\u043d.<\/p>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432\u00a0\u0442\u043e\u043c, \u0447\u0442\u043e\u00a0\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430, \u0430\u00a0\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434 \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u043e\u0447\u0435\u043d\u044c \u0434\u043e\u043b\u0433\u043e, \u0442\u0430\u043a \u043a\u0430\u043a\u00a0\u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u0420\u0435\u0448\u0435\u043d\u0438\u0435\u00a0\u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>Source Generator<\/code>. \u041e\u043d \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u043d\u0430\u0431\u0438\u0440\u0430\u0435\u0442 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u044c, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u043e\u0436\u0435\u0442 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u043d\u0430\u0447\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c\u00a0\u0431\u044b \u043f\u0438\u0441\u0430\u0442\u044c \u0432\u0440\u0443\u0447\u043d\u0443\u044e. \u0412\u00a0\u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u044f \u043f\u043e\u043a\u0430\u0436\u0443 \u0441\u0432\u043e\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430.<\/p>\n<h2>\u041a\u0430\u043a\u0438\u0435 \u0435\u0441\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u043b\u044f\u00a0DU \u0441\u0435\u0439\u0447\u0430\u0441?<\/h2>\n<h3>\u0421\u0430\u043c\u043e\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u00a0\u2014 mcintyre321\u00a0OneOf<\/h3>\n<p><a href=\"https:\/\/github.com\/mcintyre321\/OneOf\" rel=\"noopener noreferrer nofollow\">(\u0413\u0438\u0442\u0445\u0430\u0431)<\/a> \u041e\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u0438, \u0442\u043e \u0435\u0441\u0442\u044c \u0432\u0441\u0435 \u0442\u0438\u043f\u044b \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u0440\u0443\u0433 \u0437\u0430\u00a0\u0434\u0440\u0443\u0433\u043e\u043c. \u042d\u0442\u043e \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0441\u0430\u043c\u044b\u0439 \u043b\u0435\u043d\u0438\u0432\u044b\u0439 \u0438 \u0441\u0430\u043c\u044b\u0439 \u043d\u0430\u0434\u0451\u0436\u043d\u044b\u0439 \u043f\u0443\u0442\u044c. \u0412\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441\u00a0\u0437\u0430\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0442\u0438\u043f\u0430\u043c\u0438 \u0438\u0434\u0451\u0442 \u0447\u0435\u0440\u0435\u0437 \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b <code>OneOf&lt;T0... T7&gt;<\/code> \u0441\u00a0\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u0434\u043e 8\u00a0\u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 (\u0434\u043e 32\u00a0\u0441\u00a0\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439\u2011\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u043c).<\/p>\n<p>\u0422\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u0435\u0439:<\/p>\n<pre><code class=\"cs\">public readonly struct OneOf&lt;T0, T1, T2&gt; : IOneOf{private readonly T0 _value0;private readonly T1 _value1;private readonly T2 _value2;private readonly int _index;...<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p><strong>\u041f\u043b\u044e\u0441\u044b:<\/strong><\/p>\n<ul>\n<li>\n<p>\u0418\u043c\u0435\u0435\u0442 \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>Match<\/code> \u0438 <code>Switch<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0431\u044f\u0437\u044b\u0432\u0430\u044e\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432\u0441\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b.<\/p>\n<\/li>\n<li>\n<p>\u0418\u043c\u0435\u044e\u0442\u0441\u044f \u0443\u0434\u043e\u0431\u043d\u044b\u0435 \u043a\u0430\u0441\u0442\u044b<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043a\u043e\u0434<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041c\u0438\u043d\u0443\u0441\u044b: <\/strong><\/p>\n<ul>\n<li>\n<p>\u0411\u043e\u043b\u044c\u0448\u043e\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435\u0442 \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u043b\u0435\u0439, \u0437\u043d\u0430\u0447\u0438\u0442 \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0442\u044c, \u0447\u0442\u043e\u00a0\u0437\u043d\u0430\u0447\u0438\u0442 <code>AsT0<\/code>\u00a0\u0438 \u0442.\u0434<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435\u00a0\u0441\u0430\u043c\u0430\u044f \u0432\u044b\u0441\u043e\u043a\u0430\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0432\u00a0\u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u0445 \u043f\u0443\u0441\u0442\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430, \u0442\u043e \u043e\u043d\u0430 \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u0437\u0430\u0439\u043c\u0451\u0442 \u0431\u0430\u0439\u0442<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435\u043b\u044c\u0437\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043a\u043e\u0434 (\u043a\u0440\u043e\u043c\u0435 \u043a\u0430\u043a\u00a0\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f\u043c\u0438)<\/p>\n<\/li>\n<\/ul>\n<p>\u0418\u0442\u043e\u0433: \u042d\u0442\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0441\u0435\u0439\u0447\u0430\u0441 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 \u0434\u043b\u044f\u00a0\u0442\u0435\u0445, \u043a\u0442\u043e \u043d\u0435\u00a0\u0445\u043e\u0447\u0435\u0442 \u0441\u0438\u043b\u044c\u043d\u043e \u0437\u0430\u043c\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f, \u043e\u043d\u0430 \u0434\u0430\u0451\u0442 \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0438 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f\u00a0\u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430\u00a0\u0431\u044b\u0442\u043e\u0432\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u0445\u043e\u0442\u044f \u043c\u0438\u043d\u0443\u0441\u044b \u0442\u043e\u0436\u0435 \u0435\u0441\u0442\u044c. \u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0438\u043c\u0435\u043d\u043d\u044b\u0445 \u043f\u043e\u043b\u0435\u0439 \u043e\u0447\u0435\u043d\u044c \u0441\u0438\u043b\u044c\u043d\u043e \u0431\u044c\u0451\u0442 \u043f\u043e\u00a0\u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u0438 \u043a\u043e\u0434\u0430<\/p>\n<h3>\u0411\u043e\u043b\u0435\u0435 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u00a0\u2014 domn1995\u00a0DuNet<\/h3>\n<p><a href=\"https:\/\/github.com\/domn1995\/dunet\" rel=\"noopener noreferrer nofollow\">(\u0413\u0438\u0442\u0445\u0430\u0431)<\/a> \u041e\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 <code>record<\/code> \u0442\u0438\u043f\u044b \u0438 \u0447\u0435\u0440\u0435\u0437 <code>Source Generator<\/code> \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u043c\u0435\u0442\u043e\u0434\u044b. \u0417\u0434\u0435\u0441\u044c \u0434\u043b\u044f\u00a0\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u0445\u043e\u0434 \u043a\u0430\u043a\u00a0\u0432\u00a0F#, \u0442\u043e \u0435\u0441\u0442\u044c \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435. \u0413\u043b\u0430\u0432\u043d\u0430\u044f \u0444\u0438\u0448\u043a\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438\u00a0\u2014 \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441.<\/p>\n<p>\u041e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435:<\/p>\n<pre><code class=\"cs\">[Union]partial record Shape{    partial record Circle(double Radius);    partial record Rectangle(double Length, double Width);    partial record Triangle(double Base, double Height);}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p><strong>\u041f\u043b\u044e\u0441\u044b:<\/strong><\/p>\n<ul>\n<li>\n<p>\u041a\u0440\u0430\u0441\u0438\u0432\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441<\/p>\n<\/li>\n<li>\n<p>\u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u0434 \u0441\u00a0\u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u044b\u043c\u0438 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f\u043c\u0438<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 Json \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041c\u0438\u043d\u0443\u0441\u044b:<\/strong><\/p>\n<ul>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u00a0\u2014 \u0432\u0441\u0435\u0433\u0434\u0430 \u0430\u043b\u043b\u043e\u043a\u0430\u0446\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435\u043b\u044c\u0437\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0435 \u0442\u0438\u043f\u044b, \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0432\u043d\u0443\u0442\u0440\u0438<\/p>\n<\/li>\n<li>\n<p>\u041d\u0438\u0437\u043a\u0430\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c<\/p>\n<\/li>\n<\/ul>\n<p>\u0418\u0442\u043e\u0433: \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f\u00a0\u0442\u0435\u0445, \u043a\u043e\u043c\u0443 \u043a\u0440\u0430\u0441\u043e\u0442\u0430 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 \u043f\u0440\u0435\u0432\u044b\u0448\u0435 \u0432\u0441\u0435\u0433\u043e, \u043f\u043e\u0434\u043e\u0439\u0434\u0451\u0442 \u0434\u043b\u044f\u00a0\u043d\u0435\u043d\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439.<\/p>\n<h2>\u0410\u00a0\u0447\u0442\u043e \u043e\u0431\u0435\u0449\u0430\u044e\u0442 \u0432\u00a0\u0441\u0430\u043c\u043e\u043c C#?<\/h2>\n<p>\u0423\u0436\u0435 \u043c\u043d\u043e\u0433\u043e \u043b\u0435\u0442 Microsoft \u043e\u0431\u0435\u0449\u0430\u044e\u0442 \u0432\u0432\u0435\u0441\u0442\u0438 DU \u0432\u00a0\u0441\u0430\u043c \u044f\u0437\u044b\u043a. \u0418 \u0432\u043f\u0440\u0430\u0432\u0434\u0443, \u0432\u00a0\u0442\u043e\u043c\u00a0\u0436\u0435 F# \u043e\u043d\u0438\u00a0\u0431\u044b\u043b\u0438 \u0441\u00a0\u0441\u0430\u043c\u043e\u0433\u043e \u043d\u0430\u0447\u0430\u043b\u0430.<\/p>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f:<\/p>\n<pre><code class=\"cs\">public record class Circle(double Radius);public record class Rectangle((double Weight, double Height) Rect);public union Pet(Circle, Rectangle);<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0442\u043e\u00a0\u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435, \u0447\u0442\u043e\u00a0\u0438 \u0432\u00a0F#, \u043d\u043e\u00a0\u0435\u0441\u0442\u044c \u0448\u0430\u043d\u0441, \u0447\u0442\u043e\u00a0\u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u0434\u0445\u043e\u0434 \u0441\u00a0\u043d\u0430\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0442\u0430\u043c, \u0433\u0434\u0435 \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043e\u0431\u0435\u0449\u0430\u044e\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u044b\u0435 \u0441\u043e\u044e\u0437\u044b<\/p>\n<pre><code class=\"cs\">public (int | string) GetValue() ...<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041d\u0430\u00a0\u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u044d\u0442\u043e\u0433\u043e\u00a0\u0431\u044b \u0445\u0432\u0430\u0442\u0430\u043b\u043e \u0432\u00a0\u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u0430\u00a0\u0433\u043b\u0430\u0432\u043d\u043e\u0435\u00a0\u2014 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0438\u0437\u0430\u0446\u0438\u044f: \u0430\u0432\u0442\u043e\u0440\u044b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442\u00a0\u0436\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f\u00a0DU.<\/p>\n<h4>\u0412\u00a0\u0447\u0451\u043c\u00a0\u0436\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430?<\/h4>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432\u00a0\u0442\u043e\u043c, \u0447\u0442\u043e\u00a0\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439 \u0431\u0443\u0434\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441\u00a0\u0432\u0435\u0440\u0441\u0438\u0438 \u043d\u0430\u00a0\u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043e\u043d\u0438 \u0432\u044b\u0448\u043b\u0438. \u042d\u0442\u043e \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043e\u0442\u0440\u0435\u0437\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0430\u0443\u0434\u0438\u0442\u043e\u0440\u0438\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u0432\u0438\u0436\u043a\u0430 Unity (\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u00a0\u0441\u0438\u0445 \u043f\u043e\u0440 \u043d\u0430 <code>.netstandart 2.1<\/code>) \u0438\u043b\u0438\u00a0\u043c\u043d\u043e\u0433\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u0441\u0442\u0430\u0440\u044b\u0435 \u0440\u0430\u043d\u0442\u0430\u0439\u043c\u044b. \u0414\u043b\u044f\u00a0\u043f\u0440\u043e\u0441\u0442\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u0432\u044b\u0433\u043e\u0434\u043d\u043e \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0432\u0435\u0434\u044c \u0438\u043c \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0442\u044c\u0441\u044f\u00a0\u043b\u0438\u0448\u044c \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u044f\u0437\u044b\u043a\u0430.<\/p>\n<h2>\u0421\u043e\u0437\u0434\u0430\u0451\u043c \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434<\/h2>\n<p>\u041b\u043e\u0433\u0438\u0447\u043d\u044b\u043c \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a\u00a0\u0437\u0430\u0431\u0440\u0430\u043a\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442\u044c \u0441\u0432\u043e\u0451.<\/p>\n<p>\u041a\u0430\u043a\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043d\u0443\u0436\u043d\u043e \u0440\u0435\u0448\u0438\u0442\u044c?<\/p>\n<ul>\n<li>\n<p>\u041d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u044b\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0442\u0438\u043f\u043e\u0432, \u0447\u0442\u043e\u00a0\u0443\u043b\u0443\u0447\u0448\u0438\u0442 \u0447\u0442\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u0430<\/p>\n<\/li>\n<li>\n<p>\u041d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u0430\u043c\u043e\u043c\u0443 \u0434\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u0432 Json \u0438 MemoryPack<\/p>\n<\/li>\n<li>\n<p>\u0414\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0440\u0435\u0448\u0430\u0442\u044c, \u043a\u0430\u043a\u00a0\u043a\u043e\u043c\u043f\u043e\u043d\u043e\u0432\u0430\u0442\u044c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0432\u00a0\u043f\u0430\u043c\u044f\u0442\u0438<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435\u00a0\u0432\u044b\u0434\u0435\u043b\u044f\u0442\u044c \u043c\u0435\u0441\u0442\u043e \u043f\u043e\u0434\u00a0\u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0431\u0435\u0437\u00a0\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f (Void \u0442\u0438\u043f\u044b)<\/p>\n<\/li>\n<li>\n<p>\u041e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u0445\u043e\u0440\u043e\u0448\u0443\u044e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c<\/p>\n<\/li>\n<li>\n<p>\u0421\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0438\u043d\u0441\u043f\u0435\u043a\u0442\u043e\u0440\u0430 Unity<\/p>\n<\/li>\n<li>\n<p>\u0421\u0434\u0435\u043b\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e \u0441\u00a0\u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u044f\u0437\u044b\u043a\u0430<\/p>\n<\/li>\n<li>\n<p>\u041c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u0435\u0437\u00a0\u0440\u0435\u0444\u043b\u0435\u043a\u0441\u0438\u0438<\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u043f\u0438\u0441\u043e\u043a \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c \u043f\u043e\u2011\u043f\u043e\u0440\u044f\u0434\u043a\u0443<\/p>\n<h4>\u041a\u0430\u043a\u00a0\u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0442\u0438\u043f?<\/h4>\n<p>\u0422.\u043a \u044d\u0442\u043e <code>SourceGenerator<\/code>, \u0432\u0441\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u0430\u0442\u0440\u0438\u0431\u0443\u0442, \u0430\u00a0\u0442\u0438\u043f\u044b \u0447\u0435\u0440\u0435\u0437 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441.<\/p>\n<p>\u0412\u00a0\u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0442\u043e\u043c \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"cs\">[GenerateOneOf([\"Number\", \"Text\"], AllowEmpty: false, OneOfLayoutKind.Auto, KindPosition.After, KindSize.Int, GenerateInfo: true)]public readonly partial struct Numeric : IOneOf&lt;double, string&gt;<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<h4>\u0412\u044b\u0431\u043e\u0440 \u043b\u0430\u044f\u0443\u0442\u0430<\/h4>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a\u00a0\u0432\u00a0\u043d\u0430\u0447\u0430\u043b\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u044b \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u0438, \u0447\u0442\u043e\u00a0\u043d\u0435\u0442 \u043b\u0443\u0447\u0448\u0435\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u0434\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0432\u044b\u0431\u043e\u0440 \u0438\u043b\u0438\u00a0\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0440\u0435\u0448\u0438\u0442\u044c \u0437\u0430\u00a0\u043d\u0435\u0433\u043e, \u043a\u0430\u043a\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043a\u043e\u043c\u043e\u043f\u043e\u043d\u043e\u0432\u043a\u0438 \u043f\u043e\u043b\u0435\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c.<\/p>\n<p>\u042f \u0432\u044b\u0434\u0435\u043b\u0438\u043b 4\u00a0\u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043a\u0440\u044b\u0432\u0430\u044e\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438:<\/p>\n<ul>\n<li>\n<p><code>ExplicitUnion<\/code>\u00a0\u2014 \u0432\u0441\u0435 \u0437\u043d\u0430\u0447\u0438\u043c\u044b\u0435 \u0442\u0438\u043f\u044b \u043d\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0434\u0440\u0443\u0433 \u043d\u0430\u00a0\u0434\u0440\u0443\u0433\u0430, \u0430\u00a0\u0441\u0441\u044b\u043b\u043e\u0447\u043d\u044b\u0435 \u043a\u0430\u0441\u0442\u044f\u0442\u0441\u044f \u043a\u00a0object. \u041a\u00a0\u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e \u0441\u043f\u043e\u0441\u043e\u0431 \u043d\u0435\u00a0\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0434\u043b\u044f\u00a0\u0433\u0435\u043d\u0435\u0440\u0438\u043a\u043e\u0432 (\u0432\u0435\u0434\u044c \u0438\u0445 \u043d\u0435\u043b\u044c\u0437\u044f \u043d\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c)<\/p>\n<\/li>\n<li>\n<p><code>Boxing<\/code>\u00a0\u2014 \u0432\u043e\u043e\u0431\u0449\u0435 \u043b\u044e\u0431\u044b\u0435 \u0442\u0438\u043f\u044b \u043a\u0430\u0441\u0442\u0438\u043c \u043a\u00a0object. \u0435\u0441\u043b\u0438 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0432\u0441\u0435 \u0441\u0441\u044b\u043b\u043e\u0447\u043d\u044b\u0435, \u0442\u043e \u043e\u0432\u0435\u0440\u0445\u0435\u0434\u0430 \u043d\u0435\u0442, \u0438\u043d\u0430\u0447\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b \u0430\u043b\u043b\u043e\u043a\u0430\u0446\u0438\u0438<\/p>\n<\/li>\n<li>\n<p><code>Composition<\/code>\u00a0\u2014 \u0432\u0441\u0435 \u0442\u0438\u043f\u044b \u0445\u0440\u0430\u043d\u0438\u043c \u0434\u0440\u0443\u0433 \u0437\u0430\u00a0\u0434\u0440\u0443\u0433\u043e\u043c. \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432\u0441\u0435\u0433\u0434\u0430 \u0438 \u0441\u043e \u0432\u0441\u0435\u043c<\/p>\n<\/li>\n<li>\n<p><code>Hybrid<\/code>\u00a0\u2014 \u0432\u0441\u0435 \u0437\u043d\u0430\u0447\u0438\u043c\u044b\u0435 \u0442\u0438\u043f\u044b \u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u043a\u0438 \u0445\u0440\u0430\u043d\u0438\u043c \u0434\u0440\u0443\u0433 \u0437\u0430\u00a0\u0434\u0440\u0443\u0433\u043e\u043c, \u0430\u00a0\u0441\u0441\u044b\u043b\u043e\u0447\u043d\u044b\u0435 \u043a\u0430\u0441\u0442\u0438\u043c \u043a\u00a0object<\/p>\n<\/li>\n<\/ul>\n<h4>Void \u0442\u0438\u043f\u044b<\/h4>\n<p>\u0427\u0430\u0441\u0442\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0442\u0430\u043a\u0430\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f, \u043a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0438\u043c\u0435\u0442\u044c \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435\u00a0\u043d\u0435\u0441\u0451\u0442 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438, \u0434\u043b\u044f\u00a0\u044d\u0442\u043e\u0433\u043e \u043f\u0443\u0441\u0442\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043c\u0435\u0442\u0438\u0442\u044c <code>[VoidType]<\/code>. \u0434\u043b\u044f\u00a0\u0442\u0430\u043a\u0438\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u043d\u0435\u00a0\u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043c\u0435\u0441\u0442\u043e \u0432\u00a0\u043f\u0430\u043c\u044f\u0442\u0438, \u0430\u00a0\u0432\u0441\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 <code>default<\/code>.<\/p>\n<h4>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 (X\u00a0\u2014 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u043b\u044f)<\/h4>\n<ul>\n<li>\n<p><code>Switch<\/code>\u00a0\u2014 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432\u0441\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0431\u0435\u0437\u00a0\u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f<\/p>\n<\/li>\n<li>\n<p><code>Match<\/code>\u00a0\u2014 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432\u0441\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0441\u00a0\u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043e\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f<\/p>\n<\/li>\n<li>\n<p><code>TryGet<img decoding=\"async\" class=\"formula inline\" source=\"X\" alt=\"X\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/0\/02\/021\/02129bb861061d1a052c592e2dc6b383.svg\" width=\"12\" height=\"12\" data-width=\"1.928\" data-height=\"1.545\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/0\/02\/021\/02129bb861061d1a052c592e2dc6b383.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/0\/02\/021\/02129bb861061d1a052c592e2dc6b383.svg 781w\" loading=\"lazy\" decode=\"async\"\/><\/code> \/ <code>TryPick<img decoding=\"async\" class=\"formula inline\" source=\"X\" alt=\"X\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/0\/02\/021\/02129bb861061d1a052c592e2dc6b383.svg\" width=\"12\" height=\"12\" data-width=\"1.928\" data-height=\"1.545\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/0\/02\/021\/02129bb861061d1a052c592e2dc6b383.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/0\/02\/021\/02129bb861061d1a052c592e2dc6b383.svg 781w\" loading=\"lazy\" decode=\"async\"\/><\/code>\u00a0\u2014 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435<\/p>\n<\/li>\n<li>\n<p><code><img decoding=\"async\" class=\"formula inline\" source=\"X\" alt=\"X\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/0\/02\/021\/02129bb861061d1a052c592e2dc6b383.svg\" width=\"12\" height=\"12\" data-width=\"1.928\" data-height=\"1.545\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/0\/02\/021\/02129bb861061d1a052c592e2dc6b383.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/0\/02\/021\/02129bb861061d1a052c592e2dc6b383.svg 781w\" loading=\"lazy\" decode=\"async\"\/><\/code>\/ <code><img decoding=\"async\" class=\"formula inline\" source=\"X\" alt=\"X\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/0\/02\/021\/02129bb861061d1a052c592e2dc6b383.svg\" width=\"12\" height=\"12\" data-width=\"1.928\" data-height=\"1.545\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/0\/02\/021\/02129bb861061d1a052c592e2dc6b383.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/0\/02\/021\/02129bb861061d1a052c592e2dc6b383.svg 781w\" loading=\"lazy\" decode=\"async\"\/>OrDefault<\/code>\u00a0\u2014 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0434\u043b\u044f\u00a0\u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f<\/p>\n<\/li>\n<li>\n<p><code>Deconstruct<\/code>, <code>ToString<\/code>, <code>GetHashCode<\/code> \u0438 \u043c\u043d\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0434\u043b\u044f\u00a0\u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430<\/p>\n<\/li>\n<\/ul>\n<h4>\u041c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435<\/h4>\n<p>\u042f \u0441\u0434\u0435\u043b\u0430\u043b, \u0447\u0442\u043e\u0431\u044b \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043f\u043e\u00a0\u0436\u0435\u043b\u0430\u043d\u0438\u044e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043b\u0430\u0441\u0441 \u0441\u00a0\u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043e\u00a0\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 (\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0442\u0438\u043f\u044b, \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0438 \u0442.\u0434)<\/p>\n<h4>\u0421\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u044b<\/h4>\n<p>\u0423\u00a0\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u043d\u0435\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u0432. \u042f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 <code>Newtonsoft.Json<\/code>, <code>System.Text.Json<\/code> \u0438 <code>MemoryPack<\/code>. \u0414\u043b\u044f\u00a0\u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0432\u0435\u0441\u0438\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b<\/p>\n<p>\u0421\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u044b \u0434\u043b\u044f\u00a0Json \u043d\u0435\u00a0\u0441\u043e\u0437\u0434\u0430\u044e\u0442 \u043a\u0443\u0447\u0443\u00a0\u043b\u0438\u0448\u043d\u0438\u0445 \u043f\u043e\u043b\u0435\u0439, \u0430\u00a0\u043b\u0438\u0448\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0443\u0436\u043d\u044b\u0435, \u0430\u00a0MemoryPack \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0432\u0441\u0451 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u043e<\/p>\n<h4>Unity<\/h4>\n<p>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0438\u043d\u0441\u043f\u0435\u043a\u0442\u043e\u0440\u0430 unity\u00a0\u2014 \u0442\u0430 \u0435\u0449\u0451 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u044e\u043d\u0438\u0442\u0438 \u043d\u0435 \u0443\u043c\u0435\u0435\u0442 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b. \u041f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0431\u0451\u0440\u0442\u043a\u0443 \u0441\u00a0\u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u0439 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u043e\u0439, \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043d\u0430\u0442\u0438\u0432\u043d\u043e.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/1b0\/f0a\/589\/1b0f0a589ebf39d2b3b4f743b8d5030f.png\" alt=\"\u0412\u044b\u0431\u0440\u0430\u043d \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0441\u0442\u0440\u043e\u043a\u0438\" title=\"\u0412\u044b\u0431\u0440\u0430\u043d \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0441\u0442\u0440\u043e\u043a\u0438\" width=\"449\" height=\"69\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/1b0\/f0a\/589\/1b0f0a589ebf39d2b3b4f743b8d5030f.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/1b0\/f0a\/589\/1b0f0a589ebf39d2b3b4f743b8d5030f.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u0412\u044b\u0431\u0440\u0430\u043d \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0441\u0442\u0440\u043e\u043a\u0438<\/figcaption><\/div>\n<\/figure>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d4f\/436\/a84\/d4f436a84fa4cebf8a69c93d771dd2af.png\" alt=\"\u0412\u044b\u0431\u0440\u0430\u043d \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0447\u0438\u0441\u043b\u0430\" title=\"\u0412\u044b\u0431\u0440\u0430\u043d \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0447\u0438\u0441\u043b\u0430\" width=\"449\" height=\"66\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/d4f\/436\/a84\/d4f436a84fa4cebf8a69c93d771dd2af.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d4f\/436\/a84\/d4f436a84fa4cebf8a69c93d771dd2af.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u0412\u044b\u0431\u0440\u0430\u043d \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0447\u0438\u0441\u043b\u0430<\/figcaption><\/div>\n<\/figure>\n<h4>\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c<\/h4>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <code>ExplicitUnion<\/code> \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043f\u043e\u00a0\u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441\u00a0mcintyre321\u00a0OneOf \u043d\u0430 <strong>15%<\/strong>. Match \u0441\u0442\u0430\u043b\u00a0\u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u043d\u0430 <strong>4%<\/strong>, \u0430\u00a0\u0440\u0443\u0447\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u0431\u043e\u0440 \u0447\u0435\u0440\u0435\u0437 <code>switch<\/code> \u043d\u0430\u00a0\u0432\u0441\u0435 <strong>9%<\/strong>. \u0414\u043b\u044f\u00a0\u0442\u0430\u043a\u043e\u0439 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0434\u0430\u0436\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u043e\u0432 \u043f\u0440\u0438\u0440\u043e\u0441\u0442\u0430 \u043a\u043e\u043b\u043e\u0441\u0430\u043b\u044c\u043d\u044b<\/p>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ae5\/2ab\/f9e\/ae52abf9efe351d5f67e1ae212d99d73.png\" alt=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0430 (Guid, long, int)\" title=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0430 (Guid, long, int)\" width=\"944\" height=\"336\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/ae5\/2ab\/f9e\/ae52abf9efe351d5f67e1ae212d99d73.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ae5\/2ab\/f9e\/ae52abf9efe351d5f67e1ae212d99d73.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0430 (Guid, long, int)<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u043e\u043a\u0430 \u0447\u0442\u043e\u00a0\u043b\u0443\u0447\u0448\u0435 OneOf \u0442\u043e\u043b\u044c\u043a\u043e ExplicitUnion. Composition \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043d\u0430\u00a0\u043e\u0434\u043d\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u0441\u00a0OneOf.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430 \u043c\u043e\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0441\u0435\u0442\u0438\u0442\u044c GitHub \u0438 \u043f\u043e\u043c\u043e\u0447\u044c \u043f\u0440\u043e\u0435\u043a\u0442\u0443: <a href=\"https:\/\/github.com\/SashaGonch228\/DotPointers.OneOf\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/SashaGonch228\/DotPointers.OneOf<\/a>.<\/p>\n<p>\u042f \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u044e \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0434\u043e\u0431\u0430\u0432\u043b\u044e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 protobuf, EfCore, MessagePack \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u0432, \u0430\u00a0\u0442\u0430\u043a\u0436\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u044e \u043a\u043e\u0434.<\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0431\u043e\u0442\u044b \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"cs\">[GenerateOneOf([\"Single\", \"Between\", \"All\", \"None\"], false)]public readonly partial struct Range : IOneOf&lt;int, (int, int), All, None&gt;{[MethodImpl(MethodImplOptions.AggressiveInlining)]public bool InRange(int value) =&gt; Match(single =&gt; value == single,between =&gt; value &gt;= between.Item1 &amp;&amp; value &lt;= between.Item2,all =&gt; true,none =&gt; false);}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"cs\">\/\/ &lt;auto-generated\/&gt; by OneOfGenerator\/\/ Layout: ExplicitUnion because Auto: Multiple structures detected, using union to save space#nullable enableusing System;using System.Linq;using System.Collections;using System.Collections.Generic;using System.Runtime.InteropServices;using System.Runtime.CompilerServices;using System.Diagnostics;using System.Diagnostics.CodeAnalysis;using System.Threading.Tasks;using DotPointers;using DotPointers.OneOf;namespace DotPointers.OneOf.Types{\/\/\/ &lt;summary&gt;\/\/\/ Discriminated union [(int: \"Single\"), ((int, int): \"Between\"), (All: \"All\"), (None: \"None\")]\/\/\/ &lt;\/summary&gt;[DebuggerDisplay(\"{DebuggerDisplay,nq}\")][CompilerGenerated]partial struct Range : IEquatable&lt;Range&gt;, IOneOfMetadata{[StructLayout(LayoutKind.Explicit)]internal struct __DataUnion_Range{[FieldOffset(0)] public int _v0;[FieldOffset(0)] public (int, int) _v1;}#pragma warning disable CS0649private readonly __DataUnion_Range _data;#pragma warning restore CS0649private readonly OneOfRange _kind;#pragma warning disable CS8618\/\/\/ &lt;summary&gt;\/\/\/ Internal constructor. Initializes the union with the specified kind and underlying data structure according to the determined layout.\/\/\/ &lt;\/summary&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]private Range(OneOfRange kind, __DataUnion_Range data){Unsafe.SkipInit(out this);this._kind = kind;this._data = data;}\/\/\/ &lt;summary&gt;\/\/\/ Initializes an empty instance of the union. Throws an exception since this union does not allow empty states.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;exception cref=\"InvalidOperationException\"&gt;Always thrown.&lt;\/exception&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public Range(){Unsafe.SkipInit(out this);OneOfThrowHelper.ThrowEmpty(nameof(Range));}\/\/\/ &lt;summary&gt;\/\/\/ Initializes a new instance of Range with a value of type &lt;see cref=\"int\" \/&gt;.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;param name=\"value\"&gt;The initial value.&lt;\/param&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public Range(int value){Unsafe.SkipInit(out this);global::System.Runtime.CompilerServices.Unsafe.SkipInit(out this._data);this._data._v0 = value;this._kind = OneOfRange.Single;}\/\/\/ &lt;summary&gt;\/\/\/ Initializes a new instance of Range with a value of type &lt;see cref=\"(int, int)\" \/&gt;.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;param name=\"value\"&gt;The initial value.&lt;\/param&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public Range((int, int) value){Unsafe.SkipInit(out this);global::System.Runtime.CompilerServices.Unsafe.SkipInit(out this._data);this._data._v1 = value;this._kind = OneOfRange.Between;}\/\/\/ &lt;summary&gt;\/\/\/ Initializes a new instance of Range with a value of type &lt;see cref=\"global::DotPointers.OneOf.All\" \/&gt;.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;param name=\"value\"&gt;The initial value.&lt;\/param&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public Range(global::DotPointers.OneOf.All value){Unsafe.SkipInit(out this);this._kind = OneOfRange.All;}\/\/\/ &lt;summary&gt;\/\/\/ Initializes a new instance of Range with a value of type &lt;see cref=\"global::DotPointers.OneOf.None\" \/&gt;.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;param name=\"value\"&gt;The initial value.&lt;\/param&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public Range(global::DotPointers.OneOf.None value){Unsafe.SkipInit(out this);this._kind = OneOfRange.None;}#pragma warning restore CS8618\/\/\/ &lt;summary&gt;\/\/\/ Creates a new instance of Range from a value of type &lt;see cref=\"int\" \/&gt;.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;param name=\"obj\"&gt;The value to wrap.&lt;\/param&gt;\/\/\/ &lt;returns&gt;A new Range instance.&lt;\/returns&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public static Range FromSingle(int obj) =&gt; new(obj);\/\/\/ &lt;summary&gt;\/\/\/ Creates a new instance of Range from a value of type &lt;see cref=\"(int, int)\" \/&gt;.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;param name=\"obj\"&gt;The value to wrap.&lt;\/param&gt;\/\/\/ &lt;returns&gt;A new Range instance.&lt;\/returns&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public static Range FromBetween((int, int) obj) =&gt; new(obj);\/\/\/ &lt;summary&gt;\/\/\/ Creates a new instance of Range representing the &lt;see cref=\"All\" \/&gt; state.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;returns&gt;A new Range instance.&lt;\/returns&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public static Range FromAll() =&gt; new(default(global::DotPointers.OneOf.All));\/\/\/ &lt;summary&gt;\/\/\/ Creates a new instance of Range representing the &lt;see cref=\"None\" \/&gt; state.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;returns&gt;A new Range instance.&lt;\/returns&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public static Range FromNone() =&gt; new(default(global::DotPointers.OneOf.None));private readonly int SingleForce =&gt; _data._v0;private readonly (int, int) BetweenForce =&gt; _data._v1;private readonly global::DotPointers.OneOf.All AllForce =&gt; default(global::DotPointers.OneOf.All);private readonly global::DotPointers.OneOf.None NoneForce =&gt; default(global::DotPointers.OneOf.None);\/\/\/ &lt;summary&gt;\/\/\/ Gets the kind of the current value.\/\/\/ &lt;\/summary&gt;public readonly OneOfRange Kind =&gt; _kind;\/\/\/ &lt;summary&gt;\/\/\/ Gets the integer index of the current kind.\/\/\/ &lt;\/summary&gt;public readonly int Index =&gt; (int)_kind;\/\/\/ &lt;summary&gt;\/\/\/ Gets the boxed value of the current instance.\/\/\/ &lt;\/summary&gt;public readonly object? BoxValue =&gt; _kind switch{OneOfRange.Single =&gt; (object?)SingleForce,OneOfRange.Between =&gt; (object?)BetweenForce,OneOfRange.All =&gt; (object?)AllForce,OneOfRange.None =&gt; (object?)NoneForce,_ =&gt; null,};\/\/\/ &lt;summary&gt;\/\/\/ Gets the value of the &lt;see cref=\"Single\" \/&gt; member.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;returns&gt;The value of the &lt;see cref=\"Single\" \/&gt; member.&lt;\/returns&gt;\/\/\/ &lt;exception cref=\"InvalidOperationException\"&gt;Thrown if the union instance does not currently hold the &lt;see cref=\"Single\" \/&gt; type.&lt;\/exception&gt;public readonly int Single{[MethodImpl(MethodImplOptions.AggressiveInlining)]get{if (_kind != OneOfRange.Single){OneOfThrowHelper.ThrowInvalid&lt;OneOfRange&gt;(0, (int)_kind);}return _data._v0;}}\/\/\/ &lt;summary&gt;\/\/\/ Gets the value of the &lt;see cref=\"Single\" \/&gt; member, or the default value if the union does not hold this type.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;returns&gt;The value of the &lt;see cref=\"Single\" \/&gt; member, or default.&lt;\/returns&gt;public readonly int? SingleOrDefault =&gt; _kind == OneOfRange.Single ? _data._v0: default;\/\/\/ &lt;summary&gt;\/\/\/ Gets the value of the &lt;see cref=\"Between\" \/&gt; member.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;returns&gt;The value of the &lt;see cref=\"Between\" \/&gt; member.&lt;\/returns&gt;\/\/\/ &lt;exception cref=\"InvalidOperationException\"&gt;Thrown if the union instance does not currently hold the &lt;see cref=\"Between\" \/&gt; type.&lt;\/exception&gt;public readonly (int, int) Between{[MethodImpl(MethodImplOptions.AggressiveInlining)]get{if (_kind != OneOfRange.Between){OneOfThrowHelper.ThrowInvalid&lt;OneOfRange&gt;(1, (int)_kind);}return _data._v1;}}\/\/\/ &lt;summary&gt;\/\/\/ Gets the value of the &lt;see cref=\"Between\" \/&gt; member, or the default value if the union does not hold this type.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;returns&gt;The value of the &lt;see cref=\"Between\" \/&gt; member, or default.&lt;\/returns&gt;public readonly (int, int)? BetweenOrDefault =&gt; _kind == OneOfRange.Between ? _data._v1: default;\/\/\/ &lt;summary&gt;\/\/\/ Gets the value of the &lt;see cref=\"All\" \/&gt; member.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;returns&gt;The value of the &lt;see cref=\"All\" \/&gt; member.&lt;\/returns&gt;\/\/\/ &lt;exception cref=\"InvalidOperationException\"&gt;Thrown if the union instance does not currently hold the &lt;see cref=\"All\" \/&gt; type.&lt;\/exception&gt;public readonly global::DotPointers.OneOf.All All{[MethodImpl(MethodImplOptions.AggressiveInlining)]get{if (_kind != OneOfRange.All){OneOfThrowHelper.ThrowInvalid&lt;OneOfRange&gt;(2, (int)_kind);}return default(global::DotPointers.OneOf.All);}}\/\/\/ &lt;summary&gt;\/\/\/ Gets the value of the &lt;see cref=\"All\" \/&gt; member, or the default value if the union does not hold this type.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;returns&gt;The value of the &lt;see cref=\"All\" \/&gt; member, or default.&lt;\/returns&gt;public readonly global::DotPointers.OneOf.All? AllOrDefault =&gt; _kind == OneOfRange.All ? default(global::DotPointers.OneOf.All): default;\/\/\/ &lt;summary&gt;\/\/\/ Gets the value of the &lt;see cref=\"None\" \/&gt; member.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;returns&gt;The value of the &lt;see cref=\"None\" \/&gt; member.&lt;\/returns&gt;\/\/\/ &lt;exception cref=\"InvalidOperationException\"&gt;Thrown if the union instance does not currently hold the &lt;see cref=\"None\" \/&gt; type.&lt;\/exception&gt;public readonly global::DotPointers.OneOf.None None{[MethodImpl(MethodImplOptions.AggressiveInlining)]get{if (_kind != OneOfRange.None){OneOfThrowHelper.ThrowInvalid&lt;OneOfRange&gt;(3, (int)_kind);}return default(global::DotPointers.OneOf.None);}}\/\/\/ &lt;summary&gt;\/\/\/ Gets the value of the &lt;see cref=\"None\" \/&gt; member, or the default value if the union does not hold this type.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;returns&gt;The value of the &lt;see cref=\"None\" \/&gt; member, or default.&lt;\/returns&gt;public readonly global::DotPointers.OneOf.None? NoneOrDefault =&gt; _kind == OneOfRange.None ? default(global::DotPointers.OneOf.None): default;\/\/\/ &lt;summary&gt;\/\/\/ Gets a value indicating whether this instance holds the type &lt;see cref=\"Single\" \/&gt;.\/\/\/ &lt;\/summary&gt;public readonly bool IsSingle =&gt; _kind == OneOfRange.Single;\/\/\/ &lt;summary&gt;\/\/\/ Gets a value indicating whether this instance holds the type &lt;see cref=\"Between\" \/&gt;.\/\/\/ &lt;\/summary&gt;public readonly bool IsBetween =&gt; _kind == OneOfRange.Between;\/\/\/ &lt;summary&gt;\/\/\/ Gets a value indicating whether this instance holds the type &lt;see cref=\"All\" \/&gt;.\/\/\/ &lt;\/summary&gt;public readonly bool IsAll =&gt; _kind == OneOfRange.All;\/\/\/ &lt;summary&gt;\/\/\/ Gets a value indicating whether this instance holds the type &lt;see cref=\"None\" \/&gt;.\/\/\/ &lt;\/summary&gt;public readonly bool IsNone =&gt; _kind == OneOfRange.None;\/\/\/ &lt;summary&gt;\/\/\/ Attempts to get the value of the &lt;see cref=\"Single\" \/&gt; member.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;param name=\"OutValue\"&gt;When this method returns true, contains the value.&lt;\/param&gt;\/\/\/ &lt;returns&gt;True if the union currently holds the &lt;see cref=\"Single\" \/&gt; type; otherwise, false.&lt;\/returns&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public readonly bool TryGetSingle([NotNullWhen(true)] out int OutValue){if (_kind == OneOfRange.Single){OutValue = _data._v0;return true;}OutValue = default!;return false;}\/\/\/ &lt;summary&gt;\/\/\/ Attempts to get the value of the &lt;see cref=\"Between\" \/&gt; member.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;param name=\"OutValue\"&gt;When this method returns true, contains the value.&lt;\/param&gt;\/\/\/ &lt;returns&gt;True if the union currently holds the &lt;see cref=\"Between\" \/&gt; type; otherwise, false.&lt;\/returns&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public readonly bool TryGetBetween([NotNullWhen(true)] out (int, int) OutValue){if (_kind == OneOfRange.Between){OutValue = _data._v1;return true;}OutValue = default!;return false;}\/\/\/ &lt;summary&gt;\/\/\/ Attempts to get the value of the &lt;see cref=\"All\" \/&gt; member.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;param name=\"OutValue\"&gt;When this method returns true, contains the value.&lt;\/param&gt;\/\/\/ &lt;returns&gt;True if the union currently holds the &lt;see cref=\"All\" \/&gt; type; otherwise, false.&lt;\/returns&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public readonly bool TryGetAll([NotNullWhen(true)] out global::DotPointers.OneOf.All OutValue){if (_kind == OneOfRange.All){OutValue = default(global::DotPointers.OneOf.All);return true;}OutValue = default!;return false;}\/\/\/ &lt;summary&gt;\/\/\/ Attempts to get the value of the &lt;see cref=\"None\" \/&gt; member.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;param name=\"OutValue\"&gt;When this method returns true, contains the value.&lt;\/param&gt;\/\/\/ &lt;returns&gt;True if the union currently holds the &lt;see cref=\"None\" \/&gt; type; otherwise, false.&lt;\/returns&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public readonly bool TryGetNone([NotNullWhen(true)] out global::DotPointers.OneOf.None OutValue){if (_kind == OneOfRange.None){OutValue = default(global::DotPointers.OneOf.None);return true;}OutValue = default!;return false;}\/\/\/ &lt;summary&gt;\/\/\/ Attempts to extract the value of the &lt;see cref=\"Single\" \/&gt; member, returning the remainder of the union if successful.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;returns&gt;True if the union currently holds the &lt;see cref=\"Single\" \/&gt; type; otherwise, false.&lt;\/returns&gt;\/\/\/ &lt;param name=\"OutValue\"&gt;When this method returns true, contains the value of the &lt;see cref=\"Single\" \/&gt; member.&lt;\/param&gt;\/\/\/ &lt;param name=\"Remainder\"&gt;When this method returns false, contains the remaining union instance.&lt;\/param&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public readonly bool TryPickSingle([NotNullWhen(true)] out int OutValue, [NotNullWhen(false)] out Range Remainder){if (_kind == OneOfRange.Single){OutValue = _data._v0;Remainder = default!;return true;}Remainder = this;OutValue = default!;return false;}\/\/\/ &lt;summary&gt;\/\/\/ Attempts to extract the value of the &lt;see cref=\"Between\" \/&gt; member, returning the remainder of the union if successful.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;returns&gt;True if the union currently holds the &lt;see cref=\"Between\" \/&gt; type; otherwise, false.&lt;\/returns&gt;\/\/\/ &lt;param name=\"OutValue\"&gt;When this method returns true, contains the value of the &lt;see cref=\"Between\" \/&gt; member.&lt;\/param&gt;\/\/\/ &lt;param name=\"Remainder\"&gt;When this method returns false, contains the remaining union instance.&lt;\/param&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public readonly bool TryPickBetween([NotNullWhen(true)] out (int, int) OutValue, [NotNullWhen(false)] out Range Remainder){if (_kind == OneOfRange.Between){OutValue = _data._v1;Remainder = default!;return true;}Remainder = this;OutValue = default!;return false;}\/\/\/ &lt;summary&gt;\/\/\/ Attempts to extract the value of the &lt;see cref=\"All\" \/&gt; member, returning the remainder of the union if successful.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;returns&gt;True if the union currently holds the &lt;see cref=\"All\" \/&gt; type; otherwise, false.&lt;\/returns&gt;\/\/\/ &lt;param name=\"OutValue\"&gt;When this method returns true, contains the value of the &lt;see cref=\"All\" \/&gt; member.&lt;\/param&gt;\/\/\/ &lt;param name=\"Remainder\"&gt;When this method returns false, contains the remaining union instance.&lt;\/param&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public readonly bool TryPickAll([NotNullWhen(true)] out global::DotPointers.OneOf.All OutValue, [NotNullWhen(false)] out Range Remainder){if (_kind == OneOfRange.All){OutValue = default(global::DotPointers.OneOf.All);Remainder = default!;return true;}Remainder = this;OutValue = default!;return false;}\/\/\/ &lt;summary&gt;\/\/\/ Attempts to extract the value of the &lt;see cref=\"None\" \/&gt; member, returning the remainder of the union if successful.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;returns&gt;True if the union currently holds the &lt;see cref=\"None\" \/&gt; type; otherwise, false.&lt;\/returns&gt;\/\/\/ &lt;param name=\"OutValue\"&gt;When this method returns true, contains the value of the &lt;see cref=\"None\" \/&gt; member.&lt;\/param&gt;\/\/\/ &lt;param name=\"Remainder\"&gt;When this method returns false, contains the remaining union instance.&lt;\/param&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public readonly bool TryPickNone([NotNullWhen(true)] out global::DotPointers.OneOf.None OutValue, [NotNullWhen(false)] out Range Remainder){if (_kind == OneOfRange.None){OutValue = default(global::DotPointers.OneOf.None);Remainder = default!;return true;}Remainder = this;OutValue = default!;return false;}\/\/\/ &lt;summary&gt;\/\/\/ Executes a specified action based on the current type held by the union.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;param name=\"OnSingle\"&gt;The action to execute if the union holds the &lt;see cref=\"Single\" \/&gt; type.&lt;\/param&gt;\/\/\/ &lt;param name=\"OnBetween\"&gt;The action to execute if the union holds the &lt;see cref=\"Between\" \/&gt; type.&lt;\/param&gt;\/\/\/ &lt;param name=\"OnAll\"&gt;The action to execute if the union holds the &lt;see cref=\"All\" \/&gt; type.&lt;\/param&gt;\/\/\/ &lt;param name=\"OnNone\"&gt;The action to execute if the union holds the &lt;see cref=\"None\" \/&gt; type.&lt;\/param&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public readonly void Switch(Action&lt;int&gt; OnSingle, Action&lt;(int, int)&gt; OnBetween, Action&lt;global::DotPointers.OneOf.All&gt; OnAll, Action&lt;global::DotPointers.OneOf.None&gt; OnNone){var kind = _kind;if (kind == OneOfRange.Single &amp;&amp; OnSingle != null) { OnSingle.Invoke(_data._v0); return; }if (kind == OneOfRange.Between &amp;&amp; OnBetween != null) { OnBetween.Invoke(_data._v1); return; }if (kind == OneOfRange.All &amp;&amp; OnAll != null) { OnAll.Invoke(default(global::DotPointers.OneOf.All)); return; }if (kind == OneOfRange.None &amp;&amp; OnNone != null) { OnNone.Invoke(default(global::DotPointers.OneOf.None)); return; }OneOfThrowHelper.ThrowEmpty(\"Range\");}\/\/\/ &lt;summary&gt;\/\/\/ Executes a specified function based on the current type held by the union and returns the result.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;returns&gt;The result of the executed function.&lt;\/returns&gt;\/\/\/ &lt;param name=\"OnSingle\"&gt;The function to execute if the union holds the &lt;see cref=\"Single\" \/&gt; type.&lt;\/param&gt;\/\/\/ &lt;param name=\"OnBetween\"&gt;The function to execute if the union holds the &lt;see cref=\"Between\" \/&gt; type.&lt;\/param&gt;\/\/\/ &lt;param name=\"OnAll\"&gt;The function to execute if the union holds the &lt;see cref=\"All\" \/&gt; type.&lt;\/param&gt;\/\/\/ &lt;param name=\"OnNone\"&gt;The function to execute if the union holds the &lt;see cref=\"None\" \/&gt; type.&lt;\/param&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public readonly TResult Match&lt;TResult&gt;(Func&lt;int, TResult&gt; OnSingle, Func&lt;(int, int), TResult&gt; OnBetween, Func&lt;global::DotPointers.OneOf.All, TResult&gt; OnAll, Func&lt;global::DotPointers.OneOf.None, TResult&gt; OnNone){var kind = _kind;if (kind == OneOfRange.Single &amp;&amp; OnSingle != null) { return OnSingle.Invoke(_data._v0); }if (kind == OneOfRange.Between &amp;&amp; OnBetween != null) { return OnBetween.Invoke(_data._v1); }if (kind == OneOfRange.All &amp;&amp; OnAll != null) { return OnAll.Invoke(default(global::DotPointers.OneOf.All)); }if (kind == OneOfRange.None &amp;&amp; OnNone != null) { return OnNone.Invoke(default(global::DotPointers.OneOf.None)); }return OneOfThrowHelper.ThrowEmpty&lt;TResult&gt;(\"Range\");}\/\/\/ &lt;summary&gt;\/\/\/ Executes a specified action based on the current type held by the union, passing a custom context.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;param name=\"OnSingle\"&gt;The action to execute if the union holds the &lt;see cref=\"Single\" \/&gt; type.&lt;\/param&gt;\/\/\/ &lt;param name=\"OnBetween\"&gt;The action to execute if the union holds the &lt;see cref=\"Between\" \/&gt; type.&lt;\/param&gt;\/\/\/ &lt;param name=\"OnAll\"&gt;The action to execute if the union holds the &lt;see cref=\"All\" \/&gt; type.&lt;\/param&gt;\/\/\/ &lt;param name=\"OnNone\"&gt;The action to execute if the union holds the &lt;see cref=\"None\" \/&gt; type.&lt;\/param&gt;\/\/\/ &lt;param name=\"context\"&gt;The state to pass to the action.&lt;\/param&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public readonly void Switch&lt;TContext&gt;(Action&lt;int, TContext&gt; OnSingle, Action&lt;(int, int), TContext&gt; OnBetween, Action&lt;global::DotPointers.OneOf.All, TContext&gt; OnAll, Action&lt;global::DotPointers.OneOf.None, TContext&gt; OnNone, TContext context){var kind = _kind;if (kind == OneOfRange.Single &amp;&amp; OnSingle != null) { OnSingle.Invoke(_data._v0, context); return; }if (kind == OneOfRange.Between &amp;&amp; OnBetween != null) { OnBetween.Invoke(_data._v1, context); return; }if (kind == OneOfRange.All &amp;&amp; OnAll != null) { OnAll.Invoke(default(global::DotPointers.OneOf.All), context); return; }if (kind == OneOfRange.None &amp;&amp; OnNone != null) { OnNone.Invoke(default(global::DotPointers.OneOf.None), context); return; }OneOfThrowHelper.ThrowEmpty(\"Range\");}\/\/\/ &lt;summary&gt;\/\/\/ Executes a specified function based on the current type held by the union, passing a custom context, and returns the result.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;returns&gt;The result of the executed function.&lt;\/returns&gt;\/\/\/ &lt;param name=\"OnSingle\"&gt;The function to execute if the union holds the &lt;see cref=\"Single\" \/&gt; type.&lt;\/param&gt;\/\/\/ &lt;param name=\"OnBetween\"&gt;The function to execute if the union holds the &lt;see cref=\"Between\" \/&gt; type.&lt;\/param&gt;\/\/\/ &lt;param name=\"OnAll\"&gt;The function to execute if the union holds the &lt;see cref=\"All\" \/&gt; type.&lt;\/param&gt;\/\/\/ &lt;param name=\"OnNone\"&gt;The function to execute if the union holds the &lt;see cref=\"None\" \/&gt; type.&lt;\/param&gt;\/\/\/ &lt;param name=\"context\"&gt;The state to pass to the function.&lt;\/param&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public readonly TResult Match&lt;TResult, TContext&gt;(Func&lt;int, TContext, TResult&gt; OnSingle, Func&lt;(int, int), TContext, TResult&gt; OnBetween, Func&lt;global::DotPointers.OneOf.All, TContext, TResult&gt; OnAll, Func&lt;global::DotPointers.OneOf.None, TContext, TResult&gt; OnNone, TContext context){var kind = _kind;if (kind == OneOfRange.Single &amp;&amp; OnSingle != null) { return OnSingle.Invoke(_data._v0, context); }if (kind == OneOfRange.Between &amp;&amp; OnBetween != null) { return OnBetween.Invoke(_data._v1, context); }if (kind == OneOfRange.All &amp;&amp; OnAll != null) { return OnAll.Invoke(default(global::DotPointers.OneOf.All), context); }if (kind == OneOfRange.None &amp;&amp; OnNone != null) { return OnNone.Invoke(default(global::DotPointers.OneOf.None), context); }return OneOfThrowHelper.ThrowEmpty&lt;TResult&gt;(\"Range\");}\/\/\/ &lt;summary&gt;\/\/\/ Asynchronously executes the action corresponding to the current type held by the union.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;returns&gt;A &lt;see cref=\"ValueTask\" \/&gt; representing the asynchronous operation.&lt;\/returns&gt;\/\/\/ &lt;param name=\"OnSingle\"&gt;The async action to execute if the union holds the &lt;see cref=\"Single\" \/&gt; type.&lt;\/param&gt;\/\/\/ &lt;param name=\"OnBetween\"&gt;The async action to execute if the union holds the &lt;see cref=\"Between\" \/&gt; type.&lt;\/param&gt;\/\/\/ &lt;param name=\"OnAll\"&gt;The async action to execute if the union holds the &lt;see cref=\"All\" \/&gt; type.&lt;\/param&gt;\/\/\/ &lt;param name=\"OnNone\"&gt;The async action to execute if the union holds the &lt;see cref=\"None\" \/&gt; type.&lt;\/param&gt;\/\/\/ &lt;remarks&gt;If the union is empty and no corresponding action is provided, this method throws an exception.&lt;\/remarks&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public readonly async ValueTask SwitchAsync(Func&lt;int, ValueTask&gt; OnSingle, Func&lt;(int, int), ValueTask&gt; OnBetween, Func&lt;global::DotPointers.OneOf.All, ValueTask&gt; OnAll, Func&lt;global::DotPointers.OneOf.None, ValueTask&gt; OnNone){var kind = _kind;if (kind == OneOfRange.Single &amp;&amp; OnSingle != null) { await OnSingle.Invoke(_data._v0); return; }if (kind == OneOfRange.Between &amp;&amp; OnBetween != null) { await OnBetween.Invoke(_data._v1); return; }if (kind == OneOfRange.All &amp;&amp; OnAll != null) { await OnAll.Invoke(default(global::DotPointers.OneOf.All)); return; }if (kind == OneOfRange.None &amp;&amp; OnNone != null) { await OnNone.Invoke(default(global::DotPointers.OneOf.None)); return; }OneOfThrowHelper.ThrowEmpty(\"Range\");}\/\/\/ &lt;summary&gt;\/\/\/ Asynchronously executes the function corresponding to the current type held by the union, returning a result.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;returns&gt;A &lt;see cref=\"ValueTask{{TResult}}\" \/&gt; representing the asynchronous operation.&lt;\/returns&gt;\/\/\/ &lt;param name=\"OnSingle\"&gt;The async function to execute if the union holds the &lt;see cref=\"Single\" \/&gt; type.&lt;\/param&gt;\/\/\/ &lt;param name=\"OnBetween\"&gt;The async function to execute if the union holds the &lt;see cref=\"Between\" \/&gt; type.&lt;\/param&gt;\/\/\/ &lt;param name=\"OnAll\"&gt;The async function to execute if the union holds the &lt;see cref=\"All\" \/&gt; type.&lt;\/param&gt;\/\/\/ &lt;param name=\"OnNone\"&gt;The async function to execute if the union holds the &lt;see cref=\"None\" \/&gt; type.&lt;\/param&gt;\/\/\/ &lt;exception cref=\"InvalidOperationException\"&gt;Thrown if the union instance is empty and no OnEmpty function is provided.&lt;\/exception&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public readonly async ValueTask&lt;TResult&gt; MatchAsync&lt;TResult&gt;(Func&lt;int, ValueTask&lt;TResult&gt;&gt; OnSingle, Func&lt;(int, int), ValueTask&lt;TResult&gt;&gt; OnBetween, Func&lt;global::DotPointers.OneOf.All, ValueTask&lt;TResult&gt;&gt; OnAll, Func&lt;global::DotPointers.OneOf.None, ValueTask&lt;TResult&gt;&gt; OnNone){var kind = _kind;if (kind == OneOfRange.Single &amp;&amp; OnSingle != null) { return await OnSingle.Invoke(_data._v0); }if (kind == OneOfRange.Between &amp;&amp; OnBetween != null) { return await OnBetween.Invoke(_data._v1); }if (kind == OneOfRange.All &amp;&amp; OnAll != null) { return await OnAll.Invoke(default(global::DotPointers.OneOf.All)); }if (kind == OneOfRange.None &amp;&amp; OnNone != null) { return await OnNone.Invoke(default(global::DotPointers.OneOf.None)); }return OneOfThrowHelper.ThrowEmpty&lt;TResult&gt;(\"Range\");}\/\/\/ &lt;summary&gt;\/\/\/ Returns a new Range instance where the current member's value has been transformed by the mapper function.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;param name=\"mapper\"&gt;The function to apply to the current member's value.&lt;\/param&gt;\/\/\/ &lt;returns&gt;A new Range instance containing the mapped value, or this instance if it does not hold the Single type.&lt;\/returns&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public readonly Range MapSingle(Func&lt;int, int&gt; mapper){if (_kind == OneOfRange.Single){return new Range(mapper.Invoke(_data._v0));}return this;}\/\/\/ &lt;summary&gt;\/\/\/ Returns a new Range instance where the current member's value has been transformed by the mapper function.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;param name=\"mapper\"&gt;The function to apply to the current member's value.&lt;\/param&gt;\/\/\/ &lt;returns&gt;A new Range instance containing the mapped value, or this instance if it does not hold the Between type.&lt;\/returns&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public readonly Range MapBetween(Func&lt;(int, int), (int, int)&gt; mapper){if (_kind == OneOfRange.Between){return new Range(mapper.Invoke(_data._v1));}return this;}\/\/\/ &lt;summary&gt;\/\/\/ Determines whether the specified union instance is equal to the current instance.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;param name=\"other\"&gt;The union instance to compare with.&lt;\/param&gt;\/\/\/ &lt;returns&gt;True if equal; otherwise, false.&lt;\/returns&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public readonly bool Equals(Range other){if (_kind != other._kind) { return false; }return _kind switch{OneOfRange.Single =&gt; EqualityComparer&lt;int&gt;.Default.Equals(_data._v0, other.SingleForce),OneOfRange.Between =&gt; EqualityComparer&lt;(int, int)&gt;.Default.Equals(_data._v1, other.BetweenForce),OneOfRange.All =&gt; true,OneOfRange.None =&gt; true,_ =&gt; true};}\/\/\/ &lt;summary&gt;\/\/\/ Determines whether the specified object is equal to the current instance.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;param name=\"obj\"&gt;The object to compare with.&lt;\/param&gt;\/\/\/ &lt;returns&gt;True if equal; otherwise, false.&lt;\/returns&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public readonly override bool Equals(object? obj) =&gt; obj is Range other &amp;&amp; Equals(other);\/\/\/ &lt;summary&gt;\/\/\/ Returns the hash code for this instance.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;returns&gt;A 32-bit signed integer that is the hash code for this instance.&lt;\/returns&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public readonly override int GetHashCode(){unchecked{var kind = _kind;int hash = 17;hash = hash * 23 + (int)kind;if (kind == OneOfRange.Single) { hash = hash * 23 + (_data._v0).GetHashCode(); }else if (kind == OneOfRange.Between) { hash = hash * 23 + (_data._v1).GetHashCode(); }return hash;}}\/\/\/ &lt;summary&gt;\/\/\/ Determines whether two union instances are equal.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;returns&gt;True if equal; otherwise, false.&lt;\/returns&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public static bool operator ==(Range left, Range right) =&gt; left.Equals(right);\/\/\/ &lt;summary&gt;\/\/\/ Determines whether two union instances are not equal.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;returns&gt;True if not equal; otherwise, false.&lt;\/returns&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public static bool operator !=(Range left, Range right) =&gt; !left.Equals(right);\/\/\/ &lt;summary&gt;\/\/\/ Deconstructs the union into its kind and values.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;param name=\"kind\"&gt;The kind of the current union instance.&lt;\/param&gt;\/\/\/ &lt;param name=\"single\"&gt;The out variable for the &lt;see cref=\"Single\" \/&gt; member.&lt;\/param&gt;\/\/\/ &lt;param name=\"between\"&gt;The out variable for the &lt;see cref=\"Between\" \/&gt; member.&lt;\/param&gt;\/\/\/ &lt;param name=\"all\"&gt;The out variable for the &lt;see cref=\"All\" \/&gt; member.&lt;\/param&gt;\/\/\/ &lt;param name=\"none\"&gt;The out variable for the &lt;see cref=\"None\" \/&gt; member.&lt;\/param&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public readonly void Deconstruct(out OneOfRange kind, out int? single, out (int, int)? between, out global::DotPointers.OneOf.All? all, out global::DotPointers.OneOf.None? none){kind = _kind;single = IsSingle ? _data._v0 : default;between = IsBetween ? _data._v1 : default;all = IsAll ? default(global::DotPointers.OneOf.All) : default;none = IsNone ? default(global::DotPointers.OneOf.None) : default;}\/\/\/ &lt;summary&gt;\/\/\/ Implicitly converts a value of type &lt;see cref=\"int\" \/&gt; to a Range instance.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;param name=\"value\"&gt;The value to convert.&lt;\/param&gt;\/\/\/ &lt;returns&gt;A new union instance.&lt;\/returns&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public static implicit operator Range(int value) =&gt; new(value);\/\/\/ &lt;summary&gt;\/\/\/ Explicitly converts a Range instance to a value of type &lt;see cref=\"int\" \/&gt;.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;param name=\"source\"&gt;The union instance to convert.&lt;\/param&gt;\/\/\/ &lt;returns&gt;The underlying value.&lt;\/returns&gt;\/\/\/ &lt;exception cref=\"InvalidOperationException\"&gt;Thrown if the union does not hold the requested type.&lt;\/exception&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public static explicit operator int(Range source) =&gt; source.Single;\/\/\/ &lt;summary&gt;\/\/\/ Implicitly converts a value of type &lt;see cref=\"(int, int)\" \/&gt; to a Range instance.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;param name=\"value\"&gt;The value to convert.&lt;\/param&gt;\/\/\/ &lt;returns&gt;A new union instance.&lt;\/returns&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public static implicit operator Range((int, int) value) =&gt; new(value);\/\/\/ &lt;summary&gt;\/\/\/ Explicitly converts a Range instance to a value of type &lt;see cref=\"(int, int)\" \/&gt;.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;param name=\"source\"&gt;The union instance to convert.&lt;\/param&gt;\/\/\/ &lt;returns&gt;The underlying value.&lt;\/returns&gt;\/\/\/ &lt;exception cref=\"InvalidOperationException\"&gt;Thrown if the union does not hold the requested type.&lt;\/exception&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public static explicit operator (int, int)(Range source) =&gt; source.Between;\/\/\/ &lt;summary&gt;\/\/\/ Implicitly converts a value of type &lt;see cref=\"global::DotPointers.OneOf.All\" \/&gt; to a Range instance.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;param name=\"value\"&gt;The value to convert.&lt;\/param&gt;\/\/\/ &lt;returns&gt;A new union instance.&lt;\/returns&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public static implicit operator Range(global::DotPointers.OneOf.All value) =&gt; new(value);\/\/\/ &lt;summary&gt;\/\/\/ Explicitly converts a Range instance to a value of type &lt;see cref=\"global::DotPointers.OneOf.All\" \/&gt;.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;param name=\"source\"&gt;The union instance to convert.&lt;\/param&gt;\/\/\/ &lt;returns&gt;The underlying value.&lt;\/returns&gt;\/\/\/ &lt;exception cref=\"InvalidOperationException\"&gt;Thrown if the union does not hold the requested type.&lt;\/exception&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public static explicit operator global::DotPointers.OneOf.All(Range source) =&gt; source.All;\/\/\/ &lt;summary&gt;\/\/\/ Implicitly converts a value of type &lt;see cref=\"global::DotPointers.OneOf.None\" \/&gt; to a Range instance.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;param name=\"value\"&gt;The value to convert.&lt;\/param&gt;\/\/\/ &lt;returns&gt;A new union instance.&lt;\/returns&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public static implicit operator Range(global::DotPointers.OneOf.None value) =&gt; new(value);\/\/\/ &lt;summary&gt;\/\/\/ Explicitly converts a Range instance to a value of type &lt;see cref=\"global::DotPointers.OneOf.None\" \/&gt;.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;param name=\"source\"&gt;The union instance to convert.&lt;\/param&gt;\/\/\/ &lt;returns&gt;The underlying value.&lt;\/returns&gt;\/\/\/ &lt;exception cref=\"InvalidOperationException\"&gt;Thrown if the union does not hold the requested type.&lt;\/exception&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public static explicit operator global::DotPointers.OneOf.None(Range source) =&gt; source.None;\/\/\/ &lt;summary&gt;\/\/\/ Returns an enumerable containing the current instance if it is not empty.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;returns&gt;A single-element enumerable or an empty enumerable.&lt;\/returns&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public readonly DotPointers.OneOf.SingleEnumerable&lt;Range&gt; AsEnumerable() =&gt; new(this);\/\/\/ &lt;summary&gt;\/\/\/ Returns a string that represents the current object.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;returns&gt;A string representation of the current object.&lt;\/returns&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public readonly override string? ToString() =&gt; _kind switch{OneOfRange.Single =&gt; (_data._v0).ToString(),OneOfRange.Between =&gt; (_data._v1).ToString(),OneOfRange.All =&gt; (default(global::DotPointers.OneOf.All)).ToString(),OneOfRange.None =&gt; (default(global::DotPointers.OneOf.None)).ToString(),_ =&gt; \"Empty\"};#if DEBUGprivate readonly string DebuggerDisplay =&gt; _kind switch{OneOfRange.Single =&gt; $\"int({Single}) - {Unsafe.SizeOf&lt;Range&gt;()} bytes\",OneOfRange.Between =&gt; $\"(int, int)({Between}) - {Unsafe.SizeOf&lt;Range&gt;()} bytes\",OneOfRange.All =&gt; $\"All({All}) - {Unsafe.SizeOf&lt;Range&gt;()} bytes\",OneOfRange.None =&gt; $\"None({None}) - {Unsafe.SizeOf&lt;Range&gt;()} bytes\",_ =&gt; \"Empty\"};#endif\/\/\/ &lt;summary&gt;\/\/\/ Starts a method chain for conditional execution based on the union's value.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;returns&gt;A chain context to continue the execution.&lt;\/returns&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public readonly ChainContext Chain() =&gt; new(this);\/\/\/ &lt;summary&gt;\/\/\/ Represents a context for chaining conditional operations on the union.\/\/\/ &lt;\/summary&gt;public readonly ref struct ChainContext{private readonly Range _source;private readonly bool _consumed;private readonly bool _matched;[MethodImpl(MethodImplOptions.AggressiveInlining)]internal ChainContext(Range source, bool consumed = false, bool matched = false){_source = source;_consumed = consumed;_matched = matched;}\/\/\/ &lt;summary&gt;\/\/\/ Evaluates a predicate if the union holds the &lt;see cref=\"Single\" \/&gt; type.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;param name=\"predicate\"&gt;The predicate to evaluate.&lt;\/param&gt;\/\/\/ &lt;returns&gt;The updated chain context.&lt;\/returns&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public readonly ChainContext IfSingle(Predicate&lt;int&gt; predicate){if (_consumed) { return this; }return new ChainContext(_source, false, _source.Kind == OneOfRange.Single &amp;&amp; predicate.Invoke(_source.SingleForce));}\/\/\/ &lt;summary&gt;\/\/\/ Checks if the union holds the &lt;see cref=\"Single\" \/&gt; type.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;returns&gt;The updated chain context.&lt;\/returns&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public ChainContext IfSingle(){if (_consumed) { return this; }return new ChainContext(_source, false, _source.Kind == OneOfRange.Single);}\/\/\/ &lt;summary&gt;\/\/\/ Evaluates a predicate if the union holds the &lt;see cref=\"Between\" \/&gt; type.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;param name=\"predicate\"&gt;The predicate to evaluate.&lt;\/param&gt;\/\/\/ &lt;returns&gt;The updated chain context.&lt;\/returns&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public readonly ChainContext IfBetween(Predicate&lt;(int, int)&gt; predicate){if (_consumed) { return this; }return new ChainContext(_source, false, _source.Kind == OneOfRange.Between &amp;&amp; predicate.Invoke(_source.BetweenForce));}\/\/\/ &lt;summary&gt;\/\/\/ Checks if the union holds the &lt;see cref=\"Between\" \/&gt; type.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;returns&gt;The updated chain context.&lt;\/returns&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public ChainContext IfBetween(){if (_consumed) { return this; }return new ChainContext(_source, false, _source.Kind == OneOfRange.Between);}\/\/\/ &lt;summary&gt;\/\/\/ Evaluates a predicate if the union holds the &lt;see cref=\"All\" \/&gt; type.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;param name=\"predicate\"&gt;The predicate to evaluate.&lt;\/param&gt;\/\/\/ &lt;returns&gt;The updated chain context.&lt;\/returns&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public readonly ChainContext IfAll(Predicate&lt;global::DotPointers.OneOf.All&gt; predicate){if (_consumed) { return this; }return new ChainContext(_source, false, _source.Kind == OneOfRange.All &amp;&amp; predicate.Invoke(_source.AllForce));}\/\/\/ &lt;summary&gt;\/\/\/ Checks if the union holds the &lt;see cref=\"All\" \/&gt; type.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;returns&gt;The updated chain context.&lt;\/returns&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public ChainContext IfAll(){if (_consumed) { return this; }return new ChainContext(_source, false, _source.Kind == OneOfRange.All);}\/\/\/ &lt;summary&gt;\/\/\/ Evaluates a predicate if the union holds the &lt;see cref=\"None\" \/&gt; type.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;param name=\"predicate\"&gt;The predicate to evaluate.&lt;\/param&gt;\/\/\/ &lt;returns&gt;The updated chain context.&lt;\/returns&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public readonly ChainContext IfNone(Predicate&lt;global::DotPointers.OneOf.None&gt; predicate){if (_consumed) { return this; }return new ChainContext(_source, false, _source.Kind == OneOfRange.None &amp;&amp; predicate.Invoke(_source.NoneForce));}\/\/\/ &lt;summary&gt;\/\/\/ Checks if the union holds the &lt;see cref=\"None\" \/&gt; type.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;returns&gt;The updated chain context.&lt;\/returns&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public ChainContext IfNone(){if (_consumed) { return this; }return new ChainContext(_source, false, _source.Kind == OneOfRange.None);}\/\/\/ &lt;summary&gt;\/\/\/ Executes the action if the previous condition was met.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;param name=\"action\"&gt;The action to execute.&lt;\/param&gt;\/\/\/ &lt;returns&gt;The updated chain context.&lt;\/returns&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public readonly ChainContext Then(Action&lt;int&gt; action){if (_consumed || !_matched) { return this; }action.Invoke(_source.Single);return new ChainContext(_source, true, false);}\/\/\/ &lt;summary&gt;\/\/\/ Executes the action if the previous condition was met.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;param name=\"action\"&gt;The action to execute.&lt;\/param&gt;\/\/\/ &lt;returns&gt;The updated chain context.&lt;\/returns&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public readonly ChainContext Then(Action&lt;(int, int)&gt; action){if (_consumed || !_matched) { return this; }action.Invoke(_source.Between);return new ChainContext(_source, true, false);}\/\/\/ &lt;summary&gt;\/\/\/ Executes the action if the previous condition was met.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;param name=\"action\"&gt;The action to execute.&lt;\/param&gt;\/\/\/ &lt;returns&gt;The updated chain context.&lt;\/returns&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public readonly ChainContext Then(Action&lt;global::DotPointers.OneOf.All&gt; action){if (_consumed || !_matched) { return this; }action.Invoke(_source.All);return new ChainContext(_source, true, false);}\/\/\/ &lt;summary&gt;\/\/\/ Executes the action if the previous condition was met.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;param name=\"action\"&gt;The action to execute.&lt;\/param&gt;\/\/\/ &lt;returns&gt;The updated chain context.&lt;\/returns&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public readonly ChainContext Then(Action&lt;global::DotPointers.OneOf.None&gt; action){if (_consumed || !_matched) { return this; }action.Invoke(_source.None);return new ChainContext(_source, true, false);}\/\/\/ &lt;summary&gt;\/\/\/ Executes the fallback action if no previous condition was met.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;param name=\"action\"&gt;The fallback action to execute.&lt;\/param&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public readonly void Else(Action&lt;Range&gt; action){if (!_consumed) { action.Invoke(_source); }}\/\/\/ &lt;summary&gt;\/\/\/ Terminates the chain.\/\/\/ &lt;\/summary&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public readonly void End() { }\/\/\/ &lt;summary&gt;\/\/\/ Breaks out of the chain if the previous condition was met.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;returns&gt;The updated chain context.&lt;\/returns&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public readonly ChainContext Break(){if (_consumed || !_matched) { return this; }return new ChainContext(_source, true, false);}\/\/\/ &lt;summary&gt;\/\/\/ Resets the consumed state to continue the chain evaluation.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;returns&gt;The updated chain context.&lt;\/returns&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public readonly ChainContext Continue(){if (_consumed) { return new ChainContext(_source, false, false); }return this;}}public OneOfMetadata Metadata =&gt; MetadataInfo.Instance;public static class MetadataInfo{public const int Count = 4;public const DotPointers.OneOf.OneOfLayoutKind Layout = DotPointers.OneOf.OneOfLayoutKind.ExplicitUnion;[MethodImpl(MethodImplOptions.AggressiveInlining)]public static Type GetTypeAt(int index) =&gt; index switch{0 =&gt; typeof(int),1 =&gt; typeof((int, int)),2 =&gt; typeof(global::DotPointers.OneOf.All),3 =&gt; typeof(global::DotPointers.OneOf.None),_ =&gt; throw new ArgumentOutOfRangeException(nameof(index))};[MethodImpl(MethodImplOptions.AggressiveInlining)]public static string GetFieldAt(int index) =&gt; index switch{0 =&gt; \"Single\",1 =&gt; \"Between\",2 =&gt; \"All\",3 =&gt; \"None\",_ =&gt; throw new ArgumentOutOfRangeException(nameof(index))};public static readonly OneOfMetadata Instance = new OneOfMetadata(Count, Layout, Unsafe.SizeOf&lt;Range&gt;(),!RuntimeHelpers.IsReferenceOrContainsReferences&lt;Range&gt;(),GetTypeAt,GetFieldAt);}\/\/\/ &lt;summary&gt;\/\/\/ Defines the possible kinds for the Range union.\/\/\/ &lt;\/summary&gt;public enum OneOfRange : int{Empty = 0,Single = 1,Between = 2,All = 3,None = 4,}}public static partial class OneOfLinqExtensions{\/\/\/ &lt;summary&gt;\/\/\/ Filters a sequence of Range instances to only those holding the &lt;see cref=\"Single\" \/&gt; type.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;param name=\"source\"&gt;The source sequence.&lt;\/param&gt;\/\/\/ &lt;returns&gt;An enumerable of filtered instances.&lt;\/returns&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public static IEnumerable&lt;Range&gt; WhereSingle(this IEnumerable&lt;Range&gt; source) =&gt; source.Where(static x =&gt; x.IsSingle);\/\/\/ &lt;summary&gt;\/\/\/ Filters a sequence of Range instances to exclude those holding the &lt;see cref=\"Single\" \/&gt; type.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;param name=\"source\"&gt;The source sequence.&lt;\/param&gt;\/\/\/ &lt;returns&gt;An enumerable of filtered instances.&lt;\/returns&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public static IEnumerable&lt;Range&gt; ExcludeSingle(this IEnumerable&lt;Range&gt; source) =&gt; source.Where(static x =&gt; !x.IsSingle);\/\/\/ &lt;summary&gt;\/\/\/ Projects elements of a sequence of Range holding the &lt;see cref=\"Single\" \/&gt; type into a new form.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;param name=\"source\"&gt;The source sequence.&lt;\/param&gt;\/\/\/ &lt;returns&gt;An enumerable of projected values.&lt;\/returns&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public static IEnumerable&lt;int&gt; SelectSingle(this IEnumerable&lt;Range&gt; source) =&gt; source.Where(static x =&gt; x.IsSingle).Select(static x =&gt; x.Single);\/\/\/ &lt;summary&gt;\/\/\/ Filters a sequence of Range instances to only those holding the &lt;see cref=\"Between\" \/&gt; type.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;param name=\"source\"&gt;The source sequence.&lt;\/param&gt;\/\/\/ &lt;returns&gt;An enumerable of filtered instances.&lt;\/returns&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public static IEnumerable&lt;Range&gt; WhereBetween(this IEnumerable&lt;Range&gt; source) =&gt; source.Where(static x =&gt; x.IsBetween);\/\/\/ &lt;summary&gt;\/\/\/ Filters a sequence of Range instances to exclude those holding the &lt;see cref=\"Between\" \/&gt; type.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;param name=\"source\"&gt;The source sequence.&lt;\/param&gt;\/\/\/ &lt;returns&gt;An enumerable of filtered instances.&lt;\/returns&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public static IEnumerable&lt;Range&gt; ExcludeBetween(this IEnumerable&lt;Range&gt; source) =&gt; source.Where(static x =&gt; !x.IsBetween);\/\/\/ &lt;summary&gt;\/\/\/ Projects elements of a sequence of Range holding the &lt;see cref=\"Between\" \/&gt; type into a new form.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;param name=\"source\"&gt;The source sequence.&lt;\/param&gt;\/\/\/ &lt;returns&gt;An enumerable of projected values.&lt;\/returns&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public static IEnumerable&lt;(int, int)&gt; SelectBetween(this IEnumerable&lt;Range&gt; source) =&gt; source.Where(static x =&gt; x.IsBetween).Select(static x =&gt; x.Between);\/\/\/ &lt;summary&gt;\/\/\/ Filters a sequence of Range instances to only those holding the &lt;see cref=\"All\" \/&gt; type.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;param name=\"source\"&gt;The source sequence.&lt;\/param&gt;\/\/\/ &lt;returns&gt;An enumerable of filtered instances.&lt;\/returns&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public static IEnumerable&lt;Range&gt; WhereAll(this IEnumerable&lt;Range&gt; source) =&gt; source.Where(static x =&gt; x.IsAll);\/\/\/ &lt;summary&gt;\/\/\/ Filters a sequence of Range instances to exclude those holding the &lt;see cref=\"All\" \/&gt; type.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;param name=\"source\"&gt;The source sequence.&lt;\/param&gt;\/\/\/ &lt;returns&gt;An enumerable of filtered instances.&lt;\/returns&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public static IEnumerable&lt;Range&gt; ExcludeAll(this IEnumerable&lt;Range&gt; source) =&gt; source.Where(static x =&gt; !x.IsAll);\/\/\/ &lt;summary&gt;\/\/\/ Projects elements of a sequence of Range holding the &lt;see cref=\"All\" \/&gt; type into a new form.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;param name=\"source\"&gt;The source sequence.&lt;\/param&gt;\/\/\/ &lt;returns&gt;An enumerable of projected values.&lt;\/returns&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public static IEnumerable&lt;global::DotPointers.OneOf.All&gt; SelectAll(this IEnumerable&lt;Range&gt; source) =&gt; source.Where(static x =&gt; x.IsAll).Select(static x =&gt; x.All);\/\/\/ &lt;summary&gt;\/\/\/ Filters a sequence of Range instances to only those holding the &lt;see cref=\"None\" \/&gt; type.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;param name=\"source\"&gt;The source sequence.&lt;\/param&gt;\/\/\/ &lt;returns&gt;An enumerable of filtered instances.&lt;\/returns&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public static IEnumerable&lt;Range&gt; WhereNone(this IEnumerable&lt;Range&gt; source) =&gt; source.Where(static x =&gt; x.IsNone);\/\/\/ &lt;summary&gt;\/\/\/ Filters a sequence of Range instances to exclude those holding the &lt;see cref=\"None\" \/&gt; type.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;param name=\"source\"&gt;The source sequence.&lt;\/param&gt;\/\/\/ &lt;returns&gt;An enumerable of filtered instances.&lt;\/returns&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public static IEnumerable&lt;Range&gt; ExcludeNone(this IEnumerable&lt;Range&gt; source) =&gt; source.Where(static x =&gt; !x.IsNone);\/\/\/ &lt;summary&gt;\/\/\/ Projects elements of a sequence of Range holding the &lt;see cref=\"None\" \/&gt; type into a new form.\/\/\/ &lt;\/summary&gt;\/\/\/ &lt;param name=\"source\"&gt;The source sequence.&lt;\/param&gt;\/\/\/ &lt;returns&gt;An enumerable of projected values.&lt;\/returns&gt;[MethodImpl(MethodImplOptions.AggressiveInlining)]public static IEnumerable&lt;global::DotPointers.OneOf.None&gt; SelectNone(this IEnumerable&lt;Range&gt; source) =&gt; source.Where(static x =&gt; x.IsNone).Select(static x =&gt; x.None);}}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<\/div>\n<\/details>\n<h2>\u0412\u044b\u0432\u043e\u0434<\/h2>\n<p>\u0412\u00a0\u0445\u043e\u0434\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u044b \u0443\u0437\u043d\u0430\u043b\u0438 \u043a\u0430\u043a\u00a0\u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c DU, \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u043f\u043b\u044e\u0441\u044b \u0438 \u043c\u0438\u043d\u0443\u0441\u044b \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439, \u0430\u00a0\u0442\u0430\u043a\u0436\u0435 \u044f \u0441\u043e\u0437\u0434\u0430\u043b \u0441\u0432\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442.<\/p>\n<\/div>\n<p>\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/1025098\/\">https:\/\/habr.com\/ru\/articles\/1025098\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0412\u00a0\u0436\u0438\u0437\u043d\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e C# \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430 \u0440\u0430\u043d\u043e \u0438\u043b\u0438\u00a0\u043f\u043e\u0437\u0434\u043d\u043e \u043d\u0430\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u043c\u043e\u043c\u0435\u043d\u0442, \u043a\u043e\u0433\u0434\u0430 switch \u043f\u043e object \u0438\u043b\u0438\u00a0\u0438\u0435\u0440\u0430\u0440\u0445\u0438\u044f \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442 \u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043a\u043e\u0441\u0442\u044b\u043b\u044f\u043c\u0438. \u0425\u043e\u0447\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u00ab\u043b\u0438\u0431\u043e \u0442\u043e,\u00a0\u043b\u0438\u0431\u043e \u0434\u0440\u0443\u0433\u043e\u0435\u00bb. \u0412\u00a0F# \u0438\u043b\u0438\u00a0Rust \u044d\u0442\u043e \u0431\u0430\u0437\u0430, \u0430\u00a0\u0432\u00a0C#\u00a0\u2014 \u0432\u0435\u0447\u043d\u043e\u0435 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0435.\u041f\u043e\u043a\u0430 Microsoft \u043e\u0431\u0435\u0449\u0430\u0435\u0442, \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e \u043f\u043b\u043e\u0434\u0438\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u041d\u043e\u00a0\u043f\u043e\u0447\u0435\u043c\u0443 \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435 \u043e\u043d\u0438\u00a0\u2014 \u044d\u0442\u043e\u00a0\u043b\u0438\u0431\u043e \u0443\u0434\u0430\u0440 \u043f\u043e\u00a0\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438,\u00a0\u043b\u0438\u0431\u043e \u043d\u0435\u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0435 \u043c\u0435\u0441\u0438\u0432\u043e? \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c\u0441\u044f, \u043a\u0430\u043a\u00a0\u0443\u0441\u0442\u0440\u043e\u0435\u043d\u044b DU \u043f\u043e\u0434\u00a0\u043a\u0430\u043f\u043e\u0442\u043e\u043c, \u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435\u00a0\u0441\u0442\u044b\u0434\u043d\u043e \u0437\u0430\u0441\u0443\u043d\u0443\u0442\u044c \u0432\u00a0\u0432\u044b\u0441\u043e\u043a\u043e\u043d\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0438\u043b\u0438\u00a0Unity\u2011\u0438\u0433\u0440\u0443.\u0423\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e DU \u0432\u00a0\u0434\u0440\u0443\u0433\u0438\u0445 \u044f\u0437\u044b\u043a\u0430\u0445\u0421\u0438\u041e\u0434\u043d\u0438\u043c \u0438\u0437\u00a0\u0441\u0430\u043c\u044b\u0445 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0431\u0435\u0437 \u00ab\u043d\u043e\u00bb \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0421\u0438. \u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u043c\u0435\u0435\u0442 \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e union, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u00a0\u043e\u0434\u0438\u043d \u0443\u0447\u0430\u0441\u0442\u043e\u043a \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0430\u043b\u043e\u0436\u0438\u0442\u044c \u0442\u0438\u043f\u044b. \u042d\u0442\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441\u00a0enum \u0438\u043b\u0438\u00a0int \u0442\u0435\u0433\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u0442\u044c, \u0447\u0442\u043e\u00a0\u043c\u044b \u0437\u0430\u043f\u0438\u0441\u0430\u043b\u0438. \u0422\u0430\u043a\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0430\u043c\u044b\u043c \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c, \u0432\u0435\u0434\u044c \u043e\u0432\u0435\u0440\u0445\u0435\u0434 \u0438\u0434\u0451\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u00a0\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0442\u0435\u0433\u0430, \u0430\u00a0\u0437\u0430\u043f\u0438\u0441\u044c \u0438 \u0447\u0442\u0435\u043d\u0438\u0435 \u0438\u0434\u0443\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u00a0\u043f\u0430\u043c\u044f\u0442\u0438\u041a\u043e\u0434 \u043d\u0438\u0436\u0435\u00a0\u2014 \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u043d\u0430\u00a0\u044f\u0437\u044b\u043a\u0435 \u0421\u0438enum ShapeType { CIRCLE, RECT };struct Shape {    enum ShapeType kind;    union {        double radius;        struct { double w, h; } rect;    } data;};\u041a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e\u00a0\u044d\u0442\u043e \u0441\u0430\u043c\u044b\u0439 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0438 \u0432\u00a0C# \u0442\u043e\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434, \u043d\u043e\u00a0\u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430: \u0412\u00a0\u0421\u0438 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c \u0434\u0440\u0443\u0433 \u043d\u0430\u00a0\u0434\u0440\u0443\u0433\u0430 \u043b\u044e\u0431\u044b\u0435 \u0442\u0438\u043f\u044b, \u0430\u00a0\u0432\u00a0C# \u0441\u0440\u0435\u0434\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0434\u043e\u043b\u0436\u043d\u0430 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0447\u0442\u043e\u00a0\u0441\u0441\u044b\u043b\u043e\u0447\u043d\u044b\u0439 \u0442\u0438\u043f \u043d\u0435\u00a0\u043d\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u00a0\u0437\u043d\u0430\u0447\u0438\u043c\u044b\u0439 \u0442\u0438\u043f, \u043f\u0440\u0438\u00a0\u043d\u0430\u0440\u0443\u0448\u0435\u043d\u0438\u0438 \u043e\u0448\u0438\u0431\u043a\u0430 TypeLoadException \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0435\u0442 \u043d\u0435\u00a0\u043d\u0430\u00a0\u044d\u0442\u0430\u043f\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438, \u0430\u00a0\u043f\u0440\u0438\u00a0\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0442\u0438\u043f\u0430.\u041a\u043e\u0434 \u043d\u0438\u0436\u0435 \u043d\u0430\u00a0C# \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u0442 \u043b\u043e\u0433\u0438\u043a\u0443 \u043a\u043e\u0434\u0430 \u043d\u0430\u00a0\u0421\u0438.public enum ShapeType : byte { Circle, Rect }[StructLayout(LayoutKind.Explicit)]public struct ShapeUnion{    [FieldOffset(0)] public ShapeType Kind;    [FieldOffset(1)] public double Radius;    [FieldOffset(1)] public (double Width, double Height) Rect;}F#\u0412\u00a0\u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043e\u043d\u0446\u0435\u043f\u0442\u0443\u0430\u043b\u044c\u043d\u043e \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432\u043e\u0437\u044c\u043c\u0451\u043c F#. \u0412\u00a0\u043d\u0451\u043c DU\u00a0\u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u0438\u043f\u043e\u0432. \u041f\u0440\u0438\u00a0\u044d\u0442\u043e\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442, \u0447\u0442\u043e\u00a0\u0434\u0440\u0443\u0433\u0438\u0445 \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u043e\u0432 \u0443\u00a0\u0442\u0438\u043f\u0430 \u043d\u0435\u0442. \u0423\u0434\u043e\u0431\u0441\u0442\u0432\u043e \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432\u00a0\u0442\u043e\u043c, \u0447\u0442\u043e\u00a0\u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0438\u043c\u0435\u044e\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 match \u0438 switch, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u0432\u0441\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043e\u043a.\u041d\u0438\u0436\u0435 \u043e\u0447\u0435\u043d\u044c \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u044b\u0439 \u043a\u043e\u0434 \u0434\u043b\u044f\u00a0\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044ftype Shape =    | Circle of radius: double    | Rect of width: double * height: double\u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0445\u043e\u0440\u043e\u0448\u043e, \u043f\u043e\u0447\u0435\u043c\u0443\u00a0\u0431\u044b \u043d\u0435\u00a0\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e \u0432\u0441\u0435\u0433\u0434\u0430? \u0414\u0435\u043b\u043e \u0432\u00a0\u0442\u043e\u043c, \u0447\u0442\u043e\u00a0\u043a\u0430\u0436\u0434\u043e\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 \u0442\u0430\u043a\u043e\u0433\u043e \u0442\u0438\u043f\u0430\u00a0\u2014 \u044d\u0442\u043e \u0430\u043b\u043b\u043e\u043a\u0430\u0446\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0432\u00a0\u043a\u0443\u0447\u0435. \u0411\u0430\u043d\u0430\u043b\u044c\u043d\u043e \u044d\u0442\u043e \u043d\u0435\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e. \u0414\u043b\u044f\u00a0\u0441\u0444\u0435\u0440\u044b \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 (F#) \u044d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u0435\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u043d\u043e\u00a0\u0434\u043b\u044f\u00a0\u0442\u043e\u0433\u043e\u00a0\u0436\u0435 \u0432\u0435\u0431 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f (C#)\u00a0\u2014 \u044d\u0442\u043e\u00a0\u0431\u044b\u043b\u043e\u00a0\u0431\u044b \u043d\u0435\u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e.\u0421\u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u0443\u0435\u043c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432\u00a0\u0442\u043e\u043c, \u0447\u0442\u043e\u00a0\u0434\u043b\u044f\u00a0C# \u043d\u0435\u0442 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435\u00a0\u0431\u044b \u043f\u043e\u0434\u043e\u0448\u043b\u043e \u0432\u0441\u0435\u043c.\u041f\u043e\u0434\u0445\u043e\u0434 \u043a\u0430\u043a\u00a0\u0432\u00a0\u0421\u0438: \u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u0441\u0440\u0435\u0434\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f\u041f\u043e\u0434\u0445\u043e\u0434 \u043a\u0430\u043a\u00a0\u0432\u00a0F#: \u041d\u0438\u0437\u043a\u0430\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u041d\u0430\u0438\u0432\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434, \u043f\u0440\u0438\u00a0\u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0442\u0435\u0433 \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b. \u041e\u043d \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f Composition.public enum ShapeType : byte { Circle, Rect }public struct Shape{    public ShapeType tag;    public double radius;    public (double Width, double Height) Rect;}\u042f \u0434\u0443\u043c\u0430\u044e \u0432\u044b \u0443\u0436\u0435 \u043e\u0436\u0438\u0434\u0430\u0435\u0442\u0435, \u0447\u0442\u043e\u00a0\u0431\u0443\u0434\u0435\u0442 \u043a\u0430\u043a\u043e\u0439\u2011\u0442\u043e \u043f\u043e\u0434\u0432\u043e\u0445. \u041e\u043d \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432\u00a0\u0442\u043e\u043c, \u0447\u0442\u043e\u00a0\u0442\u0430\u043a\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0438\u043c\u0435\u0435\u0442 \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0438\u0439 \u0438\u0437\u00a0\u0432\u0441\u0435\u0445 \u0440\u0430\u0437\u043c\u0435\u0440, \u0432\u0435\u0434\u044c \u043c\u044b \u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u0443\u0435\u043c \u043c\u0435\u0441\u0442\u043e \u043f\u043e\u0434\u00a0\u043a\u0430\u0436\u0434\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u0430\u00a0\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043f\u043e\u00a0\u0444\u0430\u043a\u0442\u0443 \u0442\u043e\u043b\u044c\u043a\u043e 1. \u041a\u0430\u0437\u0430\u043b\u043e\u0441\u044c\u00a0\u0431\u044b,\u00a0\u043b\u0438\u0448\u043d\u0438\u0435 20\u00a0\u0431\u0430\u0439\u0442 \u043f\u043e\u0433\u043e\u0434\u044b \u043d\u0435\u00a0\u0441\u0434\u0435\u043b\u0430\u044e\u0442, \u043d\u043e\u00a0\u0442\u0430\u043a\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0441\u00a0\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c \u043e\u0431\u0440\u0435\u0447\u0435\u043d\u0430 \u043d\u0435\u00a0\u0432\u043b\u0430\u0437\u0438\u0442\u044c \u0432\u00a0\u043a\u044d\u0448\u2011\u043b\u0438\u043d\u0438\u044e \u0438 \u0438\u043c\u0435\u0442\u044c \u043e\u0432\u0435\u0440\u0445\u0435\u0434 \u043d\u0430\u00a0\u043e\u0431\u043d\u0443\u043b\u0435\u043d\u0438\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u043e\u043b\u044f.\u0423\u0436\u0435 \u043c\u043e\u0436\u043d\u043e\u00a0\u0431\u044b\u043b\u043e \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c, \u0447\u0442\u043e\u00a0\u0435\u0441\u0442\u044c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 3\u00a0\u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u0438 \u0438\u043d\u0430\u0447\u0435 \u043d\u0438\u043a\u0430\u043a, \u043d\u043e\u00a0\u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u0434\u043b\u044f\u00a0\u0434\u043e\u0441\u0442\u0438\u0436\u0435\u043d\u0438\u044f \u043d\u0443\u0436\u043d\u044b\u0445 \u0446\u0435\u043b\u0435\u0439.\u0422\u0430\u043a\u0438\u043c \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u0443\u044e \u0438\u00a0\u0431\u044b\u0441\u0442\u0440\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0441\u00a0\u0442\u0430\u043a\u0438\u043c \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u043e\u043c:\u0412\u0441\u0435 \u0437\u043d\u0430\u0447\u0438\u043c\u044b\u0435 \u0442\u0438\u043f\u044b \u043d\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u043c \u0434\u0440\u0443\u0433 \u043d\u0430\u00a0\u0434\u0440\u0443\u0433\u0430\u0412\u0441\u0435 \u0441\u0441\u044b\u043b\u043e\u0447\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u043a\u0430\u0441\u0442\u044f\u0442\u0441\u044f \u043a object\u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434\u00a0\u0431\u044b\u0441\u0442\u0440\u044b\u0439, \u043d\u043e\u00a0\u043f\u043e\u00a0\u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0435\u00a0\u0438\u0434\u0435\u0430\u043b\u0435\u043d, \u0445\u043e\u0442\u044f \u0432\u0441\u0451 \u0435\u0449\u0451 \u043b\u0443\u0447\u0448\u0435 \u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u0438.\u041d\u0435\u00a0\u0441\u043f\u0435\u0448\u0438\u0442\u0435. \u0412\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0432\u043e\u043f\u0440\u043e\u0441: \u043a\u0430\u043a\u00a0\u044d\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c? \u041d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434 \u0434\u043b\u044f\u00a0\u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0441\u043b\u0443\u0447\u0430\u044f \u043b\u0435\u0433\u043a\u043e, \u043d\u043e\u00a0\u0447\u0442\u043e\u00a0\u0434\u0435\u043b\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u043d\u0443\u0436\u0435\u043d \u0448\u0430\u0431\u043b\u043e\u043d? \u0422\u0443\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0442 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438, \u0432\u0435\u0434\u044c \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u043a\u0430\u043a\u0438\u0435 \u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f, \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0448\u0438\u0442\u044c, \u0433\u0434\u0435 \u0438 \u043a\u0430\u043a\u00a0\u0438\u0445 \u0445\u0440\u0430\u043d\u0438\u0442\u044c. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0442\u0438\u043f T \u043d\u0435\u043b\u044c\u0437\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u00a0\u044f\u0432\u043d\u043e\u043c \u0432\u0438\u0434\u0435, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0435\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u0435\u043d.\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432\u00a0\u0442\u043e\u043c, \u0447\u0442\u043e\u00a0\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430, \u0430\u00a0\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434 \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u043e\u0447\u0435\u043d\u044c \u0434\u043e\u043b\u0433\u043e, \u0442\u0430\u043a \u043a\u0430\u043a\u00a0\u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u0420\u0435\u0448\u0435\u043d\u0438\u0435\u00a0\u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Source Generator. \u041e\u043d \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u043d\u0430\u0431\u0438\u0440\u0430\u0435\u0442 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u044c, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u043e\u0436\u0435\u0442 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u043d\u0430\u0447\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c\u00a0\u0431\u044b \u043f\u0438\u0441\u0430\u0442\u044c \u0432\u0440\u0443\u0447\u043d\u0443\u044e. \u0412\u00a0\u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u044f \u043f\u043e\u043a\u0430\u0436\u0443 \u0441\u0432\u043e\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430.\u041a\u0430\u043a\u0438\u0435 \u0435\u0441\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u043b\u044f\u00a0DU \u0441\u0435\u0439\u0447\u0430\u0441?\u0421\u0430\u043c\u043e\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u00a0\u2014 mcintyre321\u00a0OneOf(\u0413\u0438\u0442\u0445\u0430\u0431) \u041e\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u0438, \u0442\u043e \u0435\u0441\u0442\u044c \u0432\u0441\u0435 \u0442\u0438\u043f\u044b \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u0440\u0443\u0433 \u0437\u0430\u00a0\u0434\u0440\u0443\u0433\u043e\u043c. \u042d\u0442\u043e \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0441\u0430\u043c\u044b\u0439 \u043b\u0435\u043d\u0438\u0432\u044b\u0439 \u0438 \u0441\u0430\u043c\u044b\u0439 \u043d\u0430\u0434\u0451\u0436\u043d\u044b\u0439 \u043f\u0443\u0442\u044c. \u0412\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441\u00a0\u0437\u0430\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0442\u0438\u043f\u0430\u043c\u0438 \u0438\u0434\u0451\u0442 \u0447\u0435\u0440\u0435\u0437 \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b OneOf&lt;T0&#8230; T7&gt; \u0441\u00a0\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u0434\u043e 8\u00a0\u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 (\u0434\u043e 32\u00a0\u0441\u00a0\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439\u2011\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u043c).\u0422\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u0435\u0439:public readonly struct OneOf&lt;T0, T1, T2&gt; : IOneOf{private readonly T0 _value0;private readonly T1 _value1;private readonly T2 _value2;private readonly int _index;&#8230;\u041f\u043b\u044e\u0441\u044b:\u0418\u043c\u0435\u0435\u0442 \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 Match \u0438 Switch, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0431\u044f\u0437\u044b\u0432\u0430\u044e\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432\u0441\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b.\u0418\u043c\u0435\u044e\u0442\u0441\u044f \u0443\u0434\u043e\u0431\u043d\u044b\u0435 \u043a\u0430\u0441\u0442\u044b\u041d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043a\u043e\u0434\u041c\u0438\u043d\u0443\u0441\u044b: \u0411\u043e\u043b\u044c\u0448\u043e\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b\u041d\u0435\u0442 \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u043b\u0435\u0439, \u0437\u043d\u0430\u0447\u0438\u0442 \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0442\u044c, \u0447\u0442\u043e\u00a0\u0437\u043d\u0430\u0447\u0438\u0442 AsT0\u00a0\u0438 \u0442.\u0434\u041d\u0435\u00a0\u0441\u0430\u043c\u0430\u044f \u0432\u044b\u0441\u043e\u043a\u0430\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c\u0415\u0441\u043b\u0438 \u0432\u00a0\u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u0445 \u043f\u0443\u0441\u0442\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430, \u0442\u043e \u043e\u043d\u0430 \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u0437\u0430\u0439\u043c\u0451\u0442 \u0431\u0430\u0439\u0442\u041d\u0435\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u0432\u041d\u0435\u043b\u044c\u0437\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043a\u043e\u0434 (\u043a\u0440\u043e\u043c\u0435 \u043a\u0430\u043a\u00a0\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f\u043c\u0438)\u0418\u0442\u043e\u0433: \u042d\u0442\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0441\u0435\u0439\u0447\u0430\u0441 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 \u0434\u043b\u044f\u00a0\u0442\u0435\u0445, \u043a\u0442\u043e \u043d\u0435\u00a0\u0445\u043e\u0447\u0435\u0442 \u0441\u0438\u043b\u044c\u043d\u043e \u0437\u0430\u043c\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f, \u043e\u043d\u0430 \u0434\u0430\u0451\u0442 \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0438 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f\u00a0\u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430\u00a0\u0431\u044b\u0442\u043e\u0432\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u0445\u043e\u0442\u044f \u043c\u0438\u043d\u0443\u0441\u044b \u0442\u043e\u0436\u0435 \u0435\u0441\u0442\u044c. \u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0438\u043c\u0435\u043d\u043d\u044b\u0445 \u043f\u043e\u043b\u0435\u0439 \u043e\u0447\u0435\u043d\u044c \u0441\u0438\u043b\u044c\u043d\u043e \u0431\u044c\u0451\u0442 \u043f\u043e\u00a0\u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u0438 \u043a\u043e\u0434\u0430\u0411\u043e\u043b\u0435\u0435 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u00a0\u2014 domn1995\u00a0DuNet(\u0413\u0438\u0442\u0445\u0430\u0431) \u041e\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 record \u0442\u0438\u043f\u044b \u0438 \u0447\u0435\u0440\u0435\u0437 Source Generator \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u043c\u0435\u0442\u043e\u0434\u044b. \u0417\u0434\u0435\u0441\u044c \u0434\u043b\u044f\u00a0\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u0445\u043e\u0434 \u043a\u0430\u043a\u00a0\u0432\u00a0F#, \u0442\u043e \u0435\u0441\u0442\u044c \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435. \u0413\u043b\u0430\u0432\u043d\u0430\u044f \u0444\u0438\u0448\u043a\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438\u00a0\u2014 \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441.\u041e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435:[Union]partial record Shape{    partial record Circle(double Radius);    partial record Rectangle(double Length, double Width);    partial record Triangle(double Base, double Height);}\u041f\u043b\u044e\u0441\u044b:\u041a\u0440\u0430\u0441\u0438\u0432\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u0434 \u0441\u00a0\u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u044b\u043c\u0438 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f\u043c\u0438\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 Json \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e\u041c\u0438\u043d\u0443\u0441\u044b:\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u00a0\u2014 \u0432\u0441\u0435\u0433\u0434\u0430 \u0430\u043b\u043b\u043e\u043a\u0430\u0446\u0438\u044f\u041d\u0435\u043b\u044c\u0437\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0435 \u0442\u0438\u043f\u044b, \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0432\u043d\u0443\u0442\u0440\u0438\u041d\u0438\u0437\u043a\u0430\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c\u0418\u0442\u043e\u0433: \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f\u00a0\u0442\u0435\u0445, \u043a\u043e\u043c\u0443 \u043a\u0440\u0430\u0441\u043e\u0442\u0430 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 \u043f\u0440\u0435\u0432\u044b\u0448\u0435 \u0432\u0441\u0435\u0433\u043e, \u043f\u043e\u0434\u043e\u0439\u0434\u0451\u0442 \u0434\u043b\u044f\u00a0\u043d\u0435\u043d\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439.\u0410\u00a0\u0447\u0442\u043e \u043e\u0431\u0435\u0449\u0430\u044e\u0442 \u0432\u00a0\u0441\u0430\u043c\u043e\u043c C#?\u0423\u0436\u0435 \u043c\u043d\u043e\u0433\u043e \u043b\u0435\u0442 Microsoft \u043e\u0431\u0435\u0449\u0430\u044e\u0442 \u0432\u0432\u0435\u0441\u0442\u0438 DU \u0432\u00a0\u0441\u0430\u043c \u044f\u0437\u044b\u043a. \u0418 \u0432\u043f\u0440\u0430\u0432\u0434\u0443, \u0432\u00a0\u0442\u043e\u043c\u00a0\u0436\u0435 F# \u043e\u043d\u0438\u00a0\u0431\u044b\u043b\u0438 \u0441\u00a0\u0441\u0430\u043c\u043e\u0433\u043e \u043d\u0430\u0447\u0430\u043b\u0430.\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f:public record class Circle(double Radius);public record class Rectangle((double Weight, double Height) Rect);public union Pet(Circle, Rectangle);\u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0442\u043e\u00a0\u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435, \u0447\u0442\u043e\u00a0\u0438 \u0432\u00a0F#, \u043d\u043e\u00a0\u0435\u0441\u0442\u044c \u0448\u0430\u043d\u0441, \u0447\u0442\u043e\u00a0\u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u0434\u0445\u043e\u0434 \u0441\u00a0\u043d\u0430\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0442\u0430\u043c, \u0433\u0434\u0435 \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e.\u0422\u0430\u043a\u0436\u0435 \u043e\u0431\u0435\u0449\u0430\u044e\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u044b\u0435 \u0441\u043e\u044e\u0437\u044bpublic (int | string) GetValue() &#8230;\u041d\u0430\u00a0\u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u044d\u0442\u043e\u0433\u043e\u00a0\u0431\u044b \u0445\u0432\u0430\u0442\u0430\u043b\u043e \u0432\u00a0\u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u0430\u00a0\u0433\u043b\u0430\u0432\u043d\u043e\u0435\u00a0\u2014 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0438\u0437\u0430\u0446\u0438\u044f: \u0430\u0432\u0442\u043e\u0440\u044b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442\u00a0\u0436\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f\u00a0DU.\u0412\u00a0\u0447\u0451\u043c\u00a0\u0436\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430?\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432\u00a0\u0442\u043e\u043c, \u0447\u0442\u043e\u00a0\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439 \u0431\u0443\u0434\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441\u00a0\u0432\u0435\u0440\u0441\u0438\u0438 \u043d\u0430\u00a0\u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043e\u043d\u0438 \u0432\u044b\u0448\u043b\u0438. \u042d\u0442\u043e \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043e\u0442\u0440\u0435\u0437\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0430\u0443\u0434\u0438\u0442\u043e\u0440\u0438\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u0432\u0438\u0436\u043a\u0430 Unity (\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u00a0\u0441\u0438\u0445 \u043f\u043e\u0440 \u043d\u0430 .netstandart 2.1) \u0438\u043b\u0438\u00a0\u043c\u043d\u043e\u0433\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u0441\u0442\u0430\u0440\u044b\u0435 \u0440\u0430\u043d\u0442\u0430\u0439\u043c\u044b. \u0414\u043b\u044f\u00a0\u043f\u0440\u043e\u0441\u0442\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u0432\u044b\u0433\u043e\u0434\u043d\u043e \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0432\u0435\u0434\u044c \u0438\u043c \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0442\u044c\u0441\u044f\u00a0\u043b\u0438\u0448\u044c \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u044f\u0437\u044b\u043a\u0430.\u0421\u043e\u0437\u0434\u0430\u0451\u043c \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u041b\u043e\u0433\u0438\u0447\u043d\u044b\u043c \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a\u00a0\u0437\u0430\u0431\u0440\u0430\u043a\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442\u044c \u0441\u0432\u043e\u0451.\u041a\u0430\u043a\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043d\u0443\u0436\u043d\u043e \u0440\u0435\u0448\u0438\u0442\u044c?\u041d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u044b\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0442\u0438\u043f\u043e\u0432, \u0447\u0442\u043e\u00a0\u0443\u043b\u0443\u0447\u0448\u0438\u0442 \u0447\u0442\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u0430\u041d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u0430\u043c\u043e\u043c\u0443 \u0434\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u0432 Json \u0438 MemoryPack\u0414\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0440\u0435\u0448\u0430\u0442\u044c, \u043a\u0430\u043a\u00a0\u043a\u043e\u043c\u043f\u043e\u043d\u043e\u0432\u0430\u0442\u044c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0432\u00a0\u043f\u0430\u043c\u044f\u0442\u0438\u041d\u0435\u00a0\u0432\u044b\u0434\u0435\u043b\u044f\u0442\u044c \u043c\u0435\u0441\u0442\u043e \u043f\u043e\u0434\u00a0\u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0431\u0435\u0437\u00a0\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f (Void \u0442\u0438\u043f\u044b)\u041e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u0445\u043e\u0440\u043e\u0448\u0443\u044e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u0421\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0438\u043d\u0441\u043f\u0435\u043a\u0442\u043e\u0440\u0430 Unity\u0421\u0434\u0435\u043b\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e \u0441\u00a0\u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u044f\u0437\u044b\u043a\u0430\u041c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u0435\u0437\u00a0\u0440\u0435\u0444\u043b\u0435\u043a\u0441\u0438\u0438\u0421\u043f\u0438\u0441\u043e\u043a \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c \u043f\u043e\u2011\u043f\u043e\u0440\u044f\u0434\u043a\u0443\u041a\u0430\u043a\u00a0\u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0442\u0438\u043f?\u0422.\u043a \u044d\u0442\u043e SourceGenerator, \u0432\u0441\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u0430\u0442\u0440\u0438\u0431\u0443\u0442, \u0430\u00a0\u0442\u0438\u043f\u044b \u0447\u0435\u0440\u0435\u0437 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441.\u0412\u00a0\u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0442\u043e\u043c \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f.\u041f\u0440\u0438\u043c\u0435\u0440:[GenerateOneOf([&#171;Number&#187;, &#171;Text&#187;], AllowEmpty: false, OneOfLayoutKind.Auto, KindPosition.After, KindSize.Int, GenerateInfo: true)]public readonly partial struct Numeric : IOneOf&lt;double, string&gt;\u0412\u044b\u0431\u043e\u0440 \u043b\u0430\u044f\u0443\u0442\u0430\u0422\u0430\u043a \u043a\u0430\u043a\u00a0\u0432\u00a0\u043d\u0430\u0447\u0430\u043b\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u044b \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u0438, \u0447\u0442\u043e\u00a0\u043d\u0435\u0442 \u043b\u0443\u0447\u0448\u0435\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u0434\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0432\u044b\u0431\u043e\u0440 \u0438\u043b\u0438\u00a0\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0440\u0435\u0448\u0438\u0442\u044c \u0437\u0430\u00a0\u043d\u0435\u0433\u043e, \u043a\u0430\u043a\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043a\u043e\u043c\u043e\u043f\u043e\u043d\u043e\u0432\u043a\u0438 \u043f\u043e\u043b\u0435\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c.\u042f \u0432\u044b\u0434\u0435\u043b\u0438\u043b 4\u00a0\u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043a\u0440\u044b\u0432\u0430\u044e\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438:ExplicitUnion\u00a0\u2014 \u0432\u0441\u0435 \u0437\u043d\u0430\u0447\u0438\u043c\u044b\u0435 \u0442\u0438\u043f\u044b \u043d\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0434\u0440\u0443\u0433 \u043d\u0430\u00a0\u0434\u0440\u0443\u0433\u0430, \u0430\u00a0\u0441\u0441\u044b\u043b\u043e\u0447\u043d\u044b\u0435 \u043a\u0430\u0441\u0442\u044f\u0442\u0441\u044f \u043a\u00a0object. \u041a\u00a0\u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e \u0441\u043f\u043e\u0441\u043e\u0431 \u043d\u0435\u00a0\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0434\u043b\u044f\u00a0\u0433\u0435\u043d\u0435\u0440\u0438\u043a\u043e\u0432 (\u0432\u0435\u0434\u044c \u0438\u0445 \u043d\u0435\u043b\u044c\u0437\u044f \u043d\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c)Boxing\u00a0\u2014 \u0432\u043e\u043e\u0431\u0449\u0435 \u043b\u044e\u0431\u044b\u0435 \u0442\u0438\u043f\u044b \u043a\u0430\u0441\u0442\u0438\u043c \u043a\u00a0object. \u0435\u0441\u043b\u0438 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0432\u0441\u0435 \u0441\u0441\u044b\u043b\u043e\u0447\u043d\u044b\u0435, \u0442\u043e \u043e\u0432\u0435\u0440\u0445\u0435\u0434\u0430 \u043d\u0435\u0442, \u0438\u043d\u0430\u0447\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b \u0430\u043b\u043b\u043e\u043a\u0430\u0446\u0438\u0438Composition\u00a0\u2014 \u0432\u0441\u0435 \u0442\u0438\u043f\u044b \u0445\u0440\u0430\u043d\u0438\u043c \u0434\u0440\u0443\u0433 \u0437\u0430\u00a0\u0434\u0440\u0443\u0433\u043e\u043c. \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432\u0441\u0435\u0433\u0434\u0430 \u0438 \u0441\u043e \u0432\u0441\u0435\u043cHybrid\u00a0\u2014 \u0432\u0441\u0435 \u0437\u043d\u0430\u0447\u0438\u043c\u044b\u0435 \u0442\u0438\u043f\u044b \u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u043a\u0438 \u0445\u0440\u0430\u043d\u0438\u043c \u0434\u0440\u0443\u0433 \u0437\u0430\u00a0\u0434\u0440\u0443\u0433\u043e\u043c, \u0430\u00a0\u0441\u0441\u044b\u043b\u043e\u0447\u043d\u044b\u0435 \u043a\u0430\u0441\u0442\u0438\u043c \u043a\u00a0objectVoid \u0442\u0438\u043f\u044b\u0427\u0430\u0441\u0442\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0442\u0430\u043a\u0430\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f, \u043a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0438\u043c\u0435\u0442\u044c \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435\u00a0\u043d\u0435\u0441\u0451\u0442 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438, \u0434\u043b\u044f\u00a0\u044d\u0442\u043e\u0433\u043e \u043f\u0443\u0441\u0442\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043c\u0435\u0442\u0438\u0442\u044c [VoidType]. \u0434\u043b\u044f\u00a0\u0442\u0430\u043a\u0438\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u043d\u0435\u00a0\u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043c\u0435\u0441\u0442\u043e \u0432\u00a0\u043f\u0430\u043c\u044f\u0442\u0438, \u0430\u00a0\u0432\u0441\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 default.\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 (X\u00a0\u2014 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u043b\u044f)Switch\u00a0\u2014 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432\u0441\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0431\u0435\u0437\u00a0\u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044fMatch\u00a0\u2014 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432\u0441\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0441\u00a0\u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043e\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044fTryGet \/ TryPick\u00a0\u2014 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\/ OrDefault\u00a0\u2014 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0434\u043b\u044f\u00a0\u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044fDeconstruct, ToString, GetHashCode \u0438 \u043c\u043d\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0434\u043b\u044f\u00a0\u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430\u041c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435\u042f \u0441\u0434\u0435\u043b\u0430\u043b, \u0447\u0442\u043e\u0431\u044b \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043f\u043e\u00a0\u0436\u0435\u043b\u0430\u043d\u0438\u044e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043b\u0430\u0441\u0441 \u0441\u00a0\u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043e\u00a0\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 (\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0442\u0438\u043f\u044b, \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-476490","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/476490","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=476490"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/476490\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=476490"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=476490"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=476490"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}