manifold-lang / manifold-frontend

Frontend compiler for Manifold high-level language
GNU General Public License v3.0
6 stars 6 forks source link

Create a value.convertToType method #5

Open mtrberzi opened 10 years ago

mtrberzi commented 10 years ago

Issue by lucaswoj Sunday Nov 17, 2013 at 16:40 GMT Originally opened as https://github.com/manifold-lang/manifold/issues/41


Although we don't want most types of casts, there are some cases where we will need to cast variables (ie to extract a specific overloaded function implementation, tweak tuple structure, etc)

Illegal casts should throw an exception

class Value {
  ...
  abstract public Value toType(TypeValue type);
  ...
}