Commit 8bef7fdc authored by Russ Cox's avatar Russ Cox

bug252: make ... vs ...T crossing an error, at least for now

R=r
CC=golang-dev
https://golang.org/cl/199066
parent 44898c7b
......@@ -1517,6 +1517,11 @@ typecheckaste(int op, Type *tstruct, NodeList *nl, char *desc)
for(tl=tstruct->type; tl; tl=tl->down) {
t = tl->type;
if(tl->isddd) {
if(nl != nil && nl->n->isddd && !eqtype(nl->n->type, t)) {
// TODO(rsc): This is not actually illegal but will
// help catch bugs.
yyerror("cannot pass %+N as %T (... mismatch)", nl->n, tl);
}
if(nl != nil && nl->next == nil && nl->n->isddd && eqtype(nl->n->type, t))
goto out;
for(; nl; nl=nl->next) {
......
// errchk $G $D/$F.go
// Copyright 2010 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
func f(args ...) {
g(args) // ERROR "[.][.][.] mismatch"
}
func g(args ...interface{}) {
f(args) // ERROR "[.][.][.] mismatch"
}
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