Ticket #257 (closed enhancement: fixed)
First use of a variable in a method out param should declare it
Reported by: | hopscc | Owned by: | Chuck |
---|---|---|---|
Priority: | medium | Milestone: | |
Component: | Cobra Compiler | Version: | 0.8.0 |
Keywords: | Cc: |
Description
Local variables are created (and type inferred) on first assignment
t = 50 * 365
Since the situation is similar the same should happen if the first time a variable is referenced it is as an out param in a method call
if d.tryGetValue(key, out result) print result
Currently it generates an error
error: For "tryGetValue" arg 2: Cannot find "result".
see Discussion
Attachments
Change History
Note: See
TracTickets for help on using
tickets.