Avoid connecting properties for now#445
Conversation
Signed-off-by: Tom <tom@temper.systems>
| put("std/temporal.type Date.year", Like.core("Date::getYear")) | ||
| put("std/temporal.type Date.get day()", Like.core("Date::getDay")) | ||
| put("std/temporal.type Date.get month()", Like.core("Date::getMonth")) | ||
| put("std/temporal.type Date.get year()", Like.core("Date::getYear")) |
There was a problem hiding this comment.
Clearer intent this way.
| int32_t getYear(const std::shared_ptr<D>& d) { | ||
| return d->year; | ||
| return d->_year; | ||
| } |
There was a problem hiding this comment.
The actual fields have uglier names now.
And be-cpp currently makes public fields. We shouldn't do that. But even if we keep this organization the same, we could friend this helper code here for access.
| internal fun connectedKeyForMember(member: MemberShape): String? = when (member) { | ||
| is MethodShape -> connectedKeyForMethod(member) | ||
| is PropertyShape -> member.connectedKey | ||
| is PropertyShape -> null // connect only through accessors methods for now |
There was a problem hiding this comment.
Frontend things should go along with this, but that's TODO in this PR. This tmpl restriction at least limits backends from connecting properties themselves until we work more details out in the future.
| "day" -> Value(today.dayOfMonth, TInt) | ||
| "_year" -> Value(today.year, TInt) | ||
| "_month" -> Value(today.monthNumber, TInt) | ||
| "_day" -> Value(today.dayOfMonth, TInt) |
There was a problem hiding this comment.
Interpreter also has to use the private names.
| @connected | ||
| public day: Int; | ||
| public get day(): Int { _day } | ||
| private _day: Int; |
There was a problem hiding this comment.
Now all getters with private still-imu fields. Key is that the connection is specifically on the getters now.
Signed-off-by: Tom <tom@temper.systems>
No description provided.