Skip to content

Conversation

@alexanderpann
Copy link
Member

val mixed = list(true, 1, "two")                                          
                                                                          
test case mixedAccess [incomplete] {                                      
assert  mixed[0] equals true [C] [no result found]                        
assert  mixed[1] equals 1 [C] [no result found]                           
assert  mixed[2] equals "two" [C] [no result found]                       
assert  mixed.size equals 3 [C] [no result found]                         
assert  mixed.all(|it.toList.size == 1|) equals true [C] [no result found]
assert  mixed.any(|it.toList.size == 1|) equals true [C] [no result found]
assert  mixed.contains(true) equals true [C] [no result found]            
assert  mixed.first equals true [C] [no result found]                     
assert  mixed.last equals "two" [C] [no result found]                     
assert  mixed.indexOf(1) equals 1 [C] [no result found]                   
assert  mixed.reverse equals list("two", 1, true) [C] [no result found]   
assert  mixed.tail equals list(1, "two") [C] [no result found]            
}                                                                         

I think we should create a ticket for improving other operations on heterogeneous lists. An example of what doesn't work:

assert mixed.any(|it.oneOf[true, false]|) equals true -> type join(...) is not a subtype of boolean

@arimer Do you have more input on what might be not working?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants