Skip to content

Conversation

@emgre
Copy link
Contributor

@emgre emgre commented Feb 2, 2021

  • Fix Default values for structure fields #20 and fix Struct constructor/builder pattern #33.
    • It is now possible to define a default value to any struct field.
    • If all the fields of a struct have a default value, then it automatically has a default value if used within another struct
    • In C# and Java, structs now have a constructor that takes all the values that do not have a default value.
    • All documentation states the default value (if there is one)
    • In C, static (from a translation unit perspective) functions named {struct_name}_init are provided. They work the same way as the constructors in C# and Java.
  • Fix Provide Action<T> for interfaces with a single callback #34
    • In C#, when an interface or a one-time callback is functional (it only contains a single callback), then a implementation of the interface is generated. Its constructor takes an Action or a Func which can be a lambda function.
    • In Java, the FunctionalInterface is added to these interfaces.

emgre added 3 commits January 29, 2021 14:22
- struct enum default are now validated
- struct defaults are now commented
- Annotates the functional interfaces with `FunctionInterface` in Java

Fix #34
@emgre emgre force-pushed the feature/struct-defaults branch from 74594d3 to a05b44f Compare February 2, 2021 22:48
@emgre emgre force-pushed the feature/struct-defaults branch from a05b44f to a876984 Compare February 2, 2021 22:53
@jadamcrain jadamcrain merged commit 700388b into master Feb 2, 2021
@jadamcrain jadamcrain deleted the feature/struct-defaults branch February 2, 2021 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide Action<T> for interfaces with a single callback Struct constructor/builder pattern Default values for structure fields

3 participants