-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move Type, TypeBound, PrimType to better locations (#403)
namely Type, TypeBound -> types.rs PrimType -> primitive.rs also add docstrings
- Loading branch information
Showing
5 changed files
with
217 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
//! Primitive types which are leaves of the type tree | ||
|
||
use crate::ops::AliasDecl; | ||
|
||
use super::{AbstractSignature, CustomType, TypeBound}; | ||
|
||
#[derive( | ||
Clone, PartialEq, Debug, Eq, derive_more::Display, serde::Serialize, serde::Deserialize, | ||
)] | ||
pub(super) enum PrimType { | ||
E(Box<CustomType>), | ||
#[display(fmt = "Alias({})", "_0.name()")] | ||
A(AliasDecl), | ||
#[display(fmt = "Graph({})", "_0")] | ||
Graph(Box<AbstractSignature>), | ||
} | ||
|
||
impl PrimType { | ||
pub(super) fn bound(&self) -> Option<TypeBound> { | ||
// TODO update once inner types are updated to new TypeBound | ||
return None; | ||
match self { | ||
PrimType::E(_c) => todo!(), | ||
PrimType::A(_) => todo!(), | ||
PrimType::Graph(_) => Some(TypeBound::Copyable), | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.