Skip to content

Commit

Permalink
Making it so collections can have mixed types neo4j#378
Browse files Browse the repository at this point in the history
  • Loading branch information
freeeve committed Jan 18, 2013
1 parent f23059b commit ca457ac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ trait CypherType {
def mergeWith(other: CypherType): CypherType = { def mergeWith(other: CypherType): CypherType = {
if (this.isAssignableFrom(other)) other if (this.isAssignableFrom(other)) other
else if (other.isAssignableFrom(this)) this else if (other.isAssignableFrom(this)) this
else throw new CypherTypeException("Failed merging " + this + " with " + other) else AnyType()
} }


def parentType: CypherType def parentType: CypherType
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2355,4 +2355,9 @@ RETURN x0.name?
assert(result.toList === List()) assert(result.toList === List())
} }


@Test def mixed_type_collections_should_be_allowed() {
val result = parseAndExecute("START a=node(0) RETURN [1,'hello'] as mixed")

assert(result.toList.head === Map("mixed" -> List(1,"hello")))
}
} }

0 comments on commit ca457ac

Please sign in to comment.