File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -461,7 +461,19 @@ clang::QualType ClangTypeConverter::visitProtocolType(ProtocolType *type) {
461
461
// Metatypes can be converted to Class when they are metatypes for concrete
462
462
// classes. https://github.com/apple/swift/pull/27479#discussion_r344418131
463
463
clang::QualType ClangTypeConverter::visitMetatypeType (MetatypeType *type) {
464
- return getClangMetatypeType (ClangASTContext);
464
+ assert (type->hasRepresentation () &&
465
+ " metatype should have been assigned a representation" );
466
+ switch (type->getRepresentation ()) {
467
+ case MetatypeRepresentation::Thin:
468
+ return ClangASTContext.VoidTy ;
469
+
470
+ case MetatypeRepresentation::Thick:
471
+ llvm_unreachable (" thick metatypes don't have a corresponding Clang type" );
472
+
473
+ case MetatypeRepresentation::ObjC:
474
+ return getClangMetatypeType (ClangASTContext);
475
+ }
476
+ llvm_unreachable (" bad representation" );
465
477
}
466
478
467
479
// TODO: [stronger-checking-in-clang-type-conversion]
You can’t perform that action at this time.
0 commit comments