Perform some code refactor

This commit is contained in:
2020-03-12 20:23:18 +01:00
parent 10a7dc8823
commit e7567a1078
8 changed files with 22 additions and 22 deletions

View File

@@ -10,10 +10,10 @@ abstract class Function(val name: String) {
private var definitions: List<FunctionDefinition> = mutableListOf()
private var _module: Module? = null
var module: Module
get() = _module ?: throw RuntimeException("Method has not set module yet")
get() = _module ?: throw RuntimeException("Function has not set module yet")
set(value) {
if (_module != null) {
throw RuntimeException("Module of method is already set to ${module.canonicalName}")
throw RuntimeException("Function of method is already set to ${module.canonicalName}")
}
_module = value
}