I’m in the process of updating `Compose.jl`

to work with Julia 0.6 and I got a MethodError thrown when accessing the new constructor via a typealias: (this was originally posted over here: https://github.com/JuliaLang/julia/issues/20774

## Changes made on my part

I added `@compat`

and `{P}`

and `where {P}`

do the following object definition:

```
immutable Form{P <: FormPrimitive} <: ComposeNode
primitives::Vector{P}
tag::Symbol
@compat function Form{P}(prim, tag::Symbol=empty_tag) where {P <: FormPrimitive}
new(prim, tag)
end
end
```

and updated a typealias:

old:

```
immutable SimplePolygonPrimitive{P <: Vec} <: FormPrimitive
points::Vector{P}
end
typealias SimplePolygon{P<:SimplePolygonPrimitive} Form{P}
typealias Polygon SimplePolygon
typealias PolygonPrimitive SimplePolygonPrimitive
```

new:

```
immutable SimplePolygonPrimitive{P <: Vec} <: FormPrimitive
points::Vector{P}
end
const SimplePolygon{P<:SimplePolygonPrimitive} = Form{P}
const Polygon = SimplePolygon
const PolygonPrimitive = SimplePolygonPrimitive
```

## Differences in behavior

OLD:

```
julia> using Compose
julia> x = [Compose.PolygonPrimitive(Tuple{Measure, Measure}[(Compose.x_measure(point[1]), Compose.y_measure(point[2]))
for point in [(0.1, 0.2), (0.3, 0.4), (0.5, 0.6)]])]
1-element Array{Compose.SimplePolygonPrimitive{Tuple{Measures.Measure,Measures.Measure}},1}:
Compose.SimplePolygonPrimitive{Tuple{Measures.Measure,Measures.Measure}}(Tuple{Measures.Measure,Measures.Measure}[(0.1cx,0.2cy),(0.3cx,0.4cy),(0.5cx,0.6cy)])
julia> Compose.Form(x, Compose.empty_tag)
Compose.Form{Compose.SimplePolygonPrimitive{Tuple{Measures.Measure,Measures.Measure}}}(Compose.SimplePolygonPrimitive{Tuple{Measures.Measure,Measures.Measure}}[Compose.SimplePolygonPrimitive{Tuple{Measures.Measure,Measures.Measure}}(Tuple{Measures.Measure,Measures.Measure}[(0.1cx,0.2cy),(0.3cx,0.4cy),(0.5cx,0.6cy)])],Symbol(""))
julia> Compose.Polygon(x, Compose.empty_tag)
Compose.Form{Compose.SimplePolygonPrimitive{Tuple{Measures.Measure,Measures.Measure}}}(Compose.SimplePolygonPrimitive{Tuple{Measures.Measure,Measures.Measure}}[Compose.SimplePolygonPrimitive{Tuple{Measures.Measure,Measures.Measure}}(Tuple{Measures.Measure,Measures.Measure}[(0.1cx,0.2cy),(0.3cx,0.4cy),(0.5cx,0.6cy)])],Symbol(""))
```

NEW:

```
julia> using Compose
julia> x = [Compose.PolygonPrimitive(Tuple{Measure, Measure}[(Compose.x_measure(point[1]), Compose.y_measure(point[2]))
for point in [(0.1, 0.2), (0.3, 0.4), (0.5, 0.6)]])]
1-element Array{Compose.SimplePolygonPrimitive{Tuple{Measures.Measure,Measures.Measure}},1}:
Compose.SimplePolygonPrimitive{Tuple{Measures.Measure,Measures.Measure}}(Tuple{Measures.Measure,Measures.Measure}[(0.1cx, 0.2cy), (0.3cx, 0.4cy), (0.5cx, 0.6cy)])
julia> Compose.Form(x, Compose.empty_tag)
Compose.Form{Compose.SimplePolygonPrimitive{Tuple{Measures.Measure,Measures.Measure}}}(Compose.SimplePolygonPrimitive{Tuple{Measures.Measure,Measures.Measure}}[Compose.SimplePolygonPrimitive{Tuple{Measures.Measure,Measures.Measure}}(Tuple{Measures.Measure,Measures.Measure}[(0.1cx, 0.2cy), (0.3cx, 0.4cy), (0.5cx, 0.6cy)])], Symbol(""))
julia> Compose.Polygon(x, Compose.empty_tag)
ERROR: MethodError: no method matching Compose.Form{P} where P<:Compose.SimplePolygonPrimitive(::Array{Compose.SimplePolygonPrimitive{Tuple{Measures.Measure,Measures.Measure}},1}, ::Symbol)
Closest candidates are:
Compose.Form{P} where P<:Compose.SimplePolygonPrimitive(::Any) where T at sysimg.jl:24
```

Do you all have any suggestions on what I’m doing wrong? I’m not sure why this code broke on v0.5.