hawkw / decaf

like Java, but less so
hawkweisman.me/decaf
Other
18 stars 4 forks source link

Add detection for invalid use of `.` #34

Closed hawkw closed 9 years ago

hawkw commented 10 years ago

From Dr. Jumadinova's handout:

*** Cow has no such field ‘trunk’
*** Cow field ‘spots’ only accessible within class scope

Used to report problems with the dot operator. Field means either variable or method. The first message reports to an attempt to apply dot to a non-class type or access a non-existent field from a class. The last is used when the field exists but is not accessible in this context.

ArcticLight commented 10 years ago

If Decaf doesn't support encapsulation, then when do we ever encounter a problem of the second type? (aside from maybe "this")

hawkw commented 10 years ago

I...don't know?

ArcticLight commented 10 years ago

If we can't find an example, can we ignore the second case?

hawkw commented 9 years ago

We fixed this one a while ago.