-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1737 from trefis/subst-locs
Update locations during destructive substitutions
- Loading branch information
Showing
14 changed files
with
136 additions
and
3 deletions.
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
Binary file not shown.
Binary file not shown.
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
sigsubst.ml | ||
test_locations.ml |
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,13 @@ | ||
module type S = sig | ||
type elt | ||
type t | ||
|
||
val create : elt -> t | ||
end | ||
|
||
module Apply (Arg : sig type t end) : S with type elt = Arg.t = struct | ||
type elt = Arg.t | ||
type t = elt list | ||
|
||
let create x = [ x ] | ||
end |
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,4 @@ | ||
module type S = Test_functor.S with type elt = unit | ||
|
||
module M : S = Test_functor.Apply (String) | ||
|
4 changes: 4 additions & 0 deletions
4
testsuite/tests/typing-sigsubst/test_loc_modtype_type_subst.ml
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,4 @@ | ||
module type S = Test_functor.S with type elt := unit | ||
|
||
module M : S = Test_functor.Apply (String) | ||
|
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,2 @@ | ||
module M : Test_functor.S with type elt = unit = Test_functor.Apply (String) | ||
|
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,2 @@ | ||
module M : Test_functor.S with type elt := unit = Test_functor.Apply (String) | ||
|
68 changes: 68 additions & 0 deletions
68
testsuite/tests/typing-sigsubst/test_locations.compilers.reference
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,68 @@ | ||
File "test_loc_type_eq.ml", line 1, characters 49-76: | ||
Error: Signature mismatch: | ||
Modules do not match: | ||
sig | ||
type elt = String.t | ||
type t = Test_functor.Apply(String).t | ||
val create : elt -> t | ||
end | ||
is not included in | ||
sig type elt = unit type t val create : elt -> t end | ||
Type declarations do not match: | ||
type elt = String.t | ||
is not included in | ||
type elt = unit | ||
File "test_loc_type_eq.ml", line 1, characters 31-46: | ||
Expected declaration | ||
File "test_functor.ml", line 8, characters 45-61: Actual declaration | ||
File "test_loc_modtype_type_eq.ml", line 3, characters 15-42: | ||
Error: Signature mismatch: | ||
Modules do not match: | ||
sig | ||
type elt = String.t | ||
type t = Test_functor.Apply(String).t | ||
val create : elt -> t | ||
end | ||
is not included in | ||
S | ||
Type declarations do not match: | ||
type elt = String.t | ||
is not included in | ||
type elt = unit | ||
File "test_loc_modtype_type_eq.ml", line 1, characters 36-51: | ||
Expected declaration | ||
File "test_functor.ml", line 8, characters 45-61: Actual declaration | ||
File "test_loc_type_subst.ml", line 1, characters 50-77: | ||
Error: Signature mismatch: | ||
Modules do not match: | ||
sig | ||
type elt = String.t | ||
type t = Test_functor.Apply(String).t | ||
val create : elt -> t | ||
end | ||
is not included in | ||
sig type t val create : unit -> t end | ||
Values do not match: | ||
val create : elt -> t | ||
is not included in | ||
val create : unit -> t | ||
File "test_loc_type_subst.ml", line 1, characters 11-47: | ||
Expected declaration | ||
File "test_functor.ml", line 5, characters 2-23: Actual declaration | ||
File "test_loc_modtype_type_subst.ml", line 3, characters 15-42: | ||
Error: Signature mismatch: | ||
Modules do not match: | ||
sig | ||
type elt = String.t | ||
type t = Test_functor.Apply(String).t | ||
val create : elt -> t | ||
end | ||
is not included in | ||
S | ||
Values do not match: | ||
val create : elt -> t | ||
is not included in | ||
val create : unit -> t | ||
File "test_loc_modtype_type_subst.ml", line 1, characters 16-52: | ||
Expected declaration | ||
File "test_functor.ml", line 5, characters 2-23: Actual declaration |
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,20 @@ | ||
(* TEST | ||
files = "test_functor.ml test_loc_modtype_type_eq.ml test_loc_modtype_type_subst.ml test_loc_type_eq.ml test_loc_type_subst.ml" | ||
* setup-ocamlc.byte-build-env | ||
** ocamlc.byte | ||
module = "test_functor.ml" | ||
** ocamlc.byte | ||
module = "test_loc_type_eq.ml" | ||
ocamlc_byte_exit_status = "2" | ||
** ocamlc.byte | ||
module = "test_loc_modtype_type_eq.ml" | ||
ocamlc_byte_exit_status = "2" | ||
** ocamlc.byte | ||
module = "test_loc_type_subst.ml" | ||
ocamlc_byte_exit_status = "2" | ||
** ocamlc.byte | ||
module = "test_loc_modtype_type_subst.ml" | ||
ocamlc_byte_exit_status = "2" | ||
** check-ocamlc.byte-output | ||
*) | ||
|
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
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