Skip to content

[gardening] Fix recently introduced typos. Fix inconsistent header. #5364

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 19, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/IRGen/SwitchBuilder.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===--- SwitchBuilder.h --------------------------------------------------===//
//===--- SwitchBuilder.h ----------------------------------------*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
Expand Down
2 changes: 1 addition & 1 deletion lib/Parse/ParseType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ Parser::parseTypeSimpleOrComposition(Diag<> MessageID,
if (auto Comp = dyn_cast<CompositionTypeRepr>(T)) {
// Accept protocol<P1, P2> & P3; explode it.
auto TyRs = Comp->getTypes();
if (!TyRs.empty()) // If empty, is 'Any'; igone.
if (!TyRs.empty()) // If empty, is 'Any'; ignore.
Types.append(TyRs.begin(), TyRs.end());
return;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Sema/TypeCheckType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2614,7 +2614,7 @@ Type TypeResolver::resolveTupleType(TupleTypeRepr *repr,
return TupleType::get(elements, Context);
}

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

// Emit fix-it to enclose compostion part into parentheses.
// Emit fix-it to enclose composition part into parentheses.
TypeRepr *InnerMost = Postfixes.back();
TC.diagnose(InnerMost->getLoc(), diag::protocol_composition_with_postfix,
isa<ProtocolTypeRepr>(InnerMost) ? ".Protocol" :
Expand Down
2 changes: 1 addition & 1 deletion test/Compatibility/protocol_composition.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ protocol P2 {

// BEGIN swift3.swift

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