-
Notifications
You must be signed in to change notification settings - Fork 29
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 #1095 from daniel-larraz/expand-types
Expand nested types and types of call arguments
- Loading branch information
Showing
4 changed files
with
67 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
type Nat = subrange [0,*] of int; | ||
|
||
type D = subtype { i: Nat | i < 10 }; | ||
|
||
type R1 = struct { | ||
f1: D; | ||
}; | ||
|
||
type R2 = struct { | ||
r1: R1; | ||
}; | ||
|
||
type R3 = struct { | ||
r2: R2; | ||
}; | ||
|
||
function F2(r2: R2) returns (ok: bool); | ||
let | ||
ok = r2.r1.f1 < 10; | ||
tel | ||
|
||
function F1(r3: R3) returns (ok: bool); | ||
let | ||
ok = F2(r3.r2); | ||
check ok; | ||
tel |
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,23 @@ | ||
|
||
type Nat = subrange [0,*] of int; | ||
|
||
type D = subtype { i:Nat | i < 10 }; | ||
|
||
type R1 = struct { | ||
f1: D; | ||
}; | ||
|
||
type R2 = struct { | ||
r1: R1; | ||
}; | ||
|
||
function F2(r1: R1) returns (ok:bool); | ||
let | ||
ok = r1.f1 < 10; | ||
tel | ||
|
||
function F1(m: R2) returns (ok:bool); | ||
let | ||
ok = F2(m.r1); | ||
check ok; | ||
tel |