Analyzer checks access permissions when using named types
This commit is contained in:
parent
159317965d
commit
ed498a3bc0
@ -99,10 +99,19 @@ func (this *Tree) analyzeTypeInternal (
|
||||
Unit: unit,
|
||||
Name: ty.Name,
|
||||
}, acceptIncomplete)
|
||||
if err == nil {
|
||||
ty.Type = def.Type
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return ty, err
|
||||
|
||||
// check access permissions
|
||||
if def.Acc == entity.AccessPrivate && def.Unit != this.unit {
|
||||
return nil, errors.Errorf (
|
||||
ty.Position, "type %v is private",
|
||||
ty)
|
||||
}
|
||||
|
||||
ty.Type = def.Type
|
||||
return ty, nil
|
||||
|
||||
// pointer type
|
||||
case *entity.TypePointer:
|
||||
|
Loading…
Reference in New Issue
Block a user