gracelang / minigrace

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

Accessing a non-existent attribute of a module should be a static error #245

Open apblack opened 7 years ago

apblack commented 7 years ago

A program like

import "random" as random

print(random.integerFrom 1 to 6)

generates a NoSuchMethod error on line 3: no method integerFrom(_)to(_) on the "random" module.

It would be more helpful if it generates a static error at compile time. Minigrace reads the gct for random, and knows what methods it has.