Fail getting line of Exception inside a class with instance var Topic is solved

Report problems with documented functionality
safetycar
Posts: 435
Joined: 12 Aug 2017, 04:27

Fail getting line of Exception inside a class with instance var

01 Feb 2019, 15:56

I found a little inconvenience while trying to throw an exception.

A code example is this:

Code: Select all


new Example()

return

class Example
{
	InstanceVar := ""
	__New() {
		Throw, Exception("Fail", -1)
	}
}
And what is happening is that I expected to see an error pointing to line 002 but I got this:

Code: Select all

Error:  Fail

	Line#
	002: new Example()  
	004: Return
--->	000: {
	008: this.InstanceVar := ""  
	000: }
	009: {
	010: Throw,Exception("Fail", -1)
	011: }
	013: Exit
	014: Exit

The current thread will exit.
The problem seems to be on the InstanceVar, with no variables or a static variables it works ok.

I'm working around by declaring the variable inside __New().

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 21 guests