#Kotlin Allergies

9 messages · Page 1 of 1 (latest)

silk grail
#

Get all tests to pass locally, but when running tests in the online editor, I get:

We received the following error when we ran your code:
[ERROR] src/test/kotlin/AllergiesTest.kt:[214,75] Unresolved reference: Allergies
[ERROR] src/test/kotlin/AllergiesTest.kt:[216,79] Unresolved reference: Allergies
[ERROR] src/test/kotlin/AllergiesTest.kt:[218,94] Unresolved reference: Allergies

I've completed 20 other exercises thusfar, didn't have this issue before. curious if anyone else had this issue? Thanks

dapper robin
#

To get help with your solution, please include the source code of your solution.

Without it, my only guess could be that you renamed the class Allergies that was in the solution stub to something else.

ornate fogBOT
#

@silk grail How you ask questions makes a huge difference in the help we can provide. Learn how to write good support requests in this article: http://bit.ly/howto-ask

silk grail
#

Please note, I had to hardcode the list - no allergen score parts test, as I couldn't figure that out.

(I wanted to get the tests to pass so I can review comunity solutions)

dapper robin
#

That will be a problem. You cannot edit the test suite when submitting the code on the platform.

#

I cannot reproduce the Unresolved reference: Allergies error that you mentioned when I run your code in the online editor, but I am getting a whole bunch of other errors:

[ERROR] src/main/kotlin/Allergies.kt:[2,60] Type mismatch: inferred type is Unit but Comparable<TypeVariable(R)> was expected
[ERROR] src/main/kotlin/Allergies.kt:[2,60] Type mismatch: inferred type is Unit but Comparable<Unit> was expected
[ERROR] src/main/kotlin/Allergies.kt:[2,65] Unresolved reference: allergenValue
[ERROR] src/main/kotlin/Allergies.kt:[19,33] Unresolved reference: allergenValue
[ERROR] src/main/kotlin/Allergies.kt:[20,49] Unresolved reference: allergenValue
[ERROR] src/main/kotlin/Allergies.kt:[27,41] Type mismatch: inferred type is Unit but Comparable<TypeVariable(R)> was expected
[ERROR] src/main/kotlin/Allergies.kt:[27,41] Type mismatch: inferred type is Unit but Comparable<Unit> was expected
[ERROR] src/main/kotlin/Allergies.kt:[27,46] Unresolved reference: allergenValue
#

I am not a Kotlin developer, so my ability to help is very limited. But I am looking at an example solution that works right now, and based on that, my advice for you would be to get rid of all the code inside the Allergies class that is not inside of the two function definitions.

silk grail
#

You cannot edit the test suite when submitting the code on the platform.

I meant I hardcoded some of the solution to pass that test.

But thanks for taking a look anyway, I will try your suggestion of :

my advice for you would be to get rid of all the code inside the Allergies class that is not inside of the two function definitions.