vala:wip/direct-generics

Last commit made on 2019-03-22
Get this branch:
git clone -b wip/direct-generics https://git.launchpad.net/vala

Branch merges

Branch information

Name:
wip/direct-generics
Repository:
lp:vala

Recent commits

0c53c5e... by Jakub Kaszycki <email address hidden>

Added support for direct generics

Direct generics are a rare phenomenon, the only notable example in GLib
is GArray. Direct generics are handled using macros/sizeof and passed
around by pointers (not in pointers), so they need not fit in a pointer.
Thus, values like double, int64 or even funny structure types can be
stored in GArray (unlike GPtrArray or GHashTable).

This commit implements a complete support of direct generics. Also, the
GLib VAPI is adjusted for direct generics.

Direct generics are triggered by a new parameter to CCode. They are only
supposed to be used in VAPI files, using them in normal source files is
undefined. If your type is something else than a GArray, reconsider the matter
twice before enabling direct generics.

f83ecd8... by Rico Tzschichholz

codegen: Use default-value to pass element_size to GArray constructor

Based on patch by Jakub Kaszycki

906f76d... by Rico Tzschichholz

codegen: Resolve generics in sizeof-expression of parameter initializer

0ed8cad... by Rico Tzschichholz

codegen: Don't create special GArray clear-func for non-null structs

Based on patch by Jakub Kaszycki

5baacba... by Rico Tzschichholz

codegen: Move try_cast_variant_to_type() to GVariantModule.visit_cast_expression()

9a9ffd7... by Rico Tzschichholz

codegen: Move get_type_signature() to DataType

7584b13... by Rico Tzschichholz

ccode: Rename CCodeFeatureTestMacro to CCodeDefine and generalize it

This now serves as base for CCodeMacroReplacement too.

230cd35... by Corentin Noël

tests: Add more invalid "assignment" tests to increase coverage

12957d1... by Corentin Noël

tests: Add a field starting with a digit test

4b00344... by Rico Tzschichholz

tests: Add some invalid "array slice" tests to increase coverage