コード例 #1
0
 public IValue Add(IValueWithMathOperands other, IValueFactory fac)
 {
     return(other.Type switch
     {
         EilangType.String => fac.String(Item + other.As <StringValue>().Item),
         EilangType.Integer => fac.Double(Item + other.Get <int>()),
         EilangType.Long => fac.Double(Item + other.Get <long>()),
         EilangType.Double => fac.Double(Item + other.Get <double>()),
         EilangType.Byte => fac.Double(Item + other.Get <byte>()),
         _ => throw ThrowHelper.TypeMismatch(Type, "+", other.Type)
     });