 }
 
 func delcarationReturns(declaration: String, kind: SwiftDeclarationKind) -> Bool {
-    return declaration.containsString("->") || SwiftDeclarationKind.variableKinds().contains(kind)
+    if SwiftDeclarationKind.variableKinds().contains(kind) { return true }
+
+    let outsideBraces = NSMutableString(string: declaration)
+    regex("(\\s*->\\s*).*[^(]\\)").replaceMatchesInString(outsideBraces, options: [],
+        range: NSRange(location: 0, length: outsideBraces.length), withTemplate: "")
+
+    return outsideBraces.containsString("->")
 }
 
 func commentHasBatchedParameters(comment: String) -> Bool {

}

func missingReturnDocumentation(declaration: String, comment: String) -> Bool {
    return declaration.containsString("->") && !commentReturns(comment)
}

func superfluousReturnDocumentation(declaration: String, comment: String,

            "/// Returns false\npublic func a() {}",
            "/// docs\n/// - throws: NSError\nfunc a() {}",
            "/// docs\nfunc a() throws {}",
            "/// docs\n/// - parameter param: this is void" +
            "\npublic func no(param: (Void -> Void)?) -> Bool { return false }",
            "/// docs\n/// - parameter param: this is void" +
            "\n///- parameter param2: this is void too" +
            "\npublic func no(param: (Void -> Void)?, param2: String->Void) -> Bool {return false}",
            "/// docs\n/// - parameter param: this is void\n/// - returns: false" +
            "\npublic func no(param: (Void -> Void)?) {}",
            "/// docs\n/// - parameter param: this is void" +
            "\n///- parameter param2: this is void too\n/// - returns: false" +
            "\npublic func no(param: (Void -> Void)?, param2: String->Void) {}",
        ]
    )

