teatrove/teatrove — Issue #23: Tea 'as' operator does not downcast properly
Author: nicholashagen
Created: 2012-02-02 19:32:38+00:00
State: open

The 'as' keyword can be used to apply a cast and perform upconversion...ie:

// num is a Number
integer = num as Integer // equals Integer integer = (Integer) number

However, doing a downcast does not work...ie:

// integer is an Integer
num = integer as Number // should be equal to Number number = (Number) integer

The AssignmentStatement in TypeChecker needs additional handling to handle downcast cases