i expect line 35 to fail at compile time but it do...
# announcements
n
i expect line 35 to fail at compile time but it doesn’t... 😞
h
You mean line 33?
35 is the last }
n
i mean line 35 because the
company
lambda shouldn’t be called twice
k
Ah no, the compiler doesn't do any verification like that.
There's a line in the KEEP about that, let me go hunt it down.
n
oh, did i misunderstand that?
d
Sorry, I'm not sure I'm following your example. Why exactly line 35 should fail at compile time?
h
I think it works the other way around: You assure the compiler that you will only call it once. The compiler then accepts it e.g. when setting a val.
☝️ 2
n
@karelpeeters @hho thanks for the clarification i totally misunderstood then
z
It will supposedly be checked and enforced at some point in the future, but for now, it's our responsibility to keep our word about contracts
k
I doubt the "enforced" part, there's this halting problem...
z
Well, yes, for obvious cases at least 🙂
d
Well, it depends on what you're trying to enforce... 🙂
n
in my case, i’d like to prevent calling the
company
twice
d
Yeah, I got your example @nfrankel -- missed the
AT_MOST_ONCE
part. While it is true that it works the other way currently, we're considering use cases like that and actually they have quite high priority on the list of possible contracts use cases. So, stay tuned, maybe we will have something for you in the future 😉
👍 2
k
You can take a
Company
as a constructor parameter to encourage that, I don't think there's a way to enforce it for now 😉
n
@dsavvinov that would be great
@karelpeeters that wouldn’t work with a real-world example i’d like to have a full-fledged model in the dsl