JasperFx / lamar

Fast Inversion of Control Tool and Successor to StructureMap
https://jasperfx.github.io/lamar
MIT License
572 stars 119 forks source link

Compilation Failures when using 'Named' with hyphens #91

Closed erlendp closed 6 years ago

erlendp commented 6 years ago

Compilation fails when using hyphens in name with InstanceExtensions.Named. The generated class name is invalid due the hyphens being included in the class name.

e.g.

For<IFactory>().Add<FoobarFactory>().Named("foo-bar");

generates the following errors:

InvalidOperationException: Compilation failures!

CS1514: { expected
CS1513: } expected
CS1022: Type or namespace definition, or end-of-file expected
CS0116: A namespace cannot directly contain members such as fields or methods
CS1022: Type or namespace definition, or end-of-file expected
CS0116: A namespace cannot directly contain members such as fields or methods
CS1022: Type or namespace definition, or end-of-file expected
CS0116: A namespace cannot directly contain members such as fields or methods
CS1022: Type or namespace definition, or end-of-file expected
CS0116: A namespace cannot directly contain members such as fields or methods
CS1022: Type or namespace definition, or end-of-file expected
CS0116: A namespace cannot directly contain members such as fields or methods
CS1022: Type or namespace definition, or end-of-file expected
CS0116: A namespace cannot directly contain members such as fields or methods
CS1022: Type or namespace definition, or end-of-file expected
CS0116: A namespace cannot directly contain members such as fields or methods
CS1022: Type or namespace definition, or end-of-file expected
CS1022: Type or namespace definition, or end-of-file expected
CS0116: A namespace cannot directly contain members such as fields or methods
CS0116: A namespace cannot directly contain members such as fields or methods
CS1520: Method must have a return type
CS0116: A namespace cannot directly contain members such as fields or methods
CS0115: '<invalid-global-code>.Build(Scope)': no suitable method found to override
CS0103: The name '_standardReportGenerator' does not exist in the current context
CS0103: The name '_standardReportGenerator' does not exist in the current context
jeremydmiller commented 6 years ago

Looking to fix this one right now. Will be in 1.2.