Dynamic type conversions
Posted: Tue Dec 18, 2012 2:26 am
Cobra Command Line svn:2874 (post 0.9.3) / 2012-12-16
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
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
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