gracelang / minigrace

Self-hosting compiler for the Grace programming language
39 stars 22 forks source link

Re-declaring a class parameter causes crash #58

Open apblack opened 9 years ago

apblack commented 9 years ago

Kim Bruce wrote by email:

Redeclaring a class parameter name inside the class causes a compiler crash. Here is the sample code and error message:

class test.with(x:Number) {
      def x: Number = 2
      print(x)
}

This produces:

 Internal compiler error at line 513 of genjs: NoSuchMethod: no method 'dtype' in object an object.
    in "test2"

The code should be illegal.

apblack commented 9 years ago

This issue should be detected in identifierResolution; it should never get as far as code generation.