Skip to content

Use Any in types checking#17

Merged
ctrueden merged 1 commit into
masterfrom
types-any
Jun 18, 2019
Merged

Use Any in types checking#17
ctrueden merged 1 commit into
masterfrom
types-any

Conversation

@gselzer

@gselzer gselzer commented Jun 12, 2019

Copy link
Copy Markdown
Member

This PR introduces the Any type, a type designed to be assignable to any other type. In practice Anys will only ever occur when the user calls ops.run() (since if they use ops.findOp() or some helper variant they will be using Nils) and Anys should never be specifyed by the user. The purpose of Any is as a hack to allow non-reifiable type parameters (such as those of OutOfBoundsFactory) to pass matching. In practice this is a safe behavior, since if type parameters are non-reifiable they will never throw ClassCastExceptions. If the type parameters are reifiable then they can be reified using a TypeExtractor.

TODO:

  • More tests?
  • Code cleanup? This might, however, might be worth waiting on until we have smoothed more bugs out of the matcher.

@ctrueden ctrueden requested a review from wiedenm June 18, 2019 15:58

@wiedenm wiedenm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm 👍

I can't come up with reasonable additional tests, at the moment. Postponing the cleanup is also fine with me. (In general, quite some portions of the code base could require some formatting/cleanup - at least I always need to turn off my save actions/auto formatting when working on already existing files since they tend to change a lot of lines.)

@ctrueden ctrueden merged commit 75e5155 into master Jun 18, 2019
@ctrueden ctrueden deleted the types-any branch June 18, 2019 19:43
@ctrueden

Copy link
Copy Markdown
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects

Development

Successfully merging this pull request may close these issues.

3 participants