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 {
48964896 ComptimeFloat,
48974897 ComptimeInt,
48984898 UndefinedLiteral,
4899 NullLiteral,
4899 Null,
49004900 Nullable,
49014901 ErrorUnion,
49024902 Error,
......@@ -4930,7 +4930,7 @@ pub const TypeInfo = union(TypeId) {
49304930 ComptimeFloat: void,
49314931 ComptimeInt: void,
49324932 UndefinedLiteral: void,
4933 NullLiteral: void,
4933 Null: void,
49344934 Nullable: Nullable,
49354935 ErrorUnion: ErrorUnion,
49364936 ErrorSet: ErrorSet,
......@@ -5688,7 +5688,7 @@ pub const TypeId = enum {
56885688 ComptimeFloat,
56895689 ComptimeInt,
56905690 UndefinedLiteral,
5691 NullLiteral,
5691 Null,
56925692 Nullable,
56935693 ErrorUnion,
56945694 ErrorSet,
src/all_types.hpp+1-1
......@@ -1162,7 +1162,7 @@ enum TypeTableEntryId {
11621162 TypeTableEntryIdComptimeFloat,
11631163 TypeTableEntryIdComptimeInt,
11641164 TypeTableEntryIdUndefLit,
1165 TypeTableEntryIdNullLit,
1165 TypeTableEntryIdNull,
11661166 TypeTableEntryIdMaybe,
11671167 TypeTableEntryIdErrorUnion,
11681168 TypeTableEntryIdErrorSet,
src/analyze.cpp+23-23
......@@ -235,7 +235,7 @@ bool type_is_complete(TypeTableEntry *type_entry) {
235235 case TypeTableEntryIdComptimeFloat:
236236 case TypeTableEntryIdComptimeInt:
237237 case TypeTableEntryIdUndefLit:
238 case TypeTableEntryIdNullLit:
238 case TypeTableEntryIdNull:
239239 case TypeTableEntryIdMaybe:
240240 case TypeTableEntryIdErrorUnion:
241241 case TypeTableEntryIdErrorSet:
......@@ -271,7 +271,7 @@ bool type_has_zero_bits_known(TypeTableEntry *type_entry) {
271271 case TypeTableEntryIdComptimeFloat:
272272 case TypeTableEntryIdComptimeInt:
273273 case TypeTableEntryIdUndefLit:
274 case TypeTableEntryIdNullLit:
274 case TypeTableEntryIdNull:
275275 case TypeTableEntryIdMaybe:
276276 case TypeTableEntryIdErrorUnion:
277277 case TypeTableEntryIdErrorSet:
......@@ -1336,7 +1336,7 @@ static bool type_allowed_in_packed_struct(TypeTableEntry *type_entry) {
13361336 case TypeTableEntryIdComptimeFloat:
13371337 case TypeTableEntryIdComptimeInt:
13381338 case TypeTableEntryIdUndefLit:
1339 case TypeTableEntryIdNullLit:
1339 case TypeTableEntryIdNull:
13401340 case TypeTableEntryIdErrorUnion:
13411341 case TypeTableEntryIdErrorSet:
13421342 case TypeTableEntryIdNamespace:
......@@ -1377,7 +1377,7 @@ static bool type_allowed_in_extern(CodeGen *g, TypeTableEntry *type_entry) {
13771377 case TypeTableEntryIdComptimeFloat:
13781378 case TypeTableEntryIdComptimeInt:
13791379 case TypeTableEntryIdUndefLit:
1380 case TypeTableEntryIdNullLit:
1380 case TypeTableEntryIdNull:
13811381 case TypeTableEntryIdErrorUnion:
13821382 case TypeTableEntryIdErrorSet:
13831383 case TypeTableEntryIdNamespace:
......@@ -1512,7 +1512,7 @@ static TypeTableEntry *analyze_fn_type(CodeGen *g, AstNode *proto_node, Scope *c
15121512 return g->builtin_types.entry_invalid;
15131513 case TypeTableEntryIdUnreachable:
15141514 case TypeTableEntryIdUndefLit:
1515 case TypeTableEntryIdNullLit:
1515 case TypeTableEntryIdNull:
15161516 case TypeTableEntryIdArgTuple:
15171517 case TypeTableEntryIdOpaque:
15181518 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
16001600 zig_unreachable();
16011601
16021602 case TypeTableEntryIdUndefLit:
1603 case TypeTableEntryIdNullLit:
1603 case TypeTableEntryIdNull:
16041604 case TypeTableEntryIdArgTuple:
16051605 case TypeTableEntryIdOpaque:
16061606 add_node_error(g, fn_proto->return_type,
......@@ -3338,7 +3338,7 @@ TypeTableEntry *validate_var_type(CodeGen *g, AstNode *source_node, TypeTableEnt
33383338 return g->builtin_types.entry_invalid;
33393339 case TypeTableEntryIdUnreachable:
33403340 case TypeTableEntryIdUndefLit:
3341 case TypeTableEntryIdNullLit:
3341 case TypeTableEntryIdNull:
33423342 case TypeTableEntryIdBlock:
33433343 case TypeTableEntryIdArgTuple:
33443344 case TypeTableEntryIdOpaque:
......@@ -3485,7 +3485,7 @@ static void resolve_decl_var(CodeGen *g, TldVar *tld_var) {
34853485 {
34863486 add_node_error(g, source_node, buf_sprintf("unable to infer variable type"));
34873487 implicit_type = g->builtin_types.entry_invalid;
3488 } else if (implicit_type->id == TypeTableEntryIdNullLit) {
3488 } else if (implicit_type->id == TypeTableEntryIdNull) {
34893489 add_node_error(g, source_node, buf_sprintf("unable to infer variable type"));
34903490 implicit_type = g->builtin_types.entry_invalid;
34913491 } else if (implicit_type->id == TypeTableEntryIdMetaType && !is_const) {
......@@ -3733,7 +3733,7 @@ static bool is_container(TypeTableEntry *type_entry) {
37333733 case TypeTableEntryIdComptimeFloat:
37343734 case TypeTableEntryIdComptimeInt:
37353735 case TypeTableEntryIdUndefLit:
3736 case TypeTableEntryIdNullLit:
3736 case TypeTableEntryIdNull:
37373737 case TypeTableEntryIdMaybe:
37383738 case TypeTableEntryIdErrorUnion:
37393739 case TypeTableEntryIdErrorSet:
......@@ -3782,7 +3782,7 @@ void resolve_container_type(CodeGen *g, TypeTableEntry *type_entry) {
37823782 case TypeTableEntryIdComptimeFloat:
37833783 case TypeTableEntryIdComptimeInt:
37843784 case TypeTableEntryIdUndefLit:
3785 case TypeTableEntryIdNullLit:
3785 case TypeTableEntryIdNull:
37863786 case TypeTableEntryIdMaybe:
37873787 case TypeTableEntryIdErrorUnion:
37883788 case TypeTableEntryIdErrorSet:
......@@ -4286,7 +4286,7 @@ bool handle_is_ptr(TypeTableEntry *type_entry) {
42864286 case TypeTableEntryIdComptimeFloat:
42874287 case TypeTableEntryIdComptimeInt:
42884288 case TypeTableEntryIdUndefLit:
4289 case TypeTableEntryIdNullLit:
4289 case TypeTableEntryIdNull:
42904290 case TypeTableEntryIdNamespace:
42914291 case TypeTableEntryIdBlock:
42924292 case TypeTableEntryIdBoundFn:
......@@ -4674,7 +4674,7 @@ static uint32_t hash_const_val(ConstExprValue *const_val) {
46744674 return 223048345;
46754675 case TypeTableEntryIdUndefLit:
46764676 return 162837799;
4677 case TypeTableEntryIdNullLit:
4677 case TypeTableEntryIdNull:
46784678 return 844854567;
46794679 case TypeTableEntryIdArray:
46804680 // TODO better hashing algorithm
......@@ -4757,7 +4757,7 @@ static bool can_mutate_comptime_var_state(ConstExprValue *value) {
47574757 case TypeTableEntryIdComptimeFloat:
47584758 case TypeTableEntryIdComptimeInt:
47594759 case TypeTableEntryIdUndefLit:
4760 case TypeTableEntryIdNullLit:
4760 case TypeTableEntryIdNull:
47614761 case TypeTableEntryIdNamespace:
47624762 case TypeTableEntryIdBoundFn:
47634763 case TypeTableEntryIdFn:
......@@ -4822,7 +4822,7 @@ static bool return_type_is_cacheable(TypeTableEntry *return_type) {
48224822 case TypeTableEntryIdComptimeFloat:
48234823 case TypeTableEntryIdComptimeInt:
48244824 case TypeTableEntryIdUndefLit:
4825 case TypeTableEntryIdNullLit:
4825 case TypeTableEntryIdNull:
48264826 case TypeTableEntryIdNamespace:
48274827 case TypeTableEntryIdBoundFn:
48284828 case TypeTableEntryIdFn:
......@@ -4933,7 +4933,7 @@ bool type_requires_comptime(TypeTableEntry *type_entry) {
49334933 case TypeTableEntryIdComptimeFloat:
49344934 case TypeTableEntryIdComptimeInt:
49354935 case TypeTableEntryIdUndefLit:
4936 case TypeTableEntryIdNullLit:
4936 case TypeTableEntryIdNull:
49374937 case TypeTableEntryIdMetaType:
49384938 case TypeTableEntryIdNamespace:
49394939 case TypeTableEntryIdBlock:
......@@ -5412,7 +5412,7 @@ bool const_values_equal(ConstExprValue *a, ConstExprValue *b) {
54125412 return true;
54135413 case TypeTableEntryIdUndefLit:
54145414 zig_panic("TODO");
5415 case TypeTableEntryIdNullLit:
5415 case TypeTableEntryIdNull:
54165416 zig_panic("TODO");
54175417 case TypeTableEntryIdMaybe:
54185418 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) {
56465646 buf_appendf(buf, "}");
56475647 return;
56485648 }
5649 case TypeTableEntryIdNullLit:
5649 case TypeTableEntryIdNull:
56505650 {
56515651 buf_appendf(buf, "null");
56525652 return;
......@@ -5764,7 +5764,7 @@ uint32_t type_id_hash(TypeId x) {
57645764 case TypeTableEntryIdComptimeFloat:
57655765 case TypeTableEntryIdComptimeInt:
57665766 case TypeTableEntryIdUndefLit:
5767 case TypeTableEntryIdNullLit:
5767 case TypeTableEntryIdNull:
57685768 case TypeTableEntryIdMaybe:
57695769 case TypeTableEntryIdErrorSet:
57705770 case TypeTableEntryIdEnum:
......@@ -5810,7 +5810,7 @@ bool type_id_eql(TypeId a, TypeId b) {
58105810 case TypeTableEntryIdComptimeFloat:
58115811 case TypeTableEntryIdComptimeInt:
58125812 case TypeTableEntryIdUndefLit:
5813 case TypeTableEntryIdNullLit:
5813 case TypeTableEntryIdNull:
58145814 case TypeTableEntryIdMaybe:
58155815 case TypeTableEntryIdPromise:
58165816 case TypeTableEntryIdErrorSet:
......@@ -5932,7 +5932,7 @@ static const TypeTableEntryId all_type_ids[] = {
59325932 TypeTableEntryIdComptimeFloat,
59335933 TypeTableEntryIdComptimeInt,
59345934 TypeTableEntryIdUndefLit,
5935 TypeTableEntryIdNullLit,
5935 TypeTableEntryIdNull,
59365936 TypeTableEntryIdMaybe,
59375937 TypeTableEntryIdErrorUnion,
59385938 TypeTableEntryIdErrorSet,
......@@ -5986,7 +5986,7 @@ size_t type_id_index(TypeTableEntry *entry) {
59865986 return 10;
59875987 case TypeTableEntryIdUndefLit:
59885988 return 11;
5989 case TypeTableEntryIdNullLit:
5989 case TypeTableEntryIdNull:
59905990 return 12;
59915991 case TypeTableEntryIdMaybe:
59925992 return 13;
......@@ -6044,8 +6044,8 @@ const char *type_id_name(TypeTableEntryId id) {
60446044 return "ComptimeInt";
60456045 case TypeTableEntryIdUndefLit:
60466046 return "UndefinedLiteral";
6047 case TypeTableEntryIdNullLit:
6048 return "NullLiteral";
6047 case TypeTableEntryIdNull:
6048 return "Null";
60496049 case TypeTableEntryIdMaybe:
60506050 return "Nullable";
60516051 case TypeTableEntryIdErrorUnion:
src/codegen.cpp+7-7
......@@ -4919,7 +4919,7 @@ static LLVMValueRef pack_const_int(CodeGen *g, LLVMTypeRef big_int_type_ref, Con
49194919 case TypeTableEntryIdComptimeFloat:
49204920 case TypeTableEntryIdComptimeInt:
49214921 case TypeTableEntryIdUndefLit:
4922 case TypeTableEntryIdNullLit:
4922 case TypeTableEntryIdNull:
49234923 case TypeTableEntryIdErrorUnion:
49244924 case TypeTableEntryIdErrorSet:
49254925 case TypeTableEntryIdNamespace:
......@@ -5365,7 +5365,7 @@ static LLVMValueRef gen_const_val(CodeGen *g, ConstExprValue *const_val, const c
53655365 case TypeTableEntryIdComptimeFloat:
53665366 case TypeTableEntryIdComptimeInt:
53675367 case TypeTableEntryIdUndefLit:
5368 case TypeTableEntryIdNullLit:
5368 case TypeTableEntryIdNull:
53695369 case TypeTableEntryIdNamespace:
53705370 case TypeTableEntryIdBlock:
53715371 case TypeTableEntryIdBoundFn:
......@@ -6032,7 +6032,7 @@ static void define_builtin_types(CodeGen *g) {
60326032 g->builtin_types.entry_undef = entry;
60336033 }
60346034 {
6035 TypeTableEntry *entry = new_type_table_entry(TypeTableEntryIdNullLit);
6035 TypeTableEntry *entry = new_type_table_entry(TypeTableEntryIdNull);
60366036 buf_init_from_str(&entry->name, "(null)");
60376037 entry->zero_bits = true;
60386038 g->builtin_types.entry_null = entry;
......@@ -6500,7 +6500,7 @@ static void define_builtin_compile_vars(CodeGen *g) {
65006500 " ComptimeFloat: void,\n"
65016501 " ComptimeInt: void,\n"
65026502 " UndefinedLiteral: void,\n"
6503 " NullLiteral: void,\n"
6503 " Null: void,\n"
65046504 " Nullable: Nullable,\n"
65056505 " ErrorUnion: ErrorUnion,\n"
65066506 " ErrorSet: ErrorSet,\n"
......@@ -7075,7 +7075,7 @@ static void prepend_c_type_to_decl_list(CodeGen *g, GenH *gen_h, TypeTableEntry
70757075 case TypeTableEntryIdComptimeFloat:
70767076 case TypeTableEntryIdComptimeInt:
70777077 case TypeTableEntryIdUndefLit:
7078 case TypeTableEntryIdNullLit:
7078 case TypeTableEntryIdNull:
70797079 case TypeTableEntryIdNamespace:
70807080 case TypeTableEntryIdBlock:
70817081 case TypeTableEntryIdBoundFn:
......@@ -7260,7 +7260,7 @@ static void get_c_type(CodeGen *g, GenH *gen_h, TypeTableEntry *type_entry, Buf
72607260 case TypeTableEntryIdComptimeFloat:
72617261 case TypeTableEntryIdComptimeInt:
72627262 case TypeTableEntryIdUndefLit:
7263 case TypeTableEntryIdNullLit:
7263 case TypeTableEntryIdNull:
72647264 case TypeTableEntryIdArgTuple:
72657265 case TypeTableEntryIdPromise:
72667266 zig_unreachable();
......@@ -7413,7 +7413,7 @@ static void gen_h_file(CodeGen *g) {
74137413 case TypeTableEntryIdComptimeInt:
74147414 case TypeTableEntryIdArray:
74157415 case TypeTableEntryIdUndefLit:
7416 case TypeTableEntryIdNullLit:
7416 case TypeTableEntryIdNull:
74177417 case TypeTableEntryIdErrorUnion:
74187418 case TypeTableEntryIdErrorSet:
74197419 case TypeTableEntryIdNamespace:
src/ir.cpp+33-33
......@@ -7960,7 +7960,7 @@ static ImplicitCastMatchResult ir_types_match_with_implicit_cast(IrAnalyze *ira,
79607960
79617961 // implicit conversion from null literal to maybe type
79627962 if (expected_type->id == TypeTableEntryIdMaybe &&
7963 actual_type->id == TypeTableEntryIdNullLit)
7963 actual_type->id == TypeTableEntryIdNull)
79647964 {
79657965 return ImplicitCastMatchResultYes;
79667966 }
......@@ -8190,7 +8190,7 @@ static TypeTableEntry *ir_resolve_peer_types(IrAnalyze *ira, AstNode *source_nod
81908190 }
81918191 }
81928192
8193 bool any_are_null = (prev_inst->value.type->id == TypeTableEntryIdNullLit);
8193 bool any_are_null = (prev_inst->value.type->id == TypeTableEntryIdNull);
81948194 bool convert_to_const_slice = false;
81958195 for (size_t i = 1; i < instruction_count; i += 1) {
81968196 IrInstruction *cur_inst = instructions[i];
......@@ -8469,12 +8469,12 @@ static TypeTableEntry *ir_resolve_peer_types(IrAnalyze *ira, AstNode *source_nod
84698469 }
84708470 }
84718471
8472 if (prev_type->id == TypeTableEntryIdNullLit) {
8472 if (prev_type->id == TypeTableEntryIdNull) {
84738473 prev_inst = cur_inst;
84748474 continue;
84758475 }
84768476
8477 if (cur_type->id == TypeTableEntryIdNullLit) {
8477 if (cur_type->id == TypeTableEntryIdNull) {
84788478 any_are_null = true;
84798479 continue;
84808480 }
......@@ -8677,7 +8677,7 @@ static TypeTableEntry *ir_resolve_peer_types(IrAnalyze *ira, AstNode *source_nod
86778677 ir_add_error_node(ira, source_node,
86788678 buf_sprintf("unable to make error union out of number literal"));
86798679 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) {
86818681 ir_add_error_node(ira, source_node,
86828682 buf_sprintf("unable to make error union out of null literal"));
86838683 return ira->codegen->builtin_types.entry_invalid;
......@@ -8685,7 +8685,7 @@ static TypeTableEntry *ir_resolve_peer_types(IrAnalyze *ira, AstNode *source_nod
86858685 return get_error_union_type(ira->codegen, err_set_type, prev_inst->value.type);
86868686 }
86878687 }
8688 } else if (any_are_null && prev_inst->value.type->id != TypeTableEntryIdNullLit) {
8688 } else if (any_are_null && prev_inst->value.type->id != TypeTableEntryIdNull) {
86898689 if (prev_inst->value.type->id == TypeTableEntryIdComptimeInt ||
86908690 prev_inst->value.type->id == TypeTableEntryIdComptimeFloat)
86918691 {
......@@ -10004,7 +10004,7 @@ static IrInstruction *ir_analyze_cast(IrAnalyze *ira, IrInstruction *source_inst
1000410004
1000510005 // explicit cast from null literal to maybe type
1000610006 if (wanted_type->id == TypeTableEntryIdMaybe &&
10007 actual_type->id == TypeTableEntryIdNullLit)
10007 actual_type->id == TypeTableEntryIdNull)
1000810008 {
1000910009 return ir_analyze_null_to_maybe(ira, source_instr, value, wanted_type);
1001010010 }
......@@ -10061,7 +10061,7 @@ static IrInstruction *ir_analyze_cast(IrAnalyze *ira, IrInstruction *source_inst
1006110061 {
1006210062 TypeTableEntry *wanted_child_type = wanted_type->data.error_union.payload_type->data.maybe.child_type;
1006310063 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 ||
1006510065 actual_type->id == TypeTableEntryIdComptimeInt ||
1006610066 actual_type->id == TypeTableEntryIdComptimeFloat)
1006710067 {
......@@ -10627,19 +10627,19 @@ static TypeTableEntry *ir_analyze_bin_op_cmp(IrAnalyze *ira, IrInstructionBinOp
1062710627 IrBinOp op_id = bin_op_instruction->op_id;
1062810628 bool is_equality_cmp = (op_id == IrBinOpCmpEq || op_id == IrBinOpCmpNotEq);
1062910629 if (is_equality_cmp &&
10630 ((op1->value.type->id == TypeTableEntryIdNullLit && op2->value.type->id == TypeTableEntryIdMaybe) ||
10631 (op2->value.type->id == TypeTableEntryIdNullLit && op1->value.type->id == TypeTableEntryIdMaybe) ||
10632 (op1->value.type->id == TypeTableEntryIdNullLit && op2->value.type->id == TypeTableEntryIdNullLit)))
10630 ((op1->value.type->id == TypeTableEntryIdNull && op2->value.type->id == TypeTableEntryIdMaybe) ||
10631 (op2->value.type->id == TypeTableEntryIdNull && op1->value.type->id == TypeTableEntryIdMaybe) ||
10632 (op1->value.type->id == TypeTableEntryIdNull && op2->value.type->id == TypeTableEntryIdNull)))
1063310633 {
10634 if (op1->value.type->id == TypeTableEntryIdNullLit && op2->value.type->id == TypeTableEntryIdNullLit) {
10634 if (op1->value.type->id == TypeTableEntryIdNull && op2->value.type->id == TypeTableEntryIdNull) {
1063510635 ConstExprValue *out_val = ir_build_const_from(ira, &bin_op_instruction->base);
1063610636 out_val->data.x_bool = (op_id == IrBinOpCmpEq);
1063710637 return ira->codegen->builtin_types.entry_bool;
1063810638 }
1063910639 IrInstruction *maybe_op;
10640 if (op1->value.type->id == TypeTableEntryIdNullLit) {
10640 if (op1->value.type->id == TypeTableEntryIdNull) {
1064110641 maybe_op = op2;
10642 } else if (op2->value.type->id == TypeTableEntryIdNullLit) {
10642 } else if (op2->value.type->id == TypeTableEntryIdNull) {
1064310643 maybe_op = op1;
1064410644 } else {
1064510645 zig_unreachable();
......@@ -10796,7 +10796,7 @@ static TypeTableEntry *ir_analyze_bin_op_cmp(IrAnalyze *ira, IrInstructionBinOp
1079610796 case TypeTableEntryIdArray:
1079710797 case TypeTableEntryIdStruct:
1079810798 case TypeTableEntryIdUndefLit:
10799 case TypeTableEntryIdNullLit:
10799 case TypeTableEntryIdNull:
1080010800 case TypeTableEntryIdMaybe:
1080110801 case TypeTableEntryIdErrorUnion:
1080210802 case TypeTableEntryIdUnion:
......@@ -11645,7 +11645,7 @@ static VarClassRequired get_var_class_required(TypeTableEntry *type_entry) {
1164511645 case TypeTableEntryIdComptimeInt:
1164611646 case TypeTableEntryIdUndefLit:
1164711647 case TypeTableEntryIdBlock:
11648 case TypeTableEntryIdNullLit:
11648 case TypeTableEntryIdNull:
1164911649 case TypeTableEntryIdOpaque:
1165011650 case TypeTableEntryIdMetaType:
1165111651 case TypeTableEntryIdNamespace:
......@@ -11913,7 +11913,7 @@ static TypeTableEntry *ir_analyze_instruction_export(IrAnalyze *ira, IrInstructi
1191311913 case TypeTableEntryIdComptimeFloat:
1191411914 case TypeTableEntryIdComptimeInt:
1191511915 case TypeTableEntryIdUndefLit:
11916 case TypeTableEntryIdNullLit:
11916 case TypeTableEntryIdNull:
1191711917 case TypeTableEntryIdMaybe:
1191811918 case TypeTableEntryIdErrorUnion:
1191911919 case TypeTableEntryIdErrorSet:
......@@ -11937,7 +11937,7 @@ static TypeTableEntry *ir_analyze_instruction_export(IrAnalyze *ira, IrInstructi
1193711937 case TypeTableEntryIdComptimeFloat:
1193811938 case TypeTableEntryIdComptimeInt:
1193911939 case TypeTableEntryIdUndefLit:
11940 case TypeTableEntryIdNullLit:
11940 case TypeTableEntryIdNull:
1194111941 case TypeTableEntryIdMaybe:
1194211942 case TypeTableEntryIdErrorUnion:
1194311943 case TypeTableEntryIdErrorSet:
......@@ -12901,7 +12901,7 @@ static TypeTableEntry *ir_analyze_maybe(IrAnalyze *ira, IrInstructionUnOp *un_op
1290112901 case TypeTableEntryIdComptimeFloat:
1290212902 case TypeTableEntryIdComptimeInt:
1290312903 case TypeTableEntryIdUndefLit:
12904 case TypeTableEntryIdNullLit:
12904 case TypeTableEntryIdNull:
1290512905 case TypeTableEntryIdMaybe:
1290612906 case TypeTableEntryIdErrorUnion:
1290712907 case TypeTableEntryIdErrorSet:
......@@ -13152,7 +13152,7 @@ static TypeTableEntry *ir_analyze_instruction_phi(IrAnalyze *ira, IrInstructionP
1315213152
1315313153 if (resolved_type->id == TypeTableEntryIdComptimeFloat ||
1315413154 resolved_type->id == TypeTableEntryIdComptimeInt ||
13155 resolved_type->id == TypeTableEntryIdNullLit ||
13155 resolved_type->id == TypeTableEntryIdNull ||
1315613156 resolved_type->id == TypeTableEntryIdUndefLit)
1315713157 {
1315813158 ir_add_error_node(ira, phi_instruction->base.source_node,
......@@ -14216,7 +14216,7 @@ static TypeTableEntry *ir_analyze_instruction_typeof(IrAnalyze *ira, IrInstructi
1421614216 case TypeTableEntryIdComptimeFloat:
1421714217 case TypeTableEntryIdComptimeInt:
1421814218 case TypeTableEntryIdUndefLit:
14219 case TypeTableEntryIdNullLit:
14219 case TypeTableEntryIdNull:
1422014220 case TypeTableEntryIdNamespace:
1422114221 case TypeTableEntryIdBlock:
1422214222 case TypeTableEntryIdBoundFn:
......@@ -14480,7 +14480,7 @@ static TypeTableEntry *ir_analyze_instruction_slice_type(IrAnalyze *ira,
1448014480 zig_unreachable();
1448114481 case TypeTableEntryIdUnreachable:
1448214482 case TypeTableEntryIdUndefLit:
14483 case TypeTableEntryIdNullLit:
14483 case TypeTableEntryIdNull:
1448414484 case TypeTableEntryIdBlock:
1448514485 case TypeTableEntryIdArgTuple:
1448614486 case TypeTableEntryIdOpaque:
......@@ -14588,7 +14588,7 @@ static TypeTableEntry *ir_analyze_instruction_array_type(IrAnalyze *ira,
1458814588 zig_unreachable();
1458914589 case TypeTableEntryIdUnreachable:
1459014590 case TypeTableEntryIdUndefLit:
14591 case TypeTableEntryIdNullLit:
14591 case TypeTableEntryIdNull:
1459214592 case TypeTableEntryIdBlock:
1459314593 case TypeTableEntryIdArgTuple:
1459414594 case TypeTableEntryIdOpaque:
......@@ -14657,7 +14657,7 @@ static TypeTableEntry *ir_analyze_instruction_size_of(IrAnalyze *ira,
1465714657 zig_unreachable();
1465814658 case TypeTableEntryIdUnreachable:
1465914659 case TypeTableEntryIdUndefLit:
14660 case TypeTableEntryIdNullLit:
14660 case TypeTableEntryIdNull:
1466114661 case TypeTableEntryIdBlock:
1466214662 case TypeTableEntryIdComptimeFloat:
1466314663 case TypeTableEntryIdComptimeInt:
......@@ -14713,7 +14713,7 @@ static TypeTableEntry *ir_analyze_instruction_test_non_null(IrAnalyze *ira, IrIn
1471314713
1471414714 ir_build_test_nonnull_from(&ira->new_irb, &instruction->base, value);
1471514715 return ira->codegen->builtin_types.entry_bool;
14716 } else if (type_entry->id == TypeTableEntryIdNullLit) {
14716 } else if (type_entry->id == TypeTableEntryIdNull) {
1471714717 ConstExprValue *out_val = ir_build_const_from(ira, &instruction->base);
1471814718 out_val->data.x_bool = false;
1471914719 return ira->codegen->builtin_types.entry_bool;
......@@ -15100,7 +15100,7 @@ static TypeTableEntry *ir_analyze_instruction_switch_target(IrAnalyze *ira,
1510015100 case TypeTableEntryIdArray:
1510115101 case TypeTableEntryIdStruct:
1510215102 case TypeTableEntryIdUndefLit:
15103 case TypeTableEntryIdNullLit:
15103 case TypeTableEntryIdNull:
1510415104 case TypeTableEntryIdMaybe:
1510515105 case TypeTableEntryIdBlock:
1510615106 case TypeTableEntryIdBoundFn:
......@@ -15621,7 +15621,7 @@ static TypeTableEntry *ir_analyze_min_max(IrAnalyze *ira, IrInstruction *source_
1562115621 case TypeTableEntryIdComptimeFloat:
1562215622 case TypeTableEntryIdComptimeInt:
1562315623 case TypeTableEntryIdUndefLit:
15624 case TypeTableEntryIdNullLit:
15624 case TypeTableEntryIdNull:
1562515625 case TypeTableEntryIdMaybe:
1562615626 case TypeTableEntryIdErrorUnion:
1562715627 case TypeTableEntryIdErrorSet:
......@@ -16283,7 +16283,7 @@ static ConstExprValue *ir_make_type_info_value(IrAnalyze *ira, TypeTableEntry *t
1628316283 case TypeTableEntryIdComptimeFloat:
1628416284 case TypeTableEntryIdComptimeInt:
1628516285 case TypeTableEntryIdUndefLit:
16286 case TypeTableEntryIdNullLit:
16286 case TypeTableEntryIdNull:
1628716287 case TypeTableEntryIdNamespace:
1628816288 case TypeTableEntryIdBlock:
1628916289 case TypeTableEntryIdArgTuple:
......@@ -17879,7 +17879,7 @@ static TypeTableEntry *ir_analyze_instruction_align_of(IrAnalyze *ira, IrInstruc
1787917879 case TypeTableEntryIdComptimeFloat:
1788017880 case TypeTableEntryIdComptimeInt:
1788117881 case TypeTableEntryIdUndefLit:
17882 case TypeTableEntryIdNullLit:
17882 case TypeTableEntryIdNull:
1788317883 case TypeTableEntryIdNamespace:
1788417884 case TypeTableEntryIdBlock:
1788517885 case TypeTableEntryIdBoundFn:
......@@ -18613,7 +18613,7 @@ static void buf_write_value_bytes(CodeGen *codegen, uint8_t *buf, ConstExprValue
1861318613 case TypeTableEntryIdComptimeFloat:
1861418614 case TypeTableEntryIdComptimeInt:
1861518615 case TypeTableEntryIdUndefLit:
18616 case TypeTableEntryIdNullLit:
18616 case TypeTableEntryIdNull:
1861718617 case TypeTableEntryIdPromise:
1861818618 zig_unreachable();
1861918619 case TypeTableEntryIdVoid:
......@@ -18680,7 +18680,7 @@ static void buf_read_value_bytes(CodeGen *codegen, uint8_t *buf, ConstExprValue
1868018680 case TypeTableEntryIdComptimeFloat:
1868118681 case TypeTableEntryIdComptimeInt:
1868218682 case TypeTableEntryIdUndefLit:
18683 case TypeTableEntryIdNullLit:
18683 case TypeTableEntryIdNull:
1868418684 case TypeTableEntryIdPromise:
1868518685 zig_unreachable();
1868618686 case TypeTableEntryIdVoid:
......@@ -18761,7 +18761,7 @@ static TypeTableEntry *ir_analyze_instruction_bit_cast(IrAnalyze *ira, IrInstruc
1876118761 case TypeTableEntryIdComptimeFloat:
1876218762 case TypeTableEntryIdComptimeInt:
1876318763 case TypeTableEntryIdUndefLit:
18764 case TypeTableEntryIdNullLit:
18764 case TypeTableEntryIdNull:
1876518765 ir_add_error(ira, dest_type_value,
1876618766 buf_sprintf("unable to @bitCast from type '%s'", buf_ptr(&src_type->name)));
1876718767 return ira->codegen->builtin_types.entry_invalid;
......@@ -18787,7 +18787,7 @@ static TypeTableEntry *ir_analyze_instruction_bit_cast(IrAnalyze *ira, IrInstruc
1878718787 case TypeTableEntryIdComptimeFloat:
1878818788 case TypeTableEntryIdComptimeInt:
1878918789 case TypeTableEntryIdUndefLit:
18790 case TypeTableEntryIdNullLit:
18790 case TypeTableEntryIdNull:
1879118791 ir_add_error(ira, dest_type_value,
1879218792 buf_sprintf("unable to @bitCast to type '%s'", buf_ptr(&dest_type->name)));
1879318793 return ira->codegen->builtin_types.entry_invalid;
test/cases/misc.zig+1-1
......@@ -504,7 +504,7 @@ test "@typeId" {
504504 assert(@typeId(@typeOf(1)) == Tid.ComptimeInt);
505505 assert(@typeId(@typeOf(1.0)) == Tid.ComptimeFloat);
506506 assert(@typeId(@typeOf(undefined)) == Tid.UndefinedLiteral);
507 assert(@typeId(@typeOf(null)) == Tid.NullLiteral);
507 assert(@typeId(@typeOf(null)) == Tid.Null);
508508 assert(@typeId(?i32) == Tid.Nullable);
509509 assert(@typeId(error!i32) == Tid.ErrorUnion);
510510 assert(@typeId(error) == Tid.ErrorSet);