FIRST-Tech-Challenge / FIRST-Tech-Challenge/FtcRobotController

Records work properly outside of LinearOpMode subclasses, but break when instiated within a LinearOpMode subclass

Open
#1,677 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
1.3k
Forks
9.9k
Avg merge
18m
Merged PRs (30d)
1

Description

I write code for my team in Java 17, so I have access to useful features such as records, and have never has an issue doing so up to this point. I mainly use records in the process of reading or writing jsons with the gson library. I have a class that handles all the reading/writing of jsons which normally is used by objects such as motors for writing logs, reading PID parameters, etc. This meant that my main LinearOpMode subclasses never touched records directly, and everything worked fine. However, for auto, I read instructions from jsons and pass them directly into my auto class. When I tried to test this code, the build failed not at the creation of the records, but upon trying to access data from them. The error message said that the class file for `java.lang.Record` was not found. I don't know if this is a bug for anyone else, or if it is individual for me because of my instance or control hub setup. I can provide more details if necessary.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.