asynchronous/yield.vala \
generics/arrays-not-supported.test \
generics/constructor-chain-up.vala \
+ generics/inference-argument-may-fail.vala \
generics/inference-static-function.vala \
generics/parameter-sizeof-initializer.vala \
generics/member-dup-destroy.vala \
--- /dev/null
+class Foo<G> {
+ public Foo () throws Error {
+ }
+}
+
+Foo<string>? foo () throws Error {
+ return null;
+}
+
+G bar<G> (Foo<G>? foo) {
+ return null;
+}
+
+void main () {
+ try {
+ bar (foo ());
+ bar (new Foo<string> ());
+ } catch {
+ }
+}
value_type.check (context);
+ // FIXME code duplication in ObjectCreationExpression.check
if (tree_can_fail) {
if (parent_node is LocalVariable || parent_node is ExpressionStatement) {
// simple statements, no side effects after method call
insert_statement (context.analyzer.insert_block, decl);
var temp_access = SemanticAnalyzer.create_temp_access (local, target_type);
+ temp_access.formal_target_type = formal_target_type;
// don't set initializer earlier as this changes parent_node and parent_statement
local.initializer = this;
context.analyzer.visit_member_initializer (init, type_reference);
}
+ // FIXME code duplication in MethodCall.check
if (tree_can_fail) {
if (parent_node is LocalVariable || parent_node is ExpressionStatement) {
// simple statements, no side effects after method call
insert_statement (context.analyzer.insert_block, decl);
var temp_access = SemanticAnalyzer.create_temp_access (local, target_type);
+ temp_access.formal_target_type = formal_target_type;
+
// don't set initializer earlier as this changes parent_node and parent_statement
local.initializer = this;
decl.check (context);