16 Sep 2022 |
nyaamyaa | I can find an adequate replacement for .. on s3 | 11:22:45 |
Adam ឵឵#4161 | Apply(fun, parameters).asExpr no? | 11:38:24 |
| cheeze#2000 changed their profile picture. | 12:30:24 |
Bulby#2541 | https://github.com/TheDrawingCoder-Gamer/wobblelab/blob/master/src/main/scala/MagicCurry.scala#L20 here I get an inline match error:
[error] -- Error: /home/bulby/Documents/github/wobblelab-scala/src/main/scala/Main.scala:554:4
[error] 554 | FunctionHelper.curried(DomRecGene.apply)
[error] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[error] | cannot reduce inline match with
[error] | scrutinee: scala.compiletime.erasedValue[Tup] : Tup
[error] | patterns : case _:*:[h @ _, t @ _]
[error] | case _:EmptyTuple.type
[error] |---------------------------------------------------------------------------
[error] |Inline stack trace
[error] |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
[error] |This location contains code that was inlined from MagicCurry.scala:20
[error] 20 | def c[Tup <: Tuple, R](f : Tup => R) : Curried[Tup, R] = inline erasedValue[Tup] match
[error] | ^
[error] 21 | case _ : (h *: t) =>
[error] 22 | (x : h) => c[t, R]((y : t) => f((x *: y).asInstanceOf))
[error] 23 | case _ : EmptyTuple.type => f(EmptyTuple.asInstanceOf)
[error] ---------------------------------------------------------------------------
[error] one error found
[error] (Compile / compileIncremental) Compilation failed
[error] Total time: 4 s, completed Sep 16, 2022, 10:56:03 AM | 15:05:30 |
Bulby#2541 | scala 3 | 15:17:01 |
velvetbaldmime#6377 | mmm, what's suspicious is that def c is not inlined (nor can it be, as a nested method) | 15:19:46 |
Bulby#2541 | does it have to be? | 15:20:02 |
velvetbaldmime#6377 | also I don't think you need EmptyTuple.type ? I thought EmptyTuple should suffice | 15:20:05 |
velvetbaldmime#6377 | does it have to be?
I assume so - you are using compile-time features, and def c is a runtime construct without inline | 15:20:33 |
Bulby#2541 | lmao i need to raise inline limit because i have more than 32 args | 15:21:33 |
Bulby#2541 | yeah that fixed it | 15:24:18 |
Bulby#2541 | god damn it it's still crying about experimental | 15:25:32 |
Bulby#2541 | @experimental
object DomRecGene:
val parser =
import net.bulbyvr.magic.FunctionHelper
FunctionHelper.curried(DomRecGene.apply) | 15:25:54 |
Bulby#2541 | it thinks FunctionHelper.curried isn't in an experimental scope | 15:26:04 |
thecoda#7033 | Got a fun implicit clash here | 20:56:44 |
thecoda#7033 | inline given [P <: Product]
(using NotGiven[P <:< AnyVal]): FieldInspectable[P] =
${productMacro[P]}
inline given [P <: Product with AnyVal]: FieldInspectable[P] =
${anyValMacro[P]} | 20:58:37 |
thecoda#7033 | Macro implementation not important, but the compiler is halting and catching fire when one of the above two givens doesn't match, and isn't trying the other one | 20:59:14 |
thecoda#7033 | They're defined in different objects so they can be independently imported | 21:00:27 |
Aly | You could try erasedValue[P] match { case _: AnyVal => instead of separate given- | 21:00:34 |
Aly | The independent objects thing is going to prove an issue | 21:00:43 |
thecoda#7033 | Yeah, I'd have tried erasedValue already, if not for that | 21:01:22 |
Aly | What if you change with AnyVal to requiring the implicit <:< instead? | 21:02:09 |
thecoda#7033 | Tried that too 😦 | 21:04:34 |
Aly | I am out of ideas | 21:05:55 |
thecoda#7033 | Tried rolling back to 3.1.3 as well, in case it was a regression. No joy there either | 21:06:41 |
Aly | Hmm | 21:09:05 |
Aly | Any type that's - not an AnyVal - has a Product mirror available (isn't opaque) Should be an AnyRef, right? | 21:09:35 |
thecoda#7033 | AnyVal types don't have mirrors | 21:10:04 |
Aly | Right, but for your non-anyval case | 21:10:20 |
Aly | Can you use with AnyRef instead of NotGiven ? | 21:10:31 |