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

SCM Repository

[diderot] View of /branches/vis12/bugs/open/bug048.diderot
ViewVC logotype

View of /branches/vis12/bugs/open/bug048.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3338 - (download) (annotate)
Wed Oct 21 20:05:35 2015 UTC (4 years, 8 months ago) by glk
File size: 775 byte(s)
problem with int vs real in conditional expression
/*
Type promotion from int to real doesn't work if
one only side of a conditional expression.
compiling with: ../../bin/diderotc --exec  bug048.diderot
produces:
[bug048.diderot:13.12-35] Error: types do not match in conditional expression
  true branch:  int
  false branch: real
[bug048.diderot:12.1-29.0] Error: program does not have any strands
*/
input int foo = 1;
real bar = 0   if foo > 0 else 1.0; // BUG: doesn't work
//real bar = 0.0 if foo > 0 else 1; // BUG: also doesn't work

//real bar = 0   if foo > 0 else 1;   // does work ok (two ints)
//real bar = 0.0 if foo > 0 else 1.0; // does work ok (two reals)

strand sfoo (int ii) {
  output real noop = 0.0;

  update {
    print("bar = ", bar, "\n");
    stabilize;
  }
}

initially [ sfoo(ii) | ii in 0..0 ];

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