Skip to content

class C(x: R) NOT same as class C(private val x: R) #620

Closed
@SethTisue

Description

@SethTisue

reported by @yanisIk at #568:

It says on the cheatsheet that
class C(x: R) is the same as class C(private val x: R) which is not true.
In this case (class C(x: R)), x is just a parameter that the constructor can receive and is only a local variable inside the constructor and not a member of the class.

there is discussion on that apparently abandoned PR about an appropriate fix

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions