Skip to content

Commit c582190

Browse files
authored
Merge pull request #5364 from practicalswift/gardening-20161019
2 parents 31245aa + 5f8ce30 commit c582190

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

lib/IRGen/SwitchBuilder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===--- SwitchBuilder.h --------------------------------------------------===//
1+
//===--- SwitchBuilder.h ----------------------------------------*- C++ -*-===//
22
//
33
// This source file is part of the Swift.org open source project
44
//

lib/Parse/ParseType.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ Parser::parseTypeSimpleOrComposition(Diag<> MessageID,
446446
if (auto Comp = dyn_cast<CompositionTypeRepr>(T)) {
447447
// Accept protocol<P1, P2> & P3; explode it.
448448
auto TyRs = Comp->getTypes();
449-
if (!TyRs.empty()) // If empty, is 'Any'; igone.
449+
if (!TyRs.empty()) // If empty, is 'Any'; ignore.
450450
Types.append(TyRs.begin(), TyRs.end());
451451
return;
452452
}

lib/Sema/TypeCheckType.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2614,7 +2614,7 @@ Type TypeResolver::resolveTupleType(TupleTypeRepr *repr,
26142614
return TupleType::get(elements, Context);
26152615
}
26162616

2617-
/// Restore Swift3 behavior of ambiguous compostion for source compatibility.
2617+
/// Restore Swift3 behavior of ambiguous composition for source compatibility.
26182618
///
26192619
/// Currently, 'P1 & P2.Type' is parsed as (composition P1, (metatype P2))
26202620
/// In Swift3, that was (metatype (composition P1, P2)).
@@ -2674,7 +2674,7 @@ static TypeRepr *fixCompositionWithPostfix(TypeChecker &TC,
26742674
SmallVector<TypeRepr *, 4> Protocols(Types.begin(), Types.end() - 1);
26752675
Protocols.push_back(LastType);
26762676

2677-
// Emit fix-it to enclose compostion part into parentheses.
2677+
// Emit fix-it to enclose composition part into parentheses.
26782678
TypeRepr *InnerMost = Postfixes.back();
26792679
TC.diagnose(InnerMost->getLoc(), diag::protocol_composition_with_postfix,
26802680
isa<ProtocolTypeRepr>(InnerMost) ? ".Protocol" :

test/Compatibility/protocol_composition.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ protocol P2 {
1313

1414
// BEGIN swift3.swift
1515

16-
// Warning for mitakingly accepted protocol composition production.
16+
// Warning for mistakenly accepted protocol composition production.
1717
func foo(x: P1 & Any & P2.Type?) {
1818
// expected-warning @-1 {{protocol composition with postfix '.Type' is ambiguous and will be rejected in future version of Swift}} {{13-13=(}} {{26-26=)}}
1919
let _: (P1 & P2).Type? = x

0 commit comments

Comments
 (0)