You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure if this is a bug, a feature, or something else but it is impossible to export methods from a generic type. The important of this kind of feature is that if it existed, it would be (probably) be possible to replace Quill's implicit conversion Quoted[T] => T with implicit exports (so long as the exported method themselves are inline).
[error] 27 | PrintMac(Wrapped("blah").toUpperCase())
[error] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
[error] |value toUpperCase is not a member of org.deusaquilus.ImplicitConf.Wrapped[String], but could be made available as an extension method.
Expectation
It should recognize that .toUpperCase() exists on Wrapped[String] because it exists on String.
The functionality should be equivalent to this (which works):
extension (inlinet: Wrapped[String])
inlinedefunwrapped:String= t.unwrap
exportunwrapped.*Wrapped("blah").toUpperCase()
// Which in the AST should be encoded as:Wrapped("blah").unwrap.toUpperCase()
@odersky I’m totally stuck then. Is there any other way I could potentially do automatic conversion of Quoted[T] => T without implicit conversion or in some way that is planned for long term support? Everything that is currently proposed wouldn’t work.
I need to somehow be able to implicitly convert Quoted[T] to T inside of Quill quote { … } blocks or the Quill API wouldn’t work.
Uh oh!
There was an error while loading. Please reload this page.
Compiler version
3.2.0
Minimized code
I'm not sure if this is a bug, a feature, or something else but it is impossible to export methods from a generic type. The important of this kind of feature is that if it existed, it would be (probably) be possible to replace Quill's implicit conversion
Quoted[T] => T
with implicit exports (so long as the exported method themselves are inline).Output
Expectation
It should recognize that
.toUpperCase()
exists onWrapped[String]
because it exists onString
.The functionality should be equivalent to this (which works):
Of if
inline
is used,it should be equivalent to this:
Quill's unquotation
Quoted[T] => T
function specifically relies on this kind of pattern (i.e. the inputt
has to be directly spliced).The text was updated successfully, but these errors were encountered: