Allow compilation of nested/inner interfaces.
Submitted by mad..@..ir.com
Link to original bug (#666059)
Description
valac (at least at versions 0.12, 0.14, 0.15, all of which I tested) produces an error when compiling code with a nested interface. Nested classes (even when nested within interfaces) seem to survive just fine. For example:
interface Outer { interface Inner {} }
yields:
$ valac-0.14 -C -v example.vala
Loaded package /usr/share/vala-0.14/vapi/glib-2.0.vapi' Loaded package
/usr/share/vala-0.14/vapi/gobject-2.0.vapi'
example.vala:2.3-2.17: error: unexpected declaration
interface Inner {}
^^^^^^^^^^^^^^^
Compilation failed: 1 error(s), 0 warning(s)
Allowing nested interfaces seems like a perfectly reasonable and desirable feature to have in the language (i.e. I'd be using one right now if it worked). If nested interfaces have been purposefully omitted from the language, it would be helpful to have the rationale added to the 'interfaces' chapter of the Vala reference manual.
If the omission is simply an oversight, please correct it!
Version: 0.15.x