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
When I try to add extension methods, it give me error saying "Extension methods must be defined in top level class". I guess it is because that there is a implicit class wrapping around the code. Is there anyway to walkaround this
The text was updated successfully, but these errors were encountered:
I'm afraid not. This is a limitation's in Roslyn's C# script variant, which RP relies on. I may introduce a mode in the future which would allow creating a full program (with a class and a Main method).
Meanwhile, you can write extension methods as top level methods in the script, as I suggested in this answer.
When I try to add extension methods, it give me error saying "Extension methods must be defined in top level class". I guess it is because that there is a implicit class wrapping around the code. Is there anyway to walkaround this
The text was updated successfully, but these errors were encountered: