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.

inline val class parameter in backend

See original GitHub issue
class Foo(inline val i: Int)

emits the following error

Concrete method has no definition: Concrete method has no definition: DefDef(i,List(),List(List()),TypeTree[TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Int)],EmptyTree)
one error found

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
nicolasstuckicommented, Jan 24, 2018

I assume that inline should never be used in a class parameter as we cannot ensure that accesses to those field are inlined. @odersky is that the correct semantics.

1reaction
smartercommented, Jan 24, 2018

I don’t think this should compile at all.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Inline parameters for constructors - Language Design
Classes with inline parameters should be marked as inline; Inline classes's field should only be called directly like Dummy("Hello World").value ...
Read more >
Inline classes | Kotlin
To declare an inline class for the JVM backend, use the value modifier along with the @JvmInline annotation before the class declaration:.
Read more >
Effective Kotlin Item 49: Consider using inline value classes
We can use inline value classes to make a wrapper around some type (like String in the above example) with no performance overhead...
Read more >
Inline - Scala 3 - EPFL
The Config object contains a definition of the inline value logging . This means that logging is treated as a constant value, equivalent...
Read more >
Methods with Inline classes return type are not usable from Java
inline class InlineClass (val value: String) ; class Main { private String someField ; : · private · = ·.INSTANCE ...
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