Assuming that T is a record type, is this valid Oberon code?
PROCEDURE P(VAR x: T);
VAR y: T;
BEGIN
x := y
END P
If yes, should the program trap if the actual parameter x has a type
which is a proper extension of T?
-- August
On Monday, 30 January 2017 15:35:01 UTC+2, August Karlstrom wrote:haven't yet had the time or energy to debug the generated machine code to check why the type tags don't match (it is not entirely trivial to debug with record variables, it becomes quite a complex exercise).
PROCEDURE P(VAR x: T);
VAR y: T;
BEGIN
x := y
END P
Just for information - in my Oberon compiler, I know from experience that the example code will compile fine, but tends to give a type error at runtime when the assign occurs, especially with complex record variables. I am not sure why this is, I
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 296 |
Nodes: | 16 (3 / 13) |
Uptime: | 50:06:13 |
Calls: | 6,649 |
Calls today: | 1 |
Files: | 12,200 |
Messages: | 5,330,189 |