Changeset 82a5ea2


Ignore:
Timestamp:
Sep 5, 2024, 4:07:48 PM (3 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
master
Children:
a933489b
Parents:
508cff0
Message:

Added checks for (and a test to check the checks) assertions we will not be able to adapt. Using an adapted version of Mike's error message.

Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/Box.cpp

    r508cff0 r82a5ea2  
    515515                ast::FunctionType const * adaptee,
    516516                TypeVarMap const & typeVars ) {
     517        assertf( ast::FixedArgs == adaptee->isVarArgs,
     518                "Cannot adapt a varadic function, should have been checked." );
    517519        ast::FunctionType * adapter = ast::deepCopy( adaptee );
    518520        if ( isDynRet( adapter, typeVars ) ) {
  • src/Validate/module.mk

    r508cff0 r82a5ea2  
    2121        Validate/Autogen.cpp \
    2222        Validate/Autogen.hpp \
     23        Validate/CheckAssertions.cpp \
     24        Validate/CheckAssertions.hpp \
    2325        Validate/CompoundLiteral.cpp \
    2426        Validate/CompoundLiteral.hpp \
  • src/main.cpp

    r508cff0 r82a5ea2  
    6767#include "Tuples/Tuples.hpp"                // for expandMemberTuples, expan...
    6868#include "Validate/Autogen.hpp"             // for autogenerateRoutines
     69#include "Validate/CheckAssertions.hpp"     // for checkAssertions
    6970#include "Validate/CompoundLiteral.hpp"     // for handleCompoundLiterals
    7071#include "Validate/EliminateTypedef.hpp"    // for eliminateTypedef
     
    314315                PASS( "Replace Typedefs", Validate::replaceTypedef, transUnit );
    315316                PASS( "Fix Return Types", Validate::fixReturnTypes, transUnit );
     317                PASS( "Check Assertions", Validate::checkAssertions, transUnit );
    316318                PASS( "Enum and Pointer Decay", Validate::decayEnumsAndPointers, transUnit );
    317319
Note: See TracChangeset for help on using the changeset viewer.