dylan-lang / opendylan

Open Dylan compiler and IDE
http://opendylan.org/
Other
457 stars 69 forks source link

Method not congruent warning needs GF location #1119

Open cgay opened 6 years ago

cgay commented 6 years ago

This warning really should say where the generic function is defined, ideally by outputting another warning with <filename>:<line-number>: generic function dependencies defined here

package-manager/types.dylan:45: Serious warning - Method { define method dependencies (object :: {<version> in package-manager}, #next next-method) => (value :: <dependency-list>) ... end } not congruent with generic function - one parameter list includes #key, but the other does not
        -------------------------------------------------------------------------------------
        constant slot dependencies :: <dependency-list>, required-init-keyword: dependencies:;
        -------------------------------------------------------------------------------------
cgay commented 2 years ago

Having another warning (or note, like clang does) as mentioned above would help a lot, but I think the initial warning should be a lot more explicit about what types don't match. This:

json/tests/printer-tests.dylan:143.1-145.11: Serious warning - Method
 { define method table-protocol (class :: singleton(<print-json-test-table>), #next next-method) => () ... end }
 not congruent with generic function - some of the method's required parameter specializers
 aren't subtypes of their counterparts in the generic

should be more like this:

json/tests/printer-tests.dylan:143.1-145.11: Serious warning - Method
 { define method table-protocol (class :: singleton(<print-json-test-table>), #next next-method) => () ... end }
 not congruent with generic function

singleton(<print-json-test-table>) is not a subtype of <table>.