-
-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
This issue is a follow-up from http4s/http4s#3433.
I've struggled with this a bit and think it's quite problematic to embed string interpolations to uri"" and path"" of http4s (actually, it's so for every interpolated macros based on literally):
- At the moment, compilation fails if invalid strings have been passed (underlying
validateis calling at compile time). - Say
val foo = "/foo/bar"
val someuri = uri"https://example.com$foo"means that we should check the value of foo at the runtime (generally, foo could be some computation, not a constant value). So bringing embedded string interpolations means we should proceed with runtime values at compile time (because of 1). I'm not that much a Scala macros astronaut, but am feeling it's probably impossible.
UPD: speaking more accurately, compile-time checking is only possible for the literal part of the passed string.
If anyone has insights about that, please share them here.
martijnhoekstra and calvinlfer
Metadata
Metadata
Assignees
Labels
No labels