Skip to content

Commit b8d072f

Browse files
committed
[NoncopyableGenerics] misc fixes and improvements
1 parent 5e6c23e commit b8d072f

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

include/swift/AST/TypeRepr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1325,7 +1325,7 @@ class ExistentialTypeRepr: public TypeRepr {
13251325
friend class TypeRepr;
13261326
};
13271327

1328-
/// A type repr represeting the inverse of some constraint. For example,
1328+
/// A type repr representing the inverse of some constraint. For example,
13291329
/// ~Copyable
13301330
/// where `Copyable` is the constraint type.
13311331
class InverseTypeRepr : public TypeRepr {

lib/AST/Type.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ bool TypeBase::isDistributedActor() {
523523
}
524524

525525
llvm::Optional<KnownProtocolKind> TypeBase::getKnownProtocol() {
526-
if (auto protoTy = this->castTo<ProtocolType>())
526+
if (auto protoTy = this->getAs<ProtocolType>())
527527
if (auto protoDecl = protoTy->getDecl())
528528
return protoDecl->getKnownProtocolKind();
529529

lib/Sema/TypeCheckInvertible.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ bool StorageVisitor::visit(NominalTypeDecl *nominal, DeclContext *dc) {
254254
return false;
255255
}
256256

257+
assert(!isa<ProtocolDecl>(nominal) || !isa<BuiltinTupleDecl>(nominal));
257258
return false;
258259
}
259260

0 commit comments

Comments
 (0)