Make List be a phantom type

This commit is contained in:
Richard Feldman 2025-11-16 23:53:25 -05:00
parent 657caf3222
commit a263ddee5e
No known key found for this signature in database
3 changed files with 2 additions and 3 deletions

View file

@ -6,7 +6,7 @@ Builtin :: [].{
contains = |_str, _other| True
}
List :: [ProvidedByCompiler].{
List(_item) :: [ProvidedByCompiler].{
len : List(_item) -> U64
is_empty : List(_item) -> Bool
concat : List(item), List(item) -> List(item)

View file

@ -1366,7 +1366,7 @@ test "Store comprehensive CompactWriter roundtrip" {
try std.testing.expectEqual(Content{ .structure = .{ .str = {} } }, deser_str.desc.content);
const deser_list = deserialized.resolveVar(list_var);
// List is now a nominal type
// List is a nominal type
try std.testing.expect(deser_list.desc.content.structure == .nominal_type);
const deser_nominal = deser_list.desc.content.structure.nominal_type;
const deser_list_args = deserialized.sliceNominalArgs(deser_nominal);

View file

@ -395,7 +395,6 @@ pub const TypeIdent = struct {
pub const FlatType = union(enum) {
str,
box: Var,
// NOTE: .list and .list_unbound have been removed - List is now a nominal type
record: Record,
record_unbound: RecordField.SafeMultiList.Range,
tuple: Tuple,