Skip to content

Commit

Permalink
Scala 3: don't make the self ref vals private within (#555)
Browse files Browse the repository at this point in the history
  • Loading branch information
KacperFKorban authored May 17, 2023
1 parent 0855237 commit 62ace4d
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ private case class DeriveSchema()(using val ctx: Quotes) extends ReflectionUtils
}

def deriveCaseObject[T: Type](stack: Stack, top: Boolean)(using Quotes) = {
val selfRefSymbol = Symbol.newVal(Symbol.spliceOwner, s"derivedSchema${stack.size}", TypeRepr.of[Schema[T]], Flags.Lazy, Symbol.spliceOwner)
val selfRefSymbol = Symbol.newVal(Symbol.spliceOwner, s"derivedSchema${stack.size}", TypeRepr.of[Schema[T]], Flags.Lazy, Symbol.noSymbol)
val selfRef = Ref(selfRefSymbol)

val typeInfo = '{TypeId.parse(${Expr(TypeRepr.of[T].show)})}
Expand Down Expand Up @@ -150,7 +150,7 @@ private case class DeriveSchema()(using val ctx: Quotes) extends ReflectionUtils
}

def deriveCaseClass[T: Type](mirror: Mirror, stack: Stack, top: Boolean)(using Quotes) = {
val selfRefSymbol = Symbol.newVal(Symbol.spliceOwner, s"derivedSchema${stack.size}", TypeRepr.of[Schema[T]], Flags.Lazy, Symbol.spliceOwner)
val selfRefSymbol = Symbol.newVal(Symbol.spliceOwner, s"derivedSchema${stack.size}", TypeRepr.of[Schema[T]], Flags.Lazy, Symbol.noSymbol)
val selfRef = Ref(selfRefSymbol)
val newStack = stack.push(selfRef, TypeRepr.of[T])

Expand Down Expand Up @@ -283,7 +283,7 @@ private case class DeriveSchema()(using val ctx: Quotes) extends ReflectionUtils
}.toMap

def deriveEnum[T: Type](mirror: Mirror, stack: Stack)(using Quotes) = {
val selfRefSymbol = Symbol.newVal(Symbol.spliceOwner, s"derivedSchema${stack.size}", TypeRepr.of[Schema[T]], Flags.Lazy, Symbol.spliceOwner)
val selfRefSymbol = Symbol.newVal(Symbol.spliceOwner, s"derivedSchema${stack.size}", TypeRepr.of[Schema[T]], Flags.Lazy, Symbol.noSymbol)
val selfRef = Ref(selfRefSymbol)
val newStack = stack.push(selfRef, TypeRepr.of[T])

Expand Down

0 comments on commit 62ace4d

Please sign in to comment.