google-code-export / gambas

Automatically exported from code.google.com/p/gambas
1 stars 0 forks source link

Compiler fail - invalid DIM assignment not checked #222

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
1) Describe the problem.

 Dim checkWeather As String = ["Rain", "Showery", "Overcast", "Fine", "Hot"]

I feel the compiler should have raised an error on the above initialization 
assignment.

2) GIVE THE FOLLOWING INFORMATIONS (if they are appropriate):

Version: TRUNK
Revision: whatever, sometime this week
Operating system: Linux
Distribution:  mine
Architecture: x86 
GUI component: na
Desktop used: na

3) Provide a little project that reproduces the bug or the crash.
na

4) If your project needs a database, try to provide it, or part of it.
na

5) Explain clearly how to reproduce the bug or the crash.

6) By doing that carefully, you have done 50% of the bug fix job!

IMPORTANT NOTE: if you encounter several different problems or bugs, (for
example, a bug in your project, and an interpreter crash while debugging
it), please create distinct issues!

Original issue reported on code.google.com by adamn...@gmail.com on 10 Mar 2012 at 9:26

GoogleCodeExporter commented 9 years ago
The compiler does not check datatypes at all, and cannot know which datatype [ 
... ] returns (it can be anything runtime-dependent).

Knowing that [ "...", "..." ] returns a String[] is not as simple as you may 
think.

Original comment by benoit.m...@gmail.com on 10 Mar 2012 at 2:36