Skip to content

Objects: Enforce types on properties mentioned #15

@goatslacker

Description

@goatslacker

It's a little late for me so I don't have a good code sample. I'll get one tomorrow.

In the meantime this seems to be failing:

//+ foo: { hello: String } -> String
function foo(o) {
    return o.hello;
}

foo({ hello: 'foo', world: 'bar' }); // will fail because world is not typed.

You could make an argument that it should throw a TypeError but I'd like for there to be an option.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions