The typeis operator compile-time changes

In version 9.0, the Gosu operator typeis is more restrictive in its use. The left side of the typeis operator must be an object of a compile-time type that is possible at run time to be the type specified after the operator. This is a new requirement that is enforced at compile time by the Gosu editor. For example, typeis works if the type on the right side is a subtype or supertype of the compile-time type of the left-hand side of the operator.

For example, the following code was valid in version 8.0 but is a compile error in version 9.0:

var b : Boolean = true
var x = (b typeis java.lang.Integer)  // check if the type is a java.lang.Integer

The Gosu compiler knows that a Boolean object can never be a java.lang.Integer, so it is an error. This change increases the chance of detecting a certain class of accidental errors.

Generally speaking, any effects of this change result in compile errors but no run time errors. Fix any compilation errors that relate to this change.

If you use any dynamically-compiled code, test it or carefully review it for its use of the typeis operator. For example, the application dynamically compiles Gosu code embedded in templates used for Gosu document production.