# Strange enum, array and dictionary issues

**URL:** https://talk.remobjects.com/t/strange-enum-array-and-dictionary-issues/22643
**Category:** Silver
**Created:** [July 20, 2020, 7:15pm UTC](https://talk.remobjects.com/t/strange-enum-array-and-dictionary-issues/22643 "2020-07-20T19:15:19Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![ndelic](https://talk.remobjects.com/user_avatar/talk.remobjects.com/ndelic/32/526_2.png) [@ndelic](https://talk.remobjects.com/u/ndelic)
#### Post date: [July 20, 2020, 7:15pm UTC](https://talk.remobjects.com/t/strange-enum-array-and-dictionary-issues/22643/1 "2020-07-20T19:15:19Z")

</div>

Using Fire .2525, Android class library

I have an enum:

```
public enum ConnectionState: String {
    case approved, approvalPending, forbidden
}

```

If I define an array like this:

`let values: [ConnectionState] = [.approvalPending, .approved, .forbidden]`

it fails to compile with “No matching overload” message. However, the definition below compiles fine:

`let values = [ConnectionState.approvalPending, ConnectionState.approved, ConnectionState.forbidden]`

If I define a dictionary:

`var dictValues = [String: ConnectionState]()`

and then try to change it in a method:

```
func test(_ aState1: ConnectionState, _ aState2: ConnectionState) {
    dictValues["state1"] = aState1
    dictValues["state2"] = aState2
}

```

it fails to compile with “Parameter 2 should be ConnectionState?” error.

But, if I put this definition

`let values = [ConnectionState.approvalPending, ConnectionState.approved, ConnectionState.forbidden]`

before `dictValues` definition, the `test()` method compiles! Strange.

This only happens with Android project, Echoes project compiles fine.  
If I revert to Fire .2513, all the issues go away.

Test project attached.

[DictionaryTest.zip](https://talk.remobjects.com/uploads/short-url/odHPP44oCcVEzYmfDJSFx0WZgGi.zip) (229.4 KB)

---

<div class="post-metadata">

### Author: ![ndelic](https://talk.remobjects.com/user_avatar/talk.remobjects.com/ndelic/32/526_2.png) [@ndelic](https://talk.remobjects.com/u/ndelic)
#### Post date: [July 28, 2020, 1:32pm UTC](https://talk.remobjects.com/t/strange-enum-array-and-dictionary-issues/22643/2 "2020-07-28T13:32:42Z")

</div>

Anybody from Elements team saw this?

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [July 28, 2020, 1:39pm UTC](https://talk.remobjects.com/t/strange-enum-array-and-dictionary-issues/22643/3 "2020-07-28T13:39:34Z")

</div>

My apologies for the delayed response; this sounds like a bug. will log.

---

<div class="post-metadata">

### Author: ![RemObjectsSoftware](https://talk.remobjects.com/user_avatar/talk.remobjects.com/remobjectssoftware/32/15947_2.png) [@RemObjectsSoftware](https://talk.remobjects.com/u/RemObjectsSoftware)
#### Post date: [July 28, 2020, 1:39pm UTC](https://talk.remobjects.com/t/strange-enum-array-and-dictionary-issues/22643/4 "2020-07-28T13:39:38Z")

</div>

Thanks, logged as [bugs://84742](https://www.remobjects.com/portal/bugs/?id=84742)

---

<div class="post-metadata">

### Author: ![ndelic](https://talk.remobjects.com/user_avatar/talk.remobjects.com/ndelic/32/526_2.png) [@ndelic](https://talk.remobjects.com/u/ndelic)
#### Post date: [July 29, 2020, 7:25am UTC](https://talk.remobjects.com/t/strange-enum-array-and-dictionary-issues/22643/5 "2020-07-29T07:25:01Z")

</div>

Thank you.

---

<div class="post-metadata">

### Author: ![RemObjectsSoftware](https://talk.remobjects.com/user_avatar/talk.remobjects.com/remobjectssoftware/32/15947_2.png) [@RemObjectsSoftware](https://talk.remobjects.com/u/RemObjectsSoftware)
#### Post date: [September 2, 2020, 8:43am UTC](https://talk.remobjects.com/t/strange-enum-array-and-dictionary-issues/22643/6 "2020-09-02T08:43:48Z")

</div>

[bugs://84742](https://www.remobjects.com/portal/bugs/?id=84742) got closed with status fixed.
