Haven't anyone created a ticket at <https://youtra...
# kotest
s
Haven't anyone created a ticket at https://youtrack.jetbrains.com/issues/KT to allow to extract lambda outside the constructor parameters? It will be great to have such a feature for kotest: instead of
Copy code
class MyTest : FreeSpec({
    // ...
})
it will be possible to write like
Copy code
class MyTest : FreeSpec {
    // ...
}
I've searched briefly by couldn't find.
m
The test Lambda is a parameter to the constructor, hence the syntax. The only alternative is to use the
init
syntax, but personally, I think that's even less desirable.
s
@Mike, yep, I want to use the constructor syntax, but without round brackets
m
Question. How will the compiler differentiate between constructor and class definition without the parenthesis? And how much impact will it have on performance if it can? Still never hurts to ask.
Hmmm, never mind. If it was a class definition, one would require
class MyTest : FreeSpec() { .   }
s
How will the compiler differentiate between constructor and class definition without the parenthesis?
Just proposed the behavior in the ticket, thanks
s
This would be amazing
I voted