summaryrefslogtreecommitdiff
path: root/src/literal.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/literal.h')
-rw-r--r--src/literal.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/literal.h b/src/literal.h
index 727865c94..4ad81268e 100644
--- a/src/literal.h
+++ b/src/literal.h
@@ -693,6 +693,12 @@ public:
Literals(size_t initialSize) : SmallVector(initialSize) {}
Type getType() {
+ if (empty()) {
+ return Type::none;
+ }
+ if (size() == 1) {
+ return (*this)[0].type;
+ }
std::vector<Type> types;
for (auto& val : *this) {
types.push_back(val.type);