Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
955638e2
Commit
955638e2
authored
Mar 04, 2009
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
disallow ordinary-type.(T), as in spec.
R=ken OCL=25705 CL=25705
parent
461dd912
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
walk.c
src/cmd/gc/walk.c
+3
-0
type.go
src/lib/reflect/type.go
+2
-1
No files found.
src/cmd/gc/walk.c
View file @
955638e2
...
...
@@ -2851,6 +2851,9 @@ ifaceas1(Type *dst, Type *src, int explicit)
if
(
src
==
T
||
dst
==
T
)
return
Inone
;
if
(
explicit
&&
!
isinter
(
src
))
yyerror
(
"cannot use .(T) on non-interface type %T"
,
src
);
if
(
isinter
(
dst
))
{
if
(
isinter
(
src
))
{
if
(
eqtype
(
dst
,
src
,
0
))
...
...
src/lib/reflect/type.go
View file @
955638e2
...
...
@@ -107,7 +107,8 @@ func newBasicType(name string, kind int, size int) Type {
// Prebuilt basic types
var
(
Missing
=
newBasicType
(
missingString
,
MissingKind
,
1
);
DotDotDot
=
newBasicType
(
dotDotDotString
,
DotDotDotKind
,
unsafe
.
Sizeof
(
true
.
(
interface
{})));
empty
interface
{};
DotDotDot
=
newBasicType
(
dotDotDotString
,
DotDotDotKind
,
unsafe
.
Sizeof
(
empty
));
Bool
=
newBasicType
(
"bool"
,
BoolKind
,
unsafe
.
Sizeof
(
true
));
Int
=
newBasicType
(
"int"
,
IntKind
,
unsafe
.
Sizeof
(
int
(
0
)));
Int8
=
newBasicType
(
"int8"
,
Int8Kind
,
1
);
...
...
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