summaryrefslogtreecommitdiff
path: root/usr/austin/eval/scope.go
diff options
context:
space:
mode:
authorAustin Clements <aclements@csail.mit.edu>2009-08-28 14:39:12 -0700
committerAustin Clements <aclements@csail.mit.edu>2009-08-28 14:39:12 -0700
commit34b3a883750dbedf4a9c2c48c0263ea82611ffc7 (patch)
treefbfdbf724a5cb6ce3de6d2e416e46d8a1af35aac /usr/austin/eval/scope.go
parentf6b32149286964c52a6ca9c9c6f09feb0813d6fb (diff)
downloadgolang-34b3a883750dbedf4a9c2c48c0263ea82611ffc7.tar.gz
Fix named types being defined to named types. In general, the
code assumes that the definition of a named type is not a named type, but some code paths could violate that. R=rsc APPROVED=rsc DELTA=9 (5 added, 2 deleted, 2 changed) OCL=34046 CL=34053
Diffstat (limited to 'usr/austin/eval/scope.go')
-rw-r--r--usr/austin/eval/scope.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/usr/austin/eval/scope.go b/usr/austin/eval/scope.go
index fd95530b1..0f6f3a0d0 100644
--- a/usr/austin/eval/scope.go
+++ b/usr/austin/eval/scope.go
@@ -85,12 +85,10 @@ func (b *block) DefineType(name string, pos token.Position, t Type) Type {
if _, ok := b.defs[name]; ok {
return nil;
}
- // We take the representative type of t because multiple
- // levels of naming are useless.
+ nt := &NamedType{pos, name, nil, true, make(map[string] Method)};
if t != nil {
- t = t.lit();
+ nt.Complete(t);
}
- nt := &NamedType{pos, name, t, false, make(map[string] Method)};
b.defs[name] = nt;
return nt;
}