Skip to content

Conversation

@victorspivak
Copy link

I really like subcut. Great Job. I have a small enhancement how to make subcut type safer. When we use BindingId for defining/injecting primitives or special objects then we could make mistakes and use wrong id object. In this case compiler will not catch the mistake and we will learn it during runtime. The below approach allow us to catch some errors during compilation stage.

It defines a new abstract class - TypedBindingId that caries a types of the binding. In this case
when a programmer will try to use wrong ID in the module definition the compiler generates an error.

As an example, the BindingIdObjectsTest.scala is not compiled because it uses a wrong binding.

The injection is not implemented. If it is interesting I could finish the job.

It defines a new abstract class - TypedBindingId that caries a types of the binding. In this case
when a programmer will try to use wrong ID in the module definition the compiler generates an error.

As an example, the BindingIdObjectsTest.scala is not compiled because it uses a wrong binding.

The injection is not implemented. If it is interesting I could finish the job.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant