@@ -215,39 +215,22 @@ static void parseSignature(Umka *umka, Signature *sig)
215215
216216static const Type * parseTypeOrForwardType (Umka * umka )
217217{
218- const Type * type = NULL ;
219-
220218 // Forward declaration?
221- bool forward = false;
222219 if (umka -> types .forwardTypesEnabled && umka -> lex .tok .kind == TOK_IDENT )
223220 {
224- const Ident * ident = NULL ;
225-
226221 Lexer lookaheadLex = umka -> lex ;
227222 lexNext (& lookaheadLex );
228- if (lookaheadLex .tok .kind == TOK_COLONCOLON )
229- ident = identFindModule (& umka -> idents , & umka -> modules , & umka -> blocks , umka -> blocks .module , umka -> lex .tok .name , true);
230- else
231- ident = identFind (& umka -> idents , & umka -> modules , & umka -> blocks , umka -> blocks .module , umka -> lex .tok .name , NULL , true);
232-
233- if (!ident )
223+ if (lookaheadLex .tok .kind != TOK_COLONCOLON && !identFind (& umka -> idents , & umka -> modules , & umka -> blocks , umka -> blocks .module , umka -> lex .tok .name , NULL , true))
234224 {
235225 Type * forwardType = typeAdd (& umka -> types , & umka -> blocks , TYPE_FORWARD );
236226 forwardType -> typeIdent = identAddType (& umka -> idents , & umka -> modules , & umka -> blocks , umka -> lex .tok .name , forwardType , false);
237227 identSetUsed (forwardType -> typeIdent );
238-
239228 lexNext (& umka -> lex );
240-
241- type = forwardType ;
242- forward = true;
229+ return forwardType ;
243230 }
244231 }
245232
246- // Conventional declaration
247- if (!forward )
248- type = parseType (umka , NULL );
249-
250- return type ;
233+ return parseType (umka , NULL );
251234}
252235
253236
0 commit comments