Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
f10a7882
Commit
f10a7882
authored
Apr 21, 2011
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gc: another pointer to interface message
R=ken2 CC=golang-dev
https://golang.org/cl/4444056
parent
5ff33364
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
src/cmd/gc/subr.c
src/cmd/gc/subr.c
+7
-6
test/interface/pointer.go
test/interface/pointer.go
+1
-0
No files found.
src/cmd/gc/subr.c
View file @
f10a7882
...
...
@@ -1928,13 +1928,14 @@ assignop(Type *src, Type *dst, char **why)
}
return
0
;
}
if
(
isptrto
(
dst
,
TINTER
))
{
if
(
why
!=
nil
)
*
why
=
smprint
(
":
\n\t
%T is pointer to interface, not interface"
,
dst
);
return
0
;
}
if
(
src
->
etype
==
TINTER
&&
dst
->
etype
!=
TBLANK
)
{
if
(
why
!=
nil
)
{
if
(
isptrto
(
dst
,
TINTER
))
*
why
=
smprint
(
":
\n\t
%T is interface, not pointer to interface"
,
src
);
else
*
why
=
": need type assertion"
;
}
if
(
why
!=
nil
)
*
why
=
": need type assertion"
;
return
0
;
}
...
...
test/interface/pointer.go
View file @
f10a7882
...
...
@@ -33,4 +33,5 @@ func main() {
print
(
"call addinst
\n
"
)
var
x
Inst
=
AddInst
(
new
(
Start
))
// ERROR "pointer to interface"
print
(
"return from addinst
\n
"
)
var
x
*
Inst
=
new
(
Start
)
// ERROR "pointer to interface"
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment