After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 652763 - Calling a generic async method of an abstract class on a non-generic subclass instance crashes valac
Calling a generic async method of an abstract class on a non-generic subclass...
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: general
unspecified
Other All
: Normal critical
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks: 652643
 
 
Reported: 2011-06-16 17:28 UTC by Philip Withnall
Modified: 2011-06-17 10:59 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Philip Withnall 2011-06-16 17:28:00 UTC
The following test case is crashing valac for me:

public abstract class Abstract<T> : Object {
	public async List<T> my_method () {
		return new List<T> ();
	}
}

public class Subclass : Abstract<string> {
}

void main () {
	var foo = new Subclass ();
	foo.my_method.begin ((o, r) => {
		var result = foo.my_method.end (r);
	});
}

gives the following crash:

(gdb) run --pkg gio-2.0 test.vala
Starting program: /opt/gnome2/build/bin/valac --pkg gio-2.0 test.vala
[Thread debugging using libthread_db enabled]
**
ERROR:valasemanticanalyzer.c:3898:vala_semantic_analyzer_get_actual_type: assertion failed: (instance_type != NULL)

Program received signal SIGABRT, Aborted.
0x00110416 in __kernel_vsyscall ()
Missing separate debuginfos, use: debuginfo-install glibc-2.14-2.i686 libffi-3.0.9-2.fc15.i686
(gdb) t a a bt

Thread 1 (Thread 0xb7fe36c0 (LWP 6182))

  • #0 __kernel_vsyscall
  • #1 raise
    from /lib/libc.so.6
  • #2 abort
    from /lib/libc.so.6
  • #3 g_assertion_message
  • #4 g_assertion_message_expr
    at gtestutils.c line 1436
  • #5 vala_semantic_analyzer_get_actual_type
    at valasemanticanalyzer.c line 3898
  • #6 vala_data_type_real_get_actual_type
    at valadatatype.c line 1721
  • #7 vala_data_type_get_actual_type
    at valadatatype.c line 1768
  • #8 vala_data_type_real_get_actual_type
    at valadatatype.c line 1752
  • #9 vala_data_type_get_actual_type
    at valadatatype.c line 1768
  • #10 vala_method_call_real_check
    at valamethodcall.c line 3413
  • #11 vala_code_node_check
    at valacodenode.c line 411
  • #12 vala_local_variable_real_check
    at valalocalvariable.c line 771
  • #13 vala_code_node_check
    at valacodenode.c line 411
  • #14 vala_declaration_statement_real_check
    at valadeclarationstatement.c line 368
  • #15 vala_code_node_check
    at valacodenode.c line 411
  • #16 vala_block_real_check
    at valablock.c line 1847
  • #17 vala_code_node_check
    at valacodenode.c line 411
  • #18 vala_method_real_check
    at valamethod.c line 4034
  • #19 vala_code_node_check
    at valacodenode.c line 411
  • #20 vala_lambda_expression_real_check
    at valalambdaexpression.c line 2160
  • #21 vala_code_node_check
    at valacodenode.c line 411
  • #22 vala_method_call_real_check
    at valamethodcall.c line 3369
  • #23 vala_code_node_check
    at valacodenode.c line 411
  • #24 vala_expression_statement_real_check
    at valaexpressionstatement.c line 351
  • #25 vala_code_node_check
    at valacodenode.c line 411
  • #26 vala_block_real_check
    at valablock.c line 1847
  • #27 vala_code_node_check
    at valacodenode.c line 411
  • #28 vala_method_real_check
    at valamethod.c line 4034
  • #29 vala_code_node_check
    at valacodenode.c line 411
  • #30 vala_source_file_check
    at valasourcefile.c line 984
  • #31 vala_semantic_analyzer_real_visit_source_file
    at valasemanticanalyzer.c line 2071
  • #32 vala_code_visitor_visit_source_file
    at valacodevisitor.c line 1329
  • #33 vala_source_file_accept
    at valasourcefile.c line 402
  • #34 vala_code_context_accept
    at valacodecontext.c line 1119
  • #35 vala_semantic_analyzer_analyze
    at valasemanticanalyzer.c line 2061
  • #36 vala_code_context_check
    at valacodecontext.c line 1138
  • #37 vala_compiler_run
    at valacompiler.c line 906
  • #38 vala_compiler_main
    at valacompiler.c line 1605
  • #39 main
    at valacompiler.c line 1614

Comment 1 Philip Withnall 2011-06-16 17:30:06 UTC
This is with git (master, ba518e654c4fad32dc4cecfb31b5dd19be3b2da4) from a few days ago.
Comment 2 Jürg Billeter 2011-06-17 10:59:29 UTC
commit e63a6456521bf4c6202339a68a1bfa09015da5a8
Author: Jürg Billeter <j@bitron.ch>
Date:   Fri Jun 17 12:48:32 2011 +0200

    Fix .begin and .end on async methods using generic types
    
    Fixes bug 652763.