Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test case for enum type matching fix.
- Loading branch information
1 parent
48dca0b
commit 2a672b2
Showing
3 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// name: EnumFuncRel | ||
// keywords: | ||
// status: incorrect | ||
// | ||
// Checks that a function reference to a function returning an enumeration can't | ||
// be used as an enumeration value. | ||
// | ||
|
||
type E = enumeration(one, two, three); | ||
|
||
function f | ||
output E e = E.one; | ||
end f; | ||
|
||
function EnumFuncRel | ||
algorithm | ||
if f == E.one then | ||
end if; | ||
end EnumFuncRel; | ||
|
||
// Result: | ||
// Error processing file: EnumFuncRel.mo | ||
// [flattening/modelica/enums/EnumFuncRel.mo:17:3-18:9:writable] Error: Cannot resolve type of expression f == E.one. The operands have types .f<function>() => #enumeration(one, two, three), enumeration(one, two, three) in component <NO COMPONENT>. | ||
// Error: Error occurred while flattening model EnumFuncRel | ||
// | ||
// # Error encountered! Exiting... | ||
// # Please check the error message and the flags. | ||
// | ||
// Execution failed! | ||
// endResult |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters