public bool checkUniqueLocalVar(DiagnosticPosition pos, VarSymbol varSymbol, WritableScope scope) { if (scope.getSymbolsByName(varSymbol.name, s => (s.kind & Kind.VAR) != 0).Any()) { log.error(pos, messages.duplicateVar, varSymbol.name); return(false); } return(true); }
public bool checkUnique(DiagnosticPosition pos, StructSymbol ssym, WritableScope scope) { bool contains = scope.getSymbolsByName(ssym.name, LookupKind.NON_RECURSIVE).Any(); if (contains) { log.error(pos, messages.duplicateStructName, ssym.name); } return(!contains); }
public ScopeImpl(Symbol owner, WritableScope outer = null) : base(owner) { this.outer = outer; }