Skip to content

Commit 3d99c47

Browse files
committed
refactor: update import paths for consistency and remove duplicate error messages
1 parent 617a4d2 commit 3d99c47

File tree

6 files changed

+18
-24
lines changed

6 files changed

+18
-24
lines changed

app/cmd/arrays.fer

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//import "app/cmd/types";
1+
//import "demo-app/cmd/types";
22

33
//arrays
44
let arrWithoutType := [1, 2, 3, 4]; // array without explicit type

app/cmd/start.fer

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ import "github.com/itsfuad/ferret-mod/data/bigint"; // unused import;
22
import "github.com/itsfuad/ferret-mod/arrays/array"; // unused import;
33
import "github.com/itsfuad/ferret-mod/external/importer"; // unused import;
44

5-
import "compiler/std/io";
6-
import "compiler/math/constants" as cc;
7-
import "compiler/math/geometry";
5+
import "std/io";
6+
import "math/constants" as cc;
7+
import "math/geometry";
88

9-
import "app/cmd/expr"; // unused import
10-
import "app/cmd/arrays"; // unused import
9+
import "demo-app/cmd/expr"; // unused import
10+
import "demo-app/cmd/arrays"; // unused import
1111

12-
import "app2/file2/types";
12+
import "neighbor/file2/types";
1313

1414
let valueOfPi := cc::PI;
1515

app/cmd/types.fer

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//import "app/cmd/start";
1+
//import "demo-app/cmd/start";
22

33
type String str;
44
type Int i32;

app/fer.ret

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@ name = "demo-app"
44
version = "0.0.2"
55

66
[build]
7-
entry = "cmd/test.fer"
7+
entry = "cmd/start.fer"
88
output = "bin"
99

1010
[cache]
1111
path = ".ferret"
1212

1313
[external]
14-
allow-neighbor-import = true
1514
allow-sharing = false
1615
allow-remote-import = true
16+
allow-neighbor-import = true
1717

1818
[neighbors]
1919
neighbor = "../app2"
2020

2121
[dependencies]
22-
github.com/itsfuad/ferret-mod = "v0.0.4"
22+
github.com/itsfuad/ferret-mod = "v0.0.6"

app/ferret.lock

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
{
22
"version": "1.0.0",
33
"dependencies": {
4-
"github.com/itsfuad/[email protected].4": {
5-
"version": "v0.0.4",
4+
"github.com/itsfuad/[email protected].6": {
5+
"version": "v0.0.6",
66
"direct": true,
77
"dependencies": [
8-
"github.com/itsfuad/[email protected].3"
8+
"github.com/itsfuad/[email protected].4"
99
],
1010
"used_by": []
1111
},
12-
"github.com/itsfuad/[email protected].3": {
13-
"version": "v0.0.3",
12+
"github.com/itsfuad/[email protected].4": {
13+
"version": "v0.0.4",
1414
"direct": false,
1515
"dependencies": [],
1616
"used_by": [
17-
"github.com/itsfuad/[email protected].4"
17+
"github.com/itsfuad/[email protected].6"
1818
]
1919
}
2020
},
21-
"generated_at": "2025-08-20T14:13:31+06:00"
21+
"generated_at": "2025-10-09T19:21:29+06:00"
2222
}

compiler/internal/semantic/typecheck/control_flow.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ func checkIfCondition(r *analyzer.AnalyzerNode, condition ast.Expression, cm *mo
4040
r.Program.FullPath,
4141
nil,
4242
"if statement missing condition",
43-
"if statement missing condition",
4443
report.TYPECHECK_PHASE,
4544
)
4645
return
@@ -93,7 +92,6 @@ func checkAlternative(r *analyzer.AnalyzerNode, alternative ast.Node, cm *module
9392
r.Program.FullPath,
9493
alternative.Loc(),
9594
fmt.Sprintf("invalid alternative in if statement: %T", alternative),
96-
fmt.Sprintf("invalid alternative in if statement: %T", alternative),
9795
report.TYPECHECK_PHASE,
9896
)
9997
}
@@ -108,7 +106,6 @@ func checkReturnStmt(r *analyzer.AnalyzerNode, returnStmt *ast.ReturnStmt, cm *m
108106
r.Program.FullPath,
109107
returnStmt.Loc(),
110108
fmt.Sprintf("function must return a value of type %q", expectedReturnType),
111-
fmt.Sprintf("function must return a value of type %q", expectedReturnType),
112109
report.TYPECHECK_PHASE,
113110
)
114111
}
@@ -133,7 +130,6 @@ func checkReturnStmt(r *analyzer.AnalyzerNode, returnStmt *ast.ReturnStmt, cm *m
133130
r.Program.FullPath,
134131
returnStmt.Loc(),
135132
"void function cannot return a value",
136-
"void function cannot return a value",
137133
report.TYPECHECK_PHASE,
138134
)
139135
return
@@ -144,7 +140,6 @@ func checkReturnStmt(r *analyzer.AnalyzerNode, returnStmt *ast.ReturnStmt, cm *m
144140
rp := r.Ctx.Reports.AddSemanticError(
145141
r.Program.FullPath,
146142
returnStmt.Loc(),
147-
fmt.Sprintf("cannot return %q in function expecting %q: %s",
148143
fmt.Sprintf("cannot return %q in function expecting %q: %s",
149144
returnValueType, expectedReturnType, err.Error()),
150145
report.TYPECHECK_PHASE,
@@ -226,7 +221,6 @@ func reportUnreachableCode(r *analyzer.AnalyzerNode, node ast.Node) {
226221
r.Program.FullPath,
227222
node.Loc(),
228223
"unreachable code after return statement",
229-
"unreachable code after return statement",
230224
report.TYPECHECK_PHASE,
231225
)
232226
}

0 commit comments

Comments
 (0)