Closed ekk-cb closed 3 years ago
Hmm... somewhere in the README it reads that nulls are not supported. I guess this makes this issue a feature request :sweat_smile:
Original Author:mauhiz Original Author:ekk-cb
Yeah, sure =P I don't use nulls often enough to need them, but if other people do it shouldn't be too hard to put them in. Let's leave this open 'till I do
Original Author:lihaoyi Original Author:ekk-cb
I'd welcome nulls too, I'm having really hard times to deal with them right know...
Original Author:l15k4 Original Author:ekk-cb
If anyone wants to take a stab at making null
s work for all reference types, I'd happily take a PR. Otherwise I'll get to it eventually...
Original Author:lihaoyi Original Author:ekk-cb
Tomorrow I will do it for Readers
Original Author:l15k4 Original Author:ekk-cb
Ou I forgot, I wanted to do that 3 days ago, but I can't compile upickle due to stack overflow. For 2.10.4 and 2.11.2 it stackoveflows during implicit resolution? I even tried -Xss for 10MB :
at org.scalamacros.paradise.typechecker.Implicits$ParadiseImplicitSearch$ImplicitComputation.<init>(Implicits.scala:683)
at org.scalamacros.paradise.typechecker.Implicits$ParadiseImplicitSearch.searchImplicit(Implicits.scala:815)
at org.scalamacros.paradise.typechecker.Implicits$ParadiseImplicitSearch.bestImplicit(Implicits.scala:1184)
at org.scalamacros.paradise.typechecker.Implicits$class.inferImplicit(Implicits.scala:44)
at org.scalamacros.paradise.Plugin$$anon$1.inferImplicit(Plugin.scala:25)
at scala.tools.nsc.typechecker.Implicits$class.inferImplicit(Implicits.scala:37)
at org.scalamacros.paradise.Plugin$$anon$1.inferImplicit(Plugin.scala:25)
at scala.tools.nsc.typechecker.Typers$Typer.applyImplicitArgs(Typers.scala:127)
at scala.tools.nsc.typechecker.Typers$Typer.adaptToImplicitMethod$1(Typers.scala:869)
at scala.tools.nsc.typechecker.Typers$Typer.adapt(Typers.scala:1126)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5660)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5721)
at scala.tools.nsc.typechecker.Typers$Typer.computeType(Typers.scala:5808)
at scala.tools.nsc.typechecker.Namers$Namer.assignTypeToTree(Namers.scala:834)
at scala.tools.nsc.typechecker.Namers$Namer.methodSig(Namers.scala:1163)
at scala.tools.nsc.typechecker.Namers$Namer.getSig$1(Namers.scala:1454)
at scala.tools.nsc.typechecker.Namers$Namer.typeSig(Namers.scala:1466)
at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1$$anonfun$apply$1.apply$mcV$sp(Namers.scala:731)
at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1$$anonfun$apply$1.apply(Namers.scala:730)
at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1$$anonfun$apply$1.apply(Namers.scala:730)
at scala.tools.nsc.typechecker.Namers$Namer.scala$tools$nsc$typechecker$Namers$Namer$$logAndValidate(Namers.scala:1499)
at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1.apply(Namers.scala:730)
at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1.apply(Namers.scala:729)
at org.scalamacros.paradise.typechecker.Namers$$anon$3.completeImpl(Namers.scala:737)
at scala.tools.nsc.typechecker.Namers$LockingTypeCompleter$class.complete(Namers.scala:1622)
at org.scalamacros.paradise.typechecker.Namers$$anon$3.complete(Namers.scala:735)
at scala.tools.nsc.typechecker.Namers$PolyTypeCompleter.completeImpl(Namers.scala:1655)
at scala.tools.nsc.typechecker.Namers$LockingTypeCompleter$class.complete(Namers.scala:1622)
at scala.tools.nsc.typechecker.Namers$PolyTypeCompleter.complete(Namers.scala:1634)
at scala.reflect.internal.Symbols$Symbol.info(Symbols.scala:1231)
at scala.reflect.internal.Symbols$Symbol.tpe(Symbols.scala:1202)
at scala.reflect.internal.Symbols$Symbol.tpeHK(Symbols.scala:1203)
at scala.reflect.internal.Types$Type.computeMemberType(Types.scala:784)
at scala.reflect.internal.Symbols$MethodSymbol.typeAsMemberOf(Symbols.scala:2655)
at scala.reflect.internal.Types$Type.memberType(Types.scala:779)
at scala.tools.nsc.typechecker.Implicits$ImplicitInfo.tpe(Implicits.scala:210)
at scala.tools.nsc.typechecker.Implicits$ImplicitInfo.isCyclicOrErroneous(Implicits.scala:215)
at org.scalamacros.paradise.typechecker.Implicits$ParadiseImplicitSearch$ImplicitComputation.isIneligible(Implicits.scala:619)
at org.scalamacros.paradise.typechecker.Implicits$ParadiseImplicitSearch$ImplicitComputation.survives(Implicits.scala:628)
at org.scalamacros.paradise.typechecker.Implicits$ParadiseImplicitSearch$ImplicitComputation$$anonfun$11$$anonfun$12.apply(Implicits.scala:684)
at org.scalamacros.paradise.typechecker.Implicits$ParadiseImplicitSearch$ImplicitComputation$$anonfun$11$$anonfun$12.apply(Implicits.scala:684)
at scala.collection.TraversableLike$$anonfun$filter$1.apply(TraversableLike.scala:264)
at scala.collection.immutable.List.foreach(List.scala:318)
at scala.collection.TraversableLike$class.filter(TraversableLike.scala:263)
at scala.collection.AbstractTraversable.filter(Traversable.scala:105)
at org.scalamacros.paradise.typechecker.Implicits$ParadiseImplicitSearch$ImplicitComputation$$anonfun$11.apply(Implicits.scala:684)
at org.scalamacros.paradise.typechecker.Implicits$ParadiseImplicitSearch$ImplicitComputation$$anonfun$11.apply(Implicits.scala:683)
at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251)
at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251)
at scala.collection.immutable.List.foreach(List.scala:318)
at scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:251)
at scala.collection.AbstractTraversable.flatMap(Traversable.scala:105)
at org.scalamacros.paradise.typechecker.Implicits$ParadiseImplicitSearch$ImplicitComputation.<init>(Implicits.scala:683)
at org.scalamacros.paradise.typechecker.Implicits$ParadiseImplicitSearch.searchImplicit(Implicits.scala:815)
at org.scalamacros.paradise.typechecker.Implicits$ParadiseImplicitSearch.bestImplicit(Implicits.scala:1184)
at org.scalamacros.paradise.typechecker.Implicits$class.inferImplicit(Implicits.scala:44)
at org.scalamacros.paradise.Plugin$$anon$1.inferImplicit(Plugin.scala:25)
at scala.tools.nsc.typechecker.Implicits$class.inferImplicit(Implicits.scala:37)
at org.scalamacros.paradise.Plugin$$anon$1.inferImplicit(Plugin.scala:25)
at scala.tools.nsc.typechecker.Typers$Typer.applyImplicitArgs(Typers.scala:127)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$adaptToImplicitMethod$1$1$$anonfun$8.apply(Typers.scala:872)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$adaptToImplicitMethod$1$1$$anonfun$8.apply(Typers.scala:871)
at scala.tools.nsc.typechecker.Typers$Typer.silent(Typers.scala:727)
at scala.tools.nsc.typechecker.Typers$Typer.adaptToImplicitMethod$1(Typers.scala:869)
Original Author:l15k4 Original Author:ekk-cb
Ah, it must not be compiled from root project...
Original Author:l15k4 Original Author:ekk-cb
I have to give up, I couldn't find a way to get rid of the scala nullable constraints. I was playing around with stuff like [T >: Null <: AnyRef]
but it got really tedious...
stuck-on-scala-nullable-constraints.patch | uploaded via ZenHub
Original Author:l15k4 Original Author:ekk-cb
upickle 0.2.4 should support null
s in general now (that was easy!) the rule is:
0
, 0.0
, false
) and can't write themOriginal Author:lihaoyi Original Author:ekk-cb
Good one @lihaoyi, thank you, works perfectly
Original Author:l15k4 Original Author:ekk-cb
Test Close Issue Original Author:ekk-cb
Here is my stacktrace:
Although this indicates an issue with the underlying data, it should serialize it as a
Js.Null
, e.g.case Js.String(s) => if (s == null) sb.append("null") else ...
@ Js.scala:109ID: 12 Original Author: mauhiz ID: 10 Original Author: ekk-cb