Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add function prototypes #6

Open
nikomatsakis opened this issue Jul 10, 2017 · 0 comments
Open

add function prototypes #6

nikomatsakis opened this issue Jul 10, 2017 · 0 comments

Comments

@nikomatsakis
Copy link
Owner

Currently the IR includes only "use" statements, which are meant to model opaque functions. It'd be nice to replace those with function prototypes. You would give a signature like:

fn foo<...>(T1..Tn) -> Tr;

then you would write:

x = foo<..>(y, z);

and we would instantiate the function signature, add the constraints that all of the types/regions must outlive this point, and create the relevant subtyping relations, all in one step.

One can still model the existing a = use(b) by something like:

fn opaque<A,B>(B) -> A

which would permit

a = opaque<TA, TB>(b)

where TA is the type of a and TB is the type of B.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant