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
1 change: 0 additions & 1 deletion src/ast/analysis/ComponentLookup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ const Component* ComponentLookupAnalysis::getComponent(
// forward according to binding (we do not do this recursively on purpose)
QualifiedName boundName = activeBinding.find(name);
if (boundName.empty()) {
// compName is not bound to anything => just just compName
boundName = name;
}

Expand Down
2 changes: 2 additions & 0 deletions src/ast/transform/ComponentInstantiation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,8 @@ ComponentContent getInstantiatedContent(Program& program, const ComponentInit& c

if (component == nullptr) {
// this component is not defined => will trigger a semantic error
report.addError("Component " + componentInit.getComponentType()->getName() + " not found",
componentInit.getComponentType()->getSrcLoc());
return res;
}

Expand Down
1 change: 1 addition & 0 deletions tests/semantic/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -271,3 +271,4 @@ negative_test(error_deduce_type)
positive_output_stdout_test(output_stdout)
positive_test(iteration_counter)
positive_test(issue1896)
positive_test(comp_params)
1 change: 1 addition & 0 deletions tests/semantic/comp_params/TopA.Foo.X.x.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
A
1 change: 1 addition & 0 deletions tests/semantic/comp_params/TopB.Foo.X.x.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
B
26 changes: 26 additions & 0 deletions tests/semantic/comp_params/comp_params.dl
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

.comp A {
.decl x(s:symbol)
x("A").
}

.comp B {
.decl x(s:symbol)
x("B").
}

.comp _Top<Z> {

.comp _Foo<Z> : _Bar<Z> {
}

.comp _Bar<Q> {
.init X = Q
.output X.x()
}

.init Foo = _Foo<Z>
}

.init TopA = _Top<A>
.init TopB = _Top<B>
Empty file.
Empty file.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Error: Undefined relation impl.R in file comp_params_inheritance.dl at line 10
Base(x) :- impl.R(x).
---------------^----------
Error: Component T not found in file comp_params_inheritance.dl at line 8
.init impl = T
-----------------^-
1 errors generated, evaluation aborted