summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rwxr-xr-xcompiler/semexprs.nim4
-rwxr-xr-xcompiler/semstmts.nim8
-rwxr-xr-xtodo.txt3
3 files changed, 8 insertions, 7 deletions
diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim
index e1cdfcc35..3539424d1 100755
--- a/compiler/semexprs.nim
+++ b/compiler/semexprs.nim
@@ -740,7 +740,7 @@ proc discardCheck(result: PNode) =
       # XXX too much work and fixing would break bootstrapping:
       #Message(n.info, warnNilStatement)
       result.typ = nil
-    elif not ImplicitelyDiscardable(result) and result.typ.kind != tyError and
+    elif not ImplicitlyDiscardable(result) and result.typ.kind != tyError and
         gCmd != cmdInteractive:
       localError(result.info, errDiscardValue)
 
@@ -1117,7 +1117,7 @@ proc semProcBody(c: PContext, n: PNode): PNode =
     # ``result``:
     if result.kind == nkSym and result.sym == c.p.resultSym:
       nil
-    elif result.kind == nkNilLit or ImplicitelyDiscardable(result):
+    elif result.kind == nkNilLit or ImplicitlyDiscardable(result):
       # intended semantic: if it's 'discardable' and the context allows for it,
       # discard it. This is bad for chaining but nicer for C wrappers. 
       # ambiguous :-(
diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim
index 1821e5400..4c9a7f88e 100755
--- a/compiler/semstmts.nim
+++ b/compiler/semstmts.nim
@@ -1071,7 +1071,7 @@ proc destroyCase(c: PContext, n: PNode, holder: PNode): PNode =
     result = nil
  
 proc generateDestructor(c: PContext, t: PType): PNode =
-  ## generate a destructor for a user-defined object ot tuple type
+  ## generate a destructor for a user-defined object or tuple type
   ## returns nil if the destructor turns out to be trivial
   
   template addLine(e: expr): stmt =
@@ -1106,7 +1106,7 @@ proc instantiateDestructor*(c: PContext, typ: PType): bool =
   
   if t.destructor != nil:
     # XXX: This is not entirely correct for recursive types, but we need
-    # it temporarily to hide the "destroy is alrady defined" problem
+    # it temporarily to hide the "destroy is already defined" problem
     return t.destructor notin [AnalyzingDestructor, DestructorIsTrivial]
   
   case t.kind
@@ -1205,7 +1205,7 @@ proc insertDestructors(c: PContext,
 
       return
 
-proc ImplicitelyDiscardable(n: PNode): bool =
+proc ImplicitlyDiscardable(n: PNode): bool =
   result = isCallExpr(n) and n.sons[0].kind == nkSym and 
            sfDiscardable in n.sons[0].sym.flags
 
@@ -1256,7 +1256,7 @@ proc semStmtList(c: PContext, n: PNode): PNode =
   # a statement list (s; e) has the type 'e':
   if result.kind == nkStmtList and result.len > 0:
     var lastStmt = lastSon(result)
-    if lastStmt.kind != nkNilLit and not ImplicitelyDiscardable(lastStmt):
+    if lastStmt.kind != nkNilLit and not ImplicitlyDiscardable(lastStmt):
       result.typ = lastStmt.typ
       #localError(lastStmt.info, errGenerated,
       #  "Last expression must be explicitly returned if it " &
diff --git a/todo.txt b/todo.txt
index d627626a5..c0065038a 100755
--- a/todo.txt
+++ b/todo.txt
@@ -3,7 +3,7 @@ version 0.9.2
 
 - lazy overloading resolution:
   * get rid of ``expr[typ]``, use perhaps ``static[typ]`` instead
-  * typedesc[T] needs to be documented in ast.nim
+  * special case ``tyStmt``
 - FFI:
   * test libffi on windows
   * test: times.format with the FFI
@@ -131,3 +131,4 @@ Bugs
 - the better scoping for locals is the wrong default for endb
 - osproc execProcesses can deadlock if all processes fail (as experienced
   in c++ mode)
+- case statement exhaustiveness checking is still wrong