Copyright (C) 2003-2012 by Cobra Language LLC.
OS Version: Microsoft Windows NT 6.1.7601 Service Pack 1
CLR Platform: .NET
CLR Version: 4.0.30319.17929
- Code: Select all
1 class Program
2 shared
3
4 def add(x, y) as dynamic
5 return x + y
6
7 def main
8 print '*****Fun with type conversions *****'
9 numb1 as int16 = 9
10 numb2 as int16 = 10
11 print '[numb1] + [numb2] = [.add(numb1, numb2)]'
When I run the above, I experience...
Unhandled exception: Cobra.Core.UnknownMemberException: obj=9 (Int16), nam
e='op_Addition or op_Addition_Int16_Int16', type=System.Int16
in Cobra.Core.CobraImp.DynamicOp(String opMethodName, Object value1, Object va
lue2, Boolean promote)
in Cobra.Core.CobraImp.DynamicOp(String opMethodName, Object value1, Object va
lue2)
in Program.Main() в c:\workspace_Cobra\TypeConversions\Program.c
obra:line 11