* Create a temporary variable and return lvalue access to it
*/
public TargetValue create_temp_value (DataType type, bool init, CodeNode node_reference, bool? value_owned = null) {
+ if (type is VoidType) {
+ Report.error (node_reference.source_reference, "internal: 'void' not supported as variable type");
+ }
+
var local = new LocalVariable (type.copy (), "_tmp%d_".printf (next_temp_var_id++), null, node_reference.source_reference);
local.init = init;
if (value_owned != null) {
--- /dev/null
+class Foo<G> : Object {
+ public G prop { get; set; }
+}
+
+delegate G FooFunc<G> (G g);
+
+void foo () {
+}
+
+void main () {
+ {
+ var f = new Thread<void> (null, foo);
+ }
+ {
+ Thread f = new Thread<void> (null, foo);
+ }
+ {
+ Thread<void> f = new Thread<void> (null, foo);
+ }
+ {
+ FooFunc f = (FooFunc) foo;
+ f (null);
+ }
+ {
+ FooFunc<void> f = (FooFunc<void>) foo;
+ f (null);
+ }
+ {
+ FooFunc<void> f = foo;
+ f (null);
+ }
+ {
+ var f = new Foo<void> ();
+ }
+}
void check_type_argument (DataType type_arg) {
if (type_arg is GenericType
|| type_arg is PointerType
+ || type_arg is VoidType
|| is_reference_type_argument (type_arg)
|| is_nullable_value_type_argument (type_arg)
|| is_signed_integer_type_argument (type_arg)