0xfaded / eval

BSD 3-Clause "New" or "Revised" License
34 stars 7 forks source link

package name is wrong in "Cannot convert abc to type XXX.MyInt" #24

Closed rocky closed 10 years ago

rocky commented 10 years ago

In _callexprtest.go we have

    expectError(t, "bogus.MyInt(\"abc\")", &env,
    "Cannot convert abc to type eval.MyInt")

The error message should refer to package bogus, that is bogus.MyInt, not eval.MyInt .

That error message comes from util.go:

 return x, errors.New(fmt.Sprintf("Cannot convert %v to type %v", x, to))

Also note that there should be quotes around "abc". Will submit that as a separate issue.

0xfaded commented 10 years ago

I think this is going to be a will not fix. Only error messages are affected, and I'm guessing the the common use case will be to create an environment that matches the compiled programs structure. Having said that, I'll keep it in mind for when I write refract and make sure new types can have their packages specified.