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
MethodBuilder obtains an IDisposable handle on the currently being used CodeWriter at the end of its write method by calling writer.Block on it in a using statement (see here), before invoking _methodBodyWriter and ultimately disposing the CodeWriter afterwards. Because of the changes introduced to the Dispose method of CodeWriter in 9963d78, this immediately closes off not only the currently being written to method block, but also the class and namespace blocks. This means that all following Writers write outside of the namespace block, leading to incorrect code.
I can share a minimum reproducible example if necessary, but it should be immediately obvious when trying to generate any class with a method. It would probably be prudent to add a test case with multiple methods to check for this in the future.
Example diff from my project after updating:
The text was updated successfully, but these errors were encountered:
MethodBuilder obtains an IDisposable handle on the currently being used CodeWriter at the end of its write method by calling
writer.Block
on it in a using statement (see here), before invoking_methodBodyWriter
and ultimately disposing the CodeWriter afterwards. Because of the changes introduced to the Dispose method of CodeWriter in 9963d78, this immediately closes off not only the currently being written to method block, but also the class and namespace blocks. This means that all following Writers write outside of the namespace block, leading to incorrect code.I can share a minimum reproducible example if necessary, but it should be immediately obvious when trying to generate any class with a method. It would probably be prudent to add a test case with multiple methods to check for this in the future.
Example diff from my project after updating:
The text was updated successfully, but these errors were encountered: