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

Provide convenience initializer via ExpressibleByStringLiteral #735

Closed
jberkel opened this issue Sep 28, 2017 · 1 comment
Closed

Provide convenience initializer via ExpressibleByStringLiteral #735

jberkel opened this issue Sep 28, 2017 · 1 comment
Milestone

Comments

@jberkel
Copy link
Collaborator

jberkel commented Sep 28, 2017

public protocol ExpressionType : Expressible, ExpressibleByStringLiteral {
}

let date:Expression<Date> = "date"
@jberkel jberkel added this to the 0.12.0 milestone Sep 28, 2017
@jberkel jberkel modified the milestones: 0.12.0, 0.13.1 Aug 23, 2021
@jberkel jberkel modified the milestones: 0.13.1, 0.13.2 Nov 17, 2021
@jberkel jberkel modified the milestones: 0.14.0, 0.14.1 Jul 17, 2022
@jberkel
Copy link
Collaborator Author

jberkel commented Jul 19, 2022

This interacts badly with the current operator handling (and offers little value):

Expression<String>("foo") + "bar" 
// compiler treats this as
Expression<String>("foo") + Expression<String>("bar")
// "foo" || "bar"  (actual)
// "foo" || 'bar'  (expected)

A better option might be to use property wrappers, see #976

@jberkel jberkel closed this as completed Jul 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant