rogp/jspp — Issue #11: Function Parameters with Objects
Author: rogp
Created: 2011-10-13 03:08:40+00:00
State: open

What if an object with properties can have multiple types and gets passed as a parameter? For example:

function foo(bar as Object) {
//we want to enforce bar.qux is of type "String"
//we want to enforce bar.quux is also of type "String"
}

var bar as Object = {
qux: 1,
quux: "widget"
};