No compiler check on class argument types? #9461
Closed
Xylopyrographer
started this conversation in
Question - Community Help
Replies: 1 comment 3 replies
-
the compiler turned it into uint. It will compile, but would not run on 3.0.0, because the peripheral manager will say that the pin is invalid |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I was doing some testing on a library and came across puzzling result.
In the library
.h
file, the class constructor is defined asIn the sketch
setup()
I was testing with a case where an object is declared as:Button myBtn( -76, 25, true, true );
I expected this to fail as the first argument in the class constructor is of type
uint8_t
and in the test case-76
is not of that type.However it compiled without warning or error.
Wonder if anyone would have an explanation?
Using:
arduino-esp32 core 2.14
Arduino IDE Version: 2.3.2
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions