Skip to content

Commit

Permalink
Nicer TypeEnv initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
tytus-metrycki committed Jul 27, 2020
1 parent 97abbe0 commit 89ced82
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/ast/TypeSystem.h
Expand Up @@ -365,11 +365,7 @@ struct TypeSet {
*/
class TypeEnvironment {
public:
TypeEnvironment()
: constantTypes(initializeConstantTypes()),
constantNumericTypes(TypeSet(getType("__numberConstant"), getType("__unsignedConstant"),
getType("__floatConstant"))),
primitiveTypes(initializePrimitiveTypes()){};
TypeEnvironment() = default;

TypeEnvironment(const TypeEnvironment&) = delete;

Expand Down Expand Up @@ -446,10 +442,11 @@ class TypeEnvironment {
/** The list of covered types. */
std::map<AstQualifiedName, std::unique_ptr<Type>> types;

const TypeSet constantTypes;
const TypeSet constantNumericTypes;
const TypeSet constantTypes = initializeConstantTypes();
const TypeSet constantNumericTypes =
TypeSet(getType("__numberConstant"), getType("__unsignedConstant"), getType("__floatConstant"));

const TypeSet primitiveTypes;
const TypeSet primitiveTypes = initializePrimitiveTypes();
};

// ---------------------------------------------------------------
Expand Down

0 comments on commit 89ced82

Please sign in to comment.