rokucommunity / brighterscript

A superset of Roku's BrightScript language
MIT License
160 stars 46 forks source link

Adds `isInstance` flag #1187

Closed markwpearce closed 4 months ago

markwpearce commented 4 months ago

Adds the isInstance flag on symbol extra data for when a symbol represents an instance of a type.

This is useful for walking all variable expressions, and being able to check if that expression is an instance of the type or a reference to the actual type (or class constructor).

eg:

class Klass
end class

sub test(k as Klass)  ' k is an instance, Klass is not, but both are of ClassType("klass")
end sub