Hi all, I have this code-snippet:
val stateParam: Option[ExtendedStatusState] = ExtendedStatusStateVar.get var criteria = stateParam.map(state => state.criteria.copy(endLocalDate = state.criteria.endLocalDate) ).getOrElse{... Which throws this compile-error:
Any ideas?
--
Andreas Joseph Krogh
CTO / Partner - Visena AS
Mobile: +47 909 56 963
You received this message because you are subscribed to the Google Groups "scala-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/d/optout. |
På onsdag 24. mai 2017 kl. 12:23:17, skrev Andreas Joseph Krogh <[hidden email]>:
BTW; Using Scala-2.12.2
--
Andreas Joseph Krogh
CTO / Partner - Visena AS
Mobile: +47 909 56 963
You received this message because you are subscribed to the Google Groups "scala-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/d/optout. |
i've come across this once but forgot the solution ;(
Gesendet: Mittwoch, 24. Mai 2017 um 12:24 Uhr
Von: "Andreas Joseph Krogh" <[hidden email]> An: [hidden email] Betreff: Sv: [scala-user] Strange "value not found"-compiler error På onsdag 24. mai 2017 kl. 12:23:17, skrev Andreas Joseph Krogh <[hidden email]>:
BTW; Using Scala-2.12.2
--
Andreas Joseph Krogh
CTO / Partner - Visena AS
Mobile: +47 909 56 963
-- You received this message because you are subscribed to the Google Groups "scala-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/d/optout. You received this message because you are subscribed to the Google Groups "scala-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/d/optout. |
In reply to this post by Andreas Joseph Krogh
Probably something to do with these issues, if that's any help to you... https://github.com/scala/bug/issues/6391 Op woensdag 24 mei 2017 12:23:31 UTC+2 schreef andreak:
You received this message because you are subscribed to the Google Groups "scala-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/d/optout. |
val stateParam: Option[ExtendedStatusState] = ExtendedStatusStateVar.get var criteria = stateParam.map(state => state.criteria.copy( Best, Oliver On Wed, May 24, 2017 at 9:54 AM, Jasper-M <[hidden email]> wrote:
-- You received this message because you are subscribed to the Google Groups "scala-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/d/optout. |
På onsdag 24. mai 2017 kl. 16:39:08, skrev Oliver Ruebenacker <[hidden email]>:
Here's a test-case:
import org.joda.time.LocalDate case class Criteria(endLocalDate: LocalDate) class TestFisk { var criteria = Some(Criteria(LocalDate.now())).map(crit => crit.copy(endLocalDate = crit.endLocalDate) ).getOrElse(Criteria(LocalDate.now)) def endLocalDate = criteria.endLocalDate.plusYears(1).monthOfYear().withMaximumValue() } Error:(10, 28) not found: value crit
crit.copy(endLocalDate = crit.endLocalDate) It seems it's the
def endLocalDate
which is causing the trouble. I think this is a bug because the named parameter endLocalDate in copy() should be unambiguous regardless if there's a def with the same name in scope.
If I annotate the return-type of def endLoalDate it compiles fine:
var criteria = Some(Criteria(LocalDate.now())).map(crit => crit.copy(endLocalDate = crit.endLocalDate) ).getOrElse(Criteria(LocalDate.now)) def endLocalDate: LocalDate = criteria.endLocalDate.plusYears(1).monthOfYear().withMaximumValue() --
You received this message because you are subscribed to the Google Groups "scala-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/d/optout. |
Free forum by Nabble | Edit this page |