Understanding the Typesystem Follow
Hi everyone,
I am currently looking into the Typesystem of MPS and was wondering how the following situation is being resolved:
I was going through the Typesystem Trace and was also looking into the respective implementation aspects of BaseLanguage. I would like to understand why the Typesystem allows either a Integer literal or an instance of the Integer concept but rejects a Boolean. Where can I find the rule saying that a int and a Integer can be used interchangeably in this context? Where is the distinction between Integer and Boolean made. I couldn't pinpoint the exact rules yet.
Cheers
Simon
I am currently looking into the Typesystem of MPS and was wondering how the following situation is being resolved:
int i; i = 1; // ok i = new Integer(2); //ok i = new Boolean(true); // error
I was going through the Typesystem Trace and was also looking into the respective implementation aspects of BaseLanguage. I would like to understand why the Typesystem allows either a Integer literal or an instance of the Integer concept but rejects a Boolean. Where can I find the rule saying that a int and a Integer can be used interchangeably in this context? Where is the distinction between Integer and Boolean made. I couldn't pinpoint the exact rules yet.
Cheers
Simon
Please sign in to leave a comment.
Vaclav