I've figured out where the error is coming from, but I still have no idea what's going on. racket/private/generic-methods.rkt starting on line 174: (define-syntax (generic-methods stx) (syntax-case stx () [(_ gen def ...) (let () (define info (get-info 'generic-methods stx #'gen)) (define orig-id (generic-info-name info)) (define methods (map (make-method-delta #'gen orig-id) (generic-info-method-names info))) (with-syntax ([(method ...) methods]) (syntax/loc stx (syntax-parameterize ([generic-method-outer-context #'gen]) (letrec-syntaxes+values ([(method) (make-unimplemented 'method)] ...) () (syntax-parameterize ([generic-method-inner-context #'gen]) def ... (values (implementation method) ...)))))))]))
I didn't change this code at all, but something about how I'm setting up the generic interface is causing this to give the ambiguous binding error. I'm getting the error for get method, which came from a super interface (gen:getter), but the has? method, which comes directly from the sub interface (gen:pattern), works fine. #lang racket/base (require racket/generic rackunit racket/private/generic-methods syntax/macro-testing (for-syntax racket/base syntax/parse)) (define-generics getter (get getter target)) (define-generics pattern (has? pattern target) #:extends gen:getter) (generic-methods gen:pattern (define (has? this target) (pair? target))) ; this works fine (convert-compile-time-error (generic-methods gen:pattern (define (get this target) (car target)))) ; this gives an ambiguous binding error https://travis-ci.org/AlexKnauth/racket/jobs/82000849#L1868 https://github.com/AlexKnauth/racket/blob/54780f05931ac155589ff0f307e79b76a774a61b/pkgs/racket-test/tests/generic/extend.rkt Any help? > On Sep 23, 2015, at 9:04 PM, Alexander D. Knauth <alexan...@knauth.org> wrote: > > I'm trying to add inheritance to generic interfaces: > https://github.com/AlexKnauth/racket/tree/gen-extends > <https://github.com/AlexKnauth/racket/tree/gen-extends> > > But it's in a weird state where it's passing some of the time, (seemingly > depending on how exactly I fiddle with it, compile it, restart DrRacket, > and/or other things), but the other times it's giving me ambiguous binding > errors like this: > > https://travis-ci.org/AlexKnauth/racket/jobs/81884173#L1461 > <https://travis-ci.org/AlexKnauth/racket/jobs/81884173#L1461> > > pkgs/racket-test/tests/generic/extend.rkt:6:3: get: identifier's binding is > ambiguous > context...: > #(894142 module) #(894143 module extend 0) #(895177 macro) #(895618 local) > #(895650 intdef) #(895651 local) #(895652 intdef) #(895655 local) > #(895656 intdef) #(895661 local) #(895663 intdef) #(895664 local) > #(895665 intdef) #(895666 local) #(895667 intdef) #(895671 local) > #(895673 intdef) #(895674 local) #(895675 intdef) > matching binding...: > local get128618 > #(894142 module) #(894143 module extend 0) #(895618 local) #(895650 intdef) > #(895651 local) #(895652 intdef) #(895655 local) #(895656 intdef) #(895661 > local) > #(895663 intdef) #(895664 local) #(895665 intdef) #(895666 local) > #(895667 intdef) #(895671 local) #(895673 intdef) #(895674 local) > #(895675 intdef) > matching binding...: > local get128614 > #(894142 module) #(894143 module extend 0) #(895177 macro) #(895618 local) > #(895650 intdef) #(895651 local) #(895652 intdef) #(895655 local) > #(895656 intdef) #(895661 local) #(895663 intdef) #(895664 local) > #(895665 intdef) #(895666 local) > matching binding...: > #f > #(894142 module) #(894143 module extend 0) > in: get > compilation context...: > > /Users/travis/build/AlexKnauth/racket/pkgs/racket-test/tests/generic/extend.rkt > context...: > > /Users/travis/build/AlexKnauth/racket/racket/collects/racket/private/generic-methods.rkt:161:2 > > I'm also getting errors from data/order.rkt, but that's a separate problem, > and an easy one to fix. (I already did on my computer, but Travis is getting > data/order from the package, not from my computer.) > > Do you have any idea what's going on, or how to do this right? > > Thanks! > Alex Knauth > > > -- > You received this message because you are subscribed to the Google Groups > "Racket Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to racket-users+unsubscr...@googlegroups.com > <mailto:racket-users+unsubscr...@googlegroups.com>. > For more options, visit https://groups.google.com/d/optout > <https://groups.google.com/d/optout>. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.