Package org.ek9lang.compiler.phase3
Class NoDelegateMethodClashesOrError
java.lang.Object
org.ek9lang.compiler.common.RuleSupport
org.ek9lang.compiler.common.TypedSymbolAccess
org.ek9lang.compiler.phase3.NoDelegateMethodClashesOrError
As it is possible to have a variable that is a delegate 'function',
it means that to call that function, the ek9 developer would use variable-name(parameters).
This is identical in calling a method, if the ek9 developer had methods of the same name as the
variable - this would be very confusing. Does a method take precedence?, what would haven if some
methods became protected or public. So to avoid all that - we just issue an error and force the ek9 developer
to use either a different delegate name or different method names.
This could lead to a case where two separate components like a trait and a class could not be used together.
The answer would be to employ delegation rather than use inheritance.
-
Field Summary
Fields inherited from class org.ek9lang.compiler.common.RuleSupport
errorListener, symbolsAndScopes
-
Constructor Summary
ConstructorDescriptionNoDelegateMethodClashesOrError
(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener) Create a new delegate checker. -
Method Summary
Methods inherited from class org.ek9lang.compiler.common.TypedSymbolAccess
getRecordedAndTypedSymbol, isProcessingScopePure, recordATypedSymbol
-
Constructor Details
-
NoDelegateMethodClashesOrError
NoDelegateMethodClashesOrError(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener) Create a new delegate checker.
-
-
Method Details