alliedmodders/sourcemod — pull request #219 by dvander (2014-12-12 06:38:16+00:00)
Title: Replace symbol proxies with type symbols.

Methodmaps introduced the concept of "proxy symbols", which when hit by a findglb() test, redirected to a different symbol. I can't remember exactly why I did this, but it was something to do with redefinitions and the fact that constructors need to have the same name as the methodmap.

Proxies are really hacky though. This patch obsoletes them by creating actual type symbols for each methodmap. Since enums already introduce a symbol, a methodmap definition erases this symbol in the first pass, and methodmap symbols persist into the second pass. On the second pass, any attempts to use the enum symbol as an enum struct will fail.

This greatly simplifies how we implement constructors, and paves the way for using methodmap symbols in field expressions. This is also the first step toward introducing real type semantics, since right now, tags do not produce type symbols.

Non-value symbols are new to Pawn and none of the existing machinery knows how to deal with them. Luckily primary() is a pinpoint for symbol lookups, so I hacked in a check that type symbols do not escape.