Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] View of /tests/vis15-bugs/stringeq.diderot
ViewVC logotype

View of /tests/vis15-bugs/stringeq.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4923 - (download) (annotate)
Wed Feb 15 22:44:22 2017 UTC (2 years, 8 months ago) by glk
File size: 1413 byte(s)
string comparison doesn't compile in vis15
input string name ("name to test") = "bar";

strand instring (real val) {
   output real dummy = val;
   string name2 = "bar";

   /*
      BUG: testing string equality crashes vis15 compiler with:
      trAssign: _t0270 = EQ<string>(name026C,name2026E)
      uncaught exception Fail [Fail: cvtScalarTy(string)]
        raised at common/phase-timer.sml:78.57-78.59
        raised at low-to-tree/low-to-tree.sml:766.7-766.9
        raised at low-to-tree/low-to-tree.sml:160.32-160.81

      testing string inequality crashes compiler with:
      trAssign: _t024F = NEQ<string>(name024B,name2024D)
      uncaught exception Fail [Fail: cvtScalarTy(string)]
        raised at common/phase-timer.sml:78.57-78.59
        raised at low-to-tree/low-to-tree.sml:766.7-766.9
        raised at low-to-tree/low-to-tree.sml:160.32-160.81

      Both tests compile fine with vis12 branch, but then the tests do not work
      correctly (string equality is always false, even with equal strings, and
      string inequality is always true, even with equal strings).
   */

   update {

      if (name == name2) {
         print(name, " == ", name2, "\n");
      } else {
         print(name, " != ", name2, "\n");
      }

      if (name != name2) {
         print(name, " != ", name2, "\n");
      } else {
         print(name, " == ", name2, "\n");
      }

      stabilize;
   }
}

initially [ instring(ii) | ii in 1 .. 1 ];

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0