• Tobias Tebbi's avatar
    [torque] resolve operator overloads correctly · 0c62c81d
    Tobias Tebbi authored
    This implements a reasonable overload resolution strategy for operators:
    
    An overload is selected if it is strictly better than all alternatives.
    This means that it has to be strictly better in at least one parameter,
    and better or equally good in all others.
    
    When comparing a pair of corresponding parameters of two overloads...
    ... they are considered equally good if:
        - They are equal.
        - Both require some implicit conversion.
    ... one is considered better if:
        - It is a strict subtype of the other.
        - It doesn't require an implicit conversion, while the other does.
    
    If no overload is strictly better than all alternatives, this results
    in a compile error.
    
    Bug: v8:7793
    Change-Id: I8c7aadce5799ef0f854887b039e94c9c0363816d
    Reviewed-on: https://chromium-review.googlesource.com/1076292
    Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
    Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#53492}
    0c62c81d
Name
Last commit
Last update
..
Torque.g4 Loading commit data...
TorqueBaseListener.cpp Loading commit data...
TorqueBaseListener.h Loading commit data...
TorqueBaseVisitor.cpp Loading commit data...
TorqueBaseVisitor.h Loading commit data...
TorqueLexer.cpp Loading commit data...
TorqueLexer.h Loading commit data...
TorqueListener.cpp Loading commit data...
TorqueListener.h Loading commit data...
TorqueParser.cpp Loading commit data...
TorqueParser.h Loading commit data...
TorqueVisitor.cpp Loading commit data...
TorqueVisitor.h Loading commit data...
ast-generator.cc Loading commit data...
ast-generator.h Loading commit data...
ast.h Loading commit data...
contextual.h Loading commit data...
declarable.cc Loading commit data...
declarable.h Loading commit data...
declaration-visitor.cc Loading commit data...
declaration-visitor.h Loading commit data...
declarations.cc Loading commit data...
declarations.h Loading commit data...
file-visitor.cc Loading commit data...
file-visitor.h Loading commit data...
global-context.h Loading commit data...
implementation-visitor.cc Loading commit data...
implementation-visitor.h Loading commit data...
scope.cc Loading commit data...
scope.h Loading commit data...
torque.cc Loading commit data...
type-oracle.h Loading commit data...
types.cc Loading commit data...
types.h Loading commit data...
utils.cc Loading commit data...
utils.h Loading commit data...