blob: d5d0f1d620e725202c2b5684967ebe47e989cf92 [file] [log] [blame]
Robert Griesemer7e21ec32008-06-26 11:56:17 -07001// $G $D/$F.go
2
3// Copyright 2009 The Go Authors. All rights reserved.
4// Use of this source code is governed by a BSD-style
5// license that can be found in the LICENSE file.
6
7package main
8
Russ Cox839a6842009-01-20 14:40:40 -08009type T struct {
Rob Pike74dd0ab2009-08-17 13:30:22 -070010 s string;
Robert Griesemer7e21ec32008-06-26 11:56:17 -070011}
12
13
14func main() {
Rob Pike74dd0ab2009-08-17 13:30:22 -070015 s := "";
16 l1 := len(s);
17 var t T;
18 l2 := len(t.s); // BUG: cannot take len() of a string field
Russ Cox1a319892009-09-14 21:03:53 -070019 _, _ = l1, l2;
Robert Griesemer7e21ec32008-06-26 11:56:17 -070020}
21
22/*
Russ Cox839a6842009-01-20 14:40:40 -080023uetli:/home/gri/go/test/bugs gri$ 6g bug057.go
Rob Pike8a09c132008-07-27 13:30:53 -070024bug057.go:14: syntax error
Robert Griesemer7e21ec32008-06-26 11:56:17 -070025*/