Class not declared in this scope when in same file

When I am declaring a class to be used as a pointer for a parameter in a function it gives me the message that the class is not declared in the scope. This happens when it is an additional file that is not the main file, when I put it in the main file it compiles just fine. It also tells me that the function has been redeclared as a deifferent kind of symbol then references the same line the same line for the previous declaration.

I am curious if anyone else has run into this problem? Does it have to do with the compilation process of the arduino ide?

void loop(){}

void setup(){}

My main sketch file named Example.ino

class MyClass {
};

double foo(MyClass* myClass) {
  return 0;
}

The file that I'm having trouble with named bad.ino

Arduino: 1.8.5 (Windows 10), TD: 1.41, Board: "Arduino/Genuino Uno"

C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\jg2562\Documents\Arduino\libraries -fqbn=arduino:avr:uno -ide-version=10805 -build-path C:\Users\jg2562\AppData\Local\Temp\arduino_build_612267 -warnings=none -build-cache C:\Users\jg2562\AppData\Local\Temp\arduino_cache_585396 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose G:\Team Drives\Biomech_Lab\Jack\a_exo\Example\Example.ino
C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\jg2562\Documents\Arduino\libraries -fqbn=arduino:avr:uno -ide-version=10805 -build-path C:\Users\jg2562\AppData\Local\Temp\arduino_build_612267 -warnings=none -build-cache C:\Users\jg2562\AppData\Local\Temp\arduino_cache_585396 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose G:\Team Drives\Biomech_Lab\Jack\a_exo\Example\Example.ino
Using board 'uno' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr
Using core 'arduino' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr
Build options changed, rebuilding all
Detecting libraries used...
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "C:\Users\jg2562\AppData\Local\Temp\arduino_build_612267\sketch\Example.ino.cpp" -o "nul"
Generating function prototypes...
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "C:\Users\jg2562\AppData\Local\Temp\arduino_build_612267\sketch\Example.ino.cpp" -o "C:\Users\jg2562\AppData\Local\Temp\arduino_build_612267\preproc\ctags_target_for_gcc_minus_e.cpp"
"C:\Program Files (x86)\Arduino\tools-builder\ctags\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\Users\jg2562\AppData\Local\Temp\arduino_build_612267\preproc\ctags_target_for_gcc_minus_e.cpp"
Compiling sketch...
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "C:\Users\jg2562\AppData\Local\Temp\arduino_build_612267\sketch\Example.ino.cpp" -o "C:\Users\jg2562\AppData\Local\Temp\arduino_build_612267\sketch\Example.ino.cpp.o"
bad:4: error: 'MyClass' was not declared in this scope

double foo(MyClass* myClass) {

^

bad:4: error: 'myClass' was not declared in this scope

double foo(MyClass* myClass) {

^

C:\User\jg2562\Arduino\Example\bad.ino: In function 'double foo(MyClass*)':

bad:4: error: 'double foo(MyClass*)' redeclared as different kind of symbol

double foo(MyClass* myClass) {

^

C:\User\jg2562\Arduino\Example\bad.ino:4:8: note: previous declaration 'double foo'

double foo(MyClass* myClass) {

^

exit status 1
'MyClass' was not declared in this scope

Here is the error that I am getting.

I also tried using the online ide in order to solve the problem, It didn't help but here is the link if anyone wants to try it out.

Arduino Cloud

Thank you in advanced!

It's "trap" #30 on this page: Gammon Forum : Electronics : Microprocessors : Arduino programming traps, tips and style guide

MorganS:
It's "trap" #30 on this page: Gammon Forum : Electronics : Microprocessors : Arduino programming traps, tips and style guide

Thanks! This clarified some totally moot errors I was getting in my own libraries :)...

That was it! Thank you!