Strange "value not found"-compiler error

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Strange "value not found"-compiler error

Andreas Joseph Krogh
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:
 
 
[ERROR] /home/andreak/dev/officenet_origo/frontend/application/src/main/scala/no/officenet/origo/frontend/lift/snippet/report/extendedstatus/ExtendedStatusMonthYearSnippet.scala:80: not found: value state 
[ERROR]                 state.criteria.copy(endLocalDate = state.criteria.endLocalDate)
[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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Sv: [scala-user] Strange "value not found"-compiler error

Andreas Joseph Krogh
På onsdag 24. mai 2017 kl. 12:23:17, skrev Andreas Joseph Krogh <[hidden email]>:
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:
 
 
[ERROR] /home/andreak/dev/officenet_origo/frontend/application/src/main/scala/no/officenet/origo/frontend/lift/snippet/report/extendedstatus/ExtendedStatusMonthYearSnippet.scala:80: not found: value state 
[ERROR]                 state.criteria.copy(endLocalDate = state.criteria.endLocalDate)
[ERROR]                                                    ^
 
Any ideas?
 
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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Aw: Sv: [scala-user] Strange "value not found"-compiler error

Dennis Haupt-2
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]>:
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:
 
 
[ERROR] /home/andreak/dev/officenet_origo/frontend/application/src/main/scala/no/officenet/origo/frontend/lift/snippet/report/extendedstatus/ExtendedStatusMonthYearSnippet.scala:80: not found: value state 
[ERROR]                 state.criteria.copy(endLocalDate = state.criteria.endLocalDate)
[ERROR]                                                    ^
 
Any ideas?
 
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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Strange "value not found"-compiler error

Jasper-M
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/9171
https://github.com/scala/bug/issues/6391

Op woensdag 24 mei 2017 12:23:31 UTC+2 schreef andreak:
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:
 
 
[ERROR] /home/andreak/dev/officenet_origo/frontend/application/src/main/scala/no/officenet/origo/frontend/lift/snippet/report/extendedstatus/ExtendedStatusMonthYearSnippet.scala:80: not found: value state 
[ERROR]                 state.criteria.copy(endLocalDate = state.criteria.endLocalDate)
[ERROR]                                                    ^
 
Any ideas?
 
--
Andreas Joseph Krogh
CTO / Partner - Visena AS
Mobile: +47 909 56 963
<a href="javascript:" target="_blank" gdf-obfuscated-mailto="OKWT-_cuBQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">and...@...
<a href="https://www.visena.com" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.visena.com\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEZCRXz-WDRdNbJba2HgBB4l9ej_Q&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.visena.com\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEZCRXz-WDRdNbJba2HgBB4l9ej_Q&#39;;return true;">www.visena.com
<a href="https://www.visena.com" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.visena.com\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEZCRXz-WDRdNbJba2HgBB4l9ej_Q&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.visena.com\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEZCRXz-WDRdNbJba2HgBB4l9ej_Q&#39;;return true;">

--
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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Strange "value not found"-compiler error

Oliver Ruebenacker

     Hello,

  Would be nice to have something self-contained.

  What happened if you replace the argument expression with ???:

val stateParam: Option[ExtendedStatusState] = ExtendedStatusStateVar.get

var criteria = stateParam.map(state =>
   state.criteria.copy(endLocalDate = ???).getOrElse{...

     Best, Oliver

On Wed, May 24, 2017 at 9:54 AM, Jasper-M <[hidden email]> wrote:
Probably something to do with these issues, if that's any help to you...

https://github.com/scala/bug/issues/9171
https://github.com/scala/bug/issues/6391

Op woensdag 24 mei 2017 12:23:31 UTC+2 schreef andreak:
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:
 
 
[ERROR] /home/andreak/dev/officenet_origo/frontend/application/src/main/scala/no/officenet/origo/frontend/lift/snippet/report/extendedstatus/ExtendedStatusMonthYearSnippet.scala:80: not found: value state 
[ERROR]                 state.criteria.copy(endLocalDate = state.criteria.endLocalDate)
[ERROR]                                                    ^
 
Any ideas?
 
--
Andreas Joseph Krogh
CTO / Partner - Visena AS
Mobile: <a href="tel:+47%20909%2056%20963" value="+4790956963" target="_blank">+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.



--
Oliver Ruebenacker
Senior Software Engineer, Diabetes Portal, Broad Institute

--
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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Sv: Re: [scala-user] Re: Strange "value not found"-compiler error

Andreas Joseph Krogh
På onsdag 24. mai 2017 kl. 16:39:08, skrev Oliver Ruebenacker <[hidden email]>:
 
     Hello,
 
  Would be nice to have something self-contained.
 
  What happened if you replace the argument expression with ???:
 
val stateParam: Option[ExtendedStatusState] = ExtendedStatusStateVar.get

var criteria = stateParam.map(state =>
   state.criteria.copy(endLocalDate = ???).getOrElse{...

     Best, Oliver
 
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()
 
 
--
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.
Loading...