We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4957fee commit 857cd28Copy full SHA for 857cd28
1 file changed
Code/TokenSystem/Tokens/ExpressionTokens/MethodExpressionToken.cs
@@ -2,6 +2,7 @@
2
using SER.Code.Exceptions;
3
using SER.Code.Helpers.ResultSystem;
4
using SER.Code.MethodSystem.BaseMethods.Synchronous;
5
+using SER.Code.MethodSystem.BaseMethods.Yielding;
6
using SER.Code.ValueSystem;
7
8
namespace SER.Code.TokenSystem.Tokens.ExpressionTokens;
@@ -20,6 +21,11 @@ protected override IParseResult InternalParse(BaseToken[] tokens)
20
21
return new Ignore();
22
}
23
24
+ if (methodToken.Method is YieldingMethod)
25
+ {
26
+ return new Error("Yielding methods are not allowed in expressions.");
27
+ }
28
+
29
if (methodToken.Method is not ReturningMethod method)
30
{
31
return new Error($"Method '{methodToken.Method.Name}' does not return a value.");
0 commit comments