[nem-bug] [Nemerle 0000642]: Error if list declared without
initialisation
feedback at nemerle.org
feedback at nemerle.org
Wed Apr 5 21:12:10 CEST 2006
A NOTE has been added to this issue.
======================================================================
<http://nemerle.org/bugs/view.php?id=642>
======================================================================
Reported By: VladD2
Assigned To:
======================================================================
Project: Nemerle
Issue ID: 642
Category: Compiler
Reproducibility: always
Severity: minor
Priority: normal
Status: new
======================================================================
Date Submitted: 04-01-2006 19:09 CEST
Last Modified: 04-05-2006 21:12 CEST
======================================================================
Summary: Error if list declared without initialisation
Description:
Error reported for this code:
mutable seq : list[int];
seq = [3];
WriteLine(seq.Head);
Error message:
test-016.n:8:20:8:23: error: parse error near identifier `int': unexpected
end of token sequence
test-016.n:8:20:8:23: error: expected assignment operator =
======================================================================
----------------------------------------------------------------------
nazgul - 04-05-06 21:12
----------------------------------------------------------------------
BTW, this is our design from the beginning. We do not want any
uninitialized local variable flying around. Usually you can just do
mutable seq = null;
seq = [3];
it will work fine. And as for value types, you can always use their
parameterless constructor:
mutable x = int();
x = 4;
I'm against, but maybe we should change this design - it creates
additional problems, because we must then perform complex flow control to
prevent usage of uninitialized variables.
Issue History
Date Modified Username Field Change
======================================================================
04-01-06 19:09 VladD2 New Issue
04-05-06 21:12 nazgul Note Added: 0001163
======================================================================
More information about the bugs
mailing list