[dylan-lang/opendylan] acfb10: [dfmc-conversion] Fix destructuring bind.

GitHub <[email protected]> Mon, 15 Feb 2016 23:01:57 -0800
Newsgroups gmane.comp.lang.dylan.gwydion.cvs
Message-ID <56c2c965e1be6_63893fa5d1bd129c221167@hookshot-fe3-cp1-prd.iad.github.net.mail>
----==_mimepart_56c2c965e17ff_63893fa5d1bd129c2210e9
Content-Type: text/plain;
 charset=UTF-8
Content-Transfer-Encoding: 7bit

  Branch: refs/heads/master
  Home:   https://github.com/dylan-lang/opendylan
  Commit: acfb10b778d5a4475a2eb638d85dc6445c768444
      https://github.com/dylan-lang/opendylan/commit/acfb10b778d5a4475a2eb638d85dc6445c768444
  Author: Bruce Mitchener <[email protected]>
  Date:   2016-02-15 (Mon, 15 Feb 2016)

  Changed paths:
    M sources/dfmc/conversion/convert.dylan

  Log Message:
  -----------
  [dfmc-conversion] Fix destructuring bind.

When the <values> doesn't have enough elements in it, it is supposed
to be padded with references to the #f object. Instead, it was writing
with the wrong loop index, so the <values> object was incorrect:

      *t3(3) := [VALUES ^#t ^#f #f]

Note that the last element is #f and not ^#f.

This resulted in confusing type check errors at compile time as detailed
in issue #363 where this code:

    let (ign, ore, maybe-a :: false-or(<string>)) = #t;
    let a :: <string> = maybe-a | "a";

Would result in a warning:

    Type check can fail - singleton(#f :: <boolean>) inferred, <string> expected.

This was found while minimizing a test case from the peg-parser, but is
not the same bug as the peg-parser is experiencing.

Fixes #363.

* sources/dfmc/conversion/convert.dylan
  (pad-multiple-values): Write #f object references at the correct
   index into the vector. (Use the right loop index value, j, instead
   of i.)


  Commit: a952f07c900e08076a3a091ad7ac0558c37866ef
      https://github.com/dylan-lang/opendylan/commit/a952f07c900e08076a3a091ad7ac0558c37866ef
  Author: Peter S. Housel <[email protected]>
  Date:   2016-02-15 (Mon, 15 Feb 2016)

  Changed paths:
    M sources/dfmc/conversion/convert.dylan

  Log Message:
  -----------
  Merge pull request #1044 from waywardmonkeys/fix-destructuring-bind-from-short-values

[dfmc-conversion] Fix destructuring bind.


Compare: https://github.com/dylan-lang/opendylan/compare/c7e7d27e1bd0...a952f07c900e
----==_mimepart_56c2c965e17ff_63893fa5d1bd129c2210e9
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
chatter mailing list
[email protected]
https://lists.opendylan.org/mailman/listinfo/chatter
----==_mimepart_56c2c965e17ff_63893fa5d1bd129c2210e9--