diff options
| author | Ginger Bill <bill@gingerbill.org> | 2017-04-26 19:43:17 +0100 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2017-04-26 19:43:17 +0100 |
| commit | 5b8be2593821c7b30adf010bc90dfa8ab2930a72 (patch) | |
| tree | 8d251da1cf54b6771f9b849ec9dc7862d8eb333f /src/types.c | |
| parent | 29efdc5fc15b760e773b767ab81e0e825b3b85f7 (diff) | |
`fmt.String_Buffer`, Fix issue #44, Tweak overloading rules
Diffstat (limited to 'src/types.c')
| -rw-r--r-- | src/types.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/types.c b/src/types.c index 2f2bbbfef..7ddf21f30 100644 --- a/src/types.c +++ b/src/types.c @@ -551,6 +551,20 @@ bool is_type_named(Type *t) { } return t->kind == Type_Named; } +bool is_type_named_alias(Type *t) { + if (!is_type_named(t)) { + return false; + } + Entity *e = t->Named.type_name; + if (e == NULL) { + return false; + } + if (e->kind != Entity_TypeName) { + return false; + } + return e->TypeName.is_type_alias; +} + bool is_type_boolean(Type *t) { t = core_type(t); if (t->kind == Type_Basic) { |