Changeset 13738 for src/Pugs/Eval

Show
Ignore:
Timestamp:
09/30/06 03:34:30 (2 years ago)
Author:
audreyt
Message:

* Fix the dispatch bug reported by TimToady?++, where a

superclass method of an object will fail to dispatch if a
same-named method in the enclosing scope existed.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Eval/Var.hs

    r13684 r13738  
    279279        attrs <- fmap (fmap (filter (/= pkg) . nub)) $ findAttrs pkg 
    280280        if isNothing attrs || null (fromJust attrs) then fmap (err NoMatchingMulti) (findSub' var) else do 
    281         (`fix` (fromJust attrs)) $ \run pkgs -> do 
     281        -- XXX - "reverse" below is a crude hack before we have C3 dispatch; 
     282        --     - this is such that "class X is Object is Moose" can dispatch with Moose first. 
     283        (`fix` (reverse $ fromJust attrs)) $ \run pkgs -> do 
    282284            if null pkgs then return (Left $ NoSuchMethod (cast pkg)) else do 
    283285            subs <- findWithPkg (head pkgs) var