summaryrefslogtreecommitdiff
path: root/src/hir/type.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/hir/type.hpp')
-rw-r--r--src/hir/type.hpp14
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),