diff options
author | John Hodge <tpg@ucc.asn.au> | 2017-08-18 09:39:52 +0800 |
---|---|---|
committer | John Hodge <tpg@ucc.asn.au> | 2017-08-18 09:39:52 +0800 |
commit | 7ee9fc53ab6caa32261496cb76eebda40fbfe000 (patch) | |
tree | 45eaa56967f93259fd4146fc37f6077c272aa8d5 /src/hir/type.hpp | |
parent | 6498c9b315cda96114072a0fdb3dc86f8b1232fe (diff) | |
download | mrust-7ee9fc53ab6caa32261496cb76eebda40fbfe000.tar.gz |
HIR Typecheck - Refactor coerce/unsize handling
Diffstat (limited to 'src/hir/type.hpp')
-rw-r--r-- | src/hir/type.hpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/hir/type.hpp b/src/hir/type.hpp index cc0894d2..e3aeec43 100644 --- a/src/hir/type.hpp +++ b/src/hir/type.hpp @@ -127,6 +127,20 @@ public: (Infer, struct { unsigned int index; InferClass ty_class; + + /// Returns true if the ivar is a literal + bool is_lit() const { + switch(this->ty_class) + { + case InferClass::None: + case InferClass::Diverge: + return false; + case InferClass::Integer: + case InferClass::Float: + return true; + } + throw ""; + } }), (Diverge, struct {}), (Primitive, ::HIR::CoreType), |