Skip to content

bug: type parameter shadowing type definition crashes repl #5708

@crusso

Description

@crusso

crusso@crusso-Virtual-Machine:~/motoko/src$ rlwrap moc
Motoko compiler (source 0.16.3-92-g7dca1ce41)

type t = T -> T -> T; type t = T -> T_1 -> T_1 type T = (); type T = () type t = T -> T -> T; OOPS! You've triggered a compiler bug. Please report this at https://github.com/dfinity/motoko/issues/new with the following details:

Motoko (source 0.16.3-92-g7dca1ce41)

Fatal error: exception Dom.Make(X).Clash(_)
Raised at Dom.Make.disjoint_add in file "lang_utils/dom.ml", line 17, characters 45-60
Called from Mo_frontend__Typing.add_typs in file "mo_frontend/typing.ml", line 349, characters 11-60
Called from Mo_frontend__Typing.check_typ_binds in file "mo_frontend/typing.ml", line 921, characters 17-53
Called from Mo_frontend__Typing.check_typ' in file "mo_frontend/typing.ml", line 765, characters 26-51
Called from Mo_frontend__Typing.check_typ in file "mo_frontend/typing.ml" (inlined), line 735, characters 10-28
Called from Mo_frontend__Typing.check_typ_def in file "mo_frontend/typing.ml", line 857, characters 10-28
Called from Mo_frontend__Typing.infer_dec_typdecs in file "mo_frontend/typing.ml", line 4427, characters 12-57
Called from Mo_frontend__Typing.infer_block_typdecs.(fun) in file "mo_frontend/typing.ml", line 4365, characters 19-44
Called from Stdlib__List.fold_left in file "list.ml", line 121, characters 24-34
Called from Mo_frontend__Typing.infer_block_typdecs in file "mo_frontend/typing.ml", line 4364, characters 4-172
Called from Mo_frontend__Typing.infer_block_decs in file "mo_frontend/typing.ml", line 4039, characters 17-46
Called from Mo_frontend__Typing.infer_block in file "mo_frontend/typing.ml", line 4017, characters 14-42
Called from Mo_frontend__Typing.infer_prog.(fun) in file "mo_frontend/typing.ml", line 4563, characters 26-62
Called from Mo_frontend__Typing.recover_opt.(fun) in file "mo_frontend/typing.ml", line 136, characters 55-60
Called from Mo_frontend__Typing.recover_with in file "mo_frontend/typing.ml", line 135, characters 56-59
Called from Diag.with_message_store in file "lang_utils/diag.ml", line 103, characters 10-13
Called from Pipeline.infer_prog.(fun) in file "pipeline/pipeline.ml", line 192, characters 12-69
Called from Stdlib__Fun.protect in file "fun.ml", line 33, characters 8-15
Re-raised at Stdlib__Fun.protect in file "fun.ml", line 38, characters 6-52
Called from Pipeline.load_decl in file "pipeline/pipeline.ml", line 534, characters 19-91
Called from Diag.bind in file "lang_utils/diag.ml", line 32, characters 27-30
Called from Diag.bind in file "lang_utils/diag.ml", line 32, characters 27-30
Called from Diag.bind in file "lang_utils/diag.ml", line 32, characters 27-30
Called from Pipeline.run_stdin in file "pipeline/pipeline.ml", line 673, characters 28-64
Called from Pipeline.run_files_and_stdin.loop in file "pipeline/pipeline.ml", line 711, characters 42-63
Called from Pipeline.run_files_and_stdin in file "pipeline/pipeline.ml", line 712, characters 6-14
Called from Dune__exe__Moc.process_files in file "exes/moc.ml", line 280, characters 17-53
Called from Dune__exe__Moc in file "exes/moc.ml", line 394, characters 10-29

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions