Enable inference of types based on the dot ('.') operator #1313
Xyncgas
started this conversation in
Type System
Replies: 2 comments 1 reply
-
You can imagine writing a function to handle an anonymous record becomes annoying when there is so many stuffs inside the AR so you are required to write everything in every function's parameter Imagine how it becomes harder to write functions for processing anonymous records if the record has nested AR |
Beta Was this translation helpful? Give feedback.
0 replies
-
There's gotta be an existing suggestion for this, but I can't find it |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description :
Extending inference to dot operator as in
myVar.a
Usage :
Allows function to use parameter with the dot operator without first defining the type of the parameter, anonymous record benefits mostly from the feature (today we can get around the system by wrapping the anonymous record in a class type and pass that type to the function, since we previously wrapped the anonymous record in the type, we can use the anonymous record in the type that's passed into a function at a later point. The down side is the wrapper can't be a struct type otherwise you had to specify in the constructor of the anonymous record's type
Example :
Beta Was this translation helpful? Give feedback.
All reactions