-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-frontendArea: Compiler frontend (errors, parsing and HIR)Area: Compiler frontend (errors, parsing and HIR)A-type-systemArea: Type systemArea: Type system
Milestone
Description
Make it legal to do the following:
obj foo() {
fn add5(n: int) -> int {
ret n + 5;
}
}
fn add5(n: int) -> int {
ret n + 5;
}
fn main() {
let fiveplusseven = bind add5(7);
log_err fiveplusseven();
// Can't do this currently
let my_foo = foo();
let fiveplusseven_too = bind my_foo.add5(7);
log_err fiveplusseven_too();
}
This feature would make it possible to reify methods as standalone functions. (I haven't thought through all the implications of this; I suppose the resulting function would have to capture the object in its scope.)
Metadata
Metadata
Assignees
Labels
A-frontendArea: Compiler frontend (errors, parsing and HIR)Area: Compiler frontend (errors, parsing and HIR)A-type-systemArea: Type systemArea: Type system