diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index f90e5c5f96..75d8cc2e0a 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -779,20 +779,15 @@ proc semRaise(c: PContext, n: PNode): PNode = result = n checkSonsLen(n, 1) if n[0].kind != nkEmpty: - n[0] = semExprWithType(c, n[0]) let typ = n[0].typ - if not isImportedException(typ): - if typ.kind != tyRef or typ.lastSon.kind != tyObject: localError(n.info, errExprCannotBeRaised) - if not isException(typ.lastSon): localError(n.info, "raised object of type $1 does not inherit from Exception", [typeToString(typ)]) - proc addGenericParamListToScope(c: PContext, n: PNode) = if n.kind != nkGenericParams: illFormedAst(n) for i in countup(0, sonsLen(n)-1):