Last active
January 11, 2018 13:31
-
-
Save pedro-w/349666174fadef8b7e72bab40ebd2bf4 to your computer and use it in GitHub Desktop.
Strange dylan compile warnings
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
METHOD test-no-warnings () => () | |
[CONGRUENT-CALLi ^{<&method> h? ()}()] | |
*t8(0) := [VALUES] | |
return *t8(0) | |
END | |
METHOD h? () => (#rest results) | |
*t1(1) := [VALUES ^#f] | |
return *t1(1) | |
END | |
METHOD test-warnings () => () | |
t1 := [CONGRUENT-CALLi ^{<&method> h? ()}()] | |
IF (t1) | |
t7 := [PRIMOP cast-pointer-as-raw(^#f)] | |
ELSE | |
t8 := [PRIMOP cast-pointer-as-raw(^#f)] | |
END IF | |
{{ x }} := [IF-MERGE t7 t8] | |
t9 := [PRIMOP cast-raw-as-pointer({{ x }})] | |
*t6(0) := [CALLx ^{<&method> g (<object>)}(t9)] // tail call | |
return *t6(0) | |
END | |
METHOD g (k :: <object>) => (#rest results) | |
*t1(1) := [VALUES ^#f] | |
return *t1(1) | |
END |
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
define function h?() | |
end; | |
define inline function g(k :: <object>) | |
end function; | |
define inline function f(p :: <raw-address>) => (); | |
end function; | |
define function test-warnings() => () | |
let x = if (h?()) end; | |
let p = primitive-cast-pointer-as-raw(x); | |
f(p); | |
g(x); | |
end function; | |
define function test-no-warnings() => () | |
let x = if (h?()) end; | |
let p = primitive-cast-pointer-as-raw(x); | |
g(x); | |
end function; |
Simplified. Now the warning is
Serious warning - Invalid type for argument k in call to method g (k :: <object>) => (#rest results :: <object>): <raw-pointer> supplied, <object> expected.
----
g(x);
----
it's like homeopathy for code!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When compiling
table.dylan
there is always a serious warning. I took that file and cut it down to a minimal example that givesthe same warning. It also gives an additional warning from
value-object?
. If the call tovalue-object?
is removed all the warningsdisappear.
Compiling with opendylan 2014.1 on Linux 64 bit.
The code gives these serious warnings: