Hacker News new | ask | show | jobs
by yole 3118 days ago
It's not really "to make the IDE's job easier", it's to make it explicit that the given class needs to match a certain contract, and to make the validation errors more clear.
1 comments

So expected is import and actual is export in unit module parlance?
It's a bit different from a regular export/import relationship. An exported declaration is usually made visible to an unlimited number of clients, and an actual declaration matches a single specific expect declaration.
That’s why I said units, as in program units (Flatt, Findler, etc...). I added a module system to java that did the same thing using light bytecode rewriting in the linking step (kotlin seems to do structural matching, but doesn’t have a reconfigurable linker I guess); https://dl.acm.org/citation.cfm?id=504311.504298.