Skip to content

[gardening] Use consistent formatting. #4846

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 1 commit into from
Sep 17, 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 include/swift/AST/Expr.h
Original file line number Diff line number Diff line change
Expand Up @@ -1753,7 +1753,7 @@ class DynamicSubscriptExpr final
/// bar.foo. These always have unresolved type.
class UnresolvedMemberExpr final
: public Expr,
public TrailingCallArguments<UnresolvedMemberExpr> {
public TrailingCallArguments<UnresolvedMemberExpr> {
SourceLoc DotLoc;
DeclNameLoc NameLoc;
DeclName Name;
Expand Down
2 changes: 1 addition & 1 deletion lib/AST/ASTScope.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ ASTScope::ASTScope(const ASTScope *parent, ArrayRef<ASTScope *> children)

// Add child nodes, reparenting them to this node.
storedChildren.reserve(children.size());
for (auto child : children ) {
for (auto child : children) {
child->parentAndExpanded.setPointer(this);
storedChildren.push_back(child);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/AST/ArchetypeBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1196,7 +1196,7 @@ bool ArchetypeBuilder::addSameTypeRequirementBetweenArchetypes(
// along back edges.
bool creatingCycle = false;
auto T2Parent = T2;
while(T2Parent != nullptr) {
while (T2Parent != nullptr) {
if (T2Parent->getRepresentative() == T1)
creatingCycle = true;
T2Parent = T2Parent->getParent();
Expand Down
2 changes: 1 addition & 1 deletion lib/Parse/ParseType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ ParserResult<TypeRepr> Parser::parseTypeIdentifierOrTypeComposition() {
SmallString<32> replacement;
auto Begin = Protocols.begin();
replacement += extractText(*Begin);
while(++Begin != Protocols.end()) {
while (++Begin != Protocols.end()) {
replacement += " & ";
replacement += extractText(*Begin);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/SILOptimizer/Analysis/EpilogueARCAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ bool EpilogueARCContext::convergeDataflow() {
Changed |= (BS->BBSetIn != BBSetOut);
BS->BBSetIn = BBSetOut;
}
} while(Changed);
} while (Changed);
return true;
}

Expand Down
4 changes: 2 additions & 2 deletions lib/Serialization/DeserializeSIL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1187,8 +1187,8 @@ bool SILDeserializer::readSILInstruction(SILFunction *Fn, SILBasicBlock *BB,
auto Ty2 = MF->getType(TyID2);
auto ResultTy = MF->getType(TyID3);
ResultVal = Builder.createTailAddr(Loc,
getLocalValue(ValID, getSILType(Ty, SILValueCategory::Address)),
getLocalValue(ValID2, getSILType(Ty2, SILValueCategory::Object)),
getLocalValue(ValID, getSILType(Ty, SILValueCategory::Address)),
getLocalValue(ValID2, getSILType(Ty2, SILValueCategory::Object)),
getSILType(ResultTy, SILValueCategory::Address));
break;
}
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/Platform/tgmath.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public func sqrt<T: FloatingPoint>(_ x: T) -> T {

@_transparent
public func fma<T: FloatingPoint>(_ x: T, _ y: T, _ z: T) -> T {
return z.addingProduct(x,y)
return z.addingProduct(x, y)
}

@_transparent
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/SDK/Foundation/Data.swift
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ public struct Data : ReferenceConvertible, Equatable, Hashable, RandomAccessColl

private func _shouldUseNonAtomicWriteReimplementation(options: Data.WritingOptions = []) -> Bool {

// Avoid a crash that happens on OSX 10.11.x and iOS 9.x or before when writing a bridged Data non-atomically with Foundation's standard write() implementation.
// Avoid a crash that happens on OS X 10.11.x and iOS 9.x or before when writing a bridged Data non-atomically with Foundation's standard write() implementation.
if !options.contains(.atomic) {
#if os(OSX)
return NSFoundationVersionNumber <= Double(NSFoundationVersionNumber10_11_Max)
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/SDK/Foundation/URLComponents.swift
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ extension URLComponents : CustomStringConvertible, CustomDebugStringConvertible,

c.append((label: "path", value: self.path))
if #available(OSX 10.10, iOS 8.0, *) {
if let qi = self.queryItems { c.append((label: "queryItems", value: qi )) }
if let qi = self.queryItems { c.append((label: "queryItems", value: qi)) }
}
if let f = self.fragment { c.append((label: "fragment", value: f)) }
let m = Mirror(self, children: c, displayStyle: Mirror.DisplayStyle.struct)
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/core/AnyHashable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ internal struct _ConcreteHashableBox<Base : Hashable> : _AnyHashableBox {
func _downCastConditional<T>(into result: UnsafeMutablePointer<T>) -> Bool {
guard let value = _baseHashable as? T else { return false }
result.initialize(to: value)
return true;
return true
}
}

Expand Down
4 changes: 2 additions & 2 deletions stdlib/public/core/DebuggerSupport.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ public enum _DebuggerSupport {

internal static func checkValue<T>(
_ value: Any,
ifClass: (AnyObject)->T,
otherwise: ()->T
ifClass: (AnyObject) -> T,
otherwise: () -> T
) -> T {
if isClass(value) {
return ifClass(_unsafeDowncastToAnyObject(fromAny: value))
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/core/Integers.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ infix operator &>>= : AssignmentPrecedence
//===----------------------------------------------------------------------===//


//FIXME(integers): This should go in the stdlib separately, probably.
// FIXME(integers): This should go in the stdlib separately, probably.
extension ExpressibleByIntegerLiteral
where Self : _ExpressibleByBuiltinIntegerLiteral {
/// Create an instance initialized to `value`.
Expand Down
6 changes: 3 additions & 3 deletions test/Constraints/dictionary_literal.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ func testDefaultExistentials() {

let _: Int = d2 // expected-error{{value of type 'Dictionary<AnyHashable, Any>'}}

let _ = ["a" : 1,
"b" : [ "a", 2, 3.14159 ],
"c" : [ "a" : 2, "b" : 3.5] ]
let _ = ["a": 1,
"b": ["a", 2, 3.14159],
"c": ["a": 2, "b": 3.5]]
// expected-error@-3{{heterogeneous collection literal could only be inferred to 'Dictionary<String, Any>'; add explicit type annotation if this is intentional}}

let d3 = ["b" : B(), "c" : C()]
Expand Down
12 changes: 6 additions & 6 deletions test/Constraints/override.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ func removeOverrides<SomeSub: Sub>(concrete: Sub, generic: SomeSub) {
}

class Base1 {
func foo1(a : Int, b : @escaping ()->()) {} // expected-note{{potential overridden instance method 'foo1(a:b:)' here}}
func foo2(a : @escaping (Int)->(Int), b : @escaping ()->()) {} // expected-note{{potential overridden instance method 'foo2(a:b:)' here}}
func foo1(a : Int, b : @escaping () -> ()) {} // expected-note{{potential overridden instance method 'foo1(a:b:)' here}}
func foo2(a : @escaping (Int)->(Int), b : @escaping () -> ()) {} // expected-note{{potential overridden instance method 'foo2(a:b:)' here}}
}

class Sub1 : Base1 {
override func foo1(a : Int, b : ()->()) {} // expected-error {{method does not override any method from its superclass}} expected-note {{type does not match superclass instance method with type '(Int, @escaping () -> ()) -> ()'}} {{34-34=@escaping }}
override func foo2(a : (Int)->(Int), b : ()->()) {} // expected-error {{method does not override any method from its superclass}} expected-note{{type does not match superclass instance method with type '(@escaping (Int) -> (Int), @escaping () -> ()) -> ()'}} {{25-25=@escaping }} {{43-43=@escaping }}
override func foo1(a : Int, b : () -> ()) {} // expected-error {{method does not override any method from its superclass}} expected-note {{type does not match superclass instance method with type '(Int, @escaping () -> ()) -> ()'}} {{34-34=@escaping }}
override func foo2(a : (Int)->(Int), b : () -> ()) {} // expected-error {{method does not override any method from its superclass}} expected-note{{type does not match superclass instance method with type '(@escaping (Int) -> (Int), @escaping () -> ()) -> ()'}} {{25-25=@escaping }} {{43-43=@escaping }}
}

class Base2 {
func foo<T>(a : @escaping (T) ->()) {} // expected-note{{potential overridden instance method 'foo(a:)' here}}
func foo<T>(a : @escaping (T) -> ()) {} // expected-note{{potential overridden instance method 'foo(a:)' here}}
}

class Sub2 : Base2 {
override func foo<T>(a : (T) ->()) {} // expected-error {{method does not override any method from its superclass}} expected-note{{type does not match superclass instance method with type '(@escaping (T) -> ()) -> ()'}}{{28-28=@escaping }}
override func foo<T>(a : (T) -> ()) {} // expected-error {{method does not override any method from its superclass}} expected-note{{type does not match superclass instance method with type '(@escaping (T) -> ()) -> ()'}}{{28-28=@escaping }}
}
2 changes: 1 addition & 1 deletion test/Constraints/tuple.swift
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ extension r25271859 {
func map<U>(f: (T) -> U) -> r25271859<U> {
}

func andThen<U>(f: (T)->r25271859<U>) {
func andThen<U>(f: (T) -> r25271859<U>) {
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/IRGen/objc_super.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class PartialApply : Gizmo {
// CHECK: define hidden void @_TFC10objc_super12PartialApply4frobfT_T_([[PARTIAL_APPLY_CLASS]]*) {{.*}} {
override func frob() {
// CHECK: call void @_TF10objc_super8acceptFnFFT_T_T_(i8* bitcast (void (%swift.refcounted*)* [[PARTIAL_FORWARDING_THUNK:@[A-Za-z0-9_]+]] to i8*), %swift.refcounted* %3)
acceptFn( super.frob )
acceptFn(super.frob)
}
// CHECK: }

Expand Down
4 changes: 2 additions & 2 deletions test/attr/attr_escaping.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ struct StoresClosure {
closure = fn // expected-error{{assigning non-escaping parameter 'fn' to an @escaping closure}}
}

func arrayPack(_ fn: () -> Int) -> [()->Int] {
func arrayPack(_ fn: () -> Int) -> [() -> Int] {
// expected-note@-1{{parameter 'fn' is implicitly non-escaping}} {{24-24=@escaping }}

return [fn] // expected-error{{using non-escaping parameter 'fn' in a context expecting an @escaping closure}}
}

func arrayPack(_ fn: @escaping () -> Int, _ fn2 : () -> Int) -> [()->Int] {
func arrayPack(_ fn: @escaping () -> Int, _ fn2 : () -> Int) -> [() -> Int] {
// expected-note@-1{{parameter 'fn2' is implicitly non-escaping}} {{53-53=@escaping }}

return [fn, fn2] // expected-error{{using non-escaping parameter 'fn2' in a context expecting an @escaping closure}}
Expand Down
2 changes: 1 addition & 1 deletion test/stdlib/ArrayBridge.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class Thunks : NSObject {
@objc func acceptSubclassArray(
_ x: [Subclass],
expecting expected: NSArray
) {
) {
expectEqualSequence(
expected.lazy.map { ObjectIdentifier($0 as AnyObject) },
x.lazy.map { ObjectIdentifier($0 as AnyObject) }
Expand Down
2 changes: 1 addition & 1 deletion tools/SourceKit/docs/Protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ Welcome to SourceKit. Type ':help' for assistance.
key.request: source.request.cursorinfo,
key.sourcefile: "/path/to/file.swift",
key.offset: 7,
key.compilerargs: [ "/path/to/file.swift" ]
key.compilerargs: ["/path/to/file.swift"]
}
```

Expand Down