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
void is treated as assignment compatible to Object, which is incorrect and results in invalid CIL.
Attempting to operate on void values as if they were instances of Object should result in an error.
Provided #914, #915 and #916 are fixed, the only way to generate a value of void type will be calls to functions returning void. However, it's probably more straightforward to check for void values on consumption rather than production, given that calling void returning functions is obviously fine, provided the result is discarded without being used.
The following should all produce compile time errors:
Assignment from a void value
Passing a void value into a function call as an argument
Passing a void value to a built in operator
Passing a void value to a user defined operator function
Attempting to access a member of a void value
Checking if a value of void type is null with the '?' operator
Comparing a void value to anything for equality
The text was updated successfully, but these errors were encountered:
Bugs fixed:
- Void is incorrectly convertible to Object (closes#302)
- No error when declaring symbols of void type (closes#914)
- No error when inheriting from types that are constructed from void (closes#915)
- No error when attempting to create instances of types constructed from void (closes#916)
- No error when attempting to consume values of void type (closes#921)
Bugs fixed:
- Void is incorrectly convertible to Object (closes#302)
- No error when declaring symbols of void type (closes#914)
- No error when inheriting from types that are constructed from void (closes#915)
- No error when attempting to create instances of types constructed from void (closes#916)
- No error when attempting to consume values of void type (closes#921)
void
is treated as assignment compatible to Object, which is incorrect and results in invalid CIL.Attempting to operate on void values as if they were instances of Object should result in an error.
Provided #914, #915 and #916 are fixed, the only way to generate a value of
void
type will be calls to functions returningvoid
. However, it's probably more straightforward to check for void values on consumption rather than production, given that calling void returning functions is obviously fine, provided the result is discarded without being used.The following should all produce compile time errors:
The text was updated successfully, but these errors were encountered: