summaryrefslogtreecommitdiff
path: root/usr/austin/eval/scope.go
diff options
context:
space:
mode:
authorAustin Clements <aclements@csail.mit.edu>2009-08-05 11:49:51 -0700
committerAustin Clements <aclements@csail.mit.edu>2009-08-05 11:49:51 -0700
commitc8b49a4532508beea09fe32b8ff2ce8670e88652 (patch)
tree52b8f1b2dd990c619a8b473c8702d3f0a2c6d26c /usr/austin/eval/scope.go
parent3bd3459d14bc33de204f0558688f2e908c35a2f8 (diff)
downloadgolang-c8b49a4532508beea09fe32b8ff2ce8670e88652.tar.gz
Implement struct types, selector expressions, and type
declarations. R=rsc APPROVED=rsc DELTA=587 (519 added, 21 deleted, 47 changed) OCL=32754 CL=32788
Diffstat (limited to 'usr/austin/eval/scope.go')
-rw-r--r--usr/austin/eval/scope.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr/austin/eval/scope.go b/usr/austin/eval/scope.go
index d32a37a36..3ddc55e48 100644
--- a/usr/austin/eval/scope.go
+++ b/usr/austin/eval/scope.go
@@ -86,7 +86,10 @@ func (b *block) DefineType(name string, pos token.Position, t Type) Type {
}
// We take the representative type of t because multiple
// levels of naming are useless.
- nt := &NamedType{pos, name, t.lit()};
+ if t != nil {
+ t = t.lit();
+ }
+ nt := &NamedType{pos, name, t, false, make(map[string] Method)};
b.defs[name] = nt;
return nt;
}