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
aa6e81dd
Commit
aa6e81dd
authored
Sep 09, 2009
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
a few more blank tests
R=ken OCL=34500 CL=34500
parent
079e038a
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
10 deletions
+21
-10
src/cmd/gc/dcl.c
src/cmd/gc/dcl.c
+2
-2
src/cmd/gc/go.y
src/cmd/gc/go.y
+5
-2
src/cmd/gc/typecheck.c
src/cmd/gc/typecheck.c
+5
-4
test/blank.go
test/blank.go
+9
-2
No files found.
src/cmd/gc/dcl.c
View file @
aa6e81dd
...
...
@@ -1123,8 +1123,8 @@ methodname1(Node *n, Node *t)
star
=
"*"
;
t
=
t
->
left
;
}
if
(
t
->
sym
==
S
)
return
n
;
if
(
t
->
sym
==
S
||
isblank
(
n
)
)
return
n
ewname
(
n
->
sym
)
;
snprint
(
buf
,
sizeof
(
buf
),
"%s%S·%S"
,
star
,
t
->
sym
,
n
->
sym
);
return
newname
(
pkglookup
(
buf
,
t
->
sym
->
package
));
}
...
...
src/cmd/gc/go.y
View file @
aa6e81dd
...
...
@@ -176,6 +176,8 @@ import_stmt:
importdot(import);
break;
}
if(my->name[0] == '
_
' && my->name[1] == '
\
0
')
break;
// TODO(rsc): this line is needed for a package
// which does bytes := in a function, which creates
...
...
@@ -212,8 +214,8 @@ import_here:
$$ = parserline();
pkgimportname = S;
pkgmyname = $1;
if(
pkgmyname->def
)
redeclare(
pkgmyname
, "as imported package name");
if(
$1->def && ($1->name[0] != '
_
' || $1->name[1] != '
\
0
')
)
redeclare(
$1
, "as imported package name");
importfile(&$2);
}
| '
.
' LLITERAL
...
...
@@ -1172,6 +1174,7 @@ xdcl_list:
| xdcl_list xdcl
{
$$ = concat($1, $2);
testdclstack();
}
vardcl_list:
...
...
src/cmd/gc/typecheck.c
View file @
aa6e81dd
...
...
@@ -1982,12 +1982,13 @@ typecheckfunc(Node *n)
{
Type
*
t
,
*
rcvr
;
//dump("nname", n->nname);
typecheck
(
&
n
->
nname
,
Erv
|
Easgn
);
if
((
t
=
n
->
nname
->
type
)
==
T
)
return
;
n
->
type
=
t
;
rcvr
=
getthisx
(
t
)
->
type
;
if
(
rcvr
!=
nil
&&
n
->
shortname
!=
N
)
if
(
rcvr
!=
nil
&&
n
->
shortname
!=
N
&&
!
isblank
(
n
->
shortname
)
)
addmethod
(
n
->
shortname
->
sym
,
t
,
1
);
}
test/blank.go
View file @
aa6e81dd
...
...
@@ -6,12 +6,20 @@
package
main
import
_
"fmt"
var
call
string
type
T
struct
{
_
,
_
,
_
int
;
}
func
(
T
)
_
()
{
}
func
(
T
)
_
()
{
}
const
(
c0
=
iota
;
_
;
...
...
@@ -44,8 +52,7 @@ func i() int {
return
23
;
}
func
main
()
{
func
main
()
{
_
,
_
=
f
();
a
,
_
:=
f
();
if
a
!=
1
{
panic
(
a
)}
...
...
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