From 9f08ecd2e4a71af1219d821282330d69f9b70e70 Mon Sep 17 00:00:00 2001 From: "A. R. Shajii" Date: Thu, 16 Feb 2023 23:03:54 -0500 Subject: [PATCH] clang-format --- codon/parser/ast/types/class.cpp | 9 ++++++--- codon/parser/ast/types/class.h | 3 ++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/codon/parser/ast/types/class.cpp b/codon/parser/ast/types/class.cpp index d7cb5119..39cb7078 100644 --- a/codon/parser/ast/types/class.cpp +++ b/codon/parser/ast/types/class.cpp @@ -129,11 +129,13 @@ std::string ClassType::realizedTypeName() const { } RecordType::RecordType(Cache *cache, std::string name, std::string niceName, - std::vector generics, std::vector args, bool isInternal) + std::vector generics, std::vector args, + bool isInternal) : ClassType(cache, std::move(name), std::move(niceName), std::move(generics)), args(std::move(args)), isInternal(false) {} -RecordType::RecordType(const ClassTypePtr &base, std::vector args, bool isInternal) +RecordType::RecordType(const ClassTypePtr &base, std::vector args, + bool isInternal) : ClassType(base), args(std::move(args)), isInternal(isInternal) {} int RecordType::unify(Type *typ, Unification *us) { @@ -157,7 +159,8 @@ int RecordType::unify(Type *typ, Unification *us) { } // Handle Tuple<->@tuple: when unifying tuples, only record members matter. if (startswith(name, TYPE_TUPLE) || startswith(tr->name, TYPE_TUPLE)) { - if (!args.empty() || (!isInternal && !tr->isInternal)) // prevent int<->() unification + if (!args.empty() || + (!isInternal && !tr->isInternal)) // prevent int<->() unification return s1 + int(name == tr->name); else return -1; diff --git a/codon/parser/ast/types/class.h b/codon/parser/ast/types/class.h index 0a4a6100..deba8d8f 100644 --- a/codon/parser/ast/types/class.h +++ b/codon/parser/ast/types/class.h @@ -83,7 +83,8 @@ struct RecordType : public ClassType { Cache *cache, std::string name, std::string niceName, std::vector generics = std::vector(), std::vector args = std::vector(), bool isInternal = false); - RecordType(const ClassTypePtr &base, std::vector args, bool isInternal = false); + RecordType(const ClassTypePtr &base, std::vector args, + bool isInternal = false); public: int unify(Type *typ, Unification *undo) override;