Created
September 26, 2017 00:26
-
-
Save mwotton/094aeb7e4293fab21e8680934027d87c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Detected errors in 1 module. | |
-- TYPE MISMATCH --------------------------------------------------------------- | |
`thestruct` does not have a field named `quuux`. | |
6| main = text thestruct.quuux | |
^^^^^^^^^^^^^^^ | |
The type of `thestruct` is: | |
{ bar : number, quux : String } | |
Which does not contain a field named `quuux`. | |
Hint: The record fields do not match up. Maybe you made one of these typos? | |
quux <-> quuux |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set ➜ ~ g++ --version | |
g++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609 | |
set ➜ ~ g++ test.cpp | |
test.cpp: In function ‘int main()’: | |
test.cpp:9:41: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings] | |
thestruct s = { .bar = 3, .quux = "c" }; | |
^ | |
test.cpp:10:20: error: ‘thestruct {aka struct foo}’ has no member named ‘quuux’ | |
printf("%s\n", s.quuux); | |
^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
typedef struct foo { | |
int bar; | |
char * quux; | |
} thestruct; | |
main() { | |
thestruct s = { .bar = 3, .quux = "c" }; | |
printf("%s\n", s.quuux); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Html exposing (text) | |
thestruct = { bar = 1, quux = "c" } | |
main = text thestruct.quuux |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment