ReactKit / SwiftState

Elegant state machine for Swift.
MIT License
904 stars 93 forks source link

Type 'String' does not conform to protocol 'NilLiteralConvertible' #6

Closed Bouke closed 10 years ago

Bouke commented 10 years ago

After fiddling around a bit more, I got the following compiler error:

String+SwiftState.swift:10:1: Type 'String' does not conform to protocol 'NilLiteralConvertible'

Changing to the following solved my error:

extension String: StateType, StateEventType
{
    public init(nilLiteral: ()) {
        self = ""
    }
}

(Xcode 6.1 Beta 3)

inamiy commented 10 years ago

Though I haven't tried Xcode 6.1 Beta 3 yet, the cause seems to be String+SwiftState.swift not setting its String extension as public.

I'll test this later.

inamiy commented 10 years ago

Sorry, above mention is my mistake.

convertFromNilLiteral should be changed to init(nilLiteral:), so you are just right :smile: I fixed it in #7, so please check.