authorgravatar for jhc@dismail.deJimmi Holst Christensen <jhc@dismail.de> 2018-06-05 11:30:01+02:00
committergravatar for jhc@dismail.deJimmi Holst Christensen <jhc@dismail.de> 2018-06-05 11:30:01+02:00
log236c680f6bae490fddab4935892bd75240176d0b
treeeb62a022180a9b6eeeb3b35e5a956ca5b464d802
parent02cb220faf0d527b656a3a87ec96e6738770c8e6

Removed NullLiteral to Null


6 files changed, 68 insertions(+), 68 deletions(-)

doc/langref.html.in+3-3
...@@ -4896,7 +4896,7 @@ pub const TypeId = enum {...@@ -4896,7 +4896,7 @@ pub const TypeId = enum {
4896 ComptimeFloat,4896 ComptimeFloat,
4897 ComptimeInt,4897 ComptimeInt,
4898 UndefinedLiteral,4898 UndefinedLiteral,
4899 NullLiteral,4899 Null,
4900 Nullable,4900 Nullable,
4901 ErrorUnion,4901 ErrorUnion,
4902 Error,4902 Error,
...@@ -4930,7 +4930,7 @@ pub const TypeInfo = union(TypeId) {...@@ -4930,7 +4930,7 @@ pub const TypeInfo = union(TypeId) {
4930 ComptimeFloat: void,4930 ComptimeFloat: void,
4931 ComptimeInt: void,4931 ComptimeInt: void,
4932 UndefinedLiteral: void,4932 UndefinedLiteral: void,
4933 NullLiteral: void,4933 Null: void,
4934 Nullable: Nullable,4934 Nullable: Nullable,
4935 ErrorUnion: ErrorUnion,4935 ErrorUnion: ErrorUnion,
4936 ErrorSet: ErrorSet,4936 ErrorSet: ErrorSet,
...@@ -5688,7 +5688,7 @@ pub const TypeId = enum {...@@ -5688,7 +5688,7 @@ pub const TypeId = enum {
5688 ComptimeFloat,5688 ComptimeFloat,
5689 ComptimeInt,5689 ComptimeInt,
5690 UndefinedLiteral,5690 UndefinedLiteral,
5691 NullLiteral,5691 Null,
5692 Nullable,5692 Nullable,
5693 ErrorUnion,5693 ErrorUnion,
5694 ErrorSet,5694 ErrorSet,
src/all_types.hpp+1-1
...@@ -1162,7 +1162,7 @@ enum TypeTableEntryId {...@@ -1162,7 +1162,7 @@ enum TypeTableEntryId {
1162 TypeTableEntryIdComptimeFloat,1162 TypeTableEntryIdComptimeFloat,
1163 TypeTableEntryIdComptimeInt,1163 TypeTableEntryIdComptimeInt,
1164 TypeTableEntryIdUndefLit,1164 TypeTableEntryIdUndefLit,
1165 TypeTableEntryIdNullLit,1165 TypeTableEntryIdNull,
1166 TypeTableEntryIdMaybe,1166 TypeTableEntryIdMaybe,
1167 TypeTableEntryIdErrorUnion,1167 TypeTableEntryIdErrorUnion,
1168 TypeTableEntryIdErrorSet,1168 TypeTableEntryIdErrorSet,
src/analyze.cpp+23-23
...@@ -235,7 +235,7 @@ bool type_is_complete(TypeTableEntry *type_entry) {...@@ -235,7 +235,7 @@ bool type_is_complete(TypeTableEntry *type_entry) {
235 case TypeTableEntryIdComptimeFloat:235 case TypeTableEntryIdComptimeFloat:
236 case TypeTableEntryIdComptimeInt:236 case TypeTableEntryIdComptimeInt:
237 case TypeTableEntryIdUndefLit:237 case TypeTableEntryIdUndefLit:
238 case TypeTableEntryIdNullLit:238 case TypeTableEntryIdNull:
239 case TypeTableEntryIdMaybe:239 case TypeTableEntryIdMaybe:
240 case TypeTableEntryIdErrorUnion:240 case TypeTableEntryIdErrorUnion:
241 case TypeTableEntryIdErrorSet:241 case TypeTableEntryIdErrorSet:
...@@ -271,7 +271,7 @@ bool type_has_zero_bits_known(TypeTableEntry *type_entry) {...@@ -271,7 +271,7 @@ bool type_has_zero_bits_known(TypeTableEntry *type_entry) {
271 case TypeTableEntryIdComptimeFloat:271 case TypeTableEntryIdComptimeFloat:
272 case TypeTableEntryIdComptimeInt:272 case TypeTableEntryIdComptimeInt:
273 case TypeTableEntryIdUndefLit:273 case TypeTableEntryIdUndefLit:
274 case TypeTableEntryIdNullLit:274 case TypeTableEntryIdNull:
275 case TypeTableEntryIdMaybe:275 case TypeTableEntryIdMaybe:
276 case TypeTableEntryIdErrorUnion:276 case TypeTableEntryIdErrorUnion:
277 case TypeTableEntryIdErrorSet:277 case TypeTableEntryIdErrorSet:
...@@ -1336,7 +1336,7 @@ static bool type_allowed_in_packed_struct(TypeTableEntry *type_entry) {...@@ -1336,7 +1336,7 @@ static bool type_allowed_in_packed_struct(TypeTableEntry *type_entry) {
1336 case TypeTableEntryIdComptimeFloat:1336 case TypeTableEntryIdComptimeFloat:
1337 case TypeTableEntryIdComptimeInt:1337 case TypeTableEntryIdComptimeInt:
1338 case TypeTableEntryIdUndefLit:1338 case TypeTableEntryIdUndefLit:
1339 case TypeTableEntryIdNullLit:1339 case TypeTableEntryIdNull:
1340 case TypeTableEntryIdErrorUnion:1340 case TypeTableEntryIdErrorUnion:
1341 case TypeTableEntryIdErrorSet:1341 case TypeTableEntryIdErrorSet:
1342 case TypeTableEntryIdNamespace:1342 case TypeTableEntryIdNamespace:
...@@ -1377,7 +1377,7 @@ static bool type_allowed_in_extern(CodeGen *g, TypeTableEntry *type_entry) {...@@ -1377,7 +1377,7 @@ static bool type_allowed_in_extern(CodeGen *g, TypeTableEntry *type_entry) {
1377 case TypeTableEntryIdComptimeFloat:1377 case TypeTableEntryIdComptimeFloat:
1378 case TypeTableEntryIdComptimeInt:1378 case TypeTableEntryIdComptimeInt:
1379 case TypeTableEntryIdUndefLit:1379 case TypeTableEntryIdUndefLit:
1380 case TypeTableEntryIdNullLit:1380 case TypeTableEntryIdNull:
1381 case TypeTableEntryIdErrorUnion:1381 case TypeTableEntryIdErrorUnion:
1382 case TypeTableEntryIdErrorSet:1382 case TypeTableEntryIdErrorSet:
1383 case TypeTableEntryIdNamespace:1383 case TypeTableEntryIdNamespace:
...@@ -1512,7 +1512,7 @@ static TypeTableEntry *analyze_fn_type(CodeGen *g, AstNode *proto_node, Scope *c...@@ -1512,7 +1512,7 @@ static TypeTableEntry *analyze_fn_type(CodeGen *g, AstNode *proto_node, Scope *c
1512 return g->builtin_types.entry_invalid;1512 return g->builtin_types.entry_invalid;
1513 case TypeTableEntryIdUnreachable:1513 case TypeTableEntryIdUnreachable:
1514 case TypeTableEntryIdUndefLit:1514 case TypeTableEntryIdUndefLit:
1515 case TypeTableEntryIdNullLit:1515 case TypeTableEntryIdNull:
1516 case TypeTableEntryIdArgTuple:1516 case TypeTableEntryIdArgTuple:
1517 case TypeTableEntryIdOpaque:1517 case TypeTableEntryIdOpaque:
1518 add_node_error(g, param_node->data.param_decl.type,1518 add_node_error(g, param_node->data.param_decl.type,
...@@ -1600,7 +1600,7 @@ static TypeTableEntry *analyze_fn_type(CodeGen *g, AstNode *proto_node, Scope *c...@@ -1600,7 +1600,7 @@ static TypeTableEntry *analyze_fn_type(CodeGen *g, AstNode *proto_node, Scope *c
1600 zig_unreachable();1600 zig_unreachable();
16011601
1602 case TypeTableEntryIdUndefLit:1602 case TypeTableEntryIdUndefLit:
1603 case TypeTableEntryIdNullLit:1603 case TypeTableEntryIdNull:
1604 case TypeTableEntryIdArgTuple:1604 case TypeTableEntryIdArgTuple:
1605 case TypeTableEntryIdOpaque:1605 case TypeTableEntryIdOpaque:
1606 add_node_error(g, fn_proto->return_type,1606 add_node_error(g, fn_proto->return_type,
...@@ -3338,7 +3338,7 @@ TypeTableEntry *validate_var_type(CodeGen *g, AstNode *source_node, TypeTableEnt...@@ -3338,7 +3338,7 @@ TypeTableEntry *validate_var_type(CodeGen *g, AstNode *source_node, TypeTableEnt
3338 return g->builtin_types.entry_invalid;3338 return g->builtin_types.entry_invalid;
3339 case TypeTableEntryIdUnreachable:3339 case TypeTableEntryIdUnreachable:
3340 case TypeTableEntryIdUndefLit:3340 case TypeTableEntryIdUndefLit:
3341 case TypeTableEntryIdNullLit:3341 case TypeTableEntryIdNull:
3342 case TypeTableEntryIdBlock:3342 case TypeTableEntryIdBlock:
3343 case TypeTableEntryIdArgTuple:3343 case TypeTableEntryIdArgTuple:
3344 case TypeTableEntryIdOpaque:3344 case TypeTableEntryIdOpaque:
...@@ -3485,7 +3485,7 @@ static void resolve_decl_var(CodeGen *g, TldVar *tld_var) {...@@ -3485,7 +3485,7 @@ static void resolve_decl_var(CodeGen *g, TldVar *tld_var) {
3485 {3485 {
3486 add_node_error(g, source_node, buf_sprintf("unable to infer variable type"));3486 add_node_error(g, source_node, buf_sprintf("unable to infer variable type"));
3487 implicit_type = g->builtin_types.entry_invalid;3487 implicit_type = g->builtin_types.entry_invalid;
3488 } else if (implicit_type->id == TypeTableEntryIdNullLit) {3488 } else if (implicit_type->id == TypeTableEntryIdNull) {
3489 add_node_error(g, source_node, buf_sprintf("unable to infer variable type"));3489 add_node_error(g, source_node, buf_sprintf("unable to infer variable type"));
3490 implicit_type = g->builtin_types.entry_invalid;3490 implicit_type = g->builtin_types.entry_invalid;
3491 } else if (implicit_type->id == TypeTableEntryIdMetaType && !is_const) {3491 } else if (implicit_type->id == TypeTableEntryIdMetaType && !is_const) {
...@@ -3733,7 +3733,7 @@ static bool is_container(TypeTableEntry *type_entry) {...@@ -3733,7 +3733,7 @@ static bool is_container(TypeTableEntry *type_entry) {
3733 case TypeTableEntryIdComptimeFloat:3733 case TypeTableEntryIdComptimeFloat:
3734 case TypeTableEntryIdComptimeInt:3734 case TypeTableEntryIdComptimeInt:
3735 case TypeTableEntryIdUndefLit:3735 case TypeTableEntryIdUndefLit:
3736 case TypeTableEntryIdNullLit:3736 case TypeTableEntryIdNull:
3737 case TypeTableEntryIdMaybe:3737 case TypeTableEntryIdMaybe:
3738 case TypeTableEntryIdErrorUnion:3738 case TypeTableEntryIdErrorUnion:
3739 case TypeTableEntryIdErrorSet:3739 case TypeTableEntryIdErrorSet:
...@@ -3782,7 +3782,7 @@ void resolve_container_type(CodeGen *g, TypeTableEntry *type_entry) {...@@ -3782,7 +3782,7 @@ void resolve_container_type(CodeGen *g, TypeTableEntry *type_entry) {
3782 case TypeTableEntryIdComptimeFloat:3782 case TypeTableEntryIdComptimeFloat:
3783 case TypeTableEntryIdComptimeInt:3783 case TypeTableEntryIdComptimeInt:
3784 case TypeTableEntryIdUndefLit:3784 case TypeTableEntryIdUndefLit:
3785 case TypeTableEntryIdNullLit:3785 case TypeTableEntryIdNull:
3786 case TypeTableEntryIdMaybe:3786 case TypeTableEntryIdMaybe:
3787 case TypeTableEntryIdErrorUnion:3787 case TypeTableEntryIdErrorUnion:
3788 case TypeTableEntryIdErrorSet:3788 case TypeTableEntryIdErrorSet:
...@@ -4286,7 +4286,7 @@ bool handle_is_ptr(TypeTableEntry *type_entry) {...@@ -4286,7 +4286,7 @@ bool handle_is_ptr(TypeTableEntry *type_entry) {
4286 case TypeTableEntryIdComptimeFloat:4286 case TypeTableEntryIdComptimeFloat:
4287 case TypeTableEntryIdComptimeInt:4287 case TypeTableEntryIdComptimeInt:
4288 case TypeTableEntryIdUndefLit:4288 case TypeTableEntryIdUndefLit:
4289 case TypeTableEntryIdNullLit:4289 case TypeTableEntryIdNull:
4290 case TypeTableEntryIdNamespace:4290 case TypeTableEntryIdNamespace:
4291 case TypeTableEntryIdBlock:4291 case TypeTableEntryIdBlock:
4292 case TypeTableEntryIdBoundFn:4292 case TypeTableEntryIdBoundFn:
...@@ -4674,7 +4674,7 @@ static uint32_t hash_const_val(ConstExprValue *const_val) {...@@ -4674,7 +4674,7 @@ static uint32_t hash_const_val(ConstExprValue *const_val) {
4674 return 223048345;4674 return 223048345;
4675 case TypeTableEntryIdUndefLit:4675 case TypeTableEntryIdUndefLit:
4676 return 162837799;4676 return 162837799;
4677 case TypeTableEntryIdNullLit:4677 case TypeTableEntryIdNull:
4678 return 844854567;4678 return 844854567;
4679 case TypeTableEntryIdArray:4679 case TypeTableEntryIdArray:
4680 // TODO better hashing algorithm4680 // TODO better hashing algorithm
...@@ -4757,7 +4757,7 @@ static bool can_mutate_comptime_var_state(ConstExprValue *value) {...@@ -4757,7 +4757,7 @@ static bool can_mutate_comptime_var_state(ConstExprValue *value) {
4757 case TypeTableEntryIdComptimeFloat:4757 case TypeTableEntryIdComptimeFloat:
4758 case TypeTableEntryIdComptimeInt:4758 case TypeTableEntryIdComptimeInt:
4759 case TypeTableEntryIdUndefLit:4759 case TypeTableEntryIdUndefLit:
4760 case TypeTableEntryIdNullLit:4760 case TypeTableEntryIdNull:
4761 case TypeTableEntryIdNamespace:4761 case TypeTableEntryIdNamespace:
4762 case TypeTableEntryIdBoundFn:4762 case TypeTableEntryIdBoundFn:
4763 case TypeTableEntryIdFn:4763 case TypeTableEntryIdFn:
...@@ -4822,7 +4822,7 @@ static bool return_type_is_cacheable(TypeTableEntry *return_type) {...@@ -4822,7 +4822,7 @@ static bool return_type_is_cacheable(TypeTableEntry *return_type) {
4822 case TypeTableEntryIdComptimeFloat:4822 case TypeTableEntryIdComptimeFloat:
4823 case TypeTableEntryIdComptimeInt:4823 case TypeTableEntryIdComptimeInt:
4824 case TypeTableEntryIdUndefLit:4824 case TypeTableEntryIdUndefLit:
4825 case TypeTableEntryIdNullLit:4825 case TypeTableEntryIdNull:
4826 case TypeTableEntryIdNamespace:4826 case TypeTableEntryIdNamespace:
4827 case TypeTableEntryIdBoundFn:4827 case TypeTableEntryIdBoundFn:
4828 case TypeTableEntryIdFn:4828 case TypeTableEntryIdFn:
...@@ -4933,7 +4933,7 @@ bool type_requires_comptime(TypeTableEntry *type_entry) {...@@ -4933,7 +4933,7 @@ bool type_requires_comptime(TypeTableEntry *type_entry) {
4933 case TypeTableEntryIdComptimeFloat:4933 case TypeTableEntryIdComptimeFloat:
4934 case TypeTableEntryIdComptimeInt:4934 case TypeTableEntryIdComptimeInt:
4935 case TypeTableEntryIdUndefLit:4935 case TypeTableEntryIdUndefLit:
4936 case TypeTableEntryIdNullLit:4936 case TypeTableEntryIdNull:
4937 case TypeTableEntryIdMetaType:4937 case TypeTableEntryIdMetaType:
4938 case TypeTableEntryIdNamespace:4938 case TypeTableEntryIdNamespace:
4939 case TypeTableEntryIdBlock:4939 case TypeTableEntryIdBlock:
...@@ -5412,7 +5412,7 @@ bool const_values_equal(ConstExprValue *a, ConstExprValue *b) {...@@ -5412,7 +5412,7 @@ bool const_values_equal(ConstExprValue *a, ConstExprValue *b) {
5412 return true;5412 return true;
5413 case TypeTableEntryIdUndefLit:5413 case TypeTableEntryIdUndefLit:
5414 zig_panic("TODO");5414 zig_panic("TODO");
5415 case TypeTableEntryIdNullLit:5415 case TypeTableEntryIdNull:
5416 zig_panic("TODO");5416 zig_panic("TODO");
5417 case TypeTableEntryIdMaybe:5417 case TypeTableEntryIdMaybe:
5418 if (a->data.x_maybe == nullptr || b->data.x_maybe == nullptr) {5418 if (a->data.x_maybe == nullptr || b->data.x_maybe == nullptr) {
...@@ -5646,7 +5646,7 @@ void render_const_value(CodeGen *g, Buf *buf, ConstExprValue *const_val) {...@@ -5646,7 +5646,7 @@ void render_const_value(CodeGen *g, Buf *buf, ConstExprValue *const_val) {
5646 buf_appendf(buf, "}");5646 buf_appendf(buf, "}");
5647 return;5647 return;
5648 }5648 }
5649 case TypeTableEntryIdNullLit:5649 case TypeTableEntryIdNull:
5650 {5650 {
5651 buf_appendf(buf, "null");5651 buf_appendf(buf, "null");
5652 return;5652 return;
...@@ -5764,7 +5764,7 @@ uint32_t type_id_hash(TypeId x) {...@@ -5764,7 +5764,7 @@ uint32_t type_id_hash(TypeId x) {
5764 case TypeTableEntryIdComptimeFloat:5764 case TypeTableEntryIdComptimeFloat:
5765 case TypeTableEntryIdComptimeInt:5765 case TypeTableEntryIdComptimeInt:
5766 case TypeTableEntryIdUndefLit:5766 case TypeTableEntryIdUndefLit:
5767 case TypeTableEntryIdNullLit:5767 case TypeTableEntryIdNull:
5768 case TypeTableEntryIdMaybe:5768 case TypeTableEntryIdMaybe:
5769 case TypeTableEntryIdErrorSet:5769 case TypeTableEntryIdErrorSet:
5770 case TypeTableEntryIdEnum:5770 case TypeTableEntryIdEnum:
...@@ -5810,7 +5810,7 @@ bool type_id_eql(TypeId a, TypeId b) {...@@ -5810,7 +5810,7 @@ bool type_id_eql(TypeId a, TypeId b) {
5810 case TypeTableEntryIdComptimeFloat:5810 case TypeTableEntryIdComptimeFloat:
5811 case TypeTableEntryIdComptimeInt:5811 case TypeTableEntryIdComptimeInt:
5812 case TypeTableEntryIdUndefLit:5812 case TypeTableEntryIdUndefLit:
5813 case TypeTableEntryIdNullLit:5813 case TypeTableEntryIdNull:
5814 case TypeTableEntryIdMaybe:5814 case TypeTableEntryIdMaybe:
5815 case TypeTableEntryIdPromise:5815 case TypeTableEntryIdPromise:
5816 case TypeTableEntryIdErrorSet:5816 case TypeTableEntryIdErrorSet:
...@@ -5932,7 +5932,7 @@ static const TypeTableEntryId all_type_ids[] = {...@@ -5932,7 +5932,7 @@ static const TypeTableEntryId all_type_ids[] = {
5932 TypeTableEntryIdComptimeFloat,5932 TypeTableEntryIdComptimeFloat,
5933 TypeTableEntryIdComptimeInt,5933 TypeTableEntryIdComptimeInt,
5934 TypeTableEntryIdUndefLit,5934 TypeTableEntryIdUndefLit,
5935 TypeTableEntryIdNullLit,5935 TypeTableEntryIdNull,
5936 TypeTableEntryIdMaybe,5936 TypeTableEntryIdMaybe,
5937 TypeTableEntryIdErrorUnion,5937 TypeTableEntryIdErrorUnion,
5938 TypeTableEntryIdErrorSet,5938 TypeTableEntryIdErrorSet,
...@@ -5986,7 +5986,7 @@ size_t type_id_index(TypeTableEntry *entry) {...@@ -5986,7 +5986,7 @@ size_t type_id_index(TypeTableEntry *entry) {
5986 return 10;5986 return 10;
5987 case TypeTableEntryIdUndefLit:5987 case TypeTableEntryIdUndefLit:
5988 return 11;5988 return 11;
5989 case TypeTableEntryIdNullLit:5989 case TypeTableEntryIdNull:
5990 return 12;5990 return 12;
5991 case TypeTableEntryIdMaybe:5991 case TypeTableEntryIdMaybe:
5992 return 13;5992 return 13;
...@@ -6044,8 +6044,8 @@ const char *type_id_name(TypeTableEntryId id) {...@@ -6044,8 +6044,8 @@ const char *type_id_name(TypeTableEntryId id) {
6044 return "ComptimeInt";6044 return "ComptimeInt";
6045 case TypeTableEntryIdUndefLit:6045 case TypeTableEntryIdUndefLit:
6046 return "UndefinedLiteral";6046 return "UndefinedLiteral";
6047 case TypeTableEntryIdNullLit:6047 case TypeTableEntryIdNull:
6048 return "NullLiteral";6048 return "Null";
6049 case TypeTableEntryIdMaybe:6049 case TypeTableEntryIdMaybe:
6050 return "Nullable";6050 return "Nullable";
6051 case TypeTableEntryIdErrorUnion:6051 case TypeTableEntryIdErrorUnion:
src/codegen.cpp+7-7
...@@ -4919,7 +4919,7 @@ static LLVMValueRef pack_const_int(CodeGen *g, LLVMTypeRef big_int_type_ref, Con...@@ -4919,7 +4919,7 @@ static LLVMValueRef pack_const_int(CodeGen *g, LLVMTypeRef big_int_type_ref, Con
4919 case TypeTableEntryIdComptimeFloat:4919 case TypeTableEntryIdComptimeFloat:
4920 case TypeTableEntryIdComptimeInt:4920 case TypeTableEntryIdComptimeInt:
4921 case TypeTableEntryIdUndefLit:4921 case TypeTableEntryIdUndefLit:
4922 case TypeTableEntryIdNullLit:4922 case TypeTableEntryIdNull:
4923 case TypeTableEntryIdErrorUnion:4923 case TypeTableEntryIdErrorUnion:
4924 case TypeTableEntryIdErrorSet:4924 case TypeTableEntryIdErrorSet:
4925 case TypeTableEntryIdNamespace:4925 case TypeTableEntryIdNamespace:
...@@ -5365,7 +5365,7 @@ static LLVMValueRef gen_const_val(CodeGen *g, ConstExprValue *const_val, const c...@@ -5365,7 +5365,7 @@ static LLVMValueRef gen_const_val(CodeGen *g, ConstExprValue *const_val, const c
5365 case TypeTableEntryIdComptimeFloat:5365 case TypeTableEntryIdComptimeFloat:
5366 case TypeTableEntryIdComptimeInt:5366 case TypeTableEntryIdComptimeInt:
5367 case TypeTableEntryIdUndefLit:5367 case TypeTableEntryIdUndefLit:
5368 case TypeTableEntryIdNullLit:5368 case TypeTableEntryIdNull:
5369 case TypeTableEntryIdNamespace:5369 case TypeTableEntryIdNamespace:
5370 case TypeTableEntryIdBlock:5370 case TypeTableEntryIdBlock:
5371 case TypeTableEntryIdBoundFn:5371 case TypeTableEntryIdBoundFn:
...@@ -6032,7 +6032,7 @@ static void define_builtin_types(CodeGen *g) {...@@ -6032,7 +6032,7 @@ static void define_builtin_types(CodeGen *g) {
6032 g->builtin_types.entry_undef = entry;6032 g->builtin_types.entry_undef = entry;
6033 }6033 }
6034 {6034 {
6035 TypeTableEntry *entry = new_type_table_entry(TypeTableEntryIdNullLit);6035 TypeTableEntry *entry = new_type_table_entry(TypeTableEntryIdNull);
6036 buf_init_from_str(&entry->name, "(null)");6036 buf_init_from_str(&entry->name, "(null)");
6037 entry->zero_bits = true;6037 entry->zero_bits = true;
6038 g->builtin_types.entry_null = entry;6038 g->builtin_types.entry_null = entry;
...@@ -6500,7 +6500,7 @@ static void define_builtin_compile_vars(CodeGen *g) {...@@ -6500,7 +6500,7 @@ static void define_builtin_compile_vars(CodeGen *g) {
6500 " ComptimeFloat: void,\n"6500 " ComptimeFloat: void,\n"
6501 " ComptimeInt: void,\n"6501 " ComptimeInt: void,\n"
6502 " UndefinedLiteral: void,\n"6502 " UndefinedLiteral: void,\n"
6503 " NullLiteral: void,\n"6503 " Null: void,\n"
6504 " Nullable: Nullable,\n"6504 " Nullable: Nullable,\n"
6505 " ErrorUnion: ErrorUnion,\n"6505 " ErrorUnion: ErrorUnion,\n"
6506 " ErrorSet: ErrorSet,\n"6506 " ErrorSet: ErrorSet,\n"
...@@ -7075,7 +7075,7 @@ static void prepend_c_type_to_decl_list(CodeGen *g, GenH *gen_h, TypeTableEntry...@@ -7075,7 +7075,7 @@ static void prepend_c_type_to_decl_list(CodeGen *g, GenH *gen_h, TypeTableEntry
7075 case TypeTableEntryIdComptimeFloat:7075 case TypeTableEntryIdComptimeFloat:
7076 case TypeTableEntryIdComptimeInt:7076 case TypeTableEntryIdComptimeInt:
7077 case TypeTableEntryIdUndefLit:7077 case TypeTableEntryIdUndefLit:
7078 case TypeTableEntryIdNullLit:7078 case TypeTableEntryIdNull:
7079 case TypeTableEntryIdNamespace:7079 case TypeTableEntryIdNamespace:
7080 case TypeTableEntryIdBlock:7080 case TypeTableEntryIdBlock:
7081 case TypeTableEntryIdBoundFn:7081 case TypeTableEntryIdBoundFn:
...@@ -7260,7 +7260,7 @@ static void get_c_type(CodeGen *g, GenH *gen_h, TypeTableEntry *type_entry, Buf...@@ -7260,7 +7260,7 @@ static void get_c_type(CodeGen *g, GenH *gen_h, TypeTableEntry *type_entry, Buf
7260 case TypeTableEntryIdComptimeFloat:7260 case TypeTableEntryIdComptimeFloat:
7261 case TypeTableEntryIdComptimeInt:7261 case TypeTableEntryIdComptimeInt:
7262 case TypeTableEntryIdUndefLit:7262 case TypeTableEntryIdUndefLit:
7263 case TypeTableEntryIdNullLit:7263 case TypeTableEntryIdNull:
7264 case TypeTableEntryIdArgTuple:7264 case TypeTableEntryIdArgTuple:
7265 case TypeTableEntryIdPromise:7265 case TypeTableEntryIdPromise:
7266 zig_unreachable();7266 zig_unreachable();
...@@ -7413,7 +7413,7 @@ static void gen_h_file(CodeGen *g) {...@@ -7413,7 +7413,7 @@ static void gen_h_file(CodeGen *g) {
7413 case TypeTableEntryIdComptimeInt:7413 case TypeTableEntryIdComptimeInt:
7414 case TypeTableEntryIdArray:7414 case TypeTableEntryIdArray:
7415 case TypeTableEntryIdUndefLit:7415 case TypeTableEntryIdUndefLit:
7416 case TypeTableEntryIdNullLit:7416 case TypeTableEntryIdNull:
7417 case TypeTableEntryIdErrorUnion:7417 case TypeTableEntryIdErrorUnion:
7418 case TypeTableEntryIdErrorSet:7418 case TypeTableEntryIdErrorSet:
7419 case TypeTableEntryIdNamespace:7419 case TypeTableEntryIdNamespace:
src/ir.cpp+33-33
...@@ -7960,7 +7960,7 @@ static ImplicitCastMatchResult ir_types_match_with_implicit_cast(IrAnalyze *ira,...@@ -7960,7 +7960,7 @@ static ImplicitCastMatchResult ir_types_match_with_implicit_cast(IrAnalyze *ira,
79607960
7961 // implicit conversion from null literal to maybe type7961 // implicit conversion from null literal to maybe type
7962 if (expected_type->id == TypeTableEntryIdMaybe &&7962 if (expected_type->id == TypeTableEntryIdMaybe &&
7963 actual_type->id == TypeTableEntryIdNullLit)7963 actual_type->id == TypeTableEntryIdNull)
7964 {7964 {
7965 return ImplicitCastMatchResultYes;7965 return ImplicitCastMatchResultYes;
7966 }7966 }
...@@ -8190,7 +8190,7 @@ static TypeTableEntry *ir_resolve_peer_types(IrAnalyze *ira, AstNode *source_nod...@@ -8190,7 +8190,7 @@ static TypeTableEntry *ir_resolve_peer_types(IrAnalyze *ira, AstNode *source_nod
8190 }8190 }
8191 }8191 }
81928192
8193 bool any_are_null = (prev_inst->value.type->id == TypeTableEntryIdNullLit);8193 bool any_are_null = (prev_inst->value.type->id == TypeTableEntryIdNull);
8194 bool convert_to_const_slice = false;8194 bool convert_to_const_slice = false;
8195 for (size_t i = 1; i < instruction_count; i += 1) {8195 for (size_t i = 1; i < instruction_count; i += 1) {
8196 IrInstruction *cur_inst = instructions[i];8196 IrInstruction *cur_inst = instructions[i];
...@@ -8469,12 +8469,12 @@ static TypeTableEntry *ir_resolve_peer_types(IrAnalyze *ira, AstNode *source_nod...@@ -8469,12 +8469,12 @@ static TypeTableEntry *ir_resolve_peer_types(IrAnalyze *ira, AstNode *source_nod
8469 }8469 }
8470 }8470 }
84718471
8472 if (prev_type->id == TypeTableEntryIdNullLit) {8472 if (prev_type->id == TypeTableEntryIdNull) {
8473 prev_inst = cur_inst;8473 prev_inst = cur_inst;
8474 continue;8474 continue;
8475 }8475 }
84768476
8477 if (cur_type->id == TypeTableEntryIdNullLit) {8477 if (cur_type->id == TypeTableEntryIdNull) {
8478 any_are_null = true;8478 any_are_null = true;
8479 continue;8479 continue;
8480 }8480 }
...@@ -8677,7 +8677,7 @@ static TypeTableEntry *ir_resolve_peer_types(IrAnalyze *ira, AstNode *source_nod...@@ -8677,7 +8677,7 @@ static TypeTableEntry *ir_resolve_peer_types(IrAnalyze *ira, AstNode *source_nod
8677 ir_add_error_node(ira, source_node,8677 ir_add_error_node(ira, source_node,
8678 buf_sprintf("unable to make error union out of number literal"));8678 buf_sprintf("unable to make error union out of number literal"));
8679 return ira->codegen->builtin_types.entry_invalid;8679 return ira->codegen->builtin_types.entry_invalid;
8680 } else if (prev_inst->value.type->id == TypeTableEntryIdNullLit) {8680 } else if (prev_inst->value.type->id == TypeTableEntryIdNull) {
8681 ir_add_error_node(ira, source_node,8681 ir_add_error_node(ira, source_node,
8682 buf_sprintf("unable to make error union out of null literal"));8682 buf_sprintf("unable to make error union out of null literal"));
8683 return ira->codegen->builtin_types.entry_invalid;8683 return ira->codegen->builtin_types.entry_invalid;
...@@ -8685,7 +8685,7 @@ static TypeTableEntry *ir_resolve_peer_types(IrAnalyze *ira, AstNode *source_nod...@@ -8685,7 +8685,7 @@ static TypeTableEntry *ir_resolve_peer_types(IrAnalyze *ira, AstNode *source_nod
8685 return get_error_union_type(ira->codegen, err_set_type, prev_inst->value.type);8685 return get_error_union_type(ira->codegen, err_set_type, prev_inst->value.type);
8686 }8686 }
8687 }8687 }
8688 } else if (any_are_null && prev_inst->value.type->id != TypeTableEntryIdNullLit) {8688 } else if (any_are_null && prev_inst->value.type->id != TypeTableEntryIdNull) {
8689 if (prev_inst->value.type->id == TypeTableEntryIdComptimeInt ||8689 if (prev_inst->value.type->id == TypeTableEntryIdComptimeInt ||
8690 prev_inst->value.type->id == TypeTableEntryIdComptimeFloat)8690 prev_inst->value.type->id == TypeTableEntryIdComptimeFloat)
8691 {8691 {
...@@ -10004,7 +10004,7 @@ static IrInstruction *ir_analyze_cast(IrAnalyze *ira, IrInstruction *source_inst...@@ -10004,7 +10004,7 @@ static IrInstruction *ir_analyze_cast(IrAnalyze *ira, IrInstruction *source_inst
1000410004
10005 // explicit cast from null literal to maybe type10005 // explicit cast from null literal to maybe type
10006 if (wanted_type->id == TypeTableEntryIdMaybe &&10006 if (wanted_type->id == TypeTableEntryIdMaybe &&
10007 actual_type->id == TypeTableEntryIdNullLit)10007 actual_type->id == TypeTableEntryIdNull)
10008 {10008 {
10009 return ir_analyze_null_to_maybe(ira, source_instr, value, wanted_type);10009 return ir_analyze_null_to_maybe(ira, source_instr, value, wanted_type);
10010 }10010 }
...@@ -10061,7 +10061,7 @@ static IrInstruction *ir_analyze_cast(IrAnalyze *ira, IrInstruction *source_inst...@@ -10061,7 +10061,7 @@ static IrInstruction *ir_analyze_cast(IrAnalyze *ira, IrInstruction *source_inst
10061 {10061 {
10062 TypeTableEntry *wanted_child_type = wanted_type->data.error_union.payload_type->data.maybe.child_type;10062 TypeTableEntry *wanted_child_type = wanted_type->data.error_union.payload_type->data.maybe.child_type;
10063 if (types_match_const_cast_only(ira, wanted_child_type, actual_type, source_node).id == ConstCastResultIdOk ||10063 if (types_match_const_cast_only(ira, wanted_child_type, actual_type, source_node).id == ConstCastResultIdOk ||
10064 actual_type->id == TypeTableEntryIdNullLit ||10064 actual_type->id == TypeTableEntryIdNull ||
10065 actual_type->id == TypeTableEntryIdComptimeInt ||10065 actual_type->id == TypeTableEntryIdComptimeInt ||
10066 actual_type->id == TypeTableEntryIdComptimeFloat)10066 actual_type->id == TypeTableEntryIdComptimeFloat)
10067 {10067 {
...@@ -10627,19 +10627,19 @@ static TypeTableEntry *ir_analyze_bin_op_cmp(IrAnalyze *ira, IrInstructionBinOp...@@ -10627,19 +10627,19 @@ static TypeTableEntry *ir_analyze_bin_op_cmp(IrAnalyze *ira, IrInstructionBinOp
10627 IrBinOp op_id = bin_op_instruction->op_id;10627 IrBinOp op_id = bin_op_instruction->op_id;
10628 bool is_equality_cmp = (op_id == IrBinOpCmpEq || op_id == IrBinOpCmpNotEq);10628 bool is_equality_cmp = (op_id == IrBinOpCmpEq || op_id == IrBinOpCmpNotEq);
10629 if (is_equality_cmp &&10629 if (is_equality_cmp &&
10630 ((op1->value.type->id == TypeTableEntryIdNullLit && op2->value.type->id == TypeTableEntryIdMaybe) ||10630 ((op1->value.type->id == TypeTableEntryIdNull && op2->value.type->id == TypeTableEntryIdMaybe) ||
10631 (op2->value.type->id == TypeTableEntryIdNullLit && op1->value.type->id == TypeTableEntryIdMaybe) ||10631 (op2->value.type->id == TypeTableEntryIdNull && op1->value.type->id == TypeTableEntryIdMaybe) ||
10632 (op1->value.type->id == TypeTableEntryIdNullLit && op2->value.type->id == TypeTableEntryIdNullLit)))10632 (op1->value.type->id == TypeTableEntryIdNull && op2->value.type->id == TypeTableEntryIdNull)))
10633 {10633 {
10634 if (op1->value.type->id == TypeTableEntryIdNullLit && op2->value.type->id == TypeTableEntryIdNullLit) {10634 if (op1->value.type->id == TypeTableEntryIdNull && op2->value.type->id == TypeTableEntryIdNull) {
10635 ConstExprValue *out_val = ir_build_const_from(ira, &bin_op_instruction->base);10635 ConstExprValue *out_val = ir_build_const_from(ira, &bin_op_instruction->base);
10636 out_val->data.x_bool = (op_id == IrBinOpCmpEq);10636 out_val->data.x_bool = (op_id == IrBinOpCmpEq);
10637 return ira->codegen->builtin_types.entry_bool;10637 return ira->codegen->builtin_types.entry_bool;
10638 }10638 }
10639 IrInstruction *maybe_op;10639 IrInstruction *maybe_op;
10640 if (op1->value.type->id == TypeTableEntryIdNullLit) {10640 if (op1->value.type->id == TypeTableEntryIdNull) {
10641 maybe_op = op2;10641 maybe_op = op2;
10642 } else if (op2->value.type->id == TypeTableEntryIdNullLit) {10642 } else if (op2->value.type->id == TypeTableEntryIdNull) {
10643 maybe_op = op1;10643 maybe_op = op1;
10644 } else {10644 } else {
10645 zig_unreachable();10645 zig_unreachable();
...@@ -10796,7 +10796,7 @@ static TypeTableEntry *ir_analyze_bin_op_cmp(IrAnalyze *ira, IrInstructionBinOp...@@ -10796,7 +10796,7 @@ static TypeTableEntry *ir_analyze_bin_op_cmp(IrAnalyze *ira, IrInstructionBinOp
10796 case TypeTableEntryIdArray:10796 case TypeTableEntryIdArray:
10797 case TypeTableEntryIdStruct:10797 case TypeTableEntryIdStruct:
10798 case TypeTableEntryIdUndefLit:10798 case TypeTableEntryIdUndefLit:
10799 case TypeTableEntryIdNullLit:10799 case TypeTableEntryIdNull:
10800 case TypeTableEntryIdMaybe:10800 case TypeTableEntryIdMaybe:
10801 case TypeTableEntryIdErrorUnion:10801 case TypeTableEntryIdErrorUnion:
10802 case TypeTableEntryIdUnion:10802 case TypeTableEntryIdUnion:
...@@ -11645,7 +11645,7 @@ static VarClassRequired get_var_class_required(TypeTableEntry *type_entry) {...@@ -11645,7 +11645,7 @@ static VarClassRequired get_var_class_required(TypeTableEntry *type_entry) {
11645 case TypeTableEntryIdComptimeInt:11645 case TypeTableEntryIdComptimeInt:
11646 case TypeTableEntryIdUndefLit:11646 case TypeTableEntryIdUndefLit:
11647 case TypeTableEntryIdBlock:11647 case TypeTableEntryIdBlock:
11648 case TypeTableEntryIdNullLit:11648 case TypeTableEntryIdNull:
11649 case TypeTableEntryIdOpaque:11649 case TypeTableEntryIdOpaque:
11650 case TypeTableEntryIdMetaType:11650 case TypeTableEntryIdMetaType:
11651 case TypeTableEntryIdNamespace:11651 case TypeTableEntryIdNamespace:
...@@ -11913,7 +11913,7 @@ static TypeTableEntry *ir_analyze_instruction_export(IrAnalyze *ira, IrInstructi...@@ -11913,7 +11913,7 @@ static TypeTableEntry *ir_analyze_instruction_export(IrAnalyze *ira, IrInstructi
11913 case TypeTableEntryIdComptimeFloat:11913 case TypeTableEntryIdComptimeFloat:
11914 case TypeTableEntryIdComptimeInt:11914 case TypeTableEntryIdComptimeInt:
11915 case TypeTableEntryIdUndefLit:11915 case TypeTableEntryIdUndefLit:
11916 case TypeTableEntryIdNullLit:11916 case TypeTableEntryIdNull:
11917 case TypeTableEntryIdMaybe:11917 case TypeTableEntryIdMaybe:
11918 case TypeTableEntryIdErrorUnion:11918 case TypeTableEntryIdErrorUnion:
11919 case TypeTableEntryIdErrorSet:11919 case TypeTableEntryIdErrorSet:
...@@ -11937,7 +11937,7 @@ static TypeTableEntry *ir_analyze_instruction_export(IrAnalyze *ira, IrInstructi...@@ -11937,7 +11937,7 @@ static TypeTableEntry *ir_analyze_instruction_export(IrAnalyze *ira, IrInstructi
11937 case TypeTableEntryIdComptimeFloat:11937 case TypeTableEntryIdComptimeFloat:
11938 case TypeTableEntryIdComptimeInt:11938 case TypeTableEntryIdComptimeInt:
11939 case TypeTableEntryIdUndefLit:11939 case TypeTableEntryIdUndefLit:
11940 case TypeTableEntryIdNullLit:11940 case TypeTableEntryIdNull:
11941 case TypeTableEntryIdMaybe:11941 case TypeTableEntryIdMaybe:
11942 case TypeTableEntryIdErrorUnion:11942 case TypeTableEntryIdErrorUnion:
11943 case TypeTableEntryIdErrorSet:11943 case TypeTableEntryIdErrorSet:
...@@ -12901,7 +12901,7 @@ static TypeTableEntry *ir_analyze_maybe(IrAnalyze *ira, IrInstructionUnOp *un_op...@@ -12901,7 +12901,7 @@ static TypeTableEntry *ir_analyze_maybe(IrAnalyze *ira, IrInstructionUnOp *un_op
12901 case TypeTableEntryIdComptimeFloat:12901 case TypeTableEntryIdComptimeFloat:
12902 case TypeTableEntryIdComptimeInt:12902 case TypeTableEntryIdComptimeInt:
12903 case TypeTableEntryIdUndefLit:12903 case TypeTableEntryIdUndefLit:
12904 case TypeTableEntryIdNullLit:12904 case TypeTableEntryIdNull:
12905 case TypeTableEntryIdMaybe:12905 case TypeTableEntryIdMaybe:
12906 case TypeTableEntryIdErrorUnion:12906 case TypeTableEntryIdErrorUnion:
12907 case TypeTableEntryIdErrorSet:12907 case TypeTableEntryIdErrorSet:
...@@ -13152,7 +13152,7 @@ static TypeTableEntry *ir_analyze_instruction_phi(IrAnalyze *ira, IrInstructionP...@@ -13152,7 +13152,7 @@ static TypeTableEntry *ir_analyze_instruction_phi(IrAnalyze *ira, IrInstructionP
1315213152
13153 if (resolved_type->id == TypeTableEntryIdComptimeFloat ||13153 if (resolved_type->id == TypeTableEntryIdComptimeFloat ||
13154 resolved_type->id == TypeTableEntryIdComptimeInt ||13154 resolved_type->id == TypeTableEntryIdComptimeInt ||
13155 resolved_type->id == TypeTableEntryIdNullLit ||13155 resolved_type->id == TypeTableEntryIdNull ||
13156 resolved_type->id == TypeTableEntryIdUndefLit)13156 resolved_type->id == TypeTableEntryIdUndefLit)
13157 {13157 {
13158 ir_add_error_node(ira, phi_instruction->base.source_node,13158 ir_add_error_node(ira, phi_instruction->base.source_node,
...@@ -14216,7 +14216,7 @@ static TypeTableEntry *ir_analyze_instruction_typeof(IrAnalyze *ira, IrInstructi...@@ -14216,7 +14216,7 @@ static TypeTableEntry *ir_analyze_instruction_typeof(IrAnalyze *ira, IrInstructi
14216 case TypeTableEntryIdComptimeFloat:14216 case TypeTableEntryIdComptimeFloat:
14217 case TypeTableEntryIdComptimeInt:14217 case TypeTableEntryIdComptimeInt:
14218 case TypeTableEntryIdUndefLit:14218 case TypeTableEntryIdUndefLit:
14219 case TypeTableEntryIdNullLit:14219 case TypeTableEntryIdNull:
14220 case TypeTableEntryIdNamespace:14220 case TypeTableEntryIdNamespace:
14221 case TypeTableEntryIdBlock:14221 case TypeTableEntryIdBlock:
14222 case TypeTableEntryIdBoundFn:14222 case TypeTableEntryIdBoundFn:
...@@ -14480,7 +14480,7 @@ static TypeTableEntry *ir_analyze_instruction_slice_type(IrAnalyze *ira,...@@ -14480,7 +14480,7 @@ static TypeTableEntry *ir_analyze_instruction_slice_type(IrAnalyze *ira,
14480 zig_unreachable();14480 zig_unreachable();
14481 case TypeTableEntryIdUnreachable:14481 case TypeTableEntryIdUnreachable:
14482 case TypeTableEntryIdUndefLit:14482 case TypeTableEntryIdUndefLit:
14483 case TypeTableEntryIdNullLit:14483 case TypeTableEntryIdNull:
14484 case TypeTableEntryIdBlock:14484 case TypeTableEntryIdBlock:
14485 case TypeTableEntryIdArgTuple:14485 case TypeTableEntryIdArgTuple:
14486 case TypeTableEntryIdOpaque:14486 case TypeTableEntryIdOpaque:
...@@ -14588,7 +14588,7 @@ static TypeTableEntry *ir_analyze_instruction_array_type(IrAnalyze *ira,...@@ -14588,7 +14588,7 @@ static TypeTableEntry *ir_analyze_instruction_array_type(IrAnalyze *ira,
14588 zig_unreachable();14588 zig_unreachable();
14589 case TypeTableEntryIdUnreachable:14589 case TypeTableEntryIdUnreachable:
14590 case TypeTableEntryIdUndefLit:14590 case TypeTableEntryIdUndefLit:
14591 case TypeTableEntryIdNullLit:14591 case TypeTableEntryIdNull:
14592 case TypeTableEntryIdBlock:14592 case TypeTableEntryIdBlock:
14593 case TypeTableEntryIdArgTuple:14593 case TypeTableEntryIdArgTuple:
14594 case TypeTableEntryIdOpaque:14594 case TypeTableEntryIdOpaque:
...@@ -14657,7 +14657,7 @@ static TypeTableEntry *ir_analyze_instruction_size_of(IrAnalyze *ira,...@@ -14657,7 +14657,7 @@ static TypeTableEntry *ir_analyze_instruction_size_of(IrAnalyze *ira,
14657 zig_unreachable();14657 zig_unreachable();
14658 case TypeTableEntryIdUnreachable:14658 case TypeTableEntryIdUnreachable:
14659 case TypeTableEntryIdUndefLit:14659 case TypeTableEntryIdUndefLit:
14660 case TypeTableEntryIdNullLit:14660 case TypeTableEntryIdNull:
14661 case TypeTableEntryIdBlock:14661 case TypeTableEntryIdBlock:
14662 case TypeTableEntryIdComptimeFloat:14662 case TypeTableEntryIdComptimeFloat:
14663 case TypeTableEntryIdComptimeInt:14663 case TypeTableEntryIdComptimeInt:
...@@ -14713,7 +14713,7 @@ static TypeTableEntry *ir_analyze_instruction_test_non_null(IrAnalyze *ira, IrIn...@@ -14713,7 +14713,7 @@ static TypeTableEntry *ir_analyze_instruction_test_non_null(IrAnalyze *ira, IrIn
1471314713
14714 ir_build_test_nonnull_from(&ira->new_irb, &instruction->base, value);14714 ir_build_test_nonnull_from(&ira->new_irb, &instruction->base, value);
14715 return ira->codegen->builtin_types.entry_bool;14715 return ira->codegen->builtin_types.entry_bool;
14716 } else if (type_entry->id == TypeTableEntryIdNullLit) {14716 } else if (type_entry->id == TypeTableEntryIdNull) {
14717 ConstExprValue *out_val = ir_build_const_from(ira, &instruction->base);14717 ConstExprValue *out_val = ir_build_const_from(ira, &instruction->base);
14718 out_val->data.x_bool = false;14718 out_val->data.x_bool = false;
14719 return ira->codegen->builtin_types.entry_bool;14719 return ira->codegen->builtin_types.entry_bool;
...@@ -15100,7 +15100,7 @@ static TypeTableEntry *ir_analyze_instruction_switch_target(IrAnalyze *ira,...@@ -15100,7 +15100,7 @@ static TypeTableEntry *ir_analyze_instruction_switch_target(IrAnalyze *ira,
15100 case TypeTableEntryIdArray:15100 case TypeTableEntryIdArray:
15101 case TypeTableEntryIdStruct:15101 case TypeTableEntryIdStruct:
15102 case TypeTableEntryIdUndefLit:15102 case TypeTableEntryIdUndefLit:
15103 case TypeTableEntryIdNullLit:15103 case TypeTableEntryIdNull:
15104 case TypeTableEntryIdMaybe:15104 case TypeTableEntryIdMaybe:
15105 case TypeTableEntryIdBlock:15105 case TypeTableEntryIdBlock:
15106 case TypeTableEntryIdBoundFn:15106 case TypeTableEntryIdBoundFn:
...@@ -15621,7 +15621,7 @@ static TypeTableEntry *ir_analyze_min_max(IrAnalyze *ira, IrInstruction *source_...@@ -15621,7 +15621,7 @@ static TypeTableEntry *ir_analyze_min_max(IrAnalyze *ira, IrInstruction *source_
15621 case TypeTableEntryIdComptimeFloat:15621 case TypeTableEntryIdComptimeFloat:
15622 case TypeTableEntryIdComptimeInt:15622 case TypeTableEntryIdComptimeInt:
15623 case TypeTableEntryIdUndefLit:15623 case TypeTableEntryIdUndefLit:
15624 case TypeTableEntryIdNullLit:15624 case TypeTableEntryIdNull:
15625 case TypeTableEntryIdMaybe:15625 case TypeTableEntryIdMaybe:
15626 case TypeTableEntryIdErrorUnion:15626 case TypeTableEntryIdErrorUnion:
15627 case TypeTableEntryIdErrorSet:15627 case TypeTableEntryIdErrorSet:
...@@ -16283,7 +16283,7 @@ static ConstExprValue *ir_make_type_info_value(IrAnalyze *ira, TypeTableEntry *t...@@ -16283,7 +16283,7 @@ static ConstExprValue *ir_make_type_info_value(IrAnalyze *ira, TypeTableEntry *t
16283 case TypeTableEntryIdComptimeFloat:16283 case TypeTableEntryIdComptimeFloat:
16284 case TypeTableEntryIdComptimeInt:16284 case TypeTableEntryIdComptimeInt:
16285 case TypeTableEntryIdUndefLit:16285 case TypeTableEntryIdUndefLit:
16286 case TypeTableEntryIdNullLit:16286 case TypeTableEntryIdNull:
16287 case TypeTableEntryIdNamespace:16287 case TypeTableEntryIdNamespace:
16288 case TypeTableEntryIdBlock:16288 case TypeTableEntryIdBlock:
16289 case TypeTableEntryIdArgTuple:16289 case TypeTableEntryIdArgTuple:
...@@ -17879,7 +17879,7 @@ static TypeTableEntry *ir_analyze_instruction_align_of(IrAnalyze *ira, IrInstruc...@@ -17879,7 +17879,7 @@ static TypeTableEntry *ir_analyze_instruction_align_of(IrAnalyze *ira, IrInstruc
17879 case TypeTableEntryIdComptimeFloat:17879 case TypeTableEntryIdComptimeFloat:
17880 case TypeTableEntryIdComptimeInt:17880 case TypeTableEntryIdComptimeInt:
17881 case TypeTableEntryIdUndefLit:17881 case TypeTableEntryIdUndefLit:
17882 case TypeTableEntryIdNullLit:17882 case TypeTableEntryIdNull:
17883 case TypeTableEntryIdNamespace:17883 case TypeTableEntryIdNamespace:
17884 case TypeTableEntryIdBlock:17884 case TypeTableEntryIdBlock:
17885 case TypeTableEntryIdBoundFn:17885 case TypeTableEntryIdBoundFn:
...@@ -18613,7 +18613,7 @@ static void buf_write_value_bytes(CodeGen *codegen, uint8_t *buf, ConstExprValue...@@ -18613,7 +18613,7 @@ static void buf_write_value_bytes(CodeGen *codegen, uint8_t *buf, ConstExprValue
18613 case TypeTableEntryIdComptimeFloat:18613 case TypeTableEntryIdComptimeFloat:
18614 case TypeTableEntryIdComptimeInt:18614 case TypeTableEntryIdComptimeInt:
18615 case TypeTableEntryIdUndefLit:18615 case TypeTableEntryIdUndefLit:
18616 case TypeTableEntryIdNullLit:18616 case TypeTableEntryIdNull:
18617 case TypeTableEntryIdPromise:18617 case TypeTableEntryIdPromise:
18618 zig_unreachable();18618 zig_unreachable();
18619 case TypeTableEntryIdVoid:18619 case TypeTableEntryIdVoid:
...@@ -18680,7 +18680,7 @@ static void buf_read_value_bytes(CodeGen *codegen, uint8_t *buf, ConstExprValue...@@ -18680,7 +18680,7 @@ static void buf_read_value_bytes(CodeGen *codegen, uint8_t *buf, ConstExprValue
18680 case TypeTableEntryIdComptimeFloat:18680 case TypeTableEntryIdComptimeFloat:
18681 case TypeTableEntryIdComptimeInt:18681 case TypeTableEntryIdComptimeInt:
18682 case TypeTableEntryIdUndefLit:18682 case TypeTableEntryIdUndefLit:
18683 case TypeTableEntryIdNullLit:18683 case TypeTableEntryIdNull:
18684 case TypeTableEntryIdPromise:18684 case TypeTableEntryIdPromise:
18685 zig_unreachable();18685 zig_unreachable();
18686 case TypeTableEntryIdVoid:18686 case TypeTableEntryIdVoid:
...@@ -18761,7 +18761,7 @@ static TypeTableEntry *ir_analyze_instruction_bit_cast(IrAnalyze *ira, IrInstruc...@@ -18761,7 +18761,7 @@ static TypeTableEntry *ir_analyze_instruction_bit_cast(IrAnalyze *ira, IrInstruc
18761 case TypeTableEntryIdComptimeFloat:18761 case TypeTableEntryIdComptimeFloat:
18762 case TypeTableEntryIdComptimeInt:18762 case TypeTableEntryIdComptimeInt:
18763 case TypeTableEntryIdUndefLit:18763 case TypeTableEntryIdUndefLit:
18764 case TypeTableEntryIdNullLit:18764 case TypeTableEntryIdNull:
18765 ir_add_error(ira, dest_type_value,18765 ir_add_error(ira, dest_type_value,
18766 buf_sprintf("unable to @bitCast from type '%s'", buf_ptr(&src_type->name)));18766 buf_sprintf("unable to @bitCast from type '%s'", buf_ptr(&src_type->name)));
18767 return ira->codegen->builtin_types.entry_invalid;18767 return ira->codegen->builtin_types.entry_invalid;
...@@ -18787,7 +18787,7 @@ static TypeTableEntry *ir_analyze_instruction_bit_cast(IrAnalyze *ira, IrInstruc...@@ -18787,7 +18787,7 @@ static TypeTableEntry *ir_analyze_instruction_bit_cast(IrAnalyze *ira, IrInstruc
18787 case TypeTableEntryIdComptimeFloat:18787 case TypeTableEntryIdComptimeFloat:
18788 case TypeTableEntryIdComptimeInt:18788 case TypeTableEntryIdComptimeInt:
18789 case TypeTableEntryIdUndefLit:18789 case TypeTableEntryIdUndefLit:
18790 case TypeTableEntryIdNullLit:18790 case TypeTableEntryIdNull:
18791 ir_add_error(ira, dest_type_value,18791 ir_add_error(ira, dest_type_value,
18792 buf_sprintf("unable to @bitCast to type '%s'", buf_ptr(&dest_type->name)));18792 buf_sprintf("unable to @bitCast to type '%s'", buf_ptr(&dest_type->name)));
18793 return ira->codegen->builtin_types.entry_invalid;18793 return ira->codegen->builtin_types.entry_invalid;
test/cases/misc.zig+1-1
...@@ -504,7 +504,7 @@ test "@typeId" {...@@ -504,7 +504,7 @@ test "@typeId" {
504 assert(@typeId(@typeOf(1)) == Tid.ComptimeInt);504 assert(@typeId(@typeOf(1)) == Tid.ComptimeInt);
505 assert(@typeId(@typeOf(1.0)) == Tid.ComptimeFloat);505 assert(@typeId(@typeOf(1.0)) == Tid.ComptimeFloat);
506 assert(@typeId(@typeOf(undefined)) == Tid.UndefinedLiteral);506 assert(@typeId(@typeOf(undefined)) == Tid.UndefinedLiteral);
507 assert(@typeId(@typeOf(null)) == Tid.NullLiteral);507 assert(@typeId(@typeOf(null)) == Tid.Null);
508 assert(@typeId(?i32) == Tid.Nullable);508 assert(@typeId(?i32) == Tid.Nullable);
509 assert(@typeId(error!i32) == Tid.ErrorUnion);509 assert(@typeId(error!i32) == Tid.ErrorUnion);
510 assert(@typeId(error) == Tid.ErrorSet);510 assert(@typeId(error) == Tid.ErrorSet);