tupl-tufts / rdl

Types, type checking, and contracts for Ruby
BSD 3-Clause "New" or "Revised" License
602 stars 38 forks source link

Problem with mixin types #17

Closed j2ren closed 5 years ago

j2ren commented 7 years ago

In this example, it is legal for M#bar (through C) to call foo even though M does not have an ancestor that has foo as a method.

module M2 type :foo ... def foo end end

module M type :bar ... def bar foo end end

class C include M2 include M end

C.new.bar

The current static type checker would set "self" to M when type checking M#bar, which causes a no type error from foo.

baban commented 7 years ago

It is resolved dev branch now!