Closed bkayes closed 2 years ago
AFAIK, lobster hasn't supported const member functions yet.
And, it also does not support private
and public
. Because class
is private
by default. But you can call whatever member functions you like in main
.
private
and public
are indeed not supported yet. const
can exist on the types of member functions, via the type of the receiver.
But, it's not getting properly respected when a member is accessed. The issue appears that when I ported the codebase to TS a few years ago I must have mixed things up and member access is resulting in a MemberObjectEntity
from lookup rather than a MemberAccessEntity
(which can carry along the const). Working on a fix for this one now.
Hm, actually MemberAccessEntity
isn't the solution, instead IdentifierExpression
, DotExpression
, and ArrorExpression
should just take care of member access taking on constness from the receiver object.
The above compiles and runs on lobster, which is confusing to students
Notice pre/post increment and multiplication (These are the only things I tried, I bet others would not cause it fail compilation either).