Skip to content

Commit a57636d

Browse files
committed
Refactor ImpliedUse
Add unit test for fpp-check
1 parent 5cf2a37 commit a57636d

File tree

4 files changed

+27
-2
lines changed

4 files changed

+27
-2
lines changed

compiler/lib/src/main/scala/analysis/Semantics/ImpliedUse.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ object ImpliedUse {
8989
identList: List[Name.Unqualified],
9090
id: AstNode.Id,
9191
annotations: List[String] = Nil
92-
) =
93-
ImpliedUse(Name.Qualified.fromIdentList(identList), id, annotations)
92+
) = ImpliedUse(Name.Qualified.fromIdentList(identList), id, annotations)
9493

9594
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
module M {
2+
3+
module Fw {
4+
5+
port Time
6+
7+
}
8+
9+
passive component C {
10+
11+
time get port timeGetOut
12+
13+
}
14+
15+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
fpp-check
2+
[ local path prefix ]/compiler/tools/fpp-check/test/port_instance/shadowed_time_get.fpp:11.5
3+
time get port timeGetOut
4+
^
5+
error: invalid use of symbol M.Fw.Time: it shadows Fw.Time here
6+
symbol is defined here:
7+
[ local path prefix ]/compiler/tools/fpp-check/test/port_instance/shadowed_time_get.fpp:5.5
8+
port Time
9+
^
10+
note: the symbol Fw.Time has an implied use at the point of the error

compiler/tools/fpp-check/test/port_instance/tests.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ bad_priority_product_recv
1111
duplicate_command_recv
1212
duplicate_general
1313
ok
14+
shadowed_time_get
1415
special_input_kind_command
1516
special_input_kind_missing_product_recv
1617
sync_input_priority

0 commit comments

Comments
 (0)