Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[imp-dev] API change in pdb.values Type

Hi!

I'm about to commit an API change, removing an argument from the
method Type.instantiate(TypeStore store, Type type) in pdb.values.

The store argument was a design flaw. A TypeStore should hold only
declarations of (type parametrized) abstract data types, not
instances, so instantiating a type with actual type parameters should
not need a TypeStore from anywhere.
Removing the argument obviously makes sure nobody accidentally passes
in a TypeStore.
TypeStores that accidentally hold type instances instead of type
definitions eventually lead to subtle bugs, that's what I'm trying to
prevent here.

I'm not sure this is clear for anybody that has not read or used the
pdb.values code, but I wanted to put out this alert anyway. If you
have this method in use, simply removing the parameter will fix your
code.

Cheers,

Jurgen


-- 
Jurgen Vinju
- Centrum Wiskunde & Informatica - SEN1
- INRIA Lille - ATEAMS
- Universiteit van Amsterdam

  www: http://jurgen.vinju.org,
http://www.rascal-mpl.nl,http://twitter.com/jurgenvinju
skype: jurgen.vinju


Back to the top