goby-lang / goby

Goby - Yet another programming language written in Go
MIT License
3.49k stars 171 forks source link

`#new` Method for Built-In Classes #158

Closed adlerhsieh closed 7 years ago

adlerhsieh commented 7 years ago

Currently the #new method only works for classes users create. It does not work for built-in classes like String, Integer, or Hash.

The following is an error message from executing String.new:

screen shot 2017-06-11 at 5 55 25 pm

st0012 commented 7 years ago

I'm not planning support this now. But I think we should provide a more friendly error message.

st0012 commented 7 years ago

Now this kind of usages should return error likeUnsupportedMethodError: Unsupported Method #new for <Class:String>. See: https://github.com/goby-lang/goby/commit/f35bc12b7e37560531c315d73647391faa6eb537

adlerhsieh commented 7 years ago

Looks good. It works from my side.

st0012 commented 7 years ago

@adlerhsieh Then I'm closing this~