What does mean `Cannot use 'CapturedTypeConstructo...
# getting-started
v
What does mean
Cannot use 'CapturedTypeConstructor(out ObjectProperty<Any>)' as reified type parameter
?
r
Can you show us the code triggering the error?
v
Copy code
tableview { column("New", SimpleObjectProperty::class).useTextField() }
there is implementation of the function:
Copy code
inline fun <S, reified T> TableColumn<S, T?>.useTextField(...) = apply { ... }
I know, it's TornadoFX-specific and, perhaps, misuse of the function
What does mean
CapturedTypeConstructor
?
r
What's the signature of
column
?
v
Copy code
fun <S, T: Any> TableView<S>.column(String, KClass<T>, TableColumn<S, T>.() -> Unit = {}): TableColumn<S, T>
When
useTextField()
is used with no arguments it ends up with
requireNotNull
. But I think
useTextField
is not even called (in this case)
r
I'm getting another compile error with your code, and if I fix that it compiles fine, so I'm guessing this is more context-specific than I thought. Have you tried asking in #tornadofx ?
v
How do you fix it?
r
I'm not using TornadoFX myself so I'm running a little dummy setup here:
The compile error there is a different one than the one you have, but I can fix that by changing
Copy code
inline fun <S, reified T> TableColumn<S, T?>.useTextField() = apply { }
to
Copy code
inline fun <S, reified T> TableColumn<S, T>.useTextField() = apply { }
(Make
T
non-nullable)
👍 1
And then it compiles fine
v
Cool, I have the same Require/Found error, when I use
.. column(...) { useTextField() }
i.e.
useTextField()
inside the
column
I think it's tricky to change TornadoFX sources, but thanks, I can play a bit with overriding
useTextField