diff --git a/src/ast/ast_const_folding.cpp b/src/ast/ast_const_folding.cpp index 0c981af06..6b5fbdf9a 100644 --- a/src/ast/ast_const_folding.cpp +++ b/src/ast/ast_const_folding.cpp @@ -38,9 +38,9 @@ namespace das { class NoSideEffectVisitor : public Visitor { protected: - virtual bool canVisitStructureFieldInit ( Structure * ) override { return false; } - virtual bool canVisitArgumentInit ( Function * , const VariablePtr &, Expression * ) override { return false; } - virtual bool canVisitQuoteSubexpression ( ExprQuote * ) override { return false; } + // virtual bool canVisitStructureFieldInit ( Structure * ) override { return false; } + // virtual bool canVisitArgumentInit ( Function * , const VariablePtr &, Expression * ) override { return false; } + // virtual bool canVisitQuoteSubexpression ( ExprQuote * ) override { return false; } // make block virtual void preVisit ( ExprMakeBlock * expr ) override { Visitor::preVisit(expr); @@ -453,9 +453,9 @@ namespace das { return nullptr; } protected: - virtual bool canVisitStructureFieldInit ( Structure * ) override { return false; } - virtual bool canVisitArgumentInit ( Function * , const VariablePtr &, Expression * ) override { return false; } - virtual bool canVisitQuoteSubexpression ( ExprQuote * ) override { return false; } + // virtual bool canVisitStructureFieldInit ( Structure * ) override { return false; } + // virtual bool canVisitArgumentInit ( Function * , const VariablePtr &, Expression * ) override { return false; } + // virtual bool canVisitQuoteSubexpression ( ExprQuote * ) override { return false; } // swizzle virtual ExpressionPtr visit ( ExprSwizzle * expr ) override { if ( expr->type->baseType == expr->value->type->baseType ) { diff --git a/src/ast/ast_infer_type.cpp b/src/ast/ast_infer_type.cpp index 159245e16..16030fad9 100644 --- a/src/ast/ast_infer_type.cpp +++ b/src/ast/ast_infer_type.cpp @@ -1938,7 +1938,7 @@ namespace das { } } } - if ( decl.parentType ) { + if ( decl.parentType && st->parent ) { auto pf = st->parent->findField(decl.name); if ( !pf->type->isAutoOrAlias() ) { decl.type = make_smart(*pf->type);