Commit 34c58fe1 authored by Yury Smolsky's avatar Yury Smolsky Committed by Robert Griesemer

cmd/compile: use embedlineno instead of lineno in copytype

Also remove lineno from typecheckdeftype since copytype was
the only user of it and typecheck uses lineno independently.

toolstach-check passed.

Updates #19683.

Change-Id: I1663fdb8cf519d505cc087c8657dcbff3c8b1a0a
Reviewed-on: https://go-review.googlesource.com/114875
Run-TryBot: Yury Smolsky <yury@smolsky.by>
Reviewed-by: 's avatarRobert Griesemer <gri@golang.org>
parent e34f660a
......@@ -3608,21 +3608,14 @@ func copytype(n *Node, t *types.Type) {
}
// Double-check use of type as embedded type.
lno := lineno
if embedlineno.IsKnown() {
lineno = embedlineno
if t.IsPtr() || t.IsUnsafePtr() {
yyerror("embedded type cannot be a pointer")
yyerrorl(embedlineno, "embedded type cannot be a pointer")
}
}
lineno = lno
}
func typecheckdeftype(n *Node) {
lno := lineno
setlineno(n)
n.Type.Sym = n.Sym
n.SetTypecheck(1)
n.Name.Param.Ntype = typecheck(n.Name.Param.Ntype, Etype)
......@@ -3637,8 +3630,6 @@ func typecheckdeftype(n *Node) {
// that don't come along.
copytype(n, t)
}
lineno = lno
}
func typecheckdef(n *Node) {
......
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