Skip to content

Commit da2e8a9

Browse files
authored
Merge pull request swiftlang#21414 from rudkx/fixup-typecheck-forward-declarations
[Sema] Forward declare things referenced in TypeCheckType.h.
2 parents f0cdadf + 12cbe3d commit da2e8a9

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

lib/Sema/TypeCheckType.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ TypeResolution TypeResolution::forContextual(DeclContext *dc,
7878
return result;
7979
}
8080

81+
ASTContext &TypeResolution::getASTContext() const {
82+
return dc->getASTContext();
83+
}
84+
8185
GenericSignatureBuilder *TypeResolution::getGenericSignatureBuilder() const {
8286
assert(stage == TypeResolutionStage::Interface);
8387
if (!complete.builder) {

lib/Sema/TypeCheckType.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,19 @@
1616
#ifndef SWIFT_SEMA_TYPE_CHECK_TYPE_H
1717
#define SWIFT_SEMA_TYPE_CHECK_TYPE_H
1818

19+
#include "swift/AST/Type.h"
1920
#include "swift/AST/TypeResolutionStage.h"
2021
#include "llvm/ADT/None.h"
2122

2223
namespace swift {
2324

25+
class ASTContext;
26+
class TypeRepr;
27+
class ComponentIdentTypeRepr;
28+
class GenericEnvironment;
29+
class GenericSignature;
30+
class GenericSignatureBuilder;
31+
2432
/// Flags that describe the context of type checking a pattern or
2533
/// type.
2634
enum class TypeResolutionFlags : uint16_t {
@@ -318,7 +326,7 @@ class TypeResolution {
318326
GenericEnvironment *genericEnv);
319327

320328
/// Retrieve the ASTContext in which this resolution occurs.
321-
ASTContext &getASTContext() const { return dc->getASTContext(); }
329+
ASTContext &getASTContext() const;
322330

323331
/// Retrieve the declaration context in which type resolution will be
324332
/// performed.

0 commit comments

Comments
 (0)