diff options
| author | gingerBill <gingerBill@users.noreply.github.com> | 2020-09-14 14:07:02 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-14 14:07:02 +0100 |
| commit | d53725fe14209d64fe054aa4bfb705cddbc4c4ec (patch) | |
| tree | 4a1222a7d441a2b07e4cdb0acd9e0ab15b5cb5cf | |
| parent | b8bebf451183b563274592234f38619b2dd9456b (diff) | |
| parent | 2f32b8fb3d80eb835da2a3e63c7549edc30ea88c (diff) | |
Merge pull request #733 from bttelle/issue-515
Fix issue #515
| -rw-r--r-- | src/check_type.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/check_type.cpp b/src/check_type.cpp index e71a1b102..24434dba0 100644 --- a/src/check_type.cpp +++ b/src/check_type.cpp @@ -1253,7 +1253,13 @@ bool check_type_specialization_to(CheckerContext *ctx, Type *specialization, Typ e->type = t_e->type; } } else { - bool ok = is_polymorphic_type_assignable(ctx, st, tt, true, modify_type); + if (st->kind == Type_Basic && tt->kind == Type_Basic && + s_e->kind == Entity_Constant && t_e->kind == Entity_Constant) { + if (!compare_exact_values(Token_CmpEq, s_e->Constant.value, t_e->Constant.value)) + return false; + } else { + bool ok = is_polymorphic_type_assignable(ctx, st, tt, true, modify_type); + } } } |