!amEFGYrRomMpJtiMDK:matrix.org

Scala Metaprogramming

1840 Members
5 Servers

Load older messages


SenderMessageTime
16 Sep 2022
@_discord_632671653054382120:t2bot.ionyaamyaa I can find an adequate replacement for .. on s3 11:22:45
@_discord_266680529020125185:t2bot.ioAdam ឵឵#4161 Apply(fun, parameters).asExpr no? 11:38:24
@_discord_402027995021443073:t2bot.iocheeze#2000 changed their profile picture.12:30:24
@_discord_215582414544699393:t2bot.ioBulby#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
@_discord_215582414544699393:t2bot.ioBulby#2541 scala 3 15:17:01
@_discord_734849617820254331:t2bot.iovelvetbaldmime#6377 mmm, what's suspicious is that def c is not inlined (nor can it be, as a nested method) 15:19:46
@_discord_215582414544699393:t2bot.ioBulby#2541 does it have to be? 15:20:02
@_discord_734849617820254331:t2bot.iovelvetbaldmime#6377 also I don't think you need EmptyTuple.type? I thought EmptyTuple should suffice 15:20:05
@_discord_734849617820254331:t2bot.iovelvetbaldmime#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
@_discord_215582414544699393:t2bot.ioBulby#2541 lmao i need to raise inline limit because i have more than 32 args 15:21:33
@_discord_215582414544699393:t2bot.ioBulby#2541 yeah that fixed it 15:24:18
@_discord_215582414544699393:t2bot.ioBulby#2541 god damn it it's still crying about experimental 15:25:32
@_discord_215582414544699393:t2bot.ioBulby#2541
@experimental
object DomRecGene:
  val parser =
    import net.bulbyvr.magic.FunctionHelper
    FunctionHelper.curried(DomRecGene.apply)
15:25:54
@_discord_215582414544699393:t2bot.ioBulby#2541 it thinks FunctionHelper.curried isn't in an experimental scope 15:26:04
@_discord_530372354426011651:t2bot.iothecoda#7033 Got a fun implicit clash here 20:56:44
@_discord_530372354426011651:t2bot.iothecoda#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
@_discord_530372354426011651:t2bot.iothecoda#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
@_discord_530372354426011651:t2bot.iothecoda#7033 They're defined in different objects so they can be independently imported 21:00:27
@_discord_192322936219238400:t2bot.ioAly You could try erasedValue[P] match { case _: AnyVal => instead of separate given- 21:00:34
@_discord_192322936219238400:t2bot.ioAly The independent objects thing is going to prove an issue 21:00:43
@_discord_530372354426011651:t2bot.iothecoda#7033 Yeah, I'd have tried erasedValue already, if not for that 21:01:22
@_discord_192322936219238400:t2bot.ioAly What if you change with AnyVal to requiring the implicit <:< instead? 21:02:09
@_discord_530372354426011651:t2bot.iothecoda#7033 Tried that too 😦 21:04:34
@_discord_192322936219238400:t2bot.ioAly I am out of ideas 21:05:55
@_discord_530372354426011651:t2bot.iothecoda#7033 Tried rolling back to 3.1.3 as well, in case it was a regression. No joy there either 21:06:41
@_discord_192322936219238400:t2bot.ioAly Hmm 21:09:05
@_discord_192322936219238400:t2bot.ioAly Any type that's
- not an AnyVal
- has a Product mirror available (isn't opaque)
Should be an AnyRef, right?
21:09:35
@_discord_530372354426011651:t2bot.iothecoda#7033 AnyVal types don't have mirrors 21:10:04
@_discord_192322936219238400:t2bot.ioAly Right, but for your non-anyval case 21:10:20
@_discord_192322936219238400:t2bot.ioAly Can you use with AnyRef instead of NotGiven? 21:10:31

There are no newer messages yet.


Back to Room ListRoom Version: 9