iter ct.2.2-doctidy: refresh stale doc-comments on UnknownCtorInPattern and mono_xmod_ctor_pattern
This commit is contained in:
@@ -48,14 +48,19 @@ fn examples_dir() -> PathBuf {
|
|||||||
/// `head_or_zero : test_mono_ctor_listmod.List<Int> -> Int` that
|
/// `head_or_zero : test_mono_ctor_listmod.List<Int> -> Int` that
|
||||||
/// matches on `Cons h _ | Nil`.
|
/// matches on `Cons h _ | Nil`.
|
||||||
///
|
///
|
||||||
/// Pre-fix repro: `monomorphise_workspace` returns
|
/// Pre-ct.2 repro: `monomorphise_workspace` returned
|
||||||
/// `Err(CheckError::PatternTypeMismatch { ctor: "Cons", ty:
|
/// `Err(CheckError::PatternTypeMismatch { ctor: "Cons", ty:
|
||||||
/// "test_mono_ctor_listmod.List<Int>" })`. The same workspace
|
/// "test_mono_ctor_listmod.List<Int>" })`. The same workspace
|
||||||
/// typechecks cleanly because `check_in_workspace` clears the flat
|
/// typechecked cleanly because the typecheck pass overlaid a
|
||||||
/// `ctor_index` before running `Pattern::Ctor` resolution.
|
/// per-module `ctor_index` whose imports-fallback produced the
|
||||||
|
/// qualified `resolved_type_name`, while the mono pass kept the
|
||||||
|
/// workspace-flat index whose local hit produced the bare one.
|
||||||
///
|
///
|
||||||
/// Post-fix expectation: `monomorphise_workspace` returns `Ok` and the
|
/// Post-ct.2 expectation: `monomorphise_workspace` returns `Ok`
|
||||||
/// `head_or_zero` fn body's match arm types correctly.
|
/// because the Pattern::Ctor lookup no longer consults
|
||||||
|
/// `ctor_index` at all — it walks directly from the scrutinee's
|
||||||
|
/// canonical `Type::Con.name` to its TypeDef in
|
||||||
|
/// `env.module_types` and validates the ctor by name there.
|
||||||
#[test]
|
#[test]
|
||||||
fn mono_pass_handles_xmod_ctor_pattern() {
|
fn mono_pass_handles_xmod_ctor_pattern() {
|
||||||
let entry = examples_dir().join("test_mono_ctor_main.ail.json");
|
let entry = examples_dir().join("test_mono_ctor_main.ail.json");
|
||||||
|
|||||||
@@ -345,8 +345,11 @@ pub enum CheckError {
|
|||||||
#[error("type `{ty}` has no constructor `{ctor}`")]
|
#[error("type `{ty}` has no constructor `{ctor}`")]
|
||||||
UnknownCtor { ty: String, ctor: String },
|
UnknownCtor { ty: String, ctor: String },
|
||||||
|
|
||||||
/// A pattern referenced a ctor not in [`Env::ctor_index`]. Code:
|
/// A pattern referenced a ctor that does not exist in the
|
||||||
/// `unknown-ctor-in-pattern`.
|
/// scrutinee's resolved [`TypeDef`]. The Pattern::Ctor lookup
|
||||||
|
/// is type-driven (post-ct.2): it walks `td.ctors` for the
|
||||||
|
/// `expected` Type::Con's TypeDef and reports this code when
|
||||||
|
/// no ctor of that name is present. Code: `unknown-ctor-in-pattern`.
|
||||||
#[error("unknown constructor `{0}` in pattern")]
|
#[error("unknown constructor `{0}` in pattern")]
|
||||||
UnknownCtorInPattern(String),
|
UnknownCtorInPattern(String),
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user