 for name, type of allTypes
 	declare type
 
-for name, type of allTypes when type.pub and type instanceof bw.Struct
-	decls.forward.push "struct #{name}"
+forwardStructs = for name, type of allTypes when type.pub and type instanceof bw.Struct
+	"struct #{name}"
+
+decls.forward = forwardStructs.concat decls.forward
 
 for t in ['forward', 'other']
 	decls[t] = decls[t].filter (x) -> x

	name

register = (type, hint, pub = false) ->
	name = type.typename? hint
	if not type.name?
		allTypes[type.name = name] = type
	type.pub or= pub
	type.name

declare = (type) -> if not type.declared and type.pub

			declare t
	decl = type.declaration?() ? (type.spec and type.name != type.spec and "using #{type.name} = #{type.spec}" or "")
	decls[if not deps then 'forward' else 'other'].push decl

capitalizeFirstLetter = (s) -> s[0].toUpperCase() + s.substring 1

