Why this is not allowed? ```public value class Set...
# language-evolution
t
Why this is not allowed?
Copy code
public value class SetValue<Value>(public val value : Value)
"Inline class cannot have value parameter of type 'Value'" Thread in Slack Conversation
Sorry, for cross-posting, but I'm still looking for an answer. Probably there's good reason for that, but if not - That's a real use-case. I'm writing store API and this represents operation for the simplest Property store.
r
Why is
Value
a generic type?
t
@Rob Elliot Because SetValue represents operation on a
Property<Value>
store, that is itself generic.
Copy code
public interface Store<out State, in Mutation> {
    public fun <Value> query(query : Query<State, Value>) : Value
    public fun apply(mutation : Mutation)
    // ...
}
.
Copy code
public class PropertyStore<Value> : Store<Value, SetValue<Value>>
r
wierd thing is, if you change the parameter type to smth like
List<Value>
it works 🤔
found this related to it: https://youtrack.jetbrains.com/issue/KT-26352 seems like it's unclear what such class should do, therefore it's not allowed
🙏 1