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

Remove CustomStringConvertible constraint on typeMismatch function #302

Merged
merged 1 commit into from Dec 5, 2015
Merged

Remove CustomStringConvertible constraint on typeMismatch function #302

merged 1 commit into from Dec 5, 2015

Conversation

ghost
Copy link

@ghost ghost commented Dec 5, 2015

According to Apple's documentation of CustomStringConvertible: String(instance) will work for an instance of any type, returning its description if the instance happens to be CustomStringConvertible. Using CustomStringConvertible as a generic constraint, or accessing a conforming type's description directly, is therefore discouraged.

Hence we can unify the typeMismatch function so that it accepts any types.

According to Apple's documentation of `CustomStringConvertible`: `String(instance)` will work for an `instance` of _any_ type, returning its `description` if the `instance` happens to be `CustomStringConvertible`. Using `CustomStringConvertible` as a generic constraint, or accessing a conforming type's `description` directly, is therefore discouraged.

Hence we can unify the `typeMismatch` function so that it accepts _any_ types.
@gfontenot gfontenot merged commit e7680fc into thoughtbot:master Dec 5, 2015
@gfontenot
Copy link
Collaborator

(noting that this supersedes #291)

Thanks!

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

Successfully merging this pull request may close these issues.

1 participant