Skip to content

Commit 3bf76ff

Browse files
committed
---
yaml --- r: 344984 b: refs/heads/master c: 6128824 h: refs/heads/master
1 parent a3fb65d commit 3bf76ff

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 1923c27346f74c21fc19756db61294b9283fbfa5
2+
refs/heads/master: 612882491ac70ee1584554759191034c24fb74f4
33
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea

trunk/lib/Parse/ParseDecl.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5481,8 +5481,6 @@ ParserResult<EnumDecl> Parser::parseDeclEnum(ParseDeclOptions Flags,
54815481
{ }, nullptr, CurDeclContext);
54825482
setLocalDiscriminator(ED);
54835483
ED->getAttrs() = Attributes;
5484-
if (SF.Kind == SourceFileKind::Interface)
5485-
ED->setAddedImplicitInitializers();
54865484

54875485
ContextChange CC(*this, ED);
54885486

@@ -5755,8 +5753,6 @@ ParserResult<StructDecl> Parser::parseDeclStruct(ParseDeclOptions Flags,
57555753
CurDeclContext);
57565754
setLocalDiscriminator(SD);
57575755
SD->getAttrs() = Attributes;
5758-
if (SF.Kind == SourceFileKind::Interface)
5759-
SD->setAddedImplicitInitializers();
57605756

57615757
ContextChange CC(*this, SD);
57625758

@@ -5845,8 +5841,6 @@ ParserResult<ClassDecl> Parser::parseDeclClass(ParseDeclOptions Flags,
58455841
{ }, nullptr, CurDeclContext);
58465842
setLocalDiscriminator(CD);
58475843
CD->getAttrs() = Attributes;
5848-
if (SF.Kind == SourceFileKind::Interface)
5849-
CD->setAddedImplicitInitializers();
58505844

58515845
ContextChange CC(*this, CD);
58525846

trunk/lib/Sema/TypeCheckDecl.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5263,6 +5263,14 @@ void TypeChecker::addImplicitConstructors(NominalTypeDecl *decl) {
52635263
if (decl->isInvalid())
52645264
return;
52655265

5266+
// Don't add implicit constructors in textual interfaces.
5267+
if (auto *SF = decl->getParentSourceFile()) {
5268+
if (SF->Kind == SourceFileKind::Interface) {
5269+
decl->setAddedImplicitInitializers();
5270+
return;
5271+
}
5272+
}
5273+
52665274
// Bail out if we're validating one of our constructors already; we'll
52675275
// revisit the issue later.
52685276
if (isa<ClassDecl>(decl)) {

0 commit comments

Comments
 (0)