aboutsummaryrefslogtreecommitdiff
path: root/src/types.c
diff options
context:
space:
mode:
authorZachary Pierson <zacpiersonhehe@gmail.com>2017-03-30 00:26:46 -0500
committerZachary Pierson <zacpiersonhehe@gmail.com>2017-03-30 00:26:46 -0500
commit1349aa6f2cfc63ace0382a8dd6b346f24e861ea9 (patch)
tree55b6fb23ecfb86e3c474bfd4bbc8e9bb5c78f986 /src/types.c
parent7a28827602f29f0e9485ca6617daf316635802df (diff)
parenta75ccb6fbc529d2fee00f9b456ca7c0c830548ee (diff)
Merge https://github.com/gingerBill/Odin, cleaned up a bit, fixed the object file version message on macOS
Diffstat (limited to 'src/types.c')
-rw-r--r--src/types.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/src/types.c b/src/types.c
index 534f00f15..eee10dd45 100644
--- a/src/types.c
+++ b/src/types.c
@@ -1035,24 +1035,13 @@ typedef enum ProcTypeOverloadKind {
} ProcTypeOverloadKind;
-#include "stdio.h"
-bool has_encountered_null_proc_type = false;
ProcTypeOverloadKind are_proc_types_overload_safe(Type *x, Type *y) {
- if(x == NULL && y == NULL) {
- if(!has_encountered_null_proc_type) {
- printf("The compiler has encountered a NULL proc type.\n"
- " This is probably not an error in your code, and\n"
- " the compile is probably still successful.\n"
- " This does mean that (at least once), there could be a\n"
- " bad procedure overload in your program, and Odin wouldn't catch it.\n"
- " As far as I know, this is a porting bug, and doesn't occur on mainline Odin.\n"
- " Be careful, and sorry about this bug :(\n");
- has_encountered_null_proc_type = true;
- }
- return ProcOverload_ParamCount;
- }
- if (!is_type_proc(x)) return ProcOverload_NotProcedure;
- if (!is_type_proc(y)) return ProcOverload_NotProcedure;
+ if (x == NULL && y == NULL) return ProcOverload_NotProcedure;
+ if (x == NULL && y != NULL) return ProcOverload_NotProcedure;
+ if (x != NULL && y == NULL) return ProcOverload_NotProcedure;
+ if (!is_type_proc(x)) return ProcOverload_NotProcedure;
+ if (!is_type_proc(y)) return ProcOverload_NotProcedure;
+
TypeProc px = base_type(x)->Proc;
TypeProc py = base_type(y)->Proc;