GraphQLSwift / GraphQL

The Swift GraphQL implementation for macOS and Linux
MIT License
938 stars 72 forks source link

Compilation warnings with Swift 3.0.2 #6

Closed maximveksler closed 7 years ago

maximveksler commented 7 years ago

Compiling .Package(url: "https://github.com/GraphQLSwift/GraphQL.git", majorVersion: 0) on Mac.

swift --version
Apple Swift version 3.0.2 (swiftlang-800.0.63 clang-800.0.42.1)
Target: x86_64-apple-macosx10.9

Calling swift build is able to build binary, but produces these warnings:

Compile Swift Module 'GraphQL' (62 sources)
/Users/maximveksler/Project/StreamstagerOrg/Collection/Packages/GraphQL-0.2.8/Sources/GraphQL/Map/Map.swift:759:32: warning: will never be executed
                        string += ","
                               ^
/Users/maximveksler/Project/StreamstagerOrg/Collection/Packages/GraphQL-0.2.8/Sources/GraphQL/Map/Map.swift:756:24: note: condition always evaluates to true
                    if _isDebugAssertConfiguration() {
                       ^
/Users/maximveksler/Project/StreamstagerOrg/Collection/Packages/GraphQL-0.2.8/Sources/GraphQL/Map/Map.swift:768:31: warning: will never be executed
                return string + "]"
                              ^
/Users/maximveksler/Project/StreamstagerOrg/Collection/Packages/GraphQL-0.2.8/Sources/GraphQL/Map/Map.swift:764:16: note: condition always evaluates to true
            if _isDebugAssertConfiguration() {
               ^
/Users/maximveksler/Project/StreamstagerOrg/Collection/Packages/GraphQL-0.2.8/Sources/GraphQL/Map/Map.swift:786:28: warning: will never be executed
                    string += escape(key) + ":" + serialize(map: value)
                           ^
/Users/maximveksler/Project/StreamstagerOrg/Collection/Packages/GraphQL-0.2.8/Sources/GraphQL/Map/Map.swift:781:20: note: condition always evaluates to true
                if _isDebugAssertConfiguration() {
                   ^
/Users/maximveksler/Project/StreamstagerOrg/Collection/Packages/GraphQL-0.2.8/Sources/GraphQL/Map/Map.swift:793:32: warning: will never be executed
                        string += ","
                               ^
/Users/maximveksler/Project/StreamstagerOrg/Collection/Packages/GraphQL-0.2.8/Sources/GraphQL/Map/Map.swift:790:24: note: condition always evaluates to true
                    if _isDebugAssertConfiguration() {
                       ^
/Users/maximveksler/Project/StreamstagerOrg/Collection/Packages/GraphQL-0.2.8/Sources/GraphQL/Map/Map.swift:804:31: warning: will never be executed
                return string + "}"
                              ^
/Users/maximveksler/Project/StreamstagerOrg/Collection/Packages/GraphQL-0.2.8/Sources/GraphQL/Map/Map.swift:800:16: note: condition always evaluates to true
            if _isDebugAssertConfiguration() {
               ^
paulofaria commented 7 years ago

Those are optimizations for release builds which the compiler doesn't like. I think I'll make the optimizations the default to stop the warnings.