Skip to content

Commit 6fbc343

Browse files
committed
Add the Item::is_named helper method
1 parent f1caa10 commit 6fbc343

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/ir/item.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,13 @@ impl Item {
472472
self.kind().as_type()
473473
}
474474

475+
/// Is this item a named template type parameter?
476+
pub fn is_named(&self) -> bool {
477+
self.as_type()
478+
.map(|ty| ty.is_named())
479+
.unwrap_or(false)
480+
}
481+
475482
/// Get a reference to this item's underlying `Function`. Panic if this is
476483
/// some other kind of item.
477484
pub fn expect_function(&self) -> &Function {

0 commit comments

Comments
 (0)