You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Better type in error conected to usage of Options #17
type xmlc.XMLNode = unsafe &void
for id in ids {
mut node := none as ?xmlc.XMLNode
for potential_node in nodes {
if get_attribute_value(potential_node, "id") == id {
node = potential_node
break
}
}
if node == none {
panic("No such typedef node with id " + id)
}
name := get_attribute_value(node, "name") or { panic("Typedef node is corrupted - doesn't have name attribute") }
}
error(E0050): cannot pass `?xmlc.XMLNode` to parameter with `xmlc.XMLNode` type
--> xml.sp:71:31:35
|
71 | name := get_attribute_value(node, "name") or { panic("Typedef node is corrupted - doesn't have name attribute") }
| ^^^^ expected: unsafe &void, got: ?xmlc.XMLNode
note: parameter has `xmlc.XMLNode` type
--> xml.sp:77:24:41
|
77 | fn get_attribute_value(node xmlc.XMLNode, attribute_name string) -> ?string {
| ^^^^^^^^^^^^^^^^^ (1) parameter declared here as `xmlc.XMLNode`
Line ^^^^ expected: unsafe &void, got: ?xmlc.XMLNode should be ^^^^ expected: xmlc.XMLNode, got: ?xmlc.XMLNode
Activity