diff mbox

Go patch committed: Give error for unknown tuple call

Message ID mcripqdstrw.fsf@coign.corp.google.com
State New
Headers show

Commit Message

Ian Lance Taylor Aug. 4, 2011, 4:08 a.m. UTC
This patch from Roberto Lublinerman fixes PR 49889, which is a case
where the compiler failed to give an error for a program which made a
tuple assignment from a symbol which was not a function at all.
Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu.
Committed to mainline.

Ian
diff mbox

Patch

diff -r 8a209d96ec69 go/expressions.cc
--- a/go/expressions.cc	Tue Aug 02 17:13:31 2011 -0700
+++ b/go/expressions.cc	Wed Aug 03 20:53:47 2011 -0700
@@ -9682,6 +9682,8 @@ 
   Function_type* fntype = ce->get_function_type();
   if (fntype == NULL)
     {
+      if (ce->issue_error())
+	this->report_error(_("expected function"));    
       this->set_is_error();
       return Type::make_error_type();
     }