當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


Scala Quotes.matches用法及代碼示例

matches 方法(或屬性)屬於 scala.quoted.Quotes 特性(trait),其相關用法說明如下。

用法:

def matches(that: Expr[Any]): Boolean

模式匹配 thisthat 。有效地執行深度相等檢查。它相當於

this match
  case '{...} => true // where the contents of the pattern are the contents of `that`
  case _ => false

源碼:

Quotes.scala

相關用法


注:本文由純淨天空篩選整理自scala-lang.org大神的英文原創作品 Quotes.matches。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。