Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix unittest #74

Merged
merged 1 commit into from
Jun 11, 2020
Merged

Conversation

ShigekiKarita
Copy link
Contributor

I found a unittest inside Interpreter template can cause compiler error when I built drepl with unittest or used as a library. The problem is comparison between Interpreter!EchoEngine.Kind and Interpreter!(<Instantiated Type>).Kind in the unittest.

For example, when I instantiated Interpreter!DMDEngine inside unittest caused following compiler error.

src/drepl/interpreter.d(129,16): Error: Comparison between different enumeration types Kind and Kind; If this behavior is intended consider using std.conv.as
OriginalType
src/drepl/interpreter.d(131,16): Error: Comparison between different enumeration types Kind and Kind; If this behavior is intended consider using std.conv.as
OriginalType
src/drepl/interpreter.d(132,16): Error: Comparison between different enumeration types Kind and Kind; If this behavior is intended consider using std.conv.as
OriginalType
src/drepl/interpreter.d(134,16): Error: Comparison between different enumeration types Kind and Kind; If this behavior is intended consider using std.conv.as
OriginalType
src/drepl/interpreter.d(135,16): Error: Comparison between different enumeration types Kind and Kind; If this behavior is intended consider using std.conv.as
OriginalType
src/drepl/interpreter.d(137,16): Error: Comparison between different enumeration types Kind and Kind; If this behavior is intended consider using std.conv.asOriginalType
src/drepl/interpreter.d(139,16): Error: Comparison between different enumeration types Kind and Kind; If this behavior is intended consider using std.conv.asOriginalType
src/drepl/interpreter.d(141,16): Error: Comparison between different enumeration types Kind and Kind; If this behavior is intended consider using std.conv.asOriginalType
src/drepl/interpreter.d(143,16): Error: Comparison between different enumeration types Kind and Kind; If this behavior is intended consider using std.conv.asOriginalType
src/drepl/interpreter.d(145,16): Error: Comparison between different enumeration types Kind and Kind; If this behavior is intended consider using std.conv.asOriginalType
src/drepl/interpreter.d(152,1): Error: template instance `drepl.interpreter.Interpreter!(DMDEngine)` error instantiating
src/drepl/interpreter.d(160,25):        instantiated from here: interpreter!(DMDEngine)

Therefore, I propose adding static if to limit the unittest instantiation only with EchoEngine.

@rikkimax
Copy link

@wilzbach I've rerun CI, you seem to have some ownership, are we good to go?

@wilzbach wilzbach merged commit cbfaf6a into dlang-community:master Jun 11, 2020
@wilzbach
Copy link
Member

Sure. Sorry for missing it and thanks for the ping!

@wilzbach
Copy link
Member

you seem to have some ownership

Should we change the teams to give everyone at dlang-community access to every repo?

@rikkimax
Copy link

you seem to have some ownership

Should we change the teams to give everyone at dlang-community access to every repo?

I was referring to the code base, rather than the repository. So no, we are good as far as I know :)

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.

3 participants