Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions cedar-policy-validator/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -482,14 +482,18 @@ impl Type {
}

/// Return true if we know that any value in this type must be a specified
/// entity. An unspecified entity has type `AnyEntity`, so `AnyEntity` might
/// not be specified. Other entity types must be specified.
/// entity.
pub(crate) fn must_be_specified_entity(ty: &Type) -> bool {
matches!(
ty,
// An unspecified entity has type `AnyEntity`, so `AnyEntity` might
// not be specified. Other entity types must be specified.
Type::EntityOrRecord(
EntityRecordKind::Entity(_) | EntityRecordKind::ActionEntity { .. }
)
// It is vacuously true that any value in the type `Never` is a
// specified entity.
| Type::Never
)
}

Expand Down