mirror of
https://github.com/odin-lang/Odin.git
synced 2026-04-21 22:05:20 +00:00
fix broken bit_set parapoly specialization #6240
This commit is contained in:
@@ -1501,6 +1501,11 @@ gb_internal bool is_polymorphic_type_assignable(CheckerContext *c, Type *poly, T
|
||||
|
||||
case Type_BitSet:
|
||||
if (source->kind == Type_BitSet) {
|
||||
if (!is_type_polymorphic(poly->BitSet.elem)) {
|
||||
if (poly->BitSet.upper != source->BitSet.upper || poly->BitSet.lower != source->BitSet.lower) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (!is_polymorphic_type_assignable(c, poly->BitSet.elem, source->BitSet.elem, true, modify_type)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1229,6 +1229,7 @@ gb_internal void check_bit_set_type(CheckerContext *c, Type *type, Type *named_t
|
||||
ast_node(bs, BitSetType, node);
|
||||
GB_ASSERT(type->kind == Type_BitSet);
|
||||
type->BitSet.node = node;
|
||||
type->BitSet.elem = t_invalid;
|
||||
|
||||
/* i64 const DEFAULT_BITS = cast(i64)(8*build_context.word_size); */
|
||||
i64 const MAX_BITS = 128;
|
||||
|
||||
@@ -29,6 +29,7 @@ set COMMON=-define:ODIN_TEST_FANCY=false -file -vet -strict-style -ignore-unused
|
||||
..\..\..\odin test ..\test_issue_6068.odin %COMMON% || exit /b
|
||||
..\..\..\odin test ..\test_issue_6101.odin %COMMON% || exit /b
|
||||
..\..\..\odin test ..\test_issue_6165.odin %COMMON% || exit /b
|
||||
..\..\..\odin build ..\test_issue_6240.odin %COMMON% 2>&1 | find /c "Error:" | findstr "3" || exit /b
|
||||
|
||||
@echo off
|
||||
|
||||
|
||||
@@ -36,6 +36,12 @@ $ODIN test ../test_issue_5699.odin $COMMON
|
||||
$ODIN test ../test_issue_6068.odin $COMMON
|
||||
$ODIN test ../test_issue_6101.odin $COMMON
|
||||
$ODIN test ../test_issue_6165.odin $COMMON
|
||||
if [[ $($ODIN build ../test_issue_6240.odin $COMMON 2>&1 >/dev/null | grep -c "Error:") -eq 3 ]] ; then
|
||||
echo "SUCCESSFUL 1/1"
|
||||
else
|
||||
echo "SUCCESSFUL 0/1"
|
||||
exit 1
|
||||
fi
|
||||
set +x
|
||||
|
||||
popd
|
||||
|
||||
Reference in New Issue
Block a user