Mercurial > hg > ugly-duckling
changeset 496:3c962af5342c
Work-around for causing a compile error for non-exhaustive switch on discriminated union.
author | Lucas Thompson <dev@lucas.im> |
---|---|
date | Fri, 21 Jul 2017 14:29:02 +0100 |
parents | 33b4106af9dd |
children | c39df81c4dae |
files | src/app/visualisations/FeatureUtilities.ts |
diffstat | 1 files changed, 5 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/app/visualisations/FeatureUtilities.ts Fri Jul 21 14:21:26 2017 +0100 +++ b/src/app/visualisations/FeatureUtilities.ts Fri Jul 21 14:29:02 2017 +0100 @@ -109,7 +109,10 @@ return ['vector', 'matrix', 'tracks'].includes(shape); } -const throwShapeError = () => { throw new Error('No shape could be deduced'); }; +function throwShapeError(compileAssertion?: never) { + throw new Error('No shape could be deduced'); +} + function deduceHigherLevelFeatureShape(response: SimpleResponse) : HigherLevelFeatureShape { const collection = response.features; @@ -180,7 +183,7 @@ })) }; } - throwShapeError(); + throwShapeError(deducedShape); } export interface PlotDataPoint {