Merge: Better autoinit conflict message
authorJean Privat <jean@pryen.org>
Tue, 14 Jul 2015 19:50:57 +0000 (15:50 -0400)
committerJean Privat <jean@pryen.org>
Tue, 14 Jul 2015 19:50:57 +0000 (15:50 -0400)
commit95792f75eb7bd17bb1c7287bc62bf96735550df6
treef5d113822b712ab566b4a8d2f8b9bcf1be0d762a
parent2532783d4a8b781f5b28b819d12f1355be05a08f
parente85d420c23dedd33110ae31102bef75ed540e11f
Merge: Better autoinit conflict message

On

~~~nit
class A
    var x: Int
end

class B
    var y: Bool
end

class C
    super A
    super B
end
~~~

The error message

> a.nit:9,7: Error: conflict for inherited inits a#B#init(y=) and a#A#init(x=)

now become

> a.nit:9,7: Error: cannot generate automatic init for class C. Conflict in the order in inherited initializers a#B#init(y=) and a#A#init(x=). Use `autoinit` to order initializers. eg `autoinit x=, y=`

(fell free to simplify or propose better)

Close #1549

Pull-Request: #1568
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>