From d58ff6bc0b89e714cbba9f82aa41472354e82e2e Mon Sep 17 00:00:00 2001 From: Richard Reeve Date: Tue, 19 Feb 2019 14:46:14 +0000 Subject: [PATCH] Make default getcoords() implementation more precise. --- src/DataTypes.jl | 1 + src/Interface.jl | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/DataTypes.jl b/src/DataTypes.jl index 723123e..e7e319a 100644 --- a/src/DataTypes.jl +++ b/src/DataTypes.jl @@ -1,3 +1,4 @@ +using Compat: Nothing """ AbstractThings diff --git a/src/Interface.jl b/src/Interface.jl index 18c7150..1cf40f0 100644 --- a/src/Interface.jl +++ b/src/Interface.jl @@ -95,7 +95,9 @@ thingnames(asm::AbstractAssemblage, args...) = thingnames(things(asm), args...) # accessing cache # Methods for AbstractPlaces -getcoords(plc::AbstractPlaces) = plc # Pure places generate their own fake location data +getcoords(plc::AbstractPlaces{Nothing}) = plc # Pure places generate their own fake location data +getcoords(plc::AbstractPlaces{<: AbstractLocationData}) = + error("function not defined for $(typeof(plc))") coordinates(plc::AbstractPlaces) = error("function not defined for $(typeof(plc))") # Methods for AbstractGrid