It specifically fixes two problems that were causing the complier to not respect constness via member access:
FunctionDefinition was creating a function context using the type of the containing class as the type of the receiver. But, this fails to take into account any constness present on the signature of that function. So the contextual receiver object never carried a const. Now the type of the receiver for the function context is taken from the receiver type for the declared function type, which is correct.
DotExpression, ArrowExpression, and IdentifierExpression - the three expressions that can provide member access - failed to take into account whether const should be applied due to member access on a const receiver object (and the entities used to represent the members accessed have no mechanism for applying this const or not). Now, those objects do account for this.
We also clean up a bunch of random stuff, including an old unused MemberAccessEntity, some unused properties on various classes (e.g. staticReceiver, functionCallReceiver), and some random old commented code for dot operators.
Also fixes a miscellaneous bug that I noticed in the error messages for postfix operators.
This PR fixes #291.
It specifically fixes two problems that were causing the complier to not respect constness via member access:
FunctionDefinition
was creating a function context using the type of the containing class as the type of the receiver. But, this fails to take into account any constness present on the signature of that function. So the contextual receiver object never carried a const. Now the type of the receiver for the function context is taken from the receiver type for the declared function type, which is correct.DotExpression
,ArrowExpression
, andIdentifierExpression
- the three expressions that can provide member access - failed to take into account whether const should be applied due to member access on a const receiver object (and the entities used to represent the members accessed have no mechanism for applying this const or not). Now, those objects do account for this.We also clean up a bunch of random stuff, including an old unused
MemberAccessEntity
, some unused properties on various classes (e.g.staticReceiver
,functionCallReceiver
), and some random old commented code for dot operators.Also fixes a miscellaneous bug that I noticed in the error messages for postfix operators.