This PR removes any code-generation support for optional classes, replacing them with asserts to ensure the compiler never encounters an optional class type. This also lets us simplify our logic in some places.
It also adds a new isClassType function to the compiler. Every language had it's own version of this logic... So I deleted all those duplicate functions and we now use this single, centralized function instead.
The base implementation returns false, and it's overridden by Class and Builtin (for Value and Object keywords).
It also also adds some tests to ensure the compiler does correctly reject optional classes, and types which are using them.
This PR removes any code-generation support for optional classes, replacing them with asserts to ensure the compiler never encounters an optional class type. This also lets us simplify our logic in some places.
It also adds a new
isClassType
function to the compiler. Every language had it's own version of this logic... So I deleted all those duplicate functions and we now use this single, centralized function instead. The base implementation returnsfalse
, and it's overridden byClass
andBuiltin
(forValue
andObject
keywords).It also also adds some tests to ensure the compiler does correctly reject optional classes, and types which are using them.