summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 {