opendylan icon indicating copy to clipboard operation
opendylan copied to clipboard

"define generic" should not allow types for keywords

Open cgay opened this issue 6 years ago • 0 comments

https://opendylan.org/books/drm/Parameter_Lists

Keyword parameter types are not allowed in generic function definitions,...

OD 2019.1 issues no warning for this:

define open generic encode-json
    (stream :: <stream>, object :: <object>, #key pretty? :: <boolean>);

I've been getting this wrong consistently for years. Should there be a warning for it? What happens when a method's keyword type isn't congruent with the generic's keyword type? (Answer: no warning.) What should happen?

I kind of like putting a type on keyword parameters, for documentation purposes if nothing else.

cgay avatar Oct 02 '19 04:10 cgay