- All Known Implementing Classes:
Compiler,CompilerBase
- Enclosing class:
Members
public static interface Members.Resolution
Resolution defines a strategy how applicable
members for explicitly given arguments are determined and how
the most specific member of these is chosen.- Author:
- Ole Kniemeyer
-
Method Summary
Modifier and TypeMethodDescriptionbooleanallowsAmbiguousMembers(Member first) Defines if ambiguous members are allowed.Type[]Returns the argument types which are used inisApplicable(Member, Members.Applicability, Scope)to determine the applicability.booleanisApplicable(Member m, Members.Applicability applOut, Scope scope) Checks whether a membermis applicable.booleanisLessThan(Member m1, Members.Applicability a1, Member m2, Members.Applicability a2, Scope scope) Checks whether an applicable memberm1is less specific than another applicable memberm2.
-
Method Details
-
allowsAmbiguousMembers
Defines if ambiguous members are allowed. If so, ambiguities between members do not cause an exception be thrown in; the first member is returned.invalid reference
Members#find(Resolution)- Parameters:
first- the first member of a set of ambiguous members- Returns:
trueiff ambiguous members are allowed andfirstshall be returned as the result of resolution
-
isApplicable
Checks whether a membermis applicable. The quality of applicability is stored inapplOutby this method.- Parameters:
m- a memberapplOut- the quality of applicability is stored here by this methodscope- scope in which the member is accessed- Returns:
trueiffmis applicable
-
getArgumentTypes
Type[] getArgumentTypes()Returns the argument types which are used inisApplicable(Member, Members.Applicability, Scope)to determine the applicability. This method is only invoked to generate an error message in case no applicable member was found.- Returns:
- argument types
-
isLessThan
boolean isLessThan(Member m1, Members.Applicability a1, Member m2, Members.Applicability a2, Scope scope) Checks whether an applicable memberm1is less specific than another applicable memberm2. The applicablities are the same instances which have been passed before toisApplicable(Member, Members.Applicability, Scope).- Parameters:
m1- a membera1-m1's applicability as determined byisApplicable(Member, Members.Applicability, Scope)m2- another membera2-m2's applicability as determined byisApplicable(Member, Members.Applicability, Scope)scope- scope in which the member is accessed- Returns:
trueiffm1is less specific thanm2
-