-
Notifications
You must be signed in to change notification settings - Fork 326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dataflow error in a default of a type-ascribed argument results in a type error instead of being propagated #7137
Comments
I've just executed: enso$ git log | head -n 2
commit b243a5f5292bf01c810cd37ecd2f04ee751c1601
Author: somebody1234 <[email protected]>
enso$ cat >test.enso
from Standard.Base import all
import Standard.Base.Runtime.Context
from Standard.Table import Table, Value_Type
from Standard.Database import Database, SQLite, In_Memory, Column_Description, Update_Action
from Standard.Database.Internal.Upload_Table import default_key_columns
main =
c = Database.connect (SQLite In_Memory)
Context.Output.with_disabled <|
t = c.create_table "table123" [Column_Description.Value "Y" Value_Type.Char] primary_key=Nothing
r0 = default_key_columns t
IO.println r0
src = Table.new [["Y", ["d", "e", "f"]]]
r1 = src.update_database_table t Update_Action.Insert
IO.println r1
^D
enso$ sbt
sbt:enso> runEngineDistribution --run test.enso
Nothing
(Database Table enso-dry-run-table123) e.g. I don't see any error. |
Jaroslav Tulach reports a new STANDUP for yesterday (2023-07-05): Progress: - reply to emails
Next Day: More vacationing |
Jaroslav Tulach reports a new STANDUP for the last Friday (2023-07-07): Progress: - rewriting read argument node type check:
Next Day: Polish #7009 to be ready for review |
Jaroslav Tulach reports a new STANDUP for yesterday (2023-07-09): Progress: - PR-7009 is ready for review: #7009
Next Day: Benchmarking & travel
|
There seems to be some issue when a default argument value returns a dataflow error and that argument has a type ascription resulting in a typecheck. Weirdly, it is not happening always. Below I present a repro where it consistently (wrongly) fails with a type error, but later I also show attempted repros where it actually works as expected.
Run the following repro (it assumes code from #7072 - which is waiting to be merged as of this moment):
Expected behaviour
It should print the same dataflow error twice (in the
r1
call, the dataflow error from the default value should get propagated to the return value).Actual behaviour
Instead, in the
update_database_table
case, it results in a type error:It looks like the type check introduced by the ascription
key_columns : Vector | Nothing
somehow ignores the fact that the argument is a dataflow error to be propagated and sees that an 'Error' does not (obviously) fit the expected type.I have spent some time trying to figure out a simpler example, but failed to do so. This bug seems to trigger under some specific conditions. But the repro above works reliably for me (100% replayability).
Below is a repro that didn't work (i.e. it actually works as expected):
Details
and another one
So the bug only seems to occur under some specific conditions, that I could not track down yet.
The text was updated successfully, but these errors were encountered: