diff --git a/ghc/compiler/parser/Lex.lhs b/ghc/compiler/parser/Lex.lhs
index 72b31c529209e5163102e8c48e71bf1906c53b16..39b2358d08b0d33d212bb7b39041900aea8a21f3 100644
--- a/ghc/compiler/parser/Lex.lhs
+++ b/ghc/compiler/parser/Lex.lhs
@@ -522,8 +522,8 @@ lexToken cont glaexts buf =
 
     '}'# -> \ s@PState{context = ctx} ->
 	    case ctx of	
-		(NoLayout:ctx') -> cont ITccurly (incLexeme buf) s{context=ctx'}
-		_ 		-> lexError "too many '}'s" buf s
+		(_:ctx') -> cont ITccurly (incLexeme buf) s{context=ctx'}
+		_  	 -> lexError "too many '}'s" buf s
 
     '#'# -> case lookAhead# buf 1# of
 		')'#  | flag glaexts -> cont ITcubxparen (setCurrentPos# buf 2#)