wright/ast/decl/type_alias.rs
1//! Type alias declarations in wright source code.
2//!
3
4use crate::{
5 ast::{identifier::Identifier, ty::Type},
6 source_tracking::fragment::Fragment,
7};
8
9/// A type alias in wright source code.
10#[derive(Debug)]
11pub struct TypeAlias {
12 /// Full matching source including whitespace.
13 pub matching_source: Fragment,
14
15 /// The name of the new/aliased type.
16 pub new_type_name: Identifier,
17
18 /// The type aliased to if any (we support abstract `pub type Void;`) style declarations.
19 pub target_type: Option<Type>,
20}