Skip to content

Commit 2a61f17

Browse files
committed
Uncomment assertions
1 parent 269516a commit 2a61f17

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

lib/Sema/OverloadChoice.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "llvm/ADT/PointerIntPair.h"
2222
#include "llvm/Support/ErrorHandling.h"
2323
#include "swift/AST/Availability.h"
24+
#include "swift/AST/Decl.h"
2425
#include "swift/AST/Type.h"
2526
#include "swift/AST/Types.h"
2627

@@ -132,8 +133,8 @@ class OverloadChoice {
132133
/// Retrieve an overload choice for a declaration that was found via
133134
/// dynamic lookup.
134135
static OverloadChoice getDeclViaDynamic(Type base, ValueDecl *value, bool isFlattened = false) {
135-
// assert((!isFlattened || isa<FuncDecl>(value)) &&
136-
// "can only flatten function decls");
136+
assert((!isFlattened || isa<FuncDecl>(value)) &&
137+
"can only flatten function decls");
137138
OverloadChoice result;
138139
result.BaseAndBits.setPointer(base);
139140
result.DeclOrKind = reinterpret_cast<uintptr_t>(value) | 0x02;
@@ -145,8 +146,8 @@ class OverloadChoice {
145146
/// bridging to an Objective-C class.
146147
static OverloadChoice getDeclViaBridge(Type base, ValueDecl *value,
147148
bool isFlattened = false) {
148-
// assert((!isFlattened || isa<FuncDecl>(value)) &&
149-
// "can only flatten function decls");
149+
assert((!isFlattened || isa<FuncDecl>(value)) &&
150+
"can only flatten function decls");
150151
OverloadChoice result;
151152
result.BaseAndBits.setPointer(base);
152153
result.BaseAndBits.setInt(IsBridgedBit);
@@ -159,8 +160,8 @@ class OverloadChoice {
159160
/// by unwrapping an optional context type.
160161
static OverloadChoice getDeclViaUnwrappedOptional(Type base, ValueDecl *value,
161162
bool isFlattened = false) {
162-
// assert((!isFlattened || isa<FuncDecl>(value)) &&
163-
// "can only flatten function decls");
163+
assert((!isFlattened || isa<FuncDecl>(value)) &&
164+
"can only flatten function decls");
164165
OverloadChoice result;
165166
result.BaseAndBits.setPointer(base);
166167
result.BaseAndBits.setInt(IsUnwrappedOptionalBit);

0 commit comments

Comments
 (0)