facebookincubator / cinder

Cinder is Meta's internal performance-oriented production version of CPython.
https://trycinder.com
Other
3.49k stars 121 forks source link

static Python allows passing too many arguments #32

Closed DinoV closed 3 years ago

DinoV commented 3 years ago

This should report an error:

def produce() -> type:
    return object

produce(1)
DinoV commented 3 years ago

What we should be doing here is producing a compile time error so that we know we already have the correct arguments.

This could potentially be resulting in corruption for calls to non-JITed code right now as well as we could over-fill the locals array in the frame, and probably fires an assert in debug builds. In JITed code we should just be ignoring the extra args.

Calls from non-static Python should all still be okay as we'll still do the arg check.