}
}
- public override List<Symbol> get_symbols () {
- return element_type.get_symbols ();
+ public override bool is_accessible (Symbol sym) {
+ return element_type.is_accessible (sym);
}
public override bool check (SemanticAnalyzer analyzer) {
return false;
}
- /**
- * Returns a list of symbols that define this type.
- *
- * @return symbol list
- */
- public virtual List<Symbol> get_symbols () {
- var symbols = new ArrayList<Symbol> ();
+ // check whether this type is at least as accessible as the specified symbol
+ public virtual bool is_accessible (Symbol sym) {
if (data_type != null) {
- symbols.add (data_type);
+ return data_type.is_accessible (sym);
}
- return symbols;
+ return true;
}
public virtual Symbol? get_member (string member_name) {
}
}
- public override List<Symbol> get_symbols () {
- var symbols = new ArrayList<Symbol> ();
- symbols.add (delegate_symbol);
- return symbols;
+ public override bool is_accessible (Symbol sym) {
+ return delegate_symbol.is_accessible (sym);
}
public override string? get_type_id () {
return SemanticAnalyzer.symbol_lookup_inherited (base_symbol, member_name);
}
- public override List<Symbol> get_symbols () {
- return base_type.get_symbols ();
+ public override bool is_accessible (Symbol sym) {
+ return base_type.is_accessible (sym);
}
public override string? get_type_id () {
// check whether type is at least as accessible as the specified symbol
public bool is_type_accessible (Symbol sym, DataType type) {
- foreach (Symbol type_symbol in type.get_symbols ()) {
- Scope method_scope = sym.get_top_accessible_scope ();
- Scope type_scope = type_symbol.get_top_accessible_scope ();
- if ((method_scope == null && type_scope != null)
- || (method_scope != null && !method_scope.is_subscope_of (type_scope))) {
- return false;
- }
- }
-
- return true;
+ return type.is_accessible (sym);
}
public DataType? get_value_type_for_symbol (Symbol sym, bool lvalue) {
return null;
}
- public override List<Symbol> get_symbols () {
- var symbols = new ArrayList<Symbol> ();
- symbols.add (signal_symbol);
- return symbols;
+ public override bool is_accessible (Symbol sym) {
+ return signal_symbol.is_accessible (sym);
}
}
return null;
}
+
+ // check whether this symbol is at least as accessible as the specified symbol
+ public bool is_accessible (Symbol sym) {
+ Scope sym_scope = sym.get_top_accessible_scope ();
+ Scope this_scope = this.get_top_accessible_scope ();
+ if ((sym_scope == null && this_scope != null)
+ || (sym_scope != null && !sym_scope.is_subscope_of (this_scope))) {
+ return false;
+ }
+
+ return true;
+ }
}
public enum Vala.SymbolAccessibility {