-
Notifications
You must be signed in to change notification settings - Fork 103
Closed
Description
neo-devpack-dotnet/src/Neo.Compiler.CSharp/Helper.cs
Lines 126 to 137 in 4661dd2
| public static StackItemType GetPatternType(this ITypeSymbol type) | |
| { | |
| return type.ToString() switch | |
| { | |
| "bool" => StackItemType.Boolean, | |
| "byte[]" => StackItemType.Buffer, | |
| "string" => StackItemType.ByteString, | |
| "Neo.SmartContract.Framework.ByteString" => StackItemType.ByteString, | |
| "System.Numerics.BigInteger" => StackItemType.Integer, | |
| _ => throw new CompilationException(type, DiagnosticId.SyntaxNotSupported, $"Unsupported pattern type: {type}") | |
| }; | |
| } |
The code above, looks like it supports ByteString and BigInteger, but in fact, if it's written this way in the contract, he'll report an error somewhere else.
public void M(object o1)
{
switch (o1)
{
case byte[]: break; // Compile Successfully
case string: break; // Compile Successfully
case bool: break; // Compile Successfully
case ByteString: break; //Compile Failure
case BigInteger: break; //Compile Failure
}
}
This method(ConvertIdentifierNameExpression) throws an exception Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels