Skip to content

Commit 07fafa3

Browse files
committed
[NFC] Add a TypeBase Conversion Constructor to NeverNullType
1 parent 891e115 commit 07fafa3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/Sema/TypeCheckType.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1706,11 +1706,14 @@ namespace {
17061706
public:
17071707
/// Construct a never-null Type. If \p Ty is null, a fatal error is thrown.
17081708
NeverNullType(Type Ty) : WrappedTy(Ty) {
1709-
if (Ty.isNull()) {
1709+
if (WrappedTy.isNull()) {
17101710
llvm::report_fatal_error("Resolved to null type!");
17111711
}
17121712
}
17131713

1714+
/// Construct a never-null Type. If \p TyB is null, a fatal error is thrown.
1715+
NeverNullType(TypeBase *TyB) : NeverNullType(Type(TyB)) {}
1716+
17141717
operator Type() const { return WrappedTy; }
17151718
Type get() const { return WrappedTy; }
17161719

0 commit comments

Comments
 (0)