-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
proposalNew feature or requestNew feature or request
Description
This is specifically to address the need for having to call:
var m: &Map(Str, int)
m = map::make(Str, int)
The information is already baked into the return type so it might be possible to infer it using this syntax:
def make -> &Map(type K, type V) {
// use K and V here
}
m = map::make()
You could also do fancy things like overloading based on the return type:
def function -> type T {
#if T == int {
return 20
} else if T == Str {
return "Some string"
} else {
...
}
}
This does make overload resultion harder but it should be possible to implement by using a context type.
Metadata
Metadata
Assignees
Labels
proposalNew feature or requestNew feature or request