Skip to content

Commit 524171a

Browse files
committed
sema: fix type analysis of the new checked structure declaration instances
1 parent 5bcb4d7 commit 524171a

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

std/jule/sema/sema.jule

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2534,6 +2534,7 @@ impl sema {
25342534
if s.Bind {
25352535
ret
25362536
}
2537+
s.checked = true
25372538

25382539
if len(s.Generics) == 0 && len(s.Instances) == 0 {
25392540
mut ins := s.instance()

std/jule/sema/struct.jule

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ struct Struct {
5353
// Structure instances for each unique type combination of structure.
5454
// Nil if structure is never used.
5555
Instances: []&StructIns
56+
57+
checked: bool
5658
}
5759

5860
impl Struct {

std/jule/sema/type.jule

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1165,7 +1165,7 @@ impl typeChecker {
11651165
// Disable gstruct collection.
11661166
self.s.meta.gstructs = self.s.meta.gstructs[:0]
11671167
self.s.meta.flags &= ^semametaGstruct
1168-
} else {
1168+
} else if ins.Decl.checked {
11691169
// gstruct collection is not enable and semas are same.
11701170
// So this structure is instantiated in the it's own package.
11711171
// Check it immediately, otherwise some defines may remain unchecked.

0 commit comments

Comments
 (0)