summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Fitzgerald <fitzgen@gmail.com>2017-02-14 14:50:21 -0800
committerNick Fitzgerald <fitzgen@gmail.com>2017-02-14 15:05:49 -0800
commit6fbc343032307ff6d5b1705dc6cb0284601873e3 (patch)
tree36cd77e76d8895e1461ee861f6b7e5e6eb3bcbf0
parentf1caa107f463a548524572bd426fd7fe4e7d13f5 (diff)
Add the `Item::is_named` helper method
-rw-r--r--src/ir/item.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ir/item.rs b/src/ir/item.rs
index 4c65c433..5b785513 100644
--- a/src/ir/item.rs
+++ b/src/ir/item.rs
@@ -472,6 +472,13 @@ impl Item {
self.kind().as_type()
}
+ /// Is this item a named template type parameter?
+ pub fn is_named(&self) -> bool {
+ self.as_type()
+ .map(|ty| ty.is_named())
+ .unwrap_or(false)
+ }
+
/// Get a reference to this item's underlying `Function`. Panic if this is
/// some other kind of item.
pub fn expect_function(&self) -> &Function {