Ticket #217 (closed defect: wontfix)
Something with not having a type on a get not being caught by the compiler.
Reported by: | nevdelap | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | Cobra Compiler | Version: | 0.8.0 |
Keywords: | Cc: |
Description
These are fine...
class Program def main print "a" + .thing def thing as char return c'b'
class Program def main print "a" + .thing get thing as char return c'b'
test.cobra(4): error: For "print" arg 1: Cannot mix types String and char for arithmetic.
This is fine...
class Program def main print "a" + .thing def thing return c'b'
test.cobra(4): error: For "print" arg 1: Cannot mix types String and void for arithmetic.
test.cobra(7): error: Cannot return char because "thing" is not declared to return anything.
But this compiles and throws at run...
class Program def main print "a" + .thing get thing return c'b'
Unhandled Exception: Cobra.Lang.UnknownMemberException?: obj='a', name='op_Addition or op_Addition_String_Char', type=System.String
Change History
Note: See
TracTickets for help on using
tickets.