diff options
author | John Hodge <tpg@mutabah.net> | 2016-06-11 12:05:30 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-06-11 12:05:30 +0800 |
commit | 5585040f36b6f8ffd6c0c44689525ce29ccb74d9 (patch) | |
tree | 9c5566dcb60260643293965cd216c505b4423ead /src/hir/type.hpp | |
parent | 556cf732e28ae68185f778a4c5c63d0d2bec032a (diff) | |
download | mrust-5585040f36b6f8ffd6c0c44689525ce29ccb74d9.tar.gz |
HIR Typecheck - autoderef arrays to slices, don't check method if unknown
Diffstat (limited to 'src/hir/type.hpp')
-rw-r--r-- | src/hir/type.hpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/hir/type.hpp b/src/hir/type.hpp index 6dd02804..e5ccf0ce 100644 --- a/src/hir/type.hpp +++ b/src/hir/type.hpp @@ -170,6 +170,9 @@ public: static TypeRef new_pointer(BorrowType bt, TypeRef inner) { return TypeRef(Data::make_Pointer({bt, box$(mv$(inner))})); } + static TypeRef new_slice(TypeRef inner) { + return TypeRef(Data::make_Slice({box$(mv$(inner))})); + } static TypeRef new_array(TypeRef inner, unsigned int size) { assert(size != ~0u); return TypeRef(Data::make_Array({box$(mv$(inner)), ::HIR::ExprPtr(), size})); |