Don't use Any unless you absolutely have to. Reasoning about it, in exactly this kind of situation, is very tricky. Swift has type-parameterization (generics) for a reason. In most cases you want a struct anyway.
I tried to write out what the type of this thing would actually be, but it's not really possible to write in Swift. The second element is [String:Float], which is fine. But the first element is [String:[[String: Any]]], which is a type that Swift will not implicitly promote to (and also happens to be a really insane type). Swift only promotes to Any if you explicitly ask for it exactly where you want it to do so. That's why it doesn't quietly promote to [Any] here. That's a feature. If it were otherwise, all kinds of things would quietly promote to Any and the compiler errors would be even more confusing.
The answer is to avoid Any. What you really have here are a couple of structs:
struct Item {
let name: String
let units: Int
}
struct Dico {
let tickets: [Item]
let totale: Float
}
let dico = Dico(tickets: [
Item(name: "kebab", units: 1),
Item(name: "muffin", units: 1),
Item(name: "coca-cola", units: 2)
],
totale: 225.00 )
let tickets = dico.tickets
This is how you should store and deal with your data. If you're starting with something like JSON that returns you a bunch of Any objects, you should parse it into data structures before using it. Otherwise you will fight with this insane dictionary all over the code. I've been writing about JSON parsing in Swift in a series that started with Functional Wish Fulfillment. I link there to several other similar approaches. The same basic technique applies to any parser, not just JSON.