vmware-archive / scripted

The Scripted code editor
Eclipse Public License 1.0
1.56k stars 166 forks source link

Use function parameter types to infer the types of arguments passed into the function #240

Open aeisenberg opened 11 years ago

aeisenberg commented 11 years ago

Consider the following snippet:

function File(path) { this.path = path;}
/**
 * @param {function(f:File):undefined} computer
 */
function pathFunc(computer) {
}
pathFunc(function(f) { });

Since we are now keeping track of parameter types, we have enough information to determine the type of the final f parameter.