-
Notifications
You must be signed in to change notification settings - Fork 16
Invalid code for bool? to bool conversion in return #117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I've changed the generation logic for a Null-conditional operator when the return value is used afterwards.
The old behavior copied the whole code after the invocation statement, but as we can see below the code is invalid because of duplicate variable names:
The only solution that I found and implement to solve the above problem without knowing the type of the
In your example the following code will be generated:
I know that it is not ideal, but due to the current limitations of the transformation process it is the only solution for now.
Also having multiple async invocation with a Null-conditional operator in the same statement is currently not supported even with the new logic. Example:
|
…eturn value is used afterwards, fixes #117 # Conflicts: # Source/AsyncGenerator/Transformation/Internal/ReturnTaskFunctionRewriter.cs
Uh oh!
There was an error while loading. Please reload this page.
If you change the code below:
https://github.com/nhibernate/nhibernate-core/blob/4d887d8796e7c4e56cf88f52b5748826d6255c18/src/NHibernate/Engine/ISessionImplementor.cs#L47-L50
to the following:
Iinvalid code is generated:
Compilation error:
error CS0019: Operator '??' cannot be applied to operands of type 'bool' and 'bool'
P.S. It's not something that I really need just noticed when tested some stuff
The text was updated successfully, but these errors were encountered: