HaxeFoundation / haxe-evolution

Repository for maintaining proposal for changes to the Haxe programming language
111 stars 58 forks source link

Readable/Writbale constraints #61

Closed lublak closed 4 years ago

lublak commented 5 years ago

Rendered version

Simn commented 4 years ago

This proposal basically throws a piece of code at us and asks us to make it work. You would have to go more into detail here and describe what you actually want. Is this just syntactic sugar for properties? Or are we talking about variance annotations? Or what?

Closing for now. I'm willing to reopen if clarifications are made.

lublak commented 4 years ago

@Simn it was about the idea of ​​readable and writtable constrain checks. I'm not a native speaker, but I hope you understand what I'm trying to explain. Currently we have different readable getters (get, never), (default, null) and (default, default). For a constraints it should not matter how it can be read. Currently if you use <T:{var field:String}> it is impossible to use fields with (get, never), (default, null). If you use <T:{var field(default, null):String}> you only can use field(default, null). The same applies to writable constrains.