Skip to content
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

Swift 2 Error #2

Open
Zorgatone opened this issue Oct 6, 2015 · 0 comments
Open

Swift 2 Error #2

Zorgatone opened this issue Oct 6, 2015 · 0 comments

Comments

@Zorgatone
Copy link

ante.swift:47:10: error: expected identifier in function declaration
    func repeat(n: Int) -> String {
         ^
ante.swift:32:29: error: missing argument label 'arrayLiteral:' in call
        return String(Array(self)[i])
                            ^
                            arrayLiteral:
ante.swift:36:16: error: use of unresolved identifier 'countElements'
        return countElements(self)
               ^
ante.swift:53:21: error: cannot invoke initializer for type 'NSRegularExpression' with an argument list of type '(pattern: String, options: NilLiteralConvertible, error: NilLiteralConvertible)'
        let regex = NSRegularExpression(pattern: pattern, options: nil, error: nil)
                    ^
ante.swift:53:21: note: overloads for 'NSRegularExpression' exist with these partially matching parameter lists: (pattern: String, options: NSRegularExpressionOptions), (), (coder: NSCoder)
        let regex = NSRegularExpression(pattern: pattern, options: nil, error: nil)
                    ^
ante.swift:204:54: error: expected member name following '.'
                let label = "Q\(Int(card.suit).chr)".repeat(Int(suit / card.suit))
                                                     ^
ante.swift:204:54: error: consecutive statements on a line must be separated by ';'
                let label = "Q\(Int(card.suit).chr)".repeat(Int(suit / card.suit))
                                                     ^
                                                     ;
ante.swift:204:60: error: expected '{' after 'repeat'
                let label = "Q\(Int(card.suit).chr)".repeat(Int(suit / card.suit))
                                                           ^
<unknown>:0: error: expected 'while' after body of 'repeat' statement
ante.swift:275:5: error: 'println' has been renamed to 'print'
    println("usage: ante.swift filename.ante");
    ^~~~~~~
    print
Swift.println:1:33: note: 'println' has been explicitly marked unavailable here
@available(*, unavailable) func println<T>(value: T)
                                ^
ante.swift:105:23: error: cannot invoke initializer for type 'NSString' with an argument list of type '(contentsOfFile: String, encoding: UInt, error: inout NSError?)'
        let program = NSString(contentsOfFile: fileName, encoding: NSUTF8StringEncoding, error: &error)
                      ^
ante.swift:105:23: note: overloads for 'NSString' exist with these partially matching parameter lists: (unicodeScalarLiteral: StaticString), (extendedGraphemeClusterLiteral: StaticString), (stringLiteral: StaticString), (string: NSString), (), (coder: NSCoder), (characters: UnsafePointer<unichar>, length: Int), (UTF8String: UnsafePointer<Int8>), (string: String), (format: String, arguments: CVaListPointer), (data: NSData, encoding: UInt), (bytesNoCopy: UnsafeMutablePointer<Void>, length: Int, encoding: UInt, freeWhenDone: Bool), (CString: UnsafePointer<Int8>, encoding: UInt), (contentsOfURL: NSURL, encoding: UInt), (contentsOfFile: String, encoding: UInt), (contentsOfURL: NSURL, usedEncoding: UnsafeMutablePointer<UInt>), (contentsOfFile: String, usedEncoding: UnsafeMutablePointer<UInt>), (contentsOfFile: String), (contentsOfURL: NSURL), (CString: UnsafePointer<Int8>, length: Int), (CString: UnsafePointer<Int8>)
        let program = NSString(contentsOfFile: fileName, encoding: NSUTF8StringEncoding, error: &error)
                      ^
ante.swift:137:26: error: 'enumerate' is unavailable: call the 'enumerate()' method on the sequence
        for (i, line) in enumerate(lines) {
                         ^~~~~~~~~
Swift.enumerate:1:90: note: 'enumerate' has been explicitly marked unavailable here
@available(*, unavailable, message="call the 'enumerate()' method on the sequence") func enumerate<Seq : SequenceType>(base: Seq) -> EnumerateSequence<Seq>
                                                                                         ^
ante.swift:139:52: error: ambiguous use of operator '+'
            self.code.append(Card(rank: 0, suit: i + 1))
                                                   ^
Swift.+:1:26: note: found this candidate
@warn_unused_result func +<T : Strideable>(lhs: T.Stride, rhs: T) -> T
                         ^
Swift.+:1:6: note: found this candidate
func +<T : UnsignedIntegerType>(lhs: T._DisallowMixedSignArithmetic, rhs: T) -> T
     ^
ante.swift:255:43: error: use of unresolved identifier '&/'
                        initial = initial &/ rank
                                          ^
ante.swift:255:43: error: operator is not a known binary operator
                        initial = initial &/ rank
                                          ^
ante.swift:255:43: error: operator is not a known binary operator
                        initial = initial &/ rank
                                          ^
ante.swift:267:9: error: 'println' has been renamed to 'print'
        println("Ante exception: \(message) on line \(self.line) (pc:\(self.pc))")
        ^~~~~~~
        print
Swift.println:1:33: note: 'println' has been explicitly marked unavailable here
@available(*, unavailable) func println<T>(value: T)
@Zorgatone Zorgatone changed the title Swift Error Swift 2 Error Oct 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant