diff --git a/lib/infer.js b/lib/infer.js
index <HASH>..<HASH> 100644
--- a/lib/infer.js
+++ b/lib/infer.js
@@ -888,14 +888,15 @@
     case "in": case "instanceof": return true;
     }
   }
-  function literalType(val) {
-    switch (typeof val) {
+  function literalType(node) {
+    if (node.regex) return getInstance(cx.protos.RegExp);
+    switch (typeof node.value) {
     case "boolean": return cx.bool;
     case "number": return cx.num;
     case "string": return cx.str;
     case "object":
     case "function":
-      if (!val) return ANull;
+      if (!node.value) return ANull;
       return getInstance(cx.protos.RegExp);
     }
   }
@@ -1091,7 +1092,7 @@
       return scope.fnType ? scope.fnType.self : cx.topScope;
     }),
     Literal: ret(function(node) {
-      return literalType(node.value);
+      return literalType(node);
     })
   };
 
@@ -1338,7 +1339,7 @@
       return scope.fnType ? scope.fnType.self : cx.topScope;
     },
     Literal: function(node) {
-      return literalType(node.value);
+      return literalType(node);
     }
   };
Fix type inference for unsyntactic regexps

They get a .value of undefined, which would confuse literalType

Issue #<I>