Skip to content

Commit

Permalink
compiler: minor fixes for implicit import handling
Browse files Browse the repository at this point in the history
  • Loading branch information
mertcandav committed Sep 6, 2024
1 parent 752795d commit 411ccd5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/julec/obj/ir.jule
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,10 @@ fn pushRuntimeToAST(mut &f: &ast::Ast) {
Binded: false,
Std: true,
}
if len(f.UseDecls) > 0 {
f.UseDecls = append(f.UseDecls[:1], f.UseDecls...)
f.UseDecls = append(f.UseDecls, decl)
if len(f.UseDecls) > 1 {
// If we have another use declarations, move decl to first item.
f.UseDecls[len(f.UseDecls)-1] = f.UseDecls[0]
f.UseDecls[0] = decl
} else {
f.UseDecls = append(f.UseDecls, decl)
}
}
2 changes: 1 addition & 1 deletion std/jule/sema/sema.jule
Original file line number Diff line number Diff line change
Expand Up @@ -2448,7 +2448,7 @@ impl Sema {
// If structure instance is comparable and have not custom compare method,
// compiler will use default compare method. If There is array field,
// push instance for runtime function.
if s.Comparable && s.Operators.Eq == nil {
if s.Comparable && s.Operators.Eq == nil && self.meta.runtime != nil {
mut decl := runtimeFindFn(self.meta.runtime, runtimeFunc.arrayCmp)
for (_, mut field) in s.Fields {
mut arr := field.Kind.Arr()
Expand Down

0 comments on commit 411ccd5

Please sign in to comment.