Vala compiler update 0.50.4

A new version of the compiler for the Vala programming language 0.50.4 has been released. The Long Term Support (LTS) branch Vala 0.48.14 (packaged for Ubuntu 18.04) and the experimental branch Vala 0.51.3 have also been updated.

The Vala language is an object-oriented programming language that provides a syntax similar to C# or Java. Gobject (Glib Object System) is used as an object model. Memory management is carried out by ownership (owned/unowned references) or by using ARC (substitution of destructors and decrements of object reference counters at the compilation stage).

The language has support for introspection, lambda functions, interfaces, delegates and closures, signals and slots, exceptions, properties, non-null types, type inference for local variables. The kit comes with a large number of bindings to C libraries (vala-girs, vala-extra-vapis). Vala programs are translated into a C representation and then compiled by a standard C compiler. It is possible to run programs in script mode.

List of changes:

  • Added additional params keyword support for constructors class Foo{ public Foo(params string[] args){ foreach (var arg in args) print(arg); } }
  • codegen:
    • Improved support for SimpleType struct constructors (e.g. used to bind typedef uint32_t people_inside; from C) [SimpleType] [CCode (cname = "people_inside")] public struct PeopleInside : uint32 {}
    • Improved handling of the "NoWrapper" attribute.
    • For classes, CCode.type_cname and get_ccode_type_name() are allowed.
    • Always use G_TYPE_INSTANCE_GET_CLASS/INTERFACE for external symbols.
    • Used g_boxed_free in free-wrapper to allocate GLib.Value on the heap.
    • Fixed memory leak during implicit unboxing of GLib.Value (universal container of any value type).
    • Fixed memory leak when moving heap-allocated structure to stack.
    • Inheritance of the destructor of the parent structure is provided
    • Improved proper getting of symbol_reference nested cast-expressions.
    • Removed all nested occurrences of CCodeCastExpression.
    • Stopped incorrect calling of the default signal handler.
    • Included "string.h" for strcmp() (POSIX profile, a mode in which Vala generates code using only the standard C library).
  • Vala:
    • Improved detection of duplicate package source files.
    • The fields/properties of GtkChild must be declared unowned.
    • Reassignment of field/property of GtkChild is forbidden.
    • Applied stricter condition for lambda when delegating assignment.
    • It is forbidden to use one-time SimpleType structures.
    • GLib.Value unboxing ensures that an unowned value is returned.
    • It is forbidden to cast GLib.Value to nullable struct/simple type.
    • Added checking of type arguments in base types/class/interface preconditions.
    • Capture of va_list parameters/variables is prohibited.
    • Generics containing a pointer to a structure must be cast to the correct type when accessed to avoid C UB.
    • Implemented type inference for "in" inside enum.
    • Improved context checking for assignments in the writeable field.
    • Included "stdlib.h" for Enum.to_string() (POSIX).
    • Set correct source_reference for implicit variables "this" and "result"
    • Provided an error message for an invalid internal operand of unary expressions.
  • Codewriter: Stopped adding trailing ";" after the WithStatement body.
  • Girparser:
    • Provided processing of an anonymous delegate not backed by a virtual method or signal.
    • Applied "delegate_target" metadata for methods and parameters
    • Applied "destroy_notify_cname" metadata for fields
    • Applied "type_get_function" metadata for classes and interfaces
    • Set CCode.type_cname for classes if it doesn't match the default.
  • girwriter: Write instance parameter elements provided.
  • girwriter: Implemented default signal handler output.
  • libvaladoc/html: Removed struct field sorting to keep their original order when generating valadoc.org html documentation
  • libvaladoc: Ensured proper getting of values ​​for Api.Class.is_compact
  • libvaladoc: Added wrapper for 'agedge' graphviz library
  • Bindings:
    • Minor fixes in binding generation: cairo, gobject-2.0, pango, goocanvas-2.0, curses, alsa, bzlib, sqlite3, libgvc, posix, gstreamer-1.0, gdk-3.0, gdk-x11-3.0, gtk+-3.0, gtk4, fuse, libxml-2.0
    • gdk-pixbuf-2.0: Pixbuf.save_to_streamv_async() fix
    • gio-2.0: PollableOutputStream.write*_nonblocking() binding fix
    • gio-2.0,gtk+-3.0,gtk4: Discard explicit c-type attributes of va_list parameters
    • gio-2.0: Missing invoker selected for some AppInfo/File.*() methods
    • glib-2.0: Added GLib.[S]List.is_empty() convenience methods for non-null
    • glib-2.0: Binding the assert_cmp* function [#395]
    • glib-2.0: Improved OptionEntry.flags field type
    • glib-2.0: PtrArray is now a subclass of GenericArray
    • gstreamer-1.0: CCode.type_id of MiniObject is set to G_TYPE_BOXED [#1133]
    • gtk+-2.0,javascriptcoregtk-4.0: Corrected use of CCode.type_cname attribute
    • gtk+-3.0,gtk4: Fixed some delegate return values ​​and parameters
    • gtk4: Updated to version 4.0.2.

Source: opennet.ru

Add a comment