Boo
  1. Boo
  2. BOO-292

treat any subclass of IQuackFu as a duck when Ducky is set

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.7
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Description

      When the -ducky option is set, treat any subclass of IQuackFu as a duck type implicitly.

      Perhaps by adding a castexpression ("as duck") to typeinvocations or using some other strategy in the ProcessMethodBodiesWithDuckTyping step.

      Not a priority for me now (maybe for others), but once we have this and slicing duck types (BOO-192), boo can handle the full range from completely static to completely dynamic programming.

      A start: In ProcessMethodBodiesWithDuckTyping step, add field:
      protected IType quackfu;
      In constructor:
      quackfu = TypeSystemServices.Map(typeof(Boo.Lang.IQuackFu));
      add method:
      bool IsIQuackFu(IType type)
      {
      return quackfu.IsAssignableFrom(type);
      }

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Rodrigo B. de Oliveira
            Reporter:
            Doug H
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: