Forums

Overloaded method compile bug?

General discussion about Cobra. Releases and general news will also be posted here.
Feel free to ask questions or just say "Hello".

Overloaded method compile bug?

Postby DelphiGuy » Tue Aug 14, 2012 9:48 pm

Compiling the following code, in a file named ESutils.cobra , on a Win 7 notebook resulted in the lengthy error msg posted below. Yes, I realize the code is goofy and makes no common sense, and that the method arguments are never used, but that's because I had to hack repeatedly at the original code in order to get it small enough to intelligently post here, while still replicating the error.

Code: Select all
namespace ESutils_

   class Program

      def main
         print 'hello'

   
   class MyRandom inherits Random
   
      cue init
         base.init
         
      enum Coin
         heads, tails
         
      def next(lowValue as int, highValue as int) as int    #fix next from random class,
         assert lowValue <= highValue
         assert highValue + 1 <= int.maxValue
         return base.next(lowValue, highValue + 1)
         
      def next(lowPitchName as Coin, highPitchName as Coin) as int     #fix next from random class,
         lowValue = 1   #lowPitchName to int
         highValue = 2 #highPitchName to int
         assert lowValue <= highValue
         assert highValue + 1 <= int.maxValue
         return base.next(lowValue, highValue + 1)


error msg:

C:\Users\Paul\Desktop\foldername>cobra esutils
error: COBRA INTERNAL ERROR / FallThroughException / info=MemberOverload-sh(9422, name=next, didBindInh=false, didStartBindInt=true, didBindInt=true,
didBindImp=false, token=Token.empty, name=next, isNames=['public'], numMembers=3, parentBox=Class-mi(1525, name=Random, didStartBindInh=true, didBindI
nh=true, didStartBindInt=true, didBindInt=true, didBindImp=false, token=Token.empty, didBindInh=true, isGeneric=false, isGenericDef=false, needsConstr
uction=false, 1525), 9422)
Compilation failed - 1 error, 0 warnings
Not running due to errors above.


Any comments? If the fault is mine and I'm missing something obvious in my code causing the error, I can't spot it.
DelphiGuy
 
Posts: 116

Re: Overloaded method compile bug?

Postby Charles » Tue Aug 14, 2012 11:30 pm

The fault can never be yours when Cobra spits out "INTERNAL ERROR" in screaming caps. I'll take a look.

Btw including your output for "cobra -version" is always helpful.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: Overloaded method compile bug?

Postby DelphiGuy » Wed Aug 15, 2012 1:20 am

C:\Users\Paul\Desktop\foldername>cobra esutils
error: COBRA INTERNAL ERROR / FallThroughException / info=MemberOverload-sh(9923, name=next, didBindInh=false, didStartBindInt=true, didBindInt=true,
didBindImp=false, token=Token.empty, name=next, isNames=['public'], numMembers=3, parentBox=Class-mi(1525, name=Random, didStartBindInh=true, didBindI
nh=true, didStartBindInt=true, didBindInt=true, didBindImp=false, token=Token.empty, didBindInh=true, isGeneric=false, isGenericDef=false, needsConstr
uction=false, 1525), 9923)
Compilation failed - 1 error, 0 warnings
Not running due to errors above.

C:\Users\Paul\Desktop\foldername>cobra -version
Cobra svn: (post 0.8) / 2012-08-15 on .NET CLR v4.0.30319 on Microsoft Windows NT 6.1.7601 Service Pack 1
DelphiGuy
 
Posts: 116

Re: Overloaded method compile bug?

Postby hopscc » Wed Aug 15, 2012 2:08 am

Hey chuck,

Since
(a)we/you always want the version when theres an Internal compiler error thrown and
(b)noone thinks to give it until
(c) you prompt for it

Why not modify the compiler to
insert the current version number into the output
when an internal error is either thrown or displayed ......

Might save some repetition ....
hopscc
 
Posts: 632
Location: New Plymouth, Taranaki, New Zealand

Re: Overloaded method compile bug?

Postby Charles » Wed Aug 15, 2012 8:09 am

That's a nice idea. Though many bug reports don't involve internal errors so I'd still like people to get "cobra -version" into their head.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: Overloaded method compile bug?

Postby Charles » Fri Aug 17, 2012 7:48 am

This is fixed now along with a test case so that we never see it again.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: Overloaded method compile bug?

Postby DelphiGuy » Fri Aug 17, 2012 3:03 pm

Thank you, Charles. I've now tested it and it seems flawless so far.
DelphiGuy
 
Posts: 116


Return to Discussion

Who is online

Users browsing this forum: No registered users and 45 guests