mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-15 09:23:44 +00:00
Fix a failing test case.
The test case hard_coded/intermod_foreign_type is failing in the C# grades due
to a missing foreign_type pragma. When originally added this test case had a
foreign_type pragma for IL, but at some point that was deleted (presumably at
the same time the IL backend was removed). This meant that for C# grades, the
coord/0 type would default to its Mercury definition, which conflicts with
the handwritten definition used by the C# foreign_procs.
The fix is to add a C# foreign_type pragma.
tests/hard_coded/intermod_foreign_type.m:
tests/hard_coded/intermod_foreign_type_helper_1.m:
Add a missing c# foreign_type pragma.
Delete unused imports.
This commit is contained in:
@@ -3,17 +3,18 @@
|
||||
%---------------------------------------------------------------------------%
|
||||
|
||||
:- module intermod_foreign_type.
|
||||
|
||||
:- interface.
|
||||
|
||||
:- import_module io.
|
||||
|
||||
:- pred main(io::di, io::uo) is det.
|
||||
|
||||
%---------------------------------------------------------------------------%
|
||||
%---------------------------------------------------------------------------%
|
||||
|
||||
:- implementation.
|
||||
|
||||
:- import_module intermod_foreign_type_helper_1.
|
||||
:- import_module std_util.
|
||||
|
||||
main(!IO) :-
|
||||
C = new(4, 5),
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
|
||||
:- implementation.
|
||||
|
||||
:- import_module std_util.
|
||||
|
||||
:- pragma foreign_decl("C#", "
|
||||
public class coord {
|
||||
public int x;
|
||||
@@ -51,7 +49,11 @@ public class coord {
|
||||
|
||||
%---------------------------------------------------------------------------%
|
||||
|
||||
% Mercury implementation
|
||||
% C# implementation.
|
||||
|
||||
:- pragma foreign_type("C#", coord, "coord").
|
||||
|
||||
% Mercury implementation.
|
||||
|
||||
:- type coord
|
||||
---> coord(x :: int, y :: int).
|
||||
|
||||
Reference in New Issue
Block a user