dave08
11/09/2021, 2:32 PMdata
and inner
modifiers to class
compatible together?Joffrey
11/09/2021, 2:33 PMdave08
11/09/2021, 2:36 PMTestFixture
class that uses repos in the outer test class to add the fields (entities with relations) to the dbs in the init
block... if I put the data class inside the test's init block before the tests, it has access to the test class's properties, whereas if I put it after, I have to make it into an inner class, then I can't do :
val (client, order) = TextFixture()
unless I implement my own componentX functions...ephemient
11/09/2021, 7:47 PMinner
classes work by having a extra hidden reference to the outer class, inserted into every constructor, which I suppose could be implemented on a data
class, but feels very strangeclass Foo { inner data class Bar(...) }
should Foo().Bar(...) == Foo().Bar(...)
with different outer references that aren't publicly accessible on Bar
itself?dave08
11/09/2021, 8:22 PMephemient
11/11/2021, 1:23 AMdata class Foo(val bar: Int) {
var extra = 0
}
Foo(0).apply { extra = 1 } == Foo(0).apply { extra = 2 }