Commit fc253334 by Ian Lance Taylor

compiler: Report invalid receiver types in function definitions.

    
    Fixes golang/go#12324.
    
    Reviewed-on: https://go-review.googlesource.com/13988

From-SVN: r227427
parent 5b078017
3f8feb4f905535448833a14e4f5c83f682087749 672ac2abc52d8bd70cb9fb03dd4a32fdde9c438f
The first line of this file holds the git revision number of the last The first line of this file holds the git revision number of the last
merge done from the gofrontend repository. merge done from the gofrontend repository.
...@@ -1818,7 +1818,11 @@ Gogo::start_function(const std::string& name, Function_type* type, ...@@ -1818,7 +1818,11 @@ Gogo::start_function(const std::string& name, Function_type* type,
function); function);
} }
else else
go_unreachable(); {
error_at(type->receiver()->location(),
"invalid receiver type (receiver must be a named type)");
ret = Named_object::make_function(name, NULL, function);
}
} }
this->package_->bindings()->add_method(ret); this->package_->bindings()->add_method(ret);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment