XS9016 Class name .. differs : just by adding optional class statement

This forum is meant for questions and discussions about the X# language and tools
Post Reply
ic2
Posts: 1858
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

XS9016 Class name .. differs : just by adding optional class statement

Post by ic2 »

Consider this:

Code: Select all

Public Partial Class NewEmail
Method AcceptSaveAndSendEmail() As Logic Pascal Class NewEmail
Return Self:AcceptAndSaveAndOrSendEmail(True, False, True, Null_date) 

Method AcceptAndSaveAndOrSendEmail(lSend As Logic, lAuto As Logic, lCheckAddress As Logic, dSendDate As Date) As Logic Pascal Class NewMail
ENDCLASS //Newmail
As you can see I add Class (something) like in VO as this makes it directly visible in which class you are working which in VS requires you to look to the upper left of the screen while it doesn't show when you are browsing.

So the CLASS xx is optional, like a comment.

Why then do I get this error in the 2nd method then? The first method is fine, with the 2nd method just below (so in the same class) the 1st, only this error shows (until I remove class NewMail again which I don't want)

Error XS9016 Class name NewMail for method differs from parent class name NewEmail

Dick
User avatar
Chris
Posts: 4907
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

XS9016 Class name .. differs : just by adding optional class statement

Post by Chris »

Hi Dick,

The class name (and class clause in the first method) is "NewEmail", while the class clause in the second method is "NewMail"
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
ic2
Posts: 1858
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

XS9016 Class name .. differs : just by adding optional class statement

Post by ic2 »

Hello Chris,

Yes! How could I miss that.
It makes me wonder one thing. I thought adding Class XX after a method was merely info. Like I could write anything, a comment.

But the compiler is actually doing something with it I now understand?

Dick
User avatar
Chris
Posts: 4907
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

XS9016 Class name .. differs : just by adding optional class statement

Post by Chris »

Hi Dick,

Yes, of course, the X# compiler does make a lot of checks to see if what you type is valid. It's not like in VO, where you can accidentally write a lot of incorrect things or typos and the compiler does not even warn you ;)
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
Post Reply