You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
UFCS try to match with calling get() method on obj
In example of using fopen the code looks like:
main: () -> int = {
myfile := fopen("file-opened-with-c-function.txt", "w");
myfile.fprintf("Unified Function Call Syntax Rocks!\n\n");
myfile.fclose();
}
there is a need to call fclose at the end of scope.
We can introduce better_fopen that will return unique_prt
with fclose as a deleter.
main: () -> int = {
myfile := better_fopen("file-opened-with-c-function.txt", "w");
myfile.fprintf("Unified Function Call Syntax Rocks!\n\n");
}
That will ensure closing but will not work with UFCS.
In this change we added a check
(after other matches failed) if there is a call to get() method
that match a function signature.
0 commit comments