Wiki

Ticket #236 (assigned defect)

Opened 7 years ago

Last modified 7 years ago

Specifying -test and -compile-if-needed gets ArgumentOutOfRangeException.

Reported by: nevdelap Owned by: Chuck
Priority: minor Milestone:
Component: Cobra Compiler Version: 0.8.0
Keywords: Cc:

Description

class P

	def main is shared
		test
			assert false
		body
			print 'hello'
nev@bananinha:~/Temp/cobra$ cobra -test -compile-if-needed test.cobra
An unhandled exception has occurred.

Cobra debugging tips:
    To get file name and line number information for the stack frames, use:
        cobra -debug foo.cobra
    If running the executable through "mono" then also use --debug (double dash):
        mono --debug foo.exe ...
    To get a post-mortem, HTML-formatted report with more details about your objects:
        cobra -debug -exception-report foo.cobra
    For even more information, try:
        cobra -debug -exception-report -detailed-stack-trace foo.cobra
    Or use the abbreviations:
        cobra -d -er -dst foo.cobra


Unhandled Exception: System.ArgumentOutOfRangeException: Argument is out of range.
Parameter name: index
  at System.Collections.Generic.List`1[Module].get_Item (Int32 index) [0x00000] 
  at Cobra.Lang_ert_b6e375e3164366f1086afa629ec24c88.Extend_IList__T__ExtendList.Last[Module] (IList`1 _lh_this) [0x00000] 
  at Compiler.ComputeOutNameSharp () [0x00000] 
  at ClrBackEnd.ComputeOutName () [0x00000] 
  at Compiler.CompileFilesNamed (IList`1 paths, Boolean writeTestInvocation, System.Predicate`1 stopCompilation) [0x00000] 
  at CommandLine.DoCompile (System.Collections.Generic.List`1 paths, Boolean willPrintSuccessMsg, Boolean writeTestInvocation, System.Predicate`1 stopCompilation) [0x00000] 
  at CommandLine.DoTest (System.Collections.Generic.List`1 paths) [0x00000] 
  at CommandLine.Run (System.Collections.Generic.List`1 args) [0x00000] 
  at CommandLine.Run () [0x00000] 
  at CobraMain.Main () [0x00000] 

Attachments

cin-test.patch Download (2.5 KB) - added by hopscc 7 years ago.

Change History

Changed 7 years ago by nevdelap

  • priority changed from major to minor

Changed 7 years ago by hopscc

Changed 7 years ago by hopscc

  • status changed from new to assigned
  • owner set to Chuck

patch and new tests and relnote.

Changed 7 years ago by Chuck

  • owner changed from Chuck to hopscc

It looks like the patch limits -cin to only work with -compile and -run, but is there any reason why it should not or cannot also work with -test?

Changed 7 years ago by hopscc

  • owner changed from hopscc to Chuck

Well it seemed to me that a test run (compile and run) suggests a new clean compile anyway (if not a better soln would be to keep the tests exe around for rerunning tests
without recompilation)

If I remember correctly it previously failed with this because a test run didnt have something setup (Module List??) that both -compile and -run did that the -cin check needed/used (different prerequisites).
I couldnt/didnt work out the reason why they were different and just suppressed it...
Given the other constraints on -cin that seemed reasonable and with the time its taken for this bug to surface it didnt seem use of both -test and -cin is at all common or even necessary...

Changed 7 years ago by Chuck

Okay, but I may enhance it to print a warning that -cin is ignored when using -test so at least people know.

Changed 7 years ago by hopscc

good idea.

Note: See TracTickets for help on using tickets.