aboutsummaryrefslogtreecommitdiff
path: root/src/checker/type.cpp
diff options
context:
space:
mode:
authorgingerBill <ginger.bill.22@gmail.com>2016-07-31 23:01:42 +0100
committergingerBill <ginger.bill.22@gmail.com>2016-07-31 23:01:42 +0100
commit70f6282f41cdd7f500159116c520140364f6739a (patch)
tree577ba99ea8249236dc4a70695a1e94ef26ddb340 /src/checker/type.cpp
parent776dc0e8f1aa506ae0096c78ff10565e56c175e7 (diff)
Variable declaration and assign, unary operators
Diffstat (limited to 'src/checker/type.cpp')
-rw-r--r--src/checker/type.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/checker/type.cpp b/src/checker/type.cpp
index 8dea9c58f..37d37162d 100644
--- a/src/checker/type.cpp
+++ b/src/checker/type.cpp
@@ -208,6 +208,12 @@ Type *make_type_procedure(gbAllocator a, Scope *scope, Type *params, isize param
}
+Type *type_deref(Type *t) {
+ if (t != NULL && t->kind == Type_Pointer)
+ return t->pointer.element;
+ return t;
+}
+
#define STR_LIT(x) {cast(u8 *)(x), gb_size_of(x)-1}
gb_global Type basic_types[] = {