ruby: added error message to isinstance check

Added error message when a symbol is not an instance of a particular expected
type.
This commit is contained in:
Brad Beckmann
2009-11-18 16:34:32 -08:00
parent 20f872ed2a
commit c9764b1ff1

View File

@@ -72,7 +72,10 @@ class SymbolTable(object):
continue
if types is not None:
assert isinstance(symbol, types)
if not isinstance(symbol, types):
symbol.error("Symbol '%s' is not of types '%s'.",
symbol,
types)
return symbol