Forums

Internal Error

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

Internal Error

Postby _Gold_Fish » Sun Jul 11, 2010 8:49 am

Just run into this:
Code: Select all
error: COBRA INTERNAL ERROR / AssertException / ; sourceSite = C:\Program Files\
Cobra-2010-04-02\Source\Types.cobra:784 in CobraType.memberForName for object Vo
idType-sh(5385, didBindInh=false, didBindInt=false, didBindImp=false); info
  = nil; this       = VoidType-sh(5385, didBindInh=false, didBindInt=false, didB
indImp=false);     (.didBindInh and .didBindInt) = false;         .didBindInh =
false;         .didBindInt = (short-circuited);
Compilation failed - 1 error, 0 warnings
Not running due to errors above.


Does anyone know how I can fix this?
_Gold_Fish
 
Posts: 18

Re: Internal Error

Postby Charles » Sun Jul 11, 2010 6:22 pm

Not without you sharing the code that stimulated it... which I would love for you to do so I can fix this bug.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: Internal Error

Postby _Gold_Fish » Mon Jul 12, 2010 6:34 am

Sure stuff.

I'll put the code up here as soon as I get to the computer.
_Gold_Fish
 
Posts: 18

Re: Internal Error

Postby _Gold_Fish » Mon Jul 12, 2010 11:34 am

class Sequence
var _start as int
var _count as int
cue init(startingNumber)
base.init
_start = startingNumber
_count = 1
def solve
currentNumber = _start
while currentNumber > 1
if currentNumber % 2 == 0
currentNumber /= 2
else
currentNumber *= 3
currentNumber += 1
_count += 1
get count from var

class Program
def main
print Sequence(13).solve.count


There's the code.
_Gold_Fish
 
Posts: 18

Re: Internal Error

Postby Charles » Mon Jul 12, 2010 12:08 pm

Looks like this problem is already fixed. When I use the latest Cobra from subversion, I get:

gold-fish.cobra(21): error: Cannot find a definition for "count" in "Sequence(13).solve" whose type is "void".

See HowToInstallFromSource to get it. It's actually the same installation program you used for the 2010-04-02 release, but you run Subversion first to get the latest code.

I hope to cut a release soon.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: Internal Error

Postby _Gold_Fish » Mon Jul 12, 2010 9:57 pm

Ok, I'll take a look. Thanks!
_Gold_Fish
 
Posts: 18

Re: Internal Error

Postby hopscc » Tue Jul 13, 2010 3:27 am

You can get what you want to do to work if you change this line
Code: Select all
def solve


to
Code: Select all
def solve as Sequence

and add
Code: Select all
return this

to the end of that method.
hopscc
 
Posts: 632
Location: New Plymouth, Taranaki, New Zealand

Re: Internal Error

Postby _Gold_Fish » Tue Jul 13, 2010 12:03 pm

Alright, thanks hopscc. That's probably better for me, as I don't have Internet access for the computer at the moment.
_Gold_Fish
 
Posts: 18


Return to Discussion

Who is online

Users browsing this forum: No registered users and 84 guests