Hi, I'm an MPS newbie using v3
I am trying to create something similar to the money sample by myself. I have the basics all working. Now I want to define an exchange rate conversion operator. I made a new concept that extends Expression which takes an expression along with a currency (enum type). The editors all work as I expect.
However, without a type system, I can write erroneous code like
String a = 10 EUR in USD;
Money m = "bob" in EUR;
Trying to fix the latter issue first, I made a type system rule. I thought I wanted something like this:
typeof(exchangeRateConversionOperator.expr) :==: <MoneyLiteral>;
however inside the quotation I can't see any of my concepts, or indeed anything from my model. Only stuff from baseLanguage shows up.
I'm obviously making some conceptual mistake here. Why can't I tell MPS that the left hand part of the operator must be some kind of money (or any expression that is of type MoneyLiteral)?