Ticket #54 (closed defect: fixed)

Opened 2 months ago

Last modified 2 months 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 (3.8 kB) - added by hopscc 2 months ago.

Change History

Changed 2 months ago by hopscc

Changed 2 months 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 2 months 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.