diff options
Diffstat (limited to 'api/dotty/tools/dotc/transform/PatternMatcher/Translator/TreeMakers.html')
-rw-r--r-- | api/dotty/tools/dotc/transform/PatternMatcher/Translator/TreeMakers.html | 142 |
1 files changed, 0 insertions, 142 deletions
diff --git a/api/dotty/tools/dotc/transform/PatternMatcher/Translator/TreeMakers.html b/api/dotty/tools/dotc/transform/PatternMatcher/Translator/TreeMakers.html index 3cb60fe97..9dc9c16ca 100644 --- a/api/dotty/tools/dotc/transform/PatternMatcher/Translator/TreeMakers.html +++ b/api/dotty/tools/dotc/transform/PatternMatcher/Translator/TreeMakers.html @@ -6170,148 +6170,6 @@ This makes extractor patterns more debuggable (SI-5739).</p> </script> </div><!-- end member --> - <div id="ProductExtractorTreeMaker" class="member "> - <div class="member-title"> - <span class="expand-button " onclick="toggleMemberBody(this, 'ProductExtractorTreeMaker');">[+]</span> - <span class="member-annotations"> - - </span> - <span class="member-modifiers"> - - </span> - <span class="member-kind"> - case class - </span> - <span class="member-name "> - - <a href="../../../../../../.././api/dotty/tools/dotc/transform/PatternMatcher/Translator/TreeMakers/ProductExtractorTreeMaker.html">ProductExtractorTreeMaker</a> - - </span> - - - - - - - </div><!-- end member-title --> - - <div class="member-body"> - <div class="member-body-short" id="short-body-ProductExtractorTreeMaker"> - <p>An optimized version of ExtractorTreeMaker for Products. -For now, this is hard-coded to case classes, and we simply extract the case class fields.</p> -<p>The v... -</p> -<p> -</p> -<p> -</p> - - </div> - <div class="member-body-long" id ="long-body-ProductExtractorTreeMaker"> - <p>An optimized version of ExtractorTreeMaker for Products. -For now, this is hard-coded to case classes, and we simply extract the case class fields.</p> -<p>The values for the subpatterns, as specified by the case class fields at the time of extraction, -are stored in local variables that re-use the symbols in <code>subPatBinders</code>. -This makes extractor patterns more debuggable (SI-5739) as well as -avoiding mutation after the pattern has been matched (SI-5158, SI-6070)</p> -<p>TODO: make this user-definable as follows -When a companion object defines a method <code>def unapply_1(x: T): U_1</code>, but no <code>def unapply</code> or <code>def unapplySeq</code>, -the extractor is considered to match any non-null value of type T -the pattern is expected to have as many sub-patterns as there are <code>def unapply_I(x: T): U_I</code> methods, -and the type of the I'th sub-pattern is <code>U_I</code>. -The same exception for Seq patterns applies: if the last extractor is of type <code>Seq[U_N]</code>, -the pattern must have at least N arguments (exactly N if the last argument is annotated with <code>: _*</code>). -The arguments starting at N (and beyond) are taken from the sequence returned by apply_N, -and it is checked that the sequence has enough elements to provide values for all expected sub-patterns.</p> -<p>For a case class C, the implementation is assumed to be <code>def unapply_I(x: C) = x._I</code>, -and the extractor call is inlined under that assumption.</p> - - </div> - </div> - <script> - function toggleMemberBody(span, sig) { - var shortBody = document.getElementById("short-body-" + sig); - var longBody = document.getElementById("long-body-" + sig); - - shortBody.classList.toggle("toggled") - longBody.classList.toggle("toggled") - - span.innerHTML = (span.innerHTML == "[+]") ? "[-]" : "[+]"; - } - </script> - </div><!-- end member --> - - <div id="ProductExtractorTreeMaker$" class="member "> - <div class="member-title"> - <span class="expand-button " onclick="toggleMemberBody(this, 'ProductExtractorTreeMaker$');">[+]</span> - <span class="member-annotations"> - - </span> - <span class="member-modifiers"> - final - </span> - <span class="member-kind"> - object - </span> - <span class="member-name "> - - <a href="../../../../../../.././api/dotty/tools/dotc/transform/PatternMatcher/Translator/TreeMakers/ProductExtractorTreeMaker$.html">ProductExtractorTreeMaker</a> - - </span> - - - - - - - </div><!-- end member-title --> - - <div class="member-body"> - <div class="member-body-short" id="short-body-ProductExtractorTreeMaker$"> - <p>An optimized version of ExtractorTreeMaker for Products. -For now, this is hard-coded to case classes, and we simply extract the case class fields.</p> -<p>The v... -</p> -<p> -</p> -<p> -</p> - - </div> - <div class="member-body-long" id ="long-body-ProductExtractorTreeMaker$"> - <p>An optimized version of ExtractorTreeMaker for Products. -For now, this is hard-coded to case classes, and we simply extract the case class fields.</p> -<p>The values for the subpatterns, as specified by the case class fields at the time of extraction, -are stored in local variables that re-use the symbols in <code>subPatBinders</code>. -This makes extractor patterns more debuggable (SI-5739) as well as -avoiding mutation after the pattern has been matched (SI-5158, SI-6070)</p> -<p>TODO: make this user-definable as follows -When a companion object defines a method <code>def unapply_1(x: T): U_1</code>, but no <code>def unapply</code> or <code>def unapplySeq</code>, -the extractor is considered to match any non-null value of type T -the pattern is expected to have as many sub-patterns as there are <code>def unapply_I(x: T): U_I</code> methods, -and the type of the I'th sub-pattern is <code>U_I</code>. -The same exception for Seq patterns applies: if the last extractor is of type <code>Seq[U_N]</code>, -the pattern must have at least N arguments (exactly N if the last argument is annotated with <code>: _*</code>). -The arguments starting at N (and beyond) are taken from the sequence returned by apply_N, -and it is checked that the sequence has enough elements to provide values for all expected sub-patterns.</p> -<p>For a case class C, the implementation is assumed to be <code>def unapply_I(x: C) = x._I</code>, -and the extractor call is inlined under that assumption.</p> - - </div> - </div> - <script> - function toggleMemberBody(span, sig) { - var shortBody = document.getElementById("short-body-" + sig); - var longBody = document.getElementById("long-body-" + sig); - - shortBody.classList.toggle("toggled") - longBody.classList.toggle("toggled") - - span.innerHTML = (span.innerHTML == "[+]") ? "[-]" : "[+]"; - } - </script> - </div><!-- end member --> - <div id="SubstOnlyTreeMaker" class="member "> <div class="member-title"> <span class="expand-button " onclick="toggleMemberBody(this, 'SubstOnlyTreeMaker');">[+]</span> |