musictheory / NilScript

Objective-C-style language superset of JavaScript with a tiny, simple runtime
Other
50 stars 5 forks source link

Check `@cast` codegen #130

Closed iccir closed 7 years ago

iccir commented 7 years ago

Assuming -[SettingsTableGroupCell targetTableID] returns a string, the following results in prefix being a SettingsTableGroupCell and not a String:

    let prefix = [@cast(SettingsTableGroupCell, cell) targetTableID];

    // Error: Argument of type 'SettingsTableGroupCell' is not assignable to parameter of type 'String'
    [foo selectPrefix: prefix];