lean4-htt/tests/lean/struct1.lean.expected.out
Kyle Miller 7557542bc2
feat: make structure parent projections nameable (#7100)
This PR modifies the `structure` syntax so that parents can be named,
like in
```lean
structure S extends toParent : P
```
**Breaking change:** The syntax is also modified so that the resultant
type comes *before* the `extends` clause, for example `structure S :
Prop extends P`. This is necessary to prevent a parsing ambiguity, but
also this is the natural place for the resultant type. Implements RFC
#7099.

Will need followup PRs for cleanup after a stage0 update.
2025-02-18 07:38:13 +00:00

33 lines
1.5 KiB
Text

struct1.lean:9:14-9:17: error: invalid resulting type, expecting 'Type _' or 'Prop'
struct1.lean:12:20-12:29: error: expected structure
This error is possibly due to a change in the 'structure' syntax. Now the syntax is 'structure S : Type extends P' rather than 'structure S extends P' : Type'.
The purpose of the change is to accommodate 'structure S extends toP : P' syntax for naming parent projections.
struct1.lean:15:28-15:33: warning: field 'x' from 'B' has already been declared
struct1.lean:16:1-16:2: error: field 'x' has been declared in parent structure
struct1.lean:17:30-17:35: warning: duplicate parent structure 'A', skipping
struct1.lean:19:27-19:33: error: parent field type mismatch, field 'x' from parent 'B' has type
Bool : Type
but is expected to have type
Nat : Type
struct1.lean:30:1-30:2: error: field 'x' has already been declared
struct1.lean:33:1-33:2: error: field 'x' has been declared in parent structure
struct1.lean:36:6-36:10: error: type mismatch
true
has type
Bool : Type
but is expected to have type
Nat : Type
struct1.lean:39:5-39:9: error: omit field 'x' type to set default value
struct1.lean:42:12-42:16: error: type mismatch
true
has type
Bool : Type
but is expected to have type
Nat : Type
struct1.lean:45:0-45:13: error: invalid 'private' constructor in a 'private' structure
struct1.lean:48:0-48:15: error: invalid 'protected' constructor in a 'private' structure
struct1.lean:51:0-51:19: error: invalid 'protected' field in a 'private' structure
S : Type
S.mk2 (x : Nat) : S