Whiley / RFCs

Request for Comment (RFC) proposals for substantial changes to the Whiley language.
3 stars 2 forks source link

Typing For Loop Index Variable #96

Open DavePearce opened 4 years ago

DavePearce commented 4 years ago

There is currently a limitation with respect to typing the index variable of a for loop. For example:

method f(uint x):
  ...

method main():
   for x in 0...10:
      f(x)

Here, the type of x is set as int and, hence, the above fails to type check without necessary casts.