Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/native-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24'
go-version: '1.26'

- name: Run tests with coverage
run: go test -race -count=1 -skip 'TestParseCorpusFiles|TestJBalUnitTests|TestJBalUnitBIRTests' -coverpkg=./... -coverprofile=coverage.out -covermode=atomic ./...
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24'
go-version: '1.26'

- name: Get version
id: version
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24'
go-version: '1.26'

- name: Get version
id: version
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wasm-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24'
go-version: '1.26'

- name: Run WASM tests
run: |
Expand Down
2 changes: 1 addition & 1 deletion ast/ast.go
Original file line number Diff line number Diff line change
Expand Up @@ -1144,7 +1144,7 @@
if this.ReturnParameter == nil {
return nil
}
return common.ToPointer(this.ReturnParameter.GetReturnParameterDocumentation())
return new(this.ReturnParameter.GetReturnParameterDocumentation())

Check warning on line 1147 in ast/ast.go

View check run for this annotation

Codecov / codecov/patch

ast/ast.go#L1147

Added line #L1147 was not covered by tests
}

func (this *BLangMarkdownDocumentation) GetReferences() []model.MarkdownDocumentationReferenceAttributeNode {
Expand Down
4 changes: 2 additions & 2 deletions ast/expressions.go
Original file line number Diff line number Diff line change
Expand Up @@ -584,12 +584,12 @@
return model.NodeKind_SIMPLE_VARIABLE_REF
}

func (this *BLangConstRef) GetValue() interface{} {
func (this *BLangConstRef) GetValue() any {

Check warning on line 587 in ast/expressions.go

View check run for this annotation

Codecov / codecov/patch

ast/expressions.go#L587

Added line #L587 was not covered by tests
// migrated from BLangConstRef.java:38:5
return this.Value
}

func (this *BLangConstRef) SetValue(value interface{}) {
func (this *BLangConstRef) SetValue(value any) {

Check warning on line 592 in ast/expressions.go

View check run for this annotation

Codecov / codecov/patch

ast/expressions.go#L592

Added line #L592 was not covered by tests
// migrated from BLangConstRef.java:43:5
this.Value = value
}
Expand Down
10 changes: 5 additions & 5 deletions ast/node_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,7 @@
if isFiniteType {
// Remove f, d, and + suffixes
value = regexp.MustCompile("[fd+]").ReplaceAllString(textValue, "")
originalValue = balCommon.ToPointer(strings.ReplaceAll(textValue, "+", ""))
originalValue = new(strings.ReplaceAll(textValue, "+", ""))

Check warning on line 1047 in ast/node_builder.go

View check run for this annotation

Codecov / codecov/patch

ast/node_builder.go#L1047

Added line #L1047 was not covered by tests
} else {
value = textValue
originalValue = &textValue
Expand Down Expand Up @@ -1102,10 +1102,10 @@
} else if kind == common.NIL_LITERAL {
typeTag = model.TypeTags_NIL
value = nil
originalValue = balCommon.ToPointer(string(model.NIL_VALUE))
originalValue = new(string(model.NIL_VALUE))
bLiteral = &BLangLiteral{}
} else if kind == common.NULL_LITERAL {
originalValue = balCommon.ToPointer("null")
originalValue = new("null")
typeTag = model.TypeTags_NIL
bLiteral = &BLangLiteral{}
} else if kind == common.BINARY_EXPRESSION { // Should be base16 and base64
Expand Down Expand Up @@ -1601,8 +1601,8 @@
nameReference := n.createBLangNameReference(actionOrExpression)
bLVarRef := BLangSimpleVarRef{}
bLVarRef.pos = getPosition(actionOrExpression)
bLVarRef.PkgAlias = balCommon.ToPointer(createIdentifier(nameReference[0].GetPosition(), balCommon.ToPointer(nameReference[0].GetValue()), balCommon.ToPointer(nameReference[0].GetValue())))
bLVarRef.VariableName = balCommon.ToPointer(createIdentifier(nameReference[1].GetPosition(), balCommon.ToPointer(nameReference[1].GetValue()), balCommon.ToPointer(nameReference[1].GetValue())))
bLVarRef.PkgAlias = new(createIdentifier(nameReference[0].GetPosition(), new(nameReference[0].GetValue()), new(nameReference[0].GetValue())))
bLVarRef.VariableName = new(createIdentifier(nameReference[1].GetPosition(), new(nameReference[1].GetValue()), new(nameReference[1].GetValue())))
return &bLVarRef

} else if actionOrExpression.Kind() == common.BRACED_EXPRESSION {
Expand Down
2 changes: 1 addition & 1 deletion ast/pretty_printer.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ func (p *PrettyPrinter) printTypeKind(typeKind model.TypeKind) {
p.printString(string(typeKind))
}

func (p *PrettyPrinter) printFlags(flagSet interface{}) {
func (p *PrettyPrinter) printFlags(flagSet any) {
// Check if flagSet has a Contains method
type flagChecker interface {
Contains(model.Flag) bool
Expand Down
2 changes: 1 addition & 1 deletion bir/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (

type ConstValue struct {
Type model.ValueType
Value interface{}
Value any
}

type BIRInstruction interface {
Expand Down
6 changes: 2 additions & 4 deletions cli/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,16 +139,14 @@
logWriter = os.Stderr
}

wg.Add(1)
go func() {
defer wg.Done()
wg.Go(func() {

Check warning on line 142 in cli/cmd/run.go

View check run for this annotation

Codecov / codecov/patch

cli/cmd/run.go#L142

Added line #L142 was not covered by tests
if runOpts.logFile != "" {
defer logWriter.Close()
}
for msg := range debugCtx.Channel {
fmt.Fprintf(logWriter, "%s\n", msg)
}
}()
})

// Ensure debug context cleanup on any exit path
defer func() {
Expand Down
22 changes: 9 additions & 13 deletions common/values.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@

package common

import "iter"
import (
"iter"
"slices"
)

type Optional[T any] struct {
value T
Expand Down Expand Up @@ -51,10 +54,6 @@
}
}

func ToPointer[t any](v t) *t {
return &v
}

func Assert(condition bool) {
if !condition {
panic("Assertion failed")
Expand Down Expand Up @@ -95,8 +94,10 @@
}
)

var _ Set[any] = &UnorderedSet[any]{}
var _ Set[any] = &OrderedSet[any]{}
var (
_ Set[any] = &UnorderedSet[any]{}
_ Set[any] = &OrderedSet[any]{}
)

func (s *UnorderedSet[T]) Add(value T) {
if s.values == nil {
Expand Down Expand Up @@ -127,12 +128,7 @@
}

func (s *OrderedSet[T]) Contains(value T) bool {
for _, v := range s.values {
if v == value {
return true
}
}
return false
return slices.Contains(s.values, value)

Check warning on line 131 in common/values.go

View check run for this annotation

Codecov / codecov/patch

common/values.go#L131

Added line #L131 was not covered by tests
}

func (s *UnorderedSet[T]) Values() iter.Seq[T] {
Expand Down
2 changes: 1 addition & 1 deletion compiler-tools/tree-gen/go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module tree-gen

go 1.24
go 1.26
4 changes: 0 additions & 4 deletions compiler-tools/update-corpus/go.mod

This file was deleted.

Loading