| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
|
|
|
|
| |
and for type variable scoping ([Typetexp.wrap_type_variable_scope]).
The older API ([Ctype.(begin_def,end_def)], [Typetexp.(narrow,widen)], etc.)
is now removed.
The scope of some level management is refined (in particular for [type_application]).
|
|
|
|
|
|
| |
Follow synonyms in #show_module _type
(cherry picked from commit 85a081792117f2f4a312aee3484e84fed8dd5b8a)
|
| |
|
|
|
|
| |
Suggested-by: Nicolás Ojeda Bär <n.oje.bar@gmail.com>
|
|
|
|
| |
Suggested-by: Nicolás Ojeda Bär <n.oje.bar@gmail.com>
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The debugger and toplevels let users install printers for their data types.
To make sure the provided printers have the right type, both the debugger and
the toplevel need to know the internal OCaml representation of
the expected types.
So far, both the debugger and the toplevels used to extract the expected
representatioons from topdirs.cmi which they were reading at runtime.
This creates problems (e.g. when the compiler has not yet been installed)
and yields not so easy to read code.
In this commit, the type of the printers are defined in strings as they
would be written in OCaml in topdirs.ml. These strings are parsed
at runtime and the corresponding typing declarations are added to the
environment.
|
| |
|
| |
|
|
|
|
|
|
| |
fix #show regression in 4.14
(cherry picked from commit ae1a31b01922642389758e313777feaab9de93a0)
|
| |
|
|
|
|
|
|
|
|
| |
The #directory directive now uses Load_path.prepend_dir which adds the
directory given to the _start_ of the load path (i.e. overriding
everything already loaded). This is slightly more intuitive for the
toplevel, consistent with the previous (undefined) behaviour, and also
consistent with treatment of the directory for the DLL search path.
|
|
|
|
|
| |
Clarify the meaning of where the directory gets added (cf. Dll.add_path
which adds directories at the start of the search path)
|
| |
|
| |
|
| |
|
|
|
| |
Co-authored-by: Takafumi Saikawa <tscompor@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In addition to the smaller fixes, there were two major changes:
1. `Errortrace` has its type completely refactored, removing `desc`
and exposing both `'variant trace` and `'variant error`. The
former is for traces that are being built up, and contains
`type_expr`s; the lattern is for complete traces, and contains
`expanded_type`s (a record containing two `type_expr`s). This
dramatically affected a number of call sites, but is much cleaner.
2. We now detect weakly polymorphic types much better during
printing. This involved fixing a bug in moregeneral, which was not
restoring enough information in the error case; it also involved
exposing the flag that differentiated between printing a type (no
weakly polymorphic type detection) and a scheme (yes weakly
polymorphic type detection) in more places, and giving it its own
custom variant type, `Printtyp.type_or_scheme`.
Among the minor changes, the updates to `Includecore` to more
carefully detect privacy violation errors and differentiate between
the various kinds thereof (recorded in the `privacy_mismatch` type) is
the most visible in the code.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We now produce more detailed error messages during various kinds of
module inclusion, taking advantage of the new structured error trace
generation from #10170. Previously, these errors were "shallow",
ending as soon as there was an incompatibility; this patch makes them
"deep", reporting the *reasons* for those problems. For example,
consider the following module:
module M : sig
val x : bool * int
end = struct
let x = false , "not an int"
end
This now produces the following error:
Error: Signature mismatch:
Modules do not match:
sig val x : bool * string end
is not included in
sig val x : bool * int end
Values do not match:
val x : bool * string
is not included in
val x : bool * int
The type bool * string is not compatible with the type bool * int
Type string is not compatible with type int
The last two lines are new in this patch. Previously, the error
message stopped two lines earlier, omitting the key detail that the
reason there is an error is specifically that `string` is not equal to
`int`.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit refactors the types that make up type-checking errors to
maintain more structural information. Most significantly, we split
out the errors we get from unification, moregen, and type equality in
`Ctype` into three distinct exceptions, and retain the sorts of
information we keep during unification in the other two cases as well
(no more `Unify []`). We also maintain more information in
`Includecore` about mismatches of primitives, manifests, and private
objects and variants
This commit doesn't make a lot of changes to the user-visible error
messages yet, only what's necessary to support the type changes, but
it enables a forthcoming patch where we use this improvement to
produce more informative error messages.
This commit includes existing work by Mekhrubon Tuarev, who did all
the early development. I (Antal Spector-Zabusky) came and built the
layer of types on top.
|
|
|
|
|
|
|
|
|
|
| |
For instance, -w "Ae" now raises an ocaml_deprecated_cli alert.
Setting warning with prefixed letters (-w "+a-e") is clearer and
coexists better with named warnings (-w +fragile-match).
In particular, this new alert should warn on spelling mistakes like
-w +fragile-math
|
| |
|
|
|
|
| |
Introduce modules Topeval and Topcommon to share common code between the bytecode and native toplevel.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This unifies both implementations of the toplevel under a common interface.
Similar Makefile hacks to those in place for dynlink are used: byte
and native implementations are in separate directories, while the
shared interface are in the parent and copied as needed by the build
rules.
This is a preliminary step to remove duplication as much as possible
in the two implementations, but should already be pretty useful for
libraries that use the `Toploop` interface.
|
| |
|
|
|
|
| |
See: https://github.com/ocaml/ocaml/issues/9828
|
|
|
|
| |
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
Co-authored-by: David Allsopp <david.allsopp@metastack.com>
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
The show directive now has some basic facility to show
useful information for constructors of "normal" values,
exceptions and other non-exception extension constructors.
Also updated show_type to print out recursion status
with a default of Trec_first.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There is a small change of behavior in this patch due to a different
handling of weak dependencies (those with crco=None); in
Env.check_consistency, only non-weak dependencies would get
[Env.add_import] called, while the `toplevel/` implementations would
also call [Env.add_import] on weak dependencies. After this patch, we
systematically call [add_import] only on non-weak dependencies, even
in `toplevel/`.
([Gabriel:] As far as I can see, the use of [add_import] in the
toplevel never leads to a use of [Env.imports()] for producing
a dependency list, as the toplevel does not produce cmi/cmo files; are
they just no-ops?)
|
|
|
|
|
|
|
|
|
| |
- Add a Load_path module which caches files lookup
- Instead of falling back to the external environment, allow to
declare in the environment that a module comes from the external
world. This allows persistent structures to shadows non-persistent
ones
|
|
|
|
| |
applicative module paths in signatures
|
| |
|
|
|
|
|
|
|
|
| |
- Ident.create now takes a scope as argument
- added Ident.create_var to use when the scope doesn't matter
- the current_time and the current_level are unrelated as of this
commit. But one has to remember to bump the level when creating new
scopes.
|
|
|
|
|
|
| |
Changes
fix typo
|
| |
|
|
|
|
|
| |
And add labels ~always for previous cleanup function and
~exceptionally for new cleanup function in exceptional case
|
| |
|
| |
|