Quantcast
Channel: General - Epic Developer Community Forums
Viewing all articles
Browse latest Browse all 9965

Inconsistent ambiguity issues.

$
0
0

Please select what you are reporting on:

Verse

What Type of Bug are you experiencing?

Verse

Summary

Look at the following examples.

interface_a := interface:
interface_b := interface:
Foo(:interface_a): void = ()
Foo(:interface_b): void = ()

Foo(:interface_a) and Foo(:interface_b) are not allowed because something could be a subtype of both.
The compiler won’t allow it.

class_a := class:
class_b := class:
Foo(:class_a): void = ()
Foo(:class_b): void = ()

Foo(:class_a) and Foo(:class_b) are allowed despite false being a subtype of both.
The compiler will allow it.

Foo(:[]int): void = ()
Foo(:[]char): void = ()

Foo(:class_a) and Foo(:class_b) are not allowed because []false being a subtype of both.
The compiler won’t allow it.

Steps to Reproduce

Copy and paste the snippets above into your code and check it for yourself.

Expected Result

All three of these examples should work totally fine.

Observed Result

The compiler is inconsistent - allows some and not others, even tho the exact same thing applies to all three examples.

Platform(s)

All

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 9965

Trending Articles