public override SymbolDefinition AddDeclaration(SymbolDeclaration symbol) { if (definition == null) { return(null); } symbol.scope = this; switch (symbol.kind) { case SymbolKind.ConstantField: case SymbolKind.LocalConstant: if (!(definition is TypeDefinitionBase)) { return(base.AddDeclaration(symbol)); } break; case SymbolKind.Variable: case SymbolKind.ForEachVariable: case SymbolKind.FromClauseVariable: return(base.AddDeclaration(symbol)); } return(definition.AddDeclaration(symbol)); }