I agree with the intention of all these bugs and suspect that there are other similar bugs filed (not that I'm objecting to filing additional ones rather than looking for the existing ones). Another common case is initializing a range of idxType int(8) with a range like 1..10 (which is a range(int)).
The compiler currently only has param downcasting rules (the thing that permits a param value like '100' to be implicitly downcast to a smaller-sized int as long as it can legally store the value) for base types because it currently only supports param base types. To support the desired behavior here, we'd need to extend these rules to other types. In my opinion, the stepping stone to doing this would be to have the compiler support param values of the types in question: ranges, domains, arrays, tuples. The two main approaches that could be taken to do so would be: * teach the compiler about ranges, domains, arrays, tuples * teach the compiler about param records and classes and then extend the standard module code that defines ranges, domains, and arrays to support operations on param ranges, domains, and arrays. The second approach has the advantages of being far more general and probably duplicating less code, but at a greater implementation expense. The first approach is probably simpler but could end up creating more special cases / duplicating more logic. I'm inclined to follow the second approach to see how far it gets us. In our year-end brainstorming exercise for 2014 priorities, this was noted as a desireable language feature to pursue (but we have not yet done a complete sort to see where it will fall relative to other work items). -Brad On Thu, 2 Jan 2014, Michael Ferguson wrote: > Hi - > > I've been having some trouble with non-default-size int in > array, tuple, or domain literals, I have to cast every element, > which is a real drag if there are many of them. > > See test/users/ferguson/literals > > Thanks, > > -michael > > ------------------------------------------------------------------------------ > Rapidly troubleshoot problems before they affect your business. Most IT > organizations don't have a clear picture of how application performance > affects their revenue. With AppDynamics, you get 100% visibility into your > Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! > http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk > _______________________________________________ > Chapel-bugs mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/chapel-bugs > ------------------------------------------------------------------------------ Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk _______________________________________________ Chapel-bugs mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/chapel-bugs
