From b994162b8a04175f5aae94fd59ce46f388c1f179 Mon Sep 17 00:00:00 2001 From: DanielGavin Date: Fri, 28 Jul 2023 19:30:15 +0200 Subject: Fix more issues with bitset inference --- tests/completions_test.odin | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'tests') diff --git a/tests/completions_test.odin b/tests/completions_test.odin index 65078f9..3078a14 100644 --- a/tests/completions_test.odin +++ b/tests/completions_test.odin @@ -2298,3 +2298,36 @@ ast_private_proc_ignore :: proc(t: ^testing.T) { test.expect_completion_labels(t, &source, ".", {}) } + +@(test) +ast_bitset_assignment_diff_pkg :: proc(t: ^testing.T) { + packages := make([dynamic]test.Package) + + append( + &packages, + test.Package{ + pkg = "my_package", + source = `package my_package + Foo :: enum { Aa, Ab, Ac, Ad } + Foo_Set :: bit_set[Foo] + `, + }, + ) + + source := test.Source { + main = `package main + import "my_package" + + Bar :: struct { + set: my_package.Foo_Set, + } + main :: proc() { + s: Bar + s.set = {.{*}} + } + `, + packages = packages[:], + } + + test.expect_completion_labels(t, &source, ".", {"Aa", "Ab", "Ac", "Ad"}) +} -- cgit v1.2.3