From 707603b81f2da88d1d0782a4365492b48d6dd5c2 Mon Sep 17 00:00:00 2001
From: David Sehnal <david.sehnal@gmail.com>
Date: Sun, 2 Dec 2018 10:46:01 +0100
Subject: [PATCH] mol-plugin: compiler check if all param types have associated
 control.

---
 src/mol-plugin/ui/controls/parameters.tsx | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/mol-plugin/ui/controls/parameters.tsx b/src/mol-plugin/ui/controls/parameters.tsx
index f7399b0bb..0674d2c1e 100644
--- a/src/mol-plugin/ui/controls/parameters.tsx
+++ b/src/mol-plugin/ui/controls/parameters.tsx
@@ -59,9 +59,11 @@ function controlFor(param: PD.Any): ParamControl | undefined {
         case 'group': return GroupControl;
         case 'mapped': return MappedControl;
         case 'line-graph': return LineGraphControl;
+        default:
+            const _: never = param;
+            console.warn(`${_} has no associated UI component`);
+            return void 0;
     }
-    console.warn(`${(param as any).type} has no associated UI component.`);
-    return void 0;
 }
 
 // type ParamWrapperProps = { name: string, value: any, param: PD.Base<any>, onChange: ParamOnChange, control: ValueControl, onEnter?: () => void, isEnabled?: boolean }
-- 
GitLab