question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to create value classes

See original GitHub issue

I ran into the following issue while creating a value class in an almond-based Juptyer notebook:

class Kelvin(val t: Double) extends AnyVal
cmd0.sc:7: not found: value res0
  .declareVariable("res0", res0); Iterator() }, 
                           ^cmd0.sc:1: value class may not be a member of another class
class Kelvin(val t: Double) extends AnyVal
      ^Compilation Failed

Compilation Failed

I can reproduce the error via the “Try it online” button on https://almond.sh/ for Scala 2.11, 2.12 and 2.13 (although the error message is less verbose in 2.11). I assume, almond silently injects another base class which is not allow for the value class. Is there a way to solve this?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
alexarchambaultcommented, Apr 21, 2021

@Quafadas @sauerburger The upcoming version 0.11.2 should fix the error in 2.12 and 2.13 in the binder demo, or when the variable inspector is enabled, thanks to https://github.com/almond-sh/almond/pull/793.

0reactions
Quafadascommented, Apr 21, 2021

Oh - cool, thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

PowerShell classes still can't create value types · Issue #10669
PowerShell classes still can't create value types #10669 ... I should be able to write IEquatable<T> and IComparable<T> classes ...
Read more >
Unable to instantiate class with value class parameter from Java
The output when building with gradle shows that Java can't acces the constructor of DomainObject : ❯❯❯ ./gradlew run > Task :compileJava FAILED...
Read more >
can't set a value in another class [closed] - Stack Overflow
This is a method from a class, courses is an array from another class, I set the value of cn in main, but...
Read more >
010426: Failed to create feature class <value>.—ArcGIS Pro
Solution. Check to see if a feature class with the same name already exists at the specified output location. Either try a different...
Read more >
this - JavaScript | MDN
Class constructors are always called with new , so their behavior is the same as function constructors: the this value is the new...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found