diff --git a/src/protocol/ast.rs b/src/protocol/ast.rs index 93833384855321f904980f02802bd594d93a4dca..782a5cbe5f3944cfaaaf6cafee08cde10226f41b 100644 --- a/src/protocol/ast.rs +++ b/src/protocol/ast.rs @@ -345,7 +345,7 @@ pub struct Identifier { } impl Identifier { - pub(crate) fn new_empty(span: InputSpan) -> Identifier { + pub(crate) const fn new_empty(span: InputSpan) -> Identifier { return Identifier{ span, value: StringRef::new_empty(), @@ -510,6 +510,7 @@ pub enum ConcreteTypePart { Slice, Input, Output, + Pointer, // Tuple: variable number of nested types, will never be 1 Tuple(u32), // User defined type with any number of nested types @@ -528,7 +529,7 @@ impl ConcreteTypePart { SInt8 | SInt16 | SInt32 | SInt64 | Character | String => 0, - Array | Slice | Input | Output => + Array | Slice | Input | Output | Pointer => 1, Tuple(num_embedded) => *num_embedded, Instance(_, num_embedded) => *num_embedded, @@ -635,6 +636,10 @@ impl ConcreteType { idx = Self::render_type_part_at(parts, heap, idx, target); target.push('>'); }, + CTP::Pointer => { + target.push('*'); + idx = Self::render_type_part_at(parts, heap, idx, target); + } CTP::Tuple(num_parts) => { target.push('('); if num_parts != 0 {