aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-06-29 16:08:30 +0100
committerGinger Bill <bill@gingerbill.org>2017-06-29 16:08:30 +0100
commit7e3293fc20592bf978b3cb9ceeeb0d88590b2909 (patch)
tree828bc9f08f30db126598eea500f8b014564d3ca8 /src
parente4a82833275acc166313ff11613bcc748309571a (diff)
Fix `odin version` printing
Diffstat (limited to 'src')
-rw-r--r--src/check_expr.cpp2
-rw-r--r--src/main.cpp2
-rw-r--r--src/types.cpp5
3 files changed, 5 insertions, 4 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp
index 32d23431a..557b57d8c 100644
--- a/src/check_expr.cpp
+++ b/src/check_expr.cpp
@@ -1166,7 +1166,7 @@ Type *check_get_params(Checker *c, Scope *scope, AstNode *_params, bool *is_vari
success = false;
}
} else {
- type = make_type_generic(c->allocator, 0);
+ type = make_type_generic(c->allocator, 0, str_lit(""));
}
} else {
type = check_type(c, type_expr);
diff --git a/src/main.cpp b/src/main.cpp
index c3923b5d0..ff562d5c6 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -375,7 +375,7 @@ int main(int arg_count, char **arg_ptr) {
return 1;
#endif
} else if (args[1] == "version") {
- gb_printf("%s version %.*s\n", args[0], LIT(build_context.ODIN_VERSION));
+ gb_printf("%.*s version %.*s\n", LIT(args[0]), LIT(build_context.ODIN_VERSION));
return 0;
} else {
usage(args[0]);
diff --git a/src/types.cpp b/src/types.cpp
index db957a21f..e4c28fed9 100644
--- a/src/types.cpp
+++ b/src/types.cpp
@@ -117,7 +117,7 @@ struct TypeRecord {
#define TYPE_KINDS \
TYPE_KIND(Basic, BasicType) \
- TYPE_KIND(Generic, struct{ i64 id; }) \
+ TYPE_KIND(Generic, struct{ i64 id; String name; }) \
TYPE_KIND(Pointer, struct { Type *elem; }) \
TYPE_KIND(Atomic, struct { Type *elem; }) \
TYPE_KIND(Array, struct { Type *elem; i64 count; }) \
@@ -478,9 +478,10 @@ Type *make_type_basic(gbAllocator a, BasicType basic) {
return t;
}
-Type *make_type_generic(gbAllocator a, i64 id) {
+Type *make_type_generic(gbAllocator a, i64 id, String name) {
Type *t = alloc_type(a, Type_Generic);
t->Generic.id = id;
+ t->Generic.name = name;
return t;
}