Overture error: Name 'BinBuilder()' is not in scope

175 views Asked by At

I've been doing the exercises of a book focused on iteratively building a whole application. After having written four classes, I'm writing my fifth which is a test for the fourth one. However, Overture is reporting a "Name 'BinBuilder()' is not in scope" error; BinBuilder is the last class I successfully wrote. I cannot figure out what I'm doing differently this time. BinBuilder is not the only class causing problems, two other are too. Since I don't know what's wrong, I'm including a link to the whole thing here. Thank you.

EDIT: It links a zip file exported from Overture and it includes a screen capture showing the error.

1

There are 1 answers

2
Nick Battle On BEST ANSWER

You have the following:

builder: BinBuilder := BinBuilder();

But I think you mean:

builder: BinBuilder := new BinBuilder();

The "not in scope" error means "I can't find a function or operation call of that name in scope". It's not a great error message, I'm afraid. Overture and VDMJ use the same "not in scope" message for when a name does not exist anywhere and for when it does exist, but is not visible within the current scope. In this case, the syntax causes it to look for a func/op call rather than a class name.