It would help even more with Kubernetes types used...
# dotnet
w
It would help even more with Kubernetes types used to express yaml equivalents... just need to improve the Pulumi C# types. What do you reckon, @tall-librarian-49374?
t
Yeah… We can’t get rid of input types I’m afraid.
w
I'm not suggesting that, rather they should somehow play nice with target typing, probably by having a default ctor but I'm not sure of the implications.
t
The default constructor isn’t enough, right? The generic type doesn’t have the properties that you set. Compiler should somehow be instructed to instantiate the
T
type directly, not
Input<T>
w
Yeah I think you're right. The
Input<T>
is relying on implicit type conversion. The thing is you only ever instantiate
T
directly, otherwise you're passing an
Output<T>
from upstream.
I can't see an easy way to do it since
Input<T>
can't derive from
T
, so it would have to compose / wrap
T
instead, effectively lifting the properties of
T
. That would require either dynamic dispatch or code generation.
Let me know if you have any ideas
t
We do a similar codegen for Go, so it is possible, but I’m not sure if it would be a good thing for C#. Go doesn’t have generics, so options are limited.
w
IIRC the typescript support lifts properties, which is nice to have as it makes
apply
etc go away.
... so there would be other "benefits"
t
TypeScript has a language feature for that