Wiki

Ticket #54 (closed defect: fixed)

Opened 15 years ago

Last modified 15 years ago

For statement type inference bug with HashTable

Reported by: hopscc Owned by: Chuck
Priority: minor Milestone:
Component: Cobra Compiler Version: 0.8.0
Keywords: Cc:

Description

Erroneous compilation error

htbl=HashTable()
htbl['a'] ='value1'
...
for de in htbl
  # de to DictionaryEntry  # works if cast explicitly
  print de.key, de.value

gives error

Cannot find a definition for "key" in "de" whose type is "Object?

Should be able to infer type of de as DictionaryEntry
See discussion and fixup area of attack in
 Type inference bug with hashTable and for

Not seen as major since Hashtable not used frequently...

Attachments

infer-hashTable-enumType.patch Download (3.8 KB) - added by hopscc 15 years ago.

Change History

Changed 15 years ago by hopscc

Changed 15 years ago by hopscc

  • status changed from new to assigned
  • owner set to Chuck

Fix for this bug, testfile and relnotes add.
Since this disallowed multiarg assignment in a for-statement from a hashtable,
that test in multiarg-forDict tests is also updated...

Changed 15 years ago by Chuck

  • status changed from assigned to closed
  • resolution set to fixed

Applied in changeset:1710

Note: See TracTickets for help on using tickets.