qdtk / openshadinglanguage

Automatically exported from code.google.com/p/openshadinglanguage
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

output color arguments can be associated with a float variable. #51

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
a function with an output color argument can be applied to a float
variable,  resulting in an implicit assignment from color to float.  oslc
should flag this as an error.

e.g.
func(int i, output color c) {
    c = color(0.4);
}

int i;
float f;
func(i, f);

Original issue reported on code.google.com by dan.roli...@gmail.com on 2 Feb 2010 at 7:34

GoogleCodeExporter commented 9 years ago
Oh, I see.  Yes, my bad, that should be an error.  What's happening is that if 
it
weren't an output parameter, it would be legal, since the float passed would be
converted to a color in the obvious way.  But for an OUTPUT, that doesn't make 
any
sense.  Fix shouldn't be too hard.

Original comment by larrygr...@gmail.com on 2 Feb 2010 at 7:45

GoogleCodeExporter commented 9 years ago
Review: http://codereview.appspot.com/204076/show

Original comment by larrygr...@gmail.com on 8 Feb 2010 at 7:58

GoogleCodeExporter commented 9 years ago
Fixed in r573

Original comment by larrygr...@gmail.com on 8 Feb 2010 at 10:22