957b2173d98d0c39500a627ed064b6af95084758
This patch allows WritableScope "locking". WritableScope now has three lock levels: reading, writing, both. Scope modification is not allowed in "reading" state, scope data access is not allowed in "writing". Scope lock level can only be raised: from "writing" to "both" and from "both" to "reading". There are two reasons for this enhancement: 1. Code self-documentation. It is clear where WritableScope is used as readonly scope. For example developers can see that class structure is not modified after DelegationResolver.process(), because MutableClassDescriptor.lockScopes() is called right after that method. 2. Ease of debugging, program gets more assertions. For example, if some scope is not yet filled and some member resolution is triggered, IllegalStateException is thrown instead of wrong unresolved reference. Currently not all scope locks are configured strictly. In many cases lock level is set to safe "both" value.
Description
The Kotlin Programming Language.
Languages
Kotlin
79.9%
Java
10.4%
Swift
4.3%
C
2.8%
C++
2.1%
Other
0.3%