Reputation: 178
Code:
void main(){
print(foo().runtimeType);
}
Function foo(){
return (){};
}
Output:
() => Null
Why is this Null and not void?
Upvotes: 0
Views: 60
Reputation: 467
From dart official site:
All functions return a value. If no return value is specified, the statement return null; is implicitly appended to the function body.
Upvotes: 2