-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds a frontend error so it doesn't result in a confusing compiler internal error. Also fixes an unrelated type annotation issue flagged by a new version of mypy.
- Loading branch information
Showing
3 changed files
with
31 additions
and
3 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
from typing import * | ||
import unittest | ||
|
||
from . import * | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import unittest | ||
|
||
from . import * | ||
from .HdlUserExceptions import UnconnectableError | ||
from .test_elaboration_common import TestBlockSource | ||
from .test_bundle import TestBundle | ||
|
||
|
||
class TestInner(Block): | ||
def __init__(self) -> None: | ||
super().__init__() | ||
self.port = self.Port(TestBundle()) | ||
|
||
|
||
class TestInvalidOuter(Block): | ||
def __init__(self) -> None: | ||
super().__init__() | ||
self.inner = self.Block(TestInner()) | ||
self.source = self.Block(TestBlockSource()) | ||
self.connect(self.inner.port.a, self.source.source) | ||
|
||
|
||
class BundleInnerConnectError(unittest.TestCase): | ||
def test_connect_error(self) -> None: | ||
with self.assertRaises(UnconnectableError): | ||
TestInvalidOuter()._elaborated_def_to_proto() |