felixangell / kpd

an old compiler for Krug written in D - a prototype version
MIT License
44 stars 1 forks source link

implement function receivers #70

Closed felixangell closed 6 years ago

felixangell commented 6 years ago
func (gw *Game_Window) change_title(new_title string) {
    gw.title = new_title;
}

Gives us

Error: Couldn't find type 'gw' in environment:
core.exception.AssertError@src/middle/infer.d(193): Assertion failure

Function receivers aren't really supported atm. they should be introduced into the type environment and type checked, inferred, resolved, etc.